forked from hplush/slowreader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.ts
More file actions
37 lines (27 loc) · 1.08 KB
/
settings.ts
File metadata and controls
37 lines (27 loc) · 1.08 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
import { persistentAtom, persistentBoolean } from '@nanostores/persistent'
import type { StoreValue } from 'nanostores'
export const userId = persistentAtom<string | undefined>('slowreader:userId')
export const encryptionKey = persistentAtom<string | undefined>(
'slowreader:encryptionKey'
)
export const syncServer = persistentAtom<string | undefined>(
'slowreader:server'
)
export const hasPassword = persistentBoolean('slowreader:has-password')
export type Theme = 'dark' | 'light' | 'system'
export const theme = persistentAtom<'dark' | 'light' | 'system'>(
'slowreader:theme',
'system'
)
export const preloadImages = persistentAtom<'always' | 'free' | 'never'>(
'slowreader:preloadImages',
'always'
)
export const useReducedMotion = persistentBoolean('slowreader:reduced-motion')
export const useQuietCursor = persistentBoolean('slowreader:quiet-cursor')
export interface Settings {
preloadImages: StoreValue<typeof preloadImages>
theme: StoreValue<typeof theme>
useQuietCursor: StoreValue<typeof useQuietCursor>
useReducedMotion: StoreValue<typeof useReducedMotion>
}