import Core from "../core/api.ts"; import RemoteCoreClient from "../core/http/client.ts"; import Sentence from "./sentence.ts"; export default class Yomikun { protected core: Core; protected user: string = "root"; protected uid: number = 0; public ready: Promise; constructor(core?: Core) { this.core = core ?? new RemoteCoreClient(); this.ready = new Promise(async resolve => { await this.core.ready; resolve(); }) } async sentence(input: string): Promise { var sentence = new Sentence(input).withAPI(this); await sentence.ready; return sentence; } public su(user: string) { this.user = user; // TODO: set this.uid } private async setTermPriority(expression: string, reading: string, priority: number) { this.core.user.termPriority(this.uid, expression, reading, priority); } }