import { R as Results, d as PGliteInterface } from '../pglite-CntadC_p.js'; interface LiveQueryOptions { query: string; params?: any[] | null; offset?: number; limit?: number; callback?: (results: Results) => void; signal?: AbortSignal; } interface LiveChangesOptions { query: string; params?: any[] | null; key: string; callback?: (changes: Array>) => void; signal?: AbortSignal; } interface LiveIncrementalQueryOptions { query: string; params?: any[] | null; key: string; callback?: (results: Results) => void; signal?: AbortSignal; } interface LiveNamespace { /** * Create a live query * @param query - The query to run * @param params - The parameters to pass to the query * @param callback - A callback to run when the query is updated * @returns A promise that resolves to an object with the initial results, * an unsubscribe function, and a refresh function */ query(query: string, params?: any[] | null, callback?: (results: Results) => void): Promise>; /** * Create a live query * @param options - The options to pass to the query * @returns A promise that resolves to an object with the initial results, * an unsubscribe function, and a refresh function */ query(options: LiveQueryOptions): Promise>; /** * Create a live query that returns the changes to the query results * @param query - The query to run * @param params - The parameters to pass to the query * @param callback - A callback to run when the query is updated * @returns A promise that resolves to an object with the initial changes, * an unsubscribe function, and a refresh function */ changes(query: string, params: any[] | undefined | null, key: string, callback?: (changes: Array>) => void): Promise>; /** * Create a live query that returns the changes to the query results * @param options - The options to pass to the query * @returns A promise that resolves to an object with the initial changes, * an unsubscribe function, and a refresh function */ changes(options: LiveChangesOptions): Promise>; /** * Create a live query with incremental updates * @param query - The query to run * @param params - The parameters to pass to the query * @param callback - A callback to run when the query is updated * @returns A promise that resolves to an object with the initial results, * an unsubscribe function, and a refresh function */ incrementalQuery(query: string, params: any[] | undefined | null, key: string, callback?: (results: Results) => void): Promise>; /** * Create a live query with incremental updates * @param options - The options to pass to the query * @returns A promise that resolves to an object with the initial results, * an unsubscribe function, and a refresh function */ incrementalQuery(options: LiveIncrementalQueryOptions): Promise>; } interface LiveQueryResults extends Results { totalCount?: number; offset?: number; limit?: number; } interface LiveQuery { initialResults: LiveQueryResults; subscribe: (callback: (results: LiveQueryResults) => void) => void; unsubscribe: (callback?: (results: LiveQueryResults) => void) => Promise; refresh: (options?: { offset?: number; limit?: number; }) => Promise; } interface LiveChanges { fields: { name: string; dataTypeID: number; }[]; initialChanges: Array>; subscribe: (callback: (changes: Array>) => void) => void; unsubscribe: (callback?: (changes: Array>) => void) => Promise; refresh: () => Promise; } type ChangeInsert = { __changed_columns__: string[]; __op__: 'INSERT'; __after__: number; } & T; type ChangeDelete = { __changed_columns__: string[]; __op__: 'DELETE'; __after__: undefined; } & T; type ChangeUpdate = { __changed_columns__: string[]; __op__: 'UPDATE'; __after__: number; } & T; type ChangeReset = { __op__: 'RESET'; } & T; type Change = ChangeInsert | ChangeDelete | ChangeUpdate | ChangeReset; declare const live: { name: string; setup: (pg: PGliteInterface, _emscriptenOpts: any) => Promise<{ namespaceObj: LiveNamespace; }>; }; type PGliteWithLive = PGliteInterface & { live: LiveNamespace; }; export { type Change, type LiveChanges, type LiveNamespace, type LiveQuery, type LiveQueryResults, type PGliteWithLive, live };