UNPKG

@appium/support

Version:

Support libs used across Appium packages

40 lines 1.48 kB
import _ from 'lodash'; /** Prefix/suffix for temp directory or file names */ export interface Affixes { prefix?: string; suffix?: string; } /** Result of opening a temp file */ export interface OpenedAffixes { path: string; fd: number; } /** * Generate a temporary directory with arbitrary prefix/suffix for the directory name. * * @param rawAffixes - Prefix string, or object with prefix/suffix, or omitted. * @param defaultPrefix - Default prefix when rawAffixes is omitted. * @returns A path to the temporary directory. */ export declare function path(rawAffixes?: string | Affixes, defaultPrefix?: string): Promise<string>; /** * Generate a temp file path with prefix/suffix, open the file, and return path and fd. * * @param affixes - Prefix/suffix for the file name. * @returns The opened file path and descriptor. */ export declare function open(affixes: Affixes): Promise<OpenedAffixes>; /** Returns a new path to a temporary directory (alias for the tempDir implementation). */ export declare const openDir: typeof tempDir; /** * Returns a path to a temporary directory which is reused for the life of the process. * * @returns The same temp directory path on every call. */ export declare const staticDir: (() => Promise<string>) & _.MemoizedFunction; /** * Generate a temporary directory in os.tmpdir() or process.env.APPIUM_TMP_DIR. */ declare function tempDir(): Promise<string>; export {}; //# sourceMappingURL=tempdir.d.ts.map