UNPKG

5.01 kBTypeScriptView Raw
1import * as fs from 'fs';
2export { createReadStream, createWriteStream, watch, watchFile, unwatchFile, Stats, FSWatcher, ReadStream, WriteStream, F_OK, R_OK, W_OK, X_OK } from 'fs';
3export declare function access(path: string, mode?: number | string): Promise<void>;
4export declare function appendFile(file: string | number, data: any, options?: {
5 encoding?: 'ascii' | 'base64' | 'binary' | 'hex' | 'ucs2' | 'utf16le' | 'utf8';
6 mode?: number | string;
7 flag?: 'r' | 'r+' | 'rs' | 'rs+' | 'w' | 'wx' | 'w+' | 'wx+' | 'a' | 'ax' | 'a+' | 'ax+';
8}): Promise<void>;
9export declare function chmod(path: string, mode: number | string): Promise<void>;
10export declare function chown(path: string, uid: number, gid: number): Promise<void>;
11export declare function close(fd: number): Promise<void>;
12export declare function fchmod(fd: number, mode: number | string): Promise<void>;
13export declare function fchown(fd: number, uid: number, gid: number): Promise<void>;
14export declare function fstat(fd: number): Promise<fs.Stats>;
15export declare function ftruncate(fd: number, len?: number): Promise<void>;
16export declare function futimes(fd: number, atime: Date | number, mtime: Date | number): Promise<void>;
17export declare function fsync(fd: number): Promise<void>;
18export declare function lchmod(path: string, mode: number | string): Promise<void>;
19export declare function lchown(path: string, uid: number, gid: number): Promise<void>;
20export declare function link(srcpath: string, dstpath: string): Promise<void>;
21export declare function lstat(path: string): Promise<fs.Stats>;
22export declare function mkdir(path: string, mode?: number | string): Promise<void>;
23export declare function mkdtemp(path: string): Promise<string>;
24export declare function open(path: string, flags: 'r' | 'r+' | 'rs' | 'rs+' | 'w' | 'wx' | 'w+' | 'wx+' | 'a' | 'ax' | 'a+' | 'ax+', mode?: number | string): Promise<number>;
25export declare function read(fd: number, buffer: Buffer, offset: number, length: number, position: number): Promise<{
26 bytesRead: number;
27 buffer: Buffer;
28}>;
29export declare function readdir(path: string): Promise<string[]>;
30export declare function readFile(file: string | number, options?: {
31 encoding?: 'ascii' | 'base64' | 'binary' | 'hex' | 'ucs2' | 'utf16le' | 'utf8';
32 flag?: 'r' | 'r+' | 'rs' | 'rs+' | 'w' | 'wx' | 'w+' | 'wx+' | 'a' | 'ax' | 'a+' | 'ax+';
33} | 'ascii' | 'base64' | 'binary' | 'hex' | 'ucs2' | 'utf16le' | 'utf8' | 'r' | 'r+' | 'rs' | 'rs+' | 'w' | 'wx' | 'w+' | 'wx+' | 'a' | 'ax' | 'a+' | 'ax+'): Promise<any>;
34export declare function readlink(path: string): Promise<string>;
35export declare function realpath(path: string, cache?: {
36 [path: string]: string;
37}): Promise<string>;
38export declare function rename(oldPath: string, newPath: string): Promise<void>;
39export declare function rmdir(path: string): Promise<void>;
40export declare function stat(path: string): Promise<fs.Stats>;
41export declare function symlink(srcpath: string, dstpath: string, type?: string): Promise<void>;
42export declare function truncate(path: string, len?: number): Promise<void>;
43export declare function unlink(path: string): Promise<void>;
44export declare function utimes(path: string, atime: Date | number, mtime: Date | number): Promise<void>;
45export declare function write(fd: number, buffer: Buffer, offset: number, length: number, position?: number): Promise<{
46 written: number;
47 buffer: Buffer;
48}>;
49export declare function write(fd: number, data: any, offset?: number, encoding?: 'ascii' | 'base64' | 'binary' | 'hex' | 'ucs2' | 'utf16le' | 'utf8'): Promise<{
50 written: number;
51 buffer: Buffer;
52}>;
53export declare function writeFile(file: string | number, data: string | any, options?: {
54 encoding?: 'ascii' | 'base64' | 'binary' | 'hex' | 'ucs2' | 'utf16le' | 'utf8';
55 flag?: 'r' | 'r+' | 'rs' | 'rs+' | 'w' | 'wx' | 'w+' | 'wx+' | 'a' | 'ax' | 'a+' | 'ax+';
56 mode?: number | string;
57} | 'ascii' | 'base64' | 'binary' | 'hex' | 'ucs2' | 'utf16le' | 'utf8' | 'r' | 'r+' | 'rs' | 'rs+' | 'w' | 'wx' | 'w+' | 'wx+' | 'a' | 'ax' | 'a+' | 'ax+'): Promise<void>;
58export declare function readTextFile(file: string | number, encoding?: 'ascii' | 'base64' | 'binary' | 'hex' | 'ucs2' | 'utf16le' | 'utf8', flags?: 'r' | 'r+' | 'rs' | 'rs+' | 'w' | 'wx' | 'w+' | 'wx+' | 'a' | 'ax' | 'a+' | 'ax+'): Promise<string>;
59export declare function writeTextFile(file: string | number, data: string, encoding?: 'ascii' | 'base64' | 'binary' | 'hex' | 'ucs2' | 'utf16le' | 'utf8', flags?: 'r' | 'r+' | 'rs' | 'rs+' | 'w' | 'wx' | 'w+' | 'wx+' | 'a' | 'ax' | 'a+' | 'ax+', mode?: number | string): Promise<void>;
60export declare function createDirectory(path: string, mode?: number | string): Promise<void>;
61export { createDirectory as mkdirp };
62declare function del(path: string): Promise<void>;
63export { del as delete };
64export { del as rimraf };
65export declare function exists(path: string): Promise<boolean>;