summaryrefslogtreecommitdiff
path: root/src/client/scripts/form.ts
blob: 7bf6cec452028da3f52656bfeb2261dec36ea602 (plain)
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
export type FormItem = {
	label?: string;
	type: 'string';
	default: string | null;
	hidden?: boolean;
	multiline?: boolean;
} | {
	label?: string;
	type: 'number';
	default: number | null;
	hidden?: boolean;
	step?: number;
} | {
	label?: string;
	type: 'boolean';
	default: boolean | null;
	hidden?: boolean;
} | {
	label?: string;
	type: 'enum';
	default: string | null;
	hidden?: boolean;
	enum: string[];
} | {
	label?: string;
	type: 'array';
	default: unknown[] | null;
	hidden?: boolean;
};

export type Form = Record<string, FormItem>;