-
-
Notifications
You must be signed in to change notification settings - Fork 159
/
types.ts
49 lines (44 loc) · 1.1 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 }
export interface EditorColumn {
id: string
content: string
width: number // 1-12 representing tailwind grid columns
}
export interface EditorBlock {
id: string
type: 'text' | 'heading' | 'checkbox' | 'columns'
content: string
columns?: EditorColumn[]
}
export interface EditorHistoryState {
blocks: EditorBlock[]
timestamp: number
}