refactor: migrate to nuxt compatibilityVersion: 4 (#3298)
This commit is contained in:
parent
46e4433e1c
commit
a3fbc056a9
342 changed files with 1200 additions and 2932 deletions
107
shared/types/index.ts
Normal file
107
shared/types/index.ts
Normal file
|
@ -0,0 +1,107 @@
|
|||
import type { RouteLocationRaw } from '#vue-router'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { MarkNonNullable, Mutable } from './utils'
|
||||
|
||||
export interface AppInfo {
|
||||
id: string
|
||||
name: string
|
||||
website: string | null
|
||||
redirect_uri: string
|
||||
client_id: string
|
||||
client_secret: string
|
||||
vapid_key: string
|
||||
}
|
||||
|
||||
export interface UserLogin {
|
||||
server: string
|
||||
token?: string
|
||||
account: mastodon.v1.AccountCredentials
|
||||
vapidKey?: string
|
||||
pushSubscription?: mastodon.v1.WebPushSubscription
|
||||
}
|
||||
|
||||
export type PaginatorState = 'idle' | 'loading' | 'done' | 'error'
|
||||
|
||||
export interface GroupedNotifications {
|
||||
id: string
|
||||
type: 'grouped-follow'
|
||||
items: mastodon.v1.Notification[]
|
||||
}
|
||||
|
||||
export interface GroupedAccountLike {
|
||||
account: mastodon.v1.Account
|
||||
favourite?: mastodon.v1.Notification
|
||||
reblog?: mastodon.v1.Notification
|
||||
}
|
||||
|
||||
export interface GroupedLikeNotifications {
|
||||
id: string
|
||||
type: 'grouped-reblogs-and-favourites'
|
||||
status: mastodon.v1.Status
|
||||
likes: GroupedAccountLike[]
|
||||
}
|
||||
|
||||
export type NotificationSlot = GroupedNotifications | GroupedLikeNotifications | mastodon.v1.Notification
|
||||
|
||||
export type TranslateFn = ReturnType<typeof useI18n>['t']
|
||||
|
||||
export interface DraftItem {
|
||||
editingStatus?: mastodon.v1.Status
|
||||
initialText?: string
|
||||
params: MarkNonNullable<Mutable<Omit<mastodon.rest.v1.CreateStatusParams, 'poll'>>, 'status' | 'language' | 'sensitive' | 'spoilerText' | 'visibility'> & { poll: Mutable<mastodon.rest.v1.CreateStatusParams['poll']> }
|
||||
attachments: mastodon.v1.MediaAttachment[]
|
||||
lastUpdated: number
|
||||
mentions?: string[]
|
||||
}
|
||||
|
||||
export type DraftMap = Record<string, Array<DraftItem>
|
||||
// For backward compatibility we need to support single draft items
|
||||
| DraftItem>
|
||||
|
||||
export interface ConfirmDialogOptions {
|
||||
title: string
|
||||
description?: string
|
||||
confirm?: string
|
||||
cancel?: string
|
||||
extraOptionType?: 'mute'
|
||||
}
|
||||
export interface ConfirmDialogChoice {
|
||||
choice: 'confirm' | 'cancel'
|
||||
extraOptions?: {
|
||||
mute: {
|
||||
duration: number
|
||||
notifications: boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface CommonRouteTabOption {
|
||||
to: RouteLocationRaw
|
||||
display: string
|
||||
disabled?: boolean
|
||||
name?: string
|
||||
icon?: string
|
||||
hide?: boolean
|
||||
match?: boolean
|
||||
}
|
||||
export interface CommonRouteTabMoreOption {
|
||||
options: CommonRouteTabOption[]
|
||||
icon?: string
|
||||
tooltip?: string
|
||||
match?: boolean
|
||||
}
|
||||
|
||||
export interface ErrorDialogData {
|
||||
title: string
|
||||
messages: string[]
|
||||
close: string
|
||||
}
|
||||
|
||||
export interface BuildInfo {
|
||||
version: string
|
||||
commit: string
|
||||
shortCommit: string
|
||||
time: number
|
||||
branch: string
|
||||
env: 'preview' | 'canary' | 'dev' | 'release'
|
||||
}
|
7
shared/types/translation-status.ts
Normal file
7
shared/types/translation-status.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
export interface ElkTranslationStatus {
|
||||
total: number
|
||||
locales: Record<string, {
|
||||
percentage: string
|
||||
total: number
|
||||
}>
|
||||
}
|
8
shared/types/utils.ts
Normal file
8
shared/types/utils.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
export type Mutable<T> = {
|
||||
-readonly[P in keyof T]: T[P]
|
||||
}
|
||||
|
||||
export type Overwrite<T, O> = Omit<T, keyof O> & O
|
||||
export type MarkNonNullable<T, K extends keyof T> = Overwrite<T, {
|
||||
[P in K]-?: NonNullable<T[P]>
|
||||
}>
|
Loading…
Add table
Add a link
Reference in a new issue