UNPKG

821 BTypeScriptView Raw
1export declare function ngCompilerCli(): Promise<typeof import('@angular/compiler-cli')>;
2/**
3 * This uses a dynamic import to load a module which may be ESM.
4 * CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript
5 * will currently, unconditionally downlevel dynamic import into a require call.
6 * require calls cannot load ESM code and will result in a runtime error. To workaround
7 * this, a Function constructor is used to prevent TypeScript from changing the dynamic import.
8 * Once TypeScript provides support for keeping the dynamic import this workaround can
9 * be dropped.
10 *
11 * @param modulePath The path of the module to load.
12 * @returns A Promise that resolves to the dynamically imported module.
13 */
14export declare function loadEsmModule<T>(modulePath: string | URL): Promise<T>;