-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
schema.ts
36 lines (29 loc) · 798 Bytes
/
schema.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
import type { SupportedDataTypes } from "./data_types.ts";
type PropertyType = keyof SupportedDataTypes;
export type PropertyPrototype = {
"@id": string;
"@type"?: PropertyType;
"@context"?: SchemaPrototype;
"@optional"?: true;
"@array"?: true;
"@multilang"?: true;
};
export type SchemaPrototypeProperties = {
[key: string]: PropertyPrototype | string | readonly string[];
};
export type SchemaPrototypeType = {
"@type": string | readonly string[];
};
export type SchemaPrototype = SchemaPrototypeProperties & SchemaPrototypeType;
export type Property = {
"@id": string;
"@type"?: PropertyType;
"@context"?: Schema;
"@optional"?: true;
"@array"?: true;
"@multilang"?: true;
};
export type Schema = {
[key: string]: Property | string[];
"@type": string[];
};