import React from 'react'; import { DSLQuery } from '@lingxiteam/dsl'; import { LcdpPlatformKey } from '../../interfaces/types'; interface SimulatorRenderOptions { isMobile: boolean; platformType: LcdpPlatformKey; canDrag: boolean; editorType: 'scene'; disabledDnd?: boolean; getEdEngineApi: (compName: string, platform: 'pc' | 'mobile') => any; } interface SimulatorAdapterOptions { ContainerDropBox: React.FunctionComponent; LabelDropBox: React.FunctionComponent; PageDragBox: React.FunctionComponent; } declare class SimulatorRender { readonly opts: SimulatorRenderOptions; width: string; height: string; name: string; private DSLCore?; private adapter?; constructor(opts: SimulatorRenderOptions); setDSLCore(core: DSLQuery): void; setAdapter(adapter: SimulatorAdapterOptions): void; /** * 挂载主题 */ private mountTheme; /** * 挂载资源 */ private monutAssets; /** * 挂载 */ mount(): void; /** * 重置画布适合的样式 * @param c */ private resetStyle; /** * 兼容旧版本 */ private compatibleOldVersion; /** * 获取组件属性 */ private getComponentProps; private parseBeforeContext; /** * 渲染组件 * @param param0 * @returns */ private render; /** * 通过DSL渲染组件 * @param ids * @param DSLCore */ renderComponentByDSLCore: (ids?: string[]) => React.ReactNode; /** * 通过JSON渲染画布 * @param components */ renderComponentByJSON: (components: any[]) => React.ReactNode; } export default SimulatorRender;