aboutsummaryrefslogtreecommitdiff
path: root/core/api.ts
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-07-10 16:26:13 +0200
committerlonkaars <loek@pipeframe.xyz>2023-07-10 16:26:13 +0200
commita3a81530a0a30ba02b5253b762e2ccd77d3b01fc (patch)
treeafad1bae0c2f7cb9d4a11b6c1c56bc8bae2f14e5 /core/api.ts
parente430d8cb4a30640298b7fae3c93bc6329e2a0382 (diff)
small restructuring + all deinflection tests working
Diffstat (limited to 'core/api.ts')
-rw-r--r--core/api.ts35
1 files changed, 32 insertions, 3 deletions
diff --git a/core/api.ts b/core/api.ts
index 0720c8b..77195b2 100644
--- a/core/api.ts
+++ b/core/api.ts
@@ -1,6 +1,33 @@
-import { InputSentenceProps, ParseResult } from "../language/types.ts";
+import { SearchSentenceProps, SearchSentenceResult, SearchTermResult } from "../search/types.ts";
import { DeepPartial } from "../util/types.ts";
+/** @interface serach-related functions */
+export interface CoreSearch {
+ terms(term: string): Promise<Array<SearchTermResult>>;
+ sentence(sentence: string, optional?: DeepPartial<SearchSentenceProps>): Promise<SearchSentenceResult>;
+ // glossary: (input: string) => Promise<void>;
+};
+
+/** @interface user management */
+export interface CoreUser {
+ // TODO: list
+ // TODO: add
+ // TODO: remove
+ // TODO: get info
+};
+
+/** @interface dictionary/user data import functions */
+export interface CoreImport {
+ // TODO: import dictionary
+ // TODO: import user preferences
+};
+
+/** @interface dictionary/user data export functions */
+export interface CoreExport {
+ // TODO: export dictionary
+ // TODO: export user preferences
+};
+
/**
* @summary Core interface
*
@@ -12,7 +39,9 @@ export default abstract class Core {
/** @summary resolved when ready */
abstract ready: Promise<void>;
- /** @summary parse sentence */
- abstract parseSentence(input: string, options?: DeepPartial<InputSentenceProps>): Promise<ParseResult>;
+ abstract search: CoreSearch;
+ abstract user: CoreUser;
+ abstract import: CoreImport;
+ abstract export: CoreExport;
};