UNPKG

@kurrent/kurrentdb-client

Version:
34 lines (33 loc) 1.21 kB
import type { BaseOptions, ProjectionEngineVersion } from "../types"; export interface CreateProjectionOptions extends BaseOptions { /** * Enables emitting from the projection. * @defaultValue false */ emitEnabled?: boolean; /** * Enables tracking emitted streams. * @defaultValue false */ trackEmittedStreams?: boolean; /** * Selects the projection engine version. Pinned at create time and * cannot be changed later. V2 is opt-in and does not support * `trackEmittedStreams`, bi-state projections, or live `outputState` * result streams. See the KurrentDB documentation for the full list of * limitations before choosing V2. * @defaultValue {@link PROJECTION_ENGINE_V1} */ engineVersion?: ProjectionEngineVersion; } declare module "../Client" { interface Client { /** * Creates a continuous projection. * @param projectionName - The name of the projection. * @param query - The query to run. * @param options - Projection options. */ createProjection(projectionName: string, query: string, options?: CreateProjectionOptions): Promise<void>; } }