forked from ajnart/homarr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.ts
87 lines (72 loc) · 2.3 KB
/
settings.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
import { MantineTheme } from '@mantine/core';
export interface SettingsType {
common: CommonSettingsType;
customization: CustomizationSettingsType;
access: BoardAccessSettingsType;
}
export interface BoardAccessSettingsType {
allowGuests: boolean;
}
export interface CommonSettingsType {
searchEngine: SearchEngineCommonSettingsType;
}
export type SearchEngineCommonSettingsType =
| CommonSearchEngineCommonSettingsType
| CustomSearchEngineCommonSettingsType;
export interface CommonSearchEngineCommonSettingsType extends BaseSearchEngineType {
type: 'google' | 'duckDuckGo' | 'bing';
}
interface CustomSearchEngineCommonSettingsType extends BaseSearchEngineType {
type: 'custom';
properties: {
template: string;
openInNewTab: boolean;
enabled: boolean;
};
}
interface BaseSearchEngineType {
properties: {
openInNewTab: boolean;
enabled: boolean;
};
}
export interface CustomizationSettingsType {
layout: LayoutCustomizationSettingsType;
pageTitle?: string;
metaTitle?: string;
logoImageUrl?: string;
faviconUrl?: string;
backgroundImageUrl?: string;
backgroundImageAttachment?: typeof BackgroundImageAttachment[number];
backgroundImageSize?: typeof BackgroundImageSize[number];
backgroundImageRepeat?: typeof BackgroundImageRepeat[number];
customCss?: string;
colors: ColorsCustomizationSettingsType;
appOpacity?: number;
gridstack?: GridstackSettingsType;
accessibility: AccessibilitySettings;
}
export const BackgroundImageAttachment = ['fixed', 'scroll'] as const;
export const BackgroundImageSize = ['cover', 'contain'] as const;
export const BackgroundImageRepeat = ['no-repeat', 'repeat', 'repeat-x', 'repeat-y'] as const;
export interface AccessibilitySettings {
disablePingPulse: boolean;
replacePingDotsWithIcons: boolean;
}
export interface GridstackSettingsType {
columnCountSmall: number; // default: 3
columnCountMedium: number; // default: 6
columnCountLarge: number; // default: 12
}
interface LayoutCustomizationSettingsType {
enabledLeftSidebar: boolean;
enabledRightSidebar: boolean;
enabledDocker: boolean;
enabledPing: boolean;
enabledSearchbar: boolean;
}
interface ColorsCustomizationSettingsType {
primary?: MantineTheme['primaryColor'];
secondary?: MantineTheme['primaryColor'];
shade?: MantineTheme['primaryShade'];
}