1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export interface TmpNameOptions {
|
10 | dir?: string | undefined;
|
11 | name?: string | undefined;
|
12 | postfix?: string | undefined;
|
13 | prefix?: string | undefined;
|
14 | template?: string | undefined;
|
15 | tmpdir?: string | undefined;
|
16 | tries?: number | undefined;
|
17 | }
|
18 |
|
19 | export interface FileOptions extends TmpNameOptions {
|
20 | detachDescriptor?: boolean | undefined;
|
21 | discardDescriptor?: boolean | undefined;
|
22 | keep?: boolean | undefined;
|
23 | mode?: number | undefined;
|
24 | }
|
25 |
|
26 | export interface DirOptions extends TmpNameOptions {
|
27 | keep?: boolean | undefined;
|
28 | mode?: number | undefined;
|
29 | unsafeCleanup?: boolean | undefined;
|
30 | }
|
31 |
|
32 | export interface FileResult {
|
33 | name: string;
|
34 | fd: number;
|
35 | removeCallback: () => void;
|
36 | }
|
37 |
|
38 | export interface DirResult {
|
39 | name: string;
|
40 | removeCallback: () => void;
|
41 | }
|
42 |
|
43 | export type FileCallback = (
|
44 | err: Error|null,
|
45 | name: string,
|
46 | fd: number,
|
47 | removeCallback: () => void
|
48 | ) => void;
|
49 |
|
50 | export type DirCallback = (
|
51 | err: Error|null,
|
52 | name: string,
|
53 | removeCallback: () => void
|
54 | ) => void;
|
55 |
|
56 | export type TmpNameCallback = (err: Error|null, name: string) => void;
|
57 |
|
58 | export const tmpdir: string;
|
59 |
|
60 | export function file(options: FileOptions, cb: FileCallback): void;
|
61 | export function file(cb: FileCallback): void;
|
62 |
|
63 | export function fileSync(options?: FileOptions): FileResult;
|
64 |
|
65 | export function dir(options: DirOptions, cb: DirCallback): void;
|
66 | export function dir(cb: DirCallback): void;
|
67 |
|
68 | export function dirSync(options?: DirOptions): DirResult;
|
69 |
|
70 | export function tmpName(options: TmpNameOptions, cb: TmpNameCallback): void;
|
71 | export function tmpName(cb: TmpNameCallback): void;
|
72 |
|
73 | export function tmpNameSync(options?: TmpNameOptions): string;
|
74 |
|
75 | export function setGracefulCleanup(): void;
|