add typings for resolve-pkg

This commit is contained in:
Meno Abels
2018-12-07 09:35:08 +01:00
parent a5cac1fda5
commit 6ef208779f
4 changed files with 43 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for resolve-pkg 1.0
// Project: https://github.com/sindresorhus/resolve-pkg
// Definitions by: Meno Abels <https://github.com/mabels>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
interface ResolvePkgOptions {
cwd?: boolean;
}
type ResolveFunction = (moduleId: string, options?: ResolvePkgOptions) => string;
declare const resolveFunction: ResolveFunction;
export = resolveFunction;
+5
View File
@@ -0,0 +1,5 @@
import * as rpkg from 'resolve-pkg';
const test1 = rpkg('hello');
const test2 = rpkg('hello', {});
const test3 = rpkg('hello', { cwd: true });
+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-pkg-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }