mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Fix app-root-path
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
/// <reference path="app-root-path.d.ts" />
|
||||
import * as root from 'app-root-path';
|
||||
|
||||
let resolvedPath: string;
|
||||
|
||||
39
app-root-path/app-root-path.d.ts
vendored
39
app-root-path/app-root-path.d.ts
vendored
@@ -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
37
app-root-path/index.d.ts
vendored
Normal 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;
|
||||
19
app-root-path/tsconfig.json
Normal file
19
app-root-path/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user