/** * Normalize n8n conditional nodes (IF / Filter / Switch) into a canonical * branch spec that maps onto @pikku/addon-graph's `branch` function. Structural * only — operand values stay raw (n8n literals or `={{ … }}` expressions) and are * lowered to `ref`/`template`/literal by the codegen. * * Branch keys are output-slot indices ("0", "1", …) so they line up with the * graph `next` Record the topology emits. IF: slot 0 = true, slot 1 = false. * Filter: slot 0 = kept (no fallback — a false result dead-ends). Switch: one * slot per rule, plus an optional `extra` fallback slot. */ export interface RawCondition { left: unknown; right?: unknown; type: string; operation: string; } export interface RawCase { key: string; combinator: 'and' | 'or'; conditions: RawCondition[]; } export interface BranchSpec { cases: RawCase[]; fallback?: string; } interface BranchNode { typeShort: string; parameters: Record; } /** * Build a branch spec for an IF / Filter / Switch node, or `null` when the node * isn't a supported conditional (e.g. Switch expression-mode → stays a stub). */ export declare function normalizeBranch(node: BranchNode): BranchSpec | null; export {};