1
0
elk/composables/push-notifications/types.ts

27 lines
888 B
TypeScript
Raw Normal View History

2023-01-08 15:21:09 +09:00
import type { mastodon } from 'masto'
import type { UserLogin } from '~/types'
export type SubscriptionResult = 'subscribed' | 'notification-denied' | 'not-supported' | 'invalid-vapid-key' | 'no-user'
export interface PushManagerSubscriptionInfo {
registration: ServiceWorkerRegistration
subscription: PushSubscription | null
}
export interface RequiredUserLogin extends Required<Omit<UserLogin, 'account' | 'pushSubscription'>> {
2023-01-08 15:21:09 +09:00
pushSubscription?: mastodon.v1.WebPushSubscription
}
export interface CreatePushNotification {
2023-01-08 15:21:09 +09:00
alerts?: Partial<mastodon.v1.WebPushSubscriptionAlerts> | null
policy?: mastodon.v1.SubscriptionPolicy
}
export type PushNotificationRequest = Record<string, boolean>
2023-01-08 15:21:09 +09:00
export type PushNotificationPolicy = Record<string, mastodon.v1.SubscriptionPolicy>
2022-12-24 07:56:16 +09:00
export interface CustomEmojisInfo {
lastUpdate: number
2023-01-08 15:21:09 +09:00
emojis: mastodon.v1.CustomEmoji[]
2022-12-24 07:56:16 +09:00
}