UNPKG

732 BTypeScriptView Raw
1/**
2 * Provides ModuleNameResolver class used for loading files based on device capabilities.
3 */ /** */
4
5import { PlatformContext } from './qualifier-matcher';
6
7export { PlatformContext } from './qualifier-matcher';
8
9export type ModuleListProvider = () => string[];
10
11export class ModuleNameResolver {
12 constructor(context: PlatformContext, moduleListProvider?: ModuleListProvider);
13 resolveModuleName(path: string, ext: string): string;
14 clearCache(): void;
15}
16
17export function resolveModuleName(path: string, ext: string): string;
18export function clearCache(): void;
19
20/**
21 * Used to set a global singular instance of ModuleNameResolver
22 * @param resolver instance
23 */
24export function _setResolver(resolver: ModuleNameResolver);