import * as Comlink from 'comlink'; import { AsyncDatabaseConnection, OnTableChangeCallback, OpenAsyncDatabaseConnection, ProxiedQueryResult } from './AsyncDatabaseConnection'; import { ResolvedWebSQLOpenOptions } from './web-sql-flags'; export type SharedConnectionWorker = { identifier: string; port: MessagePort; }; export type WrappedWorkerConnectionOptions = { baseConnection: AsyncDatabaseConnection; identifier: string; /** * Need a remote in order to keep a reference to the Proxied worker */ remote: Comlink.Remote>; onClose?: () => void; }; /** * Wraps a provided instance of {@link AsyncDatabaseConnection}, providing necessary proxy * functions for worker listeners. */ export declare class WorkerWrappedAsyncDatabaseConnection implements AsyncDatabaseConnection { protected options: WrappedWorkerConnectionOptions; protected lockAbortController: AbortController; constructor(options: WrappedWorkerConnectionOptions); protected get baseConnection(): AsyncDatabaseConnection; init(): Promise; /** * Get a MessagePort which can be used to share the internals of this connection. */ shareConnection(): Promise; /** * Registers a table change notification callback with the base database. * This can be extended by custom implementations in order to handle proxy events. */ registerOnTableChange(callback: OnTableChangeCallback): Promise<() => void>; close(): Promise; execute(sql: string, params?: any[]): Promise; executeRaw(sql: string, params?: any[]): Promise; executeBatch(sql: string, params?: any[]): Promise; getConfig(): Promise; }