forked from Pong420/google-tasks-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.d.ts
53 lines (48 loc) · 1.33 KB
/
common.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
type Theme = 'light' | 'dark';
type AccentColor = 'red' | 'blue' | 'amber' | 'green' | 'purple' | 'grey';
type TitleBar = 'native' | 'frameless';
interface Schema$Storage<T> {
get(): T;
save(value: NonNullable<T>): void;
}
interface OAuthKeys {
installed: {
client_id: string;
project_id: string;
auth_uri: string;
token_uri: string;
client_secret: string;
redirect_uris: string[];
};
}
interface SyncConfig {
enabled: boolean;
reconnection: boolean;
inactiveHours: number;
}
type Schema$Preferences = {
accentColor: AccentColor;
maxTasks: number;
sync: SyncConfig;
theme: Theme;
titleBar: TitleBar;
};
declare interface Window {
__setTheme(theme?: Theme): void;
__setAccentColor(color?: AccentColor): void;
__setTitleBar(titleBar?: TitleBar, shouldRelaunch?: boolean): void;
platform: NodeJS.Platform;
openExternal: Electron.Shell['openExternal'];
getCurrentWindow(): Electron.BrowserWindow;
oAuth2Storage: Schema$Storage<OAuthKeys | undefined>;
tokenStorage: Schema$Storage<any>;
preferencesStorage: Schema$Storage<Schema$Preferences>;
taskListSortByDateStorage: Schema$Storage<string[]>;
logout: () => void;
TOKEN_PATH: string;
OAUTH2_KEYS_PATH: string;
PREFERENCES_PATH: string;
TASKLIST_SORT_BY_DATE_PATH: string;
STORAGE_DIRECTORY: string;
relaunch: () => void;
}