import type { ClingoError, OnModel, RunFunction } from "./run.js"; import type { Messages, Replies } from "./protocol.js"; /** Platform-independent view of a worker that runs clingo. */ export interface ClingoWorker { postMessage(message: Messages): void; onReply(handler: (reply: Replies) => void): void; onError(handler: (error: unknown) => void): void; terminate(): void | Promise; /** Node only: hold or release the event loop. */ ref?(): void; unref?(): void; } /** * The client API around a clingo worker, shared by the browser and Node entry * points: runs one program at a time, streams models to the caller, and can * abort a running solve by terminating the worker. */ export declare function createClient(spawn: () => ClingoWorker): { run: (program: string, models?: number | undefined, options?: string[] | undefined, onModel?: OnModel | undefined) => Promise>; init: (wasmUrl?: string) => Promise; restart: (wasmUrl?: string) => Promise; stream: (program: string, models?: number, options?: string[]) => AsyncGenerator; };