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 |
|
6 | interface RootPath {
|
7 |
|
8 | /**
|
9 | * Application root directory absolute path
|
10 | */
|
11 | path: string;
|
12 |
|
13 | /**
|
14 | * Resolves relative path from root to absolute path
|
15 | * @param {string} pathToModule
|
16 | * @returns {string}
|
17 | */
|
18 | resolve(pathToModule: string): string;
|
19 |
|
20 | /**
|
21 | * Resolve module by relative addressing from root
|
22 | * @param {string} pathToModule
|
23 | * @returns {*}
|
24 | */
|
25 | require(pathToModule: string): any;
|
26 |
|
27 | /**
|
28 | * Explicitly set root path
|
29 | * @param {string} explicitlySetPath
|
30 | */
|
31 | setPath(explicitlySetPath: string): void;
|
32 |
|
33 | toString(): string;
|
34 | }
|
35 | declare const RootPath: RootPath;
|
36 | export = RootPath;
|