/** * Pipe content generator * Converts PipeDefinition to native .pipe file format */ import type { PipeDefinition } from "../schema/pipe.js"; /** * Generated pipe content */ export interface GeneratedPipe { /** Pipe name */ name: string; /** The generated .pipe file content */ content: string; } /** * Generate a .pipe file content from a PipeDefinition * * @param pipe - The pipe definition * @returns Generated pipe content * * @example * ```ts * const topEvents = definePipe('top_events', { * description: 'Get top events by count', * params: { * start_date: p.dateTime(), * limit: p.int32().optional(10), * }, * nodes: [ * node({ * name: 'endpoint', * sql: ` * SELECT event_type, count() as count * FROM events * WHERE timestamp >= {{DateTime(start_date)}} * ORDER BY count DESC * LIMIT {{Int32(limit, 10)}} * `, * }), * ], * output: { * event_type: t.string(), * count: t.uint64(), * }, * endpoint: true, * }); * * const { content } = generatePipe(topEvents); * // Returns: * // DESCRIPTION > * // Get top events by count * // * // NODE endpoint * // SQL > * // SELECT event_type, count() as count * // FROM events * // WHERE timestamp >= {{DateTime(start_date)}} * // ORDER BY count DESC * // LIMIT {{Int32(limit, 10)}} * // * // TYPE endpoint * ``` */ export declare function generatePipe(pipe: PipeDefinition): GeneratedPipe; /** * Generate .pipe files for all pipes in a project * * @param pipes - Record of pipe definitions * @returns Array of generated pipe content */ export declare function generateAllPipes(pipes: Record): GeneratedPipe[]; //# sourceMappingURL=pipe.d.ts.map