Add types for pkg-up (#30570)

This commit is contained in:
Emily Marigold Klassen
2018-11-16 16:00:49 -08:00
committed by Pranav Senthilnathan
parent 3b1a21e700
commit 4d24ec8a7e
4 changed files with 42 additions and 0 deletions

12
types/pkg-up/index.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
// Type definitions for pkg-up 2.0
// Project: https://github.com/sindresorhus/pkg-up#readme
// Definitions by: Emily Marigold Klassen <https://github.com/forivall>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = pkgUp;
declare function pkgUp(cwd?: string): Promise<string>;
declare namespace pkgUp {
function sync(cwd?: string): string;
}

View File

@@ -0,0 +1,6 @@
import pkgUp = require('pkg-up');
pkgUp().then(filepath => {
filepath;
// => '/Users/sindresorhus/foo/package.json'
});

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",
"pkg-up-tests.ts"
]
}

1
types/pkg-up/tslint.json Normal file
View File

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