forked from Mumble-SRL/MBurger-JS-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mburger.d.ts
72 lines (63 loc) · 1.67 KB
/
mburger.d.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
*
* MBurger Types Declaration
*
*/
// Commons
export interface ListMetaInterface {
from: number;
to: number;
total: number;
}
export interface ErrorInterface {
message: string;
errors?: [];
}
export interface AddressValueInterface {
address: string;
distance?: number;
latitude: number;
longitude: number;
}
export interface FileInterface {
file_name: string;
id: number;
mime_type: string;
size: number;
url: string;
}
export interface DocumentValueInterface extends FileInterface {}
export interface ImageValueInterface extends FileInterface {}
// Elements
export interface BaseElementInterface<Value> {
id: number;
locale: string;
name: string;
options: [];
order: number;
type: string;
value: Value;
}
export interface AddressElementInterface extends BaseElementInterface<AddressValueInterface> {}
export interface TextElementInterface extends BaseElementInterface<string> {}
export interface CheckboxElementInterface extends BaseElementInterface<boolean> {}
export interface DocumentElementInterface extends BaseElementInterface<DocumentValueInterface[]> {}
export interface ImageElementInterface extends BaseElementInterface<[ImageValueInterface]> {}
export interface TextAreaElementInterface extends BaseElementInterface<string> {}
export interface SlugElementInterface extends BaseElementInterface<string> {}
// Sections
export interface SectionInterface<Elements> {
all_locales: boolean;
available_at: number;
elements: Elements;
id: number;
in_evidence: boolean;
order: number;
updated_at: number;
visible: number;
}
// Responses
export interface ListResponseInterface<Item> {
items: Item[];
meta: ListMetaInterface;
}