/** * `branch` runtime semantics. * * Operational semantics, in order: * 1. Evaluate `on` once in the current environment. The contract domain is * intentionally small: string/number literals or identifiers bound to * string/number values. * 2. Evaluate every non-default `path value=...` in source order. * Quoted values are string literals; unquoted numeric values are numbers; * unquoted identifiers resolve through `env.bindings`. * 3. Execute the first matching path body. Matching uses target-portable * strict value equality: same primitive type and same value. * 4. Execute `path default=true` iff no value path matched. The default * path's source position is not observable because branch has no * fallthrough. * 5. Run the chosen path body in a child environment so path-local bindings * cannot leak to sibling paths or following statements. * * Equality portability: * TS `switch` uses strict equality while Python lowers to idiomatic `==`. * Python's bool is a numeric subtype (`True == 1`), so booleans are outside * this executable contract. Keeping the contract to strings/numbers and * identifiers that resolve to strings/numbers makes Python `==` equivalent * to TS `===` for all differential fixtures without replacing either * target's natural branch form. */ import { type NodeContract } from './index.js'; export interface BranchProps { on?: string; name?: string; } export declare const branchContract: NodeContract; /** Idempotent registration. Test cleanup that clears the registry must re-call. */ export declare function registerBranchContract(): void; /** Reset registration flag — only for test cleanup that clears the registry. */ export declare function _resetBranchContractForTest(): void;