/// /** * Text generator. */ import { ChildProcessWithoutNullStreams } from 'child_process'; import { defer } from './utils'; interface Options { path: string; spawnArgs?: string[]; onMessage: (message: string) => any; onStderr?: (err: string) => any; isReady?: (message: string) => boolean; } export declare const lib: string; export declare class ModelWrapper { static readonly lib: string; process: ChildProcessWithoutNullStreams; ready: defer.Deferred | null; down?: Error; private options; constructor(opts: Options); handleError(err: Error): never; private stderr; write(message: string): Promise; } export declare class QueuedModelWrapper extends ModelWrapper { private waiting; private taskId; private opts; constructor(opts: QueuedModelWrapper['opts']); destroy(): void; private onMessage; handleError(err: Error): never; query(text: string, id?: number | null, raw?: boolean): Promise; } export {};