/** * Build a `File` from any byte-bearing source. Useful for multipart * uploads (vision, audio, files endpoints) where the source might be a * string, Uint8Array, ArrayBuffer, Blob, ReadableStream, or async * iterable (Node fs.ReadStream, generators, etc.). * * The result is a real `File` with a working `arrayBuffer()` / * `stream()` / `text()` so it can be appended to FormData and read by * fetch implementations across runtimes. */ export type FileSource = string | Uint8Array | ArrayBuffer | Blob | ReadableStream | AsyncIterable; export interface ToFileOptions { /** MIME type. Default: 'application/octet-stream'. */ type?: string; /** lastModified epoch ms. Default: now. */ lastModified?: number; } export declare function toFile(name: string, source: FileSource, options?: ToFileOptions): Promise;