/** * Python tempfile module for TypeScript - Browser version * * Browser stub - temporary file operations are not available. * * @see {@link https://docs.python.org/3/library/tempfile.html | Python tempfile documentation} * @module */ /** * Return the name of the directory used for temporary files. */ declare function getTempDir(): string; /** * Return the default prefix for temporary names. */ declare function getPrefix(): string; /** * Generate a unique temporary file path (does not create the file). * Browser stub - returns a path that would be used in Node.js. */ declare function mktemp(suffix?: string, prefix?: string, dir?: string): string; /** * Create a temporary file and return [handle, path]. * Browser stub - throws error. */ declare function mkstemp(_suffix?: string, _prefix?: string, _dir?: string): Promise<[unknown, string]>; /** * Create a temporary directory and return its path. * Browser stub - throws error. */ declare function mkdtemp(_suffix?: string, _prefix?: string, _dir?: string): Promise; /** * Named temporary file - Browser stub. */ declare class NamedTemporaryFile { readonly name: string; readonly deleteOnClose: boolean; private constructor(); static create(_options?: { mode?: string; suffix?: string; prefix?: string; dir?: string; delete?: boolean; }): Promise; write(_data: string | Uint8Array): Promise; read(_size?: number): Promise; flush(): Promise; close(): Promise; } /** * Temporary directory - Browser stub. */ declare class TemporaryDirectory { readonly name: string; private constructor(); static create(_options?: { suffix?: string; prefix?: string; dir?: string; }): Promise; cleanup(): Promise; } type tempfileModule_NamedTemporaryFile = NamedTemporaryFile; declare const tempfileModule_NamedTemporaryFile: typeof NamedTemporaryFile; type tempfileModule_TemporaryDirectory = TemporaryDirectory; declare const tempfileModule_TemporaryDirectory: typeof TemporaryDirectory; declare const tempfileModule_getPrefix: typeof getPrefix; declare const tempfileModule_getTempDir: typeof getTempDir; declare const tempfileModule_mkdtemp: typeof mkdtemp; declare const tempfileModule_mkstemp: typeof mkstemp; declare const tempfileModule_mktemp: typeof mktemp; declare namespace tempfileModule { export { tempfileModule_NamedTemporaryFile as NamedTemporaryFile, tempfileModule_TemporaryDirectory as TemporaryDirectory, tempfileModule_getPrefix as getPrefix, tempfileModule_getTempDir as getTempDir, tempfileModule_mkdtemp as mkdtemp, tempfileModule_mkstemp as mkstemp, tempfileModule_mktemp as mktemp }; } export { NamedTemporaryFile as N, TemporaryDirectory as T, getTempDir as a, mkstemp as b, mktemp as c, getPrefix as g, mkdtemp as m, tempfileModule as t };