mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
Merge pull request #23576 from ajafff/npm-packlist
Add types for npm-packlist
This commit is contained in:
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// Type definitions for npm-packlist 1.1
|
||||
// Project: https://github.com/npm/npm-packlist
|
||||
// Definitions by: Klaus Meinhardt <https://github.com/ajafff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
declare function packlist(options?: packlist.Options): Promise<string[]>;
|
||||
declare function packlist<T>(options: packlist.Options | undefined, callback: (result: string[]) => T): Promise<T>;
|
||||
declare namespace packlist {
|
||||
interface Options {
|
||||
/** Directory to walk recusively. Defaults to `process.cwd()`. */
|
||||
path?: string;
|
||||
}
|
||||
function sync(options?: Options): string[];
|
||||
}
|
||||
export = packlist;
|
||||
@@ -0,0 +1,14 @@
|
||||
import packlist = require('npm-packlist');
|
||||
|
||||
let result: string[] = packlist.sync();
|
||||
result = packlist.sync({});
|
||||
result = packlist.sync({path: 'foo'});
|
||||
|
||||
(async () => {
|
||||
result = await packlist();
|
||||
result = await packlist({});
|
||||
result = await packlist({path: 'foo'});
|
||||
|
||||
packlist(undefined, (r) => result = r);
|
||||
packlist({path: 'foo'}, (r) => result = r);
|
||||
})();
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"esModuleInterop": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"npm-packlist-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user