/** * Returns true if the value implements the async iterable protocol. */ export declare function isAsyncIterable(value: unknown): value is AsyncIterable; /** * Throws if the value is an AsyncIterable. Use at port return boundaries * to prevent streams from leaking into persistence layers. * * @param value - The value to check * @param context - Description of where the check is (e.g. "FileSystem.readFile()") */ export declare function assertNotStream(value: unknown, context: string): void; /** * Throws if the value is NOT an AsyncIterable. Use at stream transform * entry points to prevent bounded values from entering traversal pipelines. * * @param value - The value to check * @param context - Description of where the check is (e.g. "BlobWriteTransform.apply()") */ export declare function assertStream(value: unknown, context: string): asserts value is AsyncIterable; /** * Wraps a port method to guard its return value against accidental streams. * Use this to retrofit existing ports without modifying their interfaces. * * @param portName - Name of the port class (for error messages) * @param methodName - Name of the method being guarded * @param fn - The original method */ export declare function guardPortReturn(portName: string, methodName: string, fn: (...args: TArgs) => Promise): (...args: TArgs) => Promise; /** * Wraps an entire port interface via Proxy. Every method call is * intercepted: if the return is a Promise, it's awaited and checked * with assertNotStream. Synchronous returns are checked directly. * * One line to guard a whole port instead of per-method wiring. * * @param portName - Name of the port (for error messages) * @param port - The port instance to guard */ export declare function guardedPort(portName: string, port: T): T; //# sourceMappingURL=stream-boundary.d.ts.map