erp-platform/ui/src/proxy/developerKit/componentInfo.ts

63 lines
1.1 KiB
TypeScript
Raw Normal View History

2025-08-11 06:34:44 +00:00
export interface ComponentInfo {
id: string;
name: string;
type: string;
props: Record<string, any>;
children?: ComponentInfo[] | string;
startLine: number;
endLine: number;
startColumn: number;
endColumn: number;
}
export interface PropertyInfo {
name: string;
type:
| "string"
| "boolean"
| "number"
| "function"
| "object"
| "array"
| "select";
value: any;
options?: string[];
description?: string;
category: "properties" | "events" | "styling";
}
export interface HookInfo {
name: string;
type:
| "useState"
| "useRef"
| "useEffect"
| "useCallback"
| "useMemo"
| "useContext";
enabled: boolean;
initialValue?: any;
dependencies?: string[];
}
export interface ComponentDefinition {
name: string;
icon: string;
category: string;
description: string;
properties: PropertyInfo[];
hooks: HookInfo[];
defaultProps?: Record<string, any>;
}
export interface TailwindClass {
category: string;
classes: string[];
}
export interface EditorState {
code: string;
components: ComponentInfo[];
selectedComponentId: string | null;
}