1 |
|
2 |
|
3 | import * as Promise from "bluebird";
|
4 | import * as fs from "fs";
|
5 | import { CopyFilter, CopyOptions, MoveOptions, ReadOptions, WriteOptions } from "fs-extra";
|
6 | import * as stream from "stream";
|
7 | import Stats = fs.Stats;
|
8 |
|
9 | export * from "fs-extra";
|
10 |
|
11 | export interface MkdirOptions {
|
12 | fs?: any;
|
13 | mode?: number | undefined;
|
14 | }
|
15 |
|
16 |
|
17 | export function copyAsync(src: string, dest: string, options?: CopyFilter | CopyOptions): Promise<void>;
|
18 |
|
19 | export function createFileAsync(file: string): Promise<void>;
|
20 |
|
21 | export function mkdirsAsync(dir: string, options?: MkdirOptions): Promise<void>;
|
22 | export function mkdirpAsync(dir: string, options?: MkdirOptions): Promise<void>;
|
23 |
|
24 | export function moveAsync(src: string, dest: string, options?: MoveOptions): Promise<void>;
|
25 |
|
26 | export function outputFileAsync(file: string, data: any): Promise<void>;
|
27 |
|
28 | export function outputJsonAsync(file: string, data: any): Promise<void>;
|
29 | export function outputJSONAsync(file: string, data: any): Promise<void>;
|
30 |
|
31 | export function readJsonAsync(file: string, options?: ReadOptions): Promise<any>;
|
32 | export function readJSONAsync(file: string, options?: ReadOptions): Promise<any>;
|
33 |
|
34 | export function removeAsync(dir: string): Promise<void>;
|
35 |
|
36 | export function writeJsonAsync(file: string, object: any, options?: WriteOptions): Promise<void>;
|
37 | export function writeJSONAsync(file: string, object: any, options?: WriteOptions): Promise<void>;
|
38 |
|
39 | export function renameAsync(oldPath: string, newPath: string): Promise<void>;
|
40 | export function truncateAsync(fd: number, len: number): Promise<void>;
|
41 | export function chownAsync(path: string, uid: number, gid: number): Promise<void>;
|
42 | export function fchownAsync(fd: number, uid: number, gid: number): Promise<void>;
|
43 | export function lchownAsync(path: string, uid: number, gid: number): Promise<void>;
|
44 | export function chmodAsync(path: string, mode: number | string): Promise<void>;
|
45 | export function fchmodAsync(fd: number, mode: number | string): Promise<void>;
|
46 | export function lchmodAsync(path: string, mode: number | string): Promise<void>;
|
47 | export function statAsync(path: string): Promise<Stats>;
|
48 | export function lstatAsync(path: string): Promise<Stats>;
|
49 | export function fstatAsync(fd: number): Promise<Stats>;
|
50 | export function linkAsync(srcpath: string, dstpath: string): Promise<void>;
|
51 | export function symlinkAsync(srcpath: string, dstpath: string, type?: fs.symlink.Type): Promise<void>;
|
52 | export function readlinkAsync(path: string): Promise<string>;
|
53 | export function realpathAsync(path: string, cache?: { [path: string]: string }): Promise<string>;
|
54 | export function unlinkAsync(path: string): Promise<void>;
|
55 | export function rmdirAsync(path: string): Promise<void>;
|
56 | export function mkdirAsync(path: string, mode?: number | string): Promise<void>;
|
57 | export function readdirAsync(path: string): Promise<string[]>;
|
58 | export function closeAsync(fd: number): Promise<void>;
|
59 | export function openAsync(path: string, flags: string, mode?: string): Promise<number>;
|
60 | export function utimesAsync(path: string, atime: number, mtime: number): Promise<void>;
|
61 | export function futimesAsync(fd: number, atime: number, mtime: number): Promise<void>;
|
62 | export function fsyncAsync(fd: number): Promise<void>;
|
63 | export function writeAsync(
|
64 | fd: number,
|
65 | buffer: Buffer,
|
66 | offset: number,
|
67 | length: number,
|
68 | position: number,
|
69 | ): Promise<[number, Buffer]>;
|
70 | export function readAsync(
|
71 | fd: number,
|
72 | buffer: Buffer,
|
73 | offset: number,
|
74 | length: number,
|
75 | position: number,
|
76 | ): Promise<[number, Buffer]>;
|
77 | export function readFileAsync(filename: string, options: string | ReadOptions): Promise<string>;
|
78 | export function readFileAsync(filename: string): Promise<Buffer>;
|
79 | export function writeFileAsync(filename: string, data: any, options?: string | WriteOptions): Promise<void>;
|
80 | export function mkdtempAsync(prefix: string, options: string | { encoding: string }): Promise<string>;
|
81 | export function appendFileAsync(filename: string, data: any, option?: string | WriteOptions): Promise<void>;
|
82 |
|
83 | export function existsAsync(path: string): Promise<boolean>;
|
84 | export function ensureDirAsync(path: string): Promise<void>;
|
85 |
|
86 | export function isDirectory(path: string, callback?: (err: Error, isDirectory: boolean) => void): void;
|
87 | export function isDirectorySync(path: string): boolean;
|
88 | export function isDirectoryAsync(path: string): Promise<boolean>;
|