mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
update(rimraf): update to version 3.0 (#43188)
- v2 created - removed BUSYTRIES_MAX and EMFILE_MAX - other minor changes https://github.com/isaacs/rimraf/blob/master/rimraf.js Thanks!
This commit is contained in:
committed by
GitHub
parent
d3c19af135
commit
551f768a3f
19
types/rimraf/index.d.ts
vendored
19
types/rimraf/index.d.ts
vendored
@@ -1,13 +1,12 @@
|
||||
// Type definitions for rimraf 2.0
|
||||
// Type definitions for rimraf 3.0
|
||||
// Project: https://github.com/isaacs/rimraf
|
||||
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
|
||||
// e-cloud <https://github.com/e-cloud>
|
||||
// Ruben Schmidmeister <https://github.com/bash>
|
||||
// Oganexon <https://github.com/oganexon>
|
||||
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Imported from: https://github.com/soywiz/typescript-node-definitions/rimraf.d.ts
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import glob = require('glob');
|
||||
@@ -16,13 +15,20 @@ import fs = require('fs');
|
||||
declare function rimraf(path: string, options: rimraf.Options, callback: (error: Error) => void): void;
|
||||
declare function rimraf(path: string, callback: (error: Error) => void): void;
|
||||
declare namespace rimraf {
|
||||
function __promisify__(path: string, options?: Options): Promise<void>;
|
||||
/**
|
||||
* It can remove stuff synchronously, too.
|
||||
* But that's not so good. Use the async API.
|
||||
* It's better.
|
||||
*/
|
||||
function sync(path: string, options?: Options): void;
|
||||
let EMFILE_MAX: number;
|
||||
let BUSYTRIES_MAX: number;
|
||||
|
||||
/**
|
||||
* see {@link https://github.com/isaacs/rimraf/blob/79b933fb362b2c51bedfa448be848e1d7ed32d7e/README.md#options}
|
||||
*/
|
||||
interface Options {
|
||||
maxBusyTries?: number;
|
||||
emfileWait?: number;
|
||||
/** @default false */
|
||||
disableGlob?: boolean;
|
||||
glob?: glob.IOptions | false;
|
||||
|
||||
@@ -32,7 +38,6 @@ declare namespace rimraf {
|
||||
lstat?: typeof fs.lstat;
|
||||
rmdir?: typeof fs.rmdir;
|
||||
readdir?: typeof fs.readdir;
|
||||
|
||||
unlinkSync?: typeof fs.unlinkSync;
|
||||
chmodSync?: typeof fs.chmodSync;
|
||||
statSync?: typeof fs.statSync;
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import rimraf = require('rimraf');
|
||||
|
||||
rimraf('./xyz', (err: Error) => { });
|
||||
rimraf('./xyz', (err: Error) => {});
|
||||
rimraf.sync('./xyz');
|
||||
|
||||
rimraf('./xyz', { glob: { ignore: '' } }, (err: Error) => { });
|
||||
rimraf('./xyz', { glob: { ignore: '' } }, (err: Error) => {});
|
||||
rimraf.sync('./xyz', { glob: { ignore: '' } });
|
||||
|
||||
rimraf.EMFILE_MAX = 0;
|
||||
rimraf.BUSYTRIES_MAX = 0;
|
||||
|
||||
44
types/rimraf/v2/index.d.ts
vendored
Normal file
44
types/rimraf/v2/index.d.ts
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
// Type definitions for rimraf 2.0
|
||||
// Project: https://github.com/isaacs/rimraf
|
||||
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
|
||||
// e-cloud <https://github.com/e-cloud>
|
||||
// Ruben Schmidmeister <https://github.com/bash>
|
||||
// Oganexon <https://github.com/oganexon>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Imported from: https://github.com/soywiz/typescript-node-definitions/rimraf.d.ts
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import glob = require('glob');
|
||||
import fs = require('fs');
|
||||
|
||||
declare function rimraf(path: string, options: rimraf.Options, callback: (error: Error) => void): void;
|
||||
declare function rimraf(path: string, callback: (error: Error) => void): void;
|
||||
declare namespace rimraf {
|
||||
function __promisify__(path: string, options?: Options): Promise<void>;
|
||||
function sync(path: string, options?: Options): void;
|
||||
let EMFILE_MAX: number;
|
||||
let BUSYTRIES_MAX: number;
|
||||
interface Options {
|
||||
maxBusyTries?: number;
|
||||
emfileWait?: number;
|
||||
disableGlob?: boolean;
|
||||
glob?: glob.IOptions | false;
|
||||
|
||||
unlink?: typeof fs.unlink;
|
||||
chmod?: typeof fs.chmod;
|
||||
stat?: typeof fs.stat;
|
||||
lstat?: typeof fs.lstat;
|
||||
rmdir?: typeof fs.rmdir;
|
||||
readdir?: typeof fs.readdir;
|
||||
|
||||
unlinkSync?: typeof fs.unlinkSync;
|
||||
chmodSync?: typeof fs.chmodSync;
|
||||
statSync?: typeof fs.statSync;
|
||||
lstatSync?: typeof fs.lstatSync;
|
||||
rmdirSync?: typeof fs.rmdirSync;
|
||||
readdirSync?: typeof fs.readdirSync;
|
||||
}
|
||||
}
|
||||
export = rimraf;
|
||||
10
types/rimraf/v2/rimraf-tests.ts
Normal file
10
types/rimraf/v2/rimraf-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import rimraf = require('rimraf');
|
||||
|
||||
rimraf('./xyz', (err: Error) => { });
|
||||
rimraf.sync('./xyz');
|
||||
|
||||
rimraf('./xyz', { glob: { ignore: '' } }, (err: Error) => { });
|
||||
rimraf.sync('./xyz', { glob: { ignore: '' } });
|
||||
|
||||
rimraf.EMFILE_MAX = 0;
|
||||
rimraf.BUSYTRIES_MAX = 0;
|
||||
28
types/rimraf/v2/tsconfig.json
Normal file
28
types/rimraf/v2/tsconfig.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths": {
|
||||
"rimraf": [
|
||||
"rimraf/v2"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"rimraf-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/rimraf/v2/tslint.json
Normal file
3
types/rimraf/v2/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user