feat: add local notifications management and UI integration

This commit is contained in:
Moyasee
2025-12-16 15:18:21 +02:00
parent 1552a5f359
commit b8352be274
40 changed files with 2082 additions and 122 deletions

View File

@@ -144,6 +144,10 @@ export interface FriendRequestSync {
friendRequestCount: number;
}
export interface NotificationSync {
notificationCount: number;
}
export interface FriendRequest {
id: string;
displayName: string;
@@ -312,6 +316,58 @@ export interface GameArtifact {
isFrozen: boolean;
}
export type NotificationType =
| "FRIEND_REQUEST_RECEIVED"
| "FRIEND_REQUEST_ACCEPTED"
| "BADGE_RECEIVED"
| "REVIEW_UPVOTE";
export type LocalNotificationType =
| "EXTRACTION_COMPLETE"
| "DOWNLOAD_COMPLETE"
| "UPDATE_AVAILABLE"
| "ACHIEVEMENT_UNLOCKED";
export interface Notification {
id: string;
type: NotificationType;
variables: Record<string, string>;
pictureUrl: string | null;
url: string | null;
isRead: boolean;
priority: number;
createdAt: string;
}
export interface LocalNotification {
id: string;
type: LocalNotificationType;
title: string;
description: string;
pictureUrl: string | null;
url: string | null;
isRead: boolean;
createdAt: string;
}
export type MergedNotification =
| (Notification & { source: "api" })
| (LocalNotification & { source: "local" });
export interface NotificationsResponse {
notifications: Notification[];
pagination: {
total: number;
take: number;
skip: number;
hasMore: boolean;
};
}
export interface NotificationCountResponse {
count: number;
}
export interface ComparedAchievements {
achievementsPointsTotal: number;
owner: {