UNPKG

963 BTypeScriptView Raw
1// Type definitions for app-root-path 1.2.1
2// Project: https://github.com/inxilpro/node-app-root-path
3// Definitions by: Shant Marouti <https://github.com/shantmarouti>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6interface RootPath {
7
8 /**
9 * Application root directory absolute path
10 * @type {string}
11 */
12 path: string;
13
14 /**
15 * Resolves relative path from root to absolute path
16 * @param {string} pathToModule
17 * @returns {string}
18 */
19 resolve(pathToModule: string): string;
20
21 /**
22 * Resolve module by relative addressing from root
23 * @param {string} pathToModule
24 * @returns {*}
25 */
26 require(pathToModule: string): any;
27
28 /**
29 * Explicitly set root path
30 * @param {string} explicitlySetPath
31 */
32 setPath(explicitlySetPath: string): void;
33
34 toString(): string;
35}
36declare const RootPath: RootPath;
37export = RootPath;