/** * UICompBuilder Adapter * * Cung cấp các hàm để chuyển đổi từ component schema sang UICompBuilder */ import { ComponentSchema } from '../types'; export interface UICompBuilder { setPropertyViewFn: (fn: any) => UICompBuilder; setExposeStateConfigs: (configs: any[]) => UICompBuilder; setExposeMethodConfigs: (configs: any[]) => UICompBuilder; build: () => any; } export interface NameConfig { new (name: string, desc?: any): any; } export interface ViewFnTypeForComp { (props: any, dispatch: any): ViewReturn; } export interface PropertyViewFnTypeForComp { (children: any, dispatch: any): any; } export interface ExposingConfig { name: string; desc: any; depsFn: (comp: T) => any; } export interface MethodConfigsType { method: { name: string; description?: string; params?: Array<{ name: string; type: string; }>; }; execute: (comp: T, params: any[]) => any; } /** * Chuyển đổi component schema thành UICompBuilder * * @param schema Component schema * @param uiCompBuilder UICompBuilder constructor * @param nameConfig NameConfig constructor * @returns UICompBuilder instance */ export declare function schemaToUICompBuilder(schema: ComponentSchema, uiCompBuilder: new (childrenMap: any, viewFn: any) => UICompBuilder, nameConfig: NameConfig): UICompBuilder; /** * Tạo childrenMap từ schema * * @param schema Component schema * @returns Record */ export declare function createChildrenMap(schema: ComponentSchema): Record; /** * Tạo view function từ schema * * @param schema Component schema * @returns ViewFnTypeForComp */ export declare function createViewFunction(schema: ComponentSchema): ViewFnTypeForComp; /** * Tạo property view function từ schema * * @param schema Component schema * @returns PropertyViewFnTypeForComp */ export declare function createPropertyViewFunction(schema: ComponentSchema): PropertyViewFnTypeForComp; /** * Tạo expose state configs từ schema * * @param schema Component schema * @param nameConfig NameConfig constructor * @returns ExposingConfig[] */ export declare function createExposeStateConfigs(schema: ComponentSchema, nameConfig: NameConfig): ExposingConfig[]; /** * Tạo expose method configs từ schema * * @param schema Component schema * @returns MethodConfigsType[] */ export declare function createExposeMethodConfigs(schema: ComponentSchema): MethodConfigsType[];