62 lines
1.1 KiB
TypeScript
62 lines
1.1 KiB
TypeScript
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;
|
|
}
|