import { type PlanetScaleConnectConfig } from '../clients/createPsdbConnectV1Alpha1Client'; import { type TableCursor } from '../generated/psdbconnect_pb'; export { TableCursor } from '../generated/psdbconnect_pb'; interface IPlanetScaleVStreamConstructor { /** * @description PlanetScale database config */ db_config: PlanetScaleConnectConfig; /** * @description Table name to stream */ table_name: string; } /** * @class PlanetScaleVStream * @description VStream interface for a PlanetScale database */ export declare class PlanetScaleVStream { readonly db_config: IPlanetScaleVStreamConstructor['db_config']; readonly table_name: IPlanetScaleVStreamConstructor['table_name']; private client; constructor({ db_config, table_name }: IPlanetScaleVStreamConstructor); /** * @method stream * @description Stream messages from the Vitess VStream * @param options * @param options.read_duration_ms - Amount of time to run stream * @param options.stop_position - The vgtid position at which to stop * @param options.table_cursor - The table cursor to start streaming at */ stream(options: { read_duration_ms?: number; stop_position?: string; starting_cursor: TableCursor; }): AsyncGenerator<{ /** * @property raw_response * @description The raw response from the sync stream */ raw_response: import("../generated/psdbconnect_pb").SyncResponse; /** * @property error * @description Any error encountered in streaming data from the table */ error: import("../generated/vtrpc_pb").RPCError | undefined; /** * @property cursor * @description The cursor position up to which changes have been streamed */ cursor: TableCursor | undefined; /** * @property inserts * @description The inserts from the sync stream */ inserts: { table: string; row: Record; }[]; /** * @property updates * @description The updates from the sync stream */ updates: { table: string; before: Record | undefined; after: Record | undefined; }[]; /** * @property deletes * @description The deletes from the sync stream */ deletes: { table: string; row: Record; }[]; }, void, unknown>; }