From 19d6068d7f03791448fc416efc21dade419edfa0 Mon Sep 17 00:00:00 2001 From: Jay Anslow Date: Tue, 26 Apr 2016 22:14:04 +0100 Subject: [PATCH] Add `resolve` dependency (and custom typings) --- custom-typings/resolve.d.ts | 29 +++++++++++++++++++++++++++++ package.json | 1 + src/tsconfig.json | 1 + test/tsconfig.json | 1 + 4 files changed, 32 insertions(+) create mode 100644 custom-typings/resolve.d.ts diff --git a/custom-typings/resolve.d.ts b/custom-typings/resolve.d.ts new file mode 100644 index 00000000000..31ab1a0d164 --- /dev/null +++ b/custom-typings/resolve.d.ts @@ -0,0 +1,29 @@ +declare module "resolve" { + interface ResolveOptions { + basedir?: string; + extensions?: string[]; + paths?: string[]; + moduleDirectory?: string | string[]; + } + interface AsyncResolveOptions extends ResolveOptions { + package?: any; + readFile?: Function; + isFile?: (file: string, cb: Function) => void; + packageFilter?: Function; + pathFilter?: Function; + } + interface SyncResolveOptions extends ResolveOptions { + readFile?: Function; + isFile?: (file: string) => boolean; + packageFilter?: Function; + } + interface ResolveFunction { + (id: string, cb: (err: any, res: string, pkg: any) => void): void; + (id: string, opts: AsyncResolveOptions, cb: (err: any, res: string, pkg: any) => void): void; + sync(id: string, opts?: SyncResolveOptions): string; + isCore(pkg: any): any; + } + + const resolve: ResolveFunction; + export = resolve; +} diff --git a/package.json b/package.json index 9b26fb35333..8366a8415fd 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "glob": "^6.0.1", "optimist": "~0.6.0", "path-is-absolute": "^1.0.0", + "resolve": "^1.1.7", "underscore.string": "~3.1.1" }, "devDependencies": { diff --git a/src/tsconfig.json b/src/tsconfig.json index de8ab98f545..ed00f2e64f4 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -22,6 +22,7 @@ ], "files": [ "../custom-typings/path-is-absolute.d.ts", + "../custom-typings/resolve.d.ts", "../typings/colors/colors.d.ts", "../typings/diff/diff.d.ts", "../typings/findup-sync/findup-sync.d.ts", diff --git a/test/tsconfig.json b/test/tsconfig.json index 21d5b1f6914..9eb6193e4a5 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -21,6 +21,7 @@ ], "files": [ "../custom-typings/path-is-absolute.d.ts", + "../custom-typings/resolve.d.ts", "../typings/colors/colors.d.ts", "../typings/diff/diff.d.ts", "../typings/findup-sync/findup-sync.d.ts",