/** * Connection content generator * Converts ConnectionDefinition to native .connection file format */ import type { ConnectionDefinition } from "../schema/connection.js"; /** * Generated connection content */ export interface GeneratedConnection { /** Connection name */ name: string; /** The generated .connection file content */ content: string; } /** * Generate a .connection file content from a ConnectionDefinition * * @param connection - The connection definition * @returns Generated connection content * * @example * ```ts * const myKafka = defineKafkaConnection('my_kafka', { * bootstrapServers: 'kafka.example.com:9092', * securityProtocol: 'SASL_SSL', * saslMechanism: 'PLAIN', * key: '{{ tb_secret("KAFKA_KEY") }}', * secret: '{{ tb_secret("KAFKA_SECRET") }}', * }); * * const { content } = generateConnection(myKafka); * // Returns: * // TYPE kafka * // KAFKA_BOOTSTRAP_SERVERS kafka.example.com:9092 * // KAFKA_SECURITY_PROTOCOL SASL_SSL * // KAFKA_SASL_MECHANISM PLAIN * // KAFKA_KEY {{ tb_secret("KAFKA_KEY") }} * // KAFKA_SECRET {{ tb_secret("KAFKA_SECRET") }} * ``` */ export declare function generateConnection(connection: ConnectionDefinition): GeneratedConnection; /** * Generate .connection files for all connections in a project * * @param connections - Record of connection definitions * @returns Array of generated connection content */ export declare function generateAllConnections(connections: Record): GeneratedConnection[]; //# sourceMappingURL=connection.d.ts.map