mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[global-modules-path] introduce types (#37246)
This commit is contained in:
parent
7923edeecc
commit
2fab8543dd
25
types/global-modules-path/global-modules-path-tests.ts
Normal file
25
types/global-modules-path/global-modules-path-tests.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import globalModulesPath = require('global-modules-path');
|
||||
|
||||
globalModulesPath(); // $ExpectError
|
||||
globalModulesPath.getPath(); // $ExpectError
|
||||
globalModulesPath.getPath(undefined, undefined); // $ExpectError
|
||||
globalModulesPath.getPath(undefined, 'hello'); // $ExpectError
|
||||
|
||||
globalModulesPath.getPath(undefined); // $ExpectError
|
||||
globalModulesPath.getPath(null); // $ExpectError
|
||||
globalModulesPath.getPath(() => {}); // $ExpectError
|
||||
globalModulesPath.getPath({}); // $ExpectError
|
||||
globalModulesPath.getPath(1); // $ExpectError
|
||||
globalModulesPath.getPath([]); // $ExpectError
|
||||
globalModulesPath.getPath(({})); // $ExpectError
|
||||
|
||||
globalModulesPath.getPath('typescript', undefined); // $ExpectType string | null
|
||||
globalModulesPath.getPath('typescript', null); // $ExpectError
|
||||
globalModulesPath.getPath('typescript', () => {}); // $ExpectError
|
||||
globalModulesPath.getPath('typescript', {}); // $ExpectError
|
||||
globalModulesPath.getPath('typescript', 1); // $ExpectError
|
||||
globalModulesPath.getPath('typescript', []); // $ExpectError
|
||||
globalModulesPath.getPath('typescript', ({})); // $ExpectError
|
||||
|
||||
globalModulesPath.getPath('typescript'); // $ExpectType string | null
|
||||
globalModulesPath.getPath('typescript', 'tsc'); // $ExpectType string | null
|
||||
6
types/global-modules-path/index.d.ts
vendored
Normal file
6
types/global-modules-path/index.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
// Type definitions for global-modules-path 2.3
|
||||
// Project: https://www.npmjs.com/package/global-modules-path
|
||||
// Definitions by: Gareth Jones <https://github.com/g-rath>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function getPath(module: string, executable?: string): string | null;
|
||||
23
types/global-modules-path/tsconfig.json
Normal file
23
types/global-modules-path/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"global-modules-path-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/global-modules-path/tslint.json
Normal file
1
types/global-modules-path/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user