mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-17 22:44:18 +08:00
Merge pull request #4814 from tkrotoff/del
del: options and callback are optional
This commit is contained in:
@@ -3,6 +3,10 @@ import del = require("del");
|
||||
|
||||
var paths = ["build", "dist/**/*.js"];
|
||||
|
||||
del(["tmp/*.js", "!tmp/unicorn.js"]);
|
||||
|
||||
del(["tmp/*.js", "!tmp/unicorn.js"], {force: true});
|
||||
|
||||
del(["tmp/*.js", "!tmp/unicorn.js"], (err, paths) => {
|
||||
console.log('Deleted files/folders:\n', paths.join('\n'));
|
||||
});
|
||||
@@ -11,6 +15,10 @@ del(["tmp/*.js", "!tmp/unicorn.js"], {force: true}, (err, paths) => {
|
||||
console.log('Deleted files/folders:\n', paths.join('\n'));
|
||||
});
|
||||
|
||||
del("tmp/*.js");
|
||||
|
||||
del("tmp/*.js", {force: true});
|
||||
|
||||
del("tmp/*.js", (err, paths) => {
|
||||
console.log('Deleted files/folders:\n', paths.join('\n'));
|
||||
});
|
||||
@@ -25,4 +33,4 @@ del.sync(["tmp/*.js", "!tmp/unicorn.js"], {force: true});
|
||||
|
||||
del.sync("tmp/*.js");
|
||||
|
||||
del.sync("tmp/*.js", {force: true});
|
||||
del.sync("tmp/*.js", {force: true});
|
||||
|
||||
11
del/del.d.ts
vendored
11
del/del.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for del
|
||||
// Type definitions for del v1.2.0
|
||||
// Project: https://github.com/sindresorhus/del
|
||||
// Definitions by: Asana <https://asana.com>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -8,13 +8,16 @@
|
||||
declare module "del" {
|
||||
import glob = require("glob");
|
||||
|
||||
function Del(pattern: string): void;
|
||||
function Del(pattern: string, options: Del.Options): void;
|
||||
function Del(pattern: string, callback: (err: Error, deletedFiles: string[]) => any): void;
|
||||
|
||||
function Del(pattern: string, options: Del.Options, callback: (err: Error, deletedFiles: string[]) => any): void;
|
||||
|
||||
function Del(patterns: string[]): void;
|
||||
function Del(patterns: string[], options: Del.Options): void;
|
||||
function Del(patterns: string[], callback: (err: Error, deletedFiles: string[]) => any): void;
|
||||
|
||||
function Del(patterns: string[], options: Del.Options, callback: (err: Error, deletedFiles: string[]) => any): void;
|
||||
|
||||
module Del {
|
||||
function sync(pattern: string, options?: Options): void;
|
||||
function sync(patterns: string[], options?: Options): void;
|
||||
@@ -25,4 +28,4 @@ declare module "del" {
|
||||
}
|
||||
|
||||
export = Del;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user