From 602f93ae6a5ceca5383b888cd4803638799558c5 Mon Sep 17 00:00:00 2001 From: hulkrelax <104332602+hulkrelax@users.noreply.github.com> Date: Sat, 9 Jul 2022 09:34:09 -0500 Subject: [PATCH] feat(Router.tsx): adds more methods to router (#9) Adds the ability to get the main running app and to navigate to the running app --- src/deck-components/Router.tsx | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/deck-components/Router.tsx b/src/deck-components/Router.tsx index 0b4e5fd..882d5cc 100644 --- a/src/deck-components/Router.tsx +++ b/src/deck-components/Router.tsx @@ -17,6 +17,52 @@ export enum QuickAccessTab { Decky, } +export enum DisplayStatus { + Invalid = 0, + Launching = 1, + Uninstalling = 2, + Installing = 3, + Running = 4, + Validating = 5, + Updating = 6, + Downloading = 7, + Synchronizing = 8, + ReadyToInstall = 9, + ReadyToPreload = 10, + ReadyToLaunch = 11, + RegionRestricted = 12, + PresaleOnly = 13, + InvalidPlatform = 14, + PreloadComplete = 16, + BorrowerLocked = 17, + UpdatePaused = 18, + UpdateQueued = 19, + UpdateRequired = 20, + UpdateDisabled = 21, + DownloadPaused = 22, + DownloadQueued = 23, + DownloadRequired = 24, + DownloadDisabled = 25, + LicensePending = 26, + LicenseExpired = 27, + AvailForFree = 28, + AvailToBorrow = 29, + AvailGuestPass = 30, + Purchase = 31, + Unavailable = 32, + NotLaunchable = 33, + CloudError = 34, + CloudOutOfDate = 35, + Terminating = 36, +} + +export type AppOverview = { + appid: string + display_name: string + display_status: DisplayStatus + sort_as: string +} + export interface Router { CloseSideMenus(): void; OpenQuickAccessMenu(quickAccessTab?: QuickAccessTab): void; @@ -24,12 +70,14 @@ export interface Router { Navigate(path: string): void; NavigateBackOrOpenMenu(): void; NavigateToExternalWeb(url: string): void; + NavigateToRunningApp(replace?: boolean): void; NavigateToStore(): void; ToggleSideMenu(sideMenu: SideMenu): void; CloseSideMenus(): void; OpenSideMenu(sideMenu: SideMenu): void; OpenPowerMenu(unknown?: any): void; get RunningApps(): any; + get MainRunningApp(): AppOverview | undefined; } export const Router = findModuleChild((m: Module) => {