forked from hasanharman/form-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
31 lines (29 loc) · 771 Bytes
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import * as Locales from 'date-fns/locale'
// Define the FormField type
export type FormFieldType = {
type: string
variant: string
name: string
label: string
placeholder?: string
description?: string
disabled: boolean
value: string | boolean | Date | number | string[]
setValue: (value: string | boolean) => void
checked: boolean
onChange: (
value: string | string[] | boolean | Date | number | number[],
) => void
onSelect: (
value: string | string[] | boolean | Date | number | number[],
) => void
rowIndex: number
required?: boolean
min?: number
max?: number
step?: number
locale?: keyof typeof Locales
hour12?: boolean
className?: string
}
export type FieldType = { name: string; isNew: boolean; index?: number }