import type { Reader, Writer } from "@endo/stream"; import type { Infer } from "@metamask/superstruct"; export type { Reader, Writer }; export declare const StreamSentinel: { readonly Error: "@@StreamError"; readonly Done: "@@StreamDone"; }; export declare const StreamDoneSymbol: unique symbol; declare const StreamDoneStruct: import("@metamask/superstruct").Struct<{ "@@StreamDone": true; }, unknown>; declare const StreamErrorStruct: import("@metamask/superstruct").Struct<{ "@@StreamError": true; error: import("@metamask/utils").Json; }, unknown>; type StreamDone = Infer; type StreamError = Infer; export type StreamSignal = StreamError | StreamDone; export declare const isSignalLike: (value: unknown) => value is StreamSignal; export declare const makeStreamErrorSignal: (error: Error) => StreamError; export declare const makeStreamDoneSignal: () => StreamDone; /** * A value that can be written to a stream. * * @template Yield - The type of the values yielded by the iterator. */ export type Writable = Yield | Error | typeof StreamDoneSymbol; /** * A value that can be dispatched to the internal transport mechanism of a stream. * * @template Yield - The type of the values yielded by the stream. */ export type Dispatchable = Yield | StreamSignal; /** * Marshals a {@link Writable} into a {@link Dispatchable}. * * @param value - The value to marshal. * @returns The marshaled value. */ export declare function marshal(value: Writable): Dispatchable; /** * Unmarshals a {@link Dispatchable} into a {@link Writable}. * * @param value - The value to unmarshal. * @returns The unmarshaled value. */ export declare function unmarshal(value: Dispatchable): Writable; /** * Creates a {@link IteratorResult} with `{ done: true, value: undefined }`. * * @template Yield - The type of the values yielded by the iterator. * @returns A {@link IteratorResult} with `{ done: true, value: undefined }`. */ export declare const makeDoneResult: () => IteratorResult; /** * Creates a {@link IteratorResult} with `{ done: false, value }`. * * @template Yield - The type of the values yielded by the iterator. * @param value - The value of the iterator result. * @returns A {@link IteratorResult} with `{ done: false, value }`. */ export declare const makePendingResult: (value: Yield) => IteratorResult; //# sourceMappingURL=utils.d.cts.map