UNPKG

umd-package-loader

Version:

umd 包加载器

47 lines (46 loc) 1.02 kB
interface LoaderProps { url: string; name: string; context?: globalThis.Window; } declare class BaseLoader { name: string; url: string; options: LoaderProps; timestamp: number; noCache: boolean; contextWindow: Window; constructor(props: LoaderProps); /** * @private 根据协议标准,获取library */ private resolveName; /** * @private 根据协议标准,获取url */ private resolveURL; /** * @private * @param {string} url * @returns {string} 处理后的url */ private shouldApplyLocalCache; /** * @private 获取缓存 */ private getCache; /** * @private 设置缓存 */ private setCache; /** * @public 清除本地缓存与文件缓存,使用timestamp的方式 */ clearCache: () => void; private createNode; /** * @public 加载微应用 */ loadScript: (config?: Record<string, any>) => Promise<any>; } export default BaseLoader;