@datafinder/embed-sdk
Version:
Embed SDK for DataFinder
37 lines (36 loc) • 1.14 kB
TypeScript
import * as Comlink from 'comlink';
import { ViewRenderingOptions } from '../types/rendering';
export declare abstract class AbstractViewManager<T = unknown> {
protected _targetNode: HTMLElement;
protected _options: ViewRenderingOptions;
private _iframeElement?;
private _endpoint?;
protected _remote?: Comlink.Remote<T>;
constructor(_targetNode: HTMLElement, _options: ViewRenderingOptions);
/**
* 销毁当前视图
*/
destroy(): void;
get iframe(): HTMLIFrameElement | undefined;
/**
* 暴露一个命名方法
*/
exposeFunction(funcName: string, func?: Function): void;
/**
* 返回当前视图的 URL Path
*/
protected abstract getViewPath(): string;
/**
* 返回当前视图的 URL SearchParams
*/
protected abstract getViewSearchParams(): Record<string, string | null | undefined> | null;
/**
* 创建一个渲染 DataFinder 页面的 IFrame
*/
private _createIframe;
private _getIFrameURL;
/**
* 返回当前视图的 URL Origin
*/
private _getIFrameOrigin;
}