-
-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathsettings.ts
More file actions
82 lines (52 loc) · 1.65 KB
/
settings.ts
File metadata and controls
82 lines (52 loc) · 1.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
import { create } from "zustand";
export type AddPageLinkSetting = "off" | "description" | "content";
export type AddTaskAction = "add" | "add-copy-app" | "add-copy-web";
export type DueDateDefaultSetting = "none" | "today" | "tomorrow";
export type TokenStorageSetting = "secrets" | "file";
export type ProjectDefaultSetting = {
projectId: string;
projectName: string;
} | null;
export type LabelsDefaultSetting = Array<{
labelId: string;
labelName: string;
}>;
const defaultSettings: Settings = {
apiTokenSecretId: "swt-todoist-api-token",
tokenStorage: "secrets",
fadeToggle: true,
autoRefreshToggle: false,
autoRefreshInterval: 60,
renderDateIcon: true,
renderProjectIcon: true,
renderLabelsIcon: true,
shouldWrapLinksInParens: false,
addTaskButtonAddsPageLink: "content",
taskCreationDefaultDueDate: "none",
taskCreationDefaultProject: null,
taskCreationDefaultLabels: [],
defaultAddTaskAction: "add",
debugLogging: false,
version: 0,
};
export type Settings = {
apiTokenSecretId: string;
tokenStorage: TokenStorageSetting;
fadeToggle: boolean;
autoRefreshToggle: boolean;
autoRefreshInterval: number;
renderDateIcon: boolean;
renderProjectIcon: boolean;
renderLabelsIcon: boolean;
shouldWrapLinksInParens: boolean;
addTaskButtonAddsPageLink: AddPageLinkSetting;
taskCreationDefaultDueDate: DueDateDefaultSetting;
taskCreationDefaultProject: ProjectDefaultSetting;
taskCreationDefaultLabels: LabelsDefaultSetting;
defaultAddTaskAction: AddTaskAction;
debugLogging: boolean;
version: number;
};
export const useSettingsStore = create<Settings>(() => ({
...defaultSettings,
}));