38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
|
|
import { URL } from 'url';
|
||
|
|
import BrowserWindow from '../window/BrowserWindow.js';
|
||
|
|
import Location from '../location/Location.js';
|
||
|
|
/**
|
||
|
|
* Module URL utility.
|
||
|
|
*/
|
||
|
|
export default class ModuleURLUtility {
|
||
|
|
private static nodeModuleResolveCache;
|
||
|
|
private static packageJsonCache;
|
||
|
|
/**
|
||
|
|
* Returns module URL based on parent URL and the import map.
|
||
|
|
*
|
||
|
|
* @param window Window.
|
||
|
|
* @param parentURL Parent URL.
|
||
|
|
* @param url Module URL.
|
||
|
|
*/
|
||
|
|
static getURL(window: BrowserWindow, parentURL: URL | Location | string, url: string): URL;
|
||
|
|
/**
|
||
|
|
* Clears the internal caches.
|
||
|
|
*/
|
||
|
|
static clearCache(): void;
|
||
|
|
/**
|
||
|
|
* Resolves the module URL using the settings.
|
||
|
|
*
|
||
|
|
* @param window Window.
|
||
|
|
* @param parentURL Parent URL.
|
||
|
|
* @param url Module URL.
|
||
|
|
*/
|
||
|
|
private static resolveURL;
|
||
|
|
/**
|
||
|
|
* Resolves node module URL.
|
||
|
|
*
|
||
|
|
* @param resolveNodeModules Settings for resolving node modules.
|
||
|
|
* @param url Module URL.
|
||
|
|
*/
|
||
|
|
private static resolveNodeModuleURL;
|
||
|
|
}
|
||
|
|
//# sourceMappingURL=ModuleURLUtility.d.ts.map
|