mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
which-pm: Provides its own types (#39572)
This commit is contained in:
committed by
Jesse Trinity
parent
0de0e14062
commit
b278c786e0
@@ -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",
|
||||
|
||||
Vendored
-14
@@ -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;
|
||||
@@ -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 +0,0 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user