import { Events, ScriptingObjectTypes } from '@elliemae/pui-scripting-object'; import { Logger } from '@elliemae/pui-diagnostics'; import type { EventListeners, GuestContext, SubscribeParam, UnsubscribeParam } from '@elliemae/microfe-common'; import { ScriptingObjectManager, ScriptingObjects } from '@elliemae/microfe-common'; import { EventManager } from './eventManager.js'; import { IMicroFEHost, AppWindowSize } from './typings/host.js'; /** * Constructor parameters for the host application */ export type CMicroFEHostParams = { /** * unique id of the iframe container */ containerId?: string; /** * unique id of the guest application */ guest: GuestContext; /** * release version of the host application */ version?: string; /** * instance of pui diagnostics logger */ logger: Logger; /** * instance of scripting object manager */ soManager: ScriptingObjectManager; /** * instance of event manager */ eventManager: EventManager; }; /** * Represents a host micro frontend application * @typeParam AppObjects - scripting objects that are published by the host application * @typeParam AppEvents - events that are published by the host application */ export declare class CMicroFEHost, AppEvents extends EventListeners = Events> implements IMicroFEHost { #private; /** * Create new instance of the host frontend application * @param {CMicroFEHostParams} params - constructor parameters */ constructor(params: CMicroFEHostParams); /** * application release version * @returns release version */ get version(): string; /** * Get reference to the scripting object (or proxy) by name * @param name unique name of the scripting object * @param objectId * @returns scripting object reference */ getObject: >(objectId: ObjectId) => Promise; /** * set the size of the guest application iframe window * @param {AppWindowSize} appSize window size of the application */ setAppWindowSize: (appSize: AppWindowSize) => void; /** * add listener to the scripting object event * @param {SubscribeParam} params - parameters to add event listener * @returns subscription id */ subscribe: >(params: SubscribeParam) => string; /** * removes listener from the scripting object event * @param {UnsubscribeParam} params - parameters to remove event listener */ unsubscribe: >(params: UnsubscribeParam) => void; }