import type { FileInfo, StoredFile } from "../index.js"; export type BodySource = { kind: "buffer"; data: Uint8Array; } | { kind: "stream"; factory: () => ReadableStream; } | { kind: "lazy"; factory: () => Promise; }; /** * A StoredFile's buffering accessors, each taking a `signal`. Not on the * public `StoredFile` type: the Effect bridge reads through them so an * interrupted `text`/`arrayBuffer`/`blob` cancels the body read underneath. */ export interface BufferedReads { arrayBuffer: (signal?: AbortSignal) => Promise; blob: (signal?: AbortSignal) => Promise; text: (signal?: AbortSignal) => Promise; } /** * `file`'s signal-aware buffering accessors. A StoredFile built some other way * (a hand-rolled adapter's) has none, so its plain accessors stand in and the * signal only stops the caller waiting. */ export declare const bufferedReads: (file: StoredFile) => BufferedReads; /** * Attach `reads` to a StoredFile wrapper, so a wrapper (the `usage()` meter) * keeps the body read cancellable. */ export declare const withBufferedReads: (file: StoredFile, reads: BufferedReads) => StoredFile; export declare const createStoredFile: (meta: FileInfo, body: BodySource, nativeBlob?: () => Promise) => StoredFile; //# sourceMappingURL=stored-file.d.ts.map