1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

619 restructure local storage (#628)

* To MMKV migration working

* POC migrated font size settings

* Moved settings to mmkv

* Fix typos

* Migrated contexts slice

* Migrated app slice

* POC instance emoji update

* Migrated drafts

* Migrated simple instance properties

* All migrated!

* Re-structure files

* Tolerant of undefined settings

* Can properly logging in and out including empty state
This commit is contained in:
xmflsct
2022-12-28 23:41:36 +01:00
committed by GitHub
parent 71ccb4a93c
commit 1ea6aff328
214 changed files with 2151 additions and 3694 deletions

View File

@@ -264,14 +264,6 @@ declare namespace Mastodon {
}
type Filter<T extends 'v1' | 'v2'> = T extends 'v2' ? Filter_V2 : Filter_V1
type Filter_V1 = {
id: string
phrase: string
context: ('home' | 'notifications' | 'public' | 'thread' | 'account')[]
expires_at?: string
irreversible: boolean
whole_word: boolean
}
type Filter_V2 = {
id: string
title: string
@@ -281,6 +273,14 @@ declare namespace Mastodon {
keywords: FilterKeyword[]
statuses: FilterStatus[]
}
type Filter_V1 = {
id: string
phrase: string
context: ('home' | 'notifications' | 'public' | 'thread' | 'account')[]
expires_at?: string
irreversible: boolean
whole_word: boolean
}
type FilterKeyword = { id: string; keyword: string; whole_word: boolean }
@@ -298,7 +298,45 @@ declare namespace Mastodon {
replies_policy: 'none' | 'list' | 'followed'
}
type Instance = {
type Instance<T extends 'v1' | 'v2'> = T extends 'v2' ? Instance_V2 : Instance_V1
type Instance_V2 = {
domain: string
title: string
version: string
source_url: string
description: string
usage: { users: { active_month: number } }
thumbnail: { url: string; blurhash?: string; versions?: { '@1x'?: string; '@2x'?: string } }
languages: string[]
configuration: {
urls: { streaming_api: string }
accounts: { max_featured_tags: number }
statuses: {
max_characters: number
max_media_attachments: number
characters_reserved_per_url: number
}
media_attachments: {
supported_mime_types: string[]
image_size_limit: number
image_matrix_limit: number
video_size_limit: number
video_frame_rate_limit: number
video_matrix_limit: number
}
polls: {
max_options: number
max_characters_per_option: number
min_expiration: number
max_expiration: number
}
translation: { enabled: boolean }
registrations: { enabled: boolean; approval_required: boolean; message?: string }
contact: { email: string; account: Account }
rules: Rule[]
}
}
type Instance_V1 = {
// Base
uri: string
title: string