Merge pull request #31320 from BendingBender/resolve-global

Add types for resolve-global
This commit is contained in:
Nathan Shively-Sanders
2018-12-17 10:37:31 -08:00
committed by GitHub
4 changed files with 42 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for resolve-global 0.1
// Project: https://github.com/sindresorhus/resolve-global#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = resolveGlobal;
declare function resolveGlobal(moduleId: string): string;
declare namespace resolveGlobal {
function silent(moduleId: string): string | null;
}
@@ -0,0 +1,6 @@
import resolveGlobal = require('resolve-global');
// $ExpectType string
resolveGlobal('cat-names');
// $ExpectType string | null
resolveGlobal.silent('cat-names');
+23
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",
"resolve-global-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }