UNPKG

1.99 kBTypeScriptView Raw
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
12import glob = require('glob');
13import fs = require('fs');
14
15declare function rimraf(path: string, options: rimraf.Options, callback: (error: Error | null | undefined) => void): void;
16declare function rimraf(path: string, callback: (error: Error | null | undefined) => void): void;
17declare 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 | undefined;
30 emfileWait?: number | undefined;
31 /** @default false */
32 disableGlob?: boolean | undefined;
33 glob?: glob.IOptions | false | undefined;
34
35 unlink?: typeof fs.unlink | undefined;
36 chmod?: typeof fs.chmod | undefined;
37 stat?: typeof fs.stat | undefined;
38 lstat?: typeof fs.lstat | undefined;
39 rmdir?: typeof fs.rmdir | undefined;
40 readdir?: typeof fs.readdir | undefined;
41 unlinkSync?: typeof fs.unlinkSync | undefined;
42 chmodSync?: typeof fs.chmodSync | undefined;
43 statSync?: typeof fs.statSync | undefined;
44 lstatSync?: typeof fs.lstatSync | undefined;
45 rmdirSync?: typeof fs.rmdirSync | undefined;
46 readdirSync?: typeof fs.readdirSync | undefined;
47 }
48}
49export = rimraf;