UNPKG

1.55 kBTypeScriptView Raw
1// Type definitions for rimraf 2.0
2// Project: https://github.com/isaacs/rimraf
3// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
4// e-cloud <https://github.com/e-cloud>
5// Ruben Schmidmeister <https://github.com/bash>
6// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
8// Imported from: https://github.com/soywiz/typescript-node-definitions/rimraf.d.ts
9
10/// <reference types="node" />
11
12import glob = require('glob');
13import fs = require('fs');
14
15declare function rimraf(path: string, options: rimraf.Options, callback: (error: Error) => void): void;
16declare function rimraf(path: string, callback: (error: Error) => void): void;
17declare namespace rimraf {
18 function __promisify__(path: string, options?: Options): Promise<void>;
19 function sync(path: string, options?: Options): void;
20 let EMFILE_MAX: number;
21 let BUSYTRIES_MAX: number;
22 interface Options {
23 maxBusyTries?: number;
24 emfileWait?: boolean;
25 disableGlob?: boolean;
26 glob?: glob.IOptions | false;
27
28 unlink?: typeof fs.unlink;
29 chmod?: typeof fs.chmod;
30 stat?: typeof fs.stat;
31 lstat?: typeof fs.lstat;
32 rmdir?: typeof fs.rmdir;
33 readdir?: typeof fs.readdir;
34
35 unlinkSync?: typeof fs.unlinkSync;
36 chmodSync?: typeof fs.chmodSync;
37 statSync?: typeof fs.statSync;
38 lstatSync?: typeof fs.lstatSync;
39 rmdirSync?: typeof fs.rmdirSync;
40 readdirSync?: typeof fs.readdirSync;
41 }
42}
43export = rimraf;