sharkey/packages/frontend/src/local-storage.ts
okayurisotto d84796588c
cleanup: trim trailing whitespace (#11136)
* cleanup: trim trailing whitespace

* update(`.editorconfig`)

---------

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2023-07-08 07:08:16 +09:00

40 lines
899 B
TypeScript

type Keys =
'v' |
'lastVersion' |
'instance' |
'account' |
'accounts' |
'latestDonationInfoShownAt' |
'neverShowDonationInfo' |
'neverShowLocalOnlyInfo' |
'lastUsed' |
'lang' |
'drafts' |
'hashtags' |
'wallpaper' |
'theme' |
'colorScheme' |
'useSystemFont' |
'fontSize' |
'ui' |
'ui_temp' |
'locale' |
'localeVersion' |
'theme' |
'customCss' |
'message_drafts' |
'scratchpad' |
'debug' |
`miux:${string}` |
`ui:folder:${string}` |
`themes:${string}` |
`aiscript:${string}` |
'lastEmojisFetchedAt' | // DEPRECATED, stored in indexeddb (13.9.0~)
'emojis' // DEPRECATED, stored in indexeddb (13.9.0~);
export const miLocalStorage = {
getItem: (key: Keys): string | null => window.localStorage.getItem(key),
setItem: (key: Keys, value: string): void => window.localStorage.setItem(key, value),
removeItem: (key: Keys): void => window.localStorage.removeItem(key),
};