import Yomikun from "./yomikun.ts"; /** @summary generic class that keeps a reference to parent API reference */ export default abstract class APIBase { private _resolveAPI: (api: Yomikun) => void = _ => {}; protected api = new Promise(res => this._resolveAPI = res); /** @summary set API reference and return self (for use directly after constructor) */ withAPI(api: Yomikun) { this._resolveAPI(api); return this; } }