mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Export options interface along with module definition
This commit is contained in:
Vendored
+9
-8
@@ -1,14 +1,15 @@
|
||||
// Type definitions for resolve-pkg 1.0
|
||||
// Project: https://github.com/sindresorhus/resolve-pkg
|
||||
// Definitions by: Meno Abels <https://github.com/mabels>
|
||||
// BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
interface ResolvePkgOptions {
|
||||
cwd?: boolean;
|
||||
export = resolvePkg;
|
||||
|
||||
declare function resolvePkg(moduleId: string, options?: resolvePkg.Options): string;
|
||||
|
||||
declare namespace resolvePkg {
|
||||
interface Options {
|
||||
cwd?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
type ResolveFunction = (moduleId: string, options?: ResolvePkgOptions) => string;
|
||||
declare const resolveFunction: ResolveFunction;
|
||||
|
||||
export = resolveFunction;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import rpkg = require('resolve-pkg');
|
||||
import resolvePkg = require('resolve-pkg');
|
||||
|
||||
const test1 = rpkg('hello');
|
||||
const test2 = rpkg('hello', {});
|
||||
const test3 = rpkg('hello', { cwd: true });
|
||||
// $ExpectType string
|
||||
rpkg('hello');
|
||||
rpkg('hello', {});
|
||||
rpkg('hello', { cwd: true });
|
||||
|
||||
const resolvePkgOpts: resolvePkg.Options = {};
|
||||
|
||||
Reference in New Issue
Block a user