which-pm: Provides its own types (#39572)

This commit is contained in:
Alexander T
2019-10-28 20:48:23 -07:00
committed by Jesse Trinity
parent 0de0e14062
commit b278c786e0
5 changed files with 6 additions and 52 deletions
+6
View File
@@ -4356,6 +4356,12 @@
"sourceRepoURL": "https://streams.spec.whatwg.org",
"asOfVersion": "3.2.1"
},
{
"libraryName": "which-pm",
"typingsPackageName": "which-pm",
"sourceRepoURL": "https://github.com/zkochan/which-pm#readme",
"asOfVersion": "1.1.0"
},
{
"libraryName": "winston",
"typingsPackageName": "winston",
-14
View File
@@ -1,14 +0,0 @@
// Type definitions for which-pm 1.0
// Project: https://github.com/zkochan/which-pm#readme
// Definitions by: Jorge Gonzalez <https://github.com/jorgegonzalez>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
interface PMInfo {
name: string;
version?: string;
}
declare function whichpm(pkgPath: string): Promise<PMInfo | null>;
export = whichpm;
-23
View File
@@ -1,23 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"which-pm-tests.ts"
]
}
-1
View File
@@ -1 +0,0 @@
{ "extends": "dtslint/dt.json" }
-14
View File
@@ -1,14 +0,0 @@
/// <reference types="node" />
import whichpm = require("which-pm");
whichpm(process.cwd())
.then(pm => {
pm; // $ExpectType PMInfo | null
if (pm !== null && pm !== undefined) {
pm.name; // $ExpectType string
pm.version; // $ExpectType string | undefined
}
})
.catch(err => console.error(err));
const _wpm = whichpm(process.cwd()); // $ExpectType Promise<PMInfo | null>