/** * Visual Editor Integration * * Cung cấp các hàm để tích hợp với visual editor */ import { ComponentSchema, GeneratorOptions, RegistryIntegrationOptions } from '../types'; /** * Interface cho EditorState */ export interface EditorState { getComponent: (componentId: string) => any; selectedComps: () => Record; } /** * Class tích hợp với visual editor */ export declare class VisualEditorIntegration { private editorState; /** * Khởi tạo một instance tích hợp với visual editor * * @param editorState EditorState */ constructor(editorState: EditorState); /** * Export component schema từ component trong editor * * @param componentId ID của component * @returns Promise */ exportComponentSchema(componentId: string): Promise; /** * Chuyển đổi component từ editor thành schema * * @param component Component từ editor * @returns ComponentSchema */ private convertComponentToSchema; /** * Chuyển đổi component từ editor thành DSL * * @param component Component từ editor * @returns ModuleDSL */ private convertComponentToDSL; /** * Import component từ schema vào editor * * @param schema Component schema * @returns Promise ID của component đã import */ importComponentFromSchema(schema: ComponentSchema): Promise; /** * Tạo và đăng ký component từ component trong editor * * @param componentId ID của component * @param options Các tùy chọn cho generator * @param registryOptions Các tùy chọn cho registry * @param registerComp Hàm đăng ký component * @param fs FileSystem * @param path Path * @returns Promise */ generateAndRegisterComponent(componentId: string, options: GeneratorOptions, registryOptions: RegistryIntegrationOptions, registerComp: any, fs: any, path: any): Promise; }