mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Add types for resolve-from v4
This commit is contained in:
13
types/resolve-from/index.d.ts
vendored
Normal file
13
types/resolve-from/index.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Type definitions for resolve-from 4.0
|
||||
// Project: https://github.com/sindresorhus/resolve-from
|
||||
// Definitions by: unional <https://github.com/unional>
|
||||
// BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = resolveFrom;
|
||||
|
||||
declare function resolveFrom(fromDir: string, moduleId: string): string;
|
||||
|
||||
declare namespace resolveFrom {
|
||||
function silent(fromDir: string, moduleId: string): string | null;
|
||||
}
|
||||
6
types/resolve-from/resolve-from-tests.ts
Normal file
6
types/resolve-from/resolve-from-tests.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import resolveFrom = require("resolve-from");
|
||||
|
||||
// $ExpectType string
|
||||
resolveFrom('foo', './bar');
|
||||
// $ExpectType string | null
|
||||
resolveFrom.silent('foo', './baz');
|
||||
23
types/resolve-from/tsconfig.json
Normal file
23
types/resolve-from/tsconfig.json
Normal 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-from-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/resolve-from/tslint.json
Normal file
3
types/resolve-from/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user