diff --git a/services/frontend/src/types/index.ts b/services/frontend/src/types/index.ts index d143a63..1db610b 100644 --- a/services/frontend/src/types/index.ts +++ b/services/frontend/src/types/index.ts @@ -527,3 +527,51 @@ export interface ITabContext { export interface ISuperFormContext { types: Record; } + +export interface IFormField { + id: string; + type: "group" | "text" | "integer" | "toggle" | "accordion" | "records"; +} + +export interface IGroupField { + fields: IFormField[]; +} + +export interface IValueField extends IFormField { + name: string; +} + +export interface ISingleRowField extends IValueField { + help?: string; +} + +export interface ITextField extends ISingleRowField { + type: "text"; + label: string; + required: boolean; +} + +export interface IIntegerField extends ISingleRowField { + type: "integer"; + label: string; + required: boolean; +} + +export interface IToggleField extends ISingleRowField { + type: "toggle"; + label: string; + options: { + text: string; + value: string; + }[]; +} + +export interface IRecordsField extends IValueField { + defaultOpen?: boolean; + fields: (index: number) => IFormField[]; + newValue: any; +} + +export interface IAccordionField extends IFormField { + title: string; +}