import type { DirOptions } from 'tmp'; export interface NameOptions { dir: string; prefix: string; postfix?: string; template?: string; name?: string; } export interface Options extends NameOptions { tries: number; keep: boolean; unsafeCleanup: boolean; mode: number; } /** * A callback which runs in the context of a temporary directory. After the callback is completed context is returned to the original directory. * */ export type TmpDirCallback = () => T; export type WithLocalTmpDirArgs = TmpDirCallback | Options; /** * A promise returned from withLocalTmpDir that, when executed, cleans up the tmp directory. Can be used instead of the callback. * */ export type ResetFunc = () => Promise; declare const _default: ((callback: TmpDirCallback, options?: DirOptions) => Promise) & ((options: DirOptions, callback: TmpDirCallback) => Promise) & ((options?: DirOptions) => Promise); export default _default;