-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.ts
More file actions
69 lines (59 loc) · 1.33 KB
/
schema.ts
File metadata and controls
69 lines (59 loc) · 1.33 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
export type Identifier = {
uid: string;
};
export type Enum = {
advanced: boolean;
choices: Array<{ value: string }>;
};
export type FieldOptions = {
display_name: string;
data_type: string;
mandatory: boolean;
description: string;
unique: boolean;
multiple: boolean;
non_localizable: boolean;
max_instance: boolean | undefined;
display_type: string;
config?: Record<string, any>;
field_metadata?: Record<string, any>;
} & Identifier;
export type Block = {
title: string;
schema: Schema;
reference_to?: string;
} & Identifier;
export type GlobalField = {
reference_to: string;
schema: Schema;
schema_type?: string;
_version?: number;
referred_content_types: Array<{ uid: string; title: string }>;
} & FieldOptions;
export type ReferenceField = {
reference_to: string | string[];
} & FieldOptions;
export type GroupField = {
schema: Schema;
} & FieldOptions;
export type EnumField = {
enum: Enum;
} & FieldOptions;
export type BlockField = {
blocks: Block[];
} & FieldOptions;
export type Field = GlobalField &
ReferenceField &
GroupField &
EnumField &
BlockField;
export type Schema = Array<Field>;
export type ContentType = {
description: string;
schema: Schema;
_version: number;
reference_to?: string;
data_type?: string;
schema_type?: string;
title?: string;
} & Identifier;