mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add types for find-down
This commit is contained in:
parent
0341d2d082
commit
5407df6243
13
types/find-down/find-down-tests.ts
Normal file
13
types/find-down/find-down-tests.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import findDown = require('find-down');
|
||||
|
||||
findDown('unicorn.png').then(file => {
|
||||
file; // $ExpectType string | null
|
||||
});
|
||||
|
||||
findDown(['unicorn.png']).then(file => {
|
||||
file; // $ExpectType string | null
|
||||
});
|
||||
|
||||
findDown('unicorn.png', { cwd: '.' }).then(file => {
|
||||
file; // $ExpectType string | null
|
||||
});
|
||||
15
types/find-down/index.d.ts
vendored
Normal file
15
types/find-down/index.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
// Type definitions for find-down 0.1
|
||||
// Project: https://github.com/sholladay/find-down
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace findDown {
|
||||
interface Options {
|
||||
/** Directory to end with. Default: `process.cwd()` */
|
||||
cwd?: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare function findDown(filename: string | string[], options?: findDown.Options): Promise<string | null>;
|
||||
|
||||
export = findDown;
|
||||
23
types/find-down/tsconfig.json
Normal file
23
types/find-down/tsconfig.json
Normal 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",
|
||||
"find-down-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/find-down/tslint.json
Normal file
1
types/find-down/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user