UNPKG

1.06 kBTypeScriptView Raw
1import { IocContract } from '../Contracts';
2/**
3 * Manages the import aliases
4 */
5export declare class ImportAliases {
6 private container;
7 /**
8 * Registered aliases
9 */
10 list: {
11 [alias: string]: string;
12 };
13 /**
14 * In-memory require cache to speed up lookup calls. Yes, "require"
15 * is slow. Check "perf/require.js"
16 */
17 private requireCache;
18 constructor(container: IocContract);
19 /**
20 * Returns the matching alias for the given namespace
21 */
22 private getPathAlias;
23 /**
24 * Returns path for a given alias
25 */
26 private makeAliasPath;
27 /**
28 * Register an import alias
29 */
30 register(absolutePath: string, alias: string): this;
31 /**
32 * Find if a namespace is part of the import aliases
33 */
34 has(namespace: string): boolean;
35 /**
36 * Import the namespace from the registered import aliases.
37 */
38 resolve(namespace: string): any;
39 /**
40 * Same as [[resolve]] but uses ES modules
41 */
42 resolveAsync(namespace: string): Promise<any>;
43}