import { ModuleSideEffectCallback, ModuleInput, FetchedScript, ScriptSideEffectCallback, CustomInstaller, LightLibraryWithAliasQueryString } from './inputs.models'; import { CdnEvent } from './events.models'; export declare function onHttpRequestLoad(req: XMLHttpRequest, event: ProgressEvent, resolve: any, reject: any, { url, name, assetId, version }: { url: any; name: any; assetId: any; version: any; }, onEvent?: any): void; export declare function sanitizeModules(modules: ModuleInput[]): { name: string; version: string; sideEffects?: ModuleSideEffectCallback; }[]; /** * Parse a resource id in the form `{libraryName}#{version}~{rest-of-path}` where: * - libraryName is the name of the library * - version is the target version * - rest-of-path is the partial url from the package's directory to the target CSS * * @param resourceId resource id in the form `{libraryName}#{version}~{rest-of-path}` * @category Helpers */ export declare function parseResourceId(resourceId: string): { name: string; version: string; path: string; assetId: string; url: string; }; export declare function patchExportedSymbolForBackwardCompatibility(origin: FetchedScript, executingWindow: WindowOrWorkerGlobalScope): any; export declare function applyModuleSideEffects(origin: FetchedScript, htmlScriptElement: HTMLScriptElement, executingWindow: WindowOrWorkerGlobalScope, userSideEffects: ModuleSideEffectCallback[], onEvent: (CdnEvent: any) => void): Promise; export declare function importScriptMainWindow({ url, assetId, version, name, content, executingWindow, }: { url: any; assetId: any; version: any; name: any; content: any; executingWindow: Window; }): HTMLScriptElement | ErrorEvent; export declare function importScriptWebWorker({ url }: { url: any; }): undefined | Error; export declare function addScriptElements(sources: (FetchedScript & { sideEffect?: ScriptSideEffectCallback; })[], executingWindow?: WindowOrWorkerGlobalScope, onEvent?: (event: CdnEvent) => void): Promise; /** * Returns the assetId from a name. * It does not imply that the asset exist. * * @param name name of the package (as defined in package.json) * @returns assetId used in the assets store * @category Helpers */ export declare function getAssetId(name: string): string; /** * Returns the base url to access a CDN asset from its name & version. * It does not imply that the asset exist. * * @param name name of the package (as defined in package.json). * @param version version of the package (as defined in package.json). * @returns base url to access the resource. * @category Helpers */ export declare function getUrlBase(name: string, version: string): string; /** * Return the regular exported symbol name of a library (including API version). * Warning: Valid only for already installed package. * * @param name name of the library * @param version version of the library */ export declare function getRegularFullExportedSymbol(name: string, version: string): string; /** * Return the full exported symbol name of a library (including API version). * Warning: Valid only for already installed package. * * @param name name of the library * @param version version of the library */ export declare function getInstalledFullExportedSymbol(name: string, version: string): string; /** * Return the full (expected) exported symbol name of a library (including API version) * * @param name name of the library * @param version version of the library */ export declare function getExpectedFullExportedSymbol(name: string, version: string): string; /** * Return the API key from a version. * * @param version version (conform to semver) */ export declare function getApiKey(version: string): string; /** * Return the alias (using '#') of full exported symbol name of a library (including API version) * * @param name name of the library * @param version version of the library */ export declare function getFullExportedSymbolAlias(name: string, version: string): string; /** * Install resources using a custom installer. * * @param installer */ export declare function resolveCustomInstaller(installer: CustomInstaller): Promise; export declare function installAliases(aliases: { [key: string]: string | ((Window: any) => unknown); }, executingWindow: WindowOrWorkerGlobalScope): void; export declare function isInstanceOfWindow(scope: WindowOrWorkerGlobalScope): scope is Window; export declare function extractModulesToInstall(modules: LightLibraryWithAliasQueryString[]): string[]; export declare function extractInlinedAliases(modules: LightLibraryWithAliasQueryString[]): {};