-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
156 lines (141 loc) · 2.84 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import {PodiumClientResource} from "@podium/client";
export interface Options {
/**
* Name of the layout
*/
layoutName: string;
/**
* Port for the layout service.
*/
layoutPort: number;
/**
* Base path of the layout service.
*/
layoutPathName: string;
/**
* Determent if we run in development mode or not.
*/
isDevelopment?: boolean;
/**
* Logging level of the layout service.
*/
loggingLevel?: string;
/**
* Podium layout debugging.
*/
layoutDebug?: boolean;
}
export class DefaultOptions implements Options {
/**
* @param layoutName Name that the layout identifies itself by
* @param basePath Pathname of where a layout is mounted in an HTTP server
*/
constructor(layoutName: string, basePath?: string) {
this.layoutName = layoutName;
if (basePath) {
this.layoutPathName = basePath;
}
}
/**
* @default false
*/
isDevelopment = false;
/**
* @default false
*/
layoutDebug = false;
/**
*
*/
layoutName: string;
/**
* @default /
*/
layoutPathName = '/';
/**
* @default 7000
*/
layoutPort = 3000;
/**
* @default info
*/
loggingLevel = 'info';
/**
* @default ./pods.json
*/
//podsFile = './pods.json';
}
/**
*
*/
export interface LayoutConfiguration {
name: string;
basePath: string;
appBarMenuMainLayout: AppBarMenuMainLayout
}
/**
* Represents a AppBar, Menu, Main/features layout.
* @example
* ```json
* {
* "appbar": {
* "name": "fint-kontroll-appbar-pod",
* "uri": "http://fint-kontroll-appbar-pod:7100/manifest.json"
* },
* "menu": {
* "name": "fint-kontroll-menu-pod",
* "uri": "http://fint-kontroll-appbar-pod:7100/manifest.json"
* },
* "main": [
* {
* "name": "fint-kontroll-groups-pod",
* "uri": "http://fint-kontroll-groups-pod:7100/manifest.json"
* }
* ]
* }
* ```
*/
export interface AppBarMenuMainLayout {
/**
* The AppBar {@link Pod}
*/
appbar: Pod;
/**
* The Menu {@link Pod}
*/
menu: Pod;
/**
* A list of main/feature {@link Pod}s
*/
main: Pod[];
}
/**
* Represents a podlet.
* @example
* ```json
* {
* "name": "fint-kontroll-groups-pod",
* "uri": "http://fint-kontroll-groups-pod:7100/manifest.json",
* "title": "Grupper"
* }
* ```
*/
export interface Pod {
/**
* Name of the pod. Need to be the same as the `id` of the podlet.
*/
name: string;
/**
* Url of the manifest for the pod.
*/
uri: string;
/**
* Title to be shown in the browser.
*/
title?: string;
path: string;
}
export interface MainPodClientResource {
pod: Pod;
resource: PodiumClientResource
}