import { Port } from '../../../types/core'; /** * Runtime type guard for Port * Validates that an unknown value conforms to the Port interface's required fields */ export declare const isPort: (value: unknown) => value is Port; /** * Returns the port if valid, otherwise returns the fallback */ export declare const ensurePort: (raw: unknown, fallback: Port) => Port; declare const InputPortBrand: unique symbol; declare const OutputPortBrand: unique symbol; /** * Branded type for input ports. * Provides compile-time guarantee that a port has type: "input". * The brand symbol ensures InputPort and OutputPort are structurally distinct. */ export type InputPort = Port & { readonly type: "input"; readonly [InputPortBrand]: never; }; /** * Branded type for output ports. * Provides compile-time guarantee that a port has type: "output". * The brand symbol ensures InputPort and OutputPort are structurally distinct. */ export type OutputPort = Port & { readonly type: "output"; readonly [OutputPortBrand]: never; }; /** * Union type representing either branded port type. * Useful for functions that need to accept any validated port. */ export type BrandedPort = InputPort | OutputPort; /** * Type guard that narrows Port to InputPort. * Use this for conditional checks where you need to verify port direction. */ export declare const isInputPort: (port: Port) => port is InputPort; /** * Type guard that narrows Port to OutputPort. * Use this for conditional checks where you need to verify port direction. */ export declare const isOutputPort: (port: Port) => port is OutputPort; /** * Assertion function that throws if port is not an input port. * Use this at function boundaries to enforce correct port direction. * @throws Error if port.type !== "input" */ export declare function assertInputPort(port: Port): asserts port is InputPort; /** * Assertion function that throws if port is not an output port. * Use this at function boundaries to enforce correct port direction. * @throws Error if port.type !== "output" */ export declare function assertOutputPort(port: Port): asserts port is OutputPort; export {};