add delete-empty types

This commit is contained in:
Arturas 2018-09-05 12:14:55 +01:00
parent 2b6e08299d
commit d1b857efe6
4 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,12 @@
import * as deleteEmpty from 'delete-empty';
deleteEmpty('foo').then(f => f[0].toLowerCase());
deleteEmpty('foo', (err, f) => {
if (err) {
err.message;
} else {
f[0].toLowerCase();
}
});
deleteEmpty.sync('foo')[0].toLowerCase();

13
types/delete-empty/index.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
// Type definitions for delete-empty 2.0
// Project: https://github.com/jonschlinkert/delete-empty
// Definitions by: Alorel <https://github.com/Alorel>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function deleteEmpty(dir: string): Promise<string[]>;
declare function deleteEmpty(dir: string, cb: (err: Error | undefined | null, deleted: string[]) => void): void;
declare namespace deleteEmpty {
function sync(dir: string): string[];
}
export = deleteEmpty;

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"delete-empty-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }