import type { Operator, Job } from "../../topology"; import type { KeyEventFunc } from "../../types"; /** * Parameters for creating a stdio source. */ export interface StdioSourceParams { /** * Function that converts event data to KeyedEvents for processing. */ keyEvent: KeyEventFunc; /** * Optional framing strategy to use for separating records in the input stream. */ framing?: Framing; } /** * Standard Input/Output Source provides connectivity to read data from stdin. * This is useful for development and testing workflows. */ export declare class Source { private operators; /** * Creates a new stdio source. * * @param job - The job that will use this source * @param id - An identifier for this source * @param params - Configuration parameters for the stdio source */ constructor(job: Job, id: string, params: StdioSourceParams); /** * Connects an operator to this source. * * @param operator - The operator that will process events from this source */ connect(operator: Operator): void; } /** * Framing configures the strategy for separating records in the input stream. * Currently only delimited framing is supported. * * @example * * ``` * // Create a source that reads from stdin * const source = new stdio.Source(job, "Source", { * keyEvent, * framing: stdio.Framing.delimited({ delimiter: Buffer.from("\n") }), * }); * ``` */ export declare abstract class Framing { static delimited(params: { delimiter: Uint8Array; }): Framing; }