refactor: reorganize modules

This commit is contained in:
Anthony Fu 2022-12-13 15:03:30 +01:00
parent fd29c379dc
commit 0ef44cdf50
11 changed files with 130 additions and 116 deletions

View file

@ -1,16 +1,6 @@
import type { Account, Attachment, CreateStatusParams, Status } from 'masto'
import type { Account, Status } from 'masto'
import { STORAGE_KEY_DRAFTS } from '~/constants'
import type { Mutable } from '~/types/utils'
export interface Draft {
editingStatus?: Status
initialText?: string
params: Omit<Mutable<CreateStatusParams>, 'status'> & {
status?: Exclude<CreateStatusParams['status'], null>
}
attachments: Attachment[]
}
export type DraftMap = Record<string, Draft>
import type { Draft, DraftMap } from '~/types'
export const currentUserDrafts = useUserLocalStorage<DraftMap>(STORAGE_KEY_DRAFTS, () => ({}))