2022-12-18 00:29:16 +01:00
|
|
|
import type { Account, AccountCredentials, Attachment, CreateStatusParams, Emoji, Instance, MastoClient, Notification, PushSubscription, Status } from 'masto'
|
2022-12-17 17:55:29 +01:00
|
|
|
import type { Ref } from 'vue'
|
2023-01-04 11:21:18 +01:00
|
|
|
import type { MarkNonNullable, Mutable } from './utils'
|
2022-11-15 16:48:23 +01:00
|
|
|
|
|
|
|
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
|
2022-11-29 21:51:52 +01:00
|
|
|
token?: string
|
2022-11-24 16:48:52 +01:00
|
|
|
account: AccountCredentials
|
2022-12-18 00:29:16 +01:00
|
|
|
vapidKey?: string
|
|
|
|
pushSubscription?: PushSubscription
|
2022-11-15 16:48:23 +01:00
|
|
|
}
|
2022-11-16 17:11:08 +01:00
|
|
|
|
2022-12-17 17:55:29 +01:00
|
|
|
export interface ElkMasto extends MastoClient {
|
|
|
|
loginTo (user?: Omit<UserLogin, 'account'> & { account?: AccountCredentials }): Promise<MastoClient>
|
|
|
|
loggedIn: Ref<boolean>
|
|
|
|
}
|
|
|
|
|
2022-11-17 08:35:42 +01:00
|
|
|
export type PaginatorState = 'idle' | 'loading' | 'done' | 'error'
|
2022-11-21 07:55:31 +01:00
|
|
|
|
|
|
|
export interface ServerInfo extends Instance {
|
|
|
|
server: string
|
|
|
|
timeUpdated: number
|
|
|
|
customEmojis?: Record<string, Emoji>
|
|
|
|
}
|
2022-11-30 01:47:54 +01:00
|
|
|
|
|
|
|
export interface GroupedNotifications {
|
|
|
|
id: string
|
2022-12-11 23:40:40 +01:00
|
|
|
type: Exclude<string, 'grouped-reblogs-and-favourites'>
|
2022-11-30 01:47:54 +01:00
|
|
|
items: Notification[]
|
|
|
|
}
|
2022-11-30 05:50:29 +01:00
|
|
|
|
2022-12-11 23:40:40 +01:00
|
|
|
export interface GroupedAccountLike {
|
|
|
|
account: Account
|
|
|
|
favourite?: Notification
|
|
|
|
reblog?: Notification
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GroupedLikeNotifications {
|
|
|
|
id: string
|
|
|
|
type: 'grouped-reblogs-and-favourites'
|
|
|
|
status: Status
|
|
|
|
likes: GroupedAccountLike[]
|
|
|
|
}
|
|
|
|
|
|
|
|
export type NotificationSlot = GroupedNotifications | GroupedLikeNotifications | Notification
|
|
|
|
|
2022-11-30 05:50:29 +01:00
|
|
|
export type TranslateFn = ReturnType<typeof useI18n>['t']
|
2022-12-13 15:03:30 +01:00
|
|
|
|
|
|
|
export interface Draft {
|
|
|
|
editingStatus?: Status
|
|
|
|
initialText?: string
|
2023-01-04 11:21:18 +01:00
|
|
|
params: MarkNonNullable<Mutable<CreateStatusParams>, 'status' | 'language' | 'sensitive' | 'spoilerText' | 'visibility'>
|
2022-12-13 15:03:30 +01:00
|
|
|
attachments: Attachment[]
|
|
|
|
}
|
|
|
|
export type DraftMap = Record<string, Draft>
|
2022-12-26 20:33:19 +01:00
|
|
|
|
|
|
|
export interface BuildInfo {
|
|
|
|
version: string
|
|
|
|
commit: string
|
|
|
|
time: number
|
|
|
|
branch: string
|
|
|
|
}
|
2022-12-28 02:06:54 +01:00
|
|
|
|
|
|
|
export type FontSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
|
|
export type ColorMode = 'light' | 'dark'
|