-
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathscreens-config.ts
More file actions
42 lines (35 loc) · 1.3 KB
/
Copy pathscreens-config.ts
File metadata and controls
42 lines (35 loc) · 1.3 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
import { Type, Static } from '@sinclair/typebox';
import { ButtonConfigSchema } from './buttons-config';
export const InlineButtonConfigSchema = Type.Intersect([
ButtonConfigSchema,
Type.Object({
id: Type.String(),
}),
]);
export type InlineButtonConfig = Static<typeof InlineButtonConfigSchema>;
export const VideoConfigSchema = Type.Object({
muted: Type.Optional(Type.Boolean()),
loop: Type.Optional(Type.Boolean()),
});
export type VideoConfig = Static<typeof VideoConfigSchema>;
export const ScreenConfigSchema = Type.Object({
background: Type.String(),
video: Type.Optional(VideoConfigSchema),
buttons: Type.Optional(
Type.Array(Type.Union([Type.String(), InlineButtonConfigSchema])),
),
});
export type ScreenConfig = Static<typeof ScreenConfigSchema>;
export const ScreensListSchema = Type.Record(Type.String(), ScreenConfigSchema);
export type ScreensList = Static<typeof ScreensListSchema>;
export const ScreensConfigSchema = Type.Object({
screens: ScreensListSchema,
});
export type ScreensConfig = Static<typeof ScreensConfigSchema>;
export const ScreensInputConfigSchema = Type.Object({
screens: Type.Optional(ScreensListSchema),
});
export type ScreensInputConfig = Static<typeof ScreensInputConfigSchema>;
export const defaultScreensConfig: ScreensConfig = {
screens: {},
};