38 lines
2.1 KiB
TypeScript
38 lines
2.1 KiB
TypeScript
import type { ProcessorConfig, UserFunction, QueryKey, ConnectReason, SQLocalDriver } from './types.js';
|
|
import type { BatchMessage, ConfigMessage, DeleteMessage, DestroyMessage, ExportMessage, FunctionMessage, GetInfoMessage, ImportMessage, InputMessage, OutputMessage, QueryMessage, TransactionMessage, WorkerProxy } from './messages.js';
|
|
export declare class SQLocalProcessor {
|
|
protected driver: SQLocalDriver;
|
|
protected config: ProcessorConfig;
|
|
protected userFunctions: Map<string, UserFunction>;
|
|
protected initMutex: {
|
|
lock: () => Promise<void>;
|
|
unlock: () => Promise<void>;
|
|
};
|
|
protected transactionMutex: {
|
|
lock: () => Promise<void>;
|
|
unlock: () => Promise<void>;
|
|
};
|
|
protected transactionKey: QueryKey | null;
|
|
protected proxy: WorkerProxy;
|
|
protected dirtyTables: Set<string>;
|
|
protected effectsChannel?: BroadcastChannel;
|
|
protected reinitChannel?: BroadcastChannel;
|
|
onmessage?: (message: OutputMessage, transfer: Transferable[]) => void;
|
|
constructor(driver: SQLocalDriver);
|
|
protected init: (reason: ConnectReason) => Promise<void>;
|
|
postMessage: (event: InputMessage | MessageEvent<InputMessage>, _transfer?: Transferable) => Promise<void>;
|
|
protected emitMessage: (message: OutputMessage, transfer?: Transferable[]) => void;
|
|
protected emitEffects: () => void;
|
|
protected emitEffectsDebounced: import("./lib/debounce.js").DebouncedFunction<() => void>;
|
|
protected editConfig: (message: ConfigMessage) => void;
|
|
protected exec: (message: QueryMessage | BatchMessage | TransactionMessage) => Promise<void>;
|
|
protected execInitStatements: () => Promise<void>;
|
|
protected getDatabaseInfo: (message: GetInfoMessage) => Promise<void>;
|
|
protected createUserFunction: (message: FunctionMessage) => Promise<void>;
|
|
protected initUserFunction: (fn: UserFunction) => Promise<void>;
|
|
protected importDb: (message: ImportMessage) => Promise<void>;
|
|
protected exportDb: (message: ExportMessage) => Promise<void>;
|
|
protected deleteDb: (message: DeleteMessage) => Promise<void>;
|
|
protected destroy: (message?: DestroyMessage) => Promise<void>;
|
|
}
|