UNPKG

1.01 kBTypeScriptView Raw
1/// <reference types="node" />
2
3export = writeFile;
4
5declare function writeFile(
6 filename: string,
7 data: string | Buffer,
8 options: writeFile.Options | BufferEncoding,
9 callback: (error?: Error) => void,
10): void;
11declare function writeFile(filename: string, data: string | Buffer, callback: (error?: Error) => void): void;
12declare function writeFile(
13 filename: string,
14 data: string | Buffer,
15 options?: writeFile.Options | BufferEncoding,
16): Promise<void>;
17
18declare namespace writeFile {
19 function sync(filename: string, data: string | Buffer, options?: Options | BufferEncoding): void;
20
21 interface Options {
22 chown?:
23 | {
24 uid: number;
25 gid: number;
26 }
27 | undefined;
28 /**
29 * @default 'utf8'
30 */
31 encoding?: BufferEncoding | undefined;
32 fsync?: boolean | undefined;
33 mode?: number | undefined;
34 tmpfileCreated?: ((tmpfile: string) => void) | undefined;
35 }
36}
37
\No newline at end of file