/// import EventEmitter from 'events'; /** * @internal */ type PromisifyFunc = (emitter: StreamablePromise, resolve: (result: T) => void, reject: (err: Error) => void) => void; /** * @internal */ export declare class StreamablePromise extends EventEmitter implements Promise { private _promise; private _promiseifyFn; /** * @internal */ constructor(promisefyFn: PromisifyFunc); private get promise(); then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; finally(onfinally?: (() => void) | undefined | null): Promise; /** * @internal */ get [Symbol.toStringTag](): string; } /** * Provides the ability to be used as both a promise, or an event emitter. Enabling * an application to easily retrieve all results using async/await, while also enabling * streaming of results by listening for the row and meta events. */ export declare class StreamableRowPromise extends StreamablePromise { constructor(fn: (rows: TRow[], meta: TMeta) => T); } /** * Provides the ability to be used as both a promise, or an event emitter. Enabling * an application to easily retrieve all results using async/await, while also enabling * streaming of results by listening for the replica event. */ export declare class StreamableReplicasPromise extends StreamablePromise { constructor(fn: (replicas: TRep[]) => T); } export declare class StreamableScanPromise extends StreamablePromise { private _cancelRequested; constructor(fn: (results: TRes[]) => T); get cancelRequested(): boolean; cancelStreaming(): void; } export {};