@kurrent/kurrentdb-client
Version:
KurrentDB gRPC NodeJS Client SDK
25 lines (24 loc) • 937 B
TypeScript
import type { BaseOptions, AppendResult, AppendStreamState, EventData, EventType } from "../../types";
export interface AppendToStreamOptions extends BaseOptions {
/**
* Asks the server to check the stream is at specific revision before writing events.
* @defaultValue ANY
*/
streamState?: AppendStreamState;
/**
* The batch size, in bytes.
* @defaultValue 3 * 1024 * 1024
*/
batchAppendSize?: number;
}
declare module "../../Client" {
interface Client {
/**
* Appends events to a given stream.
* @param streamName - A stream name.
* @param events - Events or event to write.
* @param options - Writing options.
*/
appendToStream<KnownEventType extends EventType = EventType>(streamName: string, events: EventData<KnownEventType> | EventData<KnownEventType>[], options?: AppendToStreamOptions): Promise<AppendResult>;
}
}