/** Streaming file source utilities for memory-efficient uploads (no temp files) */ import { Readable } from 'stream'; /** Resolved source for an upload URI: a readable stream plus naming/MIME hints */ export interface FileSource { /** Binary read stream of the file content */ stream: Readable; /** Best-effort file name (used as default Drive name) */ fileName: string; /** MIME type from the Content-Type header (http/https sources only) */ contentType?: string; /** File size in bytes when known (file:// via stat, http/https via Content-Length) */ size?: number; } /** Guess MIME type from file name extension (application/octet-stream fallback) */ export declare function guessMimeType(fileName: string): string; /** * Get readable stream and metadata from a file URI * * Memory efficiency: * - file:// URIs stream directly from disk * - http:// URIs stream directly from response (no temp files!) * * Unlike mcp-sheets' getCsvReadStream, this streams binary content * (no text encoding) so arbitrary file types can be uploaded. * * @example * ```ts * const source = await getFileReadStream('file:///path/to/report.pdf'); * await drive.files.create({ * requestBody: { name: source.fileName }, * media: { mimeType: guessMimeType(source.fileName), body: source.stream }, * }); * ``` */ export declare function getFileReadStream(fileUri: string): Promise;