UNPKG

988 BTypeScriptView Raw
1/// <reference types="node" />
2
3declare function touch<T = void>(filename: string, cb?: (err?: NodeJS.ErrnoException) => T): Promise<T>;
4declare function touch<T = void>(
5 filename: string,
6 options?: touch.Options,
7 cb?: (err?: NodeJS.ErrnoException) => T,
8): Promise<T>;
9
10declare namespace touch {
11 interface Options {
12 force?: boolean | undefined;
13 time?: Date | string | number | undefined;
14 atime?: boolean | Date | undefined;
15 mtime?: boolean | Date | undefined;
16 ref?: string | undefined;
17 nocreate?: boolean | undefined;
18 closeAfter?: boolean | undefined;
19 }
20
21 function sync(filename: string, options?: Options): void;
22
23 function ftouch<T = void>(fd: number, cb?: (err?: NodeJS.ErrnoException) => T): Promise<T>;
24 function ftouch<T = void>(fd: number, options?: Options, cb?: (err?: NodeJS.ErrnoException) => T): Promise<T>;
25
26 function ftouchSync(fd: number, options?: Options): void;
27}
28
29export = touch;