1 | // Type definitions for rimraf 3.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 | // Oganexon <https://github.com/oganexon>
|
7 | // Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
8 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
9 |
|
10 | /// <reference types="node" />
|
11 |
|
12 | import glob = require('glob');
|
13 | import fs = require('fs');
|
14 |
|
15 | declare function rimraf(path: string, options: rimraf.Options, callback: (error: Error) => void): void;
|
16 | declare function rimraf(path: string, callback: (error: Error) => void): void;
|
17 | declare namespace rimraf {
|
18 | /**
|
19 | * It can remove stuff synchronously, too.
|
20 | * But that's not so good. Use the async API.
|
21 | * It's better.
|
22 | */
|
23 | function sync(path: string, options?: Options): void;
|
24 |
|
25 | /**
|
26 | * see {@link https://github.com/isaacs/rimraf/blob/79b933fb362b2c51bedfa448be848e1d7ed32d7e/README.md#options}
|
27 | */
|
28 | interface Options {
|
29 | maxBusyTries?: number;
|
30 | emfileWait?: number;
|
31 | /** @default false */
|
32 | disableGlob?: boolean;
|
33 | glob?: glob.IOptions | false;
|
34 |
|
35 | unlink?: typeof fs.unlink;
|
36 | chmod?: typeof fs.chmod;
|
37 | stat?: typeof fs.stat;
|
38 | lstat?: typeof fs.lstat;
|
39 | rmdir?: typeof fs.rmdir;
|
40 | readdir?: typeof fs.readdir;
|
41 | unlinkSync?: typeof fs.unlinkSync;
|
42 | chmodSync?: typeof fs.chmodSync;
|
43 | statSync?: typeof fs.statSync;
|
44 | lstatSync?: typeof fs.lstatSync;
|
45 | rmdirSync?: typeof fs.rmdirSync;
|
46 | readdirSync?: typeof fs.readdirSync;
|
47 | }
|
48 | }
|
49 | export = rimraf;
|