import React from "react"; import { ComponentData, PropertyTransform, TransformProperty, IComponentParser } from "./parser"; import { ComponentTypes } from "maishu-jueying/type"; type ParserRuntimeContext = { args: Record; refs: Record; }; export declare const defaultPropertyTransforms: Record; /** * 通过枚举组件类型解析生成组件 * 解析组件数据,通过 React React 组件 * */ export declare class ComponentParser implements IComponentParser { private types; private propertyTransforms; private runtimeContext; private globalThis; constructor(types: ComponentTypes, globalRuntimeScope?: Record); private getGlobalRuntimeScope; private exposeRefToGlobal; ensureNamedRef(refName: string, refs: Record): any; parse(componentData: ComponentData, args?: Record): React.ReactNode; /** * 读取根组件(Page)props.importedModules 并按 URL 动态加载, * 返回以 alias || name 为键的模块映射,可并入 args(componentImports)注入运行作用域。 */ loadImportedModules(componentData: ComponentData): Promise>; parseWithRuntimeContext(componentData: ComponentData, runtimeContext: ParserRuntimeContext): React.ReactNode; processTransformProperties(componentData: ComponentData): ComponentData; transformProperty(transformProperty: TransformProperty, runtimeContext?: ParserRuntimeContext): any; /** * 查找组件类型,支持大小写不敏感匹配 */ private findComponentType; private resolveElementType; private parsePropValue; private _parse; } export declare function parseComponent(componentData: ComponentData, componentTypes: Record>, args?: Record): React.ReactNode; export declare function getRefNames(obj: any): string[]; export declare function searchComponentTypes(obj: any, componentTypes: ComponentTypes): ComponentTypes; export declare function propsTraval(target: any, callback: (body: any, key: string, value: any) => any): any; export {};