import { CSSProperties } from "react"; import { SemanticSIZES } from "semantic-ui-react"; import { PlainTableActions } from "./lib/PlainTable/interfaces"; export interface CrudColumn { name: keyof T; inputType?: 'string' | 'boolean' | 'number' | 'date' | 'multilinestring'; optional?: boolean; label?: string; inline?: boolean; skipList?: boolean; skipForm?: boolean; customControl?: FieldControl; listRenderer?: (item: T, props: PlainTableActions) => string | JSX.Element; style?: CSSProperties; fluid?: boolean; className?: string; size?: SemanticSIZES; } export interface FormEditorRenderProps { EditorCompo: any; ErrorCompo: any; FieldControls: JSX.Element[]; item: T | undefined; } export interface CrudEditorRenderProps { MenuCompo: any; FormEditorCompo: any; item: T | undefined; } export interface FormEditorConfiguration { columns: Array>; key: keyof T; validation?: (item: T, setError: (key: keyof T, value: string) => void) => void; formEditorRender?: (props: FormEditorRenderProps) => JSX.Element; debug?: boolean; } export interface CrudConfig extends FormEditorConfiguration { path: string; skipList?: boolean; skipForm?: boolean; hideSwitchModeToggle?: boolean; preventAddNew?: boolean; listItems?: (options: { filter: string; pageIndex?: number; pageSize?: number; sortKeys?: Array<{ field: string; desc: boolean; }>; }) => Promise; getNewItem?: () => Promise; getItemById?: (id: string) => Promise; updateItem?: (id: string, item: Partial) => Promise; insertItem?: (item: T) => Promise; deleteItemById?: (id: string) => Promise; crudEditorRender?: (props: CrudEditorRenderProps) => JSX.Element; } export interface FieldProps { value: T | undefined; onChange: (value: T | undefined, error?: any) => void; onSetError: (error: string) => void; dirty?: boolean; style?: CSSProperties; fluid?: boolean; className?: string; size?: SemanticSIZES; } export declare type FieldControl = (props: FieldProps) => JSX.Element;