forked from darkreader/darkreader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefinitions.d.ts
More file actions
161 lines (145 loc) · 3.65 KB
/
Copy pathdefinitions.d.ts
File metadata and controls
161 lines (145 loc) · 3.65 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
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
157
158
159
160
161
import {FilterMode} from './generators/css-filter';
export interface ExtensionData {
isEnabled: boolean;
isReady: boolean;
settings: UserSettings;
fonts: string[];
news: News[];
shortcuts: Shortcuts;
devtools: {
dynamicFixesText: string;
filterFixesText: string;
staticThemesText: string;
hasCustomDynamicFixes: boolean;
hasCustomFilterFixes: boolean;
hasCustomStaticFixes: boolean;
};
}
export interface ExtensionActions {
changeSettings(settings: Partial<UserSettings>);
setTheme(theme: Partial<FilterConfig>);
setShortcut(command: string, shortcut: string);
toggleURL(url: string);
markNewsAsRead(ids: string[]);
applyDevDynamicThemeFixes(text: string): Promise<void>;
resetDevDynamicThemeFixes();
applyDevInversionFixes(text: string): Promise<void>;
resetDevInversionFixes();
applyDevStaticThemes(text: string): Promise<void>;
resetDevStaticThemes();
}
export interface ExtWrapper {
data: ExtensionData;
actions: ExtensionActions;
}
export interface FilterConfig {
mode: FilterMode;
brightness: number;
contrast: number;
grayscale: number;
sepia: number;
useFont: boolean;
fontFamily: string;
textStroke: number;
engine: string;
stylesheet: string;
darkSchemeBackgroundColor: string;
darkSchemeTextColor: string;
lightSchemeBackgroundColor: string;
lightSchemeTextColor: string;
scrollbarColor: '' | 'auto' | string;
selectionColor: '' | 'auto' | string;
}
export type Theme = FilterConfig;
export interface CustomSiteConfig {
url: string[];
theme: FilterConfig;
}
export interface UserSettings {
enabled: boolean;
theme: FilterConfig;
customThemes: CustomSiteConfig[];
siteList: string[];
siteListEnabled: string[];
applyToListedOnly: boolean;
changeBrowserTheme: boolean;
notifyOfNews: boolean;
syncSettings: boolean;
automation: '' | 'time' | 'system' | 'location';
time: TimeSettings;
location: LocationSettings;
previewNewDesign: boolean;
enableForPDF: boolean;
}
export interface TimeSettings {
activation: string;
deactivation: string;
}
export interface LocationSettings {
latitude: number;
longitude: number;
}
export interface TabInfo {
url: string;
isProtected: boolean;
isInDarkList: boolean;
}
export interface Message {
type: string;
data?: any;
id?: any;
error?: any;
}
export interface Shortcuts {
[name: string]: string;
}
export interface DynamicThemeFix {
url: string[];
ignoreInlineStyle: string[];
invert: string[];
css: string;
}
export interface InversionFix {
url: string[];
invert: string[];
noinvert: string[];
removebg: string[];
css: string;
}
export interface StaticTheme {
url: string[];
neutralBg?: string[];
neutralBgActive?: string[];
neutralText?: string[];
neutralTextActive?: string[];
neutralBorder?: string[];
redBg?: string[];
redBgActive?: string[];
redText?: string[];
redTextActive?: string[];
redBorder?: string[];
greenBg?: string[];
greenBgActive?: string[];
greenText?: string[];
greenTextActive?: string[];
greenBorder?: string[];
blueBg?: string[];
blueBgActive?: string[];
blueText?: string[];
blueTextActive?: string[];
blueBorder?: string[];
fadeBg?: string[];
fadeText?: string[];
transparentBg?: string[];
noImage?: string[];
invert?: string[];
noCommon?: boolean;
}
export interface News {
id: string;
date: string;
url: string;
headline: string;
important: boolean;
read?: boolean;
}