import { type ServiceScope } from '@microsoft/sp-core-library'; import type { IClientSideComponentManifest } from '@microsoft/sp-module-interfaces'; import type { ILoadScriptOptions } from '../../interfaces/ILoadScriptOptions'; import type { IModuleLoader } from '../interfaces/IModuleLoader'; export interface IPreloadedDefineArgs { id: string; deps: string[]; f: () => void; } export type IWindowWithRequireJs = Window & typeof globalThis & { requirejs: Require | undefined; require: Require | undefined; define: RequireDefine | undefined; /** * Global that's defined from the server when loading SPFx on IE. This enables executing the scripts using a mock * define() function that stores its parameters. * To be used when configuring a component to ensure that RequireJS handles it properly. */ __spfxPreloadedModules?: { [id: string]: IPreloadedDefineArgs; }; }; /** * RequireJS Loader */ export declare class RequireLoader implements IModuleLoader { private _requireJs; private _define; private _configurator; private _moduleLoads; private _loadComponentExecutor; private _systemJsFallbackLoader; private readonly _serviceScope; private readonly _useSecondaryCdn; constructor(serviceScope: ServiceScope, useSecondaryCdn: boolean); /** * {@inheritdoc IModuleLoader.delete} */ delete(manifest: IClientSideComponentManifest): void; /** * {@inheritdoc IModuleLoader.ensure} */ ensure(moduleName: string, module: unknown): void; /** * {@inheritdoc IModuleLoader.loadComponent} */ loadComponent(manifest: IClientSideComponentManifest): Promise; /** * {@inheritdoc IModuleLoader.loadEntryPoint} */ loadEntryPoint(manifest: IClientSideComponentManifest, name?: string, globalName?: string): Promise; /** * {@inheritdoc IModuleLoader.loadScript} */ loadScript(url: string, options?: ILoadScriptOptions): Promise; /** * {@inheritdoc IModuleLoader.load} */ load(moduleName: string, globalName?: string): Promise; private _loadComponent; private _ensureFallback; /** * Looks at the path to see if it is a provider hosted app. If it is, it modifies the existing * module name to match the provider hosted app js module name and then loads the component. If * its not that case it looks at the registry of RequireJS to find another version of the same * component as moduleName, if found, it configures RequireJS with the same dependency resolution * (that comes from the manifest) and ensuring that the path points only to the found version, * and it loads the component. */ private _loadWithDifferentModuleId; private _require; } //# sourceMappingURL=RequireLoader.d.ts.map