misskey/packages/sw/src/types.ts
かっこかり 5fb6847419
Feat: 未読通知数を表示できるように (#11982)
* 未読通知数を表示できるように

* Update Changelog

* オプトインにする

* Fix lint

* (add) テスト通知のプッシュ通知を追加

* add test

* フロントエンドの表示上限を99に変更

* Make it default on

* 共通スタイルをくくりだす

* Update Changelog

* tweak

* Update UserEntityService.ts

* rename

* Update navbar-for-mobile.vue

---------

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2023-11-01 13:34:05 +09:00

54 lines
1.1 KiB
TypeScript

/*
* SPDX-FileCopyrightText: syuilo and other misskey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
import type * as Misskey from 'misskey-js';
export type SwMessageOrderType = 'post' | 'push';
export type SwMessage = {
type: 'order';
order: SwMessageOrderType;
loginId?: string;
url: string;
[x: string]: unknown;
};
// Defined also @/core/PushNotificationService.ts#L12
type PushNotificationDataSourceMap = {
notification: Misskey.entities.Notification;
unreadAntennaNote: {
antenna: { id: string; name: string };
note: Misskey.entities.Note;
};
readAllNotifications: undefined;
};
export type PushNotificationData<K extends keyof PushNotificationDataSourceMap> = {
type: K;
body: PushNotificationDataSourceMap[K];
userId: string;
dateTime: number;
};
export type PushNotificationDataMap = {
[K in keyof PushNotificationDataSourceMap]: PushNotificationData<K>;
};
export type BadgeNames =
| 'null'
| 'antenna'
| 'arrow-back-up'
| 'at'
| 'bell'
| 'chart-arrows'
| 'circle-check'
| 'medal'
| 'messages'
| 'plus'
| 'quote'
| 'repeat'
| 'user-plus'
| 'users';