From b6110c52f66348eca771a6110641dccabf1cb08e Mon Sep 17 00:00:00 2001 From: 4gray Date: Sat, 28 Mar 2026 15:48:00 +0100 Subject: [PATCH] feat(typings): enhance typings with new database operation types and parameters --- apps/web/src/typings.d.ts | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/apps/web/src/typings.d.ts b/apps/web/src/typings.d.ts index 152bd6cea..c0bd3b027 100644 --- a/apps/web/src/typings.d.ts +++ b/apps/web/src/typings.d.ts @@ -13,7 +13,9 @@ import { PortalDebugEvent, } from 'shared-interfaces'; import { + DbOperationEvent, GlobalFavoriteItem, + GlobalRecentlyAddedItem, GlobalRecentItem, GlobalSearchResult, XCategoryFromDb, @@ -117,6 +119,7 @@ declare global { url: string; params: Record; requestId?: string; + suppressErrorLog?: boolean; }) => Promise<{ payload: unknown; action: string }>; // Database operations dbCreatePlaylist: ( @@ -136,9 +139,13 @@ declare global { updates: Partial ) => Promise<{ success: boolean }>; dbDeletePlaylist: ( - playlistId: string + playlistId: string, + operationId?: string ) => Promise<{ success: boolean }>; - dbDeleteXtreamContent: (playlistId: string) => Promise<{ + dbDeleteXtreamContent: ( + playlistId: string, + operationId?: string + ) => Promise<{ success: boolean; favoritedXtreamIds: number[]; recentlyViewedXtreamIds: { @@ -156,7 +163,8 @@ declare global { recentlyViewedXtreamIds: { xtreamId: number; viewedAt: string; - }[] + }[], + operationId?: string ) => Promise<{ success: boolean }>; dbHasCategories: ( playlistId: string, @@ -191,7 +199,8 @@ declare global { dbSaveContent: ( playlistId: string, streams: JsonArray, - type: string + type: string, + operationId?: string ) => Promise<{ success: boolean; count: number }>; dbSearchContent: ( playlistId: string, @@ -204,6 +213,10 @@ declare global { types: string[], excludeHidden?: boolean ) => Promise; + dbGetGlobalRecentlyAdded: ( + kind: 'all' | 'vod' | 'series', + limit?: number + ) => Promise; dbGetRecentlyViewed: () => Promise; dbClearRecentlyViewed: () => Promise<{ success: boolean }>; // Favorites @@ -299,7 +312,15 @@ declare global { callback: (count: number) => void ) => void; removeDbSaveContentProgress: () => void; - dbDeleteAllPlaylists: () => Promise<{ success: boolean }>; + onDbOperationEvent?: ( + callback: (data: DbOperationEvent) => void + ) => () => void; + dbDeleteAllPlaylists: ( + operationId?: string + ) => Promise<{ success: boolean }>; + dbCancelOperation: ( + operationId: string + ) => Promise<{ success: boolean }>; // Playback positions dbSavePlaybackPosition: ( playlistId: string,