/// import { CompSceneConfigType } from '../../utils/defineConfig'; import PluginInstance from '../pluginInstance'; import { CompScenePanelType, noop } from '../type'; declare type HooksType = 'finishBefore' | 'finishAfter' | 'prePanelBefore' | 'prePanelAfter' | 'nextPanelBefore' | 'nextPanelAfter' | 'closeBefore' | 'closeAfter'; /** * 组件场景化 */ declare class CompScenePlugin extends PluginInstance { startBefore?: (comName: string) => Promise; /** * 完成后的回掉 */ endAfter?: () => void; /** * 保存面板临时属性。 */ panelData: { [key: string]: Record; }; /** * 存放hooks函数 */ hooksFn: { [key: string]: Record; }; sceneConfigs: Map; InterceptComponent?: React.ComponentClass<{ next: (e?: Record) => void; destroy: () => void; wrapRef?: React.RefObject; }> | React.FunctionComponent<{ next: (e?: Record) => void; destroy: () => void; wrapRef?: React.RefObject; }>; /** * 默认面板 */ defaultActiveKey?: string; /** * 组件场景标题 */ title?: string; /** * 弹窗宽度 */ modalWidth?: string; /** * 是否展示 */ visible: boolean; private setActiveKey; private setShow; private getPanelListFunc?; private getTitle?; refreshPluginComp?: () => void; setConfig: noop | undefined; config?: CompSceneConfigType; /** * 是否处于第一个面板 */ get isLastPanel(): boolean; /** * 是否处于最后一个面板 */ get isFirstPanel(): boolean; /** * 面板列表 */ panelList: CompScenePanelType[]; /** * 当前面板位置 */ activeIndex: number; /** * 初始化配置 * @param param0 */ buildFromConfig({ setActiveKey, setVisible, refreshPluginComp, }: { setActiveKey: (e: string) => void; setVisible: (e: boolean) => void; refreshPluginComp: () => void; }): void; registerAllConfigs(configs: CompSceneConfigType[]): void; registerConfig(config: CompSceneConfigType): void; /** * 初始化 */ private initialze; private reset; /** * 解析用户配置 */ parseConfig(config: CompSceneConfigType): void; setPanelList(opts: any): void; /** * 获取面板 * @param key * @returns */ get(key: string): CompScenePanelType | undefined; /** * 切换到下一个面板 */ next(props: Record): void; /** * 切换到上一个面板 */ pre(): void; /** * 通过面板key获取当前组件属性 */ getPanelPropsByKey(key: string): Record; private setVisible; /** * 场景启动入口 */ start(opts: { platform: 'h5' | 'pc'; compName: string; endAfter?: () => void; }): Promise; /** * 关闭 */ setClose(): void; /** * 设置面板的hooks函数 * @param callback */ setHooks(type: HooksType, callback: noop, key: string): void; get callFinishAfter(): noop; get callFinishBefore(): noop; get callNextPanelBefore(): noop; get callNextPanelAfter(): noop; get callPrePanelBefore(): noop; get callPrePanelAfter(): noop; get callCloseBefore(): noop; get callCloseAfter(): noop; /** * 卸载数据 */ unmount(): void; destroy(): void; } export default CompScenePlugin;