Fix app-root-path

This commit is contained in:
Paul van Brenk
2016-08-19 16:07:05 -07:00
parent 10b1b3f8f7
commit be53f448da
4 changed files with 56 additions and 40 deletions

View File

@@ -1,4 +1,3 @@
/// <reference path="app-root-path.d.ts" />
import * as root from 'app-root-path';
let resolvedPath: string;

View File

@@ -1,39 +0,0 @@
// Type definitions for app-root-path 1.2.1
// Project: https://github.com/inxilpro/node-app-root-path
// Definitions by: Shant Marouti <https://github.com/shantmarouti>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'app-root-path' {
interface RootPath {
/**
* Application root directory absolute path
* @type {string}
*/
path: string;
/**
* Resolves relative path from root to absolute path
* @param {string} pathToModule
* @returns {string}
*/
resolve(pathToModule: string): string;
/**
* Resolve module by relative addressing from root
* @param {string} pathToModule
* @returns {*}
*/
require(pathToModule: string): any;
/**
* Explicitly set root path
* @param {string} explicitlySetPath
*/
setPath(explicitlySetPath: string): void;
toString(): string;
}
var RootPath: RootPath;
export = RootPath;
}

37
app-root-path/index.d.ts vendored Normal file
View File

@@ -0,0 +1,37 @@
// Type definitions for app-root-path 1.2.1
// Project: https://github.com/inxilpro/node-app-root-path
// Definitions by: Shant Marouti <https://github.com/shantmarouti>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface RootPath {
/**
* Application root directory absolute path
* @type {string}
*/
path: string;
/**
* Resolves relative path from root to absolute path
* @param {string} pathToModule
* @returns {string}
*/
resolve(pathToModule: string): string;
/**
* Resolve module by relative addressing from root
* @param {string} pathToModule
* @returns {*}
*/
require(pathToModule: string): any;
/**
* Explicitly set root path
* @param {string} explicitlySetPath
*/
setPath(explicitlySetPath: string): void;
toString(): string;
}
declare const RootPath: RootPath;
export = RootPath;

View File

@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"app-root-path-tests.ts"
]
}