import { BatchedUpdateNotification, QueryResult } from '@powersync/common'; import { ResolvedWebSQLOpenOptions } from './web-sql-flags'; /** * @internal * Proxied query result does not contain a function for accessing row values */ export type ProxiedQueryResult = Omit & { rows: { _array: any[]; length: number; }; }; /** * @internal */ export type OnTableChangeCallback = (event: BatchedUpdateNotification) => void; /** * @internal * An async Database connection which provides basic async SQL methods. * This is usually a proxied through a web worker. */ export interface AsyncDatabaseConnection { init(): Promise; close(): Promise; execute(sql: string, params?: any[]): Promise; executeRaw(sql: string, params?: any[]): Promise; executeBatch(sql: string, params?: any[]): Promise; registerOnTableChange(callback: OnTableChangeCallback): Promise<() => void>; getConfig(): Promise; } /** * @internal */ export type OpenAsyncDatabaseConnection = (config: Config) => AsyncDatabaseConnection;