Skip to content

Commit

Permalink
Add resolve dependency (and custom typings)
Browse files Browse the repository at this point in the history
  • Loading branch information
janslow committed Apr 26, 2016
1 parent 0bc9178 commit 19d6068
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
29 changes: 29 additions & 0 deletions custom-typings/resolve.d.ts
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 19d6068

Please sign in to comment.