@readium/navigator-html-injectables
Version:
An embeddable solution for connecting frames of HTML publications with a Readium Navigator
34 lines (33 loc) • 966 B
TypeScript
import { ReadiumWindow } from "./helpers/dom";
import { ModuleName } from "./modules";
/**
* The Module loader. Handles initialization of the HTML injectables
* in the target Window, which could be an IFrame, or the current window).
*/
export declare class Loader<T extends string = ModuleName> {
private loadedModules;
private readonly wnd;
private readonly comms;
/**
* @param wnd Window instance to operate on
* @param initialModules List of initial modules to load
*/
constructor(wnd?: ReadiumWindow, initialModules?: string[]);
private loadModule;
/**
* Add a module by name
* @param moduleName Module name
* @returns Success
*/
addModule(moduleName: T): boolean;
/**
* Remove a module by name
* @param moduleName Module name
* @returns Success
*/
removeModule(moduleName: T): boolean;
/**
* Unmount and remove all modules
*/
destroy(): void;
}