@standard-forms/cdk
Version:
Interfaces, types and classes utilities for @standard-forms.
36 lines (26 loc) • 714 B
text/typescript
import { FormItem } from './FormItem';
export interface FormItemSize {
xs: number;
sm: number;
md: number;
lg: number;
xl: number;
}
export type FormValue = Record<string, any>;
export type FormValueWatcher = (value: any) => void;
export type FormItemsObject = Record<string, FormItem>;
export type FormLayout = LayoutItem[][];
export interface FormValidator {
name: string;
fn: (formFields: FormItemsObject) => string;
}
export type FormErrors = Record<string, string>;
export type FormValidationWatcher = (isValid: boolean) => void;
export interface LayoutItem {
size: FormItemSize;
item: FormItem;
}
export interface FormProps {
layout: FormLayout,
validators?: FormValidator[]
}