blob: 6046a26c72b2e6c767374e521ec56674ab9e2f5b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
import Core, { CoreExport, CoreImport, CoreSearch, CoreUser } from "../api.ts";
import YomikunError from "../../util/error.ts";
import Search from "../../search/search.ts";
/** @summary internal Core (DO NOT USE DIRECTLY) */
export default class RawCore implements Core {
public ready: Promise<void>;
private _search: Search;
constructor() {
if (this.constructor === RawCore) {
throw new YomikunError("RawCore instantiated! Use DirectCoreClient instead!");
}
this._search = new Search();
this.ready = new Promise(async resolve => {
await this._search.ready;
resolve();
})
}
public search: CoreSearch = {
terms: async term => {
return await this._search.terms(term);
},
sentence: async (sentence, optional?) => {
return await this._search.sentence(sentence, optional);
},
};
public user: CoreUser = {};
public import: CoreImport = {};
public export: CoreExport = {};
};
|