import { FormInstance } from "antd"; interface DependencyStrategy { when: string[]; keepFields: string[]; } interface EffectConfig { dependencies: string[]; handler: string; params: Record; updateStrategy?: DependencyStrategy; priority?: number; } export interface Meta { setters: { props: SetterConfig[]; layout: setterLayout[]; }; defaultValues: { props: Record; }; transforms?: Record) => any; }>; datasource?: Record; dependencyAnalysis?: { strict?: boolean; warnCycles?: boolean; }; } export interface OperationHandlers { handleClone: (key: string) => void; handleDelete: (itemName: string) => void; handleVisibility: (itemName: string) => void; } export interface OperationConfig { key?: string; tooltip?: string; targetPath?: string; } export interface Operations { actions?: { clone?: OperationConfig; delete?: OperationConfig; visibility?: OperationConfig; }; } export interface UpdatePayload { type: "setValue" | "setMeta" | "updateValue"; data: any; } export interface OperationContext { meta: Meta; form: FormInstance; selectedPath: string | null; setSelectedPath: (path: string | null) => void; onChange?: (payload: UpdatePayload) => void; } export interface CompositeField { name: string; title: string; fields: Field[]; operations?: Operations; } export type Field = string | CompositeField; interface OperationAction { tooltip: string; targetPath?: string; } export interface Operations { actions: { clone?: OperationAction; visibility?: OperationAction; delete?: OperationAction; }; } type JsonLogicVar = { var: string; }; type JsonLogicConst = { const: any; }; type JsonLogicOperation = { [key: string]: any[]; }; type JsonLogicValue = JsonLogicVar | JsonLogicConst | JsonLogicOperation; interface UpdateStrategy { when: string[]; keepFields: string[]; } interface EffectConfig { dependencies: string[]; handler: string; params: Record; updateStrategy?: UpdateStrategy; } type VisibilityCondition = JsonLogicOperation; interface OptionsMapping { source: string; dependency: string; transform?: { map: [JsonLogicValue, Record]; }; } export interface Option { label: string; value: string | number; } export interface SetterConfig { name: string; title: string; setter: "string" | "number" | "boolean" | "select" | "json" | "colorPicker" | "color"; options?: Option[] | { mapping: OptionsMapping; }; min?: number; max?: number; step?: number; priority?: number; effects?: EffectConfig; visible?: VisibilityCondition; } export interface CompositeField { name: string; title: string; fields: Field[]; operations?: Operations; } type FormLayout = "horizontal" | "vertical" | "inline"; type LabelAlign = "left" | "right"; interface FormItemLayout { labelCol?: { span?: number; offset?: number; }; wrapperCol?: { span?: number; offset?: number; }; } interface LayoutItem { name: string; title: string; fields: Field[]; operations?: Operations; } export interface setterLayout { name: string; title: string; items: LayoutItem[]; formLayout?: { layout?: FormLayout; labelAlign?: LabelAlign; labelWidth?: number; labelCol?: FormItemLayout["labelCol"]; wrapperCol?: FormItemLayout["wrapperCol"]; colon?: boolean; requiredMark?: boolean | "optional"; }; } export interface SetterProps { config: SetterConfig; value: any; onChange: (value: any) => void; } export interface PropertyPanelProps { meta: Meta; onChange?: (payload: UpdatePayload) => void; theme?: 'dark' | 'light'; config?: { defaultActiveTab?: number; allowMultipleExpand?: boolean; showOperations?: boolean; showTooltips?: boolean; autoSelectOnHover?: boolean; validateOnChange?: boolean; debounceTime?: number; }; } export {};