From f627b87af3e9246b32b0e2efbd9c77b1a6b65002 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Sun, 27 Aug 2023 13:58:49 +0800 Subject: [PATCH 01/46] change: Add SteamClient types Steam Version: 1690583737 Steam Client Build Date: Sat, Jul 29 02:44 UTC -08:00 --- src/globals/SteamClient.ts | 1109 +++++++++++++++++++++++++++++++----- 1 file changed, 961 insertions(+), 148 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 0c657077..6ee886e1 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -3,187 +3,1000 @@ declare global { } export interface Apps { - RegisterForAppOverviewChanges: any; - RegisterForAppDetails: any; - RegisterForLocalizationChanges: any; - RegisterForWorkshopChanges: any; - RegisterForWorkshopItemDownloads: any; - GetLibraryBootstrapData: any; - RegisterForAchievementChanges: any; - GetFriendAchievementsForApp: any; - GetMyAchievementsForApp: any; + AddShortcut: any; AddUserTagToApps: any; - RemoveUserTagFromApps: any; - ClearUserTagsOnApps: any; - ClearAndSetUserTagsOnApp: any; - SetAppHidden: any; - ResetHiddenState: any; - SetAppLaunchOptions: any; - SetAppResolutionOverride: any; - SetAppCurrentLanguage: any; - SetAppAutoUpdateBehavior: any; - SetAppBackgroundDownloadsBehavior: any; - ToggleAppFamilyBlockedState: any; - ToggleAppSteamCloudEnabled: any; - ToggleAppSteamCloudSyncOnSuspendEnabled: any; - ToggleOverrideResolutionForInternalDisplay: any; - ToggleEnableSteamOverlayForApp: any; - ToggleEnableDesktopTheatreForApp: any; - BrowseLocalFilesForApp: any; - BrowseScreenshotsForApp: any; - BrowseScreenshotForApp: any; BackupFilesForApp: any; - VerifyFilesForApp: any; + BrowseScreenshotForApp: any; + BrowseScreenshotsForApp: any; + CancelBackup: any; + CancelGameAction: any; + CancelLaunch: any; + ClearAndSetUserTagsOnApp: any; + ClearCustomArtworkForApp: any; + ClearCustomLogoPositionForApp: any; + ClearProton: any; + ClearUserTagsOnApps: any; + ContinueGameAction: any; CreateDesktopShortcutForApp: any; - JoinAppContentBeta: any; - JoinAppContentBetaByPassword: any; - GetAchievementsInTimeRange: any; - GetSubscribedWorkshopItems: any; - SubscribeWorkshopItem: any; - GetDownloadedWorkshopItems: any; DownloadWorkshopItem: any; - SetLocalScreenshotCaption: any; - SetLocalScreenshotSpoiler: any; + GetAchievementsInTimeRange: any; + GetActiveGameActions: any; + GetAvailableCompatTools: any; + GetBackupsInFolder: any; + GetCachedAppDetails: any; + GetCloudPendingRemoteOperations: any; + GetConflictingFileTimestamps: any; GetDetailsForScreenshotUpload: any; - UploadLocalScreenshot: any; - DeleteLocalScreenshot: any; - GetScreenshotsInTimeRange: any; + GetDetailsForScreenshotUploads: any; + GetDownloadedWorkshopItems: any; + GetDurationControlInfo: any; + GetFriendAchievementsForApp: any; GetFriendsWhoPlay: any; - RequestLegacyCDKeysForApp: any; - GetSoundtrackDetails: any; - GetStoreTagLocalization: any; + GetGameActionDetails: any; + GetGameActionForApp: any; GetLaunchOptionsForApp: any; + GetLibraryBootstrapData: any; + GetMyAchievementsForApp: any; + GetPlaytime: any; + GetPrePurchasedApps: any; GetResolutionOverrideForApp: any; - ScanForShortcuts: any; - GetAllShortcuts: any; + GetScreenshotInfo: any; + GetScreenshotsInTimeRange: any; GetShortcutData: any; - AddShortcut: any; - RemoveShortcut: any; + GetShortcutDataForPath: any; + GetSoundtrackDetails: any; + GetStoreTagLocalization: any; + GetSubscribedWorkshopItems: any; InstallFlatpakAppAndCreateShortcut: any; + JoinAppContentBeta: any; + JoinAppContentBetaByPassword: any; ListFlatpakApps: any; - UninstallFlatpakApp: any; - ShowControllerConfigurator: any; - SetThirdPartyControllerConfiguration: any; - ToggleAllowDesktopConfiguration: any; - SetControllerRumblePreference: any; - GetCachedAppDetails: any; - SetCachedAppDetails: any; + LoadEula: any; + MarkEulaAccepted: any; + MarkEulaRejected: any; + OpenAppSettingsDialog: any; + RaiseWindowForGame: any; + RegisterForAchievementChanges: any; + RegisterForAppBackupStatus: any; + RegisterForAppDetails: any; + RegisterForAppOverviewChanges: any; + RegisterForDRMFailureResponse: any; + RegisterForGameActionEnd: any; + RegisterForGameActionShowError: any; + RegisterForGameActionShowUI: any; + RegisterForGameActionStart: any; + RegisterForGameActionTaskChange: any; + RegisterForGameActionUserRequest: any; + RegisterForLocalizationChanges: any; + RegisterForPrePurchasedAppChanges: any; + RegisterForShowMarketingMessageDialog: any; + RegisterForWorkshopChanges: any; + RegisterForWorkshopItemDownloads: any; + RemoveShortcut: any; + RemoveUserTagFromApps: any; ReportLibraryAssetCacheMiss: any; + ReportMarketingMessageDialogShown: any; + RequestIconDataForApp: any; + RequestLegacyCDKeysForApp: any; + ResetHiddenState: any; + RunGame: any; SaveAchievementProgressCache: any; - SetStreamingClientForApp: any; + ScanForInstalledNonSteamApps: any; + SetAppAutoUpdateBehavior: any; + SetAppBackgroundDownloadsBehavior: any; + SetAppCurrentLanguage: any; + SetAppHidden: any; + SetAppLaunchOptions: any; + SetAppResolutionOverride: any; + SetCachedAppDetails: any; + SetControllerRumblePreference: any; SetCustomArtworkForApp: any; - ClearCustomArtworkForApp: any; SetCustomLogoPositionForApp: any; - ClearCustomLogoPositionForApp: any; - RequestIconDataForApp: any; - SpecifyCompatTool: any; - GetAvailableCompatTools: any; - SetShortcutName: any; + SetDLCEnabled: any; + SetLocalScreenshotCaption: any; + SetLocalScreenshotPrivacy: any; + SetLocalScreenshotSpoiler: any; SetShortcutExe: any; - SetShortcutStartDir: any; - SetShortcutLaunchOptions: any; + SetShortcutIcon: any; SetShortcutIsVR: any; - PromptToChangeShortcut: any; - PromptToSelectShortcutIcon: any; - InstallApp: any; - RunGame: any; - VerifyApp: any; + SetShortcutLaunchOptions: any; + SetShortcutName: any; + SetShortcutStartDir: any; + SetStreamingClientForApp: any; + SetThirdPartyControllerConfiguration: any; + ShowControllerConfigurator: any; + ShowStore: any; + SpecifyCompatTool: any; StreamGame: any; - CancelLaunch: any; + SubscribeWorkshopItem: any; TerminateApp: any; - UninstallApps: any; - ShowStore: any; - SetDLCEnabled: any; - ContinueGameAction: any; - CancelGameAction: any; - GetActiveGameActions: any; - GetGameActionDetails: any; - GetGameActionForApp: any; - SkipShaderProcessing: any; - MarkEulaAccepted: any; - MarkEulaRejected: any; - LoadEula: any; - GetConflictingFileTimestamps: any; - GetCloudPendingRemoteOperations: any; - ClearProton: any; - RegisterForMarketingMessages: any; - FetchMarketingMessages: any; - MarkMarketingMessageSeen: any; - ReportMarketingMessageSeen: any; - RegisterForGameActionStart: any; - RegisterForGameActionEnd: any; - RegisterForGameActionTaskChange: any; - RegisterForGameActionUserRequest: any; - RegisterForGameActionShowError: any; - RegisterForGameActionShowUI: any; - OpenAppSettingsDialog: any; + ToggleAllowDesktopConfiguration: any; + ToggleAppFamilyBlockedState: any; + ToggleAppSteamCloudEnabled: any; + ToggleAppSteamCloudSyncOnSuspendEnabled: any; + ToggleEnableDesktopTheatreForApp: any; + ToggleEnableSteamOverlayForApp: any; + ToggleOverrideResolutionForInternalDisplay: any; + UninstallFlatpakApp: any; + VerifyApp: any; +} + +export interface Auth { + GetLocalHostname: any; + GetMachineID: any; + GetRefreshInfo: any; + GetSteamGuardData: any; + IsSecureComputer: any; + SetLoginToken: any; + SetSteamGuardData: any; + StartSignInFromCache: any; +} + +export interface Broadcast { + ApproveViewerRequest: any; + InviteToWatch: any; + RegisterForBroadcastStatus: any; + RegisterForViewerRequests: any; + RejectViewerRequest: any; + StopBroadcasting: any; +} + +export interface Browser { + BIsDirectHWNDBrowser: any; + BIsPopupWindow: any; + BIsVROverlayBrowser: any; + ClearAllBrowsingData: any; + ClearHistory: any; + CloseDevTools: any; + GetBrowserID: any; + GetSteamBrowserID: any; + GoBack: any; + GoForward: any; + HideCursorUntilMouseEvent: any; + InspectElement: any; + NotifyUserActivation: any; + OpenDevTools: any; + OpenURLForNavigation: any; + RegisterForGestureEvents: any; + RegisterForOpenNewTab: any; + SetShouldExitSteamOnBrowserClosed: any; + SetTouchGesturesToCancel: any; + StartDownload: any; +} + +export interface BrowserView { + Create: any; + CreatePopup: any; + Destroy: any; + PostMessageToParent: any; +} + +export interface ClientNotifications { + DisplayClientNotification: any; + OnRespondToClientNotification: any; +} + +export interface Cloud { + ResolveAppSyncConflict: any; + RetryAppSync: any; +} + +export interface CommunityItems { + DownloadItemAsset: any; + GetItemAssetPath: any; + RemoveDownloadedItemAsset: any; +} + +export interface Console { + ExecCommand: any; + GetAutocompleteSuggestions: any; + RegisterForSpewOutput: any; +} + +export interface Customization { + GenerateLocalStartupMoviesThumbnails: any; + GetDownloadedStartupMovies: any; + GetLocalStartupMovies: any; +} + +export interface Downloads { + EnableAllDownloads: any; + MoveAppUpdateDown: any; + MoveAppUpdateUp: any; + PauseAppUpdate: any; + QueueAppUpdate: any; + RegisterForDownloadItems: any; + RegisterForDownloadOverview: any; + RemoveFromDownloadList: any; + ResumeAppUpdate: any; + SetLaunchOnUpdateComplete: any; + SetQueueIndex: any; + SuspendDownloadThrottling: any; + SuspendLanPeerContent: any; +} + +export interface FamilySharing { + AuthorizeLocalDevice: any; + DeauthorizeLocalDevice: any; + RequestFamilySharingAuthorization: any; + UpdateAuthorizedBorrower: any; +} + +export interface Features { + SteamInitsPopups: any; +} + +export interface FriendSettings { + GetEnabledFeatures: any; + RegisterForSettingsChanged: any; + SetFriendSettings: any; +} + +export interface Friends { + AddFriend: any; + GetCoplayData: any; + InviteUserToCurrentGame: any; + InviteUserToGame: any; + InviteUserToLobby: any; + InviteUserToRemotePlayTogetherCurrentGame: any; + RegisterForVoiceChatStatus: any; + RemoveFriend: any; +} + +export interface GameNotes { + DeleteImage: any; + DeleteNotes: any; + GetNotes: any; + GetNotesMetadata: any; + GetNumNotes: any; + GetQuota: any; + IterateNotes: any; + ResolveSyncConflicts: any; + SaveNotes: any; + SyncToClient: any; + SyncToServer: any; + UploadImage: any; +} + +export interface GameSessions { + RegisterForAchievementNotification: any; + RegisterForAppLifetimeNotifications: any; + RegisterForScreenshotNotification: any; +} + +export interface Input { + BIsSteamController: any; + BSupportsControllerLEDColor: any; + CalibrateControllerIMU: any; + CalibrateControllerJoystick: any; + CalibrateControllerTrackpads: any; + CancelGyroSWCalibration: any; + ClearSelectedConfigForApp: any; + CloseDesktopConfigurator: any; + ControllerKeyboardSendText: any; + ControllerKeyboardSetKeyState: any; + DeauthorizeControllerAccount: any; + DecrementCloudedControllerConfigsCounter: any; + DeletePersonalControllerConfiguration: any; + DuplicateControllerConfigurationSourceMode: any; + EndControllerDeviceSupportFlow: any; + ExportCurrentControllerConfiguration: any; + ForceConfiguratorFocus: any; + ForceSimpleHapticEvent: any; + FreeControllerConfig: any; + GetConfigForAppAndController: any; + GetControllerMappingString: any; + GetSteamControllerDongleState: any; + GetTouchMenuIconsForApp: any; + GetXboxDriverInstallState: any; + IdentifyController: any; + InitControllerSounds: any; + InitializeControllerPersonalizationSettings: any; + ModalKeyboardDismissed: any; + OpenDesktopConfigurator: any; + PreviewConfiguForAppAndController: any; + PreviewControllerLEDColor: any; + QueryControllerConfigsForApp: any; + RegisterForActiveControllerChanges: any; + RegisterForConfigSelectionChanges: any; + RegisterForControllerAccountChanges: any; + RegisterForControllerAnalogInputMessages: any; + RegisterForControllerCommandMessages: any; + RegisterForControllerConfigCloudStateChanges: any; + RegisterForControllerConfigInfoMessages: any; + RegisterForControllerInputMessages: any; + RegisterForControllerListChanges: any; + RegisterForControllerStateChanges: any; + RegisterForGameKeyboardMessages: any; + RegisterForRemotePlayConfigChanges: any; + RegisterForShowControllerLayoutPreviewMessages: any; + RegisterForTouchMenuInputMessages: any; + RegisterForTouchMenuMessages: any; + RegisterForUIVisualization: any; + RegisterForUnboundControllerListChanges: any; + RegisterForUserDismissKeyboardMessages: any; + RegisterForUserKeyboardMessages: any; + RequestGyroActive: any; + RequestRemotePlayControllerConfigs: any; + ResetControllerBindings: any; + ResolveCloudedControllerConfigConflict: any; + RestoreControllerPersonalizationSettings: any; + SaveControllerCalibration: any; + SaveControllerPersonalizationSettings: any; + SaveControllerSounds: any; + SaveEditingControllerConfiguration: any; + SetActiveControllerAccount: any; + SetControllerConfigurationModeShiftBinding: any; + SetControllerHapticSetting: any; + SetControllerMappingString: any; + SetControllerNintendoLayoutSetting: any; + SetControllerPersonalizationName: any; + SetControllerPersonalizationSetting: any; + SetControllerPersonalizationSettingFloat: any; + SetControllerRumbleSetting: any; + SetCursorActionset: any; + SetEditingControllerConfigurationActionSet: any; + SetEditingControllerConfigurationInputActivator: any; + SetEditingControllerConfigurationInputActivatorEnabled: any; + SetEditingControllerConfigurationInputBinding: any; + SetEditingControllerConfigurationMiscSetting: any; + SetEditingControllerConfigurationSourceMode: any; + SetGamepadKeyboardText: any; + SetKeyboardActionset: any; + SetMousePosition: any; + SetSelectedConfigForApp: any; + SetSteamControllerDonglePairingMode: any; + SetVirtualMenuKeySelected: any; + SetWebBrowserActionset: any; + SetXboxDriverInstallState: any; + ShowControllerSettings: any; + StandaloneKeyboardDismissed: any; + StartControllerDeviceSupportFlow: any; + StartEditingControllerConfigurationForAppIDAndControllerIndex: any; + StartGyroSWCalibration: any; + StopEditingControllerConfiguration: any; + SwapControllerModeInputBindings: any; + SwapControllerOrder: any; + SyncCloudedControllerConfigs: any; + TriggerHapticPulse: any; + TriggerSimpleHapticEvent: any; + UnregisterForControllerStateChanges: any; + UnregisterForUIVisualization: any; + UploadChangesForCloudedControllerConfigs: any; +} + +export interface InstallFolder { + AddInstallFolder: any; + BrowseFilesInFolder: any; + CancelMove: any; + GetInstallFolders: any; + GetPotentialFolders: any; + MoveInstallFolderForApp: any; + RefreshFolders: any; + RegisterForInstallFolderChanges: any; + RegisterForMoveContentProgress: any; + RegisterForRepairFolderFinished: any; + RemoveInstallFolder: any; + RepairInstallFolder: any; + SetDefaultInstallFolder: any; + SetFolderLabel: any; +} + +export interface Installs { + CancelInstall: any; + ContinueInstall: any; + GetInstallManagerInfo: any; + OpenInstallBackup: any; + OpenInstallWizard: any; + OpenUninstallWizard: any; + RegisterForShowConfirmUninstall: any; + RegisterForShowFailedUninstall: any; + RegisterForShowInstallWizard: any; + RegisterForShowRegisterCDKey: any; + SetAppList: any; + SetCreateShortcuts: any; + SetInstallFolder: any; +} + +export interface Messaging { + RegisterForMessages: any; + PostMessage: any; +} + +export interface Music { + DecreaseVolume: any; + IncreaseVolume: any; + PlayEntry: any; + PlayNext: any; + PlayPrevious: any; + RegisterForMusicPlaybackChanges: any; + RegisterForMusicPlaybackPosition: any; + SetPlaybackPosition: any; + SetPlayingRepeatStatus: any; + SetPlayingShuffled: any; + SetVolume: any; + ToggleMuteVolume: any; + TogglePlayPause: any; +} + +export interface Notifications { + RegisterForNotifications: any; +} + +export interface VRDevice { + BIsConnected: any; + RegisterForDeviceConnectivityChange: any; +} + +export interface DeviceProperties { + GetBoolDeviceProperty: any; + GetDoubleDeviceProperty: any; + GetFloatDeviceProperty: any; + GetInt32DeviceProperty: any; + GetStringDeviceProperty: any; + RegisterForDevicePropertyChange: any; +} + +export interface Keyboard { + SendText: any; +} + +export interface VROverlay { + ShowDashboard: any; +} + +export interface OpenVR { + Device: VRDevice; + DeviceProperties: DeviceProperties; + GetWebSecret: any; + HideKeyboard: any; + InstallVR: any; + Keyboard: Keyboard; + QuitAllVR: any; + RegisterForInstallDialog: any; + RegisterStartupErrors: any; + RegisterForVRHardwareDetected: any; + RegisterForVRModeChange: any; + SendKeyboardDone: any; + SetOverlayInteractionAffordance: any; + ShowKeyboard: any; + StartVR: any; + TriggerOverlayHapticEffect: any; + VROverlay: VROverlay; +} + +export interface Overlay { + DestroyGamePadUIDesktopConfiguratorWindow: any; + GetOverlayBrowserInfo: any; + HandleGameWebCallback: any; + HandleProtocolForOverlayBrowser: any; + RegisterForActiveOverlayRequests: any; + RegisterForMicroTxnAuth: any; + RegisterForMicroTxnAuthDismiss: any; + RegisterForNotificationPositionChanged: any; + RegisterForOverlayActivated: any; + RegisterForOverlayBrowserProtocols: any; + RegisterOverlayBrowserInfoChanged: any; + SetOverlayState: any; +} + +export interface Parental { + LockParentalLock: any; + RegisterForParentalLockStatus: any; + UnlockParentalLock: any; +} + +export interface RemotePlay { + BCanAcceptInviteForGame: any; + BCanCreateInviteForGame: any; + BCanHostIsolatedGameAudio: any; + BEnabled: any; + BRemotePlayTogetherGuestOnPhoneOrTablet: any; + BRemotePlayTogetherGuestSupported: any; + CancelInviteAndSession: any; + CancelInviteAndSessionWithGuestID: any; + CloseGroup: any; + CreateGroup: any; + CreateInviteAndSession: any; + CreateInviteAndSessionWithGuestID: any; + GetClientStreamingBitrate: any; + GetClientStreamingQuality: any; + GetControllerType: any; + GetGameSystemVolume: any; + GetPerUserInputSettings: any; + GetPerUserInputSettingsWithGuestID: any; + IdentifyController: any; + InstallAudioDriver: any; + InstallInputDriver: any; + MoveControllerToSlot: any; + RegisterForAudioDriverPrompt: any; + RegisterForBitrateOverride: any; + RegisterForControllerIndexSet: any; + RegisterForDevicesChanges: any; + RegisterForGroupCreated: any; + RegisterForGroupDisbanded: any; + RegisterForInputDriverPrompt: any; + RegisterForInputDriverRestartNotice: any; + RegisterForInputUsed: any; + RegisterForInviteResult: any; + RegisterForNetworkUtilizationUpdate: any; + RegisterForPlaceholderStateChanged: any; + RegisterForPlayerInputSettingsChanged: any; + RegisterForQualityOverride: any; + RegisterForRemoteClientLaunchFailed: any; + RegisterForRemoteClientStarted: any; + RegisterForRemoteClientStopped: any; + RegisterForSettingsChanges: any; + SetClientStreamingBitrate: any; + SetClientStreamingQuality: any; + SetGameSystemVolume: any; + SetPerUserControllerInputEnabled: any; + SetPerUserControllerInputEnabledWithGuestID: any; + SetPerUserKeyboardInputEnabled: any; + SetPerUserKeyboardInputEnabledWithGuestID: any; + SetPerUserMouseInputEnabled: any; + SetPerUserMouseInputEnabledWithGuestID: any; + SetRemoteDeviceAuthorized: any; + SetRemoteDevicePIN: any; + SetRemotePlayEnabled: any; + SetStreamingClientConfig: any; + SetStreamingClientConfigEnabled: any; + SetStreamingDesktopToRemotePlayTogetherEnabled: any; + SetStreamingP2PScope: any; + SetStreamingServerConfig: any; + SetStreamingServerConfigEnabled: any; + StopStreamingClient: any; + StopStreamingSession: any; + StopStreamingSessionAndSuspendDevice: any; + UnlockH264: any; + UnpairRemoteDevices: any; +} + +export interface Screenshots { + DeleteLocalScreenshot: any; + GetAllAppsLocalScreenshots: any; + GetAllAppsLocalScreenshotsCount: any; + GetAllAppsLocalScreenshotsRange: any; + GetAllLocalScreenshots: any; + GetGameWithLocalScreenshots: any; + GetLastScreenshotTaken: any; + GetLocalScreenshot: any; + GetLocalScreenshotCount: any; + GetNumGamesWithLocalScreenshots: any; + ShowScreenshotInSystemViewer: any; + ShowScreenshotOnDisk: any; + UploadLocalScreenshot: any; +} + +export interface ServerBrowser { + AddFavoriteServer: any; + AddFavoriteServersByIP: any; + CancelServerQuery: any; + ConnectToServer: any; + CreateFriendGameInfoDialog: any; + CreateServerGameInfoDialog: any; + DestroyGameInfoDialog: any; + DestroyServerListRequest: any; + GetMultiplayerGames: any; + GetServerListPreferences: any; + PingServer: any; + RegisterForFavorites: any; + RegisterForFriendGamePlayed: any; + RegisterForGameInfoDialogs: any; + RegisterForPlayerDetails: any; + RegisterForServerInfo: any; + RemoveFavoriteServer: any; + RemoveHistoryServer: any; + RequestPlayerDetails: any; + SetServerListPreferences: any; +} + +export interface Settings { + AddClientBeta: any; + ClearAllHTTPCaches: any; + ClearDownloadCache: any; + GetAccountSettings: any; + GetAppUsesP2PVoice: any; + GetAvailableLanguages: any; + GetAvailableTimeZones: any; + GetCurrentLanguage: any; + GetGlobalCompatTools: any; + GetMonitorInfo: any; + GetOOBETestMode: any; + GetRegisteredSteamDeck: any; + GetTimeZone: any; + GetWindowed: any; + IgnoreSteamDeckRewards: any; + OpenWindowsMicSettings: any; + RegisterForMicVolumeUpdates: any; + RegisterForSettingsArrayChanges: any; + RegisterForSettingsChanges: any; + RegisterForTimeZoneChange: any; + ReinitMicSettings: any; + RequestDeviceAuthInfo: any; + SelectClientBeta: any; + SetCefRemoteDebuggingEnabled: any; + SetCurrentLanguage: any; + SetEnableSoftProcessKill: any; + SetEnableTestUpdaters: any; + SetForceOOBE: any; + SetHostname: any; + SetMicTestMode: any; + SetOOBETestMode: any; + SetOverrideBrowserComposerMode: any; + SetPreferredMonitor: any; + SetRegisteredSteamDeck: any; + SetSaveAccountCredentials: any; + SetSetting: any; + SetShowMobxDevTools: any; + SetSteamPlayEnabled: any; + SetTimeZone: any; + SetUseNintendoButtonLayout: any; + SetWindowed: any; + SpecifyGlobalCompatTool: any; + ToggleSteamInstall: any; +} + +export interface SharedConnection { + AllocateSharedConnection: any; + Close: any; + RegisterOnBinaryMessageReceived: any; + RegisterOnLogonInfoChanged: any; + RegisterOnMessageReceived: any; + SendMsg: any; + SendMsgAndAwaitBinaryResponse: any; + SubscribeToClientServiceMethod: any; + SubscribeToEMsg: any; +} + +export interface Stats { + RecordActivationEvent: any; + RecordDisplayEvent: any; +} + +export interface SteamChina { + GetCustomLauncherAppID: any; +} + +export interface Storage { + DeleteKey: any; + GetJSON: any; + GetString: any; + SetObject: any; + SetString: any; +} + +export interface Streaming { + AcceptStreamingEULA: any; + CancelStreamGame: any; + RegisterForStreamingClientFinished: any; + RegisterForStreamingClientLaunchProgress: any; + RegisterForStreamingClientStarted: any; + RegisterForStreamingLaunchComplete: any; + RegisterForStreamingShowEula: any; + RegisterForStreamingShowIntro: any; + RegisterForStreamingShowLaunchOptions: any; + StreamingContinueStreamGame: any; + StreamingSetLaunchOption: any; +} + +export interface Audio { + ClearDefaultDeviceOverride: any; + GetApps: any; + GetDevices: any; + RegisterForAppAdded: any; + RegisterForAppRemoved: any; + RegisterForAppVolumeChanged: any; + RegisterForDeviceAdded: any; + RegisterForDeviceRemoved: any; + RegisterForDeviceVolumeChanged: any; + RegisterForServiceConnectionStateChanges: any; + RegisterForVolumeButtonPressed: any; + SetAppVolume: any; + SetDefaultDeviceOverride: any; + SetDeviceVolume: any; +} + +export interface Devkit { + DeveloperModeChanged: any; + RegisterForPairingPrompt: any; + RespondToPairingPrompt: any; + SetPairing: any; +} + +export interface Display { + EnableUnderscan: any; + RegisterForBrightnessChanges: any; + SetBrightness: any; + SetUnderscanLevel: any; +} + +export interface WirelessNetwork { + Forget: any; + SetAutoconnect: any; +} + +export interface NetworkDevice { + Connect: any; + Disconnect: any; + WirelessNetwork: WirelessNetwork; +} + +export interface Network { + Device: NetworkDevice; + ForceRefresh: any; + ForceTestConnectivity: any; + GetProxyInfo: any; + RegisterForAppSummaryUpdate: any; + RegisterForConnectionStateUpdate: any; + RegisterForConnectivityTestChanges: any; + RegisterForDeviceChanges: any; + SetFakeLocalSystemState: any; + SetProxyInfo: any; + SetWifiEnabled: any; + StartScanningForNetworks: any; + StopScanningForNetworks: any; +} + +export interface Report { + GenerateSystemReport: any; + Submit: any; +} + +export interface BlockDevice { + Format: any; + Unmount: any; +} + +export interface Drive { + Eject: any; +} + +export interface SystemStorage { + BlockDevice: BlockDevice; + Drive: Drive; + RegisterForStateChanges: any; + TrimAll: any; +} + +export interface SystemUI { + CloseGameWindow: any; + GetGameWindowsInfo: any; + RegisterForFocusChangeEvents: any; + RegisterForOverlayGameWindowFocusChanged: any; + RegisterForSystemKeyEvents: any; +} + +export interface System { + Audio: Audio; + Devkit: Devkit; + Display: Display; + ExitFakeCaptivePortal: any; + FactoryReset: any; + FormatStorage: any; + GetLegacyAmpControlEnabled: any; + GetOSType: any; + GetSystemInfo: any; + IsDeckFactoryImage: any; + Network: Network; + NotifyGameOverlayStateChanged: any; + OpenFileDialog: any; + OpenLocalDirectoryInSystemExplorer: any; + RebootToAlternateSystemPartition: any; + RebootToFactoryTestImage: any; + RegisterForAirplaneModeChanges: any; + RegisterForBatteryStateChanges: any; + RegisterForFormatStorageProgress: any; + RegisterForOnResumeFromSuspend: any; + RegisterForOnSuspendRequest: any; + RegisterForSettingsChanges: any; + Report: Report; + RestartPC: any; + SetAirplaneMode: any; + SetLegacyAmpControl: any; + ShutdownPC: any; + SteamRuntimeSystemInfo: any; + Storage: SystemStorage; + SuspendPC: any; + SwitchToDesktop: any; + UI: SystemUI; + UpdateSettings: any; +} + +export interface UI { + EnsureMainWindowCreated: any; + ExitBigPictureMode: any; + GetDesiredSteamUIWindows: any; + GetOSEndOfLifeInfo: any; + GetUIMode: any; + NotifyAppInitialized: any; + RegisterDesiredSteamUIWindowsChanged: any; + RegisterForKioskModeResetSignal: any; + RegisterForUIModeChanged: any; + ResetErrorCondition: any; + SetUIMode: any; +} + +export interface URL { + ExecuteSteamURL: any; + GetSteamURLList: any; + GetWebSessionID: any; + RegisterForRunSteamURL: any; + RegisterForSteamURLChanges: any; +} + +export interface Updates { + ApplyUpdates: any; + CheckForUpdates: any; + GetCurrentOSBranch: any; + RegisterForUpdateStateChanges: any; + SelectOSBranch: any; +} + +export interface User { + AuthorizeMicrotxn: any; + CancelLogin: any; + CancelMicrotxn: any; + CancelShutdown: any; + ChangeUser: any; + Connect: any; + FlipToLogin: any; + ForceShutdown: any; + ForgetPassword: any; + GetIPCountry: any; + GetLoginProgress: any; + GetLoginUsers: any; + GoOffline: any; + GoOnline: any; + OptOutOfSurvey: any; + PrepareForSystemSuspend: any; + Reconnect: any; + RegisterForConnectionAttemptsThrottled: any; + RegisterForCurrentUserChanges: any; + RegisterForLoginStateChange: any; + RegisterForPrepareForSystemSuspendProgress: any; + RegisterForResumeSuspendedGamesProgress: any; + RegisterForShutdownDone: any; + RegisterForShutdownFailed: any; + RegisterForShutdownStart: any; + RegisterForShutdownState: any; + RemoveUser: any; + RequestSupportSystemReport: any; + ResumeSuspendedGames: any; + RunSurvey: any; + SendSurvey: any; + SetAsyncNotificationEnabled: any; + SetLoginCredentials: any; + SetOOBEComplete: any; + ShouldShowUserChooser: any; + SignOutAndRestart: any; + StartLogin: any; + StartOffline: any; + StartRestart: any; + StartShutdown: any; +} + +export interface WebChat { + BSuppressPopupsInRestore: any; + GetCurrentUserAccountID: any; + GetLocalAvatarBase64: any; + GetLocalPersonaName: any; + GetOverlayChatBrowserInfo: any; + GetPrivateConnectString: any; + GetPushToTalkEnabled: any; + GetSignIntoFriendsOnStart: any; + GetUIMode: any; + GetWebChatLanguage: any; + OnGroupChatUserStateChange: any; + OpenURLInClient: any; + RegisterForComputerActiveStateChange: any; + RegisterForFriendPostMessage: any; + RegisterForMouseXButtonDown: any; + RegisterForPushToTalkStateChange: any; + RegisterForUIModeChange: any; + RegisterForVRModeChange: any; + RegisterOverlayChatBrowserInfoChanged: any; + SetActiveClanChatIDs: any; + SetNumChatsWithUnreadPriorityMessages: any; + SetPersonaName: any; + SetPushToMuteEnabled: any; + SetPushToTalkEnabled: any; + SetPushToTalkHotKey: any; + SetPushToTalkMouseButton: any; + SetVoiceChatActive: any; + SetVoiceChatStatus: any; + ShowChatRoomGroupDialog: any; + ShowFriendChatDialog: any; + UnregisterForMouseXButtonDown: any; +} + +export interface WebUITransport { + GetTransportInfo: any; } export interface Window { - RegisterForExternalDisplayChanged: any; - SetManualDisplayScaleFactor: any; - SetAutoDisplayScale: any; + BringToFront: any; + Close: any; + DefaultMonitorHasFullscreenWindow: any; + FlashWindow: any; + GamescopeBlur: any; + GetDefaultMonitorDimensions: any; + GetMousePositionDetails: any; + GetWindowDimensions: any; + GetWindowRestoreDetails: any; + HideWindow: any; + IsWindowMaximized: any; + IsWindowMinimized: any; + MarkLastFocused: any; Minimize: any; - ProcessShuttingDown: any; - ToggleMaximize: any; MoveTo: any; + MoveToLocation: any; + PositionWindowRelative: any; + ProcessShuttingDown: any; ResizeTo: any; - SetMinSize: any; - SetResizeGrip: any; + RestoreWindowSizeAndPosition: any; + SetAutoDisplayScale: any; SetComposition: any; - GamescopeBlur: any; - BringToFront: any; - SetForegroundWindow: any; + SetHideOnClose: any; SetKeyFocus: any; - FlashWindow: any; - StopFlashWindow: any; - ShowWindow: any; - HideWindow: any; + SetManualDisplayScaleFactor: any; + SetMaxSize: any; + SetMinSize: any; + SetModal: any; + SetResizeGrip: any; SetWindowIcon: any; - GetWindowDimensions: any; - GetWindowRestoreDetails: any; - PositionWindowRelative: any; - GetMousePositionDetails: any; - IsWindowMinimized: any; - GetBrowserID: any; + ShowWindow: any; + StopFlashWindow: any; + ToggleFullscreen: any; + ToggleMaximize: any; } export interface SteamClient { Apps: Apps; - Browser: any; - BrowserView: any; - ClientNotifications: any; - Cloud: any; - Console: any; - Downloads: any; - FamilySharing: any; - FriendSettings: any; - Friends: any; - GameSessions: any; - Input: any; - InstallFolder: any; - Installs: any; - MachineStorage: any; - Messaging: any; - Notifications: any; - OpenVR: any; - Overlay: any; - Parental: any; + Auth: Auth; + Broadcast: Broadcast; + Browser: Browser; + BrowserView: BrowserView; + ClientNotifications: ClientNotifications; + Cloud: Cloud; + CommunityItems: CommunityItems; + Console: Console; + Customization: Customization; + Downloads: Downloads; + FamilySharing: FamilySharing; + Features: Features; + FriendSettings: FriendSettings; + Friends: Friends; + GameNotes: GameNotes; + GameSessions: GameSessions; + Input: Input; + InstallFolder: InstallFolder; + Installs: Installs; + MachineStorage: Storage; + Messaging: Messaging; + Music: Music; + Notifications: Notifications; + OpenVR: OpenVR; + Overlay: Overlay; + Parental: Parental; RegisterIFrameNavigatedCallback: any; - RemotePlay: any; - RoamingStorage: any; - Screenshots: any; - Settings: any; - SharedConnection: any; - Stats: any; - Storage: any; - Streaming: any; - System: any; - UI: any; - URL: any; - Updates: any; - User: any; - WebChat: any; + RemotePlay: RemotePlay; + RoamingStorage: Storage; + Screenshots: Screenshots; + ServerBrowser: ServerBrowser; + Settings: Settings; + SharedConnection: SharedConnection; + Stats: Stats; + SteamChina: SteamChina; + Storage: Storage; + Streaming: Streaming; + System: System; + UI: UI; + URL: URL; + Updates: Updates; + User: User; + WebChat: WebChat; + WebUITransport: WebUITransport; Window: Window; } From d4e18c0998d4462e1becf3880f6be1a3b0f9d404 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Sun, 27 Aug 2023 19:02:58 +0800 Subject: [PATCH 02/46] new: Document some SteamClient interfaces Using the SDH discord server, GitHub and some personal findings, I tried to document as much SteamClient functions as I can. --- src/globals/SteamClient.ts | 2224 +++++++++++++++++++++--------------- 1 file changed, 1296 insertions(+), 928 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 6ee886e1..ae9ddbe6 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -3,1132 +3,1500 @@ declare global { } export interface Apps { - AddShortcut: any; - AddUserTagToApps: any; - BackupFilesForApp: any; - BrowseScreenshotForApp: any; - BrowseScreenshotsForApp: any; - CancelBackup: any; - CancelGameAction: any; - CancelLaunch: any; - ClearAndSetUserTagsOnApp: any; - ClearCustomArtworkForApp: any; - ClearCustomLogoPositionForApp: any; - ClearProton: any; - ClearUserTagsOnApps: any; - ContinueGameAction: any; - CreateDesktopShortcutForApp: any; - DownloadWorkshopItem: any; - GetAchievementsInTimeRange: any; - GetActiveGameActions: any; - GetAvailableCompatTools: any; - GetBackupsInFolder: any; - GetCachedAppDetails: any; - GetCloudPendingRemoteOperations: any; - GetConflictingFileTimestamps: any; - GetDetailsForScreenshotUpload: any; - GetDetailsForScreenshotUploads: any; - GetDownloadedWorkshopItems: any; - GetDurationControlInfo: any; - GetFriendAchievementsForApp: any; - GetFriendsWhoPlay: any; - GetGameActionDetails: any; - GetGameActionForApp: any; - GetLaunchOptionsForApp: any; - GetLibraryBootstrapData: any; - GetMyAchievementsForApp: any; - GetPlaytime: any; - GetPrePurchasedApps: any; - GetResolutionOverrideForApp: any; - GetScreenshotInfo: any; - GetScreenshotsInTimeRange: any; - GetShortcutData: any; - GetShortcutDataForPath: any; - GetSoundtrackDetails: any; - GetStoreTagLocalization: any; - GetSubscribedWorkshopItems: any; - InstallFlatpakAppAndCreateShortcut: any; - JoinAppContentBeta: any; - JoinAppContentBetaByPassword: any; - ListFlatpakApps: any; - LoadEula: any; - MarkEulaAccepted: any; - MarkEulaRejected: any; - OpenAppSettingsDialog: any; - RaiseWindowForGame: any; - RegisterForAchievementChanges: any; - RegisterForAppBackupStatus: any; - RegisterForAppDetails: any; - RegisterForAppOverviewChanges: any; - RegisterForDRMFailureResponse: any; - RegisterForGameActionEnd: any; - RegisterForGameActionShowError: any; - RegisterForGameActionShowUI: any; - RegisterForGameActionStart: any; - RegisterForGameActionTaskChange: any; - RegisterForGameActionUserRequest: any; - RegisterForLocalizationChanges: any; - RegisterForPrePurchasedAppChanges: any; - RegisterForShowMarketingMessageDialog: any; - RegisterForWorkshopChanges: any; - RegisterForWorkshopItemDownloads: any; - RemoveShortcut: any; - RemoveUserTagFromApps: any; - ReportLibraryAssetCacheMiss: any; - ReportMarketingMessageDialogShown: any; - RequestIconDataForApp: any; - RequestLegacyCDKeysForApp: any; - ResetHiddenState: any; - RunGame: any; - SaveAchievementProgressCache: any; - ScanForInstalledNonSteamApps: any; - SetAppAutoUpdateBehavior: any; - SetAppBackgroundDownloadsBehavior: any; - SetAppCurrentLanguage: any; - SetAppHidden: any; - SetAppLaunchOptions: any; - SetAppResolutionOverride: any; - SetCachedAppDetails: any; - SetControllerRumblePreference: any; - SetCustomArtworkForApp: any; - SetCustomLogoPositionForApp: any; - SetDLCEnabled: any; - SetLocalScreenshotCaption: any; - SetLocalScreenshotPrivacy: any; - SetLocalScreenshotSpoiler: any; - SetShortcutExe: any; - SetShortcutIcon: any; - SetShortcutIsVR: any; - SetShortcutLaunchOptions: any; - SetShortcutName: any; - SetShortcutStartDir: any; - SetStreamingClientForApp: any; - SetThirdPartyControllerConfiguration: any; - ShowControllerConfigurator: any; - ShowStore: any; - SpecifyCompatTool: any; - StreamGame: any; - SubscribeWorkshopItem: any; - TerminateApp: any; - ToggleAllowDesktopConfiguration: any; - ToggleAppFamilyBlockedState: any; - ToggleAppSteamCloudEnabled: any; - ToggleAppSteamCloudSyncOnSuspendEnabled: any; - ToggleEnableDesktopTheatreForApp: any; - ToggleEnableSteamOverlayForApp: any; - ToggleOverrideResolutionForInternalDisplay: any; - UninstallFlatpakApp: any; - VerifyApp: any; + /** + * Adds a non-Steam game to the local Steam library. + * @param appName The name of the game. + * @param executablePath The path to the game executable. + * @param directory The working directory for the game. + * @param launchOptions Options to be passed when launching the game. + */ + AddShortcut(appName: string, executablePath: string, directory: string, launchOptions: string): any; + + AddUserTagToApps: any; + + /** + * Backups an app to the specified path. + * @param appId The ID of the application to back up. + * @param backupToPath The path to store the backup. + */ + BackupFilesForApp(appId: number, backupToPath: string): any; + + /** + * Opens the screenshot folder for a specific app. + * @param appId The ID of the app to browse screenshots for. + * @param param1 Additional parameter (exact usage may vary). + */ + BrowseScreenshotForApp(appId: string, param1: number): any; + + /** + * Opens the screenshot folder for a specific app. + * @param appId The ID of the app to browse screenshots for. + */ + BrowseScreenshotsForApp(appId: string): any; + + /** + * Cancels the current backup process. + */ + CancelBackup(): any; + + CancelGameAction: any; + CancelLaunch: any; + ClearAndSetUserTagsOnApp: any; + + /** + * Clears the custom artwork for a given application. + * @param appId The ID of the application to clear custom artwork for. + * @param assetType 0 = Grid, 1 = Hero, 2 = Logo + */ + ClearCustomArtworkForApp(appId: number, assetType: number): Promise; + + ClearCustomLogoPositionForApp: any; + ClearProton: any; + ClearUserTagsOnApps: any; + ContinueGameAction: any; + CreateDesktopShortcutForApp: any; + DownloadWorkshopItem: any; + GetAchievementsInTimeRange: any; + GetActiveGameActions: any; + + /** + * Retrieves a list of available compatibility tools for a specific application. + * @param appId The ID of the application to retrieve compatibility tools for. + * @returns A Promise that resolves to an array of CompatibilityToolInfo objects. + */ + GetAvailableCompatTools(appId: number): Promise; + + GetBackupsInFolder: any; + GetCachedAppDetails: any; + GetCloudPendingRemoteOperations: any; + GetConflictingFileTimestamps: any; + GetDetailsForScreenshotUpload: any; + GetDetailsForScreenshotUploads: any; + GetDownloadedWorkshopItems: any; + GetDurationControlInfo: any; + GetFriendAchievementsForApp: any; + GetFriendsWhoPlay: any; + GetGameActionDetails: any; + GetGameActionForApp: any; + GetLaunchOptionsForApp: any; + GetLibraryBootstrapData: any; + GetMyAchievementsForApp: any; + GetPlaytime: any; + GetPrePurchasedApps: any; + + /** + * Retrieves the resolution override for a specific application. + * @param appId The ID of the application to retrieve the resolution override for. + * @returns A Promise that resolves to a string of the resolution override. + */ + GetResolutionOverrideForApp(appId: number): Promise; + + GetScreenshotInfo: any; + GetScreenshotsInTimeRange: any; + GetShortcutData: any; + GetShortcutDataForPath: any; + GetSoundtrackDetails: any; + + GetStoreTagLocalization(tags: number[]): Promise; + + GetSubscribedWorkshopItems: any; + InstallFlatpakAppAndCreateShortcut: any; + JoinAppContentBeta: any; + JoinAppContentBetaByPassword: any; + ListFlatpakApps: any; + LoadEula: any; + MarkEulaAccepted: any; + MarkEulaRejected: any; + OpenAppSettingsDialog: any; + RaiseWindowForGame: any; + + /** + * Registers a callback function to be called when achievement changes occur. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. + */ + RegisterForAchievementChanges(callback: () => void): Unregisterable | any; + + RegisterForAppBackupStatus: Unregisterable | any; + + /** + * Registers a callback function to be called when app details change. + * @param appId The ID of the application to monitor. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. + */ + RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; + + RegisterForAppOverviewChanges: Unregisterable | any; + RegisterForDRMFailureResponse: Unregisterable | any; + + /** + * Registers a callback function to be called when a game action ends. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. + */ + RegisterForGameActionEnd(callback: (param0: number) => void): Unregisterable | any; + + RegisterForGameActionShowError: Unregisterable | any; + + /** + * Registers a callback function to be called when a game action UI is shown. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. + */ + RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; + + /** + * Registers a callback function to be called when a game action starts. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. + */ + RegisterForGameActionStart(callback: (actionType: any, appId: any) => void): Unregisterable | any; + + RegisterForGameActionTaskChange(callback: (data: any) => void): Unregisterable | any; + + RegisterForGameActionUserRequest(callback: (param0: number, appId: string, action: string, requestedAction: string, appId2: string) => void): Unregisterable | any; + + RegisterForLocalizationChanges: Unregisterable | any; + RegisterForPrePurchasedAppChanges: Unregisterable | any; + RegisterForShowMarketingMessageDialog: Unregisterable | any; + RegisterForWorkshopChanges: Unregisterable | any; + RegisterForWorkshopItemDownloads: Unregisterable | any; + + RemoveShortcut(appId: number): any; + + RemoveUserTagFromApps: any; + ReportLibraryAssetCacheMiss: any; + ReportMarketingMessageDialogShown: any; + RequestIconDataForApp: any; + RequestLegacyCDKeysForApp: any; + ResetHiddenState: any; + + RunGame(appId: string, param1: string, param2: number, param3: number): any; + + SaveAchievementProgressCache: any; + ScanForInstalledNonSteamApps: any; + SetAppAutoUpdateBehavior: any; + SetAppBackgroundDownloadsBehavior: any; + SetAppCurrentLanguage: any; + SetAppHidden: any; + + SetAppLaunchOptions(appId: number, launchOptions: string): any; + + SetAppResolutionOverride: any; + SetCachedAppDetails: any; + SetControllerRumblePreference: any; + + /** + * Sets the custom artwork for a given application. + * @param appId The ID of the application to set custom artwork for. + * @param base64Image Base64 encoded image. + * @param imageType "jpeg" or "png". + * @param assetType 0 = Grid, 1 = Hero, 2 = Logo. + * @returns A Promise that resolves after the custom artwork is set. + */ + SetCustomArtworkForApp(appId: number, base64Image: string, imageType: string, assetType: number): Promise; + + SetCustomLogoPositionForApp: any; + SetDLCEnabled: any; + SetLocalScreenshotCaption: any; + SetLocalScreenshotPrivacy: any; + SetLocalScreenshotSpoiler: any; + + SetShortcutExe(appId: number, path: string): any; + + SetShortcutIcon: any; + SetShortcutIsVR: any; + + SetShortcutLaunchOptions(appId: number, launchOptions: string): any; + + SetShortcutName(appId: number, shortcutName: string): any; + + SetShortcutStartDir(appId: number, directory: string): any; + + SetStreamingClientForApp: any; + SetThirdPartyControllerConfiguration: any; + ShowControllerConfigurator: any; + ShowStore: any; + + /** + * Specifies a compatibility tool by its name for a given application. If strToolName is an empty string, the specified application will no longer use a compatibility tool. + * @param appId The ID of the application to specify compatibility tool for. + * @param strToolName The name of the compatibility tool to specify. + */ + SpecifyCompatTool(appId: number, strToolName: string): void; + + StreamGame: any; + SubscribeWorkshopItem: any; + + TerminateApp(appId: string, param1: boolean): any; + + ToggleAllowDesktopConfiguration: any; + ToggleAppFamilyBlockedState: any; + ToggleAppSteamCloudEnabled: any; + ToggleAppSteamCloudSyncOnSuspendEnabled: any; + ToggleEnableDesktopTheatreForApp: any; + ToggleEnableSteamOverlayForApp: any; + ToggleOverrideResolutionForInternalDisplay: any; + UninstallFlatpakApp: any; + + /** + * Verifies the integrity of an app's files. + * @param appId The ID of the app to verify. + */ + VerifyApp(appId: number): any; } export interface Auth { - GetLocalHostname: any; - GetMachineID: any; - GetRefreshInfo: any; - GetSteamGuardData: any; - IsSecureComputer: any; - SetLoginToken: any; - SetSteamGuardData: any; - StartSignInFromCache: any; + GetLocalHostname(): Promise; + + GetMachineID(): Promise; + + GetRefreshInfo(): Promise; + + GetSteamGuardData: any; + + IsSecureComputer(): Promise; + + SetLoginToken: any; + SetSteamGuardData: any; + StartSignInFromCache: any; } export interface Broadcast { - ApproveViewerRequest: any; - InviteToWatch: any; - RegisterForBroadcastStatus: any; - RegisterForViewerRequests: any; - RejectViewerRequest: any; - StopBroadcasting: any; + ApproveViewerRequest: any; + InviteToWatch: any; + RegisterForBroadcastStatus: Unregisterable | any; + RegisterForViewerRequests: Unregisterable | any; + RejectViewerRequest: any; + StopBroadcasting: any; } export interface Browser { - BIsDirectHWNDBrowser: any; - BIsPopupWindow: any; - BIsVROverlayBrowser: any; - ClearAllBrowsingData: any; - ClearHistory: any; - CloseDevTools: any; - GetBrowserID: any; - GetSteamBrowserID: any; - GoBack: any; - GoForward: any; - HideCursorUntilMouseEvent: any; - InspectElement: any; - NotifyUserActivation: any; - OpenDevTools: any; - OpenURLForNavigation: any; - RegisterForGestureEvents: any; - RegisterForOpenNewTab: any; - SetShouldExitSteamOnBrowserClosed: any; - SetTouchGesturesToCancel: any; - StartDownload: any; + BIsDirectHWNDBrowser: any; + BIsPopupWindow: any; + BIsVROverlayBrowser: any; + ClearAllBrowsingData: any; + ClearHistory: any; + CloseDevTools: any; + GetBrowserID: Promise; + GetSteamBrowserID: Promise; // 16-bit unsigned integer? + GoBack: any; + GoForward: any; + HideCursorUntilMouseEvent: any; + InspectElement: any; + NotifyUserActivation: any; + OpenDevTools: any; + OpenURLForNavigation: any; + RegisterForGestureEvents: Unregisterable | any; + RegisterForOpenNewTab: Unregisterable | any; + SetShouldExitSteamOnBrowserClosed: any; + SetTouchGesturesToCancel: any; + StartDownload: any; } export interface BrowserView { - Create: any; - CreatePopup: any; - Destroy: any; - PostMessageToParent: any; + Create: any; + CreatePopup: any; + Destroy: any; + PostMessageToParent: any; } export interface ClientNotifications { - DisplayClientNotification: any; - OnRespondToClientNotification: any; + DisplayClientNotification: any; + OnRespondToClientNotification: any; } export interface Cloud { - ResolveAppSyncConflict: any; - RetryAppSync: any; + ResolveAppSyncConflict: any; + RetryAppSync: any; } export interface CommunityItems { - DownloadItemAsset: any; - GetItemAssetPath: any; - RemoveDownloadedItemAsset: any; + DownloadItemAsset: any; + GetItemAssetPath: any; + RemoveDownloadedItemAsset: any; } export interface Console { - ExecCommand: any; - GetAutocompleteSuggestions: any; - RegisterForSpewOutput: any; + ExecCommand(command: string): void; + + GetAutocompleteSuggestions(command: string): Promise; + + RegisterForSpewOutput(callback: (spewOutput: SpewOutput) => void): Unregisterable | any; } export interface Customization { - GenerateLocalStartupMoviesThumbnails: any; - GetDownloadedStartupMovies: any; - GetLocalStartupMovies: any; + GenerateLocalStartupMoviesThumbnails: any; + GetDownloadedStartupMovies: any; + GetLocalStartupMovies: any; } export interface Downloads { - EnableAllDownloads: any; - MoveAppUpdateDown: any; - MoveAppUpdateUp: any; - PauseAppUpdate: any; - QueueAppUpdate: any; - RegisterForDownloadItems: any; - RegisterForDownloadOverview: any; - RemoveFromDownloadList: any; - ResumeAppUpdate: any; - SetLaunchOnUpdateComplete: any; - SetQueueIndex: any; - SuspendDownloadThrottling: any; - SuspendLanPeerContent: any; + EnableAllDownloads: any; + MoveAppUpdateDown: any; + MoveAppUpdateUp: any; + PauseAppUpdate: any; + QueueAppUpdate: any; + + RegisterForDownloadItems(callback: (isDownloading: boolean, downloadItems: DownloadItem[]) => void): Unregisterable | any; + + RegisterForDownloadOverview(callback: (downloadOverview: DownloadOverview) => void): Unregisterable | any; + + RemoveFromDownloadList: any; + ResumeAppUpdate: any; + SetLaunchOnUpdateComplete: any; + SetQueueIndex: any; + SuspendDownloadThrottling: any; + SuspendLanPeerContent: any; } export interface FamilySharing { - AuthorizeLocalDevice: any; - DeauthorizeLocalDevice: any; - RequestFamilySharingAuthorization: any; - UpdateAuthorizedBorrower: any; + AuthorizeLocalDevice: any; + DeauthorizeLocalDevice: any; + RequestFamilySharingAuthorization: any; + UpdateAuthorizedBorrower: any; } export interface Features { - SteamInitsPopups: any; + SteamInitsPopups: any; } export interface FriendSettings { - GetEnabledFeatures: any; - RegisterForSettingsChanged: any; - SetFriendSettings: any; + GetEnabledFeatures: any; + RegisterForSettingsChanged: any; + SetFriendSettings: any; } export interface Friends { - AddFriend: any; - GetCoplayData: any; - InviteUserToCurrentGame: any; - InviteUserToGame: any; - InviteUserToLobby: any; - InviteUserToRemotePlayTogetherCurrentGame: any; - RegisterForVoiceChatStatus: any; - RemoveFriend: any; + AddFriend: any; + GetCoplayData: any; + InviteUserToCurrentGame: any; + InviteUserToGame: any; + InviteUserToLobby: any; + InviteUserToRemotePlayTogetherCurrentGame: any; + RegisterForVoiceChatStatus: any; + RemoveFriend: any; } export interface GameNotes { - DeleteImage: any; - DeleteNotes: any; - GetNotes: any; - GetNotesMetadata: any; - GetNumNotes: any; - GetQuota: any; - IterateNotes: any; - ResolveSyncConflicts: any; - SaveNotes: any; - SyncToClient: any; - SyncToServer: any; - UploadImage: any; + DeleteImage: any; + DeleteNotes: any; + GetNotes: any; + GetNotesMetadata: any; + GetNumNotes: any; + GetQuota: any; + IterateNotes: any; + ResolveSyncConflicts: any; + SaveNotes: any; + SyncToClient: any; + SyncToServer: any; + UploadImage: any; } export interface GameSessions { - RegisterForAchievementNotification: any; - RegisterForAppLifetimeNotifications: any; - RegisterForScreenshotNotification: any; + RegisterForAchievementNotification(callback: (achievementNotification: AchievementNotification) => void): Unregisterable | any; + + RegisterForAppLifetimeNotifications(callback: (appLifetimeNotification: AppLifetimeNotification) => void): Unregisterable | any; + + RegisterForScreenshotNotification(callback: (screenshotNotification: ScreenshotNotification) => void): Unregisterable | any; } export interface Input { - BIsSteamController: any; - BSupportsControllerLEDColor: any; - CalibrateControllerIMU: any; - CalibrateControllerJoystick: any; - CalibrateControllerTrackpads: any; - CancelGyroSWCalibration: any; - ClearSelectedConfigForApp: any; - CloseDesktopConfigurator: any; - ControllerKeyboardSendText: any; - ControllerKeyboardSetKeyState: any; - DeauthorizeControllerAccount: any; - DecrementCloudedControllerConfigsCounter: any; - DeletePersonalControllerConfiguration: any; - DuplicateControllerConfigurationSourceMode: any; - EndControllerDeviceSupportFlow: any; - ExportCurrentControllerConfiguration: any; - ForceConfiguratorFocus: any; - ForceSimpleHapticEvent: any; - FreeControllerConfig: any; - GetConfigForAppAndController: any; - GetControllerMappingString: any; - GetSteamControllerDongleState: any; - GetTouchMenuIconsForApp: any; - GetXboxDriverInstallState: any; - IdentifyController: any; - InitControllerSounds: any; - InitializeControllerPersonalizationSettings: any; - ModalKeyboardDismissed: any; - OpenDesktopConfigurator: any; - PreviewConfiguForAppAndController: any; - PreviewControllerLEDColor: any; - QueryControllerConfigsForApp: any; - RegisterForActiveControllerChanges: any; - RegisterForConfigSelectionChanges: any; - RegisterForControllerAccountChanges: any; - RegisterForControllerAnalogInputMessages: any; - RegisterForControllerCommandMessages: any; - RegisterForControllerConfigCloudStateChanges: any; - RegisterForControllerConfigInfoMessages: any; - RegisterForControllerInputMessages: any; - RegisterForControllerListChanges: any; - RegisterForControllerStateChanges: any; - RegisterForGameKeyboardMessages: any; - RegisterForRemotePlayConfigChanges: any; - RegisterForShowControllerLayoutPreviewMessages: any; - RegisterForTouchMenuInputMessages: any; - RegisterForTouchMenuMessages: any; - RegisterForUIVisualization: any; - RegisterForUnboundControllerListChanges: any; - RegisterForUserDismissKeyboardMessages: any; - RegisterForUserKeyboardMessages: any; - RequestGyroActive: any; - RequestRemotePlayControllerConfigs: any; - ResetControllerBindings: any; - ResolveCloudedControllerConfigConflict: any; - RestoreControllerPersonalizationSettings: any; - SaveControllerCalibration: any; - SaveControllerPersonalizationSettings: any; - SaveControllerSounds: any; - SaveEditingControllerConfiguration: any; - SetActiveControllerAccount: any; - SetControllerConfigurationModeShiftBinding: any; - SetControllerHapticSetting: any; - SetControllerMappingString: any; - SetControllerNintendoLayoutSetting: any; - SetControllerPersonalizationName: any; - SetControllerPersonalizationSetting: any; - SetControllerPersonalizationSettingFloat: any; - SetControllerRumbleSetting: any; - SetCursorActionset: any; - SetEditingControllerConfigurationActionSet: any; - SetEditingControllerConfigurationInputActivator: any; - SetEditingControllerConfigurationInputActivatorEnabled: any; - SetEditingControllerConfigurationInputBinding: any; - SetEditingControllerConfigurationMiscSetting: any; - SetEditingControllerConfigurationSourceMode: any; - SetGamepadKeyboardText: any; - SetKeyboardActionset: any; - SetMousePosition: any; - SetSelectedConfigForApp: any; - SetSteamControllerDonglePairingMode: any; - SetVirtualMenuKeySelected: any; - SetWebBrowserActionset: any; - SetXboxDriverInstallState: any; - ShowControllerSettings: any; - StandaloneKeyboardDismissed: any; - StartControllerDeviceSupportFlow: any; - StartEditingControllerConfigurationForAppIDAndControllerIndex: any; - StartGyroSWCalibration: any; - StopEditingControllerConfiguration: any; - SwapControllerModeInputBindings: any; - SwapControllerOrder: any; - SyncCloudedControllerConfigs: any; - TriggerHapticPulse: any; - TriggerSimpleHapticEvent: any; - UnregisterForControllerStateChanges: any; - UnregisterForUIVisualization: any; - UploadChangesForCloudedControllerConfigs: any; + BIsSteamController: any; + BSupportsControllerLEDColor: any; + CalibrateControllerIMU: any; + CalibrateControllerJoystick: any; + CalibrateControllerTrackpads: any; + CancelGyroSWCalibration: any; + ClearSelectedConfigForApp: any; + CloseDesktopConfigurator: any; + ControllerKeyboardSendText: any; + ControllerKeyboardSetKeyState: any; + DeauthorizeControllerAccount: any; + DecrementCloudedControllerConfigsCounter: any; + DeletePersonalControllerConfiguration: any; + DuplicateControllerConfigurationSourceMode: any; + EndControllerDeviceSupportFlow: any; + ExportCurrentControllerConfiguration: any; + ForceConfiguratorFocus: any; + ForceSimpleHapticEvent: any; + FreeControllerConfig: any; + GetConfigForAppAndController: any; + GetControllerMappingString: any; + GetSteamControllerDongleState: any; + GetTouchMenuIconsForApp: any; + GetXboxDriverInstallState: any; + IdentifyController: any; + InitControllerSounds: any; + InitializeControllerPersonalizationSettings: any; + ModalKeyboardDismissed: any; + OpenDesktopConfigurator: any; + PreviewConfiguForAppAndController: any; + PreviewControllerLEDColor: any; + QueryControllerConfigsForApp: any; + RegisterForActiveControllerChanges: any; + RegisterForConfigSelectionChanges: any; + RegisterForControllerAccountChanges: any; + RegisterForControllerAnalogInputMessages: any; + RegisterForControllerCommandMessages: any; + RegisterForControllerConfigCloudStateChanges: any; + RegisterForControllerConfigInfoMessages: any; + + RegisterForControllerInputMessages(callback: () => void): any; + + RegisterForControllerListChanges: any; + RegisterForControllerStateChanges: any; + RegisterForGameKeyboardMessages: any; + RegisterForRemotePlayConfigChanges: any; + RegisterForShowControllerLayoutPreviewMessages: any; + RegisterForTouchMenuInputMessages: any; + RegisterForTouchMenuMessages: any; + RegisterForUIVisualization: any; + RegisterForUnboundControllerListChanges: any; + RegisterForUserDismissKeyboardMessages: any; + RegisterForUserKeyboardMessages: any; + RequestGyroActive: any; + RequestRemotePlayControllerConfigs: any; + ResetControllerBindings: any; + ResolveCloudedControllerConfigConflict: any; + RestoreControllerPersonalizationSettings: any; + SaveControllerCalibration: any; + SaveControllerPersonalizationSettings: any; + SaveControllerSounds: any; + SaveEditingControllerConfiguration: any; + SetActiveControllerAccount: any; + SetControllerConfigurationModeShiftBinding: any; + SetControllerHapticSetting: any; + SetControllerMappingString: any; + SetControllerNintendoLayoutSetting: any; + SetControllerPersonalizationName: any; + SetControllerPersonalizationSetting: any; + SetControllerPersonalizationSettingFloat: any; + SetControllerRumbleSetting: any; + SetCursorActionset: any; + SetEditingControllerConfigurationActionSet: any; + SetEditingControllerConfigurationInputActivator: any; + SetEditingControllerConfigurationInputActivatorEnabled: any; + SetEditingControllerConfigurationInputBinding: any; + SetEditingControllerConfigurationMiscSetting: any; + SetEditingControllerConfigurationSourceMode: any; + SetGamepadKeyboardText: any; + SetKeyboardActionset: any; + + SetMousePosition(x: number, y: number): any; + + SetSelectedConfigForApp: any; + SetSteamControllerDonglePairingMode: any; + SetVirtualMenuKeySelected: any; + SetWebBrowserActionset: any; + SetXboxDriverInstallState: any; + ShowControllerSettings: any; + StandaloneKeyboardDismissed: any; + StartControllerDeviceSupportFlow: any; + StartEditingControllerConfigurationForAppIDAndControllerIndex: any; + StartGyroSWCalibration: any; + StopEditingControllerConfiguration: any; + SwapControllerModeInputBindings: any; + SwapControllerOrder: any; + SyncCloudedControllerConfigs: any; + TriggerHapticPulse: any; + TriggerSimpleHapticEvent: any; + UnregisterForControllerStateChanges: any; + UnregisterForUIVisualization: any; + UploadChangesForCloudedControllerConfigs: any; } export interface InstallFolder { - AddInstallFolder: any; - BrowseFilesInFolder: any; - CancelMove: any; - GetInstallFolders: any; - GetPotentialFolders: any; - MoveInstallFolderForApp: any; - RefreshFolders: any; - RegisterForInstallFolderChanges: any; - RegisterForMoveContentProgress: any; - RegisterForRepairFolderFinished: any; - RemoveInstallFolder: any; - RepairInstallFolder: any; - SetDefaultInstallFolder: any; - SetFolderLabel: any; + AddInstallFolder: any; + BrowseFilesInFolder: any; + CancelMove: any; + + /** + * Retrieves a list of install folders. + * @returns A Promise that resolves to an array of InstallFolder objects. + */ + GetInstallFolders(): Promise; + + GetPotentialFolders: any; + MoveInstallFolderForApp: any; + RefreshFolders: any; + RegisterForInstallFolderChanges: Unregisterable | any; + RegisterForMoveContentProgress: Unregisterable | any; + RegisterForRepairFolderFinished: Unregisterable | any; + RemoveInstallFolder: any; + RepairInstallFolder: any; + SetDefaultInstallFolder: any; + SetFolderLabel: any; } export interface Installs { - CancelInstall: any; - ContinueInstall: any; - GetInstallManagerInfo: any; - OpenInstallBackup: any; - OpenInstallWizard: any; - OpenUninstallWizard: any; - RegisterForShowConfirmUninstall: any; - RegisterForShowFailedUninstall: any; - RegisterForShowInstallWizard: any; - RegisterForShowRegisterCDKey: any; - SetAppList: any; - SetCreateShortcuts: any; - SetInstallFolder: any; + CancelInstall: any; + ContinueInstall: any; + GetInstallManagerInfo: any; + OpenInstallBackup: any; + OpenInstallWizard: any; + OpenUninstallWizard: any; + RegisterForShowConfirmUninstall: Unregisterable | any; + RegisterForShowFailedUninstall: Unregisterable | any; + + RegisterForShowInstallWizard(callback: (data: InstallWizardInfo) => void): Unregisterable | any; + + RegisterForShowRegisterCDKey: any; + SetAppList: any; + SetCreateShortcuts: any; + SetInstallFolder: any; } export interface Messaging { - RegisterForMessages: any; - PostMessage: any; + RegisterForMessages(accountName: string, callback: (param0: any) => void): Unregisterable | any; + + PostMessage(): void; } export interface Music { - DecreaseVolume: any; - IncreaseVolume: any; - PlayEntry: any; - PlayNext: any; - PlayPrevious: any; - RegisterForMusicPlaybackChanges: any; - RegisterForMusicPlaybackPosition: any; - SetPlaybackPosition: any; - SetPlayingRepeatStatus: any; - SetPlayingShuffled: any; - SetVolume: any; - ToggleMuteVolume: any; - TogglePlayPause: any; + DecreaseVolume: any; + IncreaseVolume: any; + PlayEntry: any; + PlayNext: any; + PlayPrevious: any; + RegisterForMusicPlaybackChanges: Unregisterable | any; + RegisterForMusicPlaybackPosition: Unregisterable | any; + SetPlaybackPosition: any; + SetPlayingRepeatStatus: any; + SetPlayingShuffled: any; + SetVolume: any; + ToggleMuteVolume: any; + TogglePlayPause: any; } export interface Notifications { - RegisterForNotifications: any; + RegisterForNotifications(callback: (param0: number, param1: number, param2: ArrayBuffer) => void): Unregisterable | any; } export interface VRDevice { - BIsConnected: any; - RegisterForDeviceConnectivityChange: any; + BIsConnected: any; + RegisterForDeviceConnectivityChange: Unregisterable | any; } export interface DeviceProperties { - GetBoolDeviceProperty: any; - GetDoubleDeviceProperty: any; - GetFloatDeviceProperty: any; - GetInt32DeviceProperty: any; - GetStringDeviceProperty: any; - RegisterForDevicePropertyChange: any; + GetBoolDeviceProperty: any; + GetDoubleDeviceProperty: any; + GetFloatDeviceProperty: any; + GetInt32DeviceProperty: any; + GetStringDeviceProperty: any; + RegisterForDevicePropertyChange: Unregisterable | any; } export interface Keyboard { - SendText: any; + SendText: any; } export interface VROverlay { - ShowDashboard: any; + ShowDashboard: any; } export interface OpenVR { - Device: VRDevice; - DeviceProperties: DeviceProperties; - GetWebSecret: any; - HideKeyboard: any; - InstallVR: any; - Keyboard: Keyboard; - QuitAllVR: any; - RegisterForInstallDialog: any; - RegisterStartupErrors: any; - RegisterForVRHardwareDetected: any; - RegisterForVRModeChange: any; - SendKeyboardDone: any; - SetOverlayInteractionAffordance: any; - ShowKeyboard: any; - StartVR: any; - TriggerOverlayHapticEffect: any; - VROverlay: VROverlay; + Device: VRDevice; + DeviceProperties: DeviceProperties; + GetWebSecret: any; + HideKeyboard: any; + InstallVR: any; + Keyboard: Keyboard; + QuitAllVR: any; + RegisterForInstallDialog: Unregisterable | any; + RegisterStartupErrors: Unregisterable | any; + RegisterForVRHardwareDetected: Unregisterable | any; + RegisterForVRModeChange: Unregisterable | any; + SendKeyboardDone: any; + SetOverlayInteractionAffordance: any; + ShowKeyboard: any; + StartVR: any; + TriggerOverlayHapticEffect: any; + VROverlay: VROverlay; } export interface Overlay { - DestroyGamePadUIDesktopConfiguratorWindow: any; - GetOverlayBrowserInfo: any; - HandleGameWebCallback: any; - HandleProtocolForOverlayBrowser: any; - RegisterForActiveOverlayRequests: any; - RegisterForMicroTxnAuth: any; - RegisterForMicroTxnAuthDismiss: any; - RegisterForNotificationPositionChanged: any; - RegisterForOverlayActivated: any; - RegisterForOverlayBrowserProtocols: any; - RegisterOverlayBrowserInfoChanged: any; - SetOverlayState: any; + DestroyGamePadUIDesktopConfiguratorWindow: any; + GetOverlayBrowserInfo: any; + HandleGameWebCallback: any; + HandleProtocolForOverlayBrowser: any; + RegisterForActiveOverlayRequests: Unregisterable | any; + RegisterForMicroTxnAuth: Unregisterable | any; + RegisterForMicroTxnAuthDismiss: Unregisterable | any; + RegisterForNotificationPositionChanged: Unregisterable | any; + RegisterForOverlayActivated: Unregisterable | any; + RegisterForOverlayBrowserProtocols: Unregisterable | any; + RegisterOverlayBrowserInfoChanged: Unregisterable | any; + SetOverlayState: any; } export interface Parental { - LockParentalLock: any; - RegisterForParentalLockStatus: any; - UnlockParentalLock: any; + LockParentalLock: any; + RegisterForParentalLockStatus: Unregisterable | any; + UnlockParentalLock: any; } export interface RemotePlay { - BCanAcceptInviteForGame: any; - BCanCreateInviteForGame: any; - BCanHostIsolatedGameAudio: any; - BEnabled: any; - BRemotePlayTogetherGuestOnPhoneOrTablet: any; - BRemotePlayTogetherGuestSupported: any; - CancelInviteAndSession: any; - CancelInviteAndSessionWithGuestID: any; - CloseGroup: any; - CreateGroup: any; - CreateInviteAndSession: any; - CreateInviteAndSessionWithGuestID: any; - GetClientStreamingBitrate: any; - GetClientStreamingQuality: any; - GetControllerType: any; - GetGameSystemVolume: any; - GetPerUserInputSettings: any; - GetPerUserInputSettingsWithGuestID: any; - IdentifyController: any; - InstallAudioDriver: any; - InstallInputDriver: any; - MoveControllerToSlot: any; - RegisterForAudioDriverPrompt: any; - RegisterForBitrateOverride: any; - RegisterForControllerIndexSet: any; - RegisterForDevicesChanges: any; - RegisterForGroupCreated: any; - RegisterForGroupDisbanded: any; - RegisterForInputDriverPrompt: any; - RegisterForInputDriverRestartNotice: any; - RegisterForInputUsed: any; - RegisterForInviteResult: any; - RegisterForNetworkUtilizationUpdate: any; - RegisterForPlaceholderStateChanged: any; - RegisterForPlayerInputSettingsChanged: any; - RegisterForQualityOverride: any; - RegisterForRemoteClientLaunchFailed: any; - RegisterForRemoteClientStarted: any; - RegisterForRemoteClientStopped: any; - RegisterForSettingsChanges: any; - SetClientStreamingBitrate: any; - SetClientStreamingQuality: any; - SetGameSystemVolume: any; - SetPerUserControllerInputEnabled: any; - SetPerUserControllerInputEnabledWithGuestID: any; - SetPerUserKeyboardInputEnabled: any; - SetPerUserKeyboardInputEnabledWithGuestID: any; - SetPerUserMouseInputEnabled: any; - SetPerUserMouseInputEnabledWithGuestID: any; - SetRemoteDeviceAuthorized: any; - SetRemoteDevicePIN: any; - SetRemotePlayEnabled: any; - SetStreamingClientConfig: any; - SetStreamingClientConfigEnabled: any; - SetStreamingDesktopToRemotePlayTogetherEnabled: any; - SetStreamingP2PScope: any; - SetStreamingServerConfig: any; - SetStreamingServerConfigEnabled: any; - StopStreamingClient: any; - StopStreamingSession: any; - StopStreamingSessionAndSuspendDevice: any; - UnlockH264: any; - UnpairRemoteDevices: any; + BCanAcceptInviteForGame: any; + BCanCreateInviteForGame: any; + BCanHostIsolatedGameAudio: any; + BEnabled: any; + BRemotePlayTogetherGuestOnPhoneOrTablet: any; + BRemotePlayTogetherGuestSupported: any; + CancelInviteAndSession: any; + CancelInviteAndSessionWithGuestID: any; + CloseGroup: any; + CreateGroup: any; + CreateInviteAndSession: any; + CreateInviteAndSessionWithGuestID: any; + GetClientStreamingBitrate: any; + GetClientStreamingQuality: any; + GetControllerType: any; + GetGameSystemVolume: any; + GetPerUserInputSettings: any; + GetPerUserInputSettingsWithGuestID: any; + IdentifyController: any; + InstallAudioDriver: any; + InstallInputDriver: any; + MoveControllerToSlot: any; + RegisterForAudioDriverPrompt: Unregisterable | any; + RegisterForBitrateOverride: Unregisterable | any; + RegisterForControllerIndexSet: Unregisterable | any; + RegisterForDevicesChanges: Unregisterable | any; + RegisterForGroupCreated: Unregisterable | any; + RegisterForGroupDisbanded: Unregisterable | any; + RegisterForInputDriverPrompt: Unregisterable | any; + RegisterForInputDriverRestartNotice: Unregisterable | any; + RegisterForInputUsed: Unregisterable | any; + RegisterForInviteResult: Unregisterable | any; + RegisterForNetworkUtilizationUpdate: Unregisterable | any; + RegisterForPlaceholderStateChanged: Unregisterable | any; + RegisterForPlayerInputSettingsChanged: Unregisterable | any; + RegisterForQualityOverride: Unregisterable | any; + RegisterForRemoteClientLaunchFailed: Unregisterable | any; + RegisterForRemoteClientStarted: Unregisterable | any; + RegisterForRemoteClientStopped: Unregisterable | any; + + RegisterForSettingsChanges(callback: (steamSettings: any) => void): Unregisterable | any; + + SetClientStreamingBitrate: any; + SetClientStreamingQuality: any; + SetGameSystemVolume: any; + SetPerUserControllerInputEnabled: any; + SetPerUserControllerInputEnabledWithGuestID: any; + SetPerUserKeyboardInputEnabled: any; + SetPerUserKeyboardInputEnabledWithGuestID: any; + SetPerUserMouseInputEnabled: any; + SetPerUserMouseInputEnabledWithGuestID: any; + SetRemoteDeviceAuthorized: any; + SetRemoteDevicePIN: any; + SetRemotePlayEnabled: any; + SetStreamingClientConfig: any; + SetStreamingClientConfigEnabled: any; + SetStreamingDesktopToRemotePlayTogetherEnabled: any; + SetStreamingP2PScope: any; + SetStreamingServerConfig: any; + SetStreamingServerConfigEnabled: any; + StopStreamingClient: any; + StopStreamingSession: any; + StopStreamingSessionAndSuspendDevice: any; + UnlockH264: any; + UnpairRemoteDevices: any; } export interface Screenshots { - DeleteLocalScreenshot: any; - GetAllAppsLocalScreenshots: any; - GetAllAppsLocalScreenshotsCount: any; - GetAllAppsLocalScreenshotsRange: any; - GetAllLocalScreenshots: any; - GetGameWithLocalScreenshots: any; - GetLastScreenshotTaken: any; - GetLocalScreenshot: any; - GetLocalScreenshotCount: any; - GetNumGamesWithLocalScreenshots: any; - ShowScreenshotInSystemViewer: any; - ShowScreenshotOnDisk: any; - UploadLocalScreenshot: any; + DeleteLocalScreenshot: any; + + GetAllAppsLocalScreenshots(): Promise; + + GetAllAppsLocalScreenshotsCount: any; + GetAllAppsLocalScreenshotsRange: any; + + GetAllLocalScreenshots(): Promise; + + GetGameWithLocalScreenshots: any; + + GetLastScreenshotTaken(): Promise; + + GetLocalScreenshot: any; + GetLocalScreenshotCount: any; + GetNumGamesWithLocalScreenshots: any; + ShowScreenshotInSystemViewer: any; + ShowScreenshotOnDisk: any; + UploadLocalScreenshot: any; } export interface ServerBrowser { - AddFavoriteServer: any; - AddFavoriteServersByIP: any; - CancelServerQuery: any; - ConnectToServer: any; - CreateFriendGameInfoDialog: any; - CreateServerGameInfoDialog: any; - DestroyGameInfoDialog: any; - DestroyServerListRequest: any; - GetMultiplayerGames: any; - GetServerListPreferences: any; - PingServer: any; - RegisterForFavorites: any; - RegisterForFriendGamePlayed: any; - RegisterForGameInfoDialogs: any; - RegisterForPlayerDetails: any; - RegisterForServerInfo: any; - RemoveFavoriteServer: any; - RemoveHistoryServer: any; - RequestPlayerDetails: any; - SetServerListPreferences: any; + AddFavoriteServer: any; + AddFavoriteServersByIP: any; + CancelServerQuery: any; + ConnectToServer: any; + CreateFriendGameInfoDialog: any; + CreateServerGameInfoDialog: any; + DestroyGameInfoDialog: any; + DestroyServerListRequest: any; + GetMultiplayerGames: any; + GetServerListPreferences: any; + PingServer: any; + RegisterForFavorites: any; + RegisterForFriendGamePlayed: any; + RegisterForGameInfoDialogs: any; + RegisterForPlayerDetails: any; + RegisterForServerInfo: any; + RemoveFavoriteServer: any; + RemoveHistoryServer: any; + RequestPlayerDetails: any; + SetServerListPreferences: any; } export interface Settings { - AddClientBeta: any; - ClearAllHTTPCaches: any; - ClearDownloadCache: any; - GetAccountSettings: any; - GetAppUsesP2PVoice: any; - GetAvailableLanguages: any; - GetAvailableTimeZones: any; - GetCurrentLanguage: any; - GetGlobalCompatTools: any; - GetMonitorInfo: any; - GetOOBETestMode: any; - GetRegisteredSteamDeck: any; - GetTimeZone: any; - GetWindowed: any; - IgnoreSteamDeckRewards: any; - OpenWindowsMicSettings: any; - RegisterForMicVolumeUpdates: any; - RegisterForSettingsArrayChanges: any; - RegisterForSettingsChanges: any; - RegisterForTimeZoneChange: any; - ReinitMicSettings: any; - RequestDeviceAuthInfo: any; - SelectClientBeta: any; - SetCefRemoteDebuggingEnabled: any; - SetCurrentLanguage: any; - SetEnableSoftProcessKill: any; - SetEnableTestUpdaters: any; - SetForceOOBE: any; - SetHostname: any; - SetMicTestMode: any; - SetOOBETestMode: any; - SetOverrideBrowserComposerMode: any; - SetPreferredMonitor: any; - SetRegisteredSteamDeck: any; - SetSaveAccountCredentials: any; - SetSetting: any; - SetShowMobxDevTools: any; - SetSteamPlayEnabled: any; - SetTimeZone: any; - SetUseNintendoButtonLayout: any; - SetWindowed: any; - SpecifyGlobalCompatTool: any; - ToggleSteamInstall: any; + AddClientBeta: any; + ClearAllHTTPCaches: any; + ClearDownloadCache: any; + GetAccountSettings: any; + GetAppUsesP2PVoice: any; + GetAvailableLanguages: any; + GetAvailableTimeZones: any; + GetCurrentLanguage: any; + + GetGlobalCompatTools(): Promise; + + GetMonitorInfo: any; + GetOOBETestMode: any; + GetRegisteredSteamDeck: any; + GetTimeZone: any; + GetWindowed: any; + IgnoreSteamDeckRewards: any; + OpenWindowsMicSettings: any; + RegisterForMicVolumeUpdates: Unregisterable | any; + RegisterForSettingsArrayChanges: Unregisterable | any; + RegisterForSettingsChanges: Unregisterable | any; + RegisterForTimeZoneChange: Unregisterable | any; + ReinitMicSettings: any; + RequestDeviceAuthInfo: any; + SelectClientBeta: any; + + SetCefRemoteDebuggingEnabled(value: boolean): any; + + SetCurrentLanguage: any; + SetEnableSoftProcessKill: any; + SetEnableTestUpdaters: any; + SetForceOOBE: any; + SetHostname: any; + SetMicTestMode: any; + SetOOBETestMode: any; + SetOverrideBrowserComposerMode: any; + SetPreferredMonitor: any; + SetRegisteredSteamDeck: any; + SetSaveAccountCredentials: any; + SetSetting: any; + SetShowMobxDevTools: any; + SetSteamPlayEnabled: any; + SetTimeZone: any; + SetUseNintendoButtonLayout: any; + SetWindowed: any; + SpecifyGlobalCompatTool: any; + ToggleSteamInstall: any; } export interface SharedConnection { - AllocateSharedConnection: any; - Close: any; - RegisterOnBinaryMessageReceived: any; - RegisterOnLogonInfoChanged: any; - RegisterOnMessageReceived: any; - SendMsg: any; - SendMsgAndAwaitBinaryResponse: any; - SubscribeToClientServiceMethod: any; - SubscribeToEMsg: any; + AllocateSharedConnection: any; + Close: any; + RegisterOnBinaryMessageReceived: Unregisterable | any; + RegisterOnLogonInfoChanged: Unregisterable | any; + RegisterOnMessageReceived: Unregisterable | any; + SendMsg: any; + SendMsgAndAwaitBinaryResponse: any; + SubscribeToClientServiceMethod: any; + SubscribeToEMsg: any; } export interface Stats { - RecordActivationEvent: any; - RecordDisplayEvent: any; + RecordActivationEvent: any; + RecordDisplayEvent: any; } export interface SteamChina { - GetCustomLauncherAppID: any; + GetCustomLauncherAppID: any; } export interface Storage { - DeleteKey: any; - GetJSON: any; - GetString: any; - SetObject: any; - SetString: any; + DeleteKey: any; + GetJSON: any; + GetString: any; + SetObject: any; + SetString: any; } export interface Streaming { - AcceptStreamingEULA: any; - CancelStreamGame: any; - RegisterForStreamingClientFinished: any; - RegisterForStreamingClientLaunchProgress: any; - RegisterForStreamingClientStarted: any; - RegisterForStreamingLaunchComplete: any; - RegisterForStreamingShowEula: any; - RegisterForStreamingShowIntro: any; - RegisterForStreamingShowLaunchOptions: any; - StreamingContinueStreamGame: any; - StreamingSetLaunchOption: any; + AcceptStreamingEULA: any; + CancelStreamGame: any; + RegisterForStreamingClientFinished: Unregisterable | any; + RegisterForStreamingClientLaunchProgress: Unregisterable | any; + RegisterForStreamingClientStarted: Unregisterable | any; + RegisterForStreamingLaunchComplete: Unregisterable | any; + RegisterForStreamingShowEula: Unregisterable | any; + RegisterForStreamingShowIntro: Unregisterable | any; + RegisterForStreamingShowLaunchOptions: Unregisterable | any; + StreamingContinueStreamGame: any; + StreamingSetLaunchOption: any; } export interface Audio { - ClearDefaultDeviceOverride: any; - GetApps: any; - GetDevices: any; - RegisterForAppAdded: any; - RegisterForAppRemoved: any; - RegisterForAppVolumeChanged: any; - RegisterForDeviceAdded: any; - RegisterForDeviceRemoved: any; - RegisterForDeviceVolumeChanged: any; - RegisterForServiceConnectionStateChanges: any; - RegisterForVolumeButtonPressed: any; - SetAppVolume: any; - SetDefaultDeviceOverride: any; - SetDeviceVolume: any; + ClearDefaultDeviceOverride: any; + GetApps: any; + GetDevices: any; + RegisterForAppAdded: Unregisterable | any; + RegisterForAppRemoved: Unregisterable | any; + RegisterForAppVolumeChanged: Unregisterable | any; + RegisterForDeviceAdded: Unregisterable | any; + RegisterForDeviceRemoved: Unregisterable | any; + RegisterForDeviceVolumeChanged: Unregisterable | any; + RegisterForServiceConnectionStateChanges: Unregisterable | any; + RegisterForVolumeButtonPressed: Unregisterable | any; + SetAppVolume: any; + SetDefaultDeviceOverride: any; + SetDeviceVolume: any; } export interface Devkit { - DeveloperModeChanged: any; - RegisterForPairingPrompt: any; - RespondToPairingPrompt: any; - SetPairing: any; + DeveloperModeChanged: any; + RegisterForPairingPrompt: Unregisterable | any; + RespondToPairingPrompt: any; + SetPairing: any; } export interface Display { - EnableUnderscan: any; - RegisterForBrightnessChanges: any; - SetBrightness: any; - SetUnderscanLevel: any; + EnableUnderscan: any; + + RegisterForBrightnessChanges(callback: (brightness: number) => void): Unregisterable | any; + + SetBrightness(brightness: number): any; + + SetUnderscanLevel: any; } export interface WirelessNetwork { - Forget: any; - SetAutoconnect: any; + Forget: any; + SetAutoconnect: any; } export interface NetworkDevice { - Connect: any; - Disconnect: any; - WirelessNetwork: WirelessNetwork; + Connect: any; + Disconnect: any; + WirelessNetwork: WirelessNetwork; } export interface Network { - Device: NetworkDevice; - ForceRefresh: any; - ForceTestConnectivity: any; - GetProxyInfo: any; - RegisterForAppSummaryUpdate: any; - RegisterForConnectionStateUpdate: any; - RegisterForConnectivityTestChanges: any; - RegisterForDeviceChanges: any; - SetFakeLocalSystemState: any; - SetProxyInfo: any; - SetWifiEnabled: any; - StartScanningForNetworks: any; - StopScanningForNetworks: any; + Device: NetworkDevice; + ForceRefresh: any; + ForceTestConnectivity: any; + GetProxyInfo: any; + RegisterForAppSummaryUpdate: Unregisterable | any; + RegisterForConnectionStateUpdate: Unregisterable | any; + RegisterForConnectivityTestChanges: Unregisterable | any; + RegisterForDeviceChanges: Unregisterable | any; + SetFakeLocalSystemState: any; + SetProxyInfo: any; + SetWifiEnabled: any; + StartScanningForNetworks: any; + StopScanningForNetworks: any; } export interface Report { - GenerateSystemReport: any; - Submit: any; + GenerateSystemReport: any; + Submit: any; } export interface BlockDevice { - Format: any; - Unmount: any; + Format: any; + Unmount: any; } export interface Drive { - Eject: any; + Eject: any; } export interface SystemStorage { - BlockDevice: BlockDevice; - Drive: Drive; - RegisterForStateChanges: any; - TrimAll: any; + BlockDevice: BlockDevice; + Drive: Drive; + RegisterForStateChanges: Unregisterable | any; + TrimAll: any; } export interface SystemUI { - CloseGameWindow: any; - GetGameWindowsInfo: any; - RegisterForFocusChangeEvents: any; - RegisterForOverlayGameWindowFocusChanged: any; - RegisterForSystemKeyEvents: any; + CloseGameWindow: any; + GetGameWindowsInfo: any; + RegisterForFocusChangeEvents: Unregisterable | any; + RegisterForOverlayGameWindowFocusChanged: Unregisterable | any; + + RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable | any; } export interface System { - Audio: Audio; - Devkit: Devkit; - Display: Display; - ExitFakeCaptivePortal: any; - FactoryReset: any; - FormatStorage: any; - GetLegacyAmpControlEnabled: any; - GetOSType: any; - GetSystemInfo: any; - IsDeckFactoryImage: any; - Network: Network; - NotifyGameOverlayStateChanged: any; - OpenFileDialog: any; - OpenLocalDirectoryInSystemExplorer: any; - RebootToAlternateSystemPartition: any; - RebootToFactoryTestImage: any; - RegisterForAirplaneModeChanges: any; - RegisterForBatteryStateChanges: any; - RegisterForFormatStorageProgress: any; - RegisterForOnResumeFromSuspend: any; - RegisterForOnSuspendRequest: any; - RegisterForSettingsChanges: any; - Report: Report; - RestartPC: any; - SetAirplaneMode: any; - SetLegacyAmpControl: any; - ShutdownPC: any; - SteamRuntimeSystemInfo: any; - Storage: SystemStorage; - SuspendPC: any; - SwitchToDesktop: any; - UI: SystemUI; - UpdateSettings: any; + Audio: Audio; + Devkit: Devkit; + Display: Display; + ExitFakeCaptivePortal: any; + FactoryReset: any; + FormatStorage: any; + GetLegacyAmpControlEnabled: any; + GetOSType: any; + GetSystemInfo: any; + IsDeckFactoryImage: any; + Network: Network; + NotifyGameOverlayStateChanged: any; + OpenFileDialog: any; + OpenLocalDirectoryInSystemExplorer: any; + RebootToAlternateSystemPartition: any; + RebootToFactoryTestImage: any; + + RegisterForAirplaneModeChanges(callback: (param0: any) => void): Unregisterable | any; + + RegisterForBatteryStateChanges: Unregisterable | any; + RegisterForFormatStorageProgress: Unregisterable | any; + + RegisterForOnResumeFromSuspend(callback: () => void): Unregisterable | any; + + RegisterForOnSuspendRequest(callback: () => void): Unregisterable | any; + + RegisterForSettingsChanges: Unregisterable | any; + Report: Report; + RestartPC: any; + SetAirplaneMode: any; + SetLegacyAmpControl: any; + + ShutdownPC(): any; + + SteamRuntimeSystemInfo: any; + Storage: SystemStorage; + SuspendPC: any; + SwitchToDesktop: any; + UI: SystemUI; + UpdateSettings: any; } export interface UI { - EnsureMainWindowCreated: any; - ExitBigPictureMode: any; - GetDesiredSteamUIWindows: any; - GetOSEndOfLifeInfo: any; - GetUIMode: any; - NotifyAppInitialized: any; - RegisterDesiredSteamUIWindowsChanged: any; - RegisterForKioskModeResetSignal: any; - RegisterForUIModeChanged: any; - ResetErrorCondition: any; - SetUIMode: any; + EnsureMainWindowCreated: any; + ExitBigPictureMode: any; + GetDesiredSteamUIWindows: any; + GetOSEndOfLifeInfo: any; + GetUIMode: any; + NotifyAppInitialized: any; + RegisterDesiredSteamUIWindowsChanged: Unregisterable | any; + RegisterForKioskModeResetSignal: Unregisterable | any; + RegisterForUIModeChanged: Unregisterable | any; + ResetErrorCondition: any; + SetUIMode: any; } export interface URL { - ExecuteSteamURL: any; - GetSteamURLList: any; - GetWebSessionID: any; - RegisterForRunSteamURL: any; - RegisterForSteamURLChanges: any; + ExecuteSteamURL: any; + GetSteamURLList: any; + GetWebSessionID: any; + RegisterForRunSteamURL: Unregisterable | any; + RegisterForSteamURLChanges: Unregisterable | any; } export interface Updates { - ApplyUpdates: any; - CheckForUpdates: any; - GetCurrentOSBranch: any; - RegisterForUpdateStateChanges: any; - SelectOSBranch: any; + ApplyUpdates: any; + CheckForUpdates: any; + GetCurrentOSBranch: any; + RegisterForUpdateStateChanges: Unregisterable | any; + SelectOSBranch: any; } export interface User { - AuthorizeMicrotxn: any; - CancelLogin: any; - CancelMicrotxn: any; - CancelShutdown: any; - ChangeUser: any; - Connect: any; - FlipToLogin: any; - ForceShutdown: any; - ForgetPassword: any; - GetIPCountry: any; - GetLoginProgress: any; - GetLoginUsers: any; - GoOffline: any; - GoOnline: any; - OptOutOfSurvey: any; - PrepareForSystemSuspend: any; - Reconnect: any; - RegisterForConnectionAttemptsThrottled: any; - RegisterForCurrentUserChanges: any; - RegisterForLoginStateChange: any; - RegisterForPrepareForSystemSuspendProgress: any; - RegisterForResumeSuspendedGamesProgress: any; - RegisterForShutdownDone: any; - RegisterForShutdownFailed: any; - RegisterForShutdownStart: any; - RegisterForShutdownState: any; - RemoveUser: any; - RequestSupportSystemReport: any; - ResumeSuspendedGames: any; - RunSurvey: any; - SendSurvey: any; - SetAsyncNotificationEnabled: any; - SetLoginCredentials: any; - SetOOBEComplete: any; - ShouldShowUserChooser: any; - SignOutAndRestart: any; - StartLogin: any; - StartOffline: any; - StartRestart: any; - StartShutdown: any; + AuthorizeMicrotxn: any; + CancelLogin: any; + CancelMicrotxn: any; + CancelShutdown: any; + ChangeUser: any; + Connect: any; + FlipToLogin: any; + ForceShutdown: any; + ForgetPassword: any; + GetIPCountry: any; + GetLoginProgress: any; + GetLoginUsers: any; + GoOffline: any; + GoOnline: any; + OptOutOfSurvey: any; + PrepareForSystemSuspend: any; + Reconnect: any; + RegisterForConnectionAttemptsThrottled: Unregisterable | any; + + RegisterForCurrentUserChanges(callback: (data: any) => void): Unregisterable | any; + + RegisterForLoginStateChange(callback: (username: string) => void): Unregisterable | any; + + RegisterForPrepareForSystemSuspendProgress(callback: (data: any) => void): Unregisterable | any; + + RegisterForResumeSuspendedGamesProgress: Unregisterable | any; + + RegisterForShutdownDone(callback: () => void): Unregisterable | any; + + RegisterForShutdownFailed: Unregisterable | any; + + /** + * Register a function to be executed when a shutdown start is detected. + * @param callback The function to be executed on shutdown start. + */ + RegisterForShutdownStart(callback: () => void): Unregisterable | any; + + RegisterForShutdownState: Unregisterable | any; + RemoveUser: any; + RequestSupportSystemReport: any; + ResumeSuspendedGames: any; + RunSurvey: any; + SendSurvey: any; + SetAsyncNotificationEnabled: any; + SetLoginCredentials: any; + SetOOBEComplete: any; + ShouldShowUserChooser: any; + SignOutAndRestart: any; + StartLogin: any; + StartOffline: any; + + /** + * Restarts the Steam client. + */ + StartRestart(): any; + + StartShutdown(flag: boolean): any; } export interface WebChat { - BSuppressPopupsInRestore: any; - GetCurrentUserAccountID: any; - GetLocalAvatarBase64: any; - GetLocalPersonaName: any; - GetOverlayChatBrowserInfo: any; - GetPrivateConnectString: any; - GetPushToTalkEnabled: any; - GetSignIntoFriendsOnStart: any; - GetUIMode: any; - GetWebChatLanguage: any; - OnGroupChatUserStateChange: any; - OpenURLInClient: any; - RegisterForComputerActiveStateChange: any; - RegisterForFriendPostMessage: any; - RegisterForMouseXButtonDown: any; - RegisterForPushToTalkStateChange: any; - RegisterForUIModeChange: any; - RegisterForVRModeChange: any; - RegisterOverlayChatBrowserInfoChanged: any; - SetActiveClanChatIDs: any; - SetNumChatsWithUnreadPriorityMessages: any; - SetPersonaName: any; - SetPushToMuteEnabled: any; - SetPushToTalkEnabled: any; - SetPushToTalkHotKey: any; - SetPushToTalkMouseButton: any; - SetVoiceChatActive: any; - SetVoiceChatStatus: any; - ShowChatRoomGroupDialog: any; - ShowFriendChatDialog: any; - UnregisterForMouseXButtonDown: any; + BSuppressPopupsInRestore: any; + GetCurrentUserAccountID: any; + GetLocalAvatarBase64: any; + GetLocalPersonaName: any; + GetOverlayChatBrowserInfo: any; + GetPrivateConnectString: any; + GetPushToTalkEnabled: any; + GetSignIntoFriendsOnStart: any; + GetUIMode: any; + GetWebChatLanguage: any; + OnGroupChatUserStateChange: any; + OpenURLInClient: any; + RegisterForComputerActiveStateChange: Unregisterable | any; + RegisterForFriendPostMessage: Unregisterable | any; + RegisterForMouseXButtonDown: Unregisterable | any; + RegisterForPushToTalkStateChange: Unregisterable | any; + RegisterForUIModeChange: Unregisterable | any; + RegisterForVRModeChange: Unregisterable | any; + RegisterOverlayChatBrowserInfoChanged: Unregisterable | any; + SetActiveClanChatIDs: any; + SetNumChatsWithUnreadPriorityMessages: any; + SetPersonaName: any; + SetPushToMuteEnabled: any; + SetPushToTalkEnabled: any; + SetPushToTalkHotKey: any; + SetPushToTalkMouseButton: any; + SetVoiceChatActive: any; + SetVoiceChatStatus: any; + ShowChatRoomGroupDialog: any; + ShowFriendChatDialog: any; + UnregisterForMouseXButtonDown: any; } export interface WebUITransport { - GetTransportInfo: any; + GetTransportInfo: any; } export interface Window { - BringToFront: any; - Close: any; - DefaultMonitorHasFullscreenWindow: any; - FlashWindow: any; - GamescopeBlur: any; - GetDefaultMonitorDimensions: any; - GetMousePositionDetails: any; - GetWindowDimensions: any; - GetWindowRestoreDetails: any; - HideWindow: any; - IsWindowMaximized: any; - IsWindowMinimized: any; - MarkLastFocused: any; - Minimize: any; - MoveTo: any; - MoveToLocation: any; - PositionWindowRelative: any; - ProcessShuttingDown: any; - ResizeTo: any; - RestoreWindowSizeAndPosition: any; - SetAutoDisplayScale: any; - SetComposition: any; - SetHideOnClose: any; - SetKeyFocus: any; - SetManualDisplayScaleFactor: any; - SetMaxSize: any; - SetMinSize: any; - SetModal: any; - SetResizeGrip: any; - SetWindowIcon: any; - ShowWindow: any; - StopFlashWindow: any; - ToggleFullscreen: any; - ToggleMaximize: any; + BringToFront: any; + Close: any; + DefaultMonitorHasFullscreenWindow: any; + FlashWindow: any; + GamescopeBlur: any; + GetDefaultMonitorDimensions: any; + GetMousePositionDetails: any; + GetWindowDimensions: any; + GetWindowRestoreDetails: any; + HideWindow: any; + IsWindowMaximized: any; + IsWindowMinimized: any; + MarkLastFocused: any; + Minimize: any; + MoveTo: any; + MoveToLocation: any; + PositionWindowRelative: any; + ProcessShuttingDown: any; + ResizeTo: any; + RestoreWindowSizeAndPosition: any; + SetAutoDisplayScale: any; + SetComposition: any; + SetHideOnClose: any; + SetKeyFocus: any; + SetManualDisplayScaleFactor: any; + SetMaxSize: any; + SetMinSize: any; + SetModal: any; + SetResizeGrip: any; + SetWindowIcon: any; + ShowWindow: any; + StopFlashWindow: any; + ToggleFullscreen: any; + ToggleMaximize: any; } export interface SteamClient { - Apps: Apps; - Auth: Auth; - Broadcast: Broadcast; - Browser: Browser; - BrowserView: BrowserView; - ClientNotifications: ClientNotifications; - Cloud: Cloud; - CommunityItems: CommunityItems; - Console: Console; - Customization: Customization; - Downloads: Downloads; - FamilySharing: FamilySharing; - Features: Features; - FriendSettings: FriendSettings; - Friends: Friends; - GameNotes: GameNotes; - GameSessions: GameSessions; - Input: Input; - InstallFolder: InstallFolder; - Installs: Installs; - MachineStorage: Storage; - Messaging: Messaging; - Music: Music; - Notifications: Notifications; - OpenVR: OpenVR; - Overlay: Overlay; - Parental: Parental; - RegisterIFrameNavigatedCallback: any; - RemotePlay: RemotePlay; - RoamingStorage: Storage; - Screenshots: Screenshots; - ServerBrowser: ServerBrowser; - Settings: Settings; - SharedConnection: SharedConnection; - Stats: Stats; - SteamChina: SteamChina; - Storage: Storage; - Streaming: Streaming; - System: System; - UI: UI; - URL: URL; - Updates: Updates; - User: User; - WebChat: WebChat; - WebUITransport: WebUITransport; - Window: Window; + Apps: Apps; + Auth: Auth; + Broadcast: Broadcast; + Browser: Browser; + BrowserView: BrowserView; + ClientNotifications: ClientNotifications; + Cloud: Cloud; + CommunityItems: CommunityItems; + Console: Console; + Customization: Customization; + Downloads: Downloads; + FamilySharing: FamilySharing; + Features: Features; + FriendSettings: FriendSettings; + Friends: Friends; + GameNotes: GameNotes; + GameSessions: GameSessions; + Input: Input; + InstallFolder: InstallFolder; + Installs: Installs; + MachineStorage: Storage; + Messaging: Messaging; + Music: Music; + Notifications: Notifications; + OpenVR: OpenVR; + Overlay: Overlay; + Parental: Parental; + RegisterIFrameNavigatedCallback: any; + RemotePlay: RemotePlay; + RoamingStorage: Storage; + Screenshots: Screenshots; + ServerBrowser: ServerBrowser; + Settings: Settings; + SharedConnection: SharedConnection; + Stats: Stats; + SteamChina: SteamChina; + Storage: Storage; + Streaming: Streaming; + System: System; + UI: UI; + URL: URL; + Updates: Updates; + User: User; + WebChat: WebChat; + WebUITransport: WebUITransport; + Window: Window; } export interface SteamShortcut { - appid: number; - data: { - bIsApplication: boolean; - strAppName: string; - strExePath: string; - strArguments: string; - strShortcutPath: string; - strSortAs: string; - }; + appid: number; + data: { + bIsApplication: boolean; + strAppName: string; + strExePath: string; + strArguments: string; + strShortcutPath: string; + strSortAs: string; + }; } /** * @prop unAppID is not properly set by Steam for non-steam game shortcuts, so it defaults to 0 for them */ -export interface LifetimeNotification { - unAppID: number; - nInstanceID: number; - bRunning: boolean; +export interface AppLifetimeNotification { + unAppID: number; + nInstanceID: number; + bRunning: boolean; } export type AppAchievements = { - nAchieved: number; - nTotal: number; - vecAchievedHidden: any[]; - vecHighlight: any[]; - vecUnachieved: any[]; + nAchieved: number; + nTotal: number; + vecAchievedHidden: any[]; + vecHighlight: any[]; + vecUnachieved: any[]; }; export type AppLanguages = { - strDisplayName: string; - strShortName: string; + strDisplayName: string; + strShortName: string; }; export type LogoPinPositions = 'BottomLeft' | 'UpperLeft' | 'CenterCenter' | 'UpperCenter' | 'BottomCenter'; export interface LogoPosition { - pinnedPosition: LogoPinPositions; - nWidthPct: number; - nHeightPct: number; + pinnedPosition: LogoPinPositions; + nWidthPct: number; + nHeightPct: number; } export interface AppDetails { - achievements: AppAchievements; - bCanMoveInstallFolder: boolean; - bCloudAvailable: boolean; - bCloudEnabledForAccount: boolean; - bCloudEnabledForApp: boolean; - bCloudSyncOnSuspendAvailable: boolean; - bCloudSyncOnSuspendEnabled: boolean; - bCommunityMarketPresence: boolean; - bEnableAllowDesktopConfiguration: boolean; - bFreeRemovableLicense: boolean; - bHasAllLegacyCDKeys: boolean; - bHasAnyLocalContent: boolean; - bHasLockedPrivateBetas: boolean; - bIsExcludedFromSharing: boolean; - bIsSubscribedTo: boolean; - bOverlayEnabled: boolean; - bOverrideInternalResolution: boolean; - bRequiresLegacyCDKey: boolean; - bShortcutIsVR: boolean; - bShowCDKeyInMenus: boolean; - bShowControllerConfig: boolean; - bSupportsCDKeyCopyToClipboard: boolean; - bVRGameTheatreEnabled: boolean; - bWorkshopVisible: boolean; - eAppOwnershipFlags: number; - eAutoUpdateValue: number; - eBackgroundDownloads: number; - eCloudSync: number; - eControllerRumblePreference: number; - eDisplayStatus: number; - eEnableThirdPartyControllerConfiguration: number; - eSteamInputControllerMask: number; - iInstallFolder: number; - lDiskUsageBytes: number; - lDlcUsageBytes: number; - nBuildID: number; - nCompatToolPriority: number; - nPlaytimeForever: number; - nScreenshots: number; - rtLastTimePlayed: number; - rtLastUpdated: number; - rtPurchased: number; - selectedLanguage: { + achievements: AppAchievements; + bCanMoveInstallFolder: boolean; + bCloudAvailable: boolean; + bCloudEnabledForAccount: boolean; + bCloudEnabledForApp: boolean; + bCloudSyncOnSuspendAvailable: boolean; + bCloudSyncOnSuspendEnabled: boolean; + bCommunityMarketPresence: boolean; + bEnableAllowDesktopConfiguration: boolean; + bFreeRemovableLicense: boolean; + bHasAllLegacyCDKeys: boolean; + bHasAnyLocalContent: boolean; + bHasLockedPrivateBetas: boolean; + bIsExcludedFromSharing: boolean; + bIsSubscribedTo: boolean; + bOverlayEnabled: boolean; + bOverrideInternalResolution: boolean; + bRequiresLegacyCDKey: boolean; + bShortcutIsVR: boolean; + bShowCDKeyInMenus: boolean; + bShowControllerConfig: boolean; + bSupportsCDKeyCopyToClipboard: boolean; + bVRGameTheatreEnabled: boolean; + bWorkshopVisible: boolean; + eAppOwnershipFlags: number; + eAutoUpdateValue: number; + eBackgroundDownloads: number; + eCloudSync: number; + eControllerRumblePreference: number; + eDisplayStatus: number; + eEnableThirdPartyControllerConfiguration: number; + eSteamInputControllerMask: number; + iInstallFolder: number; + lDiskUsageBytes: number; + lDlcUsageBytes: number; + nBuildID: number; + nCompatToolPriority: number; + nPlaytimeForever: number; + nScreenshots: number; + rtLastTimePlayed: number; + rtLastUpdated: number; + rtPurchased: number; + selectedLanguage: { + strDisplayName: string; + strShortName: string; + }; + strCloudBytesAvailable: string; + strCloudBytesUsed: string; + strCompatToolDisplayName: string; + strCompatToolName: string; + strDeveloperName: string; + strDeveloperURL: string; strDisplayName: string; - strShortName: string; - }; - strCloudBytesAvailable: string; - strCloudBytesUsed: string; - strCompatToolDisplayName: string; - strCompatToolName: string; - strDeveloperName: string; - strDeveloperURL: string; - strDisplayName: string; - strExternalSubscriptionURL: string; - strFlatpakAppID: string; - strHomepageURL: string; - strLaunchOptions: string; - strManualURL: string; - strOwnerSteamID: string; - strResolutionOverride: string; - strSelectedBeta: string; - strShortcutExe: string; - strShortcutLaunchOptions: string; - strShortcutStartDir: string; - strSteamDeckBlogURL: string; - unAppID: number; - vecBetas: any[]; - vecDLC: any[]; - vecDeckCompatTestResults: any[]; - vecLanguages: AppLanguages[]; - vecLegacyCDKeys: any[]; - vecMusicAlbums: any[]; - vecPlatforms: string[]; - vecScreenShots: any[]; - libraryAssets?: { - logoPosition?: LogoPosition; - }; + strExternalSubscriptionURL: string; + strFlatpakAppID: string; + strHomepageURL: string; + strLaunchOptions: string; + strManualURL: string; + strOwnerSteamID: string; + strResolutionOverride: string; + strSelectedBeta: string; + strShortcutExe: string; + strShortcutLaunchOptions: string; + strShortcutStartDir: string; + strSteamDeckBlogURL: string; + unAppID: number; + vecBetas: any[]; + vecDLC: any[]; + vecDeckCompatTestResults: any[]; + vecLanguages: AppLanguages[]; + vecLegacyCDKeys: any[]; + vecMusicAlbums: any[]; + vecPlatforms: string[]; + vecScreenShots: any[]; + libraryAssets?: { + logoPosition?: LogoPosition; + }; } export interface SteamAppOverview { - display_name: string; - gameid: string; - appid: number; - icon_hash: string; - third_party_mod?: boolean; - selected_clientid?: string; - BIsModOrShortcut: () => boolean; - BIsShortcut: () => boolean; + display_name: string; + gameid: string; + appid: number; + icon_hash: string; + third_party_mod?: boolean; + selected_clientid?: string; + BIsModOrShortcut: () => boolean; + BIsShortcut: () => boolean; +} + +/** + * Represents information about a compatibility tool. + */ +export interface CompatibilityToolInfo { + /** Name of the compatibility tool. */ + strToolName: string; + /** Display name of the compatibility tool. */ + strDisplayName: string; } + + +/** + * Represents information about an installed application. + */ +export interface AppInfo { + /** ID of the application. */ + nAppID: number; + /** Name of the application. */ + strAppName: string; + /** Sorting information for the application. */ + strSortAs: string; + /** Last played time in Unix Epoch time format. */ + rtLastPlayed: number; + /** Size of used storage by the application. */ + strUsedSize: string; + /** Size of DLC storage used by the application. */ + strDLCSize: string; + /** Size of workshop storage used by the application. */ + strWorkshopSize: string; + /** Size of staged storage used by the application. */ + strStagedSize: string; +} + +/** + * Represents information about an installation folder. + */ +export interface InstallFolder { + /** Index of the folder. */ + nFolderIndex: number; + /** Path of the folder. */ + strFolderPath: string; + /** User label for the folder. */ + strUserLabel: string; + /** Name of the drive where the folder is located. */ + strDriveName: string; + /** Total capacity of the folder. */ + strCapacity: string; + /** Available free space in the folder. */ + strFreeSpace: string; + /** Used space in the folder. */ + strUsedSize: string; + /** Size of DLC storage used in the folder. */ + strDLCSize: string; + /** Size of workshop storage used in the folder. */ + strWorkshopSize: string; + /** Size of staged storage used in the folder. */ + strStagedSize: string; + /** Indicates if the folder is set as the default installation folder. */ + bIsDefaultFolder: boolean; + /** Indicates if the folder is currently mounted. */ + bIsMounted: boolean; + /** Indicates if the folder is on a fixed drive. */ + bIsFixed: boolean; + /** List of applications installed in the folder. */ + vecApps: AppInfo[]; +} + +export interface AchievementNotification { + achievement: AppAchievements, + nCurrentProgress: number, + nMaxProgress: number, + unAppID: number +} + +export interface ScreenshotNotification { + details: Screenshot, + hScreenshot: number, + strOperation: string, + unAppID: number, +} + +export interface Screenshot { + bSpoilers: boolean, + bUploaded: boolean, + ePrivacy: number, + hHandle: number, + nAppID: number, + nCreated: number, + nHeight: number, + nWidth: number, + strCaption: "", + strUrl: string, + ugcHandle: string +} + +export interface DownloadItem { + active: boolean, + appid: number, + buildid: number, + completed: boolean, + completed_time: number, + deferred_time: number, + downloaded_bytes: number, + launch_on_completion: boolean, + paused: boolean, + queue_index: number, + target_buildid: number, + total_bytes: number, + update_error: string, + update_result: number, + update_type_info: UpdateTypeInfo[] +} + +export interface UpdateTypeInfo { + completed_update: boolean, + downloaded_bytes: number, + has_update: boolean, + total_bytes: number +} + +export interface DownloadOverview { + lan_peer_hostname: string, + paused: boolean, + throttling_suspended: boolean, + update_appid: number, + update_bytes_downloaded: number, + update_bytes_processed: number, + update_bytes_staged: number, + update_bytes_to_download: number, + update_bytes_to_process: number, + update_bytes_to_stage: number, + update_disc_bytes_per_second: number, + update_is_install: boolean, + update_is_prefetch_estimate: boolean, + update_is_shader: boolean, + update_is_upload: boolean, + update_is_workshop: boolean, + update_network_bytes_per_second: number, + update_peak_network_bytes_per_second: number, + update_seconds_remaining: number, + update_start_time: number, + update_state: "None" | "Starting" | "Updating" | "Stopping" +} + +export interface InstallWizardInfo { + bCanChangeInstallFolder: boolean, + bIsRetailInstall: boolean, + currentAppID: number, + eAppError: number, + eInstallState: number, + errorDetail: string, + iInstallFolder: number, + iUnmountedFolder: number, + nDiskSpaceAvailable: number, + nDiskSpaceRequired: number, + rgAppIDs: number[], +} + +export interface SpewOutput { + spew: string; + spew_type: string; +} + +export interface AuthRefreshInfo { + reason: number; + account_name: string; + login_id_token: string; +} + + +export interface Unregisterable { + /** + * Unregister the callback. + */ + unregister(): void; +} \ No newline at end of file From 1ed9b72f668c7871a6d2ccc25ebe58689ff8db9d Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Mon, 28 Aug 2023 08:07:27 +0800 Subject: [PATCH 03/46] new: Document some SteamClient interfaces - part 2 --- src/globals/SteamClient.ts | 251 ++++++++++++++++++++++++++++++------- 1 file changed, 208 insertions(+), 43 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index ae9ddbe6..ec0846cf 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -40,7 +40,13 @@ export interface Apps { CancelBackup(): any; CancelGameAction: any; - CancelLaunch: any; + + /** + * Cancels the launch of an application with the specified ID. + * @param appId - The ID of the application whose launch is to be canceled. + */ + CancelLaunch(appId: string): void; + ClearAndSetUserTagsOnApp: any; /** @@ -62,7 +68,7 @@ export interface Apps { /** * Retrieves a list of available compatibility tools for a specific application. * @param appId The ID of the application to retrieve compatibility tools for. - * @returns A Promise that resolves to an array of CompatibilityToolInfo objects. + * @returns {Promise} A Promise that resolves to an array of CompatibilityToolInfo objects. */ GetAvailableCompatTools(appId: number): Promise; @@ -81,7 +87,14 @@ export interface Apps { GetLaunchOptionsForApp: any; GetLibraryBootstrapData: any; GetMyAchievementsForApp: any; - GetPlaytime: any; + + /** + * Retrieves the playtime information for a specific application. + * @param {number} appId - The ID of the application to get playtime information for. + * @returns {Promise} - A Promise that resolves to playtime information or undefined if not available. + */ + GetPlaytime(appId: number): Promise; + GetPrePurchasedApps: any; /** @@ -99,7 +112,8 @@ export interface Apps { GetStoreTagLocalization(tags: number[]): Promise; - GetSubscribedWorkshopItems: any; + GetSubscribedWorkshopItems(appId: number): Promise; + InstallFlatpakAppAndCreateShortcut: any; JoinAppContentBeta: any; JoinAppContentBetaByPassword: any; @@ -113,7 +127,7 @@ export interface Apps { /** * Registers a callback function to be called when achievement changes occur. * @param callback The callback function to be called. - * @returns An object that can be used to unregister the callback. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForAchievementChanges(callback: () => void): Unregisterable | any; @@ -123,7 +137,7 @@ export interface Apps { * Registers a callback function to be called when app details change. * @param appId The ID of the application to monitor. * @param callback The callback function to be called. - * @returns An object that can be used to unregister the callback. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; @@ -133,7 +147,7 @@ export interface Apps { /** * Registers a callback function to be called when a game action ends. * @param callback The callback function to be called. - * @returns An object that can be used to unregister the callback. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForGameActionEnd(callback: (param0: number) => void): Unregisterable | any; @@ -142,14 +156,14 @@ export interface Apps { /** * Registers a callback function to be called when a game action UI is shown. * @param callback The callback function to be called. - * @returns An object that can be used to unregister the callback. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; /** * Registers a callback function to be called when a game action starts. * @param callback The callback function to be called. - * @returns An object that can be used to unregister the callback. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForGameActionStart(callback: (actionType: any, appId: any) => void): Unregisterable | any; @@ -216,7 +230,14 @@ export interface Apps { SetStreamingClientForApp: any; SetThirdPartyControllerConfiguration: any; - ShowControllerConfigurator: any; + + /** + * Opens the controller configurator for a specific application. + * @param {number} appId - The ID of the application for which to open the controller configurator. + * @returns {void} + */ + ShowControllerConfigurator(appId: number): void; + ShowStore: any; /** @@ -435,27 +456,32 @@ export interface Input { PreviewConfiguForAppAndController: any; PreviewControllerLEDColor: any; QueryControllerConfigsForApp: any; - RegisterForActiveControllerChanges: any; - RegisterForConfigSelectionChanges: any; - RegisterForControllerAccountChanges: any; - RegisterForControllerAnalogInputMessages: any; - RegisterForControllerCommandMessages: any; - RegisterForControllerConfigCloudStateChanges: any; - RegisterForControllerConfigInfoMessages: any; - - RegisterForControllerInputMessages(callback: () => void): any; - - RegisterForControllerListChanges: any; - RegisterForControllerStateChanges: any; - RegisterForGameKeyboardMessages: any; - RegisterForRemotePlayConfigChanges: any; - RegisterForShowControllerLayoutPreviewMessages: any; - RegisterForTouchMenuInputMessages: any; - RegisterForTouchMenuMessages: any; - RegisterForUIVisualization: any; - RegisterForUnboundControllerListChanges: any; - RegisterForUserDismissKeyboardMessages: any; - RegisterForUserKeyboardMessages: any; + RegisterForActiveControllerChanges: Unregisterable | any; + RegisterForConfigSelectionChanges: Unregisterable | any; + RegisterForControllerAccountChanges: Unregisterable | any; + RegisterForControllerAnalogInputMessages: Unregisterable | any; + RegisterForControllerCommandMessages: Unregisterable | any; + RegisterForControllerConfigCloudStateChanges: Unregisterable | any; + RegisterForControllerConfigInfoMessages: Unregisterable | any; + + /** + * Registers a callback function to be invoked when controller input messages are received. + * @param {() => void} callback - The callback function to be invoked when controller input messages are received. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForControllerInputMessages(callback: () => void): Unregisterable | any; + + RegisterForControllerListChanges: Unregisterable | any; + RegisterForControllerStateChanges: Unregisterable | any; + RegisterForGameKeyboardMessages: Unregisterable | any; + RegisterForRemotePlayConfigChanges: Unregisterable | any; + RegisterForShowControllerLayoutPreviewMessages: Unregisterable | any; + RegisterForTouchMenuInputMessages: Unregisterable | any; + RegisterForTouchMenuMessages: Unregisterable | any; + RegisterForUIVisualization: Unregisterable | any; + RegisterForUnboundControllerListChanges: Unregisterable | any; + RegisterForUserDismissKeyboardMessages: Unregisterable | any; + RegisterForUserKeyboardMessages: Unregisterable | any; RequestGyroActive: any; RequestRemotePlayControllerConfigs: any; ResetControllerBindings: any; @@ -678,7 +704,7 @@ export interface RemotePlay { RegisterForRemoteClientStarted: Unregisterable | any; RegisterForRemoteClientStopped: Unregisterable | any; - RegisterForSettingsChanges(callback: (steamSettings: any) => void): Unregisterable | any; + RegisterForSettingsChanges: Unregisterable | any; SetClientStreamingBitrate: any; SetClientStreamingQuality: any; @@ -771,7 +797,9 @@ export interface Settings { OpenWindowsMicSettings: any; RegisterForMicVolumeUpdates: Unregisterable | any; RegisterForSettingsArrayChanges: Unregisterable | any; - RegisterForSettingsChanges: Unregisterable | any; + + RegisterForSettingsChanges(callback: (steamSettings: SteamSettings) => void): Unregisterable | any; + RegisterForTimeZoneChange: Unregisterable | any; ReinitMicSettings: any; RequestDeviceAuthInfo: any; @@ -870,7 +898,7 @@ export interface Devkit { export interface Display { EnableUnderscan: any; - RegisterForBrightnessChanges(callback: (brightness: number) => void): Unregisterable | any; + RegisterForBrightnessChanges(callback: (brightnessChanges: BrightnessChange) => void): Unregisterable | any; SetBrightness(brightness: number): any; @@ -943,8 +971,10 @@ export interface System { FormatStorage: any; GetLegacyAmpControlEnabled: any; GetOSType: any; - GetSystemInfo: any; - IsDeckFactoryImage: any; + + GetSystemInfo(): Promise; + + IsDeckFactoryImage: Promise; Network: Network; NotifyGameOverlayStateChanged: any; OpenFileDialog: any; @@ -952,7 +982,7 @@ export interface System { RebootToAlternateSystemPartition: any; RebootToFactoryTestImage: any; - RegisterForAirplaneModeChanges(callback: (param0: any) => void): Unregisterable | any; + RegisterForAirplaneModeChanges(callback: (airplaneModeChange: AirplaneModeChange) => void): Unregisterable | any; RegisterForBatteryStateChanges: Unregisterable | any; RegisterForFormatStorageProgress: Unregisterable | any; @@ -963,16 +993,31 @@ export interface System { RegisterForSettingsChanges: Unregisterable | any; Report: Report; - RestartPC: any; - SetAirplaneMode: any; + + /** + * Restarts the system. + */ + RestartPC(): any; + + SetAirplaneMode(enabled: boolean): void; + SetLegacyAmpControl: any; ShutdownPC(): any; SteamRuntimeSystemInfo: any; Storage: SystemStorage; - SuspendPC: any; - SwitchToDesktop: any; + + /** + * Suspends the system. + */ + SuspendPC(): any; + + /** + * Switches to desktop mode. + */ + SwitchToDesktop(): any; + UI: SystemUI; UpdateSettings: any; } @@ -982,13 +1027,29 @@ export interface UI { ExitBigPictureMode: any; GetDesiredSteamUIWindows: any; GetOSEndOfLifeInfo: any; - GetUIMode: any; + + /** + * Retrieves the current UI mode. + * @returns {Promise} - A Promise that resolves to the current UI mode. + * 4 represents Deck Mode/Big Picture Mode. + * 7 represents Desktop Mode. + */ + GetUIMode(): Promise; + NotifyAppInitialized: any; RegisterDesiredSteamUIWindowsChanged: Unregisterable | any; RegisterForKioskModeResetSignal: Unregisterable | any; RegisterForUIModeChanged: Unregisterable | any; ResetErrorCondition: any; - SetUIMode: any; + + /** + * Sets the UI mode to the specified value. + * @param {number} mode - The UI mode to set. Use values: + * - 4 for Deck Mode/Big Picture Mode. + * - 7 for Desktop Mode. + * @returns {void} + */ + SetUIMode(mode: number): void; } export interface URL { @@ -1493,6 +1554,110 @@ export interface AuthRefreshInfo { login_id_token: string; } +export interface WorkshopItem { + unAppID: number; + ulPublishedFileID: string; +} + +/** + * Represents playtime information for an application. + */ +export interface Playtime { + /** Total playtime in minutes for the last 2 weeks. */ + nPlaytimeLastTwoWeeks: number; + /** Total playtime in minutes. */ + nPlaytimeForever: number; + /** Last played time in Unix Epoch time format. */ + rtLastTimePlayed: number; +} + +export interface BrightnessChange { + flBrightness: number; +} + +export interface AirplaneModeChange { + bEnabled: boolean; +} + +export interface SystemInfo { + sOSName: string; + sKernelVersion: string; + sBIOSVersion: string; + sHostname: string; + sOSCodename: string; + sOSVariantId: string; + sOSVersionId: string; + sOSBuildId: string; + nSteamVersion: number; + sSteamBuildDate: string; + sSteamAPI: string; + sCPUVendor: string; + sCPUName: string; + nCPUHz: number; + nCPUPhysicalCores: number; + nCPULogicalCores: number; + nSystemRAMSizeMB: number; + sVideoCardName: string; + sVideoDriverVersion: string; + nVideoRAMSizeMB: number; + bIsUnsupportedPrototypeHardware: boolean; +} + +interface Region { + nRegionID: number; + strRegionName: string; +} + +interface Hour { + nHour: number; + strDisplay: string; +} + +interface AvailableClientBeta { + nBetaID: number; + strName: string; +} + +interface DisplaySettings { + bDisplayIsExternal: boolean; + flAutoDisplayScaleFactor: number; + flCurrentDisplayScaleFactor: number; + bDisplayIsUsingAutoScale: boolean; + flMinDisplayScaleFactor: number; + flMaxDisplayScaleFactor: number; + flCurrentUnderscanLevel: number; + bUnderscanEnabled: boolean; +} + +interface SteamSettings { + bIsInClientBeta: boolean; + bIsSteamSideload: boolean; + eClientBetaState: number; + strSelectedBetaName: string; + nAvailableBetas: number; + bChangeBetaEnabled: boolean; + nSelectedBetaID: number; + vecAvailableClientBetas: AvailableClientBeta[]; + bIsValveEmail: boolean; + bIsInDesktopUIBeta: boolean; + bEnableSoftProcessKill: boolean; + vecValidDownloadRegions: Region[]; + vecValidAutoUpdateRestrictHours: Hour[]; + bCompatEnabled: boolean; + bCompatEnabledForOtherTitles: boolean; + strCompatTool: string; + bShowMobxDevTools: boolean; + bForceOOBE: boolean; + bEnableTestUpdaters: boolean; + bOOBETestModeEnabled: boolean; + bEnableTabbedAppDetails: boolean; + eOverrideBrowserComposerMode: number; + bCefRemoteDebuggingEnabled: boolean; + strDisplayName: string; + displaySettings: DisplaySettings; + vecNightModeScheduledHours: Hour[]; +} + export interface Unregisterable { /** From 82237e3b7090f1deb809beea0e1741919c7f6ed6 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Mon, 28 Aug 2023 16:59:57 +0800 Subject: [PATCH 04/46] new: Document some SteamClient interfaces - part 3 --- src/globals/SteamClient.ts | 286 +++++++++++++++++++++++++++++++------ 1 file changed, 239 insertions(+), 47 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index ec0846cf..967d9d4f 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -18,8 +18,9 @@ export interface Apps { * Backups an app to the specified path. * @param appId The ID of the application to back up. * @param backupToPath The path to store the backup. + * @return {number} - A Promise that resolves to the number. // Todo: Which appears to be "20" for backup busy and "0" success */ - BackupFilesForApp(appId: number, backupToPath: string): any; + BackupFilesForApp(appId: number, backupToPath: string): Promise; /** * Opens the screenshot folder for a specific app. @@ -37,7 +38,7 @@ export interface Apps { /** * Cancels the current backup process. */ - CancelBackup(): any; + CancelBackup(): void; CancelGameAction: any; @@ -78,15 +79,26 @@ export interface Apps { GetConflictingFileTimestamps: any; GetDetailsForScreenshotUpload: any; GetDetailsForScreenshotUploads: any; - GetDownloadedWorkshopItems: any; + + GetDownloadedWorkshopItems(appId: number): Promise; + GetDurationControlInfo: any; - GetFriendAchievementsForApp: any; - GetFriendsWhoPlay: any; + + GetFriendAchievementsForApp(appId: string, friendSteam64Id: string): Promise; + + /** + * Retrieves a list of friends who play the specified application. + * @param {number} appId - The ID of the application. + * @returns {Promise} - A Promise that resolves to an array of Steam64 IDs representing friends who play the application. + */ + GetFriendsWhoPlay(appId: number): Promise; + GetGameActionDetails: any; GetGameActionForApp: any; GetLaunchOptionsForApp: any; GetLibraryBootstrapData: any; - GetMyAchievementsForApp: any; + + GetMyAchievementsForApp(appId: string): Promise; /** * Retrieves the playtime information for a specific application. @@ -95,16 +107,17 @@ export interface Apps { */ GetPlaytime(appId: number): Promise; - GetPrePurchasedApps: any; + GetPrePurchasedApps(appIds: number[]): Promise; /** * Retrieves the resolution override for a specific application. * @param appId The ID of the application to retrieve the resolution override for. - * @returns A Promise that resolves to a string of the resolution override. + * @returns {Promise} A Promise that resolves to a string of the resolution override. */ GetResolutionOverrideForApp(appId: number): Promise; - GetScreenshotInfo: any; + GetScreenshotInfo(param0: string, param1: number): any; + GetScreenshotsInTimeRange: any; GetShortcutData: any; GetShortcutDataForPath: any; @@ -131,7 +144,7 @@ export interface Apps { */ RegisterForAchievementChanges(callback: () => void): Unregisterable | any; - RegisterForAppBackupStatus: Unregisterable | any; + RegisterForAppBackupStatus(callback: (appBackupStatus: AppBackupStatus) => void): Unregisterable | any; /** * Registers a callback function to be called when app details change. @@ -149,7 +162,7 @@ export interface Apps { * @param callback The callback function to be called. * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ - RegisterForGameActionEnd(callback: (param0: number) => void): Unregisterable | any; + RegisterForGameActionEnd(callback: (gameActionIdentifier: number) => void): Unregisterable | any; RegisterForGameActionShowError: Unregisterable | any; @@ -158,24 +171,26 @@ export interface Apps { * @param callback The callback function to be called. * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ - RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; + RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; // todo: no idea what this callback is from /** * Registers a callback function to be called when a game action starts. * @param callback The callback function to be called. * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ - RegisterForGameActionStart(callback: (actionType: any, appId: any) => void): Unregisterable | any; + RegisterForGameActionStart(callback: (gameActionIdentifier: number, appId: string, action: string, param3: number) => void): Unregisterable | any; // gameActionIdentifier is incremental per game action since steam client start - RegisterForGameActionTaskChange(callback: (data: any) => void): Unregisterable | any; + RegisterForGameActionTaskChange(callback: (gameActionIdentifier: number, appId: string, action: string, requestedAction: string, param4: string) => void): Unregisterable | any; - RegisterForGameActionUserRequest(callback: (param0: number, appId: string, action: string, requestedAction: string, appId2: string) => void): Unregisterable | any; + RegisterForGameActionUserRequest(callback: (gameActionIdentifier: number, appId: string, action: string, requestedAction: string, appId2: string) => void): Unregisterable | any; RegisterForLocalizationChanges: Unregisterable | any; RegisterForPrePurchasedAppChanges: Unregisterable | any; RegisterForShowMarketingMessageDialog: Unregisterable | any; - RegisterForWorkshopChanges: Unregisterable | any; - RegisterForWorkshopItemDownloads: Unregisterable | any; + + RegisterForWorkshopChanges(callback: (appId: number) => void): Unregisterable | any; + + RegisterForWorkshopItemDownloads(param0: number, callback: () => void): Unregisterable | any; RemoveShortcut(appId: number): any; @@ -189,7 +204,9 @@ export interface Apps { RunGame(appId: string, param1: string, param2: number, param3: number): any; SaveAchievementProgressCache: any; - ScanForInstalledNonSteamApps: any; + + ScanForInstalledNonSteamApps(): Promise; + SetAppAutoUpdateBehavior: any; SetAppBackgroundDownloadsBehavior: any; SetAppCurrentLanguage: any; @@ -510,14 +527,17 @@ export interface Input { SetGamepadKeyboardText: any; SetKeyboardActionset: any; - SetMousePosition(x: number, y: number): any; + SetMousePosition: any; SetSelectedConfigForApp: any; SetSteamControllerDonglePairingMode: any; SetVirtualMenuKeySelected: any; SetWebBrowserActionset: any; SetXboxDriverInstallState: any; - ShowControllerSettings: any; + + // Shows Steam Input controller settings + ShowControllerSettings(): any; + StandaloneKeyboardDismissed: any; StartControllerDeviceSupportFlow: any; StartEditingControllerConfigurationForAppIDAndControllerIndex: any; @@ -731,26 +751,102 @@ export interface RemotePlay { UnpairRemoteDevices: any; } +/** + * Interface for managing screenshots. + */ export interface Screenshots { - DeleteLocalScreenshot: any; + /** + * Deletes a local screenshot. + * @param {string} appId - The ID of the application. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {Promise} - A Promise that resolves to a boolean value indicating whether the deletion was successful. + */ + DeleteLocalScreenshot(appId: string, screenshotIndex: number): Promise; + /** + * Retrieves all local screenshots for all applications. + * @returns {Promise} - A Promise that resolves to an array of Screenshot objects. + */ GetAllAppsLocalScreenshots(): Promise; - GetAllAppsLocalScreenshotsCount: any; - GetAllAppsLocalScreenshotsRange: any; + /** + * Retrieves the count of all local screenshots for all applications. + * @returns {Promise} - A Promise that resolves to the count of local screenshots. + */ + GetAllAppsLocalScreenshotsCount(): Promise; + + /** + * Retrieves a range of local screenshots for all applications. + * @param {number} start - The starting index of the screenshot range. + * @param {number} end - The ending index of the screenshot range. + * @returns {Promise} - A Promise that resolves to an array of Screenshot objects within the specified range. + */ + GetAllAppsLocalScreenshotsRange(start: number, end: number): Promise; + /** + * Retrieves all local screenshots. + * @returns {Promise} - A Promise that resolves to an array of Screenshot objects. + */ GetAllLocalScreenshots(): Promise; - GetGameWithLocalScreenshots: any; + /** + * Retrieves the game associated with a specific local screenshot index. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {Promise} - A Promise that resolves to the ID of the game associated with the screenshot. + */ + GetGameWithLocalScreenshots(screenshotIndex: number): Promise; + /** + * Retrieves the last taken local screenshot. + * @returns {Promise} - A Promise that resolves to the last taken local screenshot. + */ GetLastScreenshotTaken(): Promise; - GetLocalScreenshot: any; - GetLocalScreenshotCount: any; - GetNumGamesWithLocalScreenshots: any; - ShowScreenshotInSystemViewer: any; - ShowScreenshotOnDisk: any; - UploadLocalScreenshot: any; + /** + * Retrieves a specific local screenshot for an application. + * @param {string} appId - The ID of the application. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {Promise} - A Promise that resolves to the requested local screenshot. + */ + GetLocalScreenshot(appId: string, screenshotIndex: number): Promise; + + /** + * Retrieves the count of local screenshots for a specific application. + * @param {number} appId - The ID of the application. + * @returns {Promise} - A Promise that resolves to the count of local screenshots for the application. + */ + GetLocalScreenshotCount(appId: number): Promise; + + /** + * Retrieves the number of games with local screenshots. + * @returns {Promise} - A Promise that resolves to the number of games with local screenshots. + */ + GetNumGamesWithLocalScreenshots(): Promise; + + /** + * Opens a local screenshot in the system image viewer. + * If the screenshot index is invalid, this function opens the screenshots directory for the specified application ID. + * @param {string} appId - The ID of the application. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {void} + */ + ShowScreenshotInSystemViewer(appId: string, screenshotIndex: number): void; + + /** + * Opens the folder containing local screenshots for a specific application. + * @param {string} appId - The ID of the application. + * @returns {void} + */ + ShowScreenshotsOnDisk(appId: string): void; + + /** + * Uploads a local screenshot. + * @param {string} appId - The ID of the application. + * @param {number} localScreenshot_hHandle - The handle of the local screenshot. + * @param {number} param2 - Additional parameter. // Todo: Unknown at this time. My assumption is the visibility of the screenshot. + * @returns {Promise} - A Promise that resolves to a boolean value indicating whether the upload was successful. + */ + UploadLocalScreenshot(appId: string, localScreenshot_hHandle: number, param2: number): Promise; } export interface ServerBrowser { @@ -780,19 +876,31 @@ export interface Settings { AddClientBeta: any; ClearAllHTTPCaches: any; ClearDownloadCache: any; - GetAccountSettings: any; - GetAppUsesP2PVoice: any; - GetAvailableLanguages: any; - GetAvailableTimeZones: any; - GetCurrentLanguage: any; + + GetAccountSettings(): Promise; + + GetAppUsesP2PVoice(appId: number): Promise; + + GetAvailableLanguages(): Promise; + + GetAvailableTimeZones(): Promise; + + // Returns the current language "english" + GetCurrentLanguage(): Promise; GetGlobalCompatTools(): Promise; GetMonitorInfo: any; - GetOOBETestMode: any; - GetRegisteredSteamDeck: any; - GetTimeZone: any; - GetWindowed: any; + + GetOOBETestMode(): Promise; + + GetRegisteredSteamDeck(): Promise; + + // Returns the current timezone "America/Los_Angeles" + GetTimeZone(): Promise; + + GetWindowed(): Promise; + IgnoreSteamDeckRewards: any; OpenWindowsMicSettings: any; RegisterForMicVolumeUpdates: Unregisterable | any; @@ -807,7 +915,9 @@ export interface Settings { SetCefRemoteDebuggingEnabled(value: boolean): any; - SetCurrentLanguage: any; + // Get from available languages + SetCurrentLanguage(strShortName: string): void; + SetEnableSoftProcessKill: any; SetEnableTestUpdaters: any; SetForceOOBE: any; @@ -824,7 +934,9 @@ export interface Settings { SetTimeZone: any; SetUseNintendoButtonLayout: any; SetWindowed: any; - SpecifyGlobalCompatTool: any; + + SpecifyGlobalCompatTool(strToolName: string): void; + ToggleSteamInstall: any; } @@ -1467,19 +1579,21 @@ export interface ScreenshotNotification { } export interface Screenshot { - bSpoilers: boolean, - bUploaded: boolean, - ePrivacy: number, - hHandle: number, nAppID: number, - nCreated: number, - nHeight: number, + strGameID: string, + hHandle: number, nWidth: number, + nHeight: number, + nCreated: number, // timestamp + ePrivacy: number, strCaption: "", + bSpoilers: boolean, strUrl: string, + bUploaded: boolean, ugcHandle: string } + export interface DownloadItem { active: boolean, appid: number, @@ -1658,6 +1772,84 @@ interface SteamSettings { vecNightModeScheduledHours: Hour[]; } +export interface PrePurchaseApp { + nAppID: number; + eState: number; +} + +export interface PrePurchaseInfo { + apps: PrePurchaseApp[]; + lastChangeNumber: number; +} + +export interface AppAchievement { + strID: string; + strName: string; + strDescription: string; + bAchieved: boolean; + rtUnlocked: number; // epoch time + strImage: string; + bHidden: boolean; + flMinProgress: number; + flCurrentProgress: number; + flMaxProgress: number; + flAchieved: number; +} + +export interface AppAchievementData { + rgAchievements: AppAchievement[]; +} + +export interface AppAchievementResponse { + result: number; + data: AppAchievementData +} + +export interface NonSteamApp { + bIsApplication: boolean; + strAppName: string; + strExePath: string; + strArguments: string; + strCmdline: string; + strIconDataBase64: string; +} + +export interface RegisteredSteamDeck { + bRegistered: boolean; + bIgnoreRegistrationPrompt: boolean; + strSteamID: string; + strSerialNumber: string; +} + +export interface AccountSettings { + strEmail: string; + bEmailValidated: boolean; + bHasAnyVACBans: boolean; + bHasTwoFactor: boolean; + eSteamGuardState: number; + rtSteamGuardEnableTime: number; + bSaveAccountCredentials: boolean; +} + +export interface Language { + language: number; + strShortName: string; +} + +export interface TimeZone { + utcOffset: number; + timezoneID: string; + timezoneLocalizationToken: string; + regionsLocalizationToken: string; +} + +export interface AppBackupStatus { + appid: number; + eError: number; // Without confirmation 20 - In progress, 3 - Cancelled? + strBytesToProcess: string; + strBytesProcessed: string; + strTotalBytesWritten: string; +} export interface Unregisterable { /** From 484f01ec27528e81e16ced20e0563d63c74ba5e8 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Tue, 29 Aug 2023 10:32:56 +0800 Subject: [PATCH 05/46] new: Document some SteamClient interfaces - part 4 --- src/globals/SteamClient.ts | 366 ++++++++++++++++++++++++++++++++++--- 1 file changed, 337 insertions(+), 29 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 967d9d4f..1f04de98 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -2,6 +2,9 @@ declare global { var SteamClient: SteamClient; } +/** + * Represents various functions related to Steam applications. + */ export interface Apps { /** * Adds a non-Steam game to the local Steam library. @@ -44,7 +47,7 @@ export interface Apps { /** * Cancels the launch of an application with the specified ID. - * @param appId - The ID of the application whose launch is to be canceled. + * @param appId The ID of the application whose launch is to be canceled. */ CancelLaunch(appId: string): void; @@ -316,15 +319,17 @@ export interface Browser { BIsVROverlayBrowser: any; ClearAllBrowsingData: any; ClearHistory: any; - CloseDevTools: any; - GetBrowserID: Promise; - GetSteamBrowserID: Promise; // 16-bit unsigned integer? + CloseDevTools(): void; + GetBrowserID(): Promise; + GetSteamBrowserID(): Promise; // 16-bit unsigned integer? GoBack: any; GoForward: any; HideCursorUntilMouseEvent: any; - InspectElement: any; + + InspectElement(param0: any, param1: any): any; + NotifyUserActivation: any; - OpenDevTools: any; + OpenDevTools(): void; OpenURLForNavigation: any; RegisterForGestureEvents: Unregisterable | any; RegisterForOpenNewTab: Unregisterable | any; @@ -356,11 +361,29 @@ export interface CommunityItems { RemoveDownloadedItemAsset: any; } +/** + * Represents the console functionality for executing commands and handling spew output. + */ export interface Console { + /** + * Executes a console command. + * @param command - The command to execute in the console. + * @returns {void} + */ ExecCommand(command: string): void; + /** + * Retrieves autocomplete suggestions for a given console command. + * @param command - The console command to provide autocomplete suggestions for. + * @returns {Promise} - A Promise that resolves to an array of autocomplete suggestions. + */ GetAutocompleteSuggestions(command: string): Promise; + /** + * Registers a callback function to receive spew output. + * @param callback - The callback function that will receive spew output. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForSpewOutput(callback: (spewOutput: SpewOutput) => void): Unregisterable | any; } @@ -382,7 +405,7 @@ export interface Downloads { RegisterForDownloadOverview(callback: (downloadOverview: DownloadOverview) => void): Unregisterable | any; RemoveFromDownloadList: any; - ResumeAppUpdate: any; + ResumeAppUpdate(appId: number): void; SetLaunchOnUpdateComplete: any; SetQueueIndex: any; SuspendDownloadThrottling: any; @@ -390,19 +413,34 @@ export interface Downloads { } export interface FamilySharing { - AuthorizeLocalDevice: any; - DeauthorizeLocalDevice: any; + AuthorizeLocalDevice(): Promise; + DeauthorizeLocalDevice(): Promise; RequestFamilySharingAuthorization: any; UpdateAuthorizedBorrower: any; } export interface Features { - SteamInitsPopups: any; + SteamInitsPopups(): boolean; } +/** + * Represents friend settings and configuration. + */ export interface FriendSettings { - GetEnabledFeatures: any; - RegisterForSettingsChanged: any; + /** + * Retrieves a list of enabled friend settings features. + * @returns {Promise} - A Promise that resolves to an array of enabled friend settings features. + */ + GetEnabledFeatures(): Promise; + + /** + * Registers a callback function to be notified of friend settings changes. + * @param callback - The callback function to be called when friend settings change. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @todo The callback receives an escaped JSON object string as "settingsChanges", which should be parsed into FriendSettingsChange object. + */ + RegisterForSettingsChanges(callback: (settingsChanges: string) => void): Unregisterable | any; + SetFriendSettings: any; } @@ -476,25 +514,34 @@ export interface Input { RegisterForActiveControllerChanges: Unregisterable | any; RegisterForConfigSelectionChanges: Unregisterable | any; RegisterForControllerAccountChanges: Unregisterable | any; - RegisterForControllerAnalogInputMessages: Unregisterable | any; - RegisterForControllerCommandMessages: Unregisterable | any; + + RegisterForControllerAnalogInputMessages(callback: (controllerAnalogInputMessages: ControllerAnalogInputMessage[])): Unregisterable | any; + + RegisterForControllerCommandMessages(callback: (controllerCommandMessage: ControllerCommandMessage) => void): Unregisterable | any; + RegisterForControllerConfigCloudStateChanges: Unregisterable | any; RegisterForControllerConfigInfoMessages: Unregisterable | any; /** * Registers a callback function to be invoked when controller input messages are received. - * @param {() => void} callback - The callback function to be invoked when controller input messages are received. + * @param {(controllerInputMessages: ControllerInputMessage[]) => void} callback - The callback function to be invoked when controller input messages are received. * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ - RegisterForControllerInputMessages(callback: () => void): Unregisterable | any; + RegisterForControllerInputMessages(callback: (controllerInputMessages: ControllerInputMessage[]) => void): Unregisterable | any; + + + RegisterForControllerListChanges(callback: (controllerListChanges: ControllerInfo[]) => void): Unregisterable | any; + + // For controller input state changes + RegisterForControllerStateChanges(callback: (controllerStateChanges: ControllerStateChange[]) => void): Unregisterable | any; - RegisterForControllerListChanges: Unregisterable | any; - RegisterForControllerStateChanges: Unregisterable | any; RegisterForGameKeyboardMessages: Unregisterable | any; RegisterForRemotePlayConfigChanges: Unregisterable | any; RegisterForShowControllerLayoutPreviewMessages: Unregisterable | any; RegisterForTouchMenuInputMessages: Unregisterable | any; - RegisterForTouchMenuMessages: Unregisterable | any; + + RegisterForTouchMenuMessages(callback: (touchMenuMessage: TouchMenuMessage) => void): Unregisterable | any; + RegisterForUIVisualization: Unregisterable | any; RegisterForUnboundControllerListChanges: Unregisterable | any; RegisterForUserDismissKeyboardMessages: Unregisterable | any; @@ -535,8 +582,12 @@ export interface Input { SetWebBrowserActionset: any; SetXboxDriverInstallState: any; - // Shows Steam Input controller settings - ShowControllerSettings(): any; + /** + * Opens the Steam Input controller settings. + * This function displays the Steam Input controller settings for configuration. + * @returns {void} + */ + ShowControllerSettings(): void; StandaloneKeyboardDismissed: any; StartControllerDeviceSupportFlow: any; @@ -677,10 +728,30 @@ export interface Overlay { SetOverlayState: any; } +/** + * Interface for managing parental control settings. + */ export interface Parental { - LockParentalLock: any; - RegisterForParentalLockStatus: Unregisterable | any; - UnlockParentalLock: any; + /** + * Locks the parental control settings. + * @returns {void} + */ + LockParentalLock(): void; + + /** + * Registers a callback function to be invoked when parental settings change. + * @param {(parentalSettings: ParentalSettings) => void} callback - The callback function to be invoked when parental settings change. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForParentalSettingsChanges(callback: (parentalSettings: ParentalSettings) => void): Unregisterable | any; + + /** + * Unlocks the parental lock with the provided PIN. + * @param {string} pin - The 4-digit PIN to unlock the parental lock. + * @param {boolean} param1 - Additional parameter. // Todo: Unknown usage. + * @returns {Promise} - A Promise that resolves to a number representing the result of the unlock operation. + */ + UnlockParentalLock(pin: string, param1: boolean): Promise; } export interface RemotePlay { @@ -1035,8 +1106,11 @@ export interface Network { GetProxyInfo: any; RegisterForAppSummaryUpdate: Unregisterable | any; RegisterForConnectionStateUpdate: Unregisterable | any; - RegisterForConnectivityTestChanges: Unregisterable | any; - RegisterForDeviceChanges: Unregisterable | any; + + RegisterForConnectivityTestChanges(callback: (connectivityTestChange: ConnectivityTestChange) => void): Unregisterable | any; + + RegisterForDeviceChanges(callback: (param0: any) => void): Unregisterable | any; + SetFakeLocalSystemState: any; SetProxyInfo: any; SetWifiEnabled: any; @@ -1193,12 +1267,16 @@ export interface User { GetIPCountry: any; GetLoginProgress: any; GetLoginUsers: any; - GoOffline: any; - GoOnline: any; + + GoOffline(): void; + + GoOnline(): void; + OptOutOfSurvey: any; PrepareForSystemSuspend: any; Reconnect: any; - RegisterForConnectionAttemptsThrottled: Unregisterable | any; + + RegisterForConnectionAttemptsThrottled(callback: (param0: any) => void): Unregisterable | any; RegisterForCurrentUserChanges(callback: (data: any) => void): Unregisterable | any; @@ -1657,8 +1735,18 @@ export interface InstallWizardInfo { rgAppIDs: number[], } +/** + * Represents spew output information. + */ export interface SpewOutput { + /** + * The content of the spew output. + */ spew: string; + + /** + * The type or category of the spew output. + */ spew_type: string; } @@ -1851,6 +1939,226 @@ export interface AppBackupStatus { strTotalBytesWritten: string; } +/** + * Represents a list of applications with their IDs. + */ +interface AppList { + /** + * Key-value pairs where the key is the `appId` (e.g., "App_123456") and the value indicates whether the appId is allowed during parental lock. + */ + [appId: string]: number; +} + +/** + * Represents the parental settings and restrictions. + */ +export interface ParentalSettings { + /** + * Indicates whether parental settings are enabled. + */ + enabled: boolean; + /** + * Indicates whether parental settings are locked. + */ + locked: boolean; + /** + * Bitmask representing enabled features. + * - Bit 0: Unknown (@todo Please provide more details if known) + * - Bit 1: Online content & features - Steam Store + * - Bit 2: Online content & features - Community-generated content + * - Bit 3: Online content & features - Friends, chat, and groups + * - Bit 4: Online content & features - My online profile, screenshots, and achievements + * - Bit 5-11: Unknown (@todo Please provide more details if known) + * - Bit 12: Library content - 0: Only games I choose, 1: All games + */ + features: number; + /** + * Indicates whether all apps are allowed. + */ + allowallapps: boolean; + /** + * Base list (type not specified but an object). + * @todo Determine the type of this property. + */ + baselist: any | undefined; + /** + * Custom list of allowed applications. + */ + customlist: AppList; + /** + * Email for recovery (if applicable). + */ + recoveryemail: string | undefined; +} + +export interface ConnectivityTestChange { + eConnectivityTestResult: number; + eFakeState: number; + bChecking: boolean; +} + +export interface ControllerStateChange { + unControllerIndex: number; + unPacketNum: number; + ulUpperButtons: number; + ulButtons: number; + sLeftPadX: number; + sLeftPadY: number; + sRightPadX: number; + sRightPadY: number; + sCenterPadX: number; + sCenterPadY: number; + sLeftStickX: number; + sLeftStickY: number; + sRightStickX: number; + sRightStickY: number; + sTriggerL: number; + sTriggerR: number; + flDriftCorrectedQuatW: number; + flDriftCorrectedQuatX: number; + flDriftCorrectedQuatY: number; + flDriftCorrectedQuatZ: number; + flSensorFusionGyroQuatW: number; + flSensorFusionGyroQuatX: number; + flSensorFusionGyroQuatY: number; + flSensorFusionGyroQuatZ: number; + flDeferredSensorFusionGyroQuatW: number; + flDeferredSensorFusionGyroQuatX: number; + flDeferredSensorFusionGyroQuatY: number; + flDeferredSensorFusionGyroQuatZ: number; + flGyroDegreesPerSecondX: number; + flGyroDegreesPerSecondY: number; + flGyroDegreesPerSecondZ: number; + flGravityVectorX: number; + flGravityVectorY: number; + flGravityVectorZ: number; + flAccelerometerNoiseLength: number; + flGyroNoiseLength: number; + flGyroCalibrationProgress: number; + sBatteryLevel: number; + sPressurePadLeft: number; + sPressurePadRight: number; + sPressureBumperLeft: number; + sPressureBumperRight: number; + unHardwareUpdateInMicrosec: number; +} + +export interface ActiveAccount { + strActiveAccountID: string; + strName: string; + strAvatarHash: string; +} + +export interface ControllerInfo { + strName: string; + eControllerType: number; + nXInputIndex: number; + nControllerIndex: number; + eRumblePreference: number; + bWireless: boolean; + unUniqueID: number; + unVendorID: number; + unProductID: number; + unCapabilities: number; + strFirmwareBuildTime: string; + strSerialNumber: string; + strChipID: string; + nLEDColorR: number; + nLEDColorG: number; + nLEDColorB: number; + flLEDBrightness: number; + flLEDSaturation: number; + nTurnOnSound: number; + nTurnOffSound: number; + nLStickDeadzone: number; + nRStickDeadzone: number; + nLHapticStrength: number; + nRHapticStrength: number; + flLPadPressureCurve: number; + flRPadPressureCurve: number; + bHaptics: boolean; + bSWAntiDrift: boolean; + flGyroStationaryTolerance: number; + flAccelerometerStationaryTolerance: number; + bRemoteDevice: boolean; + bNintendoLayout: boolean; + bUseReversedLayout: boolean; + ActiveAccount: ActiveAccount | undefined; + vecAltAccounts: any[]; // The type for this property might need to be more specific based on the actual data structure +} + +export interface TouchMenuMessage { + bHasVirtualMenus: boolean; + unControllerIndex: number; + appID: number; +} + +export interface ControllerCommandMessage { + eAction: number; + nControllerIndex: number; +} + +export interface ControllerInputMessage { + nA: number; + bS: boolean; + nC: number; +} + +export interface ControllerAnalogInputMessage { + nA: number; + x: number; + y: number; + nC: number; +} + +export interface FriendSettingsFeature { + feature: string; + bEnabled: boolean; +} + +export interface FriendSettingsEnabledFeature { + DoNotDisturb: number; + LoaderWindowSynchronization: number; + NonFriendMessageHandling: number; + NewVoiceHotKeyState: number; + PersonaNotifications: number; + ServerVirtualizedMemberLists: number; + SteamworksChatAPI: number; + FriendsFilter: number; +} + +export interface FriendSettingsChange { + bNotifications_ShowIngame: number; + bNotifications_ShowOnline: number; + bNotifications_ShowMessage: number; + bNotifications_EventsAndAnnouncements: number; + bSounds_PlayIngame: number; + bSounds_PlayOnline: number; + bSounds_PlayMessage: number; + bSounds_EventsAndAnnouncements: number; + bAlwaysNewChatWindow: number; + bForceAlphabeticFriendSorting: number; + nChatFlashMode: number; + bRememberOpenChats: number; + bCompactQuickAccess: number; + bCompactFriendsList: number; + bNotifications_ShowChatRoomNotification: number; + bSounds_PlayChatRoomNotification: number; + bHideOfflineFriendsInTagGroups: number; + bHideCategorizedFriends: number; + bCategorizeInGameFriendsByGame: number; + nChatFontSize: number; + b24HourClock: number; + bDoNotDisturbMode: number; + bDisableEmbedInlining: number; + bSignIntoFriends: number; + bDisableSpellcheck: number; + bDisableRoomEffects: number; + bAnimatedAvatars: number; + featuresEnabled: FriendSettingsEnabledFeature; +} + + export interface Unregisterable { /** * Unregister the callback. From 2ac09e4c64dc5842c0d51e8d24dc0c602715abd8 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Wed, 30 Aug 2023 15:26:00 +0800 Subject: [PATCH 06/46] new: Document some SteamClient interfaces - part 5 --- src/globals/SteamClient.ts | 499 +++++++++++++++++++++++++++++-------- 1 file changed, 397 insertions(+), 102 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 1f04de98..6701c5f7 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -7,39 +7,49 @@ declare global { */ export interface Apps { /** - * Adds a non-Steam game to the local Steam library. - * @param appName The name of the game. - * @param executablePath The path to the game executable. - * @param directory The working directory for the game. - * @param launchOptions Options to be passed when launching the game. + * Adds a non-Steam application to the local Steam library. + * @param {string} appName - The name of the application. + * @param {string} executablePath - The path to the application executable. + * @param {string} directory - The working directory for the application. + * @param {string} launchOptions - Options to be passed when launching the application. */ AddShortcut(appName: string, executablePath: string, directory: string, launchOptions: string): any; - AddUserTagToApps: any; + /** + * Adds user tags to specified apps in the Steam library. + * @param {number[]} appIds - The IDs of the apps to which user tags will be added. + * @param {string} userTag - The user tag to be added. + * @returns {void} + * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. + */ + AddUserTagToApps(appIds: number[], userTag: string): void; /** * Backups an app to the specified path. - * @param appId The ID of the application to back up. - * @param backupToPath The path to store the backup. - * @return {number} - A Promise that resolves to the number. // Todo: Which appears to be "20" for backup busy and "0" success + * @param {number} appId - The ID of the application to back up. + * @param {string} backupToPath - The path to store the backup. + * @returns {number} A Promise that resolves to a number. This value may be "20" for backup busy and "0" for success. */ BackupFilesForApp(appId: number, backupToPath: string): Promise; /** * Opens the screenshot folder for a specific app. - * @param appId The ID of the app to browse screenshots for. - * @param param1 Additional parameter (exact usage may vary). + * @param {string} appId - The ID of the app to browse screenshots for. + * @param {number} param1 - Additional parameter (exact usage may vary). + * @returns {void} */ - BrowseScreenshotForApp(appId: string, param1: number): any; + BrowseScreenshotForApp(appId: string, param1: number): void; /** * Opens the screenshot folder for a specific app. - * @param appId The ID of the app to browse screenshots for. + * @param {string} appId - The ID of the app to browse screenshots for. + * @returns {void} */ - BrowseScreenshotsForApp(appId: string): any; + BrowseScreenshotsForApp(appId: string): void; /** * Cancels the current backup process. + * @returns {void} */ CancelBackup(): void; @@ -47,31 +57,59 @@ export interface Apps { /** * Cancels the launch of an application with the specified ID. - * @param appId The ID of the application whose launch is to be canceled. + * @param {string} appId - The ID of the application whose launch is to be canceled. + * @returns {void} */ CancelLaunch(appId: string): void; - ClearAndSetUserTagsOnApp: any; + /** + * Clears existing user tags on a specified application and sets new user tags. + * @param {number} appId - The ID of the application to clear and set user tags for. + * @param {string[]} userTags - An array of user tags to set for the application. + * @returns {void} + * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. + */ + ClearAndSetUserTagsOnApp(appId: number, userTags: string[]): void; /** * Clears the custom artwork for a given application. - * @param appId The ID of the application to clear custom artwork for. - * @param assetType 0 = Grid, 1 = Hero, 2 = Logo + * @param {number} appId - The ID of the application to clear custom artwork for. + * @param {number} assetType - 0 = Grid, 1 = Hero, 2 = Logo */ ClearCustomArtworkForApp(appId: number, assetType: number): Promise; ClearCustomLogoPositionForApp: any; ClearProton: any; - ClearUserTagsOnApps: any; + + /** + * Clears user tags on a list of specified applications. + * @param {number[]} appIds - An array of application IDs for which to clear user tags. + * @returns {void} + * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. + */ + ClearUserTagsOnApps(appIds: number[]): void; + ContinueGameAction: any; - CreateDesktopShortcutForApp: any; + + /** + * Creates a Steam application shortcut on the desktop. + * @param {number} appId - The ID of the application for which to create a desktop shortcut. + * @returns {void} + */ + CreateDesktopShortcutForApp(appId: number): void; + DownloadWorkshopItem: any; GetAchievementsInTimeRange: any; - GetActiveGameActions: any; + + /** + * Retrieves a list of active game actions, such as launching an application. + * @returns {Promise} A Promise that resolves to an array of active game actions. + */ + GetActiveGameActions(): Promise; /** * Retrieves a list of available compatibility tools for a specific application. - * @param appId The ID of the application to retrieve compatibility tools for. + * @param {number} appId - The ID of the application to retrieve compatibility tools for. * @returns {Promise} A Promise that resolves to an array of CompatibilityToolInfo objects. */ GetAvailableCompatTools(appId: number): Promise; @@ -81,18 +119,30 @@ export interface Apps { GetCloudPendingRemoteOperations: any; GetConflictingFileTimestamps: any; GetDetailsForScreenshotUpload: any; - GetDetailsForScreenshotUploads: any; + GetDetailsForScreenshotUploads(param0: string, param1: number[]): any; + + /** + * Retrieves a list of downloaded workshop items for a specific application. + * @param {number} appId - The ID of the application to retrieve downloaded workshop items for. + * @returns {Promise} - A Promise that resolves to an array of downloaded workshop items for the specified application. + */ GetDownloadedWorkshopItems(appId: number): Promise; GetDurationControlInfo: any; + /** + * Retrieves achievement information for a specific application for a given friend. + * @param {string} appId - The ID of the application to retrieve achievement information for. + * @param {string} friendSteam64Id - The Steam64 ID of the friend for whom to retrieve achievement information. + * @returns {Promise} - A Promise that resolves to an object containing achievement information for the specified friend and application. + */ GetFriendAchievementsForApp(appId: string, friendSteam64Id: string): Promise; /** * Retrieves a list of friends who play the specified application. * @param {number} appId - The ID of the application. - * @returns {Promise} - A Promise that resolves to an array of Steam64 IDs representing friends who play the application. + * @returns {Promise} A Promise that resolves to an array of Steam64 IDs representing friends who play the application. */ GetFriendsWhoPlay(appId: number): Promise; @@ -101,12 +151,17 @@ export interface Apps { GetLaunchOptionsForApp: any; GetLibraryBootstrapData: any; + /** + * Retrieves achievement information for the authenticated user in a specific Steam application. + * @param {string} appId - The ID of the application to retrieve achievement information for. + * @returns {Promise} A Promise that resolves to an AppAchievementResponse object containing the achievement information for the authenticated user in the specified application. + */ GetMyAchievementsForApp(appId: string): Promise; /** * Retrieves the playtime information for a specific application. * @param {number} appId - The ID of the application to get playtime information for. - * @returns {Promise} - A Promise that resolves to playtime information or undefined if not available. + * @returns {Promise} A Promise that resolves to playtime information or undefined if not available. */ GetPlaytime(appId: number): Promise; @@ -114,7 +169,7 @@ export interface Apps { /** * Retrieves the resolution override for a specific application. - * @param appId The ID of the application to retrieve the resolution override for. + * @param {number} appId - The ID of the application to retrieve the resolution override for. * @returns {Promise} A Promise that resolves to a string of the resolution override. */ GetResolutionOverrideForApp(appId: number): Promise; @@ -123,27 +178,49 @@ export interface Apps { GetScreenshotsInTimeRange: any; GetShortcutData: any; - GetShortcutDataForPath: any; + + /** + * Retrieves shortcut data for a given shortcut file path. + * @param {string} pathToShortcut The path to the shortcut file. + * @returns {Promise} A Promise that resolves to the shortcut data. + */ + GetShortcutDataForPath(pathToShortcut: string): Promise; + GetSoundtrackDetails: any; GetStoreTagLocalization(tags: number[]): Promise; + /** + * Retrieves a list of subscribed workshop items for a specific application. + * @param {number} appId - The ID of the application to retrieve subscribed workshop items for. + * @returns {Promise} - A Promise that resolves to an array of subscribed workshop items for the specified application. + */ GetSubscribedWorkshopItems(appId: number): Promise; InstallFlatpakAppAndCreateShortcut: any; JoinAppContentBeta: any; JoinAppContentBetaByPassword: any; - ListFlatpakApps: any; + + ListFlatpakApps(): Promise; + LoadEula: any; MarkEulaAccepted: any; MarkEulaRejected: any; - OpenAppSettingsDialog: any; + + /** + * Opens the settings dialog for a specific application. + * @param {number} appId - The ID of the application for which to open the settings dialog. + * @param {string} param1 - Additional parameter (exact usage may vary). + * @returns {void} + */ + OpenAppSettingsDialog(appId: number, param1: string): void; + RaiseWindowForGame: any; /** * Registers a callback function to be called when achievement changes occur. * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. */ RegisterForAchievementChanges(callback: () => void): Unregisterable | any; @@ -153,7 +230,7 @@ export interface Apps { * Registers a callback function to be called when app details change. * @param appId The ID of the application to monitor. * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. */ RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; @@ -162,7 +239,7 @@ export interface Apps { /** * Registers a callback function to be called when a game action ends. - * @param callback The callback function to be called. + * @param {function} callback - The callback function to be called. * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForGameActionEnd(callback: (gameActionIdentifier: number) => void): Unregisterable | any; @@ -172,62 +249,149 @@ export interface Apps { /** * Registers a callback function to be called when a game action UI is shown. * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. */ RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; // todo: no idea what this callback is from /** * Registers a callback function to be called when a game action starts. - * @param callback The callback function to be called. + * @param {function} callback - The callback function to be called. * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ - RegisterForGameActionStart(callback: (gameActionIdentifier: number, appId: string, action: string, param3: number) => void): Unregisterable | any; // gameActionIdentifier is incremental per game action since steam client start + RegisterForGameActionStart(callback: (gameActionIdentifier: number, appId: string, action: string, param3: number) => void): Unregisterable | any; + /** + * Registers a callback function to be called when a game action task changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForGameActionTaskChange(callback: (gameActionIdentifier: number, appId: string, action: string, requestedAction: string, param4: string) => void): Unregisterable | any; + /** + * Registers a callback function to be called when a user requests a game action. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForGameActionUserRequest(callback: (gameActionIdentifier: number, appId: string, action: string, requestedAction: string, appId2: string) => void): Unregisterable | any; RegisterForLocalizationChanges: Unregisterable | any; RegisterForPrePurchasedAppChanges: Unregisterable | any; RegisterForShowMarketingMessageDialog: Unregisterable | any; + /** + * Registers a callback function to be notified when workshop items are added or removed from a Steam application. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForWorkshopChanges(callback: (appId: number) => void): Unregisterable | any; RegisterForWorkshopItemDownloads(param0: number, callback: () => void): Unregisterable | any; - RemoveShortcut(appId: number): any; + /** + * Removes a non-Steam application shortcut from the Steam library. + * @param {number} appId - The ID of the application for which to remove the shortcut. + * @returns {void} + */ + RemoveShortcut(appId: number): void; + + /** + * Removes a user tag from multiple Steam applications. + * @param {number[]} appIds - An array of application IDs from which the user tag should be removed. + * @param {string} userTag - The user tag to be removed. + * @returns {void} + * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. + */ + RemoveUserTagFromApps(appIds: number[], userTag: string): void; - RemoveUserTagFromApps: any; ReportLibraryAssetCacheMiss: any; ReportMarketingMessageDialogShown: any; RequestIconDataForApp: any; RequestLegacyCDKeysForApp: any; ResetHiddenState: any; + /** + * Runs a game with specified parameters. + * @param {string} appId - The ID of the application to run. + * @param {string} param1 - Additional parameter (exact usage may vary). + * @param {number} param2 - Additional parameter (exact usage may vary). + * @param {number} param3 - Additional parameter (exact usage may vary). + * @returns {any} + */ RunGame(appId: string, param1: string, param2: number, param3: number): any; SaveAchievementProgressCache: any; + /** + * Scans the system for installed non-Steam applications. + * @returns {Promise} A Promise that resolves to an array of NonSteamApp objects representing installed non-Steam applications. + * @remarks This function scans the user's system for installed applications that are not part of the Steam library. It does not scan for shortcuts added to the Steam library. + */ ScanForInstalledNonSteamApps(): Promise; - SetAppAutoUpdateBehavior: any; - SetAppBackgroundDownloadsBehavior: any; - SetAppCurrentLanguage: any; - SetAppHidden: any; + /** + * Sets the automatic update behavior for a Steam application. + * @param {number} appId - The ID of the application to set the update behavior for. + * @param {number} mode - The update behavior mode to set. Possible values: 0 (Always keep this game updated), 1 (Only update this game when I launch it), 2 (High priority). + * @returns {void} + * @remarks This function only works with installed Steam applications. + * @todo The 'mode' parameter is likely an enum with values that control the auto-update behavior of the specified application. + */ + SetAppAutoUpdateBehavior(appId: number, mode: number): void; + + /** + * Sets the background downloads behavior for a specific Steam application. + * @param {number} appId - The ID of the application to set the background downloads behavior for. + * @param {number} mode - The background downloads mode to set. Possible values are: 0 (Pause), 1 (Always), 2 (Never). + * @returns {void} + * @remarks This function only works with installed Steam applications. + * @todo The 'mode' parameter is likely an enum with values that control the background downloads behavior of the specified application. + */ + SetAppBackgroundDownloadsBehavior(appId: number, mode: number): void; + + /** + * Sets the current language for a specific Steam application. + * @param {number} appId - The ID of the application to set the current language for. + * @param {string} language - The language to set, represented as a language (e.g., "english", "spanish", "tchinese", "schinese"). + * @returns {void} + */ + SetAppCurrentLanguage(appId: number, language: string): void; - SetAppLaunchOptions(appId: number, launchOptions: string): any; + /** + * Sets the hidden status of a specific Steam application. + * @param {number} appId - The ID of the application to set the hidden status for. + * @param {boolean} value - The value indicating whether the application should be hidden (true) or not (false). + * @returns {void} + * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file to set the hidden status of the specified application. + */ + SetAppHidden(appId: number, value: boolean): void; + + /** + * Sets launch options for a Steam application. + * @param {number} appId - The ID of the application to set launch options for. + * @param {string} launchOptions - The launch options to be set for the application. + * @returns {void} + */ + SetAppLaunchOptions(appId: number, launchOptions: string): void; + + /** + * Sets a resolution override for a Steam application. + * @param {number} appId - The ID of the application to set the resolution override for. + * @param {string} resolution - The resolution to be set for the application. It can be "Default", "Native", or other compatible resolutions for the user's monitor. + * @returns {void} + */ + SetAppResolutionOverride(appId: number, resolution: string): any; - SetAppResolutionOverride: any; SetCachedAppDetails: any; SetControllerRumblePreference: any; /** * Sets the custom artwork for a given application. - * @param appId The ID of the application to set custom artwork for. - * @param base64Image Base64 encoded image. - * @param imageType "jpeg" or "png". - * @param assetType 0 = Grid, 1 = Hero, 2 = Logo. - * @returns A Promise that resolves after the custom artwork is set. + * @param {number} appId - The ID of the application to set custom artwork for. + * @param {string} base64Image - Base64 encoded image. + * @param {string} imageType - "jpeg" or "png". + * @param {number} assetType - 0 = Grid, 1 = Hero, 2 = Logo. + * @returns {Promise} A Promise that resolves after the custom artwork is set. + * @todo More missing assetTypes */ SetCustomArtworkForApp(appId: number, base64Image: string, imageType: string, assetType: number): Promise; @@ -237,16 +401,45 @@ export interface Apps { SetLocalScreenshotPrivacy: any; SetLocalScreenshotSpoiler: any; - SetShortcutExe(appId: number, path: string): any; + /** + * Sets the icon for a non-Steam application shortcut. + * @param {string} appId - The ID of the application to set the shortcut icon for. + * @param {string} iconPath - The path to the icon image (can be png or tga format). + * @returns {void} + */ + SetShortcutIcon(appId: number, iconPath: string): void; - SetShortcutIcon: any; - SetShortcutIsVR: any; + /** + * Sets whether a non-Steam application shortcut should be included in the VR library. + * @param {number} appId The ID of the application to set the VR status for. + * @param {boolean} value A boolean indicating whether the application should be included in the VR library. + * @returns {void} + */ + SetShortcutIsVR(appId: number, value: boolean): void; - SetShortcutLaunchOptions(appId: number, launchOptions: string): any; + /** + * Sets launch options for a non-Steam application shortcut. + * @param {number} appId - The ID of the application to set the launch options for. + * @param {string} launchOptions - The launch options to be used when starting the application. + * @returns {void} + */ + SetShortcutLaunchOptions(appId: number, launchOptions: string): void; - SetShortcutName(appId: number, shortcutName: string): any; + /** + * Sets the name for a non-Steam application shortcut. + * @param {number} appId - The ID of the application to set the shortcut name for. + * @param {string} shortcutName - The name to be displayed for the application shortcut. + * @returns {void} + */ + SetShortcutName(appId: number, shortcutName: string): void; - SetShortcutStartDir(appId: number, directory: string): any; + /** + * Sets the starting directory for a non-Steam application shortcut. + * @param {number} appId - The ID of the application to set the starting directory for. + * @param {string} directory - The directory from which the application should be launched. + * @returns {void} + */ + SetShortcutStartDir(appId: number, directory: string): void; SetStreamingClientForApp: any; SetThirdPartyControllerConfiguration: any; @@ -262,15 +455,22 @@ export interface Apps { /** * Specifies a compatibility tool by its name for a given application. If strToolName is an empty string, the specified application will no longer use a compatibility tool. - * @param appId The ID of the application to specify compatibility tool for. - * @param strToolName The name of the compatibility tool to specify. + * @param {number} appId - The ID of the application to specify compatibility tool for. + * @param {string} strToolName - The name of the compatibility tool to specify. + * @returns {void} */ SpecifyCompatTool(appId: number, strToolName: string): void; StreamGame: any; SubscribeWorkshopItem: any; - TerminateApp(appId: string, param1: boolean): any; + /** + * Terminates a running application. + * @param {string} appId - The ID of the application to terminate. + * @param {boolean} param1 - Additional parameter. // Todo: Unknown usage. My guess is it forces the termination; otherwise, attempts a graceful termination. + * @returns {void} + */ + TerminateApp(appId: string, param1: boolean): void; ToggleAllowDesktopConfiguration: any; ToggleAppFamilyBlockedState: any; @@ -283,9 +483,9 @@ export interface Apps { /** * Verifies the integrity of an app's files. - * @param appId The ID of the app to verify. + * @param {number} appId - The ID of the app to verify. */ - VerifyApp(appId: number): any; + VerifyApp(appId: number): Promise; // todo: returns {"nGameActionID":9} } export interface Auth { @@ -319,8 +519,11 @@ export interface Browser { BIsVROverlayBrowser: any; ClearAllBrowsingData: any; ClearHistory: any; + CloseDevTools(): void; + GetBrowserID(): Promise; + GetSteamBrowserID(): Promise; // 16-bit unsigned integer? GoBack: any; GoForward: any; @@ -329,7 +532,9 @@ export interface Browser { InspectElement(param0: any, param1: any): any; NotifyUserActivation: any; + OpenDevTools(): void; + OpenURLForNavigation: any; RegisterForGestureEvents: Unregisterable | any; RegisterForOpenNewTab: Unregisterable | any; @@ -367,22 +572,22 @@ export interface CommunityItems { export interface Console { /** * Executes a console command. - * @param command - The command to execute in the console. + * @param {string} command - The command to execute in the console. * @returns {void} */ ExecCommand(command: string): void; /** * Retrieves autocomplete suggestions for a given console command. - * @param command - The console command to provide autocomplete suggestions for. + * @param {string} command - The console command to provide autocomplete suggestions for. * @returns {Promise} - A Promise that resolves to an array of autocomplete suggestions. */ GetAutocompleteSuggestions(command: string): Promise; /** * Registers a callback function to receive spew output. - * @param callback - The callback function that will receive spew output. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param {function} callback - The callback function that will receive spew output. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. */ RegisterForSpewOutput(callback: (spewOutput: SpewOutput) => void): Unregisterable | any; } @@ -405,18 +610,33 @@ export interface Downloads { RegisterForDownloadOverview(callback: (downloadOverview: DownloadOverview) => void): Unregisterable | any; RemoveFromDownloadList: any; + ResumeAppUpdate(appId: number): void; + SetLaunchOnUpdateComplete: any; SetQueueIndex: any; SuspendDownloadThrottling: any; SuspendLanPeerContent: any; } +/** + * Represents functions related to Steam Family Sharing. + */ export interface FamilySharing { + /** + * Authorizes library sharing on the local device. + * @returns {Promise} A Promise that resolves to a status code. + */ AuthorizeLocalDevice(): Promise; + + /** + * Deauthorizes library sharing on the local device. + * @returns {Promise} A Promise that resolves to a status code. + */ DeauthorizeLocalDevice(): Promise; - RequestFamilySharingAuthorization: any; - UpdateAuthorizedBorrower: any; + + RequestFamilySharingAuthorization(param0: string): Promise; // Unknown param0, my assumption is probably a steam64Id of the user sharing the library + UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise; // Unknown } export interface Features { @@ -436,7 +656,7 @@ export interface FriendSettings { /** * Registers a callback function to be notified of friend settings changes. * @param callback - The callback function to be called when friend settings change. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. * @todo The callback receives an escaped JSON object string as "settingsChanges", which should be parsed into FriendSettingsChange object. */ RegisterForSettingsChanges(callback: (settingsChanges: string) => void): Unregisterable | any; @@ -515,7 +735,7 @@ export interface Input { RegisterForConfigSelectionChanges: Unregisterable | any; RegisterForControllerAccountChanges: Unregisterable | any; - RegisterForControllerAnalogInputMessages(callback: (controllerAnalogInputMessages: ControllerAnalogInputMessage[])): Unregisterable | any; + RegisterForControllerAnalogInputMessages(callback: (controllerAnalogInputMessages: ControllerAnalogInputMessage[]) => void): Unregisterable | any; RegisterForControllerCommandMessages(callback: (controllerCommandMessage: ControllerCommandMessage) => void): Unregisterable | any; @@ -525,7 +745,7 @@ export interface Input { /** * Registers a callback function to be invoked when controller input messages are received. * @param {(controllerInputMessages: ControllerInputMessage[]) => void} callback - The callback function to be invoked when controller input messages are received. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. */ RegisterForControllerInputMessages(callback: (controllerInputMessages: ControllerInputMessage[]) => void): Unregisterable | any; @@ -741,7 +961,7 @@ export interface Parental { /** * Registers a callback function to be invoked when parental settings change. * @param {(parentalSettings: ParentalSettings) => void} callback - The callback function to be invoked when parental settings change. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. */ RegisterForParentalSettingsChanges(callback: (parentalSettings: ParentalSettings) => void): Unregisterable | any; @@ -757,20 +977,27 @@ export interface Parental { export interface RemotePlay { BCanAcceptInviteForGame: any; BCanCreateInviteForGame: any; - BCanHostIsolatedGameAudio: any; - BEnabled: any; + + BCanHostIsolatedGameAudio(): Promise; + + BEnabled(): Promise; + BRemotePlayTogetherGuestOnPhoneOrTablet: any; - BRemotePlayTogetherGuestSupported: any; + + BRemotePlayTogetherGuestSupported(): Promise; + CancelInviteAndSession: any; CancelInviteAndSessionWithGuestID: any; CloseGroup: any; CreateGroup: any; CreateInviteAndSession: any; CreateInviteAndSessionWithGuestID: any; - GetClientStreamingBitrate: any; - GetClientStreamingQuality: any; - GetControllerType: any; - GetGameSystemVolume: any; + + GetClientStreamingBitrate(): Promise; //todo: -1 not streaming?? + GetClientStreamingQuality(): Promise; //todo: -1 not streaming?? + GetControllerType(param0: number): Promise; // todo: param0 with value 0 is host controller type - param0 is likely an index of clients or guestId? + GetGameSystemVolume(): Promise; + GetPerUserInputSettings: any; GetPerUserInputSettingsWithGuestID: any; IdentifyController: any; @@ -780,26 +1007,36 @@ export interface RemotePlay { RegisterForAudioDriverPrompt: Unregisterable | any; RegisterForBitrateOverride: Unregisterable | any; RegisterForControllerIndexSet: Unregisterable | any; - RegisterForDevicesChanges: Unregisterable | any; + + RegisterForDevicesChanges(callback: (devicesChange: RemotePlayDevice[]) => void): Unregisterable | any; + RegisterForGroupCreated: Unregisterable | any; RegisterForGroupDisbanded: Unregisterable | any; RegisterForInputDriverPrompt: Unregisterable | any; RegisterForInputDriverRestartNotice: Unregisterable | any; - RegisterForInputUsed: Unregisterable | any; + + RegisterForInputUsed(callback: (param0: string, param1: number, param2: number) => void): Unregisterable | any; // only fires on host + RegisterForInviteResult: Unregisterable | any; - RegisterForNetworkUtilizationUpdate: Unregisterable | any; + + RegisterForNetworkUtilizationUpdate(callback: (param0: string, param1: number, param2: number, param3: number) => void): Unregisterable | any; // only fires on host + RegisterForPlaceholderStateChanged: Unregisterable | any; RegisterForPlayerInputSettingsChanged: Unregisterable | any; RegisterForQualityOverride: Unregisterable | any; RegisterForRemoteClientLaunchFailed: Unregisterable | any; - RegisterForRemoteClientStarted: Unregisterable | any; - RegisterForRemoteClientStopped: Unregisterable | any; - RegisterForSettingsChanges: Unregisterable | any; + RegisterForRemoteClientStarted(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client + + RegisterForRemoteClientStopped(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client + + RegisterForSettingsChanges(callback: (remotePlaySettings: RemotePlaySettings) => void): Unregisterable | any; SetClientStreamingBitrate: any; SetClientStreamingQuality: any; - SetGameSystemVolume: any; + + SetGameSystemVolume(volume: number): void; + SetPerUserControllerInputEnabled: any; SetPerUserControllerInputEnabledWithGuestID: any; SetPerUserKeyboardInputEnabled: any; @@ -815,11 +1052,14 @@ export interface RemotePlay { SetStreamingP2PScope: any; SetStreamingServerConfig: any; SetStreamingServerConfigEnabled: any; - StopStreamingClient: any; + + StopStreamingClient(): void; + StopStreamingSession: any; StopStreamingSessionAndSuspendDevice: any; UnlockH264: any; - UnpairRemoteDevices: any; + + UnpairRemoteDevices(): void;// unpairs all devices } /** @@ -1101,9 +1341,12 @@ export interface NetworkDevice { export interface Network { Device: NetworkDevice; - ForceRefresh: any; - ForceTestConnectivity: any; - GetProxyInfo: any; + + ForceRefresh(): Promise; // Returns {"result":1,"message":""} + ForceTestConnectivity(): void; + + GetProxyInfo(): Promise; + RegisterForAppSummaryUpdate: Unregisterable | any; RegisterForConnectionStateUpdate: Unregisterable | any; @@ -1112,10 +1355,12 @@ export interface Network { RegisterForDeviceChanges(callback: (param0: any) => void): Unregisterable | any; SetFakeLocalSystemState: any; - SetProxyInfo: any; - SetWifiEnabled: any; - StartScanningForNetworks: any; - StopScanningForNetworks: any; + + SetProxyInfo(mode: number, address: string, port: number, excludeLocal: boolean): void; + + SetWifiEnabled(value: boolean): Promise; // Returns {"result":1,"message":""} + StartScanningForNetworks(): Promise; // Returns {"result":1,"message":""} + StopScanningForNetworks(): Promise; // Returns {"result":1,"message":""} } export interface Report { @@ -1444,14 +1689,18 @@ export interface SteamClient { export interface SteamShortcut { appid: number; - data: { - bIsApplication: boolean; - strAppName: string; - strExePath: string; - strArguments: string; - strShortcutPath: string; - strSortAs: string; - }; + data: Shortcut; +} + +export interface Shortcut { + bIsApplication: boolean; + strAppName: string; + strExePath: string; + strArguments: string; + strCmdline: string; + strShortcutPath: string | undefined; + strSortAs: string | undefined; + strIconDataBase64: string | undefined; } /** @@ -1966,8 +2215,8 @@ export interface ParentalSettings { * - Bit 0: Unknown (@todo Please provide more details if known) * - Bit 1: Online content & features - Steam Store * - Bit 2: Online content & features - Community-generated content - * - Bit 3: Online content & features - Friends, chat, and groups - * - Bit 4: Online content & features - My online profile, screenshots, and achievements + * - Bit 3: Online content & features - My online profile, screenshots, and achievements + * - Bit 4: Online content & features - Friends, chat, and groups * - Bit 5-11: Unknown (@todo Please provide more details if known) * - Bit 12: Library content - 0: Only games I choose, 1: All games */ @@ -2158,6 +2407,52 @@ export interface FriendSettingsChange { featuresEnabled: FriendSettingsEnabledFeature; } +export interface ProxyInfo { + proxy_mode: number; + address: string; + port: number; // todo: 16 bit integer + exclude_local: boolean; +} + +export interface RemotePlayDevice { + clientName: string; + status: string; // "Connected", "Paired", + formFactor: number; + unStreamingSessionID: number; + bCanSuspend: boolean; +} + +export interface RemotePlaySettings { + bRemotePlaySupported: boolean; + bRemotePlayEnabled: boolean; + eRemotePlayP2PScope: number; + bRemotePlayServerConfigAvailable: boolean; + bRemotePlayServerConfigEnabled: boolean; + RemotePlayServerConfig: any; // todo: document {} + bRemotePlayClientConfigEnabled: boolean; + unStreamingSessionID: number; + strStreamingClientName: string; + RemotePlayClientConfig: any; // todo: document {} + nDefaultAudioChannels: number; + bDefaultEncodeNVIDIA: boolean; + bDefaultEncodeAMD: boolean; + bDefaultEncodeIntel: boolean; + nAutomaticResolutionX: number; + nAutomaticResolutionY: number; +} + +export interface GameAction { + nGameActionID: number; + gameid: string; + strActionName: string; + strTaskName: string; + strTaskDetails: string; + nSecondsRemaing: number; //fixme: not a typo, actually valve + strNumDone: string; + strNumTotal: string; + bWaitingForUI: boolean; +} + export interface Unregisterable { /** From 87163f62d5f60a069b1597cdfab6289038d862fa Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Thu, 31 Aug 2023 07:17:00 +0800 Subject: [PATCH 07/46] new: Document some SteamClient interfaces - part 6 --- src/globals/SteamClient.ts | 585 +++++++++++++++++++++++++++++++------ 1 file changed, 502 insertions(+), 83 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 6701c5f7..94f718cd 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -474,10 +474,31 @@ export interface Apps { ToggleAllowDesktopConfiguration: any; ToggleAppFamilyBlockedState: any; - ToggleAppSteamCloudEnabled: any; + + /** + * Toggles the Steam Cloud synchronization for game saves for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. + */ + ToggleAppSteamCloudEnabled(appId: number): void; + ToggleAppSteamCloudSyncOnSuspendEnabled: any; - ToggleEnableDesktopTheatreForApp: any; - ToggleEnableSteamOverlayForApp: any; + + /** + * Toggles the "Use Desktop Game Theatre while SteamVR is active" setting for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + */ + ToggleEnableDesktopTheatreForApp(appId: number): void; + + /** + * Toggles the Steam Overlay setting for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + */ + ToggleEnableSteamOverlayForApp(appId: number): void; + ToggleOverrideResolutionForInternalDisplay: any; UninstallFlatpakApp: any; @@ -598,25 +619,93 @@ export interface Customization { GetLocalStartupMovies: any; } +/** + * Represents functions related to managing downloads in Steam. + */ export interface Downloads { - EnableAllDownloads: any; - MoveAppUpdateDown: any; - MoveAppUpdateUp: any; - PauseAppUpdate: any; - QueueAppUpdate: any; + EnableAllDownloads(enable: boolean): void; // todo: Unknown usage + /** + * Moves the update for a specific app down the download queue. + * @param {number} appId - The ID of the application to move. + * @returns {void} + */ + MoveAppUpdateDown(appId: number): void; + + /** + * Moves the update for a specific app up the download queue. + * @param {number} appId - The ID of the application to move. + * @returns {void} + */ + MoveAppUpdateUp(appId: number): void; + + PauseAppUpdate(appId: number): void; // Broken? It seems to be removing it from download list like RemoveFromDownloadList + + /** + * Adds the update for a specific app to the download queue. + * @param {number} appId - The ID of the application to queue. + * @returns {void} + */ + QueueAppUpdate(appId: number): void; + + /** + * Registers a callback function to be called when download items change. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForDownloadItems(callback: (isDownloading: boolean, downloadItems: DownloadItem[]) => void): Unregisterable | any; + /** + * Registers a callback function to be called when download overview changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForDownloadOverview(callback: (downloadOverview: DownloadOverview) => void): Unregisterable | any; - RemoveFromDownloadList: any; + /** + * Removes the update for a specific app from the download list and places it in the unscheduled list. + * @param {number} appId - The ID of the application to remove. + * @returns {void} + */ + RemoveFromDownloadList(appId: number): void; + /** + * Resumes the update for a specific app in the queue. + * @param {number} appId - The ID of the application to resume. + * @returns {void} + */ ResumeAppUpdate(appId: number): void; - SetLaunchOnUpdateComplete: any; - SetQueueIndex: any; - SuspendDownloadThrottling: any; - SuspendLanPeerContent: any; + /** + * Sets an app to launch when its download is complete. + * @param {number} appId - The ID of the application to set. + * @returns {void} + * @todo: unsure if this toggles though + */ + SetLaunchOnUpdateComplete(appId: number): void; + + /** + * Sets the queue index for an app in the download queue. + * @param {number} appId - The ID of the application to set the index for. + * @param {number} index - The index to set. + * @returns {void} + * @remarks Index of 0 is the current download in progress. + */ + SetQueueIndex(appId: number, index: number): void; + + /** + * Suspends or resumes download throttling. + * @param {boolean} suspend - Whether to suspend or resume download throttling. + * @returns {void} + */ + SuspendDownloadThrottling(suspend: boolean): void; + + /** + * Suspends or resumes local transfers. + * @param {boolean} suspend - Whether to suspend or resume local transfers. + * @returns {void} + */ + SuspendLanPeerContent(suspend: boolean): void; } /** @@ -682,7 +771,8 @@ export interface GameNotes { GetNotesMetadata: any; GetNumNotes: any; GetQuota: any; - IterateNotes: any; + + IterateNotes(appId: number, length: number): any; // Results array of {"result":1,"filename":"","filesize":0,"timestamp":0} ResolveSyncConflicts: any; SaveNotes: any; SyncToClient: any; @@ -690,11 +780,29 @@ export interface GameNotes { UploadImage: any; } +/** + * Represents functions related to Steam Game Sessions. + */ export interface GameSessions { + /** + * Registers a callback function to be called when an achievement notification is received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForAchievementNotification(callback: (achievementNotification: AchievementNotification) => void): Unregisterable | any; + /** + * Registers a callback function to be called when an app lifetime notification is received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForAppLifetimeNotifications(callback: (appLifetimeNotification: AppLifetimeNotification) => void): Unregisterable | any; + /** + * Registers a callback function to be called when a screenshot notification is received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForScreenshotNotification(callback: (screenshotNotification: ScreenshotNotification) => void): Unregisterable | any; } @@ -824,45 +932,195 @@ export interface Input { UploadChangesForCloudedControllerConfigs: any; } +/** + * Represents functions related to Steam Install Folders. + */ export interface InstallFolder { - AddInstallFolder: any; - BrowseFilesInFolder: any; - CancelMove: any; + /** + * Adds a Steam Library folder to the Steam client. + * @param {string} steamLibraryPath - The path of the Steam Library folder to be added. + * @returns {Promise} - A Promise that resolves to the index of the added folder. + */ + AddInstallFolder(steamLibraryPath: string): Promise; + + /** + * Opens the file explorer to browse files in a specific Steam Library folder. + * @param {number} folderIndex - The index of the folder to be opened. + * @returns {void} + */ + BrowseFilesInFolder(folderIndex: number): void; + + /** + * Cancels the current move operation for moving game content. + * @returns {void} + */ + CancelMove(): void; /** - * Retrieves a list of install folders. - * @returns A Promise that resolves to an array of InstallFolder objects. + * Retrieves a list of installed Steam Library folders. + * @returns {Promise} - A Promise that resolves to an array of SteamInstallFolder objects. */ - GetInstallFolders(): Promise; + GetInstallFolders(): Promise; - GetPotentialFolders: any; - MoveInstallFolderForApp: any; - RefreshFolders: any; - RegisterForInstallFolderChanges: Unregisterable | any; - RegisterForMoveContentProgress: Unregisterable | any; - RegisterForRepairFolderFinished: Unregisterable | any; - RemoveInstallFolder: any; - RepairInstallFolder: any; - SetDefaultInstallFolder: any; - SetFolderLabel: any; + /** + * Retrieves a list of potential Steam Library folders that can be added. + * @returns {Promise} - A Promise that resolves to an array of PotentialInstallFolder objects. + */ + GetPotentialFolders(): Promise; + + /** + * Moves the installation folder for a specific app to another Steam Library folder. + * @param {number} appId - The ID of the application to be moved. + * @param {number} folderIndex - The index of the target Steam Library folder. + * @returns {void} + */ + MoveInstallFolderForApp(appId: number, folderIndex: number): void; + + /** + * Refreshes the list of installed Steam Library folders. + * @returns {any} - A Promise or response indicating the refresh operation. + */ + RefreshFolders(): any; + + /** + * Registers a callback function to be called when changes occur in Steam Install Folders. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForInstallFolderChanges(callback: (folderChange: FolderChange) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when moving game content progresses. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMoveContentProgress(callback: (moveContentProgress: MoveContentProgress) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when repairing an install folder is finished. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForRepairFolderFinished(callback: (folderChange: FolderChange) => void): Unregisterable | any; + + /** + * Removes a Steam Library folder from the Steam client. + * @param {number} folderIndex - The index of the folder to be removed. + * @returns {void} + */ + RemoveInstallFolder(folderIndex: number): void; + + /** + * Repairs an installed Steam Library folder. + * @param {number} folderIndex - The index of the folder to be repaired. + * @returns {void} + */ + RepairInstallFolder(folderIndex: number): void; + + /** + * Sets a specific Steam Library folder as the default install folder. + * @param {number} folderIndex - The index of the folder to be set as default. + * @returns {void} + */ + SetDefaultInstallFolder(folderIndex: number): void; + + /** + * Sets a user-defined label for a specific Steam Library folder. + * @param {number} folderIndex - The index of the folder to be labeled. + * @param {string} userLabel - The label to be assigned to the folder. + * @returns {void} + */ + SetFolderLabel(folderIndex: number, userLabel: string): void; } +/** + * Represents functions related to managing installs and installation wizards in Steam. + */ export interface Installs { - CancelInstall: any; - ContinueInstall: any; - GetInstallManagerInfo: any; - OpenInstallBackup: any; - OpenInstallWizard: any; - OpenUninstallWizard: any; - RegisterForShowConfirmUninstall: Unregisterable | any; - RegisterForShowFailedUninstall: Unregisterable | any; + /** + * Cancels the installation wizard if it is open. + * @returns {void} + */ + CancelInstall(): void; - RegisterForShowInstallWizard(callback: (data: InstallWizardInfo) => void): Unregisterable | any; + /** + * Continues and starts the installation if the wizard is still open. + * @returns {void} + */ + ContinueInstall(): void; + + /** + * Retrieves information from the last opened or currently opened installation wizard. + * @returns {Promise} A Promise that resolves to the InstallInfo. + */ + GetInstallManagerInfo(): Promise; + + /** + * Opens the restore from backup installer wizard for a specific app. + * @param {string} appBackupPath - The backup path of the app. + * @returns {void} + */ + OpenInstallBackup(appBackupPath: string): void; + + /** + * Opens the installation wizard for specified app IDs. + * @param {number[]} appIds - An array of app IDs to install. + * @returns {void} + */ + OpenInstallWizard(appIds: number[]): void; + + /** + * Opens the uninstall wizard for specified app IDs. + * @param {number[]} appIds - An array of app IDs to uninstall. + * @param {boolean} param1 - Additional parameter (exact usage may vary). + * @returns {any} - Returns an unknown value. + */ + OpenUninstallWizard(appIds: number[], param1: boolean): any; + + RegisterForShowConfirmUninstall: Unregisterable | any; // Broken? + + /** + * Registers a callback function to be called when the "Failed Uninstall" dialog is shown. + * @param {function} callback - The callback function to be called when the dialog is shown. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @remarks For example, a `reason` code of 16 indicates that the app is currently running, preventing the uninstallation. + * @todo Document other reason codes. + */ + RegisterForShowFailedUninstall(callback: (appId: number, reason: number) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the installation wizard is shown. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForShowInstallWizard(callback: (data: InstallInfo) => void): Unregisterable | any; RegisterForShowRegisterCDKey: any; - SetAppList: any; - SetCreateShortcuts: any; - SetInstallFolder: any; + + /** + * Sets a list of app identifiers for downloads in the installation wizard. + * @param {number[]} appIds - An array of app IDs to set. + * @returns {void} + * @remarks The wizard will not reflect this change immediately, but changing another option will. + */ + SetAppList(appIds: number[]): void; // Sets a list of app identifiers for downloads, the wizard will not reflect this immediately but changing and option will. + + /** + * Sets the options for creating shortcuts in the installation wizard. + * @param {boolean} bDesktopShortcut - Whether to create a desktop shortcut. + * @param {boolean} bSystemMenuShortcut - Whether to create a system menu shortcut. + * @returns {void} + * @remarks The wizard will not reflect this change immediately, but changing another option will. + */ + SetCreateShortcuts(bDesktopShortcut: boolean, bSystemMenuShortcut: boolean): void; // Sets install wizard create shortcuts options + + /** + * Sets the install folder for the installation wizard using an install folder index. + * @param {number} folderIndex - The index of the install folder. + * @returns {void} + * @remarks The wizard will not reflect this change immediately, but changing another option will. + */ + SetInstallFolder(folderIndex: number): void; // Sets install wizard install folder with install folder index } export interface Messaging { @@ -871,20 +1129,84 @@ export interface Messaging { PostMessage(): void; } +/** + * Represents functions related to controlling music playback in the Steam client. + */ export interface Music { - DecreaseVolume: any; - IncreaseVolume: any; - PlayEntry: any; - PlayNext: any; - PlayPrevious: any; - RegisterForMusicPlaybackChanges: Unregisterable | any; - RegisterForMusicPlaybackPosition: Unregisterable | any; - SetPlaybackPosition: any; - SetPlayingRepeatStatus: any; - SetPlayingShuffled: any; - SetVolume: any; - ToggleMuteVolume: any; - TogglePlayPause: any; + /** + * Decreases the music volume by 10%. + */ + DecreaseVolume(): void; + + /** + * Increases the music volume by 10%. + */ + IncreaseVolume(): void; + + /** + * @param {number} param0 - Unknown parameter usage. + * @param {number} param1 - Unknown parameter usage. + * @todo: unknown parameter usages, I have tried soundtrack identifier + track index and in reverse as well + */ + PlayEntry(param0: number, param1: number): void; + + /** + * Plays the next track in the music playlist. + */ + PlayNext(): void; + + /** + * Plays the previous track in the music playlist. + */ + PlayPrevious(): void; + + /** + * Registers a callback function to be called when music playback changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMusicPlaybackChanges(callback: (param0: boolean | MusicTrack) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the music playback position changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMusicPlaybackPosition(callback: (position: number) => void): Unregisterable | any; + + /** + * Sets the playback position of the music track. + * @param {number} position - The position to set in seconds. + */ + SetPlaybackPosition(position: number): void; + + /** + * Sets the repeat status for music playback. + * @param {number} status - The repeat status. 0 = off, 1 = repeat all, 2 = repeat one. + */ + SetPlayingRepeatStatus(status: number): void; + + /** + * Sets the shuffle status for music playback. + * @param {boolean} value - True to enable shuffle, false to disable shuffle. + */ + SetPlayingShuffled(value: boolean): void; + + /** + * Sets the volume for music playback. + * @param {number} volume - The volume level to set. + */ + SetVolume(volume: number): void; + + /** + * Toggles the mute state of the music volume. + */ + ToggleMuteVolume(): void; + + /** + * Toggles between play and pause for music playback. + */ + TogglePlayPause(): void; } export interface Notifications { @@ -1814,16 +2136,75 @@ export interface AppDetails { } export interface SteamAppOverview { - display_name: string; - gameid: string; appid: number; + display_name: string; + app_type: number; // 1 - games, 2 - software, 4 - tools, 8192 - soundtracks + mru_index?: number; + rt_recent_activity_time: number; + minutes_playtime_forever: number; + minutes_playtime_last_two_weeks: number; + rt_last_time_played_or_installed: number; + rt_last_time_played: number; + rt_purchased_time: number; + rt_original_release_date: number; + rt_steam_release_date: number; icon_hash: string; - third_party_mod?: boolean; + metacritic_score: number; + visible_in_game_list: boolean; + most_available_clientid: string; selected_clientid?: string; + rt_store_asset_mtime: number; + sort_as: string; + association: SteamAppOverviewAssociation[]; + m_setStoreCategories: unknown; + m_setStoreTags: unknown; + per_client_data: SteamAppOverviewClientData[]; + canonicalAppType: number; + local_per_client_data: SteamAppOverviewClientData; + most_available_per_client_data: SteamAppOverviewClientData; + selected_per_client_data: SteamAppOverviewClientData; + review_score_with_bombs: number; + review_percentage_with_bombs: number; + review_score_without_bombs: number; + review_percentage_without_bombs: number; + steam_deck_compat_category: number; + + + gameid: string; + third_party_mod?: boolean; BIsModOrShortcut: () => boolean; BIsShortcut: () => boolean; } +export interface SteamAppOverviewAssociation { + type: number; + name: string; +} + +export interface SteamAppOverviewClientData { + clientid: string; + client_name: string; + display_status: number; + status_percentage: number; + bytes_downloaded: string; + bytes_total: string; + is_available_on_current_platform: boolean; + + /** + * cloud status 0 is don't show + * cloud status 1 is disabled + * cloud status 2 is unknown + * cloud status 3 is up to date + * cloud status 4 is checking... + * cloud status 5 is out of sync + * cloud status 6 is uploading... + * cloud status 7 is downloading... + * cloud status 8 is unable to sync + * cloud status 9 is file conflict + */ + cloud_status: number; +} + /** * Represents information about a compatibility tool. */ @@ -1860,19 +2241,9 @@ export interface AppInfo { /** * Represents information about an installation folder. */ -export interface InstallFolder { +export interface SteamInstallFolder extends PotentialInstallFolder { /** Index of the folder. */ nFolderIndex: number; - /** Path of the folder. */ - strFolderPath: string; - /** User label for the folder. */ - strUserLabel: string; - /** Name of the drive where the folder is located. */ - strDriveName: string; - /** Total capacity of the folder. */ - strCapacity: string; - /** Available free space in the folder. */ - strFreeSpace: string; /** Used space in the folder. */ strUsedSize: string; /** Size of DLC storage used in the folder. */ @@ -1885,12 +2256,25 @@ export interface InstallFolder { bIsDefaultFolder: boolean; /** Indicates if the folder is currently mounted. */ bIsMounted: boolean; - /** Indicates if the folder is on a fixed drive. */ - bIsFixed: boolean; /** List of applications installed in the folder. */ vecApps: AppInfo[]; } +export interface PotentialInstallFolder { + /** Path of the folder. */ + strFolderPath: string; + /** User label for the folder. */ + strUserLabel: string; + /** Name of the drive where the folder is located. */ + strDriveName: string; + /** Total capacity of the folder. */ + strCapacity: string; + /** Available free space in the folder. */ + strFreeSpace: string; + /** Indicates if the folder is on a fixed drive. */ + bIsFixed: boolean; +} + export interface AchievementNotification { achievement: AppAchievements, nCurrentProgress: number, @@ -1970,18 +2354,30 @@ export interface DownloadOverview { update_state: "None" | "Starting" | "Updating" | "Stopping" } -export interface InstallWizardInfo { - bCanChangeInstallFolder: boolean, - bIsRetailInstall: boolean, - currentAppID: number, - eAppError: number, - eInstallState: number, - errorDetail: string, - iInstallFolder: number, - iUnmountedFolder: number, - nDiskSpaceAvailable: number, - nDiskSpaceRequired: number, - rgAppIDs: number[], +export interface InstallInfo { + rgAppIDs: InstallInfoApps[], + eInstallState: number; + nDiskSpaceRequired: number; + nDiskSpaceAvailable: number; + nCurrentDisk: number; + nTotalDisks: number; + bCanChangeInstallFolder: boolean; + iInstallFolder: number; // index of the install folder + iUnmountedFolder: number; + currentAppID: number; + eAppError: number; + errorDetail: string; + bSystemMenuShortcut: boolean; + bDesktopShortcut: boolean; + bIsBackupInstall: boolean; + strPeerContentServer: string; + bPeerContentServerOnline: boolean; + bPeerContentServerAvailable: boolean; +} + +export interface InstallInfoApps { + nAppID: number; + lDiskSpaceRequiredBytes: number; } /** @@ -2453,6 +2849,29 @@ export interface GameAction { bWaitingForUI: boolean; } +export interface MoveContentProgress { + appid: number; + eError: number; // 0 - appear when you open the move dialog and when it's done, 3 - cancelled? but appid is 0?, 20 - in progress + flProgress: number; + strBytesMoved: string; + strTotalBytesToMove: string; + nFilesMoved: number; +} + +export interface FolderChange { + folderIndex: number; +} + +export interface MusicTrack { + uSoundtrackAppId: number; + ePlaybackStatus: number;// 1 - playing, 2 - paused + eRepeatStatus: number; + bShuffle: boolean; + nVolume: number; + nActiveTrack: number; + nLengthInMsec: number; +} + export interface Unregisterable { /** From 06b0fb601aa796a56dca2d526406d3adceacbcd6 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Fri, 1 Sep 2023 08:22:37 +0800 Subject: [PATCH 08/46] new: Document some SteamClient interfaces - part 7 --- src/globals/SteamClient.ts | 298 ++++++++++++++++++++++++++++++------- 1 file changed, 245 insertions(+), 53 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 94f718cd..dffd172d 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -7,13 +7,14 @@ declare global { */ export interface Apps { /** - * Adds a non-Steam application to the local Steam library. - * @param {string} appName - The name of the application. - * @param {string} executablePath - The path to the application executable. - * @param {string} directory - The working directory for the application. - * @param {string} launchOptions - Options to be passed when launching the application. + * Adds a non-Steam application shortcut to the local Steam library. + * @param {string} appName - The name of the non-Steam application. + * @param {string} executablePath - The path to the executable file of the non-Steam application. + * @param {string} directory - The working directory for the non-Steam application. + * @param {string} launchOptions - Options to be passed when launching the non-Steam application. + * @returns {Promise} - A Promise that resolves to a unique AppID assigned to the added non-Steam application shortcut. */ - AddShortcut(appName: string, executablePath: string, directory: string, launchOptions: string): any; + AddShortcut(appName: string, executablePath: string, directory: string, launchOptions: string): Promise; /** * Adds user tags to specified apps in the Steam library. @@ -114,7 +115,13 @@ export interface Apps { */ GetAvailableCompatTools(appId: number): Promise; - GetBackupsInFolder: any; + /** + * Represents a function to retrieve the name of the application in a backup folder. + * @param {string} appBackupPath - The path to the application's backup folder. + * @returns {Promise} - A Promise that resolves to the name of the application in the backup folder, or undefined if the path is invalid. + */ + GetBackupsInFolder(appBackupPath: string): Promise; + GetCachedAppDetails: any; GetCloudPendingRemoteOperations: any; GetConflictingFileTimestamps: any; @@ -146,7 +153,8 @@ export interface Apps { */ GetFriendsWhoPlay(appId: number): Promise; - GetGameActionDetails: any; + GetGameActionDetails(appId: number, callback: (gameAction: GameAction) => void): void; + GetGameActionForApp: any; GetLaunchOptionsForApp: any; GetLibraryBootstrapData: any; @@ -174,10 +182,29 @@ export interface Apps { */ GetResolutionOverrideForApp(appId: number): Promise; - GetScreenshotInfo(param0: string, param1: number): any; + /** + * Represents a function to retrieve detailed information about a specific screenshot. + * @param {string} appId - The ID of the application the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @returns {Promise} - A Promise that resolves to detailed information about the specified screenshot. + */ + GetScreenshotInfo(appId: string, hHandle: number): Promise; + + /** + * Represents a function to retrieve screenshots within a specified time range. + * @param {number} appId - The ID of the application. + * @param {number} start - The start of the time range as a Unix timestamp. + * @param {number} end - The end of the time range as a Unix timestamp. + * @returns {Promise} - A Promise that resolves to an array of screenshots taken within the specified time range. + */ + GetScreenshotsInTimeRange(appId: number, start: number, end: number): Promise; - GetScreenshotsInTimeRange: any; - GetShortcutData: any; + /** + * Represents a function to retrieve shortcut data for a list of non-Steam app IDs. + * @param {number[]} appIds - An array of non-Steam application IDs. + * @returns {Promise} - A Promise that resolves to an array of Shortcut objects for the specified non-Steam app IDs. + */ + GetShortcutData(appIds: number[]): Promise; /** * Retrieves shortcut data for a given shortcut file path. @@ -186,7 +213,12 @@ export interface Apps { */ GetShortcutDataForPath(pathToShortcut: string): Promise; - GetSoundtrackDetails: any; + /** + * Represents a function to retrieve details about a soundtrack associated with a soundtrack application. + * @param {number} appId - The ID of the soundtrack application. + * @returns {Promise} - A Promise that resolves to the details of the soundtrack associated with the specified soundtrack application. + */ + GetSoundtrackDetails(appId: number): Promise; GetStoreTagLocalization(tags: number[]): Promise; @@ -203,7 +235,7 @@ export interface Apps { ListFlatpakApps(): Promise; - LoadEula: any; + LoadEula(appId: number): Promise; // Doesn't bring up the EULA dialog, just returns the eula data MarkEulaAccepted: any; MarkEulaRejected: any; @@ -220,7 +252,7 @@ export interface Apps { /** * Registers a callback function to be called when achievement changes occur. * @param callback The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForAchievementChanges(callback: () => void): Unregisterable | any; @@ -230,7 +262,7 @@ export interface Apps { * Registers a callback function to be called when app details change. * @param appId The ID of the application to monitor. * @param callback The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; @@ -249,7 +281,7 @@ export interface Apps { /** * Registers a callback function to be called when a game action UI is shown. * @param callback The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; // todo: no idea what this callback is from @@ -396,7 +428,9 @@ export interface Apps { SetCustomArtworkForApp(appId: number, base64Image: string, imageType: string, assetType: number): Promise; SetCustomLogoPositionForApp: any; - SetDLCEnabled: any; + + SetDLCEnabled(appId: number, appDLCId: number, value: boolean): void; + SetLocalScreenshotCaption: any; SetLocalScreenshotPrivacy: any; SetLocalScreenshotSpoiler: any; @@ -467,7 +501,7 @@ export interface Apps { /** * Terminates a running application. * @param {string} appId - The ID of the application to terminate. - * @param {boolean} param1 - Additional parameter. // Todo: Unknown usage. My guess is it forces the termination; otherwise, attempts a graceful termination. + * @param {boolean} param1 - Additional parameter. Exact usage may vary. * @returns {void} */ TerminateApp(appId: string, param1: boolean): void; @@ -525,10 +559,13 @@ export interface Auth { StartSignInFromCache: any; } +// Broadcasting support hasn't been implemented on Linux yet export interface Broadcast { ApproveViewerRequest: any; InviteToWatch: any; - RegisterForBroadcastStatus: Unregisterable | any; + + RegisterForBroadcastStatus(callback: (broadcastStatus: BroadcastStatus) => void): Unregisterable | any; + RegisterForViewerRequests: Unregisterable | any; RejectViewerRequest: any; StopBroadcasting: any; @@ -608,7 +645,7 @@ export interface Console { /** * Registers a callback function to receive spew output. * @param {function} callback - The callback function that will receive spew output. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForSpewOutput(callback: (spewOutput: SpewOutput) => void): Unregisterable | any; } @@ -745,7 +782,7 @@ export interface FriendSettings { /** * Registers a callback function to be notified of friend settings changes. * @param callback - The callback function to be called when friend settings change. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. * @todo The callback receives an escaped JSON object string as "settingsChanges", which should be parsed into FriendSettingsChange object. */ RegisterForSettingsChanges(callback: (settingsChanges: string) => void): Unregisterable | any; @@ -807,8 +844,8 @@ export interface GameSessions { } export interface Input { - BIsSteamController: any; - BSupportsControllerLEDColor: any; + BIsSteamController(callback: (steamController: boolean) => void): void; // Whether the specified controller is a Steam Controller + BSupportsControllerLEDColor(callback: (supportControllerLEDColor: boolean) => void): void; // Whether the specified controller supports LED color CalibrateControllerIMU: any; CalibrateControllerJoystick: any; CalibrateControllerTrackpads: any; @@ -826,8 +863,10 @@ export interface Input { ForceConfiguratorFocus: any; ForceSimpleHapticEvent: any; FreeControllerConfig: any; - GetConfigForAppAndController: any; - GetControllerMappingString: any; + + GetConfigForAppAndController(appId: number, unControllerIndex: number): any; + + GetControllerMappingString(unControllerIndex: number): Promise;// returns mappings GetSteamControllerDongleState: any; GetTouchMenuIconsForApp: any; GetXboxDriverInstallState: any; @@ -853,7 +892,7 @@ export interface Input { /** * Registers a callback function to be invoked when controller input messages are received. * @param {(controllerInputMessages: ControllerInputMessage[]) => void} callback - The callback function to be invoked when controller input messages are received. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForControllerInputMessages(callback: (controllerInputMessages: ControllerInputMessage[]) => void): Unregisterable | any; @@ -1077,7 +1116,7 @@ export interface Installs { */ OpenUninstallWizard(appIds: number[], param1: boolean): any; - RegisterForShowConfirmUninstall: Unregisterable | any; // Broken? + RegisterForShowConfirmUninstall: Unregisterable | any; // Broken? doesn't seem to work /** * Registers a callback function to be called when the "Failed Uninstall" dialog is shown. @@ -1103,7 +1142,7 @@ export interface Installs { * @returns {void} * @remarks The wizard will not reflect this change immediately, but changing another option will. */ - SetAppList(appIds: number[]): void; // Sets a list of app identifiers for downloads, the wizard will not reflect this immediately but changing and option will. + SetAppList(appIds: number[]): void; /** * Sets the options for creating shortcuts in the installation wizard. @@ -1112,7 +1151,7 @@ export interface Installs { * @returns {void} * @remarks The wizard will not reflect this change immediately, but changing another option will. */ - SetCreateShortcuts(bDesktopShortcut: boolean, bSystemMenuShortcut: boolean): void; // Sets install wizard create shortcuts options + SetCreateShortcuts(bDesktopShortcut: boolean, bSystemMenuShortcut: boolean): void; /** * Sets the install folder for the installation wizard using an install folder index. @@ -1120,7 +1159,7 @@ export interface Installs { * @returns {void} * @remarks The wizard will not reflect this change immediately, but changing another option will. */ - SetInstallFolder(folderIndex: number): void; // Sets install wizard install folder with install folder index + SetInstallFolder(folderIndex: number): void; } export interface Messaging { @@ -1256,17 +1295,56 @@ export interface OpenVR { } export interface Overlay { - DestroyGamePadUIDesktopConfiguratorWindow: any; + /** + * Destroys the gamepad UI desktop configurator window if open. + * @returns {void} + */ + DestroyGamePadUIDesktopConfiguratorWindow(): void; + GetOverlayBrowserInfo: any; HandleGameWebCallback: any; HandleProtocolForOverlayBrowser: any; - RegisterForActiveOverlayRequests: Unregisterable | any; - RegisterForMicroTxnAuth: Unregisterable | any; - RegisterForMicroTxnAuthDismiss: Unregisterable | any; + RegisterForActivateOverlayRequests: Unregisterable | any; + + /** + * Registers a callback function to be called when a microtransaction authorization is requested. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMicroTxnAuth(callback: (appId: number, microTxnId: string, param2: number, microTxnUrl: string) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when a microtransaction authorization is dismissed by the user in Steam's authorization page. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMicroTxnAuthDismiss(callback: (appId: number, microTxnId: string) => void): Unregisterable | any; + RegisterForNotificationPositionChanged: Unregisterable | any; - RegisterForOverlayActivated: Unregisterable | any; - RegisterForOverlayBrowserProtocols: Unregisterable | any; - RegisterOverlayBrowserInfoChanged: Unregisterable | any; + + /** + * Registers a callback function to be called when an overlay is activated or closed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForOverlayActivated(callback: (popUpContextId: number, appId: number, active: boolean, param3: boolean) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the overlay browser protocols change. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForOverlayBrowserProtocols(callback: (browseProtocols: OverlayBrowserProtocols) => void): Unregisterable | any; + + /** + * Registers **the** callback function to be called when the overlay browser information changes. + * @param {function} callback - The callback function to be called when the overlay browser information changes. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @remarks Do Not Use, this will break the overlay unless you know what you are doing. + */ + RegisterOverlayBrowserInfoChanged(callback: () => void): Unregisterable | any; + + SetOverlayState: any; } @@ -1283,7 +1361,7 @@ export interface Parental { /** * Registers a callback function to be invoked when parental settings change. * @param {(parentalSettings: ParentalSettings) => void} callback - The callback function to be invoked when parental settings change. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForParentalSettingsChanges(callback: (parentalSettings: ParentalSettings) => void): Unregisterable | any; @@ -2138,8 +2216,31 @@ export interface AppDetails { export interface SteamAppOverview { appid: number; display_name: string; - app_type: number; // 1 - games, 2 - software, 4 - tools, 8192 - soundtracks - mru_index?: number; + + /** + * Invalid = 0; + * Game = 1; + * Application = 2; + * Tool = 4; + * Demo = 8; + * Deprecated = 16; + * DLC = 32; + * Guide = 64; + * Driver = 128; + * Config = 256; + * Hardware = 512; + * Franchise = 1024; + * Video = 2048; + * Plugin = 4096; + * MusicAlbum = 8192; + * Series = 16384; + * Comic = 32768; + * Beta = 65536; + * Shortcut = 1073741824; + * DepotOnly = -2147483648; + */ + app_type: number; + mru_index: number | undefined; rt_recent_activity_time: number; minutes_playtime_forever: number; minutes_playtime_last_two_weeks: number; @@ -2156,8 +2257,8 @@ export interface SteamAppOverview { rt_store_asset_mtime: number; sort_as: string; association: SteamAppOverviewAssociation[]; - m_setStoreCategories: unknown; - m_setStoreTags: unknown; + m_setStoreCategories: Set; + m_setStoreTags: Set; per_client_data: SteamAppOverviewClientData[]; canonicalAppType: number; local_per_client_data: SteamAppOverviewClientData; @@ -2168,6 +2269,8 @@ export interface SteamAppOverview { review_score_without_bombs: number; review_percentage_without_bombs: number; steam_deck_compat_category: number; + m_strPerClientData: Set | undefined; + m_strAssociations: Set | undefined; gameid: string; @@ -2177,6 +2280,12 @@ export interface SteamAppOverview { } export interface SteamAppOverviewAssociation { + /** + * Invalid = 0; + * Publisher = 1; + * Developer = 2; + * Franchise = 3; + */ type: number; name: string; } @@ -2184,6 +2293,44 @@ export interface SteamAppOverviewAssociation { export interface SteamAppOverviewClientData { clientid: string; client_name: string; + /** + * 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; + */ display_status: number; status_percentage: number; bytes_downloaded: string; @@ -2191,16 +2338,17 @@ export interface SteamAppOverviewClientData { is_available_on_current_platform: boolean; /** - * cloud status 0 is don't show - * cloud status 1 is disabled - * cloud status 2 is unknown - * cloud status 3 is up to date - * cloud status 4 is checking... - * cloud status 5 is out of sync - * cloud status 6 is uploading... - * cloud status 7 is downloading... - * cloud status 8 is unable to sync - * cloud status 9 is file conflict + * Invalid = 0; + * Disabled = 1; + * Unknown = 2; + * Synchronized = 3; + * Checking = 4; + * OutOfSync = 5; + * Uploading = 6; + * Downloading = 7; + * SyncFailed = 8; + * Conflict = 9; + * PendingElsewhere = 10; */ cloud_status: number; } @@ -2806,7 +2954,7 @@ export interface FriendSettingsChange { export interface ProxyInfo { proxy_mode: number; address: string; - port: number; // todo: 16 bit integer + port: number; exclude_local: boolean; } @@ -2872,6 +3020,50 @@ export interface MusicTrack { nLengthInMsec: number; } +export interface SoundtrackDetails { + tracks: Track[]; + metadata: SoundtrackMetadata; + vecAdditionalImageAssetURLs: string[]; + strCoverImageAssetURL: string; +} + +export interface SoundtrackMetadata { + artist: string; +} + +export interface Track { + discNumber: number; + trackNumber: number; + durationSeconds: number; + trackDisplayName: string; +} + +export interface EndUserLicenseAgreement { + id: string; + url: string; + version: number; +} + +export interface BroadcastStatus { + broadcastid: string; + nViewers: number; + nRequests: number; + bIsBroadcasting: boolean; + bIsRecordingDesktop: boolean; + eBroadcastReady: number; + bBroadcastCapable: boolean; + bMicrophoneEnabled: boolean; + bMicrophoneActive: boolean; + nCurrentFPS: number; + nUploadKbps: number; +} + +export interface OverlayBrowserProtocols { + unAppID: number; + strScheme: string; + bAdded: boolean; +} + export interface Unregisterable { /** From db0b58a6be13935e5038b9bf10e8e14669c38e0a Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Fri, 1 Sep 2023 09:28:58 +0800 Subject: [PATCH 09/46] change: Update interfaces to Steam Version 1691097434 Steam Version: 1691097434 Steam Client Build Date: Fri, Aug 4 04:54 UTC -08:00 --- src/globals/SteamClient.ts | 67 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index dffd172d..a1707965 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -247,6 +247,7 @@ export interface Apps { */ OpenAppSettingsDialog(appId: number, param1: string): void; + PromptToChangeShortcut: any; // Steam Version 1691097434 RaiseWindowForGame: any; /** @@ -761,6 +762,8 @@ export interface FamilySharing { */ DeauthorizeLocalDevice(): Promise; + RegisterForKickedBorrower: any; // Steam Version 1691097434 + RequestFamilySharingAuthorization(param0: string): Promise; // Unknown param0, my assumption is probably a steam64Id of the user sharing the library UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise; // Unknown } @@ -1267,7 +1270,25 @@ export interface DeviceProperties { } export interface Keyboard { + Hide: any; // Steam Version 1691097434 + RegisterForStatus: Unregisterable | any; // Steam Version 1691097434 + SendDone: any; // Steam Version 1691097434 SendText: any; + Show: any; // Steam Version 1691097434 +} + +export interface PathProperties { + GetBoolPathProperty: any; + GetDoublePathProperty: any; + GetFloatPathProperty: any; + GetInt32PathProperty: any; + GetStringPathProperty: any; + RegisterForPathPropertyChange: any; + SetBoolPathProperty: any; + SetDoublePathProperty: any; + SetFloatPathProperty: any; + SetInt32PathProperty: any; + SetStringPathProperty: any; } export interface VROverlay { @@ -1278,17 +1299,15 @@ export interface OpenVR { Device: VRDevice; DeviceProperties: DeviceProperties; GetWebSecret: any; - HideKeyboard: any; InstallVR: any; Keyboard: Keyboard; + PathProperties: PathProperties; // Steam Version 1691097434 QuitAllVR: any; RegisterForInstallDialog: Unregisterable | any; RegisterStartupErrors: Unregisterable | any; RegisterForVRHardwareDetected: Unregisterable | any; RegisterForVRModeChange: Unregisterable | any; - SendKeyboardDone: any; SetOverlayInteractionAffordance: any; - ShowKeyboard: any; StartVR: any; TriggerOverlayHapticEffect: any; VROverlay: VROverlay; @@ -1711,6 +1730,22 @@ export interface Audio { SetDeviceVolume: any; } +export interface AudioDevice { // Steam Version 1691097434 + RegisterForStateChanges: Unregisterable | any; + UpdateSomething: any; +} + +export interface Bluetooth { // Steam Version 1691097434 + CancelPairing: any; + Connect: any; + Disconnect: any; + Pair: any; + RegisterForStateChanges: Unregisterable | any; + SetAdapterDiscovering: any; + SetEnabled: any; + UnPair: any; +} + export interface Devkit { DeveloperModeChanged: any; RegisterForPairingPrompt: Unregisterable | any; @@ -1728,6 +1763,21 @@ export interface Display { SetUnderscanLevel: any; } +export interface DisplayManager { // Steam Version 1691097434 + ClearModeOverride: any; + GetState: any; + RegisterForStateChanges: Unregisterable | any; + SetCompatibilityMode: any; + SetGamescopeInternalResolution: any; + SetMode: any; +} + +export interface Dock { // Steam Version 1691097434 + DisarmSafetyNet: any; + RegisterForStateChanges: Unregisterable | any; + UpdateFirmware: any; +} + export interface WirelessNetwork { Forget: any; SetAutoconnect: any; @@ -1763,6 +1813,12 @@ export interface Network { StopScanningForNetworks(): Promise; // Returns {"result":1,"message":""} } +export interface Perf { + RegisterForDiagnosticInfoChanges: Unregisterable | any; + RegisterForStateChanges: Unregisterable | any; + UpdateSettings: any; +} + export interface Report { GenerateSystemReport: any; Submit: any; @@ -1795,8 +1851,12 @@ export interface SystemUI { export interface System { Audio: Audio; + AudioDevice: AudioDevice; // Steam Version 1691097434 + Bluetooth: Bluetooth; Devkit: Devkit; Display: Display; + DisplayManager: DisplayManager; // Steam Version 1691097434 + Dock: Dock; // Steam Version 1691097434 ExitFakeCaptivePortal: any; FactoryReset: any; FormatStorage: any; @@ -1810,6 +1870,7 @@ export interface System { NotifyGameOverlayStateChanged: any; OpenFileDialog: any; OpenLocalDirectoryInSystemExplorer: any; + Perf: Perf; // Steam Version 1691097434 RebootToAlternateSystemPartition: any; RebootToFactoryTestImage: any; From eec1200c23ddc5be3f6bedf764f3e86edf7d63f8 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Sat, 2 Sep 2023 19:06:14 +0800 Subject: [PATCH 10/46] new: Document some SteamClient interfaces - part 8 --- src/globals/SteamClient.ts | 290 ++++++++++++++++++++++++++++++++----- 1 file changed, 255 insertions(+), 35 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index a1707965..c9130e8b 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -156,7 +156,16 @@ export interface Apps { GetGameActionDetails(appId: number, callback: (gameAction: GameAction) => void): void; GetGameActionForApp: any; - GetLaunchOptionsForApp: any; + + /** + * Retrieves launch options for a specified application. + * These options may include different configurations or settings for launching the application, such as DirectX, Vulkan, OpenGL, 32-bit, 64-bit, etc. + * This function does not retrieve launch/argument options inputted by the user. + * @param {number} appId - The ID of the application. + * @returns {Promise} - A Promise that resolves to an array of launch options for the specified application. + */ + GetLaunchOptionsForApp(appId: number): Promise; + GetLibraryBootstrapData: any; /** @@ -247,7 +256,7 @@ export interface Apps { */ OpenAppSettingsDialog(appId: number, param1: string): void; - PromptToChangeShortcut: any; // Steam Version 1691097434 + PromptToChangeShortcut: any; RaiseWindowForGame: any; /** @@ -762,7 +771,7 @@ export interface FamilySharing { */ DeauthorizeLocalDevice(): Promise; - RegisterForKickedBorrower: any; // Steam Version 1691097434 + RegisterForKickedBorrower: any; RequestFamilySharingAuthorization(param0: string): Promise; // Unknown param0, my assumption is probably a steam64Id of the user sharing the library UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise; // Unknown @@ -1270,11 +1279,11 @@ export interface DeviceProperties { } export interface Keyboard { - Hide: any; // Steam Version 1691097434 - RegisterForStatus: Unregisterable | any; // Steam Version 1691097434 - SendDone: any; // Steam Version 1691097434 + Hide: any; + RegisterForStatus: Unregisterable | any; + SendDone: any; SendText: any; - Show: any; // Steam Version 1691097434 + Show: any; } export interface PathProperties { @@ -1301,7 +1310,7 @@ export interface OpenVR { GetWebSecret: any; InstallVR: any; Keyboard: Keyboard; - PathProperties: PathProperties; // Steam Version 1691097434 + PathProperties: PathProperties; QuitAllVR: any; RegisterForInstallDialog: Unregisterable | any; RegisterStartupErrors: Unregisterable | any; @@ -1626,7 +1635,7 @@ export interface Settings { GetRegisteredSteamDeck(): Promise; - // Returns the current timezone "America/Los_Angeles" + // Returns the current timezone GetTimeZone(): Promise; GetWindowed(): Promise; @@ -1638,7 +1647,7 @@ export interface Settings { RegisterForSettingsChanges(callback: (steamSettings: SteamSettings) => void): Unregisterable | any; - RegisterForTimeZoneChange: Unregisterable | any; + RegisterForTimeZoneChange(callback: (timezoneId: string) => void): Unregisterable | any; // When timezone is changed from settings, callback will return new timezoneId ReinitMicSettings: any; RequestDeviceAuthInfo: any; SelectClientBeta: any; @@ -1648,12 +1657,15 @@ export interface Settings { // Get from available languages SetCurrentLanguage(strShortName: string): void; - SetEnableSoftProcessKill: any; + SetEnableSoftProcessKill(value: boolean): void; // Default value is false, this is Valve internal menu SetEnableTestUpdaters: any; - SetForceOOBE: any; + + SetForceOOBE(value: boolean): void; // Force OOBE - Forces out of box experience on every device start SetHostname: any; SetMicTestMode: any; - SetOOBETestMode: any; + + SetOOBETestMode(value: boolean): void; + SetOverrideBrowserComposerMode: any; SetPreferredMonitor: any; SetRegisteredSteamDeck: any; @@ -1661,7 +1673,8 @@ export interface Settings { SetSetting: any; SetShowMobxDevTools: any; SetSteamPlayEnabled: any; - SetTimeZone: any; + + SetTimeZone(timezoneId: string): void; // You can get valid timezoneIds from GetAvailableTimeZones() SetUseNintendoButtonLayout: any; SetWindowed: any; @@ -1702,13 +1715,47 @@ export interface Storage { export interface Streaming { AcceptStreamingEULA: any; CancelStreamGame: any; - RegisterForStreamingClientFinished: Unregisterable | any; - RegisterForStreamingClientLaunchProgress: Unregisterable | any; - RegisterForStreamingClientStarted: Unregisterable | any; - RegisterForStreamingLaunchComplete: Unregisterable | any; + + /** + * Registers a callback function to be called when the streaming client finishes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingClientFinished(callback: (param0: number, description: string) => void): Unregisterable | any; + + + /** + * Registers a callback function to be called when there is progress in the launch of the streaming client. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingClientLaunchProgress(callback: (actionType: string, param1: string, param2: number, param3: number) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the streaming client is started (e.g., when clicking the stream button). + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingClientStarted(callback: (appId: number) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the streaming launch is complete. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @todo Param0 is likely a code, 1 being it started, 10 being host computer is updating game, param1 just returns "complete" + */ + RegisterForStreamingLaunchComplete(callback: (param0: number, param1: string) => void): Unregisterable | any; + RegisterForStreamingShowEula: Unregisterable | any; RegisterForStreamingShowIntro: Unregisterable | any; - RegisterForStreamingShowLaunchOptions: Unregisterable | any; + + /** + * Registers a callback function to be called when the streaming client receives launch options from the host. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingShowLaunchOptions(callback: (appId: number, launchOptions: LaunchOption[]) => void): Unregisterable | any; // Callback when streaming client receives launch options from host + StreamingContinueStreamGame: any; StreamingSetLaunchOption: any; } @@ -1730,20 +1777,76 @@ export interface Audio { SetDeviceVolume: any; } -export interface AudioDevice { // Steam Version 1691097434 +export interface AudioDevice { RegisterForStateChanges: Unregisterable | any; UpdateSomething: any; } -export interface Bluetooth { // Steam Version 1691097434 - CancelPairing: any; - Connect: any; - Disconnect: any; - Pair: any; - RegisterForStateChanges: Unregisterable | any; - SetAdapterDiscovering: any; - SetEnabled: any; - UnPair: any; +/** + * Provides functionality for managing Bluetooth devices and interactions. + */ +export interface Bluetooth { + /** + * Cancels an ongoing pairing request with a Bluetooth device. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the Bluetooth device to cancel pairing with. + * @returns {Promise} - A Promise that resolves with the result of the cancellation. + */ + CancelPairing(adapterId: number, deviceId: number): Promise; + + /** + * Connects to a paired Bluetooth device using the specified adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the paired Bluetooth device to connect to. + * @returns {Promise} - A Promise that resolves with the result of the connection attempt. + */ + Connect(adapterId: number, deviceId: number): Promise; + + /** + * Disconnects from a currently connected Bluetooth device using the specified adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the connected Bluetooth device to disconnect from. + * @returns {Promise} - A Promise that resolves with the result of the disconnection. + */ + Disconnect(adapterId: number, deviceId: number): Promise; + + /** + * Initiates pairing with a Bluetooth device using the specified adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the Bluetooth device to initiate pairing with. + * @returns {Promise} - A Promise that resolves with the result of the pairing attempt. + */ + Pair(adapterId: number, deviceId: number): Promise; + + /** + * Registers a callback function to be called when the Bluetooth state changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStateChanges(callback: (bluetoothStateChange: BluetoothStateChange) => void): Unregisterable | any; + + /** + * Sets whether the Bluetooth adapter should be in discovering mode. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {boolean} value - `true` to enable discovering mode, `false` to disable it. + * @returns {Promise} - A Promise that resolves with the result of the operation. + */ + SetAdapterDiscovering(adapterId: number, value: boolean): Promise; + + /** + * Enables or disables Bluetooth functionality. + * @param {boolean} bluetooth - `true` to enable Bluetooth, `false` to disable it. + * @returns {Promise} - A Promise that resolves with the result of the operation. + */ + SetEnabled(bluetooth: boolean): Promise; + + /** + * Unpairs a Bluetooth device from the adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the Bluetooth device to unpair with. + * @returns {Promise} - A Promise that resolves with the result of the unpairing request. + */ + UnPair(adapterId: number, deviceId: number): Promise; } export interface Devkit { @@ -1763,7 +1866,7 @@ export interface Display { SetUnderscanLevel: any; } -export interface DisplayManager { // Steam Version 1691097434 +export interface DisplayManager { ClearModeOverride: any; GetState: any; RegisterForStateChanges: Unregisterable | any; @@ -1772,7 +1875,7 @@ export interface DisplayManager { // Steam Version 1691097434 SetMode: any; } -export interface Dock { // Steam Version 1691097434 +export interface Dock { DisarmSafetyNet: any; RegisterForStateChanges: Unregisterable | any; UpdateFirmware: any; @@ -1851,12 +1954,12 @@ export interface SystemUI { export interface System { Audio: Audio; - AudioDevice: AudioDevice; // Steam Version 1691097434 + AudioDevice: AudioDevice; Bluetooth: Bluetooth; Devkit: Devkit; Display: Display; - DisplayManager: DisplayManager; // Steam Version 1691097434 - Dock: Dock; // Steam Version 1691097434 + DisplayManager: DisplayManager; + Dock: Dock; ExitFakeCaptivePortal: any; FactoryReset: any; FormatStorage: any; @@ -1870,7 +1973,7 @@ export interface System { NotifyGameOverlayStateChanged: any; OpenFileDialog: any; OpenLocalDirectoryInSystemExplorer: any; - Perf: Perf; // Steam Version 1691097434 + Perf: Perf; RebootToAlternateSystemPartition: any; RebootToFactoryTestImage: any; @@ -3125,6 +3228,123 @@ export interface OverlayBrowserProtocols { bAdded: boolean; } +export interface LaunchOption { + nIndex: number; + strDescription: string; + strGameName: string; +} + +/** + * Represents information about a Bluetooth adapter. + */ +export interface BluetoothAdapter { + /** + * The unique identifier of the Bluetooth adapter. + */ + nId: number; + + /** + * The MAC address of the Bluetooth adapter. + */ + sMAC: string; + + /** + * The name of the Bluetooth adapter. + */ + sName: string; + + /** + * Indicates whether the Bluetooth adapter is enabled. + */ + bEnabled: boolean; + + /** + * Indicates whether the Bluetooth adapter is in discovering mode. + */ + bDiscovering: boolean; +} + +/** + * Represents information about a Bluetooth device. + */ +export interface BluetoothDevice { + /** + * The unique identifier of the Bluetooth device. + */ + nId: number; + + /** + * The ID of the Bluetooth adapter to which this device is discovered by / connected to. + */ + nAdapterId: number; + + /** + * The type of the Bluetooth device (e.g., headphones, mouse, keyboard). + * @remarks 2 - Smartphone, 5 - Wireless Handset, 10 - Wireless Controller, 11 - Keyboard + */ + eType: number; + + /** + * The MAC address of the Bluetooth device. + */ + sMAC: string; + + /** + * The name of the Bluetooth device. + */ + sName: string; + + /** + * Indicates whether the Bluetooth device is currently connected to the adapter. + */ + bConnected: boolean; + + /** + * Indicates whether the Bluetooth device is paired to the adapter. + */ + bPaired: boolean; + + /** + * The raw signal strength of the Bluetooth device. + */ + nStrengthRaw: number; +} + +/** + * Represents a change in the state of Bluetooth adapters and devices. + */ +export interface BluetoothStateChange { + /** + * An array of Bluetooth adapters with their current state. + */ + vecAdapters: BluetoothAdapter[]; + + /** + * An array of Bluetooth devices with their current state. + */ + vecDevices: BluetoothDevice[]; + + /** + * Indicates whether Bluetooth is enabled (`true`) or disabled (`false`). + */ + bEnabled: boolean; +} + +/** + * Represents the response of a Bluetooth operation. + */ +export interface BluetoothOperationResponse { + /** + * The result code of the operation (1 for success, 2 for failure). + */ + result: number; + + /** + * A message describing the result of the operation. + */ + message: string; +} + export interface Unregisterable { /** From be22953e0554af03fa06a96dd99e3b7d4261b3fd Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Mon, 4 Sep 2023 16:19:45 +0800 Subject: [PATCH 11/46] new: Document some SteamClient interfaces - part 9 --- src/globals/SteamClient.ts | 312 ++++++++++++++++++++++++++++++++----- 1 file changed, 277 insertions(+), 35 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index c9130e8b..681cc7cc 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -122,12 +122,25 @@ export interface Apps { */ GetBackupsInFolder(appBackupPath: string): Promise; - GetCachedAppDetails: any; + GetCachedAppDetails(appId: number): Promise; // todo: Parsing nightmare, returns a string like // [["achievements",{"version":2,"data":{"vecHighlight":[{"strID":"AchNyxChaosReunion","strName":"Night and Darkness","strDescription":"Fulfill the 'Night and Darkness' Prophecy","bAchieved":true,"rtUnlocked":1688769817,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/fa367c6ffb8495cdaac17bdfdccfe358e3a089fe.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":11.199999809265137},{"strID":"AchSilverSkellyTrophy","strName":"Skelly's Last Lamentations","strDescription":"Earn the second of Skelly's prizes","bAchieved":true,"rtUnlocked":1688769465,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/5cb095fe7abc9fdf7340bc25637e97fab4fa682d.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":7.599999904632568},{"strID":"AchBuffedButterfly","strName":"Thorn of Thanatos","strDescription":"Get 30% bonus damage with the Pierced Butterfly","bAchieved":true,"rtUnlocked":1686611642,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/97caa23cdfb43ae581ee56c0b3b4eaadd7eda49d.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":7.599999904632568},{"strID":"AchFoundAllSummons","strName":"Complete Set","strDescription":"Earn all Chthonic Companions","bAchieved":true,"rtUnlocked":1685708516,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/aa9c66d2af7aa367490f953e54829b9c95fef474.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":7},{"strID":"ActUnlockedAllAspects","strName":"Infernal Arms","strDescription":"Unlock all Weapon Aspects","bAchieved":true,"rtUnlocked":1685698220,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/35779dd3575af4fcc9b4aa9e42c5639dd4ff5ded.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":9.899999618530273},{"strID":"AchSisyphusLiberation","strName":"End to Torment","strDescription":"Fulfill the 'End to Torment' Prophecy","bAchieved":true,"rtUnlocked":1685698202,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/437398a6a89d53e5a114fb11bc2ee538e990349e.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":10.800000190734863},{"strID":"AchMyrmidonReunion","strName":"Divided by Death","strDescription":"Fulfill the 'Divided by Death' Prophecy","bAchieved":true,"rtUnlocked":1685240429,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/1136200c4e397c4ff3af5c97d3f0d16614dac1d7.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":9},{"strID":"AchReachedEpilogue","strName":"One for the Ages","strDescription":"Reach the epilogue of the story","bAchieved":true,"rtUnlocked":1685240411,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/6065e9fa889e953201201a062d0a8f8dd75e943e.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":8.699999809265137},{"strID":"AchPactUpgradesClears","strName":"Harsh Conditions","strDescription":"Fulfill the 'Harsh Conditions' Prophecy","bAchieved":true,"rtUnlocked":1685237824,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/40d01fbcb70ed7eeb41c98244683895f7b2befec.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":8.100000381469727},{"strID":"AchLeveledKeepsakes","strName":"Friends Forever","strDescription":"Max-rank each standard Keepsake","bAchieved":true,"rtUnlocked":1685090343,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/27423565bd81b365b8ec37462e44c6215df26beb.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":6.199999809265137},{"strID":"AchBronzeSkellyTrophy","strName":"The Useless Trinket","strDescription":"Earn the first of Skelly's prizes","bAchieved":true,"rtUnlocked":1684473962,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/4c4be2fc0e6f1c6906e41ac2aa3a9d87985e7a98.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":13.699999809265137},{"strID":"AchEliteAttributeKills","strName":"Slashed Benefits","strDescription":"Fulfill the 'Slashed Benefits' Prophecy","bAchieved":true,"rtUnlocked":1684473931,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/49532f6187591c23b3d39760c87e5ad82e7d37c1.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":12.899999618530273}],"vecUnachieved":[],"vecAchievedHidden":[],"nTotal":49,"nAchieved":49}}]] GetCloudPendingRemoteOperations: any; GetConflictingFileTimestamps: any; - GetDetailsForScreenshotUpload: any; - GetDetailsForScreenshotUploads(param0: string, param1: number[]): any; + /** + * Retrieves details for a specific screenshot upload. + * @param {string} appId - The ID of the application. + * @param {number} hHandle - The handle of the screenshot upload. + * @returns {Promise} - A Promise that resolves to details about the screenshot upload. + */ + GetDetailsForScreenshotUpload(appId: string, hHandle: number): Promise; + + /** + * Retrieves details for multiple screenshot uploads. + * @param {string} appId - The ID of the application. + * @param {number[]} hHandles - An array of handles of the screenshot uploads. + * @returns {Promise} - A Promise that resolves to details about the screenshot uploads. + */ + GetDetailsForScreenshotUploads(appId: string, hHandles: number[]): Promise; /** * Retrieves a list of downloaded workshop items for a specific application. @@ -256,7 +269,7 @@ export interface Apps { */ OpenAppSettingsDialog(appId: number, param1: string): void; - PromptToChangeShortcut: any; + PromptToChangeShortcut(): Promise; // todo: unknown, prompts file picker RaiseWindowForGame: any; /** @@ -317,7 +330,8 @@ export interface Apps { RegisterForGameActionUserRequest(callback: (gameActionIdentifier: number, appId: string, action: string, requestedAction: string, appId2: string) => void): Unregisterable | any; RegisterForLocalizationChanges: Unregisterable | any; - RegisterForPrePurchasedAppChanges: Unregisterable | any; + + RegisterForPrePurchasedAppChanges(callback: () => void): Unregisterable | any; // Unknown, did have it show up a few times, but not callback parameters RegisterForShowMarketingMessageDialog: Unregisterable | any; /** @@ -1760,21 +1774,104 @@ export interface Streaming { StreamingSetLaunchOption: any; } +/** + * Represents various functions related to Steam system audio. + */ export interface Audio { - ClearDefaultDeviceOverride: any; - GetApps: any; - GetDevices: any; - RegisterForAppAdded: Unregisterable | any; - RegisterForAppRemoved: Unregisterable | any; - RegisterForAppVolumeChanged: Unregisterable | any; - RegisterForDeviceAdded: Unregisterable | any; - RegisterForDeviceRemoved: Unregisterable | any; - RegisterForDeviceVolumeChanged: Unregisterable | any; + /** + * Clears the default device override for a specified audio type. + * @param {number} audioType - The audio type (0 for input, 1 for output). + * @returns {Promise} - A Promise indicating the result of the operation. + */ + ClearDefaultDeviceOverride(audioType: number): Promise; + + /** + * Retrieves information about audio applications. + * @returns {Promise} - A Promise that resolves to information about audio applications. + */ + GetApps(): Promise; + + /** + * Retrieves information about audio devices. + * @returns {Promise} - A Promise that resolves to information about audio devices. + */ + GetDevices(): Promise; + + /** + * Registers a callback to be called when a new audio application is added. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppAdded(callback: (appAudioAdded: ApplicationAudio) => void): Unregisterable | any; + + /** + * Registers a callback to be called when an audio application is removed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppRemoved(callback: (appAudioId: number) => void): Unregisterable | any; + + /** + * Registers a callback to be called when the volume of an audio application changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppVolumeChanged(callback: (appAudioId: number, volume: number) => void): Unregisterable | any; + + /** + * Registers a callback to be called when a new audio device is added. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceAdded(callback: (audioDevice: Device) => void): Unregisterable | any; + + /** + * Registers a callback to be called when an audio device is removed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceRemoved(callback: (audioDeviceId: number) => void): Unregisterable | any; + + /** + * Registers a callback to be called when the volume of an audio device changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceVolumeChanged(callback: (audioDeviceId: number, audioType: number, volume: number) => void): Unregisterable | any; + RegisterForServiceConnectionStateChanges: Unregisterable | any; - RegisterForVolumeButtonPressed: Unregisterable | any; - SetAppVolume: any; - SetDefaultDeviceOverride: any; - SetDeviceVolume: any; + + /** + * Registers a callback to be called when volume buttons are pressed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForVolumeButtonPressed(callback: (volumeUpPressed: boolean) => void): Unregisterable | any; + + /** + * Sets the volume of an audio application. + * @param {number} appAudioId - The ID of the audio application. + * @param {number} volume - The volume level (floating point value between 0 and 1). + * @returns {Promise} - A Promise indicating the result of the operation. + */ + SetAppVolume(appAudioId: number, volume: number): Promise; + + /** + * Sets the default device override for a specified audio type. + * @param {number} audioDeviceId - The ID of the audio device. + * @param {number} audioType - The audio type (0 for input, 1 for output). + * @returns {Promise} - A Promise indicating the result of the operation. + */ + SetDefaultDeviceOverride(audioDeviceId: number, audioType: number): Promise; + + /** + * Sets the volume of an audio device. + * @param {number} audioDeviceId - The ID of the audio device. + * @param {number} audioType - The audio type (0 for input, 1 for output). + * @param {number} volume - The volume level (floating point value between 0 and 1). + * @returns {Promise} - A Promise indicating the result of the operation. + */ + SetDeviceVolume(audioDeviceId: number, audioType: number, volume: number): Promise; } export interface AudioDevice { @@ -1790,33 +1887,33 @@ export interface Bluetooth { * Cancels an ongoing pairing request with a Bluetooth device. * @param {number} adapterId - The ID of the Bluetooth adapter. * @param {number} deviceId - The ID of the Bluetooth device to cancel pairing with. - * @returns {Promise} - A Promise that resolves with the result of the cancellation. + * @returns {Promise} - A Promise that resolves with the result of the cancellation. */ - CancelPairing(adapterId: number, deviceId: number): Promise; + CancelPairing(adapterId: number, deviceId: number): Promise; /** * Connects to a paired Bluetooth device using the specified adapter. * @param {number} adapterId - The ID of the Bluetooth adapter. * @param {number} deviceId - The ID of the paired Bluetooth device to connect to. - * @returns {Promise} - A Promise that resolves with the result of the connection attempt. + * @returns {Promise} - A Promise that resolves with the result of the connection attempt. */ - Connect(adapterId: number, deviceId: number): Promise; + Connect(adapterId: number, deviceId: number): Promise; /** * Disconnects from a currently connected Bluetooth device using the specified adapter. * @param {number} adapterId - The ID of the Bluetooth adapter. * @param {number} deviceId - The ID of the connected Bluetooth device to disconnect from. - * @returns {Promise} - A Promise that resolves with the result of the disconnection. + * @returns {Promise} - A Promise that resolves with the result of the disconnection. */ - Disconnect(adapterId: number, deviceId: number): Promise; + Disconnect(adapterId: number, deviceId: number): Promise; /** * Initiates pairing with a Bluetooth device using the specified adapter. * @param {number} adapterId - The ID of the Bluetooth adapter. * @param {number} deviceId - The ID of the Bluetooth device to initiate pairing with. - * @returns {Promise} - A Promise that resolves with the result of the pairing attempt. + * @returns {Promise} - A Promise that resolves with the result of the pairing attempt. */ - Pair(adapterId: number, deviceId: number): Promise; + Pair(adapterId: number, deviceId: number): Promise; /** * Registers a callback function to be called when the Bluetooth state changes. @@ -1829,24 +1926,24 @@ export interface Bluetooth { * Sets whether the Bluetooth adapter should be in discovering mode. * @param {number} adapterId - The ID of the Bluetooth adapter. * @param {boolean} value - `true` to enable discovering mode, `false` to disable it. - * @returns {Promise} - A Promise that resolves with the result of the operation. + * @returns {Promise} - A Promise that resolves with the result of the operation. */ - SetAdapterDiscovering(adapterId: number, value: boolean): Promise; + SetAdapterDiscovering(adapterId: number, value: boolean): Promise; /** * Enables or disables Bluetooth functionality. * @param {boolean} bluetooth - `true` to enable Bluetooth, `false` to disable it. - * @returns {Promise} - A Promise that resolves with the result of the operation. + * @returns {Promise} - A Promise that resolves with the result of the operation. */ - SetEnabled(bluetooth: boolean): Promise; + SetEnabled(bluetooth: boolean): Promise; /** * Unpairs a Bluetooth device from the adapter. * @param {number} adapterId - The ID of the Bluetooth adapter. * @param {number} deviceId - The ID of the Bluetooth device to unpair with. - * @returns {Promise} - A Promise that resolves with the result of the unpairing request. + * @returns {Promise} - A Promise that resolves with the result of the unpairing request. */ - UnPair(adapterId: number, deviceId: number): Promise; + UnPair(adapterId: number, deviceId: number): Promise; } export interface Devkit { @@ -2819,7 +2916,7 @@ interface SteamSettings { export interface PrePurchaseApp { nAppID: number; - eState: number; + eState: number; // todo: 3 = Preload? 4 - Ready? I got 3 from Starfield preload and 4 with csgo } export interface PrePurchaseInfo { @@ -3331,9 +3428,9 @@ export interface BluetoothStateChange { } /** - * Represents the response of a Bluetooth operation. + * Represents the response of an operation. It appears to be not necessary to await for this operation response. It is only used to indicate the result of an operation. */ -export interface BluetoothOperationResponse { +export interface OperationResponse { /** * The result code of the operation (1 for success, 2 for failure). */ @@ -3345,6 +3442,151 @@ export interface BluetoothOperationResponse { message: string; } +/** + * Represents details about a single screenshot upload. + */ +export interface DetailsForScreenshotUpload { + /** + * The size of the screenshot upload on disk (including thumbnail). + */ + strSizeOnDisk: string; + + /** + * The amount of cloud storage available. + */ + strCloudAvailable: string; + + /** + * The total cloud storage. + */ + strCloudTotal: string; +} + +/** + * Represents details about multiple screenshot uploads. + */ +export interface DetailsForScreenshotUploads { + /** + * The total size of all screenshot uploads on disk (sum of sizes including thumbnails). + */ + unSizeOnDisk: number; + + /** + * The amount of cloud storage available. + */ + strCloudAvailable: string; + + /** + * The total cloud storage. + */ + strCloudTotal: string; +} + +/** + * Represents details about an application audio session. + */ +export interface ApplicationAudio { + /** + * The ID of the application audio. + */ + id: number; + + /** + * The name of the application (e.g., Spotify, YouTube from a browser, etc.). + */ + strName: string; + + /** + * The volume level of the application (floating point value between 0 and 1). + */ + flVolume: number; +} + +/** + * Represents details about an array of application audio sessions. + */ +export interface ApplicationsAudio { + /** + * An array of application audio sessions. + */ + apps: ApplicationAudio[]; +} + +/** + * Represents details about an audio device. + */ +export interface Device { + /** + * The identifier of the audio device. + */ + id: number; + + /** + * The name of the audio device. + */ + sName: string; + + /** + * Indicates if the device has audio output. + */ + bHasOutput: boolean; + + /** + * Indicates if the device is the default output device. + */ + bIsDefaultOutputDevice: boolean; + + /** + * The volume level of the audio output device (floating point value between 0 and 1). + */ + flOutputVolume: number; + + /** + * Indicates if the device has audio input. + */ + bHasInput: boolean; + + /** + * Indicates if the device is the default input device. + */ + bIsDefaultInputDevice: boolean; + + /** + * The volume level of the audio input device (floating point value between 0 and 1). + */ + flInputVolume: number; +} + +/** + * Represents details about audio devices and information about the active audio device. + */ +export interface AudioDeviceInfo { + /** + * The ID of the active output audio device. + */ + activeOutputDeviceId: number; + + /** + * The ID of the active input audio device. + */ + activeInputDeviceId: number; + + /** + * The ID of the overridden output audio device (-1 if not overridden). + */ + overrideOutputDeviceId: number; + + /** + * The ID of the overridden input audio device (-1 if not overridden). + */ + overrideInputDeviceId: number; + + /** + * An array of audio devices. + */ + vecDevices: Device[]; +} + export interface Unregisterable { /** From 1980e075d7058997ac04f99ce403565c6cb913bb Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:08:42 +0800 Subject: [PATCH 12/46] change: Update interfaces to Steam Version 1694466342 Steam Version: 1694466342 Steam Client Build Date: Tue, Sep 12 04:59 UTC +08:00 --- src/globals/SteamClient.ts | 100 ++++++++++++++++++++++--------------- 1 file changed, 60 insertions(+), 40 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 681cc7cc..1b97f7f8 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -607,8 +607,6 @@ export interface Browser { GetBrowserID(): Promise; GetSteamBrowserID(): Promise; // 16-bit unsigned integer? - GoBack: any; - GoForward: any; HideCursorUntilMouseEvent: any; InspectElement(param0: any, param1: any): any; @@ -617,7 +615,6 @@ export interface Browser { OpenDevTools(): void; - OpenURLForNavigation: any; RegisterForGestureEvents: Unregisterable | any; RegisterForOpenNewTab: Unregisterable | any; SetShouldExitSteamOnBrowserClosed: any; @@ -928,6 +925,7 @@ export interface Input { // For controller input state changes RegisterForControllerStateChanges(callback: (controllerStateChanges: ControllerStateChange[]) => void): Unregisterable | any; + RegisterForDualSenseUpdateNotification: Unregisterable | any; RegisterForGameKeyboardMessages: Unregisterable | any; RegisterForRemotePlayConfigChanges: Unregisterable | any; RegisterForShowControllerLayoutPreviewMessages: Unregisterable | any; @@ -1666,26 +1664,20 @@ export interface Settings { RequestDeviceAuthInfo: any; SelectClientBeta: any; - SetCefRemoteDebuggingEnabled(value: boolean): any; - // Get from available languages SetCurrentLanguage(strShortName: string): void; SetEnableSoftProcessKill(value: boolean): void; // Default value is false, this is Valve internal menu - SetEnableTestUpdaters: any; - SetForceOOBE(value: boolean): void; // Force OOBE - Forces out of box experience on every device start SetHostname: any; SetMicTestMode: any; SetOOBETestMode(value: boolean): void; - SetOverrideBrowserComposerMode: any; SetPreferredMonitor: any; SetRegisteredSteamDeck: any; SetSaveAccountCredentials: any; SetSetting: any; - SetShowMobxDevTools: any; SetSteamPlayEnabled: any; SetTimeZone(timezoneId: string): void; // You can get valid timezoneIds from GetAvailableTimeZones() @@ -1992,7 +1984,8 @@ export interface NetworkDevice { export interface Network { Device: NetworkDevice; - ForceRefresh(): Promise; // Returns {"result":1,"message":""} + ForceRefresh(): Promise; + ForceTestConnectivity(): void; GetProxyInfo(): Promise; @@ -2008,9 +2001,11 @@ export interface Network { SetProxyInfo(mode: number, address: string, port: number, excludeLocal: boolean): void; - SetWifiEnabled(value: boolean): Promise; // Returns {"result":1,"message":""} - StartScanningForNetworks(): Promise; // Returns {"result":1,"message":""} - StopScanningForNetworks(): Promise; // Returns {"result":1,"message":""} + SetWifiEnabled(value: boolean): Promise; + + StartScanningForNetworks(): Promise; + + StopScanningForNetworks(): Promise; } export interface Perf { @@ -2021,25 +2016,10 @@ export interface Perf { export interface Report { GenerateSystemReport: any; + SaveToDesktop: any; Submit: any; } -export interface BlockDevice { - Format: any; - Unmount: any; -} - -export interface Drive { - Eject: any; -} - -export interface SystemStorage { - BlockDevice: BlockDevice; - Drive: Drive; - RegisterForStateChanges: Unregisterable | any; - TrimAll: any; -} - export interface SystemUI { CloseGameWindow: any; GetGameWindowsInfo: any; @@ -2060,12 +2040,14 @@ export interface System { ExitFakeCaptivePortal: any; FactoryReset: any; FormatStorage: any; - GetLegacyAmpControlEnabled: any; + + GetLegacyAmpControlEnabled(): Promise; // {"bAvailable":true,"bEnabled":false} GetOSType: any; GetSystemInfo(): Promise; - IsDeckFactoryImage: Promise; + IsDeckFactoryImage(): Promise; + Network: Network; NotifyGameOverlayStateChanged: any; OpenFileDialog: any; @@ -2076,8 +2058,9 @@ export interface System { RegisterForAirplaneModeChanges(callback: (airplaneModeChange: AirplaneModeChange) => void): Unregisterable | any; - RegisterForBatteryStateChanges: Unregisterable | any; - RegisterForFormatStorageProgress: Unregisterable | any; + RegisterForBatteryStateChanges(callback: (batteryStateChange: BatteryStateChange) => void): Unregisterable | any; + + RegisterForFormatStorageProgress(callback: () => void): Unregisterable | any; // {"flProgress":0,"rtEstimatedCompletionTime":0,"eStage":1} RegisterForOnResumeFromSuspend(callback: () => void): Unregisterable | any; @@ -2098,7 +2081,6 @@ export interface System { ShutdownPC(): any; SteamRuntimeSystemInfo: any; - Storage: SystemStorage; /** * Suspends the system. @@ -2154,8 +2136,10 @@ export interface URL { export interface Updates { ApplyUpdates: any; - CheckForUpdates: any; - GetCurrentOSBranch: any; + + CheckForUpdates(): Promise; // Checks for software updates + GetCurrentOSBranch(): Promise; + RegisterForUpdateStateChanges: Unregisterable | any; SelectOSBranch: any; } @@ -2170,9 +2154,12 @@ export interface User { FlipToLogin: any; ForceShutdown: any; ForgetPassword: any; - GetIPCountry: any; + + GetIPCountry(): Promise; + GetLoginProgress: any; - GetLoginUsers: any; + + GetLoginUsers(): Promise; GoOffline(): void; @@ -2206,7 +2193,10 @@ export interface User { RemoveUser: any; RequestSupportSystemReport: any; ResumeSuspendedGames: any; - RunSurvey: any; + + // Hardware survey information + RunSurvey(callback: (surveySections: SurveySection[]) => void): void; + SendSurvey: any; SetAsyncNotificationEnabled: any; SetLoginCredentials: any; @@ -2234,7 +2224,6 @@ export interface WebChat { GetPushToTalkEnabled: any; GetSignIntoFriendsOnStart: any; GetUIMode: any; - GetWebChatLanguage: any; OnGroupChatUserStateChange: any; OpenURLInClient: any; RegisterForComputerActiveStateChange: Unregisterable | any; @@ -3587,6 +3576,37 @@ export interface AudioDeviceInfo { vecDevices: Device[]; } +export interface BatteryStateChange { + bHasBattery: boolean; + eACState: number; // 1 unplugged, 2 - plugged in normal, 3 - plugged in with slow charger + eBatteryState: number; // 1 - Using battery, 2 - Not using battery? 3 - hybrid? + flLevel: number; // Battery Percentage in floating point 0-1 + nSecondsRemaining: number; // Appears to be charge time remaining or time remaining on battery + bShutdownRequested: boolean; +} + +export interface OSBranch { + eBranch: number; // 1 - Stable + sRawName: string; +} + +export interface LoginUser { + personaName: string; + accountName: string; + rememberPassword: boolean; + avatarUrl: string; +} + +export interface SurveyEntry { + strName: string; + vecArgs: string[]; +} + +export interface SurveySection { + strSectionName: string; + vecEntries: SurveyEntry[]; +} + export interface Unregisterable { /** From 339136db97f58721673a4b5d4e5d4d40cc368d1a Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Sat, 23 Sep 2023 08:40:58 +0800 Subject: [PATCH 13/46] new: Document some SteamClient interfaces - part 10 --- src/globals/SteamClient.ts | 65 ++++++++++++++++++++++++++++++-------- src/globals/stores.ts | 4 ++- 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 1b97f7f8..600f25a7 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -122,7 +122,7 @@ export interface Apps { */ GetBackupsInFolder(appBackupPath: string): Promise; - GetCachedAppDetails(appId: number): Promise; // todo: Parsing nightmare, returns a string like // [["achievements",{"version":2,"data":{"vecHighlight":[{"strID":"AchNyxChaosReunion","strName":"Night and Darkness","strDescription":"Fulfill the 'Night and Darkness' Prophecy","bAchieved":true,"rtUnlocked":1688769817,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/fa367c6ffb8495cdaac17bdfdccfe358e3a089fe.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":11.199999809265137},{"strID":"AchSilverSkellyTrophy","strName":"Skelly's Last Lamentations","strDescription":"Earn the second of Skelly's prizes","bAchieved":true,"rtUnlocked":1688769465,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/5cb095fe7abc9fdf7340bc25637e97fab4fa682d.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":7.599999904632568},{"strID":"AchBuffedButterfly","strName":"Thorn of Thanatos","strDescription":"Get 30% bonus damage with the Pierced Butterfly","bAchieved":true,"rtUnlocked":1686611642,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/97caa23cdfb43ae581ee56c0b3b4eaadd7eda49d.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":7.599999904632568},{"strID":"AchFoundAllSummons","strName":"Complete Set","strDescription":"Earn all Chthonic Companions","bAchieved":true,"rtUnlocked":1685708516,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/aa9c66d2af7aa367490f953e54829b9c95fef474.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":7},{"strID":"ActUnlockedAllAspects","strName":"Infernal Arms","strDescription":"Unlock all Weapon Aspects","bAchieved":true,"rtUnlocked":1685698220,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/35779dd3575af4fcc9b4aa9e42c5639dd4ff5ded.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":9.899999618530273},{"strID":"AchSisyphusLiberation","strName":"End to Torment","strDescription":"Fulfill the 'End to Torment' Prophecy","bAchieved":true,"rtUnlocked":1685698202,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/437398a6a89d53e5a114fb11bc2ee538e990349e.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":10.800000190734863},{"strID":"AchMyrmidonReunion","strName":"Divided by Death","strDescription":"Fulfill the 'Divided by Death' Prophecy","bAchieved":true,"rtUnlocked":1685240429,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/1136200c4e397c4ff3af5c97d3f0d16614dac1d7.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":9},{"strID":"AchReachedEpilogue","strName":"One for the Ages","strDescription":"Reach the epilogue of the story","bAchieved":true,"rtUnlocked":1685240411,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/6065e9fa889e953201201a062d0a8f8dd75e943e.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":8.699999809265137},{"strID":"AchPactUpgradesClears","strName":"Harsh Conditions","strDescription":"Fulfill the 'Harsh Conditions' Prophecy","bAchieved":true,"rtUnlocked":1685237824,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/40d01fbcb70ed7eeb41c98244683895f7b2befec.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":8.100000381469727},{"strID":"AchLeveledKeepsakes","strName":"Friends Forever","strDescription":"Max-rank each standard Keepsake","bAchieved":true,"rtUnlocked":1685090343,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/27423565bd81b365b8ec37462e44c6215df26beb.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":6.199999809265137},{"strID":"AchBronzeSkellyTrophy","strName":"The Useless Trinket","strDescription":"Earn the first of Skelly's prizes","bAchieved":true,"rtUnlocked":1684473962,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/4c4be2fc0e6f1c6906e41ac2aa3a9d87985e7a98.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":13.699999809265137},{"strID":"AchEliteAttributeKills","strName":"Slashed Benefits","strDescription":"Fulfill the 'Slashed Benefits' Prophecy","bAchieved":true,"rtUnlocked":1684473931,"strImage":"https://cdn.steamstatic.com/steamcommunity/public/images/apps/1145360/49532f6187591c23b3d39760c87e5ad82e7d37c1.jpg","bHidden":false,"flMinProgress":0,"flCurrentProgress":0,"flMaxProgress":0,"flAchieved":12.899999618530273}],"vecUnachieved":[],"vecAchievedHidden":[],"nTotal":49,"nAchieved":49}}]] + GetCachedAppDetails(appId: number): Promise; // todo: Parsing nightmare GetCloudPendingRemoteOperations: any; GetConflictingFileTimestamps: any; @@ -168,7 +168,7 @@ export interface Apps { GetGameActionDetails(appId: number, callback: (gameAction: GameAction) => void): void; - GetGameActionForApp: any; + GetGameActionForApp(appId: string, callback: (param0: number, param1: number | string /* string appears to be just the appid*/, param2: string /* "LaunchApp", need to look for more to document*/) => void): void; /** * Retrieves launch options for a specified application. @@ -251,7 +251,7 @@ export interface Apps { */ GetSubscribedWorkshopItems(appId: number): Promise; - InstallFlatpakAppAndCreateShortcut: any; + InstallFlatpakAppAndCreateShortcut(param0: string, param1: string): Promise; // returns {"appid":0,"strInstallOutput":""} JoinAppContentBeta: any; JoinAppContentBetaByPassword: any; @@ -509,7 +509,12 @@ export interface Apps { */ ShowControllerConfigurator(appId: number): void; - ShowStore: any; + /** + * Opens the Steam store page for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + */ + ShowStore(appId: number): void; /** * Specifies a compatibility tool by its name for a given application. If strToolName is an empty string, the specified application will no longer use a compatibility tool. @@ -519,8 +524,16 @@ export interface Apps { */ SpecifyCompatTool(appId: number, strToolName: string): void; - StreamGame: any; - SubscribeWorkshopItem: any; + StreamGame(param0: number, param1: string, param2: number): any;// todo: unknown + + /** + * Subscribes or unsubscribes from a workshop item for a specific app. + * @param {number} appId - The ID of the application. + * @param {string} workshopId - The ID of the workshop item. + * @param {boolean} subscribed - True to subscribe, false to unsubscribe. + * @returns {void} + */ + SubscribeWorkshopItem(appId: number, workshopId: string, subscribed: boolean): void; /** * Terminates a running application. @@ -585,14 +598,36 @@ export interface Auth { // Broadcasting support hasn't been implemented on Linux yet export interface Broadcast { - ApproveViewerRequest: any; - InviteToWatch: any; + ApproveViewerRequest(param0: string, param1: number): void; // + + /** + * Invites a user identified by their SteamID64 to watch the broadcast. + * @param {string} steamId64 - The SteamID64 of the user to invite. + * @returns {Promise} - A Promise indicating the result of the invitation (1 for success, 2 for error). + */ + InviteToWatch(steamId64: string): Promise; + /** + * Registers a callback to be called when the broadcast status changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForBroadcastStatus(callback: (broadcastStatus: BroadcastStatus) => void): Unregisterable | any; - RegisterForViewerRequests: Unregisterable | any; + /** + * Registers a callback to be called when viewer requests are received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForViewerRequests(callback: (viewerFriendCode: number, param1: number, param2: number) => void): Unregisterable | any; + RejectViewerRequest: any; - StopBroadcasting: any; + + /** + * Stops the broadcast. + * @returns {void} + */ + StopBroadcasting(): void; } export interface Browser { @@ -1729,7 +1764,6 @@ export interface Streaming { */ RegisterForStreamingClientFinished(callback: (param0: number, description: string) => void): Unregisterable | any; - /** * Registers a callback function to be called when there is progress in the launch of the streaming client. * @param {function} callback - The callback function to be called. @@ -1966,7 +2000,7 @@ export interface DisplayManager { export interface Dock { DisarmSafetyNet: any; - RegisterForStateChanges: Unregisterable | any; + RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; UpdateFirmware: any; } @@ -2383,6 +2417,11 @@ export interface LogoPosition { nHeightPct: number; } +export interface AppData { + details: AppDetails; + // more +} + export interface AppDetails { achievements: AppAchievements; bCanMoveInstallFolder: boolean; @@ -2518,7 +2557,7 @@ export interface SteamAppOverview { review_percentage_with_bombs: number; review_score_without_bombs: number; review_percentage_without_bombs: number; - steam_deck_compat_category: number; + steam_deck_compat_category: number; // 0 Unknown, 1 Unsupported, 2 Playable, 3 Verified m_strPerClientData: Set | undefined; m_strAssociations: Set | undefined; diff --git a/src/globals/stores.ts b/src/globals/stores.ts index e0d88896..e4eec13b 100644 --- a/src/globals/stores.ts +++ b/src/globals/stores.ts @@ -1,4 +1,5 @@ -import { AppDetails, LogoPosition, SteamAppOverview } from './SteamClient'; +import {AppData, AppDetails, LogoPosition, SteamAppOverview, SteamClient} from './SteamClient'; + declare global { interface Window { LocalizationManager: { @@ -42,6 +43,7 @@ declare global { GetIconURLForApp: (app: SteamAppOverview) => string; }; appDetailsStore: { + GetAppData: (appId: number) => AppData | null; GetAppDetails: (appId: number) => AppDetails | null; GetCustomLogoPosition: (app: SteamAppOverview) => LogoPosition | null; SaveCustomLogoPosition: (app: SteamAppOverview, logoPositions: LogoPosition) => any; From d6f16f6a355acab40809a9493a45469f37db0c09 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Sat, 30 Sep 2023 14:10:36 +0800 Subject: [PATCH 14/46] new: Document some SteamClient interfaces - part 11 --- src/globals/SteamClient.ts | 154 +++++++++++++++++++++++++++++++++---- 1 file changed, 141 insertions(+), 13 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 600f25a7..382674f0 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -598,7 +598,12 @@ export interface Auth { // Broadcasting support hasn't been implemented on Linux yet export interface Broadcast { - ApproveViewerRequest(param0: string, param1: number): void; // + /** + * Approves a viewer request for the broadcast. + * @param {string} steamId64 - The SteamID64 of the user whose request is to be approved. + * @param {number} param1 - Unknown parameter. + */ + ApproveViewerRequest(steamId64: string, param1: number): void; /** * Invites a user identified by their SteamID64 to watch the broadcast. @@ -621,7 +626,12 @@ export interface Broadcast { */ RegisterForViewerRequests(callback: (viewerFriendCode: number, param1: number, param2: number) => void): Unregisterable | any; - RejectViewerRequest: any; + /** + * Rejects a viewer request for the broadcast. + * @param {string} steamId64 - The SteamID64 of the user whose request is to be rejected. + * @param {number} param1 - Unknown parameter. + */ + RejectViewerRequest(steamId64: string, param1: number): void; /** * Stops the broadcast. @@ -849,14 +859,16 @@ export interface FriendSettings { } export interface Friends { - AddFriend: any; - GetCoplayData: any; + AddFriend(steamId: string): Promise; // Adds friend + GetCoplayData(): Promise; // {"recentUsers":[], "currentUsers":[]} InviteUserToCurrentGame: any; - InviteUserToGame: any; + + InviteUserToGame(steamId: string, appId: number, param2: string): Promise; // Invites a user to a game InviteUserToLobby: any; InviteUserToRemotePlayTogetherCurrentGame: any; RegisterForVoiceChatStatus: any; - RemoveFriend: any; + + RemoveFriend(steamId: string): Promise; // Removes friend } export interface GameNotes { @@ -936,16 +948,29 @@ export interface Input { PreviewConfiguForAppAndController: any; PreviewControllerLEDColor: any; QueryControllerConfigsForApp: any; - RegisterForActiveControllerChanges: Unregisterable | any; - RegisterForConfigSelectionChanges: Unregisterable | any; + RegisterForActiveControllerChanges: Unregisterable | any; // {"nActiveController":0} + RegisterForConfigSelectionChanges(callback: (param0: number, param1: number) => void): Unregisterable | any; + RegisterForControllerAccountChanges: Unregisterable | any; RegisterForControllerAnalogInputMessages(callback: (controllerAnalogInputMessages: ControllerAnalogInputMessage[]) => void): Unregisterable | any; RegisterForControllerCommandMessages(callback: (controllerCommandMessage: ControllerCommandMessage) => void): Unregisterable | any; - RegisterForControllerConfigCloudStateChanges: Unregisterable | any; - RegisterForControllerConfigInfoMessages: Unregisterable | any; + /** + * Registers a callback for changes in controller configuration cloud state. + * @param {(controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void} callback - The callback function for config cloud state changes. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForControllerConfigCloudStateChanges(callback: (controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void): Unregisterable | any; + + /** + * Registers a callback for receiving controller configuration info messages (controller layouts query, personal controller layout query). + * @param {(controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[]) => void} callback - The callback function for controller config info messages. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @remarks Do Not Use, this will break the controller layout selection unless you know what you are doing. + */ + RegisterForControllerConfigInfoMessages(callback: (controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[]) => void): Unregisterable | any; /** * Registers a callback function to be invoked when controller input messages are received. @@ -957,11 +982,22 @@ export interface Input { RegisterForControllerListChanges(callback: (controllerListChanges: ControllerInfo[]) => void): Unregisterable | any; - // For controller input state changes + /** + * Registers a callback for changes in the controller state (buttons presses, triggers presses, joystick changes etc...). + * @param {(controllerStateChanges: ControllerStateChange[]) => void} callback - The callback function for controller state changes. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForControllerStateChanges(callback: (controllerStateChanges: ControllerStateChange[]) => void): Unregisterable | any; RegisterForDualSenseUpdateNotification: Unregisterable | any; - RegisterForGameKeyboardMessages: Unregisterable | any; + + /** + * Registers a callback for receiving game keyboard messages (text field popup for inputting text for games when in character creation or etc...). + * @param {(gameKeyboardMessage: GameKeyboardMessage) => void} callback - The callback function for game keyboard messages. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameKeyboardMessages(callback: (gameKeyboardMessage: GameKeyboardMessage) => void): Unregisterable | any; + RegisterForRemotePlayConfigChanges: Unregisterable | any; RegisterForShowControllerLayoutPreviewMessages: Unregisterable | any; RegisterForTouchMenuInputMessages: Unregisterable | any; @@ -969,7 +1005,8 @@ export interface Input { RegisterForTouchMenuMessages(callback: (touchMenuMessage: TouchMenuMessage) => void): Unregisterable | any; RegisterForUIVisualization: Unregisterable | any; - RegisterForUnboundControllerListChanges: Unregisterable | any; + + RegisterForUnboundControllerListChanges(callback: (param0: any) => void): Unregisterable | any; // param0 is an array RegisterForUserDismissKeyboardMessages: Unregisterable | any; RegisterForUserKeyboardMessages: Unregisterable | any; RequestGyroActive: any; @@ -2000,7 +2037,9 @@ export interface DisplayManager { export interface Dock { DisarmSafetyNet: any; + RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; + UpdateFirmware: any; } @@ -3082,7 +3121,49 @@ export interface ConnectivityTestChange { export interface ControllerStateChange { unControllerIndex: number; unPacketNum: number; + /** + * Bitmask representing pressed upper buttons. + * - Bit 0-8: Unknown (@todo Please provide more details if known) + * - Bit 9: L4 + * - Bit 10: R4 + * - Bit 11-13: Unknown (@todo Please provide more details if known) + * - Bit 14: Left Joystick Touch + * - Bit 15: Right Joystick Touch + * - Bit 16-18: Unknown (@todo Please provide more details if known) + * - Bit 19: Quick Access Menu + */ ulUpperButtons: number; + /** + * Bitmask representing pressed buttons. + * - Bit 0: R2 + * - Bit 1: L2 + * - Bit 2: R1 + * - Bit 3: L1 + * - Bit 4: Y + * - Bit 5: B + * - Bit 6: X + * - Bit 7: A + * - Bit 8: D-Pad Up + * - Bit 9: D-Pad Right + * - Bit 10: D-Pad Left + * - Bit 11: D-Pad Down + * - Bit 12: Select + * - Bit 13: Steam/Home + * - Bit 14: Start + * - Bit 15: L5 + * - Bit 16: R5 + * - Bit 17: Left Touchpad Click + * - Bit 18: Right Touchpad Click + * - Bit 19: Left Touchpad Touch + * - Bit 20: Right Touchpad Touch + * - Bit 21: Unknown (@todo Please provide more details if known) + * - Bit 22: L3 + * - Bit 23-25: Unknown (@todo Please provide more details if known) + * - Bit 26: R3 + * - Bit 27-28: Unknown (@todo Please provide more details if known) + * - Bit 29: Mute (Dualsense) + * - Bit 30-31: Unknown (@todo Please provide more details if known) + */ ulButtons: number; sLeftPadX: number; sLeftPadY: number; @@ -3646,6 +3727,53 @@ export interface SurveySection { vecEntries: SurveyEntry[]; } +export interface GameKeyboardMessage { + m_bOpen: boolean; + nAppID: number; + m_dwPID: number; + m_dwOverlayPID: number; + m_hPipe: number; + m_eInputMode: number; + m_eLineInputMode: number; + m_pchDescription: string; + m_unCharMax: number; + m_pchExistingText: string; +} + +export interface ControllerConfigInfoMessage { + appID: number; +} + +export interface ControllerConfigInfoMessageQuery extends ControllerConfigInfoMessage { + bPersonalQueryDone: boolean; +} + +export interface ControllerConfigInfoMessageList extends ControllerConfigInfoMessage { + nControllerType: number; + publishedFileID: string; + accountID: number; + Title: string; + Description: string; + URL: string; + timeUpdated: string; + bOfficial: boolean; + bProgenitorOfficial: boolean; + bRecommended: boolean; + bProgenitorRecommended: boolean; + bUsesSIAPI: boolean; + bUsesMouse: boolean; + bUsesKeyboard: boolean; + bUsesGamepad: boolean; + eExportType: number; + playtime: string; + bSelected: boolean; +} + +export interface ControllerConfigCloudStateChange { + bSyncDone: boolean; + bSyncConflict: boolean; + bSyncError: boolean; +} export interface Unregisterable { /** From fffd0b5f58249ac4632d6c366fab1458c52d30ad Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:57:05 +0800 Subject: [PATCH 15/46] new: Document some SteamClient interfaces - part 12 --- src/globals/SteamClient.ts | 465 ++++++++++++++++++++++++++++--------- 1 file changed, 352 insertions(+), 113 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 382674f0..7fa3bec0 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -75,9 +75,9 @@ export interface Apps { /** * Clears the custom artwork for a given application. * @param {number} appId - The ID of the application to clear custom artwork for. - * @param {number} assetType - 0 = Grid, 1 = Hero, 2 = Logo + * @param {AppArtworkAssetType} assetType - The type of artwork to clear. */ - ClearCustomArtworkForApp(appId: number, assetType: number): Promise; + ClearCustomArtworkForApp(appId: number, assetType: AppArtworkAssetType): Promise; ClearCustomLogoPositionForApp: any; ClearProton: any; @@ -149,7 +149,7 @@ export interface Apps { */ GetDownloadedWorkshopItems(appId: number): Promise; - GetDurationControlInfo: any; + GetDurationControlInfo(appId: number): Promise; // {"bApplicable": true} - overlay usage? /** * Retrieves achievement information for a specific application for a given friend. @@ -168,7 +168,7 @@ export interface Apps { GetGameActionDetails(appId: number, callback: (gameAction: GameAction) => void): void; - GetGameActionForApp(appId: string, callback: (param0: number, param1: number | string /* string appears to be just the appid*/, param2: string /* "LaunchApp", need to look for more to document*/) => void): void; + GetGameActionForApp(appId: string, callback: (param0: number /*flag check? for validity*/, param1: number | string /* string appears to be just the appid*/, param2: string /* "LaunchApp", need to look for more to document*/) => void): void; /** * Retrieves launch options for a specified application. @@ -179,7 +179,7 @@ export interface Apps { */ GetLaunchOptionsForApp(appId: number): Promise; - GetLibraryBootstrapData: any; + GetLibraryBootstrapData: any; // CLibraryBootstrapData - binary deserializer??? /** * Retrieves achievement information for the authenticated user in a specific Steam application. @@ -270,7 +270,7 @@ export interface Apps { OpenAppSettingsDialog(appId: number, param1: string): void; PromptToChangeShortcut(): Promise; // todo: unknown, prompts file picker - RaiseWindowForGame: any; + RaiseWindowForGame(appId: number): any; // ResumeGameInProgress /** * Registers a callback function to be called when achievement changes occur. @@ -289,8 +289,9 @@ export interface Apps { */ RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; - RegisterForAppOverviewChanges: Unregisterable | any; - RegisterForDRMFailureResponse: Unregisterable | any; + RegisterForAppOverviewChanges: Unregisterable | any; // CAppOverview_Change - binary deserializer??? + + RegisterForDRMFailureResponse(callback: (appid: number, eResult: number, errorCode: number) => void): Unregisterable | any; /** * Registers a callback function to be called when a game action ends. @@ -359,7 +360,7 @@ export interface Apps { */ RemoveUserTagFromApps(appIds: number[], userTag: string): void; - ReportLibraryAssetCacheMiss: any; + ReportLibraryAssetCacheMiss(appId: number, assetType: AppArtworkAssetType): void; ReportMarketingMessageDialogShown: any; RequestIconDataForApp: any; RequestLegacyCDKeysForApp: any; @@ -445,19 +446,18 @@ export interface Apps { * @param {number} appId - The ID of the application to set custom artwork for. * @param {string} base64Image - Base64 encoded image. * @param {string} imageType - "jpeg" or "png". - * @param {number} assetType - 0 = Grid, 1 = Hero, 2 = Logo. + * @param {AppArtworkAssetType} assetType - The type of artwork to set. * @returns {Promise} A Promise that resolves after the custom artwork is set. - * @todo More missing assetTypes */ - SetCustomArtworkForApp(appId: number, base64Image: string, imageType: string, assetType: number): Promise; + SetCustomArtworkForApp(appId: number, base64Image: string, imageType: string, assetType: AppArtworkAssetType): Promise; - SetCustomLogoPositionForApp: any; + SetCustomLogoPositionForApp(appId: number, param1: string): Promise; SetDLCEnabled(appId: number, appDLCId: number, value: boolean): void; - SetLocalScreenshotCaption: any; - SetLocalScreenshotPrivacy: any; - SetLocalScreenshotSpoiler: any; + SetLocalScreenshotCaption(appId: string, param1: any, param2: any): void; + SetLocalScreenshotPrivacy(appId: string, param1: any, param2: any): void; + SetLocalScreenshotSpoiler(appId: string, param1: any, param2: any): void; /** * Sets the icon for a non-Steam application shortcut. @@ -499,7 +499,8 @@ export interface Apps { */ SetShortcutStartDir(appId: number, directory: string): void; - SetStreamingClientForApp: any; + // Sets the client ID for streaming for a specific application. + SetStreamingClientForApp(appId: number, clientId: string): void; SetThirdPartyControllerConfiguration: any; /** @@ -524,7 +525,7 @@ export interface Apps { */ SpecifyCompatTool(appId: number, strToolName: string): void; - StreamGame(param0: number, param1: string, param2: number): any;// todo: unknown + StreamGame(appId: number, clientId: string, param2: number): void; /** * Subscribes or unsubscribes from a workshop item for a specific app. @@ -593,7 +594,7 @@ export interface Auth { SetLoginToken: any; SetSteamGuardData: any; - StartSignInFromCache: any; + StartSignInFromCache(param0: any, login: string): Promise; } // Broadcasting support hasn't been implemented on Linux yet @@ -652,9 +653,9 @@ export interface Browser { GetBrowserID(): Promise; GetSteamBrowserID(): Promise; // 16-bit unsigned integer? - HideCursorUntilMouseEvent: any; + HideCursorUntilMouseEvent(): any; - InspectElement(param0: any, param1: any): any; + InspectElement(clientY: any, clientX: any): any; // yup that's right, clientY and clientX are reversed NotifyUserActivation: any; @@ -668,9 +669,18 @@ export interface Browser { } export interface BrowserView { - Create: any; + /* + param0 - { + parentPopupBrowserID: e.SteamClient.Browser.GetBrowserID(), + strUserAgentIdentifier: i, + strVROverlayKey: a, + strInitialURL: r, + bOnlyAllowTrustedPopups: o + } + */ + Create(param0: any): any; CreatePopup: any; - Destroy: any; + Destroy(param0: any): any; PostMessageToParent: any; } @@ -718,8 +728,8 @@ export interface Console { export interface Customization { GenerateLocalStartupMoviesThumbnails: any; - GetDownloadedStartupMovies: any; - GetLocalStartupMovies: any; + GetDownloadedStartupMovies(param0: any): Promise; + GetLocalStartupMovies(): Promise; } /** @@ -872,18 +882,28 @@ export interface Friends { } export interface GameNotes { - DeleteImage: any; + DeleteImage(param0: any): any; DeleteNotes: any; - GetNotes: any; + /* + FilenameForNotes(e) { + return "appid" in e ? `notes_${Number(e.appid)}` : `notes_shortcut_${h(e.shortcut)}` + } + DirectoryForNoteImages(e) { + return "appid" in e ? `notes_${Number(e.appid)}_images/` : `notes_shortcut_${h(e.shortcut)}_images/` + } + */ + // {"result":1,"notes":""} + // example: {"notes":[{"id":"lmuudzqn","appid":1716740,"ordinal":0,"time_created":1695401684,"time_modified":1695403395,"title":"Old Earth Cuisine 1:","content":"[h1]Old Earth Cuisine 1:[/h1][list][*][p]Red Meat[/p][/*][/list][h1]Beverage Development 2:[/h1][list][*][p]Tranquilitea Sunray[/p][/*][/list][p][/p]"}]} + GetNotes(filenameForNotes: string, directoryForNoteImages: string): Promise; GetNotesMetadata: any; GetNumNotes: any; GetQuota: any; IterateNotes(appId: number, length: number): any; // Results array of {"result":1,"filename":"","filesize":0,"timestamp":0} ResolveSyncConflicts: any; - SaveNotes: any; - SyncToClient: any; - SyncToServer: any; + SaveNotes(filenameForNotes: string, param1: string): Promise; // param1 - notes like escaped json in GetNotes + SyncToClient(): Promise; + SyncToServer(): Promise; UploadImage: any; } @@ -916,19 +936,19 @@ export interface GameSessions { export interface Input { BIsSteamController(callback: (steamController: boolean) => void): void; // Whether the specified controller is a Steam Controller BSupportsControllerLEDColor(callback: (supportControllerLEDColor: boolean) => void): void; // Whether the specified controller supports LED color - CalibrateControllerIMU: any; - CalibrateControllerJoystick: any; - CalibrateControllerTrackpads: any; + CalibrateControllerIMU(param0: any): any; // param0 - m_controllerStateDeviceIdx + CalibrateControllerJoystick(param0: any): any; // param0 - m_controllerStateDeviceIdx + CalibrateControllerTrackpads(param0: any): any; // param0 - m_controllerStateDeviceIdx CancelGyroSWCalibration: any; - ClearSelectedConfigForApp: any; + ClearSelectedConfigForApp(param0: any, param1: any): any; // param0 - appid, param1 - controllerIndex CloseDesktopConfigurator: any; - ControllerKeyboardSendText: any; - ControllerKeyboardSetKeyState: any; + ControllerKeyboardSendText(key: any): any; //??? + ControllerKeyboardSetKeyState(key: number, state: boolean): any; DeauthorizeControllerAccount: any; DecrementCloudedControllerConfigsCounter: any; DeletePersonalControllerConfiguration: any; DuplicateControllerConfigurationSourceMode: any; - EndControllerDeviceSupportFlow: any; + EndControllerDeviceSupportFlow(): any; ExportCurrentControllerConfiguration: any; ForceConfiguratorFocus: any; ForceSimpleHapticEvent: any; @@ -937,16 +957,16 @@ export interface Input { GetConfigForAppAndController(appId: number, unControllerIndex: number): any; GetControllerMappingString(unControllerIndex: number): Promise;// returns mappings - GetSteamControllerDongleState: any; - GetTouchMenuIconsForApp: any; - GetXboxDriverInstallState: any; + GetSteamControllerDongleState(): Promise; + GetTouchMenuIconsForApp(param0: any): Promise;// param0 - app? + GetXboxDriverInstallState(): Promise; IdentifyController: any; InitControllerSounds: any; InitializeControllerPersonalizationSettings: any; - ModalKeyboardDismissed: any; + ModalKeyboardDismissed(): void; OpenDesktopConfigurator: any; PreviewConfiguForAppAndController: any; - PreviewControllerLEDColor: any; + PreviewControllerLEDColor(flHue: number, flSaturation: number, flBrightness: number): any; QueryControllerConfigsForApp: any; RegisterForActiveControllerChanges: Unregisterable | any; // {"nActiveController":0} RegisterForConfigSelectionChanges(callback: (param0: number, param1: number) => void): Unregisterable | any; @@ -1011,7 +1031,7 @@ export interface Input { RegisterForUserKeyboardMessages: Unregisterable | any; RequestGyroActive: any; RequestRemotePlayControllerConfigs: any; - ResetControllerBindings: any; + ResetControllerBindings(param0: any): any; ResolveCloudedControllerConfigConflict: any; RestoreControllerPersonalizationSettings: any; SaveControllerCalibration: any; @@ -1021,11 +1041,13 @@ export interface Input { SetActiveControllerAccount: any; SetControllerConfigurationModeShiftBinding: any; SetControllerHapticSetting: any; - SetControllerMappingString: any; + SetControllerMappingString(mapping: string): void; SetControllerNintendoLayoutSetting: any; SetControllerPersonalizationName: any; - SetControllerPersonalizationSetting: any; - SetControllerPersonalizationSettingFloat: any; + //param0 - nLStickDeadzone, bSWAntiDrift, nRHapticStrength, flRPadPressureCurve + SetControllerPersonalizationSetting(param0: string, param1: number): any; + //param0 - flGyroStationaryTolerance, flAccelerometerStationaryTolerance + SetControllerPersonalizationSettingFloat(param0: string, param1: number): any; SetControllerRumbleSetting: any; SetCursorActionset: any; SetEditingControllerConfigurationActionSet: any; @@ -1034,16 +1056,16 @@ export interface Input { SetEditingControllerConfigurationInputBinding: any; SetEditingControllerConfigurationMiscSetting: any; SetEditingControllerConfigurationSourceMode: any; - SetGamepadKeyboardText: any; - SetKeyboardActionset: any; + SetGamepadKeyboardText(param0: boolean, param1: string): any; + SetKeyboardActionset(param0: boolean): any; SetMousePosition: any; SetSelectedConfigForApp: any; SetSteamControllerDonglePairingMode: any; - SetVirtualMenuKeySelected: any; + SetVirtualMenuKeySelected(unControllerIndex: number, unMenuIndex: number, param2: number): any; // SetWebBrowserActionset: any; - SetXboxDriverInstallState: any; + SetXboxDriverInstallState(param0: any): any; // state /** * Opens the Steam Input controller settings. @@ -1053,7 +1075,7 @@ export interface Input { ShowControllerSettings(): void; StandaloneKeyboardDismissed: any; - StartControllerDeviceSupportFlow: any; + StartControllerDeviceSupportFlow(param0: any, param1: any, callback: (param2: any) => void): any; StartEditingControllerConfigurationForAppIDAndControllerIndex: any; StartGyroSWCalibration: any; StopEditingControllerConfiguration: any; @@ -1062,7 +1084,7 @@ export interface Input { SyncCloudedControllerConfigs: any; TriggerHapticPulse: any; TriggerSimpleHapticEvent: any; - UnregisterForControllerStateChanges: any; + UnregisterForControllerStateChanges(): void; UnregisterForUIVisualization: any; UploadChangesForCloudedControllerConfigs: any; } @@ -1259,9 +1281,18 @@ export interface Installs { } export interface Messaging { - RegisterForMessages(accountName: string, callback: (param0: any) => void): Unregisterable | any; + // section - "ContentManagement", "JumpList", "PostToLibrary" + // seems multipurpose + RegisterForMessages(section: string, callback: (param0: any) => void): Unregisterable | any; - PostMessage(): void; + /* + function m(e) { + SteamClient.Messaging.PostMessage("LibraryCommands", "ShowFriendChatDialog", JSON.stringify({ + steamid: e.persona.m_steamid.ConvertTo64BitString() + })) + } + */ + PostMessage(section: string, param1: string, param2: string): void; } /** @@ -1363,11 +1394,11 @@ export interface DeviceProperties { } export interface Keyboard { - Hide: any; + Hide(): any; RegisterForStatus: Unregisterable | any; - SendDone: any; - SendText: any; - Show: any; + SendDone(): any; + SendText(key: string): any; //??? + Show(): any; } export interface PathProperties { @@ -1456,8 +1487,7 @@ export interface Overlay { */ RegisterOverlayBrowserInfoChanged(callback: () => void): Unregisterable | any; - - SetOverlayState: any; + SetOverlayState(appId: number, uiComposition: UIComposition): any; } /** @@ -1556,7 +1586,7 @@ export interface RemotePlay { SetPerUserMouseInputEnabled: any; SetPerUserMouseInputEnabledWithGuestID: any; SetRemoteDeviceAuthorized: any; - SetRemoteDevicePIN: any; + SetRemoteDevicePIN(pin: number): void; SetRemotePlayEnabled: any; SetStreamingClientConfig: any; SetStreamingClientConfigEnabled: any; @@ -1666,10 +1696,10 @@ export interface Screenshots { * Uploads a local screenshot. * @param {string} appId - The ID of the application. * @param {number} localScreenshot_hHandle - The handle of the local screenshot. - * @param {number} param2 - Additional parameter. // Todo: Unknown at this time. My assumption is the visibility of the screenshot. + * @param {number} filePrivacyState - The privacy state of the screenshot file. * @returns {Promise} - A Promise that resolves to a boolean value indicating whether the upload was successful. */ - UploadLocalScreenshot(appId: string, localScreenshot_hHandle: number, param2: number): Promise; + UploadLocalScreenshot(appId: string, localScreenshot_hHandle: number, filePrivacyState: FilePrivacyState): Promise; } export interface ServerBrowser { @@ -1733,8 +1763,9 @@ export interface Settings { RegisterForTimeZoneChange(callback: (timezoneId: string) => void): Unregisterable | any; // When timezone is changed from settings, callback will return new timezoneId ReinitMicSettings: any; - RequestDeviceAuthInfo: any; - SelectClientBeta: any; + RequestDeviceAuthInfo(): any; + // + SelectClientBeta(nBetaID: any): any; // Get from available languages SetCurrentLanguage(strShortName: string): void; @@ -1774,7 +1805,12 @@ export interface SharedConnection { } export interface Stats { - RecordActivationEvent: any; + // param0 - AppDetailsReviewSection, Showcases, LibraryReviewSpotlight + // param1 - + // AppDetailsReviewSection: PositiveClicked, NegativeClicked, NeutralClicked, PositiveReviewPosted, NegativeReviewPosted, EditClicked, ReviewCanceled + // LibraryReviewSpotlight: ReviseClicked, PositiveClicked, ReviseCloseClicked, NegativeClicked, PositiveRevisePosted, NegativeRevisePosted, ReviseCanceled, ReviewCanceled, CloseClicked + // Showcases: Delete, Save-Modify, Save-New + RecordActivationEvent(param0: string, param1: string): any; RecordDisplayEvent: any; } @@ -1792,7 +1828,7 @@ export interface Storage { export interface Streaming { AcceptStreamingEULA: any; - CancelStreamGame: any; + CancelStreamGame(): void; // existing stream /** * Registers a callback function to be called when the streaming client finishes. @@ -1833,7 +1869,7 @@ export interface Streaming { */ RegisterForStreamingShowLaunchOptions(callback: (appId: number, launchOptions: LaunchOption[]) => void): Unregisterable | any; // Callback when streaming client receives launch options from host - StreamingContinueStreamGame: any; + StreamingContinueStreamGame(): void; // existing game running on another streaming capable device StreamingSetLaunchOption: any; } @@ -2017,30 +2053,32 @@ export interface Devkit { } export interface Display { - EnableUnderscan: any; + EnableUnderscan(param0: boolean): any; RegisterForBrightnessChanges(callback: (brightnessChanges: BrightnessChange) => void): Unregisterable | any; SetBrightness(brightness: number): any; - SetUnderscanLevel: any; + SetUnderscanLevel(param0: any): any; } +// CMsgSystemDisplayManagerState, CMsgSystemDisplayManagerSetMode export interface DisplayManager { - ClearModeOverride: any; + ClearModeOverride(displayId: any): any; GetState: any; - RegisterForStateChanges: Unregisterable | any; - SetCompatibilityMode: any; - SetGamescopeInternalResolution: any; - SetMode: any; + RegisterForStateChanges(callback: () => void): Unregisterable | any; + SetCompatibilityMode(displayId: any): any; + SetGamescopeInternalResolution(width: number, height: number): any; + SetMode(base64: string): any; // } +// CMsgSystemDockUpdateFirmware, CMsgSystemDockState export interface Dock { - DisarmSafetyNet: any; + DisarmSafetyNet(): void; - RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; + RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; // Deserialize binary - UpdateFirmware: any; + UpdateFirmware(base64String: string): any; // serialize base64 string } export interface WirelessNetwork { @@ -2049,7 +2087,7 @@ export interface WirelessNetwork { } export interface NetworkDevice { - Connect: any; + Connect(param0: any): any; // some base64 serialized string Disconnect: any; WirelessNetwork: WirelessNetwork; } @@ -2070,7 +2108,7 @@ export interface Network { RegisterForDeviceChanges(callback: (param0: any) => void): Unregisterable | any; - SetFakeLocalSystemState: any; + SetFakeLocalSystemState(param0: any): any; // enums SetProxyInfo(mode: number, address: string, port: number, excludeLocal: boolean): void; @@ -2081,12 +2119,14 @@ export interface Network { StopScanningForNetworks(): Promise; } +// CMsgSystemPerfUpdateSettings, CMsgSystemPerfState, CMsgSystemPerfSettings export interface Perf { - RegisterForDiagnosticInfoChanges: Unregisterable | any; - RegisterForStateChanges: Unregisterable | any; - UpdateSettings: any; + RegisterForDiagnosticInfoChanges(callback: (param0: any) => void): Unregisterable | any; // deserialize binary + RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; // deserialize binary + UpdateSettings(base64: string): any; // serialize } +// CMsgGenerateSystemReportReply export interface Report { GenerateSystemReport: any; SaveToDesktop: any; @@ -2096,10 +2136,10 @@ export interface Report { export interface SystemUI { CloseGameWindow: any; GetGameWindowsInfo: any; - RegisterForFocusChangeEvents: Unregisterable | any; + RegisterForFocusChangeEvents(callback: (param0: any) => void): Unregisterable | any; RegisterForOverlayGameWindowFocusChanged: Unregisterable | any; - RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable | any; + RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable | any; // eKey } export interface System { @@ -2115,16 +2155,26 @@ export interface System { FormatStorage: any; GetLegacyAmpControlEnabled(): Promise; // {"bAvailable":true,"bEnabled":false} - GetOSType: any; + + + GetOSType(): Promise; GetSystemInfo(): Promise; IsDeckFactoryImage(): Promise; Network: Network; - NotifyGameOverlayStateChanged: any; - OpenFileDialog: any; - OpenLocalDirectoryInSystemExplorer: any; + NotifyGameOverlayStateChanged(param0: boolean, appId: number): any; + + /* + { + strTitle: (0, o.Localize)("#AddNonSteam_PickAppTitle"), + rgFilters: y(), + strInitialFile: t + } + */ + OpenFileDialog(param0: any): any; + OpenLocalDirectoryInSystemExplorer(directory: string): void; // Opens local directory in system explorer Perf: Perf; RebootToAlternateSystemPartition: any; RebootToFactoryTestImage: any; @@ -2139,7 +2189,7 @@ export interface System { RegisterForOnSuspendRequest(callback: () => void): Unregisterable | any; - RegisterForSettingsChanges: Unregisterable | any; + RegisterForSettingsChanges: Unregisterable | any; // deserialize binary Report: Report; /** @@ -2200,7 +2250,7 @@ export interface UI { } export interface URL { - ExecuteSteamURL: any; + ExecuteSteamURL(url: string): void; GetSteamURLList: any; GetWebSessionID: any; RegisterForRunSteamURL: Unregisterable | any; @@ -2214,16 +2264,18 @@ export interface Updates { GetCurrentOSBranch(): Promise; RegisterForUpdateStateChanges: Unregisterable | any; - SelectOSBranch: any; + + // 1 - Stable, 2 - Beta, 3 - Preview + SelectOSBranch(branch: number): any; // enum? } export interface User { - AuthorizeMicrotxn: any; + AuthorizeMicrotxn(txnId: any): any; CancelLogin: any; - CancelMicrotxn: any; + CancelMicrotxn(txnId: any): any; CancelShutdown: any; ChangeUser: any; - Connect: any; + Connect(): any; FlipToLogin: any; ForceShutdown: any; ForgetPassword: any; @@ -2271,13 +2323,13 @@ export interface User { RunSurvey(callback: (surveySections: SurveySection[]) => void): void; SendSurvey: any; - SetAsyncNotificationEnabled: any; + SetAsyncNotificationEnabled(appId: number, enable: boolean): any; SetLoginCredentials: any; SetOOBEComplete: any; ShouldShowUserChooser: any; SignOutAndRestart: any; StartLogin: any; - StartOffline: any; + StartOffline(param0: boolean): any; /** * Restarts the Steam client. @@ -2298,7 +2350,7 @@ export interface WebChat { GetSignIntoFriendsOnStart: any; GetUIMode: any; OnGroupChatUserStateChange: any; - OpenURLInClient: any; + OpenURLInClient(url: string, param1: any, param2: any): any; RegisterForComputerActiveStateChange: Unregisterable | any; RegisterForFriendPostMessage: Unregisterable | any; RegisterForMouseXButtonDown: Unregisterable | any; @@ -2321,41 +2373,42 @@ export interface WebChat { } export interface WebUITransport { - GetTransportInfo: any; + GetTransportInfo(): any; } export interface Window { - BringToFront: any; - Close: any; + BringToFront(param0: any): any; // param0 optional? + Close(): any; DefaultMonitorHasFullscreenWindow: any; FlashWindow: any; GamescopeBlur: any; GetDefaultMonitorDimensions: any; GetMousePositionDetails: any; GetWindowDimensions: any; - GetWindowRestoreDetails: any; - HideWindow: any; + GetWindowRestoreDetails(callback: (param0: any) => void): any; + HideWindow(): any; IsWindowMaximized: any; IsWindowMinimized: any; MarkLastFocused: any; Minimize: any; - MoveTo: any; + MoveTo(x: number, y: number, ratio: number): any; MoveToLocation: any; - PositionWindowRelative: any; + // Takes param0 from callback of GetWindowRestoreDetails + PositionWindowRelative(param0: any, x: number, y: number, width: number, height: number): any; ProcessShuttingDown: any; - ResizeTo: any; + ResizeTo(width: number, height: number, ratio: number): any; RestoreWindowSizeAndPosition: any; - SetAutoDisplayScale: any; - SetComposition: any; - SetHideOnClose: any; + SetAutoDisplayScale(param0: any): any; + SetComposition(uiComposition: UIComposition, appIds: number[], param2: number): any; + SetHideOnClose(param0: boolean): any; SetKeyFocus: any; - SetManualDisplayScaleFactor: any; + SetManualDisplayScaleFactor(param0: any): any; SetMaxSize: any; SetMinSize: any; SetModal: any; - SetResizeGrip: any; + SetResizeGrip(width: number, height: number): any; SetWindowIcon: any; - ShowWindow: any; + ShowWindow(): any; StopFlashWindow: any; ToggleFullscreen: any; ToggleMaximize: any; @@ -3214,7 +3267,7 @@ export interface ActiveAccount { export interface ControllerInfo { strName: string; - eControllerType: number; + eControllerType: ControllerType; nXInputIndex: number; nControllerIndex: number; eRumblePreference: number; @@ -3359,6 +3412,48 @@ export interface GameAction { nGameActionID: number; gameid: string; strActionName: string; + /* + None - 0 + Completed - 1 + Cancelled - 2 + Failed - 3 + Starting - 4 + ConnectingToSteam - 5 + RequestingLicense - 6 + UpdatingAppInfo - 7 + UpdatingAppTicket - 8 + UnlockingH264 - 9 + WaitingOnWideVineUpdate - 10 + ShowCheckSystem - 11 + CheckTimedTrial - 12 + GetDurationControl - 13 + ShowDurationControl - 14 + ShowLaunchOption - 15 + ShowEula - 16 + ShowVR2DWarning - 17 + ShowVROculusOnly - 18 + ShowVRStreamingLaunch - 19 + ShowGameArgs - 20 + ShowCDKey - 21 + WaitingPrevProcess - 22 + DownloadingDepots - 23 + DownloadingWorkshop - 24 + UpdatingDRM - 25 + GettingLegacyKey - 26 + ProcessingInstallScript - 27 + RunningInstallScript - 28 + SynchronizingCloud - 29 + SynchronizingControllerConfig - 30 + ShowNoControllerConfig - 31 + ProcessingShaderCache - 32 + VerifyingFiles - 33 + KickingOtherSession - 34 + WaitingOpenVRAppQuit - 35 + SiteLicenseSeatCheckout - 36 + DelayLaunch - 37 + CreatingProcess - 38 + WaitingGameWindow - 39 + */ strTaskName: string; strTaskDetails: string; nSecondsRemaing: number; //fixme: not a typo, actually valve @@ -3775,6 +3870,150 @@ export interface ControllerConfigCloudStateChange { bSyncError: boolean; } +export enum AppArtworkAssetType { + Capsule, + Hero, + Logo, + Header, + Icon, + HeroBlur, +} + +export enum UIComposition { + Hidden, + Notification, + Overlay, + Opaque, + OverlayKeyboard // Unverified +} + +export enum OSType { + Web = -700, + Ios = -600, + Android = -500, + Android6 = -499, + Android7 = -498, + Android8 = -497, + Android9 = -496, + Ps3os = -300, + Linux = -203, + Linux22 = -202, + Linux24 = -201, + Linux26 = -200, + Linux32 = -199, + Linux35 = -198, + Linux36 = -197, + Linux310 = -196, + Linux316 = -195, + Linux318 = -194, + Linux3x = -193, + Linux4x = -192, + Linux41 = -191, + Linux44 = -190, + Linux49 = -189, + Linux414 = -188, + Linux419 = -187, + Linux5x = -186, + Linux54 = -185, + Linux6x = -184, + Linux7x = -183, + Linux510 = -182, + Macos = -102, + Macos104 = -101, + Macos105 = -100, + Macos1058 = -99, + Macos106_unused1 = -98, + Macos106_unused2 = -97, + Macos106_unused3 = -96, + Macos106 = -95, + Macos1063 = -94, + Macos1064_slgu = -93, + Macos1067 = -92, + Macos1067_unused = -91, + Macos107 = -90, + Macos108 = -89, + Macos109 = -88, + Macos1010 = -87, + Macos1011 = -86, + Macos1012 = -85, + Macos1013 = -84, + Macos1014 = -83, + Macos1015 = -82, + Macos1016 = -81, + Macos11 = -80, + Macos111 = -79, + Macos1017 = -78, + Macos12 = -77, + Macos1018 = -76, + Macos13 = -75, + Macos1019 = -74, + Macos14 = -73, + Macos1020 = -72, + Macos15 = -71, + Unknown = -1, + Windows = 0, + Win311 = 1, + Win95 = 2, + Win98 = 3, + WinME = 4, + WinNT = 5, + Win200 = 6, + WinXP = 7, + Win2003 = 8, + WinVista = 9, + Win7 = 10, + Win2008 = 11, + Win2012 = 12, + Win8 = 13, + Win81 = 14, + Win2012R2 = 15, + Win10 = 16, + Win2016 = 17, + Win2019 = 18, + Win2022 = 19, + Win11 = 20, +} + +export enum ControllerType { + None = -1, + Unknown = 0, + UnknownSteamController = 1, + SteamController = 2, // Codename Gordon + SteamControllerV2 = 3, // Codename Headcrab + SteamControllerNeptune = 4, + FrontPanelBoard = 20, + Generic = 30, + XBox360Controller = 31, + XBoxOneController = 32, + PS3Controller = 33, + PS4Controller = 34, + WiiController = 35, + AppleController = 36, + AndroidController = 37, + SwitchProController = 38, + SwitchJoyConLeft = 39, + SwitchJoyConRight = 40, + SwitchJoyConPair = 41, + SwitchProGenericInputOnlyController = 42, + MobileTouch = 43, + SwitchProXInputSwitchController = 44, + PS5Controller = 45, + XboxEliteController = 46, + LastController = 47, // Unverified + PS5EdgeController = 48, + GenericKeyboard = 400, + GenericMouse = 800, +} + +export enum FilePrivacyState { + Invalid = -1, + Private = 2, + FriendsOnly = 4, + Public = 8, + Unlisted = 16, +} + + export interface Unregisterable { /** * Unregister the callback. From cc835dc6fc8490d09a77a32a8e561da5a9701137 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Wed, 4 Oct 2023 09:34:00 +0800 Subject: [PATCH 16/46] new: Document some SteamClient interfaces - part 13 --- src/globals/SteamClient.ts | 531 +++++++++++++++++++++++++++---------- 1 file changed, 394 insertions(+), 137 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 7fa3bec0..4b48ad01 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -77,9 +77,15 @@ export interface Apps { * @param {number} appId - The ID of the application to clear custom artwork for. * @param {AppArtworkAssetType} assetType - The type of artwork to clear. */ - ClearCustomArtworkForApp(appId: number, assetType: AppArtworkAssetType): Promise; + ClearCustomArtworkForApp(appId: number, assetType: AppArtworkAssetType): Promise; + + /** + * Clears the custom logo position for a specific application. + * @param {number} appId - The ID of the application. + * @returns {Promise} - A Promise that resolves once the custom logo position is cleared. + */ + ClearCustomLogoPositionForApp(appId: number): Promise; - ClearCustomLogoPositionForApp: any; ClearProton: any; /** @@ -100,7 +106,15 @@ export interface Apps { CreateDesktopShortcutForApp(appId: number): void; DownloadWorkshopItem: any; - GetAchievementsInTimeRange: any; + + /** + * Retrieves achievements within a specified time range for a given app. + * @param {number} appId - The ID of the application. + * @param {number} start - The start of the time range as a Unix timestamp. + * @param {number} end - The end of the time range as a Unix timestamp. + * @returns {Promise} - A Promise that resolves to an array of AppAchievement objects. + */ + GetAchievementsInTimeRange(appId: number, start: number, end: number): Promise; /** * Retrieves a list of active game actions, such as launching an application. @@ -123,6 +137,7 @@ export interface Apps { GetBackupsInFolder(appBackupPath: string): Promise; GetCachedAppDetails(appId: number): Promise; // todo: Parsing nightmare + GetCloudPendingRemoteOperations: any; GetConflictingFileTimestamps: any; @@ -439,7 +454,7 @@ export interface Apps { SetAppResolutionOverride(appId: number, resolution: string): any; SetCachedAppDetails: any; - SetControllerRumblePreference: any; + SetControllerRumblePreference(appId: number, param1: number): any; // param1 - enum for preference /** * Sets the custom artwork for a given application. @@ -451,7 +466,7 @@ export interface Apps { */ SetCustomArtworkForApp(appId: number, base64Image: string, imageType: string, assetType: AppArtworkAssetType): Promise; - SetCustomLogoPositionForApp(appId: number, param1: string): Promise; + SetCustomLogoPositionForApp(appId: number, param1: string): Promise; // I've tried sending escaped LogoPosition JSON, but it doesn't seem to work SetDLCEnabled(appId: number, appDLCId: number, value: boolean): void; @@ -499,8 +514,13 @@ export interface Apps { */ SetShortcutStartDir(appId: number, directory: string): void; - // Sets the client ID for streaming for a specific application. + /** + * Sets the client ID for streaming for a specific application. + * @param {number} appId - The ID of the application. + * @param {string} clientId - The client ID for streaming. + */ SetStreamingClientForApp(appId: number, clientId: string): void; + SetThirdPartyControllerConfiguration: any; /** @@ -736,7 +756,11 @@ export interface Customization { * Represents functions related to managing downloads in Steam. */ export interface Downloads { - EnableAllDownloads(enable: boolean): void; // todo: Unknown usage + /** + * Enables or disables all downloads in Steam. + * @param {boolean} enable - True to enable downloads, false to disable. + */ + EnableAllDownloads(enable: boolean): void; /** * Moves the update for a specific app down the download queue. @@ -868,17 +892,38 @@ export interface FriendSettings { SetFriendSettings: any; } +/** + * Represents functions related to managing friends in Steam. + */ export interface Friends { - AddFriend(steamId: string): Promise; // Adds friend + /** + * Adds a user to the friend list. + * @param {string} steamId - The Steam ID of the user to add as a friend. + * @returns {Promise} A Promise that resolves to true if the friend was added successfully, false otherwise. + */ + AddFriend(steamId: string): Promise; + GetCoplayData(): Promise; // {"recentUsers":[], "currentUsers":[]} InviteUserToCurrentGame: any; - InviteUserToGame(steamId: string, appId: number, param2: string): Promise; // Invites a user to a game + /** + * Invites a user to a specific game. + * @param {string} steamId - The Steam ID of the user to invite. + * @param {number} appId - The ID of the game to invite the user to. + * @param {string} param2 - Additional parameters for the invitation. + * @returns {Promise} A Promise that resolves to true if the user was invited successfully, false otherwise. + */ + InviteUserToGame(steamId: string, appId: number, param2: string): Promise; InviteUserToLobby: any; InviteUserToRemotePlayTogetherCurrentGame: any; RegisterForVoiceChatStatus: any; - RemoveFriend(steamId: string): Promise; // Removes friend + /** + * Removes a user from the friend list. + * @param {string} steamId - The Steam ID of the user to remove from the friend list. + * @returns {Promise} A Promise that resolves to true if the friend was removed successfully, false otherwise. + */ + RemoveFriend(steamId: string): Promise; } export interface GameNotes { @@ -933,9 +978,22 @@ export interface GameSessions { RegisterForScreenshotNotification(callback: (screenshotNotification: ScreenshotNotification) => void): Unregisterable | any; } +/** + * Represents functions related to input and controllers in Steam. + */ export interface Input { - BIsSteamController(callback: (steamController: boolean) => void): void; // Whether the specified controller is a Steam Controller - BSupportsControllerLEDColor(callback: (supportControllerLEDColor: boolean) => void): void; // Whether the specified controller supports LED color + /** + * Checks if the specified controller is a Steam Controller. + * @param {function} callback - The callback function to receive the result. + */ + BIsSteamController(callback: (steamController: boolean) => void): void; + + /** + * Checks if the specified controller supports LED color. + * @param {function} callback - The callback function to receive the result. + */ + BSupportsControllerLEDColor(callback: (supportControllerLEDColor: boolean) => void): void; + CalibrateControllerIMU(param0: any): any; // param0 - m_controllerStateDeviceIdx CalibrateControllerJoystick(param0: any): any; // param0 - m_controllerStateDeviceIdx CalibrateControllerTrackpads(param0: any): any; // param0 - m_controllerStateDeviceIdx @@ -956,7 +1014,13 @@ export interface Input { GetConfigForAppAndController(appId: number, unControllerIndex: number): any; - GetControllerMappingString(unControllerIndex: number): Promise;// returns mappings + /** + * Retrieves the controller mapping string for the specified controller index. + * @param {number} unControllerIndex - The controller index. + * @returns {Promise} - A Promise that resolves to the controller mapping string. + */ + GetControllerMappingString(unControllerIndex: number): Promise; + GetSteamControllerDongleState(): Promise; GetTouchMenuIconsForApp(param0: any): Promise;// param0 - app? GetXboxDriverInstallState(): Promise; @@ -1537,7 +1601,7 @@ export interface RemotePlay { GetClientStreamingBitrate(): Promise; //todo: -1 not streaming?? GetClientStreamingQuality(): Promise; //todo: -1 not streaming?? - GetControllerType(param0: number): Promise; // todo: param0 with value 0 is host controller type - param0 is likely an index of clients or guestId? + GetControllerType(param0: number): Promise; // todo: param0 with value 0 is host controller type - param0 is likely an index of clients or guestId? GetGameSystemVolume(): Promise; GetPerUserInputSettings: any; @@ -2539,12 +2603,12 @@ export interface AppDetails { bSupportsCDKeyCopyToClipboard: boolean; bVRGameTheatreEnabled: boolean; bWorkshopVisible: boolean; - eAppOwnershipFlags: number; + eAppOwnershipFlags: AppOwnershipFlags | number; // is this a bitmask? eAutoUpdateValue: number; eBackgroundDownloads: number; eCloudSync: number; - eControllerRumblePreference: number; - eDisplayStatus: number; + eControllerRumblePreference: number; // ControllerRumbleSetting? + eDisplayStatus: DisplayStatus; eEnableThirdPartyControllerConfiguration: number; eSteamInputControllerMask: number; iInstallFolder: number; @@ -2594,144 +2658,93 @@ export interface AppDetails { }; } +// Appears to be all optional fields :disaster: export interface SteamAppOverview { appid: number; display_name: string; + visible_in_game_list: boolean; + sort_as: string; - /** - * Invalid = 0; - * Game = 1; - * Application = 2; - * Tool = 4; - * Demo = 8; - * Deprecated = 16; - * DLC = 32; - * Guide = 64; - * Driver = 128; - * Config = 256; - * Hardware = 512; - * Franchise = 1024; - * Video = 2048; - * Plugin = 4096; - * MusicAlbum = 8192; - * Series = 16384; - * Comic = 32768; - * Beta = 65536; - * Shortcut = 1073741824; - * DepotOnly = -2147483648; - */ - app_type: number; + /* + * Possible bitmask values, but I haven't spotted any of them being masked in the app_type field. + * Should be safe as an enum. + */ + app_type: AppType; mru_index: number | undefined; rt_recent_activity_time: number; minutes_playtime_forever: number; minutes_playtime_last_two_weeks: number; rt_last_time_played_or_installed: number; rt_last_time_played: number; - rt_purchased_time: number; + store_tag?: number[]; + association: SteamAppOverviewAssociation[]; + store_category?: number[]; rt_original_release_date: number; rt_steam_release_date: number; icon_hash: string; + controller_support?: AppControllerSupportLevel; // default none + vr_supported?: boolean; metacritic_score: number; - visible_in_game_list: boolean; + size_on_disk?: number; + third_party_mod?: boolean; + icon_data?: string; + icon_data_format?: string; + gameid: string; + library_capsule_filename?: string; + per_client_data: SteamAppOverviewClientData[]; most_available_clientid: string; selected_clientid?: string; rt_store_asset_mtime: number; - sort_as: string; - association: SteamAppOverviewAssociation[]; + rt_custom_image_mtime?: number; + optional_parent_app_id?: number; + owner_account_id?: number; + review_score_with_bombs: number; + review_percentage_with_bombs: number; + review_score_without_bombs: number; + review_percentage_without_bombs: number; + library_id?: string; + vr_only?: boolean; + mastersub_appid?: number; + mastersub_includedwith_logo?: string; + site_license_site_name?: string; + shortcut_override_appid?: number; + steam_deck_compat_category: SteamDeckCompatibilityCategory; // Default should be Unknown + rt_last_time_locally_played?: number + rt_purchased_time: number; + header_filename?: string; + m_setStoreCategories: Set; m_setStoreTags: Set; - per_client_data: SteamAppOverviewClientData[]; canonicalAppType: number; local_per_client_data: SteamAppOverviewClientData; most_available_per_client_data: SteamAppOverviewClientData; selected_per_client_data: SteamAppOverviewClientData; - review_score_with_bombs: number; - review_percentage_with_bombs: number; - review_score_without_bombs: number; - review_percentage_without_bombs: number; - steam_deck_compat_category: number; // 0 Unknown, 1 Unsupported, 2 Playable, 3 Verified m_strPerClientData: Set | undefined; m_strAssociations: Set | undefined; - - gameid: string; - third_party_mod?: boolean; BIsModOrShortcut: () => boolean; BIsShortcut: () => boolean; } export interface SteamAppOverviewAssociation { - /** - * Invalid = 0; - * Publisher = 1; - * Developer = 2; - * Franchise = 3; - */ - type: number; + type: AppAssociationType; // Default should be Invalid name: string; } export interface SteamAppOverviewClientData { clientid: string; client_name: string; - /** - * 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; - */ - display_status: number; + display_status: DisplayStatus; // Default should be Invalid status_percentage: number; + active_beta?: string; + installed?: boolean; bytes_downloaded: string; bytes_total: string; + streaming_to_local_client?: boolean; is_available_on_current_platform: boolean; - - /** - * Invalid = 0; - * Disabled = 1; - * Unknown = 2; - * Synchronized = 3; - * Checking = 4; - * OutOfSync = 5; - * Uploading = 6; - * Downloading = 7; - * SyncFailed = 8; - * Conflict = 9; - * PendingElsewhere = 10; - */ - cloud_status: number; + is_invalid_os_type?: boolean; + playtime_left?: number; + cloud_status: AppCloudStatus; } /** @@ -2744,7 +2757,6 @@ export interface CompatibilityToolInfo { strDisplayName: string; } - /** * Represents information about an installed application. */ @@ -2825,7 +2837,7 @@ export interface Screenshot { nWidth: number, nHeight: number, nCreated: number, // timestamp - ePrivacy: number, + ePrivacy: FilePrivacyState, strCaption: "", bSpoilers: boolean, strUrl: string, @@ -2894,7 +2906,7 @@ export interface InstallInfo { iInstallFolder: number; // index of the install folder iUnmountedFolder: number; currentAppID: number; - eAppError: number; + eAppError: AppError; errorDetail: string; bSystemMenuShortcut: boolean; bDesktopShortcut: boolean; @@ -3008,7 +3020,7 @@ interface DisplaySettings { interface SteamSettings { bIsInClientBeta: boolean; bIsSteamSideload: boolean; - eClientBetaState: number; + eClientBetaState: ClientBetaState; strSelectedBetaName: string; nAvailableBetas: number; bChangeBetaEnabled: boolean; @@ -3166,7 +3178,7 @@ export interface ParentalSettings { } export interface ConnectivityTestChange { - eConnectivityTestResult: number; + eConnectivityTestResult: ConnectivityTestResult; eFakeState: number; bChecking: boolean; } @@ -3270,7 +3282,7 @@ export interface ControllerInfo { eControllerType: ControllerType; nXInputIndex: number; nControllerIndex: number; - eRumblePreference: number; + eRumblePreference: number; // ControllerRumbleSetting bWireless: boolean; unUniqueID: number; unVendorID: number; @@ -3581,9 +3593,8 @@ export interface BluetoothDevice { /** * The type of the Bluetooth device (e.g., headphones, mouse, keyboard). - * @remarks 2 - Smartphone, 5 - Wireless Handset, 10 - Wireless Controller, 11 - Keyboard */ - eType: number; + eType: BluetoothDeviceType; /** * The MAC address of the Bluetooth device. @@ -3793,15 +3804,15 @@ export interface AudioDeviceInfo { export interface BatteryStateChange { bHasBattery: boolean; - eACState: number; // 1 unplugged, 2 - plugged in normal, 3 - plugged in with slow charger - eBatteryState: number; // 1 - Using battery, 2 - Not using battery? 3 - hybrid? + eACState: ACState; + eBatteryState: BatteryState; flLevel: number; // Battery Percentage in floating point 0-1 nSecondsRemaining: number; // Appears to be charge time remaining or time remaining on battery bShutdownRequested: boolean; } export interface OSBranch { - eBranch: number; // 1 - Stable + eBranch: OSBranchType; // 1 - Stable sRawName: string; } @@ -3871,20 +3882,20 @@ export interface ControllerConfigCloudStateChange { } export enum AppArtworkAssetType { - Capsule, - Hero, - Logo, - Header, - Icon, - HeroBlur, + Capsule = 0, + Hero = 1, + Logo = 2, + Header = 3, + Icon = 4, + HeroBlur = 5, } export enum UIComposition { - Hidden, - Notification, - Overlay, - Opaque, - OverlayKeyboard // Unverified + Hidden = 0, + Notification = 1, + Overlay = 2, + Opaque = 3, + OverlayKeyboard = 4, // Unverified } export enum OSType { @@ -3980,7 +3991,7 @@ export enum ControllerType { UnknownSteamController = 1, SteamController = 2, // Codename Gordon SteamControllerV2 = 3, // Codename Headcrab - SteamControllerNeptune = 4, + SteamControllerNeptune = 4, // Steam Deck FrontPanelBoard = 20, Generic = 30, XBox360Controller = 31, @@ -4013,6 +4024,252 @@ export enum FilePrivacyState { Unlisted = 16, } +export enum BluetoothDeviceType { + Invalid = 0, + Unknown = 1, + Phone = 2, + Computer = 3, + Headset = 4, + Headphones = 5, + Speakers = 6, + OtherAudio = 7, + Mouse = 8, + Joystick = 9, + Gamepad = 10, + Keyboard = 11, +} + +export enum AppAssociationType { + Invalid = 0, + Publisher = 1, + Developer = 2, + Franchise = 3, +} + +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 enum AppCloudStatus { + Invalid = 0, + Disabled = 1, + Unknown = 2, + Synchronized = 3, + Checking = 4, + OutOfSync = 5, + Uploading = 6, + Downloading = 7, + SyncFailed = 8, + Conflict = 9, + PendingElsewhere = 10, +} + +export enum SteamDeckCompatibilityCategory { + Unknown = 0, + Unsupported = 1, + Playable = 2, + Verified = 3, +} + +export enum ACState { + Unknown = 0, + Disconnected = 1, + Connected = 2, + ConnectedSlow = 3, +} + +export enum BatteryState { + Unknown = 0, + Discharging = 1, + Charging = 2, + Full = 3, +} + +export enum OSBranchType { + Unknown = 0, + Release = 1, + ReleaseCandidate = 2, + Beta = 3, + BetaCandidate = 4, + Main = 5, + Staging = 6, +} + +export enum AppOwnershipFlags { + None = 0, + Subscribed = 1, + Free = 2, + RegionRestricted = 4, + LowViolence = 8, + InvalidPlatform = 16, + Borrowed = 32, + FreeWeekend = 64, + Retail = 128, + Locked = 256, + Pending = 512, + Expired = 1024, + Permanent = 2048, + Recurring = 4096, + Canceled = 8192, + AutoGrant = 16384, + PendingGift = 32768, + RentalNotActivated = 65536, + Rental = 131072, + SiteLicense = 262144, + LegacyFreeSub = 524288, + InvalidOSType = 1048576, + TimedTrial = 2097152, +} + +export enum AppError { + None = 0, + Unspecified = 1, + Paused = 2, + Canceled = 3, + Suspended = 4, + NoSubscription = 5, + NoConnection = 6, + Timeout = 7, + MissingKey = 8, + MissingConfig = 9, + DiskReadFailure = 10, + DiskWriteFailure = 11, + NotEnoughDiskSpace = 12, + CorruptGameFiles = 13, + WaitingForNextDisk = 14, + InvalidInstallPath = 15, + AppRunning = 16, + DependencyFailure = 17, + NotInstalled = 18, + UpdateRequired = 19, + Busy = 20, + NoDownloadSources = 21, + InvalidAppConfig = 22, + InvalidDepotConfig = 23, + MissingManifest = 24, + NotReleased = 25, + RegionRestricted = 26, + CorruptDepotCache = 27, + MissingExecutable = 28, + InvalidPlatform = 29, + InvalidFileSystem = 30, + CorruptUpdateFiles = 31, + DownloadDisabled = 32, + SharedLibraryLocked = 33, + PendingLicense = 34, + OtherSessionPlaying = 35, + CorruptDownload = 36, + CorruptDisk = 37, + FilePermissions = 38, + FileLocked = 39, + MissingContent = 40, + Requires64BitOS = 41, + MissingUpdateFiles = 42, + NotEnoughDiskQuota = 43, + LockedSiteLicense = 44, + ParentalBlocked = 45, + SpawnProcess = 46, + ClientOutOfDate = 47, + PlaytimeExceeded = 48, + CorruptFileSignature = 49, + MissingGameFiles = 50, + CompatToolFailed = 51, + RemovedInstallPath = 52, + InvalidBackupPath = 53, + InvalidPasscode = 54, + SelfUpdating = 55, + ParentalPlaytimeExceeded = 56, + Max = 57 +} + +export enum ClientBetaState { + None = 0, + NoneChosen = 1, + NoneChosenNonAdmin = 2, + InBeta = 3, + InBetaNonAdmin = 4, +} + +export enum ConnectivityTestResult { + Unknown = 0, + Connected = 1, + CaptivePortal = 2, + TimedOut = 3, + Failed = 4, + WifiDisabled = 5, + NoLAN = 6, +} + +export enum ControllerRumbleSetting { + ControllerPreference = 0, + Off = 1, + On = 2, +} + +export enum AppControllerSupportLevel { + None = 0, + Partial = 1, + Full = 2, +} + +export enum AppType { + DepotOnly = -2147483648, + Invalid = 0, + Game = 1, + Application = 2, + Tool = 4, + Demo = 8, + Deprecated = 16, + DLC = 32, + Guide = 64, + Driver = 128, + Config = 256, + Hardware = 512, + Franchise = 1024, + Video = 2048, + Plugin = 4096, + MusicAlbum = 8192, + Series = 16384, + Comic = 32768, + Beta = 65536, + Shortcut = 1073741824, +} + export interface Unregisterable { /** From a74109ff81094b3351fbed5d8934e139e5ccb902 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:38:54 +0800 Subject: [PATCH 17/46] new: Document some SteamClient interfaces - part 14 --- src/globals/SteamClient.ts | 49 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 4b48ad01..22aa4eb6 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -403,22 +403,20 @@ export interface Apps { /** * Sets the automatic update behavior for a Steam application. * @param {number} appId - The ID of the application to set the update behavior for. - * @param {number} mode - The update behavior mode to set. Possible values: 0 (Always keep this game updated), 1 (Only update this game when I launch it), 2 (High priority). + * @param {AutoUpdateBehavior} mode - The update behavior mode to set. * @returns {void} * @remarks This function only works with installed Steam applications. - * @todo The 'mode' parameter is likely an enum with values that control the auto-update behavior of the specified application. */ - SetAppAutoUpdateBehavior(appId: number, mode: number): void; + SetAppAutoUpdateBehavior(appId: number, mode: AutoUpdateBehavior): void; /** * Sets the background downloads behavior for a specific Steam application. * @param {number} appId - The ID of the application to set the background downloads behavior for. - * @param {number} mode - The background downloads mode to set. Possible values are: 0 (Pause), 1 (Always), 2 (Never). + * @param {BackgroundDownloadsBehavior} mode - The background downloads mode to set. * @returns {void} * @remarks This function only works with installed Steam applications. - * @todo The 'mode' parameter is likely an enum with values that control the background downloads behavior of the specified application. */ - SetAppBackgroundDownloadsBehavior(appId: number, mode: number): void; + SetAppBackgroundDownloadsBehavior(appId: number, mode: BackgroundDownloadsBehavior): void; /** * Sets the current language for a specific Steam application. @@ -3006,17 +3004,6 @@ interface AvailableClientBeta { strName: string; } -interface DisplaySettings { - bDisplayIsExternal: boolean; - flAutoDisplayScaleFactor: number; - flCurrentDisplayScaleFactor: number; - bDisplayIsUsingAutoScale: boolean; - flMinDisplayScaleFactor: number; - flMaxDisplayScaleFactor: number; - flCurrentUnderscanLevel: number; - bUnderscanEnabled: boolean; -} - interface SteamSettings { bIsInClientBeta: boolean; bIsSteamSideload: boolean; @@ -3034,15 +3021,15 @@ interface SteamSettings { bCompatEnabled: boolean; bCompatEnabledForOtherTitles: boolean; strCompatTool: string; - bShowMobxDevTools: boolean; - bForceOOBE: boolean; - bEnableTestUpdaters: boolean; - bOOBETestModeEnabled: boolean; - bEnableTabbedAppDetails: boolean; - eOverrideBrowserComposerMode: number; - bCefRemoteDebuggingEnabled: boolean; strDisplayName: string; - displaySettings: DisplaySettings; + bDisplayIsExternal: boolean; + flAutoDisplayScaleFactor: number; + flCurrentDisplayScaleFactor: number; + bDisplayIsUsingAutoScale: boolean; + flMinDisplayScaleFactor: number; + flMaxDisplayScaleFactor: number; + flCurrentUnderscanLevel: number; + bUnderscanEnabled: boolean; vecNightModeScheduledHours: Hour[]; } @@ -4270,6 +4257,18 @@ export enum AppType { Shortcut = 1073741824, } +export enum AutoUpdateBehavior { + Always = 0, // (Always keep this game updated) + Launch = 1, // (Only update this game when I launch it) + HighPriority = 2, // (High priority) +} + +export enum BackgroundDownloadsBehavior { + Pause = 0, + Always = 1, + Never = 2, +} + export interface Unregisterable { /** From 8d845de399abb5e265934f192d6dbfbc0e4926ce Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Fri, 27 Oct 2023 07:13:01 +0800 Subject: [PATCH 18/46] change: Update interfaces to Steam Version 1698260427 Steam Version: 1698260427 Steam Client Build Date: Thu, Oct 26 2:40 AM UTC -08:00 --- src/globals/SteamClient.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 22aa4eb6..8e1e433d 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -861,7 +861,7 @@ export interface FamilySharing { RegisterForKickedBorrower: any; - RequestFamilySharingAuthorization(param0: string): Promise; // Unknown param0, my assumption is probably a steam64Id of the user sharing the library + RequestLocalDeviceAuthorization(param0: string): Promise; // Unknown param0, my assumption is probably a steam64Id of the user sharing the library UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise; // Unknown } @@ -1104,6 +1104,7 @@ export interface Input { SetControllerConfigurationModeShiftBinding: any; SetControllerHapticSetting: any; SetControllerMappingString(mapping: string): void; + SetControllerName: any; SetControllerNintendoLayoutSetting: any; SetControllerPersonalizationName: any; //param0 - nLStickDeadzone, bSWAntiDrift, nRHapticStrength, flRPadPressureCurve @@ -1478,6 +1479,10 @@ export interface PathProperties { } export interface VROverlay { + HideDashboard: any; + RegisterForButtonPress: Unregisterable | any; + RegisterForCursorMovement: Unregisterable | any; + RegisterForVisibilityChanged: Unregisterable | any; ShowDashboard: any; } @@ -1489,11 +1494,14 @@ export interface OpenVR { Keyboard: Keyboard; PathProperties: PathProperties; QuitAllVR: any; + RegisterForButtonPress: Unregisterable | any; + RegisterForHMDActivityLevelChanged: Unregisterable | any; RegisterForInstallDialog: Unregisterable | any; RegisterStartupErrors: Unregisterable | any; RegisterForVRHardwareDetected: Unregisterable | any; RegisterForVRModeChange: Unregisterable | any; SetOverlayInteractionAffordance: any; + ShowNotification: any; StartVR: any; TriggerOverlayHapticEffect: any; VROverlay: VROverlay; @@ -1608,6 +1616,7 @@ export interface RemotePlay { InstallAudioDriver: any; InstallInputDriver: any; MoveControllerToSlot: any; + RegisterForAdditionalParentalBlocks: Unregisterable | any; RegisterForAudioDriverPrompt: Unregisterable | any; RegisterForBitrateOverride: Unregisterable | any; RegisterForControllerIndexSet: Unregisterable | any; @@ -2225,6 +2234,8 @@ export interface System { IsDeckFactoryImage(): Promise; + IsSteamInTournamentMode(): Promise; + Network: Network; NotifyGameOverlayStateChanged(param0: boolean, appId: number): any; @@ -2418,7 +2429,6 @@ export interface WebChat { RegisterForMouseXButtonDown: Unregisterable | any; RegisterForPushToTalkStateChange: Unregisterable | any; RegisterForUIModeChange: Unregisterable | any; - RegisterForVRModeChange: Unregisterable | any; RegisterOverlayChatBrowserInfoChanged: Unregisterable | any; SetActiveClanChatIDs: any; SetNumChatsWithUnreadPriorityMessages: any; @@ -2443,7 +2453,6 @@ export interface Window { Close(): any; DefaultMonitorHasFullscreenWindow: any; FlashWindow: any; - GamescopeBlur: any; GetDefaultMonitorDimensions: any; GetMousePositionDetails: any; GetWindowDimensions: any; @@ -2504,7 +2513,6 @@ export interface SteamClient { OpenVR: OpenVR; Overlay: Overlay; Parental: Parental; - RegisterIFrameNavigatedCallback: any; RemotePlay: RemotePlay; RoamingStorage: Storage; Screenshots: Screenshots; From 21747ef30cb37fac1e30836e25c13daf18a0d9b0 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Sat, 23 Sep 2023 08:40:58 +0800 Subject: [PATCH 19/46] new: Document some SteamClient interfaces - part 10 --- src/globals/stores.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/globals/stores.ts b/src/globals/stores.ts index e4eec13b..119daaa6 100644 --- a/src/globals/stores.ts +++ b/src/globals/stores.ts @@ -1,5 +1,4 @@ import {AppData, AppDetails, LogoPosition, SteamAppOverview, SteamClient} from './SteamClient'; - declare global { interface Window { LocalizationManager: { From b23839e979894db4aabf4f18940924ba32fee2a4 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:10:03 +0800 Subject: [PATCH 20/46] change: Update interfaces to Steam Version 1700160213 Steam Version: 1700160213 Steam Client Build Date: Fri, Nov 17 2:23 AM UTC +08:00 --- src/globals/SteamClient.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 8e1e433d..e10b0a05 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -575,13 +575,6 @@ export interface Apps { ToggleAppSteamCloudSyncOnSuspendEnabled: any; - /** - * Toggles the "Use Desktop Game Theatre while SteamVR is active" setting for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} - */ - ToggleEnableDesktopTheatreForApp(appId: number): void; - /** * Toggles the Steam Overlay setting for a specific application. * @param {number} appId - The ID of the application. @@ -1019,6 +1012,8 @@ export interface Input { */ GetControllerMappingString(unControllerIndex: number): Promise; + GetControllerPreviouslySeen: any; + GetSteamControllerDongleState(): Promise; GetTouchMenuIconsForApp(param0: any): Promise;// param0 - app? GetXboxDriverInstallState(): Promise; @@ -1444,6 +1439,7 @@ export interface Notifications { export interface VRDevice { BIsConnected: any; + BVRDeviceSeenRecently: any; RegisterForDeviceConnectivityChange: Unregisterable | any; } @@ -1499,7 +1495,6 @@ export interface OpenVR { RegisterForInstallDialog: Unregisterable | any; RegisterStartupErrors: Unregisterable | any; RegisterForVRHardwareDetected: Unregisterable | any; - RegisterForVRModeChange: Unregisterable | any; SetOverlayInteractionAffordance: any; ShowNotification: any; StartVR: any; From 93e8c318879ad284613f91dd346c90ce65aa76eb Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:36:39 +0000 Subject: [PATCH 21/46] docs(SteamClient): document some interfaces --- src/globals/SteamClient.ts | 8812 ++++++++++++++++++++++-------------- 1 file changed, 5357 insertions(+), 3455 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index e10b0a05..d326fd8b 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -6,921 +6,1048 @@ declare global { * Represents various functions related to Steam applications. */ export interface Apps { - /** - * Adds a non-Steam application shortcut to the local Steam library. - * @param {string} appName - The name of the non-Steam application. - * @param {string} executablePath - The path to the executable file of the non-Steam application. - * @param {string} directory - The working directory for the non-Steam application. - * @param {string} launchOptions - Options to be passed when launching the non-Steam application. - * @returns {Promise} - A Promise that resolves to a unique AppID assigned to the added non-Steam application shortcut. - */ - AddShortcut(appName: string, executablePath: string, directory: string, launchOptions: string): Promise; - - /** - * Adds user tags to specified apps in the Steam library. - * @param {number[]} appIds - The IDs of the apps to which user tags will be added. - * @param {string} userTag - The user tag to be added. - * @returns {void} - * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. - */ - AddUserTagToApps(appIds: number[], userTag: string): void; - - /** - * Backups an app to the specified path. - * @param {number} appId - The ID of the application to back up. - * @param {string} backupToPath - The path to store the backup. - * @returns {number} A Promise that resolves to a number. This value may be "20" for backup busy and "0" for success. - */ - BackupFilesForApp(appId: number, backupToPath: string): Promise; - - /** - * Opens the screenshot folder for a specific app. - * @param {string} appId - The ID of the app to browse screenshots for. - * @param {number} param1 - Additional parameter (exact usage may vary). - * @returns {void} - */ - BrowseScreenshotForApp(appId: string, param1: number): void; - - /** - * Opens the screenshot folder for a specific app. - * @param {string} appId - The ID of the app to browse screenshots for. - * @returns {void} - */ - BrowseScreenshotsForApp(appId: string): void; - - /** - * Cancels the current backup process. - * @returns {void} - */ - CancelBackup(): void; - - CancelGameAction: any; - - /** - * Cancels the launch of an application with the specified ID. - * @param {string} appId - The ID of the application whose launch is to be canceled. - * @returns {void} - */ - CancelLaunch(appId: string): void; - - /** - * Clears existing user tags on a specified application and sets new user tags. - * @param {number} appId - The ID of the application to clear and set user tags for. - * @param {string[]} userTags - An array of user tags to set for the application. - * @returns {void} - * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. - */ - ClearAndSetUserTagsOnApp(appId: number, userTags: string[]): void; - - /** - * Clears the custom artwork for a given application. - * @param {number} appId - The ID of the application to clear custom artwork for. - * @param {AppArtworkAssetType} assetType - The type of artwork to clear. - */ - ClearCustomArtworkForApp(appId: number, assetType: AppArtworkAssetType): Promise; - - /** - * Clears the custom logo position for a specific application. - * @param {number} appId - The ID of the application. - * @returns {Promise} - A Promise that resolves once the custom logo position is cleared. - */ - ClearCustomLogoPositionForApp(appId: number): Promise; - - ClearProton: any; - - /** - * Clears user tags on a list of specified applications. - * @param {number[]} appIds - An array of application IDs for which to clear user tags. - * @returns {void} - * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. - */ - ClearUserTagsOnApps(appIds: number[]): void; - - ContinueGameAction: any; - - /** - * Creates a Steam application shortcut on the desktop. - * @param {number} appId - The ID of the application for which to create a desktop shortcut. - * @returns {void} - */ - CreateDesktopShortcutForApp(appId: number): void; - - DownloadWorkshopItem: any; - - /** - * Retrieves achievements within a specified time range for a given app. - * @param {number} appId - The ID of the application. - * @param {number} start - The start of the time range as a Unix timestamp. - * @param {number} end - The end of the time range as a Unix timestamp. - * @returns {Promise} - A Promise that resolves to an array of AppAchievement objects. - */ - GetAchievementsInTimeRange(appId: number, start: number, end: number): Promise; - - /** - * Retrieves a list of active game actions, such as launching an application. - * @returns {Promise} A Promise that resolves to an array of active game actions. - */ - GetActiveGameActions(): Promise; - - /** - * Retrieves a list of available compatibility tools for a specific application. - * @param {number} appId - The ID of the application to retrieve compatibility tools for. - * @returns {Promise} A Promise that resolves to an array of CompatibilityToolInfo objects. - */ - GetAvailableCompatTools(appId: number): Promise; - - /** - * Represents a function to retrieve the name of the application in a backup folder. - * @param {string} appBackupPath - The path to the application's backup folder. - * @returns {Promise} - A Promise that resolves to the name of the application in the backup folder, or undefined if the path is invalid. - */ - GetBackupsInFolder(appBackupPath: string): Promise; - - GetCachedAppDetails(appId: number): Promise; // todo: Parsing nightmare - - GetCloudPendingRemoteOperations: any; - GetConflictingFileTimestamps: any; - - /** - * Retrieves details for a specific screenshot upload. - * @param {string} appId - The ID of the application. - * @param {number} hHandle - The handle of the screenshot upload. - * @returns {Promise} - A Promise that resolves to details about the screenshot upload. - */ - GetDetailsForScreenshotUpload(appId: string, hHandle: number): Promise; - - /** - * Retrieves details for multiple screenshot uploads. - * @param {string} appId - The ID of the application. - * @param {number[]} hHandles - An array of handles of the screenshot uploads. - * @returns {Promise} - A Promise that resolves to details about the screenshot uploads. - */ - GetDetailsForScreenshotUploads(appId: string, hHandles: number[]): Promise; - - /** - * Retrieves a list of downloaded workshop items for a specific application. - * @param {number} appId - The ID of the application to retrieve downloaded workshop items for. - * @returns {Promise} - A Promise that resolves to an array of downloaded workshop items for the specified application. - */ - GetDownloadedWorkshopItems(appId: number): Promise; - - GetDurationControlInfo(appId: number): Promise; // {"bApplicable": true} - overlay usage? - - /** - * Retrieves achievement information for a specific application for a given friend. - * @param {string} appId - The ID of the application to retrieve achievement information for. - * @param {string} friendSteam64Id - The Steam64 ID of the friend for whom to retrieve achievement information. - * @returns {Promise} - A Promise that resolves to an object containing achievement information for the specified friend and application. - */ - GetFriendAchievementsForApp(appId: string, friendSteam64Id: string): Promise; - - /** - * Retrieves a list of friends who play the specified application. - * @param {number} appId - The ID of the application. - * @returns {Promise} A Promise that resolves to an array of Steam64 IDs representing friends who play the application. - */ - GetFriendsWhoPlay(appId: number): Promise; - - GetGameActionDetails(appId: number, callback: (gameAction: GameAction) => void): void; - - GetGameActionForApp(appId: string, callback: (param0: number /*flag check? for validity*/, param1: number | string /* string appears to be just the appid*/, param2: string /* "LaunchApp", need to look for more to document*/) => void): void; - - /** - * Retrieves launch options for a specified application. - * These options may include different configurations or settings for launching the application, such as DirectX, Vulkan, OpenGL, 32-bit, 64-bit, etc. - * This function does not retrieve launch/argument options inputted by the user. - * @param {number} appId - The ID of the application. - * @returns {Promise} - A Promise that resolves to an array of launch options for the specified application. - */ - GetLaunchOptionsForApp(appId: number): Promise; - - GetLibraryBootstrapData: any; // CLibraryBootstrapData - binary deserializer??? - - /** - * Retrieves achievement information for the authenticated user in a specific Steam application. - * @param {string} appId - The ID of the application to retrieve achievement information for. - * @returns {Promise} A Promise that resolves to an AppAchievementResponse object containing the achievement information for the authenticated user in the specified application. - */ - GetMyAchievementsForApp(appId: string): Promise; - - /** - * Retrieves the playtime information for a specific application. - * @param {number} appId - The ID of the application to get playtime information for. - * @returns {Promise} A Promise that resolves to playtime information or undefined if not available. - */ - GetPlaytime(appId: number): Promise; - - GetPrePurchasedApps(appIds: number[]): Promise; - - /** - * Retrieves the resolution override for a specific application. - * @param {number} appId - The ID of the application to retrieve the resolution override for. - * @returns {Promise} A Promise that resolves to a string of the resolution override. - */ - GetResolutionOverrideForApp(appId: number): Promise; - - /** - * Represents a function to retrieve detailed information about a specific screenshot. - * @param {string} appId - The ID of the application the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @returns {Promise} - A Promise that resolves to detailed information about the specified screenshot. - */ - GetScreenshotInfo(appId: string, hHandle: number): Promise; - - /** - * Represents a function to retrieve screenshots within a specified time range. - * @param {number} appId - The ID of the application. - * @param {number} start - The start of the time range as a Unix timestamp. - * @param {number} end - The end of the time range as a Unix timestamp. - * @returns {Promise} - A Promise that resolves to an array of screenshots taken within the specified time range. - */ - GetScreenshotsInTimeRange(appId: number, start: number, end: number): Promise; - - /** - * Represents a function to retrieve shortcut data for a list of non-Steam app IDs. - * @param {number[]} appIds - An array of non-Steam application IDs. - * @returns {Promise} - A Promise that resolves to an array of Shortcut objects for the specified non-Steam app IDs. - */ - GetShortcutData(appIds: number[]): Promise; - - /** - * Retrieves shortcut data for a given shortcut file path. - * @param {string} pathToShortcut The path to the shortcut file. - * @returns {Promise} A Promise that resolves to the shortcut data. - */ - GetShortcutDataForPath(pathToShortcut: string): Promise; - - /** - * Represents a function to retrieve details about a soundtrack associated with a soundtrack application. - * @param {number} appId - The ID of the soundtrack application. - * @returns {Promise} - A Promise that resolves to the details of the soundtrack associated with the specified soundtrack application. - */ - GetSoundtrackDetails(appId: number): Promise; - - GetStoreTagLocalization(tags: number[]): Promise; - - /** - * Retrieves a list of subscribed workshop items for a specific application. - * @param {number} appId - The ID of the application to retrieve subscribed workshop items for. - * @returns {Promise} - A Promise that resolves to an array of subscribed workshop items for the specified application. - */ - GetSubscribedWorkshopItems(appId: number): Promise; - - InstallFlatpakAppAndCreateShortcut(param0: string, param1: string): Promise; // returns {"appid":0,"strInstallOutput":""} - JoinAppContentBeta: any; - JoinAppContentBetaByPassword: any; - - ListFlatpakApps(): Promise; - - LoadEula(appId: number): Promise; // Doesn't bring up the EULA dialog, just returns the eula data - MarkEulaAccepted: any; - MarkEulaRejected: any; - - /** - * Opens the settings dialog for a specific application. - * @param {number} appId - The ID of the application for which to open the settings dialog. - * @param {string} param1 - Additional parameter (exact usage may vary). - * @returns {void} - */ - OpenAppSettingsDialog(appId: number, param1: string): void; - - PromptToChangeShortcut(): Promise; // todo: unknown, prompts file picker - RaiseWindowForGame(appId: number): any; // ResumeGameInProgress - - /** - * Registers a callback function to be called when achievement changes occur. - * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAchievementChanges(callback: () => void): Unregisterable | any; - - RegisterForAppBackupStatus(callback: (appBackupStatus: AppBackupStatus) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when app details change. - * @param appId The ID of the application to monitor. - * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; - - RegisterForAppOverviewChanges: Unregisterable | any; // CAppOverview_Change - binary deserializer??? - - RegisterForDRMFailureResponse(callback: (appid: number, eResult: number, errorCode: number) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when a game action ends. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionEnd(callback: (gameActionIdentifier: number) => void): Unregisterable | any; - - RegisterForGameActionShowError: Unregisterable | any; - - /** - * Registers a callback function to be called when a game action UI is shown. - * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; // todo: no idea what this callback is from - - /** - * Registers a callback function to be called when a game action starts. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionStart(callback: (gameActionIdentifier: number, appId: string, action: string, param3: number) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when a game action task changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionTaskChange(callback: (gameActionIdentifier: number, appId: string, action: string, requestedAction: string, param4: string) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when a user requests a game action. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionUserRequest(callback: (gameActionIdentifier: number, appId: string, action: string, requestedAction: string, appId2: string) => void): Unregisterable | any; - - RegisterForLocalizationChanges: Unregisterable | any; - - RegisterForPrePurchasedAppChanges(callback: () => void): Unregisterable | any; // Unknown, did have it show up a few times, but not callback parameters - RegisterForShowMarketingMessageDialog: Unregisterable | any; - - /** - * Registers a callback function to be notified when workshop items are added or removed from a Steam application. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForWorkshopChanges(callback: (appId: number) => void): Unregisterable | any; - - RegisterForWorkshopItemDownloads(param0: number, callback: () => void): Unregisterable | any; - - /** - * Removes a non-Steam application shortcut from the Steam library. - * @param {number} appId - The ID of the application for which to remove the shortcut. - * @returns {void} - */ - RemoveShortcut(appId: number): void; - - /** - * Removes a user tag from multiple Steam applications. - * @param {number[]} appIds - An array of application IDs from which the user tag should be removed. - * @param {string} userTag - The user tag to be removed. - * @returns {void} - * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. - */ - RemoveUserTagFromApps(appIds: number[], userTag: string): void; - - ReportLibraryAssetCacheMiss(appId: number, assetType: AppArtworkAssetType): void; - ReportMarketingMessageDialogShown: any; - RequestIconDataForApp: any; - RequestLegacyCDKeysForApp: any; - ResetHiddenState: any; - - /** - * Runs a game with specified parameters. - * @param {string} appId - The ID of the application to run. - * @param {string} param1 - Additional parameter (exact usage may vary). - * @param {number} param2 - Additional parameter (exact usage may vary). - * @param {number} param3 - Additional parameter (exact usage may vary). - * @returns {any} - */ - RunGame(appId: string, param1: string, param2: number, param3: number): any; - - SaveAchievementProgressCache: any; - - /** - * Scans the system for installed non-Steam applications. - * @returns {Promise} A Promise that resolves to an array of NonSteamApp objects representing installed non-Steam applications. - * @remarks This function scans the user's system for installed applications that are not part of the Steam library. It does not scan for shortcuts added to the Steam library. - */ - ScanForInstalledNonSteamApps(): Promise; - - /** - * Sets the automatic update behavior for a Steam application. - * @param {number} appId - The ID of the application to set the update behavior for. - * @param {AutoUpdateBehavior} mode - The update behavior mode to set. - * @returns {void} - * @remarks This function only works with installed Steam applications. - */ - SetAppAutoUpdateBehavior(appId: number, mode: AutoUpdateBehavior): void; - - /** - * Sets the background downloads behavior for a specific Steam application. - * @param {number} appId - The ID of the application to set the background downloads behavior for. - * @param {BackgroundDownloadsBehavior} mode - The background downloads mode to set. - * @returns {void} - * @remarks This function only works with installed Steam applications. - */ - SetAppBackgroundDownloadsBehavior(appId: number, mode: BackgroundDownloadsBehavior): void; - - /** - * Sets the current language for a specific Steam application. - * @param {number} appId - The ID of the application to set the current language for. - * @param {string} language - The language to set, represented as a language (e.g., "english", "spanish", "tchinese", "schinese"). - * @returns {void} - */ - SetAppCurrentLanguage(appId: number, language: string): void; - - /** - * Sets the hidden status of a specific Steam application. - * @param {number} appId - The ID of the application to set the hidden status for. - * @param {boolean} value - The value indicating whether the application should be hidden (true) or not (false). - * @returns {void} - * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file to set the hidden status of the specified application. - */ - SetAppHidden(appId: number, value: boolean): void; - - /** - * Sets launch options for a Steam application. - * @param {number} appId - The ID of the application to set launch options for. - * @param {string} launchOptions - The launch options to be set for the application. - * @returns {void} - */ - SetAppLaunchOptions(appId: number, launchOptions: string): void; - - /** - * Sets a resolution override for a Steam application. - * @param {number} appId - The ID of the application to set the resolution override for. - * @param {string} resolution - The resolution to be set for the application. It can be "Default", "Native", or other compatible resolutions for the user's monitor. - * @returns {void} - */ - SetAppResolutionOverride(appId: number, resolution: string): any; - - SetCachedAppDetails: any; - SetControllerRumblePreference(appId: number, param1: number): any; // param1 - enum for preference - - /** - * Sets the custom artwork for a given application. - * @param {number} appId - The ID of the application to set custom artwork for. - * @param {string} base64Image - Base64 encoded image. - * @param {string} imageType - "jpeg" or "png". - * @param {AppArtworkAssetType} assetType - The type of artwork to set. - * @returns {Promise} A Promise that resolves after the custom artwork is set. - */ - SetCustomArtworkForApp(appId: number, base64Image: string, imageType: string, assetType: AppArtworkAssetType): Promise; - - SetCustomLogoPositionForApp(appId: number, param1: string): Promise; // I've tried sending escaped LogoPosition JSON, but it doesn't seem to work - - SetDLCEnabled(appId: number, appDLCId: number, value: boolean): void; - - SetLocalScreenshotCaption(appId: string, param1: any, param2: any): void; - SetLocalScreenshotPrivacy(appId: string, param1: any, param2: any): void; - SetLocalScreenshotSpoiler(appId: string, param1: any, param2: any): void; - - /** - * Sets the icon for a non-Steam application shortcut. - * @param {string} appId - The ID of the application to set the shortcut icon for. - * @param {string} iconPath - The path to the icon image (can be png or tga format). - * @returns {void} - */ - SetShortcutIcon(appId: number, iconPath: string): void; - - /** - * Sets whether a non-Steam application shortcut should be included in the VR library. - * @param {number} appId The ID of the application to set the VR status for. - * @param {boolean} value A boolean indicating whether the application should be included in the VR library. - * @returns {void} - */ - SetShortcutIsVR(appId: number, value: boolean): void; - - /** - * Sets launch options for a non-Steam application shortcut. - * @param {number} appId - The ID of the application to set the launch options for. - * @param {string} launchOptions - The launch options to be used when starting the application. - * @returns {void} - */ - SetShortcutLaunchOptions(appId: number, launchOptions: string): void; - - /** - * Sets the name for a non-Steam application shortcut. - * @param {number} appId - The ID of the application to set the shortcut name for. - * @param {string} shortcutName - The name to be displayed for the application shortcut. - * @returns {void} - */ - SetShortcutName(appId: number, shortcutName: string): void; - - /** - * Sets the starting directory for a non-Steam application shortcut. - * @param {number} appId - The ID of the application to set the starting directory for. - * @param {string} directory - The directory from which the application should be launched. - * @returns {void} - */ - SetShortcutStartDir(appId: number, directory: string): void; - - /** - * Sets the client ID for streaming for a specific application. - * @param {number} appId - The ID of the application. - * @param {string} clientId - The client ID for streaming. - */ - SetStreamingClientForApp(appId: number, clientId: string): void; - - SetThirdPartyControllerConfiguration: any; - - /** - * Opens the controller configurator for a specific application. - * @param {number} appId - The ID of the application for which to open the controller configurator. - * @returns {void} - */ - ShowControllerConfigurator(appId: number): void; - - /** - * Opens the Steam store page for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} - */ - ShowStore(appId: number): void; - - /** - * Specifies a compatibility tool by its name for a given application. If strToolName is an empty string, the specified application will no longer use a compatibility tool. - * @param {number} appId - The ID of the application to specify compatibility tool for. - * @param {string} strToolName - The name of the compatibility tool to specify. - * @returns {void} - */ - SpecifyCompatTool(appId: number, strToolName: string): void; - - StreamGame(appId: number, clientId: string, param2: number): void; - - /** - * Subscribes or unsubscribes from a workshop item for a specific app. - * @param {number} appId - The ID of the application. - * @param {string} workshopId - The ID of the workshop item. - * @param {boolean} subscribed - True to subscribe, false to unsubscribe. - * @returns {void} - */ - SubscribeWorkshopItem(appId: number, workshopId: string, subscribed: boolean): void; - - /** - * Terminates a running application. - * @param {string} appId - The ID of the application to terminate. - * @param {boolean} param1 - Additional parameter. Exact usage may vary. - * @returns {void} - */ - TerminateApp(appId: string, param1: boolean): void; - - ToggleAllowDesktopConfiguration: any; - ToggleAppFamilyBlockedState: any; - - /** - * Toggles the Steam Cloud synchronization for game saves for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} - * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. - */ - ToggleAppSteamCloudEnabled(appId: number): void; - - ToggleAppSteamCloudSyncOnSuspendEnabled: any; - - /** - * Toggles the Steam Overlay setting for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} - */ - ToggleEnableSteamOverlayForApp(appId: number): void; - - ToggleOverrideResolutionForInternalDisplay: any; - UninstallFlatpakApp: any; - - /** - * Verifies the integrity of an app's files. - * @param {number} appId - The ID of the app to verify. - */ - VerifyApp(appId: number): Promise; // todo: returns {"nGameActionID":9} + /** + * Adds a non-Steam application shortcut to the local Steam library. + * @param {string} appName - The name of the non-Steam application. + * @param {string} executablePath - The path to the executable file of the non-Steam application. + * @param {string} directory - The working directory for the non-Steam application. + * @param {string} launchOptions - Options to be passed when launching the non-Steam application. + * @returns {Promise} - A Promise that resolves to a unique AppID assigned to the added non-Steam application shortcut. + */ + AddShortcut(appName: string, executablePath: string, directory: string, launchOptions: string): Promise; + + /** + * Adds user tags to specified apps in the Steam library. + * @param {number[]} appIds - The IDs of the apps to which user tags will be added. + * @param {string} userTag - The user tag to be added. + * @returns {void} + * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. + */ + AddUserTagToApps(appIds: number[], userTag: string): void; + + /** + * Backups an app to the specified path. + * @param {number} appId - The ID of the application to back up. + * @param {string} backupToPath - The path to store the backup. + * @returns {number} A Promise that resolves to a number. This value may be "20" for backup busy and "0" for success. + */ + BackupFilesForApp(appId: number, backupToPath: string): Promise; + + /** + * Opens the screenshot folder for a specific app. + * @param {string} appId - The ID of the app to browse screenshots for. + * @param {number} handle - The screenshot handle to use. + * @returns {void} + */ + BrowseScreenshotForApp(appId: string, handle: number): void; + + /** + * Opens the screenshot folder for a specific app. + * @param {string} appId - The ID of the app to browse screenshots for. + * @returns {void} + */ + BrowseScreenshotsForApp(appId: string): void; + + /** + * Cancels the current backup process. + * @returns {void} + */ + CancelBackup(): void; + + CancelGameAction: any; + + /** + * Cancels the launch of an application with the specified ID. + * @param {string} appId - The ID of the application whose launch is to be canceled. + * @returns {void} + */ + CancelLaunch(appId: string): void; + + /** + * Clears existing user tags on a specified application and sets new user tags. + * @param {number} appId - The ID of the application to clear and set user tags for. + * @param {string[]} userTags - An array of user tags to set for the application. + * @returns {void} + * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. + */ + ClearAndSetUserTagsOnApp(appId: number, userTags: string[]): void; + + /** + * Clears the custom artwork for a given application. + * @param {number} appId - The ID of the application to clear custom artwork for. + * @param {AppArtworkAssetType} assetType - The type of artwork to clear. + */ + ClearCustomArtworkForApp(appId: number, assetType: AppArtworkAssetType): Promise; + + /** + * Clears the custom logo position for a specific application. + * @param {number} appId - The ID of the application. + * @returns {Promise} - A Promise that resolves once the custom logo position is cleared. + */ + ClearCustomLogoPositionForApp(appId: number): Promise; + + ClearProton: any; + + /** + * Clears user tags on a list of specified applications. + * @param {number[]} appIds - An array of application IDs for which to clear user tags. + * @returns {void} + * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. + */ + ClearUserTagsOnApps(appIds: number[]): void; + + ContinueGameAction: any; + + /** + * Creates a Steam application shortcut on the desktop. + * @param {number} appId - The ID of the application for which to create a desktop shortcut. + * @returns {void} + */ + CreateDesktopShortcutForApp(appId: number): void; + + /** + * Download a workshop item. + * @param {number} appId - The ID of the application. + * @param {string} itemId - The ID of the workshop item. + * @param {boolean} param1 - Additional parameter (exact usage may vary). + * @returns {void} + */ + DownloadWorkshopItem(appId: number, itemId: string, param1: boolean): void; + + /** + * Retrieves achievements within a specified time range for a given app. + * @param {number} appId - The ID of the application. + * @param {number} start - The start of the time range as a Unix timestamp. + * @param {number} end - The end of the time range as a Unix timestamp. + * @returns {Promise} - A Promise that resolves to an array of AppAchievement objects. + */ + GetAchievementsInTimeRange(appId: number, start: number, end: number): Promise; + + /** + * Retrieves a list of active game actions, such as launching an application. + * @returns {Promise} A Promise that resolves to an array of active game actions. + */ + GetActiveGameActions(): Promise; + + /** + * Retrieves a list of available compatibility tools for a specific application. + * @param {number} appId - The ID of the application to retrieve compatibility tools for. + * @returns {Promise} A Promise that resolves to an array of CompatibilityToolInfo objects. + */ + GetAvailableCompatTools(appId: number): Promise; + + /** + * Represents a function to retrieve the name of the application in a backup folder. + * @param {string} appBackupPath - The path to the application's backup folder. + * @returns {Promise} - A Promise that resolves to the name of the application in the backup folder, or undefined if the path is invalid. + * @remarks This function checks for the "sku.sis" file in that path. + */ + GetBackupsInFolder(appBackupPath: string): Promise; + + /** + * @param appId - The ID of the application. + * @returns {Promise} - A Promise that resolves to a stringified object. + */ + GetCachedAppDetails(appId: number): Promise; // todo: Parsing nightmare + + GetCloudPendingRemoteOperations(appId: number): Promise; + GetConflictingFileTimestamps(appId: number): Promise; + + /** + * Retrieves details for a specific screenshot upload. + * @param {string} appId - The ID of the application. + * @param {number} hHandle - The handle of the screenshot upload. + * @returns {Promise} - A Promise that resolves to details about the screenshot upload. + */ + GetDetailsForScreenshotUpload(appId: string, hHandle: number): Promise; + + /** + * Retrieves details for multiple screenshot uploads. + * @param {string} appId - The ID of the application. + * @param {number[]} hHandles - An array of handles of the screenshot uploads. + * @returns {Promise} - A Promise that resolves to details about the screenshot uploads. + */ + GetDetailsForScreenshotUploads(appId: string, hHandles: number[]): Promise; + + /** + * Retrieves a list of downloaded workshop items for a specific application. + * @param {number} appId - The ID of the application to retrieve downloaded workshop items for. + * @returns {Promise} - A Promise that resolves to an array of downloaded workshop items for the specified application. + */ + GetDownloadedWorkshopItems(appId: number): Promise; + + GetDurationControlInfo(appId: number): Promise; // {"bApplicable": true} - overlay usage? + + /** + * Retrieves achievement information for a specific application for a given friend. + * @param {string} appId - The ID of the application to retrieve achievement information for. + * @param {string} friendSteam64Id - The Steam64 ID of the friend for whom to retrieve achievement information. + * @returns {Promise} - A Promise that resolves to an object containing achievement information for the specified friend and application. + */ + GetFriendAchievementsForApp(appId: string, friendSteam64Id: string): Promise; + + /** + * Retrieves a list of friends who play the specified application. + * @param {number} appId - The ID of the application. + * @returns {Promise} A Promise that resolves to an array of Steam64 IDs representing friends who play the application. + */ + GetFriendsWhoPlay(appId: number): Promise; + + GetGameActionDetails(appId: number, callback: (gameAction: GameAction) => void): void; + + GetGameActionForApp( + appId: string, + callback: ( + param0: number /*flag check? for validity*/, + appId: number | string, + param2: string /* "LaunchApp", need to look for more to document*/, + ) => void, + ): void; + + /** + * Retrieves launch options for a specified application. + * These options may include different configurations or settings for launching the application, such as DirectX, Vulkan, OpenGL, 32-bit, 64-bit, etc. + * This function does not retrieve launch/argument options inputted by the user. + * @param {number} appId - The ID of the application. + * @returns {Promise} - A Promise that resolves to an array of launch options for the specified application. + */ + GetLaunchOptionsForApp(appId: number): Promise; + + /** + * @todo Returns an empty ArrayBuffer? + */ + GetLibraryBootstrapData(): Promise; // CLibraryBootstrapData - binary deserializer??? + + /** + * Retrieves achievement information for the authenticated user in a specific Steam application. + * @param {string} appId - The ID of the application to retrieve achievement information for. + * @returns {Promise} A Promise that resolves to an AppAchievementResponse object containing the achievement information for the authenticated user in the specified application. + */ + GetMyAchievementsForApp(appId: string): Promise; + + /** + * Retrieves the playtime information for a specific application. + * @param {number} appId - The ID of the application to get playtime information for. + * @returns {Promise} A Promise that resolves to playtime information or undefined if not available. + */ + GetPlaytime(appId: number): Promise; + + GetPrePurchasedApps(appIds: number[]): Promise; + + /** + * Retrieves the resolution override for a specific application. + * @param {number} appId - The ID of the application to retrieve the resolution override for. + * @returns {Promise} A Promise that resolves to a string of the resolution override. + */ + GetResolutionOverrideForApp(appId: number): Promise; + + /** + * Represents a function to retrieve detailed information about a specific screenshot. + * @param {string} appId - The ID of the application the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @returns {Promise} - A Promise that resolves to detailed information about the specified screenshot. + */ + GetScreenshotInfo(appId: string, hHandle: number): Promise; + + /** + * Represents a function to retrieve screenshots within a specified time range. + * @param {number} appId - The ID of the application. + * @param {number} start - The start of the time range as a Unix timestamp. + * @param {number} end - The end of the time range as a Unix timestamp. + * @returns {Promise} - A Promise that resolves to an array of screenshots taken within the specified time range. + */ + GetScreenshotsInTimeRange(appId: number, start: number, end: number): Promise; + + /** + * Represents a function to retrieve shortcut data for a list of non-Steam app IDs. + * @param {number[]} appIds - An array of non-Steam application IDs. + * @returns {Promise} - A Promise that resolves to an array of Shortcut objects for the specified non-Steam app IDs. + */ + GetShortcutData(appIds: number[]): Promise; + + /** + * Retrieves shortcut data for a given shortcut file path. + * @param {string} pathToShortcut The path to the shortcut file. + * @returns {Promise} A Promise that resolves to the shortcut data. + */ + GetShortcutDataForPath(pathToShortcut: string): Promise; + + /** + * Represents a function to retrieve details about a soundtrack associated with a soundtrack application. + * The soundtrack has to be installed. + * @param {number} appId - The ID of the soundtrack application. + * @returns {Promise} - A Promise that resolves to the details of the soundtrack associated with the specified soundtrack application. + */ + GetSoundtrackDetails(appId: number): Promise; + + // [...appStore.m_mapStoreTagLocalization.keys()] + GetStoreTagLocalization(tags: number[]): Promise; + + /** + * Retrieves a list of subscribed workshop items for a specific application. + * @param {number} appId - The ID of the application to retrieve subscribed workshop items for. + * @returns {Promise} - A Promise that resolves to an array of subscribed workshop items for the specified application. + */ + GetSubscribedWorkshopItems(appId: number): Promise; + + InstallFlatpakAppAndCreateShortcut(appName: string, appCommandLineOptions: string): Promise; // returns {"appid":0,"strInstallOutput":""} + JoinAppContentBeta(appId: number, param1: any): any; + JoinAppContentBetaByPassword(appId: number, param1: any): any; + + ListFlatpakApps(): Promise; + + LoadEula(appId: number): Promise; // Doesn't bring up the EULA dialog, just returns the eula data + MarkEulaAccepted: any; + MarkEulaRejected: any; + + /** + * Opens the settings dialog for a specific application. + * @param {number} appId - The ID of the application for which to open the settings dialog. + * @param {string} section - The section (tab) to switch to. + * @returns {void} + */ + OpenAppSettingsDialog(appId: number, section: string): void; + + PromptToChangeShortcut(): Promise; // todo: unknown, prompts file picker + + /** + * Raises the window for a given application. + * @param {string} appId - The ID of the application to raise the window of. + * @returns {Promise} - A Promise that resolves to a number. + * @todo Returns a result enum? 1 if ok, 2 if not running + */ + RaiseWindowForGame(appId: number): Promise; // ResumeGameInProgress + + /** + * Registers a callback function to be called when achievement changes occur. + * @param callback The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAchievementChanges(callback: () => void): Unregisterable | any; + + RegisterForAppBackupStatus(callback: (appBackupStatus: AppBackupStatus) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when app details change. + * @param appId The ID of the application to monitor. + * @param callback The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; + + /** + * @todo Calls the callback on launching a game + * @todo Doesn't return anything? + */ + RegisterForAppOverviewChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; // CAppOverview_Change - binary deserializer??? + + RegisterForDRMFailureResponse( + callback: (appid: number, eResult: number, errorCode: number) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a game action ends. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionEnd(callback: (gameActionIdentifier: number) => void): Unregisterable | any; + + RegisterForGameActionShowError: Unregisterable | any; + + /** + * Registers a callback function to be called when a game action UI is shown. + * @param callback The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; // todo: no idea what this callback is from + + /** + * Registers a callback function to be called when a game action starts. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionStart( + callback: (gameActionIdentifier: number, appId: string, action: string, param3: number) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a game action task changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionTaskChange( + callback: ( + gameActionIdentifier: number, + appId: string, + action: string, + requestedAction: string, + param4: string, + ) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a user requests a game action. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionUserRequest( + callback: ( + gameActionIdentifier: number, + appId: string, + action: string, + requestedAction: string, + appId2: string, + ) => void, + ): Unregisterable | any; + + RegisterForLocalizationChanges(callback: (param0: ArrayBuffer) => void): Unregisterable | any; + + RegisterForPrePurchasedAppChanges(callback: () => void): Unregisterable | any; // Unknown, did have it show up a few times, but not callback parameters + RegisterForShowMarketingMessageDialog: Unregisterable | any; + + /** + * Registers a callback function to be notified when workshop items are added or removed from a Steam application. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForWorkshopChanges(callback: (appId: number) => void): Unregisterable | any; + + RegisterForWorkshopItemDownloads( + appId: number, + callback: (appId: number, publishedFileId: string, param2: number) => void, + ): Unregisterable | any; + + /** + * Removes a non-Steam application shortcut from the Steam library. + * @param {number} appId - The ID of the application for which to remove the shortcut. + * @returns {void} + */ + RemoveShortcut(appId: number): void; + + /** + * Removes a user tag from multiple Steam applications. + * @param {number[]} appIds - An array of application IDs from which the user tag should be removed. + * @param {string} userTag - The user tag to be removed. + * @returns {void} + * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. + */ + RemoveUserTagFromApps(appIds: number[], userTag: string): void; + + ReportLibraryAssetCacheMiss(appId: number, assetType: AppArtworkAssetType): void; + ReportMarketingMessageDialogShown(): void; + RequestIconDataForApp(appId: number): any; + RequestLegacyCDKeysForApp(appId: number): any; + + // collectionStore.GetCollection('hidden').allApps.map(e => e.appid) + // May be broken? + ResetHiddenState(appIds: number[]): Promise; + + /** + * Runs a game with specified parameters. + * @param {string} appId - The ID of the application to run. + * @param {string} launchOptions - Additional launch options for the application. + * @param {number} param2 - Additional parameter (exact usage may vary). + * @param {AppLaunchSource} launchSource + * @remarks `launchOptions` is appended before the ones specified in the application's settings. + * @returns {void} + */ + RunGame(appId: string, launchOptions: string, param2: number, param3: AppLaunchSource): void; + + /* + function u(e, t) { + return t instanceof Map || t instanceof Set ? Array.from(t) : t; + } + SteamClient.Apps.SaveAchievementProgressCache( + JSON.stringify(this.m_achievementProgress, u) + ); + */ + SaveAchievementProgressCache(progress: string): any; + + /** + * Scans the system for installed non-Steam applications. + * @returns {Promise} A Promise that resolves to an array of NonSteamApp objects representing installed non-Steam applications. + * @remarks This function scans the user's system for installed applications that are not part of the Steam library. It does not scan for shortcuts added to the Steam library. + * + * On Linux, it scans inside /usr/share/applications and $XDG_DATA_HOME/applications. + */ + ScanForInstalledNonSteamApps(): Promise; + + /** + * Sets the automatic update behavior for a Steam application. + * @param {number} appId - The ID of the application to set the update behavior for. + * @param {AutoUpdateBehavior} mode - The update behavior mode to set. + * @returns {void} + * @remarks This function only works with installed Steam applications. + */ + SetAppAutoUpdateBehavior(appId: number, mode: AutoUpdateBehavior): void; + + /** + * Sets the background downloads behavior for a specific Steam application. + * @param {number} appId - The ID of the application to set the background downloads behavior for. + * @param {BackgroundDownloadsBehavior} mode - The background downloads mode to set. + * @returns {void} + * @remarks This function only works with installed Steam applications. + */ + SetAppBackgroundDownloadsBehavior(appId: number, mode: BackgroundDownloadsBehavior): void; + + /** + * Sets the current language for a specific Steam application. + * @param {number} appId - The ID of the application to set the current language for. + * @param {string} language - The language to set, represented as a language (e.g., "english", "spanish", "tchinese", "schinese"). + * @returns {void} + */ + SetAppCurrentLanguage(appId: number, language: string): void; + + /** + * Sets the hidden status of a specific Steam application. + * @param {number} appId - The ID of the application to set the hidden status for. + * @param {boolean} value - The value indicating whether the application should be hidden (true) or not (false). + * @returns {void} + * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file to set the hidden status of the specified application. + */ + SetAppHidden(appId: number, value: boolean): void; + + /** + * Sets launch options for a Steam application. + * @param {number} appId - The ID of the application to set launch options for. + * @param {string} launchOptions - The launch options to be set for the application. + * @returns {void} + */ + SetAppLaunchOptions(appId: number, launchOptions: string): void; + + /** + * Sets a resolution override for a Steam application. + * @param {number} appId - The ID of the application to set the resolution override for. + * @param {string} resolution - The resolution to be set for the application. It can be "Default", "Native", or other compatible resolutions for the user's monitor. + * @returns {void} + */ + SetAppResolutionOverride(appId: number, resolution: string): any; + + SetCachedAppDetails(appId: number, details: string): any; + SetControllerRumblePreference(appId: number, param1: number): any; // param1 - enum for preference + + /** + * Sets the custom artwork for a given application. + * @param {number} appId - The ID of the application to set custom artwork for. + * @param {string} base64Image - Base64 encoded image. + * @param {string} imageType - "jpeg" or "png". + * @param {AppArtworkAssetType} assetType - The type of artwork to set. + * @returns {Promise} A Promise that resolves after the custom artwork is set. + */ + SetCustomArtworkForApp( + appId: number, + base64Image: string, + imageType: string, + assetType: AppArtworkAssetType, + ): Promise; + + SetCustomLogoPositionForApp(appId: number, details: string): Promise; // I've tried sending escaped LogoPosition JSON, but it doesn't seem to work + + SetDLCEnabled(appId: number, appDLCId: number, value: boolean): void; + + /** + * Set a local screenshot's caption. + * @param {string} appId - The application ID the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @param {string} caption + * @returns {void} + */ + SetLocalScreenshotCaption(appId: string, hHandle: any, caption: string): void; + + /** + * Set a local screenshot's privacy state. + * @param {string} appId - The application ID the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @param {FilePrivacyState} privacy - Screenshot privacy state. + */ + SetLocalScreenshotPrivacy(appId: string, hHandle: any, privacy: FilePrivacyState): void; + + /** + * Set a local screenshot's spoiler state. + * @param {string} appId - The application ID the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @param {boolean} spoilered - Is the screenshot spoilered? + */ + SetLocalScreenshotSpoiler(appId: string, hHandle: any, spoilered: boolean): void; + + /** + * Sets the icon for a non-Steam application shortcut. + * @param {string} appId - The ID of the application to set the shortcut icon for. + * @param {string} iconPath - The path to the icon image (can be png or tga format). + * @returns {void} + */ + SetShortcutIcon(appId: number, iconPath: string): void; + + /** + * Sets whether a non-Steam application shortcut should be included in the VR library. + * @param {number} appId The ID of the application to set the VR status for. + * @param {boolean} value A boolean indicating whether the application should be included in the VR library. + * @returns {void} + */ + SetShortcutIsVR(appId: number, value: boolean): void; + + /** + * Sets launch options for a non-Steam application shortcut. + * @param {number} appId - The ID of the application to set the launch options for. + * @param {string} launchOptions - The launch options to be used when starting the application. + * @returns {void} + */ + SetShortcutLaunchOptions(appId: number, launchOptions: string): void; + + /** + * Sets the name for a non-Steam application shortcut. + * @param {number} appId - The ID of the application to set the shortcut name for. + * @param {string} shortcutName - The name to be displayed for the application shortcut. + * @returns {void} + */ + SetShortcutName(appId: number, shortcutName: string): void; + + /** + * Sets the starting directory for a non-Steam application shortcut. + * @param {number} appId - The ID of the application to set the starting directory for. + * @param {string} directory - The directory from which the application should be launched. + * @returns {void} + */ + SetShortcutStartDir(appId: number, directory: string): void; + + /** + * Sets the client ID for streaming for a specific application. + * @param {number} appId - The ID of the application. + * @param {string} clientId - The client ID for streaming. + */ + SetStreamingClientForApp(appId: number, clientId: string): void; + + SetThirdPartyControllerConfiguration: any; + + /** + * Opens the controller configurator for a specific application. + * @param {number} appId - The ID of the application for which to open the controller configurator. + * @returns {void} + */ + ShowControllerConfigurator(appId: number): void; + + /** + * Opens the Steam store page for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + */ + ShowStore(appId: number): void; + + /** + * Specifies a compatibility tool by its name for a given application. If strToolName is an empty string, the specified application will no longer use a compatibility tool. + * @param {number} appId - The ID of the application to specify compatibility tool for. + * @param {string} strToolName - The name of the compatibility tool to specify. + * @returns {void} + */ + SpecifyCompatTool(appId: number, strToolName: string): void; + + StreamGame(appId: number, clientId: string, param2: number): void; + + /** + * Subscribes or unsubscribes from a workshop item for a specific app. + * @param {number} appId - The ID of the application. + * @param {string} workshopId - The ID of the workshop item. + * @param {boolean} subscribed - True to subscribe, false to unsubscribe. + * @returns {void} + */ + SubscribeWorkshopItem(appId: number, workshopId: string, subscribed: boolean): void; + + /** + * Terminates a running application. + * @param {string} appId - The ID of the application to terminate. + * @param {boolean} param1 - Additional parameter. Exact usage may vary. + * @returns {void} + */ + TerminateApp(appId: string, param1: boolean): void; + + // "#AppProperties_SteamInputDesktopConfigInLauncher" + ToggleAllowDesktopConfiguration(appId: number): any; + + ToggleAppFamilyBlockedState(appId: number): any; + + /** + * Toggles the Steam Cloud synchronization for game saves for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + * @remarks This function modifies the "/userdata//7/remote/sharedconfig.vdf" file. + */ + ToggleAppSteamCloudEnabled(appId: number): void; + + // "#AppProperties_EnableSteamCloudSyncOnSuspend" + ToggleAppSteamCloudSyncOnSuspendEnabled(appId: number): any; + + /** + * Toggles the Steam Overlay setting for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + */ + ToggleEnableSteamOverlayForApp(appId: number): void; + + // "#AppProperties_ResolutionOverride_Internal" + ToggleOverrideResolutionForInternalDisplay(appId: number): any; + + UninstallFlatpakApp(app: string): Promise; + + /** + * Verifies the integrity of an app's files. + * @param {number} appId - The ID of the app to verify. + */ + VerifyApp(appId: number): Promise; // todo: returns {"nGameActionID":9} } export interface Auth { - GetLocalHostname(): Promise; + GetLocalHostname(): Promise; - GetMachineID(): Promise; + GetMachineID(): Promise; - GetRefreshInfo(): Promise; + GetRefreshInfo(): Promise; - GetSteamGuardData: any; + GetSteamGuardData: any; - IsSecureComputer(): Promise; + IsSecureComputer(): Promise; - SetLoginToken: any; - SetSteamGuardData: any; - StartSignInFromCache(param0: any, login: string): Promise; + SetLoginToken(refreshToken: string, accountName: string): any; + SetSteamGuardData(accountName: string, newGuardData: string): any; + StartSignInFromCache(param0: any, login: string): Promise; } // Broadcasting support hasn't been implemented on Linux yet export interface Broadcast { - /** - * Approves a viewer request for the broadcast. - * @param {string} steamId64 - The SteamID64 of the user whose request is to be approved. - * @param {number} param1 - Unknown parameter. - */ - ApproveViewerRequest(steamId64: string, param1: number): void; + /** + * Approves a viewer request for the broadcast. + * @param {string} steamId64 - The SteamID64 of the user whose request is to be approved. + * @param {number} param1 - Unknown parameter. + */ + ApproveViewerRequest(steamId64: string, param1: number): void; + + /** + * Invites a user identified by their SteamID64 to watch the broadcast. + * @param {string} steamId64 - The SteamID64 of the user to invite. + * @returns {Promise} - A Promise indicating the result of the invitation (1 for success, 2 for error). + */ + InviteToWatch(steamId64: string): Promise; + + /** + * Registers a callback to be called when the broadcast status changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForBroadcastStatus(callback: (broadcastStatus: BroadcastStatus) => void): Unregisterable | any; + + /** + * Registers a callback to be called when viewer requests are received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForViewerRequests( + callback: (viewerFriendCode: number, param1: number, param2: number) => void, + ): Unregisterable | any; + + /** + * Rejects a viewer request for the broadcast. + * @param {string} steamId64 - The SteamID64 of the user whose request is to be rejected. + * @param {number} param1 - Unknown parameter. + */ + RejectViewerRequest(steamId64: string, param1: number): void; + + /** + * Stops the broadcast. + * @returns {void} + */ + StopBroadcasting(): void; +} - /** - * Invites a user identified by their SteamID64 to watch the broadcast. - * @param {string} steamId64 - The SteamID64 of the user to invite. - * @returns {Promise} - A Promise indicating the result of the invitation (1 for success, 2 for error). - */ - InviteToWatch(steamId64: string): Promise; +export interface Browser { + BIsDirectHWNDBrowser: any; + BIsPopupWindow: any; + BIsVROverlayBrowser: any; + ClearAllBrowsingData(): void; + ClearHistory(): void; - /** - * Registers a callback to be called when the broadcast status changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForBroadcastStatus(callback: (broadcastStatus: BroadcastStatus) => void): Unregisterable | any; + CloseDevTools(): void; - /** - * Registers a callback to be called when viewer requests are received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForViewerRequests(callback: (viewerFriendCode: number, param1: number, param2: number) => void): Unregisterable | any; + GetBrowserID(): Promise; - /** - * Rejects a viewer request for the broadcast. - * @param {string} steamId64 - The SteamID64 of the user whose request is to be rejected. - * @param {number} param1 - Unknown parameter. - */ - RejectViewerRequest(steamId64: string, param1: number): void; + GetSteamBrowserID(): Promise; // 16-bit unsigned integer? - /** - * Stops the broadcast. - * @returns {void} - */ - StopBroadcasting(): void; -} + /** + * Hides the mouse cursor until input. + * @returns {void} + */ + HideCursorUntilMouseEvent(): void; -export interface Browser { - BIsDirectHWNDBrowser: any; - BIsPopupWindow: any; - BIsVROverlayBrowser: any; - ClearAllBrowsingData: any; - ClearHistory: any; + InspectElement(clientY: number, clientX: number): void; // yup that's right, clientY and clientX are reversed - CloseDevTools(): void; + NotifyUserActivation(): void; - GetBrowserID(): Promise; + OpenDevTools(): void; - GetSteamBrowserID(): Promise; // 16-bit unsigned integer? - HideCursorUntilMouseEvent(): any; + /** + * @todo unconfirmed + */ + RegisterForGestureEvents(callback: (gesture: TouchGesture) => void): Unregisterable | any; + RegisterForOpenNewTab: Unregisterable | any; + SetShouldExitSteamOnBrowserClosed(value: boolean): any; + SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; - InspectElement(clientY: any, clientX: any): any; // yup that's right, clientY and clientX are reversed + /** + * Prompts and downloads a file. + * @param {string} url - The URL of the file to download. + * @returns {void} + */ + StartDownload(url: string): void; +} - NotifyUserActivation: any; +export interface BrowserView { + Create(browser: BrowserViewInit | undefined): BrowserViewPopup; - OpenDevTools(): void; + CreatePopup(browser: BrowserViewInit | undefined): { + strCreateURL: string; + browserView: BrowserViewPopup; + }; - RegisterForGestureEvents: Unregisterable | any; - RegisterForOpenNewTab: Unregisterable | any; - SetShouldExitSteamOnBrowserClosed: any; - SetTouchGesturesToCancel: any; - StartDownload: any; -} + Destroy(browser: BrowserViewInit): void; -export interface BrowserView { - /* - param0 - { - parentPopupBrowserID: e.SteamClient.Browser.GetBrowserID(), - strUserAgentIdentifier: i, - strVROverlayKey: a, - strInitialURL: r, - bOnlyAllowTrustedPopups: o - } - */ - Create(param0: any): any; - CreatePopup: any; - Destroy(param0: any): any; - PostMessageToParent: any; + PostMessageToParent(message: string, args: string): void; } export interface ClientNotifications { - DisplayClientNotification: any; - OnRespondToClientNotification: any; + /** + * Displays a Steam notification. + * @param {ClientUINotification} notification - Notification type. + * @param {string} options - Stringified object of `NotificationOptions`. + * @param {function} callback + */ + DisplayClientNotification(notification: ClientUINotification, options: string, callback: any): void; + + OnRespondToClientNotification: any; } export interface Cloud { - ResolveAppSyncConflict: any; - RetryAppSync: any; + ResolveAppSyncConflict(appId: number, keepLocal: boolean): any; + RetryAppSync(appId: number): any; } export interface CommunityItems { - DownloadItemAsset: any; - GetItemAssetPath: any; - RemoveDownloadedItemAsset: any; + DownloadItemAsset(communityItemId: string, param1: any, param2: string): any; + GetItemAssetPath(communityItemId: string, param1: any, param2: string): any; + RemoveDownloadedItemAsset(communityItemId: string, param1: any, param2: string): any; } /** * Represents the console functionality for executing commands and handling spew output. */ export interface Console { - /** - * Executes a console command. - * @param {string} command - The command to execute in the console. - * @returns {void} - */ - ExecCommand(command: string): void; - - /** - * Retrieves autocomplete suggestions for a given console command. - * @param {string} command - The console command to provide autocomplete suggestions for. - * @returns {Promise} - A Promise that resolves to an array of autocomplete suggestions. - */ - GetAutocompleteSuggestions(command: string): Promise; - - /** - * Registers a callback function to receive spew output. - * @param {function} callback - The callback function that will receive spew output. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForSpewOutput(callback: (spewOutput: SpewOutput) => void): Unregisterable | any; + /** + * Executes a console command. + * @param {string} command - The command to execute in the console. + * @returns {void} + */ + ExecCommand(command: string): void; + + /** + * Retrieves autocomplete suggestions for a given console command. + * @param {string} command - The console command to provide autocomplete suggestions for. + * @returns {Promise} - A Promise that resolves to an array of autocomplete suggestions. + */ + GetAutocompleteSuggestions(command: string): Promise; + + /** + * Registers a callback function to receive spew output. + * @param {function} callback - The callback function that will receive spew output. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForSpewOutput(callback: (spewOutput: SpewOutput) => void): Unregisterable | any; } export interface Customization { - GenerateLocalStartupMoviesThumbnails: any; - GetDownloadedStartupMovies(param0: any): Promise; - GetLocalStartupMovies(): Promise; + GenerateLocalStartupMoviesThumbnails(param0: number): Promise; + GetDownloadedStartupMovies(param0: string): Promise; + GetLocalStartupMovies(): Promise; } /** * Represents functions related to managing downloads in Steam. */ export interface Downloads { - /** - * Enables or disables all downloads in Steam. - * @param {boolean} enable - True to enable downloads, false to disable. - */ - EnableAllDownloads(enable: boolean): void; - - /** - * Moves the update for a specific app down the download queue. - * @param {number} appId - The ID of the application to move. - * @returns {void} - */ - MoveAppUpdateDown(appId: number): void; - - /** - * Moves the update for a specific app up the download queue. - * @param {number} appId - The ID of the application to move. - * @returns {void} - */ - MoveAppUpdateUp(appId: number): void; - - PauseAppUpdate(appId: number): void; // Broken? It seems to be removing it from download list like RemoveFromDownloadList - - /** - * Adds the update for a specific app to the download queue. - * @param {number} appId - The ID of the application to queue. - * @returns {void} - */ - QueueAppUpdate(appId: number): void; - - /** - * Registers a callback function to be called when download items change. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDownloadItems(callback: (isDownloading: boolean, downloadItems: DownloadItem[]) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when download overview changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDownloadOverview(callback: (downloadOverview: DownloadOverview) => void): Unregisterable | any; - - /** - * Removes the update for a specific app from the download list and places it in the unscheduled list. - * @param {number} appId - The ID of the application to remove. - * @returns {void} - */ - RemoveFromDownloadList(appId: number): void; - - /** - * Resumes the update for a specific app in the queue. - * @param {number} appId - The ID of the application to resume. - * @returns {void} - */ - ResumeAppUpdate(appId: number): void; - - /** - * Sets an app to launch when its download is complete. - * @param {number} appId - The ID of the application to set. - * @returns {void} - * @todo: unsure if this toggles though - */ - SetLaunchOnUpdateComplete(appId: number): void; - - /** - * Sets the queue index for an app in the download queue. - * @param {number} appId - The ID of the application to set the index for. - * @param {number} index - The index to set. - * @returns {void} - * @remarks Index of 0 is the current download in progress. - */ - SetQueueIndex(appId: number, index: number): void; - - /** - * Suspends or resumes download throttling. - * @param {boolean} suspend - Whether to suspend or resume download throttling. - * @returns {void} - */ - SuspendDownloadThrottling(suspend: boolean): void; - - /** - * Suspends or resumes local transfers. - * @param {boolean} suspend - Whether to suspend or resume local transfers. - * @returns {void} - */ - SuspendLanPeerContent(suspend: boolean): void; + /** + * Enables or disables all downloads in Steam. + * @param {boolean} enable - True to enable downloads, false to disable. + */ + EnableAllDownloads(enable: boolean): void; + + /** + * Moves the update for a specific app down the download queue. + * @param {number} appId - The ID of the application to move. + * @returns {void} + */ + MoveAppUpdateDown(appId: number): void; + + /** + * Moves the update for a specific app up the download queue. + * @param {number} appId - The ID of the application to move. + * @returns {void} + */ + MoveAppUpdateUp(appId: number): void; + + PauseAppUpdate(appId: number): void; // Broken? It seems to be removing it from download list like RemoveFromDownloadList + + /** + * Adds the update for a specific app to the download queue. + * @param {number} appId - The ID of the application to queue. + * @returns {void} + */ + QueueAppUpdate(appId: number): void; + + /** + * Registers a callback function to be called when download items change. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDownloadItems( + callback: (isDownloading: boolean, downloadItems: DownloadItem[]) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when download overview changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDownloadOverview(callback: (downloadOverview: DownloadOverview) => void): Unregisterable | any; + + /** + * Removes the update for a specific app from the download list and places it in the unscheduled list. + * @param {number} appId - The ID of the application to remove. + * @returns {void} + */ + RemoveFromDownloadList(appId: number): void; + + /** + * Resumes the update for a specific app in the queue. + * @param {number} appId - The ID of the application to resume. + * @returns {void} + */ + ResumeAppUpdate(appId: number): void; + + /** + * Sets an app to launch when its download is complete. + * @param {number} appId - The ID of the application to set. + * @returns {void} + * @todo: unsure if this toggles though + */ + SetLaunchOnUpdateComplete(appId: number): void; + + /** + * Sets the queue index for an app in the download queue. + * @param {number} appId - The ID of the application to set the index for. + * @param {number} index - The index to set. + * @returns {void} + * @remarks Index of 0 is the current download in progress. + */ + SetQueueIndex(appId: number, index: number): void; + + /** + * Suspends or resumes download throttling. + * @param {boolean} suspend - Whether to suspend or resume download throttling. + * @returns {void} + */ + SuspendDownloadThrottling(suspend: boolean): void; + + /** + * Suspends or resumes local transfers. + * @param {boolean} suspend - Whether to suspend or resume local transfers. + * @returns {void} + */ + SuspendLanPeerContent(suspend: boolean): void; } /** * Represents functions related to Steam Family Sharing. */ export interface FamilySharing { - /** - * Authorizes library sharing on the local device. - * @returns {Promise} A Promise that resolves to a status code. - */ - AuthorizeLocalDevice(): Promise; + /** + * Authorizes library sharing on the local device. + * @returns {Promise} A Promise that resolves to a status code. + */ + AuthorizeLocalDevice(): Promise; - /** - * Deauthorizes library sharing on the local device. - * @returns {Promise} A Promise that resolves to a status code. - */ - DeauthorizeLocalDevice(): Promise; + /** + * Deauthorizes library sharing on the local device. + * @returns {Promise} A Promise that resolves to a status code. + */ + DeauthorizeLocalDevice(): Promise; + + RegisterForKickedBorrower: any; - RegisterForKickedBorrower: any; + RequestLocalDeviceAuthorization(steam64Id: string): Promise; - RequestLocalDeviceAuthorization(param0: string): Promise; // Unknown param0, my assumption is probably a steam64Id of the user sharing the library - UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise; // Unknown + // param0 - account id? + UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise; } export interface Features { - SteamInitsPopups(): boolean; + SteamInitsPopups(): boolean; } /** * Represents friend settings and configuration. */ export interface FriendSettings { - /** - * Retrieves a list of enabled friend settings features. - * @returns {Promise} - A Promise that resolves to an array of enabled friend settings features. - */ - GetEnabledFeatures(): Promise; + /** + * Retrieves a list of enabled friend settings features. + * @returns {Promise} - A Promise that resolves to an array of enabled friend settings features. + */ + GetEnabledFeatures(): Promise; - /** - * Registers a callback function to be notified of friend settings changes. - * @param callback - The callback function to be called when friend settings change. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @todo The callback receives an escaped JSON object string as "settingsChanges", which should be parsed into FriendSettingsChange object. - */ - RegisterForSettingsChanges(callback: (settingsChanges: string) => void): Unregisterable | any; + /** + * Registers a callback function to be notified of friend settings changes. + * @param callback - The callback function to be called when friend settings change. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @todo The callback receives an escaped JSON object string as "settingsChanges", which should be parsed into FriendSettingsChange object. + */ + RegisterForSettingsChanges(callback: (settingsChanges: string) => void): Unregisterable | any; - SetFriendSettings: any; + SetFriendSettings(details: string): any; // stringified object } /** * Represents functions related to managing friends in Steam. */ export interface Friends { - /** - * Adds a user to the friend list. - * @param {string} steamId - The Steam ID of the user to add as a friend. - * @returns {Promise} A Promise that resolves to true if the friend was added successfully, false otherwise. - */ - AddFriend(steamId: string): Promise; - - GetCoplayData(): Promise; // {"recentUsers":[], "currentUsers":[]} - InviteUserToCurrentGame: any; - - /** - * Invites a user to a specific game. - * @param {string} steamId - The Steam ID of the user to invite. - * @param {number} appId - The ID of the game to invite the user to. - * @param {string} param2 - Additional parameters for the invitation. - * @returns {Promise} A Promise that resolves to true if the user was invited successfully, false otherwise. - */ - InviteUserToGame(steamId: string, appId: number, param2: string): Promise; - InviteUserToLobby: any; - InviteUserToRemotePlayTogetherCurrentGame: any; - RegisterForVoiceChatStatus: any; - - /** - * Removes a user from the friend list. - * @param {string} steamId - The Steam ID of the user to remove from the friend list. - * @returns {Promise} A Promise that resolves to true if the friend was removed successfully, false otherwise. - */ - RemoveFriend(steamId: string): Promise; + /** + * Adds a user to the friend list. + * @param {string} steamId - The Steam ID of the user to add as a friend. + * @returns {Promise} A Promise that resolves to true if the friend was added successfully, false otherwise. + */ + AddFriend(steamId: string): Promise; + + GetCoplayData(): Promise; // {"recentUsers":[], "currentUsers":[]} + InviteUserToCurrentGame: any; + + /** + * Invites a user to a specific game. + * @param {string} steamId - The Steam ID of the user to invite. + * @param {number} appId - The ID of the game to invite the user to. + * @param {string} connectString - Additional parameters for the invitation. + * @returns {Promise} A Promise that resolves to true if the user was invited successfully, false otherwise. + */ + InviteUserToGame(steamId: string, appId: number, connectString: string): Promise; + InviteUserToLobby: any; + InviteUserToRemotePlayTogetherCurrentGame: any; + RegisterForVoiceChatStatus: any; + + /** + * Removes a user from the friend list. + * @param {string} steamId - The Steam ID of the user to remove from the friend list. + * @returns {Promise} A Promise that resolves to true if the friend was removed successfully, false otherwise. + */ + RemoveFriend(steamId: string): Promise; } export interface GameNotes { - DeleteImage(param0: any): any; - DeleteNotes: any; - /* + DeleteImage(param0: any): any; + DeleteNotes: any; + /* FilenameForNotes(e) { return "appid" in e ? `notes_${Number(e.appid)}` : `notes_shortcut_${h(e.shortcut)}` } @@ -928,2493 +1055,3244 @@ export interface GameNotes { return "appid" in e ? `notes_${Number(e.appid)}_images/` : `notes_shortcut_${h(e.shortcut)}_images/` } */ - // {"result":1,"notes":""} - // example: {"notes":[{"id":"lmuudzqn","appid":1716740,"ordinal":0,"time_created":1695401684,"time_modified":1695403395,"title":"Old Earth Cuisine 1:","content":"[h1]Old Earth Cuisine 1:[/h1][list][*][p]Red Meat[/p][/*][/list][h1]Beverage Development 2:[/h1][list][*][p]Tranquilitea Sunray[/p][/*][/list][p][/p]"}]} - GetNotes(filenameForNotes: string, directoryForNoteImages: string): Promise; - GetNotesMetadata: any; - GetNumNotes: any; - GetQuota: any; + // {"result":1,"notes":""} + // example: {"notes":[{"id":"lmuudzqn","appid":1716740,"ordinal":0,"time_created":1695401684,"time_modified":1695403395,"title":"Old Earth Cuisine 1:","content":"[h1]Old Earth Cuisine 1:[/h1][list][*][p]Red Meat[/p][/*][/list][h1]Beverage Development 2:[/h1][list][*][p]Tranquilitea Sunray[/p][/*][/list][p][/p]"}]} + GetNotes(filenameForNotes: string, directoryForNoteImages: string): Promise; + GetNotesMetadata: any; + GetNumNotes: any; + GetQuota: any; - IterateNotes(appId: number, length: number): any; // Results array of {"result":1,"filename":"","filesize":0,"timestamp":0} - ResolveSyncConflicts: any; - SaveNotes(filenameForNotes: string, param1: string): Promise; // param1 - notes like escaped json in GetNotes - SyncToClient(): Promise; - SyncToServer(): Promise; - UploadImage: any; + IterateNotes(appId: number, length: number): any; // Results array of {"result":1,"filename":"","filesize":0,"timestamp":0} + ResolveSyncConflicts: any; + SaveNotes(filenameForNotes: string, param1: string): Promise; // param1 - notes like escaped json in GetNotes + SyncToClient(): Promise; + SyncToServer(): Promise; + UploadImage: any; } /** * Represents functions related to Steam Game Sessions. */ export interface GameSessions { - /** - * Registers a callback function to be called when an achievement notification is received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAchievementNotification(callback: (achievementNotification: AchievementNotification) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when an app lifetime notification is received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppLifetimeNotifications(callback: (appLifetimeNotification: AppLifetimeNotification) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when a screenshot notification is received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForScreenshotNotification(callback: (screenshotNotification: ScreenshotNotification) => void): Unregisterable | any; + /** + * Registers a callback function to be called when an achievement notification is received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAchievementNotification( + callback: (achievementNotification: AchievementNotification) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when an app lifetime notification is received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppLifetimeNotifications( + callback: (appLifetimeNotification: AppLifetimeNotification) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a screenshot notification is received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForScreenshotNotification( + callback: (screenshotNotification: ScreenshotNotification) => void, + ): Unregisterable | any; } /** * Represents functions related to input and controllers in Steam. */ export interface Input { - /** - * Checks if the specified controller is a Steam Controller. - * @param {function} callback - The callback function to receive the result. - */ - BIsSteamController(callback: (steamController: boolean) => void): void; - - /** - * Checks if the specified controller supports LED color. - * @param {function} callback - The callback function to receive the result. - */ - BSupportsControllerLEDColor(callback: (supportControllerLEDColor: boolean) => void): void; - - CalibrateControllerIMU(param0: any): any; // param0 - m_controllerStateDeviceIdx - CalibrateControllerJoystick(param0: any): any; // param0 - m_controllerStateDeviceIdx - CalibrateControllerTrackpads(param0: any): any; // param0 - m_controllerStateDeviceIdx - CancelGyroSWCalibration: any; - ClearSelectedConfigForApp(param0: any, param1: any): any; // param0 - appid, param1 - controllerIndex - CloseDesktopConfigurator: any; - ControllerKeyboardSendText(key: any): any; //??? - ControllerKeyboardSetKeyState(key: number, state: boolean): any; - DeauthorizeControllerAccount: any; - DecrementCloudedControllerConfigsCounter: any; - DeletePersonalControllerConfiguration: any; - DuplicateControllerConfigurationSourceMode: any; - EndControllerDeviceSupportFlow(): any; - ExportCurrentControllerConfiguration: any; - ForceConfiguratorFocus: any; - ForceSimpleHapticEvent: any; - FreeControllerConfig: any; - - GetConfigForAppAndController(appId: number, unControllerIndex: number): any; - - /** - * Retrieves the controller mapping string for the specified controller index. - * @param {number} unControllerIndex - The controller index. - * @returns {Promise} - A Promise that resolves to the controller mapping string. - */ - GetControllerMappingString(unControllerIndex: number): Promise; - - GetControllerPreviouslySeen: any; - - GetSteamControllerDongleState(): Promise; - GetTouchMenuIconsForApp(param0: any): Promise;// param0 - app? - GetXboxDriverInstallState(): Promise; - IdentifyController: any; - InitControllerSounds: any; - InitializeControllerPersonalizationSettings: any; - ModalKeyboardDismissed(): void; - OpenDesktopConfigurator: any; - PreviewConfiguForAppAndController: any; - PreviewControllerLEDColor(flHue: number, flSaturation: number, flBrightness: number): any; - QueryControllerConfigsForApp: any; - RegisterForActiveControllerChanges: Unregisterable | any; // {"nActiveController":0} - RegisterForConfigSelectionChanges(callback: (param0: number, param1: number) => void): Unregisterable | any; - - RegisterForControllerAccountChanges: Unregisterable | any; - - RegisterForControllerAnalogInputMessages(callback: (controllerAnalogInputMessages: ControllerAnalogInputMessage[]) => void): Unregisterable | any; - - RegisterForControllerCommandMessages(callback: (controllerCommandMessage: ControllerCommandMessage) => void): Unregisterable | any; - - /** - * Registers a callback for changes in controller configuration cloud state. - * @param {(controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void} callback - The callback function for config cloud state changes. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForControllerConfigCloudStateChanges(callback: (controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void): Unregisterable | any; - - /** - * Registers a callback for receiving controller configuration info messages (controller layouts query, personal controller layout query). - * @param {(controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[]) => void} callback - The callback function for controller config info messages. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @remarks Do Not Use, this will break the controller layout selection unless you know what you are doing. - */ - RegisterForControllerConfigInfoMessages(callback: (controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[]) => void): Unregisterable | any; - - /** - * Registers a callback function to be invoked when controller input messages are received. - * @param {(controllerInputMessages: ControllerInputMessage[]) => void} callback - The callback function to be invoked when controller input messages are received. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForControllerInputMessages(callback: (controllerInputMessages: ControllerInputMessage[]) => void): Unregisterable | any; - - - RegisterForControllerListChanges(callback: (controllerListChanges: ControllerInfo[]) => void): Unregisterable | any; - - /** - * Registers a callback for changes in the controller state (buttons presses, triggers presses, joystick changes etc...). - * @param {(controllerStateChanges: ControllerStateChange[]) => void} callback - The callback function for controller state changes. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForControllerStateChanges(callback: (controllerStateChanges: ControllerStateChange[]) => void): Unregisterable | any; - - RegisterForDualSenseUpdateNotification: Unregisterable | any; - - /** - * Registers a callback for receiving game keyboard messages (text field popup for inputting text for games when in character creation or etc...). - * @param {(gameKeyboardMessage: GameKeyboardMessage) => void} callback - The callback function for game keyboard messages. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameKeyboardMessages(callback: (gameKeyboardMessage: GameKeyboardMessage) => void): Unregisterable | any; - - RegisterForRemotePlayConfigChanges: Unregisterable | any; - RegisterForShowControllerLayoutPreviewMessages: Unregisterable | any; - RegisterForTouchMenuInputMessages: Unregisterable | any; - - RegisterForTouchMenuMessages(callback: (touchMenuMessage: TouchMenuMessage) => void): Unregisterable | any; - - RegisterForUIVisualization: Unregisterable | any; - - RegisterForUnboundControllerListChanges(callback: (param0: any) => void): Unregisterable | any; // param0 is an array - RegisterForUserDismissKeyboardMessages: Unregisterable | any; - RegisterForUserKeyboardMessages: Unregisterable | any; - RequestGyroActive: any; - RequestRemotePlayControllerConfigs: any; - ResetControllerBindings(param0: any): any; - ResolveCloudedControllerConfigConflict: any; - RestoreControllerPersonalizationSettings: any; - SaveControllerCalibration: any; - SaveControllerPersonalizationSettings: any; - SaveControllerSounds: any; - SaveEditingControllerConfiguration: any; - SetActiveControllerAccount: any; - SetControllerConfigurationModeShiftBinding: any; - SetControllerHapticSetting: any; - SetControllerMappingString(mapping: string): void; - SetControllerName: any; - SetControllerNintendoLayoutSetting: any; - SetControllerPersonalizationName: any; - //param0 - nLStickDeadzone, bSWAntiDrift, nRHapticStrength, flRPadPressureCurve - SetControllerPersonalizationSetting(param0: string, param1: number): any; - //param0 - flGyroStationaryTolerance, flAccelerometerStationaryTolerance - SetControllerPersonalizationSettingFloat(param0: string, param1: number): any; - SetControllerRumbleSetting: any; - SetCursorActionset: any; - SetEditingControllerConfigurationActionSet: any; - SetEditingControllerConfigurationInputActivator: any; - SetEditingControllerConfigurationInputActivatorEnabled: any; - SetEditingControllerConfigurationInputBinding: any; - SetEditingControllerConfigurationMiscSetting: any; - SetEditingControllerConfigurationSourceMode: any; - SetGamepadKeyboardText(param0: boolean, param1: string): any; - SetKeyboardActionset(param0: boolean): any; - - SetMousePosition: any; - - SetSelectedConfigForApp: any; - SetSteamControllerDonglePairingMode: any; - SetVirtualMenuKeySelected(unControllerIndex: number, unMenuIndex: number, param2: number): any; // - SetWebBrowserActionset: any; - SetXboxDriverInstallState(param0: any): any; // state - - /** - * Opens the Steam Input controller settings. - * This function displays the Steam Input controller settings for configuration. - * @returns {void} - */ - ShowControllerSettings(): void; - - StandaloneKeyboardDismissed: any; - StartControllerDeviceSupportFlow(param0: any, param1: any, callback: (param2: any) => void): any; - StartEditingControllerConfigurationForAppIDAndControllerIndex: any; - StartGyroSWCalibration: any; - StopEditingControllerConfiguration: any; - SwapControllerModeInputBindings: any; - SwapControllerOrder: any; - SyncCloudedControllerConfigs: any; - TriggerHapticPulse: any; - TriggerSimpleHapticEvent: any; - UnregisterForControllerStateChanges(): void; - UnregisterForUIVisualization: any; - UploadChangesForCloudedControllerConfigs: any; + /** + * Checks if the specified controller is a Steam Controller. + * @param {function} callback - The callback function to receive the result. + */ + BIsSteamController(callback: (steamController: boolean) => void): void; + + /** + * Checks if the specified controller supports LED color. + * @param {function} callback - The callback function to receive the result. + */ + BSupportsControllerLEDColor(callback: (supportControllerLEDColor: boolean) => void): void; + + CalibrateControllerIMU(param0: any): any; // param0 - m_controllerStateDeviceIdx + CalibrateControllerJoystick(param0: any): any; // param0 - m_controllerStateDeviceIdx + CalibrateControllerTrackpads(param0: any): any; // param0 - m_controllerStateDeviceIdx + CancelGyroSWCalibration(): any; + ClearSelectedConfigForApp(appId: number, controllerIndex: number): any; + CloseDesktopConfigurator: any; + + /** + * Writes text. + * @param {string} textToWrite - The text to write. + * @returns {void} + */ + ControllerKeyboardSendText(textToWrite: string): void; + + /** + * Sets a specified key's pressed state. + * @param {number} keyIndex - The key index to set the state for. + * @param {boolean} state - true for pressed, false otherwise. + * @returns {void} + * @example + * Send paste command: + * ``` + * SteamClient.Input.ControllerKeyboardSetKeyState(103, true); + * SteamClient.Input.ControllerKeyboardSetKeyState(25, true); + * SteamClient.Input.ControllerKeyboardSetKeyState(25, false); + * SteamClient.Input.ControllerKeyboardSetKeyState(103, false); + * ``` + */ + ControllerKeyboardSetKeyState(keyIndex: number, state: boolean): void; + + DeauthorizeControllerAccount: any; + DecrementCloudedControllerConfigsCounter(): any; + DeletePersonalControllerConfiguration: any; + DuplicateControllerConfigurationSourceMode: any; + EndControllerDeviceSupportFlow(): any; + ExportCurrentControllerConfiguration: any; + ForceConfiguratorFocus: any; + ForceSimpleHapticEvent: any; + FreeControllerConfig: any; + + GetConfigForAppAndController(appId: number, unControllerIndex: number): any; + + /** + * Retrieves the controller mapping string for the specified controller index. + * @param {number} unControllerIndex - The controller index. + * @returns {Promise} - A Promise that resolves to the controller mapping string. + */ + GetControllerMappingString(unControllerIndex: number): Promise; + + GetControllerPreviouslySeen: any; + + GetSteamControllerDongleState(): Promise; + GetTouchMenuIconsForApp(appId: number): Promise; + GetXboxDriverInstallState(): Promise; // "{"nResult":0}" + IdentifyController(controllerIndex: number): any; + InitControllerSounds(): any; + InitializeControllerPersonalizationSettings: any; + ModalKeyboardDismissed(): void; + OpenDesktopConfigurator: any; + PreviewConfiguForAppAndController(appId: number): any; + PreviewControllerLEDColor(flHue: number, flSaturation: number, flBrightness: number): any; + QueryControllerConfigsForApp(appId: number): any; + RegisterForActiveControllerChanges: Unregisterable | any; // {"nActiveController":0} + RegisterForConfigSelectionChanges(callback: (param0: number, param1: number) => void): Unregisterable | any; + + RegisterForControllerAccountChanges: Unregisterable | any; + + RegisterForControllerAnalogInputMessages( + callback: (controllerAnalogInputMessages: ControllerAnalogInputMessage[]) => void, + ): Unregisterable | any; + + RegisterForControllerCommandMessages( + callback: (controllerCommandMessage: ControllerCommandMessage) => void, + ): Unregisterable | any; + + /** + * Registers a callback for changes in controller configuration cloud state. + * @param {(controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void} callback - The callback function for config cloud state changes. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForControllerConfigCloudStateChanges( + callback: (controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void, + ): Unregisterable | any; + + /** + * Registers a callback for receiving controller configuration info messages (controller layouts query, personal controller layout query). + * @param {(controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[]) => void} callback - The callback function for controller config info messages. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @remarks Do Not Use, this will break the controller layout selection unless you know what you are doing. + */ + RegisterForControllerConfigInfoMessages( + callback: ( + controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[], + ) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be invoked when controller input messages are received. + * @param {(controllerInputMessages: ControllerInputMessage[]) => void} callback - The callback function to be invoked when controller input messages are received. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForControllerInputMessages( + callback: (controllerInputMessages: ControllerInputMessage[]) => void, + ): Unregisterable | any; + + RegisterForControllerListChanges(callback: (controllerListChanges: ControllerInfo[]) => void): Unregisterable | any; + + /** + * Registers a callback for changes in the controller state (buttons presses, triggers presses, joystick changes etc...). + * @param {(controllerStateChanges: ControllerStateChange[]) => void} callback - The callback function for controller state changes. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForControllerStateChanges( + callback: (controllerStateChanges: ControllerStateChange[]) => void, + ): Unregisterable | any; + + RegisterForDualSenseUpdateNotification: Unregisterable | any; + + /** + * Registers a callback for receiving game keyboard messages (text field popup for inputting text for games when in character creation or etc...). + * @param {(gameKeyboardMessage: GameKeyboardMessage) => void} callback - The callback function for game keyboard messages. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameKeyboardMessages(callback: (gameKeyboardMessage: GameKeyboardMessage) => void): Unregisterable | any; + + RegisterForRemotePlayConfigChanges: Unregisterable | any; + RegisterForShowControllerLayoutPreviewMessages: Unregisterable | any; + RegisterForTouchMenuInputMessages: Unregisterable | any; + + RegisterForTouchMenuMessages(callback: (touchMenuMessage: TouchMenuMessage) => void): Unregisterable | any; + + RegisterForUIVisualization: Unregisterable | any; + + RegisterForUnboundControllerListChanges(callback: (param0: any) => void): Unregisterable | any; // param0 is an array + RegisterForUserDismissKeyboardMessages: Unregisterable | any; + RegisterForUserKeyboardMessages: Unregisterable | any; + RequestGyroActive: any; + RequestRemotePlayControllerConfigs: any; + ResetControllerBindings(param0: any): any; + ResolveCloudedControllerConfigConflict: any; + RestoreControllerPersonalizationSettings(controllerIndex: number): any; + SaveControllerCalibration: any; + SaveControllerPersonalizationSettings: any; + SaveControllerSounds: any; + SaveEditingControllerConfiguration(controllerIndex: number, sharedConfig: boolean): any; + SetActiveControllerAccount: any; + SetControllerConfigurationModeShiftBinding: any; + SetControllerHapticSetting: any; + SetControllerMappingString(mapping: string): void; + SetControllerName: any; + SetControllerNintendoLayoutSetting: any; + SetControllerPersonalizationName: any; + //param0 - nLStickDeadzone, bSWAntiDrift, nRHapticStrength, flRPadPressureCurve + SetControllerPersonalizationSetting(param0: string, param1: number): any; + //param0 - flGyroStationaryTolerance, flAccelerometerStationaryTolerance + SetControllerPersonalizationSettingFloat(param0: string, param1: number): any; + SetControllerRumbleSetting: any; + SetCursorActionset: any; + SetEditingControllerConfigurationActionSet: any; + SetEditingControllerConfigurationInputActivator: any; + SetEditingControllerConfigurationInputActivatorEnabled: any; + SetEditingControllerConfigurationInputBinding: any; + SetEditingControllerConfigurationMiscSetting: any; + SetEditingControllerConfigurationSourceMode: any; + SetGamepadKeyboardText(param0: boolean, param1: string): any; + SetKeyboardActionset(param0: boolean): any; + + /** + * Sets the mouse position. + * @param {number} pid - 0 + * @param {number} x - Mouse X position. + * @param {number} y - Mouse Y position. + * @returns {void} + */ + SetMousePosition(pid: number, x: number, y: number): void; + + SetSelectedConfigForApp(): any; + SetSteamControllerDonglePairingMode: any; + SetVirtualMenuKeySelected(unControllerIndex: number, unMenuIndex: number, param2: number): any; // + SetWebBrowserActionset: any; + SetXboxDriverInstallState(param0: any): any; // state + + /** + * Opens the Steam Input controller settings. + * This function displays the Steam Input controller settings for configuration. + * @returns {void} + */ + ShowControllerSettings(): void; + + StandaloneKeyboardDismissed(): any; + StartControllerDeviceSupportFlow(param0: any, param1: any, callback: (param2: any) => void): any; + StartEditingControllerConfigurationForAppIDAndControllerIndex: any; + StartGyroSWCalibration: any; + StopEditingControllerConfiguration: any; + SwapControllerModeInputBindings: any; + SwapControllerOrder: any; + SyncCloudedControllerConfigs(): any; + + // type - enum + TriggerHapticPulse(controllerIndex: number, type: number, param2: number): any; + TriggerSimpleHapticEvent( + controllerIndex: number, + type: number, + intensity: number, + dbGain: number, + param4: number, + ): any; + + UnregisterForControllerStateChanges(): void; + UnregisterForUIVisualization(controllerIndex: number): any; + UploadChangesForCloudedControllerConfigs(): any; } /** * Represents functions related to Steam Install Folders. - */ -export interface InstallFolder { - /** - * Adds a Steam Library folder to the Steam client. - * @param {string} steamLibraryPath - The path of the Steam Library folder to be added. - * @returns {Promise} - A Promise that resolves to the index of the added folder. - */ - AddInstallFolder(steamLibraryPath: string): Promise; - - /** - * Opens the file explorer to browse files in a specific Steam Library folder. - * @param {number} folderIndex - The index of the folder to be opened. - * @returns {void} - */ - BrowseFilesInFolder(folderIndex: number): void; - - /** - * Cancels the current move operation for moving game content. - * @returns {void} - */ - CancelMove(): void; - - /** - * Retrieves a list of installed Steam Library folders. - * @returns {Promise} - A Promise that resolves to an array of SteamInstallFolder objects. - */ - GetInstallFolders(): Promise; - - /** - * Retrieves a list of potential Steam Library folders that can be added. - * @returns {Promise} - A Promise that resolves to an array of PotentialInstallFolder objects. - */ - GetPotentialFolders(): Promise; - - /** - * Moves the installation folder for a specific app to another Steam Library folder. - * @param {number} appId - The ID of the application to be moved. - * @param {number} folderIndex - The index of the target Steam Library folder. - * @returns {void} - */ - MoveInstallFolderForApp(appId: number, folderIndex: number): void; - - /** - * Refreshes the list of installed Steam Library folders. - * @returns {any} - A Promise or response indicating the refresh operation. - */ - RefreshFolders(): any; - - /** - * Registers a callback function to be called when changes occur in Steam Install Folders. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForInstallFolderChanges(callback: (folderChange: FolderChange) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when moving game content progresses. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMoveContentProgress(callback: (moveContentProgress: MoveContentProgress) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when repairing an install folder is finished. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForRepairFolderFinished(callback: (folderChange: FolderChange) => void): Unregisterable | any; - - /** - * Removes a Steam Library folder from the Steam client. - * @param {number} folderIndex - The index of the folder to be removed. - * @returns {void} - */ - RemoveInstallFolder(folderIndex: number): void; - - /** - * Repairs an installed Steam Library folder. - * @param {number} folderIndex - The index of the folder to be repaired. - * @returns {void} - */ - RepairInstallFolder(folderIndex: number): void; - - /** - * Sets a specific Steam Library folder as the default install folder. - * @param {number} folderIndex - The index of the folder to be set as default. - * @returns {void} - */ - SetDefaultInstallFolder(folderIndex: number): void; - - /** - * Sets a user-defined label for a specific Steam Library folder. - * @param {number} folderIndex - The index of the folder to be labeled. - * @param {string} userLabel - The label to be assigned to the folder. - * @returns {void} - */ - SetFolderLabel(folderIndex: number, userLabel: string): void; -} - -/** - * Represents functions related to managing installs and installation wizards in Steam. - */ -export interface Installs { - /** - * Cancels the installation wizard if it is open. - * @returns {void} - */ - CancelInstall(): void; - - /** - * Continues and starts the installation if the wizard is still open. - * @returns {void} - */ - ContinueInstall(): void; - - /** - * Retrieves information from the last opened or currently opened installation wizard. - * @returns {Promise} A Promise that resolves to the InstallInfo. - */ - GetInstallManagerInfo(): Promise; - - /** - * Opens the restore from backup installer wizard for a specific app. - * @param {string} appBackupPath - The backup path of the app. - * @returns {void} - */ - OpenInstallBackup(appBackupPath: string): void; - - /** - * Opens the installation wizard for specified app IDs. - * @param {number[]} appIds - An array of app IDs to install. - * @returns {void} - */ - OpenInstallWizard(appIds: number[]): void; - - /** - * Opens the uninstall wizard for specified app IDs. - * @param {number[]} appIds - An array of app IDs to uninstall. - * @param {boolean} param1 - Additional parameter (exact usage may vary). - * @returns {any} - Returns an unknown value. - */ - OpenUninstallWizard(appIds: number[], param1: boolean): any; - - RegisterForShowConfirmUninstall: Unregisterable | any; // Broken? doesn't seem to work - - /** - * Registers a callback function to be called when the "Failed Uninstall" dialog is shown. - * @param {function} callback - The callback function to be called when the dialog is shown. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @remarks For example, a `reason` code of 16 indicates that the app is currently running, preventing the uninstallation. - * @todo Document other reason codes. - */ - RegisterForShowFailedUninstall(callback: (appId: number, reason: number) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when the installation wizard is shown. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForShowInstallWizard(callback: (data: InstallInfo) => void): Unregisterable | any; - - RegisterForShowRegisterCDKey: any; - - /** - * Sets a list of app identifiers for downloads in the installation wizard. - * @param {number[]} appIds - An array of app IDs to set. - * @returns {void} - * @remarks The wizard will not reflect this change immediately, but changing another option will. - */ - SetAppList(appIds: number[]): void; - - /** - * Sets the options for creating shortcuts in the installation wizard. - * @param {boolean} bDesktopShortcut - Whether to create a desktop shortcut. - * @param {boolean} bSystemMenuShortcut - Whether to create a system menu shortcut. - * @returns {void} - * @remarks The wizard will not reflect this change immediately, but changing another option will. - */ - SetCreateShortcuts(bDesktopShortcut: boolean, bSystemMenuShortcut: boolean): void; + */ +export interface InstallFolder { + /** + * Adds a Steam Library folder to the Steam client. + * @param {string} steamLibraryPath - The path of the Steam Library folder to be added. + * @returns {Promise} - A Promise that resolves to the index of the added folder. + */ + AddInstallFolder(steamLibraryPath: string): Promise; + + /** + * Opens the file explorer to browse files in a specific Steam Library folder. + * @param {number} folderIndex - The index of the folder to be opened. + * @returns {void} + */ + BrowseFilesInFolder(folderIndex: number): void; + + /** + * Cancels the current move operation for moving game content. + * @returns {void} + */ + CancelMove(): void; + + /** + * Retrieves a list of installed Steam Library folders. + * @returns {Promise} - A Promise that resolves to an array of SteamInstallFolder objects. + */ + GetInstallFolders(): Promise; + + /** + * Retrieves a list of potential Steam Library folders that can be added. + * @returns {Promise} - A Promise that resolves to an array of PotentialInstallFolder objects. + */ + GetPotentialFolders(): Promise; + + /** + * Moves the installation folder for a specific app to another Steam Library folder. + * @param {number} appId - The ID of the application to be moved. + * @param {number} folderIndex - The index of the target Steam Library folder. + * @returns {void} + */ + MoveInstallFolderForApp(appId: number, folderIndex: number): void; + + /** + * Refreshes the list of installed Steam Library folders. + * @returns {any} - A Promise or response indicating the refresh operation. + */ + RefreshFolders(): any; + + /** + * Registers a callback function to be called when changes occur in Steam Install Folders. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForInstallFolderChanges(callback: (folderChange: FolderChange) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when moving game content progresses. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMoveContentProgress(callback: (moveContentProgress: MoveContentProgress) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when repairing an install folder is finished. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForRepairFolderFinished(callback: (folderChange: FolderChange) => void): Unregisterable | any; + + /** + * Removes a Steam Library folder from the Steam client. + * @param {number} folderIndex - The index of the folder to be removed. + * @returns {void} + */ + RemoveInstallFolder(folderIndex: number): void; + + /** + * Repairs an installed Steam Library folder. + * @param {number} folderIndex - The index of the folder to be repaired. + * @returns {void} + */ + RepairInstallFolder(folderIndex: number): void; + + /** + * Sets a specific Steam Library folder as the default install folder. + * @param {number} folderIndex - The index of the folder to be set as default. + * @returns {void} + */ + SetDefaultInstallFolder(folderIndex: number): void; + + /** + * Sets a user-defined label for a specific Steam Library folder. + * @param {number} folderIndex - The index of the folder to be labeled. + * @param {string} userLabel - The label to be assigned to the folder. + * @returns {void} + */ + SetFolderLabel(folderIndex: number, userLabel: string): void; +} - /** - * Sets the install folder for the installation wizard using an install folder index. - * @param {number} folderIndex - The index of the install folder. - * @returns {void} - * @remarks The wizard will not reflect this change immediately, but changing another option will. - */ - SetInstallFolder(folderIndex: number): void; +/** + * Represents functions related to managing installs and installation wizards in Steam. + */ +export interface Installs { + /** + * Cancels the installation wizard if it is open. + * @returns {void} + */ + CancelInstall(): void; + + /** + * Continues and starts the installation if the wizard is still open. + * @returns {void} + */ + ContinueInstall(): void; + + /** + * Retrieves information from the last opened or currently opened installation wizard. + * @returns {Promise} A Promise that resolves to the InstallInfo. + */ + GetInstallManagerInfo(): Promise; + + /** + * Opens the restore from backup installer wizard for a specific app. + * @param {string} appBackupPath - The backup path of the app. + * @returns {void} + */ + OpenInstallBackup(appBackupPath: string): void; + + /** + * Opens the installation wizard for specified app IDs. + * @param {number[]} appIds - An array of app IDs to install. + * @returns {void} + */ + OpenInstallWizard(appIds: number[]): void; + + /** + * Opens the uninstall wizard for specified app IDs. + * @param {number[]} appIds - An array of app IDs to uninstall. + * @param {boolean} dontPrompt - Whether to *not* prompt the user to uninstall. + * @returns {void} + */ + OpenUninstallWizard(appIds: number[], dontPrompt: boolean): void; + + RegisterForShowConfirmUninstall: Unregisterable | any; // Broken? doesn't seem to work + + /** + * Registers a callback function to be called when the "Failed Uninstall" dialog is shown. + * @param {function} callback - The callback function to be called when the dialog is shown. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForShowFailedUninstall(callback: (appId: number, reason: AppUpdateError) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the installation wizard is shown. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForShowInstallWizard(callback: (data: InstallInfo) => void): Unregisterable | any; + + RegisterForShowRegisterCDKey: any; + + /** + * Sets a list of app identifiers for downloads in the installation wizard. + * @param {number[]} appIds - An array of app IDs to set. + * @returns {void} + * @remarks The wizard will not reflect this change immediately, but changing another option will. + */ + SetAppList(appIds: number[]): void; + + /** + * Sets the options for creating shortcuts in the installation wizard. + * @param {boolean} bDesktopShortcut - Whether to create a desktop shortcut. + * @param {boolean} bSystemMenuShortcut - Whether to create a system menu shortcut. + * @returns {void} + * @remarks The wizard will not reflect this change immediately, but changing another option will. + */ + SetCreateShortcuts(bDesktopShortcut: boolean, bSystemMenuShortcut: boolean): void; + + /** + * Sets the install folder for the installation wizard using an install folder index. + * @param {number} folderIndex - The index of the install folder. + * @returns {void} + * @remarks The wizard will not reflect this change immediately, but changing another option will. + */ + SetInstallFolder(folderIndex: number): void; } export interface Messaging { - // section - "ContentManagement", "JumpList", "PostToLibrary" - // seems multipurpose - RegisterForMessages(section: string, callback: (param0: any) => void): Unregisterable | any; - - /* + // section - "ContentManagement", "JumpList", "PostToLibrary" + // seems multipurpose + // callback arguments are the same as in PostMessage + RegisterForMessages( + section: string, + callback: (section: string, param1: string, message: string) => void, + ): Unregisterable | any; + + /* function m(e) { SteamClient.Messaging.PostMessage("LibraryCommands", "ShowFriendChatDialog", JSON.stringify({ steamid: e.persona.m_steamid.ConvertTo64BitString() })) } */ - PostMessage(section: string, param1: string, param2: string): void; + PostMessage(section: string, param1: string, message: string): void; } /** * Represents functions related to controlling music playback in the Steam client. */ export interface Music { - /** - * Decreases the music volume by 10%. - */ - DecreaseVolume(): void; - - /** - * Increases the music volume by 10%. - */ - IncreaseVolume(): void; - - /** - * @param {number} param0 - Unknown parameter usage. - * @param {number} param1 - Unknown parameter usage. - * @todo: unknown parameter usages, I have tried soundtrack identifier + track index and in reverse as well - */ - PlayEntry(param0: number, param1: number): void; - - /** - * Plays the next track in the music playlist. - */ - PlayNext(): void; - - /** - * Plays the previous track in the music playlist. - */ - PlayPrevious(): void; - - /** - * Registers a callback function to be called when music playback changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMusicPlaybackChanges(callback: (param0: boolean | MusicTrack) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when the music playback position changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMusicPlaybackPosition(callback: (position: number) => void): Unregisterable | any; - - /** - * Sets the playback position of the music track. - * @param {number} position - The position to set in seconds. - */ - SetPlaybackPosition(position: number): void; - - /** - * Sets the repeat status for music playback. - * @param {number} status - The repeat status. 0 = off, 1 = repeat all, 2 = repeat one. - */ - SetPlayingRepeatStatus(status: number): void; - - /** - * Sets the shuffle status for music playback. - * @param {boolean} value - True to enable shuffle, false to disable shuffle. - */ - SetPlayingShuffled(value: boolean): void; - - /** - * Sets the volume for music playback. - * @param {number} volume - The volume level to set. - */ - SetVolume(volume: number): void; - - /** - * Toggles the mute state of the music volume. - */ - ToggleMuteVolume(): void; - - /** - * Toggles between play and pause for music playback. - */ - TogglePlayPause(): void; + /** + * Decreases the music volume by 10%. + */ + DecreaseVolume(): void; + + /** + * Increases the music volume by 10%. + */ + IncreaseVolume(): void; + + /** + * @param {number} param0 - Unknown parameter usage. + * @param {number} param1 - Unknown parameter usage. + * @todo: unknown parameter usages, I have tried soundtrack identifier + track index and in reverse as well + */ + PlayEntry(param0: number, param1: number): void; + + /** + * Plays the next track in the music playlist. + */ + PlayNext(): void; + + /** + * Plays the previous track in the music playlist. + */ + PlayPrevious(): void; + + /** + * Registers a callback function to be called when music playback changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMusicPlaybackChanges(callback: (param0: boolean | MusicTrack) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the music playback position changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMusicPlaybackPosition(callback: (position: number) => void): Unregisterable | any; + + /** + * Sets the playback position of the music track. + * @param {number} position - The position to set in seconds. + */ + SetPlaybackPosition(position: number): void; + + /** + * Sets the repeat status for music playback. + * @param {MusicRepeatStatus} status - The repeat status. + */ + SetPlayingRepeatStatus(status: MusicRepeatStatus): void; + + /** + * Sets the shuffle status for music playback. + * @param {boolean} value - True to enable shuffle, false to disable shuffle. + */ + SetPlayingShuffled(value: boolean): void; + + /** + * Sets the volume for music playback. + * @param {number} volume - The volume level to set. + * @remarks Ranges from 0 to 100. + */ + SetVolume(volume: number): void; + + /** + * Toggles the mute state of the music volume. + */ + ToggleMuteVolume(): void; + + /** + * Toggles between play and pause for music playback. + */ + TogglePlayPause(): void; } export interface Notifications { - RegisterForNotifications(callback: (param0: number, param1: number, param2: ArrayBuffer) => void): Unregisterable | any; + RegisterForNotifications( + callback: (notificationIndex: number, type: ClientUINotification, param2: ArrayBuffer) => void, + ): Unregisterable | any; } export interface VRDevice { - BIsConnected: any; - BVRDeviceSeenRecently: any; - RegisterForDeviceConnectivityChange: Unregisterable | any; + BIsConnected: any; + BVRDeviceSeenRecently: any; + RegisterForDeviceConnectivityChange: Unregisterable | any; } export interface DeviceProperties { - GetBoolDeviceProperty: any; - GetDoubleDeviceProperty: any; - GetFloatDeviceProperty: any; - GetInt32DeviceProperty: any; - GetStringDeviceProperty: any; - RegisterForDevicePropertyChange: Unregisterable | any; + GetBoolDeviceProperty: any; + GetDoubleDeviceProperty: any; + GetFloatDeviceProperty: any; + GetInt32DeviceProperty: any; + GetStringDeviceProperty: any; + RegisterForDevicePropertyChange: Unregisterable | any; } export interface Keyboard { - Hide(): any; - RegisterForStatus: Unregisterable | any; - SendDone(): any; - SendText(key: string): any; //??? - Show(): any; + Hide(): any; + RegisterForStatus: Unregisterable | any; + SendDone(): any; + SendText(key: string): any; //??? + Show(): any; } export interface PathProperties { - GetBoolPathProperty: any; - GetDoublePathProperty: any; - GetFloatPathProperty: any; - GetInt32PathProperty: any; - GetStringPathProperty: any; - RegisterForPathPropertyChange: any; - SetBoolPathProperty: any; - SetDoublePathProperty: any; - SetFloatPathProperty: any; - SetInt32PathProperty: any; - SetStringPathProperty: any; + GetBoolPathProperty: any; + GetDoublePathProperty: any; + GetFloatPathProperty: any; + GetInt32PathProperty: any; + GetStringPathProperty: any; + RegisterForPathPropertyChange: any; + SetBoolPathProperty: any; + SetDoublePathProperty: any; + SetFloatPathProperty: any; + SetInt32PathProperty: any; + SetStringPathProperty: any; } export interface VROverlay { - HideDashboard: any; - RegisterForButtonPress: Unregisterable | any; - RegisterForCursorMovement: Unregisterable | any; - RegisterForVisibilityChanged: Unregisterable | any; - ShowDashboard: any; + HideDashboard: any; + RegisterForButtonPress: Unregisterable | any; + RegisterForCursorMovement: Unregisterable | any; + RegisterForVisibilityChanged: Unregisterable | any; + ShowDashboard: any; } export interface OpenVR { - Device: VRDevice; - DeviceProperties: DeviceProperties; - GetWebSecret: any; - InstallVR: any; - Keyboard: Keyboard; - PathProperties: PathProperties; - QuitAllVR: any; - RegisterForButtonPress: Unregisterable | any; - RegisterForHMDActivityLevelChanged: Unregisterable | any; - RegisterForInstallDialog: Unregisterable | any; - RegisterStartupErrors: Unregisterable | any; - RegisterForVRHardwareDetected: Unregisterable | any; - SetOverlayInteractionAffordance: any; - ShowNotification: any; - StartVR: any; - TriggerOverlayHapticEffect: any; - VROverlay: VROverlay; + Device: VRDevice; + DeviceProperties: DeviceProperties; + GetWebSecret(): Promise; + InstallVR(): any; + Keyboard: Keyboard; + PathProperties: PathProperties; + QuitAllVR(): any; + RegisterForButtonPress: Unregisterable | any; + RegisterForHMDActivityLevelChanged: Unregisterable | any; + RegisterForInstallDialog: Unregisterable | any; + RegisterStartupErrors: Unregisterable | any; + RegisterForVRHardwareDetected: Unregisterable | any; + SetOverlayInteractionAffordance: any; + ShowNotification(title: string, description: string): any; + StartVR: any; + TriggerOverlayHapticEffect: any; + VROverlay: VROverlay; } export interface Overlay { - /** - * Destroys the gamepad UI desktop configurator window if open. - * @returns {void} - */ - DestroyGamePadUIDesktopConfiguratorWindow(): void; - - GetOverlayBrowserInfo: any; - HandleGameWebCallback: any; - HandleProtocolForOverlayBrowser: any; - RegisterForActivateOverlayRequests: Unregisterable | any; - - /** - * Registers a callback function to be called when a microtransaction authorization is requested. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMicroTxnAuth(callback: (appId: number, microTxnId: string, param2: number, microTxnUrl: string) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when a microtransaction authorization is dismissed by the user in Steam's authorization page. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMicroTxnAuthDismiss(callback: (appId: number, microTxnId: string) => void): Unregisterable | any; - - RegisterForNotificationPositionChanged: Unregisterable | any; - - /** - * Registers a callback function to be called when an overlay is activated or closed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForOverlayActivated(callback: (popUpContextId: number, appId: number, active: boolean, param3: boolean) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when the overlay browser protocols change. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForOverlayBrowserProtocols(callback: (browseProtocols: OverlayBrowserProtocols) => void): Unregisterable | any; - - /** - * Registers **the** callback function to be called when the overlay browser information changes. - * @param {function} callback - The callback function to be called when the overlay browser information changes. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @remarks Do Not Use, this will break the overlay unless you know what you are doing. - */ - RegisterOverlayBrowserInfoChanged(callback: () => void): Unregisterable | any; - - SetOverlayState(appId: number, uiComposition: UIComposition): any; + /** + * Destroys the gamepad UI desktop configurator window if open. + * @returns {void} + */ + DestroyGamePadUIDesktopConfiguratorWindow(): void; + + GetOverlayBrowserInfo(): any; + HandleGameWebCallback(url: string): any; + HandleProtocolForOverlayBrowser(appId: number, protocol: string): any; + RegisterForActivateOverlayRequests: Unregisterable | any; + + /** + * Registers a callback function to be called when a microtransaction authorization is requested. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMicroTxnAuth( + callback: (appId: number, microTxnId: string, realm: SteamRealm, microTxnUrl: string) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a microtransaction authorization is dismissed by the user in Steam's authorization page. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMicroTxnAuthDismiss(callback: (appId: number, microTxnId: string) => void): Unregisterable | any; + + RegisterForNotificationPositionChanged( + callback: (appId: any, position: any, horizontalInset: number, verticalInset: number) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when an overlay is activated or closed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForOverlayActivated( + callback: (popUpContextId: number, appId: number, active: boolean, param3: boolean) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when the overlay browser protocols change. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForOverlayBrowserProtocols( + callback: (browseProtocols: OverlayBrowserProtocols) => void, + ): Unregisterable | any; + + /** + * Registers **the** callback function to be called when the overlay browser information changes. + * @param {function} callback - The callback function to be called when the overlay browser information changes. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @remarks Do Not Use, this will break the overlay unless you know what you are doing. + */ + RegisterOverlayBrowserInfoChanged(callback: () => void): Unregisterable | any; + + SetOverlayState(appId: number, uiComposition: UIComposition): any; } /** * Interface for managing parental control settings. */ export interface Parental { - /** - * Locks the parental control settings. - * @returns {void} - */ - LockParentalLock(): void; - - /** - * Registers a callback function to be invoked when parental settings change. - * @param {(parentalSettings: ParentalSettings) => void} callback - The callback function to be invoked when parental settings change. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForParentalSettingsChanges(callback: (parentalSettings: ParentalSettings) => void): Unregisterable | any; - - /** - * Unlocks the parental lock with the provided PIN. - * @param {string} pin - The 4-digit PIN to unlock the parental lock. - * @param {boolean} param1 - Additional parameter. // Todo: Unknown usage. - * @returns {Promise} - A Promise that resolves to a number representing the result of the unlock operation. - */ - UnlockParentalLock(pin: string, param1: boolean): Promise; + /** + * Locks the parental control settings. + * @returns {void} + */ + LockParentalLock(): void; + + /** + * Registers a callback function to be invoked when parental settings change. + * @param {(parentalSettings: ParentalSettings) => void} callback - The callback function to be invoked when parental settings change. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForParentalSettingsChanges(callback: (parentalSettings: ParentalSettings) => void): Unregisterable | any; + + /** + * Unlocks the parental lock with the provided PIN. + * @param {string} pin - The 4-digit PIN to unlock the parental lock. + * @param {boolean} param1 - Additional parameter. // Todo: Unknown usage. + * @returns {Promise} - A Promise that resolves to a number representing the result of the unlock operation. + */ + UnlockParentalLock(pin: string, param1: boolean): Promise; } export interface RemotePlay { - BCanAcceptInviteForGame: any; - BCanCreateInviteForGame: any; + BCanAcceptInviteForGame: any; + BCanCreateInviteForGame: any; + + BCanHostIsolatedGameAudio(): Promise; - BCanHostIsolatedGameAudio(): Promise; + BEnabled(): Promise; - BEnabled(): Promise; + BRemotePlayTogetherGuestOnPhoneOrTablet(steam64Id: string, guestId: number): Promise; - BRemotePlayTogetherGuestOnPhoneOrTablet: any; + BRemotePlayTogetherGuestSupported(): Promise; - BRemotePlayTogetherGuestSupported(): Promise; + CancelInviteAndSession(steam64Id: string): any; + CancelInviteAndSessionWithGuestID(steam64Id: string, guestId: number): any; + CloseGroup(): Promise; + CreateGroup: any; + CreateInviteAndSession(steam64Id: string, param1: any): any; + CreateInviteAndSessionWithGuestID(steam64Id: string, guestId: number, param2: any): any; - CancelInviteAndSession: any; - CancelInviteAndSessionWithGuestID: any; - CloseGroup: any; - CreateGroup: any; - CreateInviteAndSession: any; - CreateInviteAndSessionWithGuestID: any; + GetClientStreamingBitrate(): Promise; //todo: -1 not streaming?? + GetClientStreamingQuality(): Promise; //todo: -1 not streaming?? + GetControllerType(param0: number): Promise; // todo: param0 with value 0 is host controller type - param0 is likely an index of clients or guestId? + GetGameSystemVolume(): Promise; - GetClientStreamingBitrate(): Promise; //todo: -1 not streaming?? - GetClientStreamingQuality(): Promise; //todo: -1 not streaming?? - GetControllerType(param0: number): Promise; // todo: param0 with value 0 is host controller type - param0 is likely an index of clients or guestId? - GetGameSystemVolume(): Promise; + GetPerUserInputSettings(steam64Id: string): any; + GetPerUserInputSettingsWithGuestID(steam64Id: string, guestId: number): any; + IdentifyController: any; + InstallAudioDriver: any; + InstallInputDriver: any; + MoveControllerToSlot: any; + RegisterForAdditionalParentalBlocks: Unregisterable | any; + RegisterForAudioDriverPrompt: Unregisterable | any; + RegisterForBitrateOverride: Unregisterable | any; + RegisterForControllerIndexSet: Unregisterable | any; - GetPerUserInputSettings: any; - GetPerUserInputSettingsWithGuestID: any; - IdentifyController: any; - InstallAudioDriver: any; - InstallInputDriver: any; - MoveControllerToSlot: any; - RegisterForAdditionalParentalBlocks: Unregisterable | any; - RegisterForAudioDriverPrompt: Unregisterable | any; - RegisterForBitrateOverride: Unregisterable | any; - RegisterForControllerIndexSet: Unregisterable | any; + RegisterForDevicesChanges(callback: (devicesChange: RemotePlayDevice[]) => void): Unregisterable | any; - RegisterForDevicesChanges(callback: (devicesChange: RemotePlayDevice[]) => void): Unregisterable | any; + RegisterForGroupCreated: Unregisterable | any; + RegisterForGroupDisbanded: Unregisterable | any; + RegisterForInputDriverPrompt: Unregisterable | any; + RegisterForInputDriverRestartNotice: Unregisterable | any; - RegisterForGroupCreated: Unregisterable | any; - RegisterForGroupDisbanded: Unregisterable | any; - RegisterForInputDriverPrompt: Unregisterable | any; - RegisterForInputDriverRestartNotice: Unregisterable | any; + RegisterForInputUsed( + callback: (steam64Id: string, type: ClientUsedInputType, guestId: number) => void, + ): Unregisterable | any; // only fires on host - RegisterForInputUsed(callback: (param0: string, param1: number, param2: number) => void): Unregisterable | any; // only fires on host + RegisterForInviteResult: Unregisterable | any; - RegisterForInviteResult: Unregisterable | any; + RegisterForNetworkUtilizationUpdate( + callback: (steam64Id: string, guestId: number, networkUtilization: number, networkDuration: number) => void, + ): Unregisterable | any; // only fires on host - RegisterForNetworkUtilizationUpdate(callback: (param0: string, param1: number, param2: number, param3: number) => void): Unregisterable | any; // only fires on host + RegisterForPlaceholderStateChanged(callback: (isShowingPlaceholder: boolean) => void): Unregisterable | any; + RegisterForPlayerInputSettingsChanged: Unregisterable | any; + RegisterForQualityOverride(callback: (hostStreamingQualityOverride: number) => void): Unregisterable | any; + RegisterForRemoteClientLaunchFailed: Unregisterable | any; - RegisterForPlaceholderStateChanged: Unregisterable | any; - RegisterForPlayerInputSettingsChanged: Unregisterable | any; - RegisterForQualityOverride: Unregisterable | any; - RegisterForRemoteClientLaunchFailed: Unregisterable | any; + RegisterForRemoteClientStarted(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client - RegisterForRemoteClientStarted(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client + RegisterForRemoteClientStopped(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client - RegisterForRemoteClientStopped(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client + RegisterForSessionStarted(callback: (steam64Id: any, gameId: any, guestId: any) => void): Unregisterable | any; + RegisterForSessionStopped(callback: (steam64Id: any, guestId: any) => void): Unregisterable | any; - RegisterForSettingsChanges(callback: (remotePlaySettings: RemotePlaySettings) => void): Unregisterable | any; + RegisterForSettingsChanges(callback: (remotePlaySettings: RemotePlaySettings) => void): Unregisterable | any; - SetClientStreamingBitrate: any; - SetClientStreamingQuality: any; + SetClientStreamingBitrate(bitrate: number): void; + SetClientStreamingQuality(quality: number): void; - SetGameSystemVolume(volume: number): void; + SetGameSystemVolume(volume: number): void; - SetPerUserControllerInputEnabled: any; - SetPerUserControllerInputEnabledWithGuestID: any; - SetPerUserKeyboardInputEnabled: any; - SetPerUserKeyboardInputEnabledWithGuestID: any; - SetPerUserMouseInputEnabled: any; - SetPerUserMouseInputEnabledWithGuestID: any; - SetRemoteDeviceAuthorized: any; - SetRemoteDevicePIN(pin: number): void; - SetRemotePlayEnabled: any; - SetStreamingClientConfig: any; - SetStreamingClientConfigEnabled: any; - SetStreamingDesktopToRemotePlayTogetherEnabled: any; - SetStreamingP2PScope: any; - SetStreamingServerConfig: any; - SetStreamingServerConfigEnabled: any; + SetPerUserControllerInputEnabled(steam64Id: string, enabled: boolean): any; + SetPerUserControllerInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; + SetPerUserKeyboardInputEnabled(steam64Id: string, enabled: boolean): any; + SetPerUserKeyboardInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; + SetPerUserMouseInputEnabled(steam64Id: string, enabled: boolean): any; + SetPerUserMouseInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; + SetRemoteDeviceAuthorized: any; + SetRemoteDevicePIN(pin: number): void; + SetRemotePlayEnabled(enabled: boolean): void; + SetStreamingClientConfig: any; + SetStreamingClientConfigEnabled: any; + SetStreamingDesktopToRemotePlayTogetherEnabled(enabled: boolean): any; + SetStreamingP2PScope: any; + SetStreamingServerConfig: any; + SetStreamingServerConfigEnabled: any; - StopStreamingClient(): void; + StopStreamingClient(): void; - StopStreamingSession: any; - StopStreamingSessionAndSuspendDevice: any; - UnlockH264: any; + StopStreamingSession: any; + StopStreamingSessionAndSuspendDevice: any; + UnlockH264(): any; - UnpairRemoteDevices(): void;// unpairs all devices + UnpairRemoteDevices(): void; // unpairs all devices } /** * Interface for managing screenshots. */ export interface Screenshots { - /** - * Deletes a local screenshot. - * @param {string} appId - The ID of the application. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {Promise} - A Promise that resolves to a boolean value indicating whether the deletion was successful. - */ - DeleteLocalScreenshot(appId: string, screenshotIndex: number): Promise; - - /** - * Retrieves all local screenshots for all applications. - * @returns {Promise} - A Promise that resolves to an array of Screenshot objects. - */ - GetAllAppsLocalScreenshots(): Promise; - - /** - * Retrieves the count of all local screenshots for all applications. - * @returns {Promise} - A Promise that resolves to the count of local screenshots. - */ - GetAllAppsLocalScreenshotsCount(): Promise; - - /** - * Retrieves a range of local screenshots for all applications. - * @param {number} start - The starting index of the screenshot range. - * @param {number} end - The ending index of the screenshot range. - * @returns {Promise} - A Promise that resolves to an array of Screenshot objects within the specified range. - */ - GetAllAppsLocalScreenshotsRange(start: number, end: number): Promise; - - /** - * Retrieves all local screenshots. - * @returns {Promise} - A Promise that resolves to an array of Screenshot objects. - */ - GetAllLocalScreenshots(): Promise; + /** + * Deletes a local screenshot. + * @param {string} appId - The ID of the application. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {Promise} - A Promise that resolves to a boolean value indicating whether the deletion was successful. + */ + DeleteLocalScreenshot(appId: string, screenshotIndex: number): Promise; + + /** + * Retrieves all local screenshots for all applications. + * @returns {Promise} - A Promise that resolves to an array of Screenshot objects. + */ + GetAllAppsLocalScreenshots(): Promise; + + /** + * Retrieves the count of all local screenshots for all applications. + * @returns {Promise} - A Promise that resolves to the count of local screenshots. + */ + GetAllAppsLocalScreenshotsCount(): Promise; + + /** + * Retrieves a range of local screenshots for all applications. + * @param {number} start - The starting index of the screenshot range. + * @param {number} end - The ending index of the screenshot range. + * @returns {Promise} - A Promise that resolves to an array of Screenshot objects within the specified range. + */ + GetAllAppsLocalScreenshotsRange(start: number, end: number): Promise; + + /** + * Retrieves all local screenshots. + * @returns {Promise} - A Promise that resolves to an array of Screenshot objects. + */ + GetAllLocalScreenshots(): Promise; + + /** + * Retrieves the game associated with a specific local screenshot index. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {Promise} - A Promise that resolves to the ID of the game associated with the screenshot. + */ + GetGameWithLocalScreenshots(screenshotIndex: number): Promise; + + /** + * Retrieves the last taken local screenshot. + * @returns {Promise} - A Promise that resolves to the last taken local screenshot. + */ + GetLastScreenshotTaken(): Promise; + + /** + * Retrieves a specific local screenshot for an application. + * @param {string} appId - The ID of the application. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {Promise} - A Promise that resolves to the requested local screenshot. + */ + GetLocalScreenshot(appId: string, screenshotIndex: number): Promise; + + /** + * Retrieves the count of local screenshots for a specific application. + * @param {number} appId - The ID of the application. + * @returns {Promise} - A Promise that resolves to the count of local screenshots for the application. + */ + GetLocalScreenshotCount(appId: number): Promise; + + /** + * Retrieves the number of games with local screenshots. + * @returns {Promise} - A Promise that resolves to the number of games with local screenshots. + */ + GetNumGamesWithLocalScreenshots(): Promise; + + /** + * Opens a local screenshot in the system image viewer. + * If the screenshot index is invalid, this function opens the screenshots directory for the specified application ID. + * @param {string} appId - The ID of the application. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {void} + */ + ShowScreenshotInSystemViewer(appId: string, screenshotIndex: number): void; + + /** + * Opens the folder containing local screenshots for a specific application. + * @param {string} appId - The ID of the application. + * @returns {void} + */ + ShowScreenshotsOnDisk(appId: string): void; + + /** + * Uploads a local screenshot. + * @param {string} appId - The ID of the application. + * @param {number} localScreenshot_hHandle - The handle of the local screenshot. + * @param {number} filePrivacyState - The privacy state of the screenshot file. + * @returns {Promise} - A Promise that resolves to a boolean value indicating whether the upload was successful. + */ + UploadLocalScreenshot( + appId: string, + localScreenshot_hHandle: number, + filePrivacyState: FilePrivacyState, + ): Promise; +} - /** - * Retrieves the game associated with a specific local screenshot index. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {Promise} - A Promise that resolves to the ID of the game associated with the screenshot. - */ - GetGameWithLocalScreenshots(screenshotIndex: number): Promise; +/** + * Represents functionality for the server browser. + */ +export interface ServerBrowser { + /** + * Adds a favorite server. + * @param {ServerBrowserServerFull} server - The server to add. + * @returns {Promise} A Promise that resolves to an empty string if successful, `Invalid/missing IPv4?` if failed. + * @todo Refreshed the favorite servers list upon adding once, but doesn't now. :-( + */ + AddFavoriteServer(server: ServerBrowserServerFull): Promise; + + /** + * Adds a favorite server by IP. + * @param {string} ip - The IP to add to favorite servers. + * @returns {Promise} A Promise that resolves to an empty string if successful, localization string if failed. + */ + AddFavoriteServersByIP(ip: string): Promise; + + CancelServerQuery(dialogId: number, queryServer: number): void; + + /** + * Connects to a server from a given dialog. + * @param {number} dialogId - The dialog ID to use. + * @param {string} password - Server password, empty if none. + * @returns {Promise} A Promise that resolves to a connection status. + */ + ConnectToServer(dialogId: number, password: string): Promise; + + /** + * Creates a server info dialog, on which your friend is playing on. + * @param {number} pid - 0 + * @param {string} steamId - A Steam64 ID of a friend. + * @returns {void} + */ + CreateFriendGameInfoDialog(pid: number, steamId: string): void; + + /** + * Creates a server info dialog. + * @param {string} ip - The IP to create a dialog for. + * @param {number} port - The IP's port. + * @param {number} queryPort - + * @returns {Promise} A Promise that resolves to the current dialog ID. + */ + CreateServerGameInfoDialog(ip: string, port: number, queryPort: number): Promise; + + /** + * Retrieves the server list. + * @param {number} appId - The game ID, 0 for every game. + * @param {ServerBrowserTab} queryType - The tab to use. + * @param {string[]} filters - Server filters. + * @param {function} serverCallback - What to do with the found server? + * @param {function} requestCompletedCallback - The callback function to be called when the request is completed. + * @returns {Promise} A Promise that resolves to the current server list request ID. + * @throws Throws if the query type is unknown. + * @throws Throws if the filter list isn't key/value pairs, i.e. of an even length. + * @remarks Stops at 10000 if there are more servers to be found. + * @example + * Filter examples, may be combined: + * ``` + * [ 'gamedir', 'cstrike' ] // Doesn't work? + * [ 'hasplayers', '1' ] // Only works with "1"? + * [ 'notfull', '1' ] // Doesn't work? + * [ 'map', 'cs_office' ] // Has to be an exact match! + * ``` + */ + + /* + The enum in question: + + (t = + 'lan' == this.id + ? this.all_servers.length > 0 + ? '#ServerBrowser_NoServersMatch' + : '#ServerBrowser_NoLanServers' + : 'internet' == this.id + ? this.all_servers.length > 0 + ? '#ServerBrowser_NoInternetGamesMatch' + : e == l.zS.k_EServerFailedToRespond + ? '#ServerBrowser_MasterServerNotResponsive' + : e == l.zS.k_ENoServersListedOnMasterServer + ? '#ServerBrowser_MasterServerHasNoServersListed' + : '#ServerBrowser_NoInternetGamesResponded' + : 'favorites' == this.id + ? this.all_servers.length > 0 + ? '#ServerBrowser_NoServersMatch' + : '#ServerBrowser_NoFavoriteServers' + : 'history' == this.id + ? this.all_servers.length > 0 + ? '#ServerBrowser_NoHistoryServersMatch' + : '#ServerBrowser_NoServersPlayed' + : 'friends' == this.id + ? this.all_servers.length > 0 + ? '#ServerBrowser_NoServersMatch' + : '#ServerBrowser_NoFriendsServers' + : 'BUGBUG'), + */ + CreateServerListRequest( + appId: number, + queryType: ServerBrowserTab, + filters: string[], + serverCallback: (server: ServerBrowserServerFull) => void, + requestCompletedCallback: (response: number) => void, + ): Promise; + + /** + * Destroys the game info dialog functions (but not the window). + * @param {number} dialogId - The dialog ID to use. + * @returns {void} + * @remarks ServerBrowser.CancelServerQuery may throw if it tries to ping the server. + */ + DestroyGameInfoDialog(dialogId: number): void; + + /** + * Stops retrieving the server list. + * @param {number} activeServerListRequestId - The active server request ID to use. + * @returns {void} + */ + DestroyServerListRequest(activeServerListRequestId: number): void; + + /** + * Gets a list of games that support the server browser feature. + * @returns {Promise} A Promise that resolves to a list of games. + */ + GetMultiplayerGames(): Promise; + + /** + * Gets the server browser preferences. + * @returns {Promise} A Promise that resolves to server browser preferences. + */ + GetServerListPreferences(): Promise; + + /** + * Pings the server of a specified dialog ID. + * @param {number} dialogId - The dialog ID to use. + * @returns {Promise} + */ + PingServer(dialogId: number): Promise; + + /** + * Registers a callback function to be called when a server gets added to favorite servers. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForFavorites(callback: (list: ServerBrowserFavoritesAndHistory) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when idk + * @param {number} dialogId - The dialog ID to use. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForFriendGamePlayed( + dialogId: number, + callback: (server: ServerBrowserFriendServer) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a server info dialog opens. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForGameInfoDialogs(callback: (dialogs: ServerBrowserDialog[]) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when player details get requested. + * @param {number} dialogId - The dialog ID to use. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForPlayerDetails( + dialogId: number, + callback: (player: ServerBrowserPlayer | ServerBrowserPlayerRefreshStatus) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a server gets pinged. + * @param {number} dialogId - The dialog ID to use. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForServerInfo(dialogId: number, callback: (server: ServerBrowserServerFull) => void): Unregisterable | any; + + /** + * Removes a server from favorite servers. + * @param {ServerBrowserServer} server - The server to remove. + * @returns {void} + */ + RemoveFavoriteServer(server: ServerBrowserServer): void; + + /** + * Removes a server from history of played servers. + * @param {ServerBrowserServer} server - The server to remove. + * @returns {void} + */ + RemoveHistoryServer(server: ServerBrowserServer): void; + + /** + * Requests player details for a specific dialog. + * @param {number} dialogId - The dialog ID to use. + * @returns {Promise} + */ + RequestPlayerDetails(dialogId: number): Promise; + + /** + * Sets the server browser preferences. + * @param {ServerBrowserPreferences} prefs - Server list preferences. + * @returns {void} + */ + SetServerListPreferences(prefs: ServerBrowserPreferences): void; +} - /** - * Retrieves the last taken local screenshot. - * @returns {Promise} - A Promise that resolves to the last taken local screenshot. - */ - GetLastScreenshotTaken(): Promise; +export interface Settings { + AddClientBeta(param0: any, name: string): any; - /** - * Retrieves a specific local screenshot for an application. - * @param {string} appId - The ID of the application. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {Promise} - A Promise that resolves to the requested local screenshot. - */ - GetLocalScreenshot(appId: string, screenshotIndex: number): Promise; + /** + * Clears HTTP cache in `/appcache/httpcache`. + * @returns {void} + */ + ClearAllHTTPCaches(): void; - /** - * Retrieves the count of local screenshots for a specific application. - * @param {number} appId - The ID of the application. - * @returns {Promise} - A Promise that resolves to the count of local screenshots for the application. - */ - GetLocalScreenshotCount(appId: number): Promise; + /** + * Clears download cache and logs you out. + * @returns {void} + */ + ClearDownloadCache(): void; - /** - * Retrieves the number of games with local screenshots. - * @returns {Promise} - A Promise that resolves to the number of games with local screenshots. - */ - GetNumGamesWithLocalScreenshots(): Promise; - - /** - * Opens a local screenshot in the system image viewer. - * If the screenshot index is invalid, this function opens the screenshots directory for the specified application ID. - * @param {string} appId - The ID of the application. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {void} - */ - ShowScreenshotInSystemViewer(appId: string, screenshotIndex: number): void; + GetAccountSettings(): Promise; - /** - * Opens the folder containing local screenshots for a specific application. - * @param {string} appId - The ID of the application. - * @returns {void} - */ - ShowScreenshotsOnDisk(appId: string): void; - - /** - * Uploads a local screenshot. - * @param {string} appId - The ID of the application. - * @param {number} localScreenshot_hHandle - The handle of the local screenshot. - * @param {number} filePrivacyState - The privacy state of the screenshot file. - * @returns {Promise} - A Promise that resolves to a boolean value indicating whether the upload was successful. - */ - UploadLocalScreenshot(appId: string, localScreenshot_hHandle: number, filePrivacyState: FilePrivacyState): Promise; -} + GetAppUsesP2PVoice(appId: number): Promise; -export interface ServerBrowser { - AddFavoriteServer: any; - AddFavoriteServersByIP: any; - CancelServerQuery: any; - ConnectToServer: any; - CreateFriendGameInfoDialog: any; - CreateServerGameInfoDialog: any; - DestroyGameInfoDialog: any; - DestroyServerListRequest: any; - GetMultiplayerGames: any; - GetServerListPreferences: any; - PingServer: any; - RegisterForFavorites: any; - RegisterForFriendGamePlayed: any; - RegisterForGameInfoDialogs: any; - RegisterForPlayerDetails: any; - RegisterForServerInfo: any; - RemoveFavoriteServer: any; - RemoveHistoryServer: any; - RequestPlayerDetails: any; - SetServerListPreferences: any; -} + GetAvailableLanguages(): Promise; -export interface Settings { - AddClientBeta: any; - ClearAllHTTPCaches: any; - ClearDownloadCache: any; + GetAvailableTimeZones(): Promise; - GetAccountSettings(): Promise; + // Returns the current language "english" + GetCurrentLanguage(): Promise; - GetAppUsesP2PVoice(appId: number): Promise; + GetGlobalCompatTools(): Promise; - GetAvailableLanguages(): Promise; + GetMonitorInfo(): Promise; - GetAvailableTimeZones(): Promise; + GetOOBETestMode(): Promise; - // Returns the current language "english" - GetCurrentLanguage(): Promise; + GetRegisteredSteamDeck(): Promise; - GetGlobalCompatTools(): Promise; + // Returns the current timezone + GetTimeZone(): Promise; - GetMonitorInfo: any; + GetWindowed(): Promise; - GetOOBETestMode(): Promise; + IgnoreSteamDeckRewards(): void; - GetRegisteredSteamDeck(): Promise; + /** + * Opens the Windows microphones dialog. + * @returns {void} + */ + OpenWindowsMicSettings(): void; - // Returns the current timezone - GetTimeZone(): Promise; + RegisterForMicVolumeUpdates: Unregisterable | any; + RegisterForSettingsArrayChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - GetWindowed(): Promise; + RegisterForSettingsChanges(callback: (steamSettings: SteamSettings) => void): Unregisterable | any; - IgnoreSteamDeckRewards: any; - OpenWindowsMicSettings: any; - RegisterForMicVolumeUpdates: Unregisterable | any; - RegisterForSettingsArrayChanges: Unregisterable | any; + RegisterForTimeZoneChange(callback: (timezoneId: string) => void): Unregisterable | any; // When timezone is changed from settings, callback will return new timezoneId + ReinitMicSettings(): void; + RequestDeviceAuthInfo(): void; + // + SelectClientBeta(nBetaID: any): any; - RegisterForSettingsChanges(callback: (steamSettings: SteamSettings) => void): Unregisterable | any; + // Get from available languages + SetCurrentLanguage(strShortName: string): void; - RegisterForTimeZoneChange(callback: (timezoneId: string) => void): Unregisterable | any; // When timezone is changed from settings, callback will return new timezoneId - ReinitMicSettings: any; - RequestDeviceAuthInfo(): any; - // - SelectClientBeta(nBetaID: any): any; + SetEnableSoftProcessKill(value: boolean): void; // Default value is false, this is Valve internal menu - // Get from available languages - SetCurrentLanguage(strShortName: string): void; + SetHostname(hostname: string): void; + SetMicTestMode: any; - SetEnableSoftProcessKill(value: boolean): void; // Default value is false, this is Valve internal menu + SetOOBETestMode(value: boolean): void; - SetHostname: any; - SetMicTestMode: any; + SetPreferredMonitor(monitor: string): void; + SetRegisteredSteamDeck: any; - SetOOBETestMode(value: boolean): void; + /** + * Sets the "Don't save account credentials on this computer" option. + * @param {boolean} value - Whether to save account credentials. + * @returns {void} + */ + SetSaveAccountCredentials(value: boolean): void; - SetPreferredMonitor: any; - SetRegisteredSteamDeck: any; - SetSaveAccountCredentials: any; - SetSetting: any; - SetSteamPlayEnabled: any; + SetSetting: any; + SetSteamPlayEnabled(value: boolean): void; - SetTimeZone(timezoneId: string): void; // You can get valid timezoneIds from GetAvailableTimeZones() - SetUseNintendoButtonLayout: any; - SetWindowed: any; + SetTimeZone(timezoneId: string): void; // You can get valid timezoneIds from GetAvailableTimeZones() + SetUseNintendoButtonLayout: any; + SetWindowed(value: boolean): void; - SpecifyGlobalCompatTool(strToolName: string): void; + SpecifyGlobalCompatTool(strToolName: string): void; - ToggleSteamInstall: any; + // "{"result":2,"message":""}" + ToggleSteamInstall(): any; } export interface SharedConnection { - AllocateSharedConnection: any; - Close: any; - RegisterOnBinaryMessageReceived: Unregisterable | any; - RegisterOnLogonInfoChanged: Unregisterable | any; - RegisterOnMessageReceived: Unregisterable | any; - SendMsg: any; - SendMsgAndAwaitBinaryResponse: any; - SubscribeToClientServiceMethod: any; - SubscribeToEMsg: any; + // hSharedConnection is the number from AllocateSharedConnection() + AllocateSharedConnection(): Promise; + // if no such number, sends this warning: + // src\clientdll\clientsharedconnection.cpp (154) : m_mapSharedConnections.HasElement( hSharedConnection ) + Close(hSharedConnection: number): void; + RegisterOnBinaryMessageReceived(hSharedConnection: number, callback: (param0: any) => void): Unregisterable | any; + RegisterOnLogonInfoChanged(hSharedConnection: number, callback: (info: LogonInfo) => void): Unregisterable | any; + RegisterOnMessageReceived(hSharedConnection: number, callback: (param0: any) => void): Unregisterable | any; + SendMsg: any; + SendMsgAndAwaitBinaryResponse: any; + SubscribeToClientServiceMethod(hSharedConnection: number, param1: any): any; + SubscribeToEMsg(hSharedConnection: number, param1: any): any; } export interface Stats { - // param0 - AppDetailsReviewSection, Showcases, LibraryReviewSpotlight - // param1 - - // AppDetailsReviewSection: PositiveClicked, NegativeClicked, NeutralClicked, PositiveReviewPosted, NegativeReviewPosted, EditClicked, ReviewCanceled - // LibraryReviewSpotlight: ReviseClicked, PositiveClicked, ReviseCloseClicked, NegativeClicked, PositiveRevisePosted, NegativeRevisePosted, ReviseCanceled, ReviewCanceled, CloseClicked - // Showcases: Delete, Save-Modify, Save-New - RecordActivationEvent(param0: string, param1: string): any; - RecordDisplayEvent: any; + // param0 - AppDetailsReviewSection, Showcases, LibraryReviewSpotlight + // param1 - + // AppDetailsReviewSection: PositiveClicked, NegativeClicked, NeutralClicked, PositiveReviewPosted, NegativeReviewPosted, EditClicked, ReviewCanceled + // LibraryReviewSpotlight: ReviseClicked, PositiveClicked, ReviseCloseClicked, NegativeClicked, PositiveRevisePosted, NegativeRevisePosted, ReviseCanceled, ReviewCanceled, CloseClicked + // Showcases: Delete, Save-Modify, Save-New + RecordActivationEvent(param0: string, param1: string): any; + RecordDisplayEvent: any; } export interface SteamChina { - GetCustomLauncherAppID: any; + GetCustomLauncherAppID: any; } export interface Storage { - DeleteKey: any; - GetJSON: any; - GetString: any; - SetObject: any; - SetString: any; + DeleteKey: any; + GetJSON: any; + GetString: any; + SetObject: any; + SetString: any; } export interface Streaming { - AcceptStreamingEULA: any; - CancelStreamGame(): void; // existing stream - - /** - * Registers a callback function to be called when the streaming client finishes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStreamingClientFinished(callback: (param0: number, description: string) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when there is progress in the launch of the streaming client. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStreamingClientLaunchProgress(callback: (actionType: string, param1: string, param2: number, param3: number) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when the streaming client is started (e.g., when clicking the stream button). - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStreamingClientStarted(callback: (appId: number) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when the streaming launch is complete. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @todo Param0 is likely a code, 1 being it started, 10 being host computer is updating game, param1 just returns "complete" - */ - RegisterForStreamingLaunchComplete(callback: (param0: number, param1: string) => void): Unregisterable | any; - - RegisterForStreamingShowEula: Unregisterable | any; - RegisterForStreamingShowIntro: Unregisterable | any; - - /** - * Registers a callback function to be called when the streaming client receives launch options from the host. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStreamingShowLaunchOptions(callback: (appId: number, launchOptions: LaunchOption[]) => void): Unregisterable | any; // Callback when streaming client receives launch options from host - - StreamingContinueStreamGame(): void; // existing game running on another streaming capable device - StreamingSetLaunchOption: any; + AcceptStreamingEULA: any; + CancelStreamGame(): void; // existing stream + + /** + * Registers a callback function to be called when the streaming client finishes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingClientFinished(callback: (param0: number, description: string) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when there is progress in the launch of the streaming client. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingClientLaunchProgress( + callback: (actionType: string, taskDetails: string, done: number, total: number) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when the streaming client is started (e.g., when clicking the stream button). + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingClientStarted(callback: (appId: number) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the streaming launch is complete. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @todo `code` is likely a code, 1 being it started, 10 being host computer is updating game, `result` just returns "complete" + */ + RegisterForStreamingLaunchComplete(callback: (code: number, result: string) => void): Unregisterable | any; + + RegisterForStreamingShowEula: Unregisterable | any; + RegisterForStreamingShowIntro: Unregisterable | any; + + /** + * Registers a callback function to be called when the streaming client receives launch options from the host. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingShowLaunchOptions( + callback: (appId: number, launchOptions: LaunchOption[]) => void, + ): Unregisterable | any; // Callback when streaming client receives launch options from host + + StreamingContinueStreamGame(): void; // existing game running on another streaming capable device + StreamingSetLaunchOption: any; } /** * Represents various functions related to Steam system audio. */ export interface Audio { - /** - * Clears the default device override for a specified audio type. - * @param {number} audioType - The audio type (0 for input, 1 for output). - * @returns {Promise} - A Promise indicating the result of the operation. - */ - ClearDefaultDeviceOverride(audioType: number): Promise; - - /** - * Retrieves information about audio applications. - * @returns {Promise} - A Promise that resolves to information about audio applications. - */ - GetApps(): Promise; - - /** - * Retrieves information about audio devices. - * @returns {Promise} - A Promise that resolves to information about audio devices. - */ - GetDevices(): Promise; - - /** - * Registers a callback to be called when a new audio application is added. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppAdded(callback: (appAudioAdded: ApplicationAudio) => void): Unregisterable | any; - - /** - * Registers a callback to be called when an audio application is removed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppRemoved(callback: (appAudioId: number) => void): Unregisterable | any; - - /** - * Registers a callback to be called when the volume of an audio application changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppVolumeChanged(callback: (appAudioId: number, volume: number) => void): Unregisterable | any; - - /** - * Registers a callback to be called when a new audio device is added. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDeviceAdded(callback: (audioDevice: Device) => void): Unregisterable | any; - - /** - * Registers a callback to be called when an audio device is removed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDeviceRemoved(callback: (audioDeviceId: number) => void): Unregisterable | any; - - /** - * Registers a callback to be called when the volume of an audio device changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDeviceVolumeChanged(callback: (audioDeviceId: number, audioType: number, volume: number) => void): Unregisterable | any; - - RegisterForServiceConnectionStateChanges: Unregisterable | any; - - /** - * Registers a callback to be called when volume buttons are pressed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForVolumeButtonPressed(callback: (volumeUpPressed: boolean) => void): Unregisterable | any; - - /** - * Sets the volume of an audio application. - * @param {number} appAudioId - The ID of the audio application. - * @param {number} volume - The volume level (floating point value between 0 and 1). - * @returns {Promise} - A Promise indicating the result of the operation. - */ - SetAppVolume(appAudioId: number, volume: number): Promise; - - /** - * Sets the default device override for a specified audio type. - * @param {number} audioDeviceId - The ID of the audio device. - * @param {number} audioType - The audio type (0 for input, 1 for output). - * @returns {Promise} - A Promise indicating the result of the operation. - */ - SetDefaultDeviceOverride(audioDeviceId: number, audioType: number): Promise; - - /** - * Sets the volume of an audio device. - * @param {number} audioDeviceId - The ID of the audio device. - * @param {number} audioType - The audio type (0 for input, 1 for output). - * @param {number} volume - The volume level (floating point value between 0 and 1). - * @returns {Promise} - A Promise indicating the result of the operation. - */ - SetDeviceVolume(audioDeviceId: number, audioType: number, volume: number): Promise; + /** + * Clears the default device override for a specified audio type. + * @param {number} audioType - The audio type (0 for input, 1 for output). + * @returns {Promise} - A Promise indicating the result of the operation. + */ + ClearDefaultDeviceOverride(audioType: number): Promise; + + /** + * Retrieves information about audio applications. + * @returns {Promise} - A Promise that resolves to information about audio applications. + */ + GetApps(): Promise; + + /** + * Retrieves information about audio devices. + * @returns {Promise} - A Promise that resolves to information about audio devices. + */ + GetDevices(): Promise; + + /** + * Registers a callback to be called when a new audio application is added. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppAdded(callback: (appAudioAdded: ApplicationAudio) => void): Unregisterable | any; + + /** + * Registers a callback to be called when an audio application is removed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppRemoved(callback: (appAudioId: number) => void): Unregisterable | any; + + /** + * Registers a callback to be called when the volume of an audio application changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppVolumeChanged(callback: (appAudioId: number, volume: number) => void): Unregisterable | any; + + /** + * Registers a callback to be called when a new audio device is added. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceAdded(callback: (audioDevice: Device) => void): Unregisterable | any; + + /** + * Registers a callback to be called when an audio device is removed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceRemoved(callback: (audioDeviceId: number) => void): Unregisterable | any; + + /** + * Registers a callback to be called when the volume of an audio device changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceVolumeChanged( + callback: (audioDeviceId: number, audioType: number, volume: number) => void, + ): Unregisterable | any; + + RegisterForServiceConnectionStateChanges: Unregisterable | any; + + /** + * Registers a callback to be called when volume buttons are pressed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForVolumeButtonPressed(callback: (volumeUpPressed: boolean) => void): Unregisterable | any; + + /** + * Sets the volume of an audio application. + * @param {number} appAudioId - The ID of the audio application. + * @param {number} volume - The volume level (floating point value between 0 and 1). + * @returns {Promise} - A Promise indicating the result of the operation. + */ + SetAppVolume(appAudioId: number, volume: number): Promise; + + /** + * Sets the default device override for a specified audio type. + * @param {number} audioDeviceId - The ID of the audio device. + * @param {number} audioType - The audio type (0 for input, 1 for output). + * @returns {Promise} - A Promise indicating the result of the operation. + */ + SetDefaultDeviceOverride(audioDeviceId: number, audioType: number): Promise; + + /** + * Sets the volume of an audio device. + * @param {number} audioDeviceId - The ID of the audio device. + * @param {number} audioType - The audio type (0 for input, 1 for output). + * @param {number} volume - The volume level (floating point value between 0 and 1). + * @returns {Promise} - A Promise indicating the result of the operation. + */ + SetDeviceVolume(audioDeviceId: number, audioType: number, volume: number): Promise; } export interface AudioDevice { - RegisterForStateChanges: Unregisterable | any; - UpdateSomething: any; + RegisterForStateChanges: Unregisterable | any; + UpdateSomething: any; } /** * Provides functionality for managing Bluetooth devices and interactions. */ export interface Bluetooth { - /** - * Cancels an ongoing pairing request with a Bluetooth device. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the Bluetooth device to cancel pairing with. - * @returns {Promise} - A Promise that resolves with the result of the cancellation. - */ - CancelPairing(adapterId: number, deviceId: number): Promise; - - /** - * Connects to a paired Bluetooth device using the specified adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the paired Bluetooth device to connect to. - * @returns {Promise} - A Promise that resolves with the result of the connection attempt. - */ - Connect(adapterId: number, deviceId: number): Promise; - - /** - * Disconnects from a currently connected Bluetooth device using the specified adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the connected Bluetooth device to disconnect from. - * @returns {Promise} - A Promise that resolves with the result of the disconnection. - */ - Disconnect(adapterId: number, deviceId: number): Promise; - - /** - * Initiates pairing with a Bluetooth device using the specified adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the Bluetooth device to initiate pairing with. - * @returns {Promise} - A Promise that resolves with the result of the pairing attempt. - */ - Pair(adapterId: number, deviceId: number): Promise; - - /** - * Registers a callback function to be called when the Bluetooth state changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStateChanges(callback: (bluetoothStateChange: BluetoothStateChange) => void): Unregisterable | any; - - /** - * Sets whether the Bluetooth adapter should be in discovering mode. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {boolean} value - `true` to enable discovering mode, `false` to disable it. - * @returns {Promise} - A Promise that resolves with the result of the operation. - */ - SetAdapterDiscovering(adapterId: number, value: boolean): Promise; - - /** - * Enables or disables Bluetooth functionality. - * @param {boolean} bluetooth - `true` to enable Bluetooth, `false` to disable it. - * @returns {Promise} - A Promise that resolves with the result of the operation. - */ - SetEnabled(bluetooth: boolean): Promise; - - /** - * Unpairs a Bluetooth device from the adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the Bluetooth device to unpair with. - * @returns {Promise} - A Promise that resolves with the result of the unpairing request. - */ - UnPair(adapterId: number, deviceId: number): Promise; + /** + * Cancels an ongoing pairing request with a Bluetooth device. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the Bluetooth device to cancel pairing with. + * @returns {Promise} - A Promise that resolves with the result of the cancellation. + */ + CancelPairing(adapterId: number, deviceId: number): Promise; + + /** + * Connects to a paired Bluetooth device using the specified adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the paired Bluetooth device to connect to. + * @returns {Promise} - A Promise that resolves with the result of the connection attempt. + */ + Connect(adapterId: number, deviceId: number): Promise; + + /** + * Disconnects from a currently connected Bluetooth device using the specified adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the connected Bluetooth device to disconnect from. + * @returns {Promise} - A Promise that resolves with the result of the disconnection. + */ + Disconnect(adapterId: number, deviceId: number): Promise; + + /** + * Initiates pairing with a Bluetooth device using the specified adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the Bluetooth device to initiate pairing with. + * @returns {Promise} - A Promise that resolves with the result of the pairing attempt. + */ + Pair(adapterId: number, deviceId: number): Promise; + + /** + * Registers a callback function to be called when the Bluetooth state changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStateChanges(callback: (bluetoothStateChange: BluetoothStateChange) => void): Unregisterable | any; + + /** + * Sets whether the Bluetooth adapter should be in discovering mode. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {boolean} value - `true` to enable discovering mode, `false` to disable it. + * @returns {Promise} - A Promise that resolves with the result of the operation. + */ + SetAdapterDiscovering(adapterId: number, value: boolean): Promise; + + /** + * Enables or disables Bluetooth functionality. + * @param {boolean} bluetooth - `true` to enable Bluetooth, `false` to disable it. + * @returns {Promise} - A Promise that resolves with the result of the operation. + */ + SetEnabled(bluetooth: boolean): Promise; + + /** + * Unpairs a Bluetooth device from the adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the Bluetooth device to unpair with. + * @returns {Promise} - A Promise that resolves with the result of the unpairing request. + */ + UnPair(adapterId: number, deviceId: number): Promise; } export interface Devkit { - DeveloperModeChanged: any; - RegisterForPairingPrompt: Unregisterable | any; - RespondToPairingPrompt: any; - SetPairing: any; + DeveloperModeChanged: any; + RegisterForPairingPrompt: Unregisterable | any; + RespondToPairingPrompt: any; + SetPairing: any; } export interface Display { - EnableUnderscan(param0: boolean): any; + EnableUnderscan(param0: boolean): any; - RegisterForBrightnessChanges(callback: (brightnessChanges: BrightnessChange) => void): Unregisterable | any; + RegisterForBrightnessChanges(callback: (brightnessChanges: BrightnessChange) => void): Unregisterable | any; - SetBrightness(brightness: number): any; + SetBrightness(brightness: number): any; - SetUnderscanLevel(param0: any): any; + SetUnderscanLevel(param0: any): any; } // CMsgSystemDisplayManagerState, CMsgSystemDisplayManagerSetMode export interface DisplayManager { - ClearModeOverride(displayId: any): any; - GetState: any; - RegisterForStateChanges(callback: () => void): Unregisterable | any; - SetCompatibilityMode(displayId: any): any; - SetGamescopeInternalResolution(width: number, height: number): any; - SetMode(base64: string): any; // + ClearModeOverride(displayId: any): any; + GetState: any; + RegisterForStateChanges(callback: () => void): Unregisterable | any; + SetCompatibilityMode(displayId: any): any; + SetGamescopeInternalResolution(width: number, height: number): any; + SetMode(base64: string): any; // } // CMsgSystemDockUpdateFirmware, CMsgSystemDockState export interface Dock { - DisarmSafetyNet(): void; + DisarmSafetyNet(): void; - RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; // Deserialize binary + RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; // Deserialize binary - UpdateFirmware(base64String: string): any; // serialize base64 string + UpdateFirmware(base64String: string): any; // serialize base64 string } export interface WirelessNetwork { - Forget: any; - SetAutoconnect: any; + Forget: any; + SetAutoconnect: any; } export interface NetworkDevice { - Connect(param0: any): any; // some base64 serialized string - Disconnect: any; - WirelessNetwork: WirelessNetwork; + Connect(param0: any): any; // some base64 serialized string + Disconnect: any; + WirelessNetwork: WirelessNetwork; } export interface Network { - Device: NetworkDevice; + Device: NetworkDevice; - ForceRefresh(): Promise; + ForceRefresh(): Promise; - ForceTestConnectivity(): void; + ForceTestConnectivity(): void; - GetProxyInfo(): Promise; + GetProxyInfo(): Promise; - RegisterForAppSummaryUpdate: Unregisterable | any; - RegisterForConnectionStateUpdate: Unregisterable | any; + RegisterForAppSummaryUpdate: Unregisterable | any; + RegisterForConnectionStateUpdate: Unregisterable | any; - RegisterForConnectivityTestChanges(callback: (connectivityTestChange: ConnectivityTestChange) => void): Unregisterable | any; + RegisterForConnectivityTestChanges( + callback: (connectivityTestChange: ConnectivityTestChange) => void, + ): Unregisterable | any; - RegisterForDeviceChanges(callback: (param0: any) => void): Unregisterable | any; + RegisterForDeviceChanges(callback: (param0: any) => void): Unregisterable | any; - SetFakeLocalSystemState(param0: any): any; // enums + SetFakeLocalSystemState(param0: any): any; // enums - SetProxyInfo(mode: number, address: string, port: number, excludeLocal: boolean): void; + SetProxyInfo(mode: number, address: string, port: number, excludeLocal: boolean): void; - SetWifiEnabled(value: boolean): Promise; + SetWifiEnabled(value: boolean): Promise; - StartScanningForNetworks(): Promise; + StartScanningForNetworks(): Promise; - StopScanningForNetworks(): Promise; + StopScanningForNetworks(): Promise; } // CMsgSystemPerfUpdateSettings, CMsgSystemPerfState, CMsgSystemPerfSettings export interface Perf { - RegisterForDiagnosticInfoChanges(callback: (param0: any) => void): Unregisterable | any; // deserialize binary - RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; // deserialize binary - UpdateSettings(base64: string): any; // serialize + RegisterForDiagnosticInfoChanges(callback: (param0: any) => void): Unregisterable | any; // deserialize binary + RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; // deserialize binary + UpdateSettings(base64: string): any; // serialize } // CMsgGenerateSystemReportReply export interface Report { - GenerateSystemReport: any; - SaveToDesktop: any; - Submit: any; + GenerateSystemReport: any; + SaveToDesktop: any; + Submit: any; } export interface SystemUI { - CloseGameWindow: any; - GetGameWindowsInfo: any; - RegisterForFocusChangeEvents(callback: (param0: any) => void): Unregisterable | any; - RegisterForOverlayGameWindowFocusChanged: Unregisterable | any; - - RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable | any; // eKey + CloseGameWindow(appId: number, windowId: number): void; + GetGameWindowsInfo(appId: number, windowIds: number[]): Promise; + RegisterForFocusChangeEvents(callback: (event: FocusChangeEvent) => void): Unregisterable | any; + RegisterForOverlayGameWindowFocusChanged(callback: (param0: number, param1: number) => void): Unregisterable | any; + RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable | any; // eKey } export interface System { - Audio: Audio; - AudioDevice: AudioDevice; - Bluetooth: Bluetooth; - Devkit: Devkit; - Display: Display; - DisplayManager: DisplayManager; - Dock: Dock; - ExitFakeCaptivePortal: any; - FactoryReset: any; - FormatStorage: any; + Audio: Audio; + AudioDevice: AudioDevice; + Bluetooth: Bluetooth; + Devkit: Devkit; + Display: Display; + DisplayManager: DisplayManager; + Dock: Dock; + ExitFakeCaptivePortal(): any; + FactoryReset(): any; + FormatStorage(forceFormat: boolean): any; - GetLegacyAmpControlEnabled(): Promise; // {"bAvailable":true,"bEnabled":false} + GetLegacyAmpControlEnabled(): Promise; // {"bAvailable":true,"bEnabled":false} + GetOSType(): Promise; - GetOSType(): Promise; + GetSystemInfo(): Promise; - GetSystemInfo(): Promise; + IsDeckFactoryImage(): Promise; - IsDeckFactoryImage(): Promise; + IsSteamInTournamentMode(): Promise; - IsSteamInTournamentMode(): Promise; + Network: Network; + NotifyGameOverlayStateChanged(latestAppOverlayStateActive: boolean, appId: number): any; - Network: Network; - NotifyGameOverlayStateChanged(param0: boolean, appId: number): any; + /** + * Open a dialog for choosing a file. + * @param {FileDialog} prefs - Dialog preferences. + * @returns {Promise} A Promise that resolves to the selected file name. + * @throws Throws if no file was selected. + */ + OpenFileDialog(prefs: FileDialog): Promise; - /* - { - strTitle: (0, o.Localize)("#AddNonSteam_PickAppTitle"), - rgFilters: y(), - strInitialFile: t - } - */ - OpenFileDialog(param0: any): any; - OpenLocalDirectoryInSystemExplorer(directory: string): void; // Opens local directory in system explorer - Perf: Perf; - RebootToAlternateSystemPartition: any; - RebootToFactoryTestImage: any; + /** + * Open a URL in the default web browser. + * @returns {void} + */ + OpenInSystemBrowser(url: string): void; - RegisterForAirplaneModeChanges(callback: (airplaneModeChange: AirplaneModeChange) => void): Unregisterable | any; + OpenLocalDirectoryInSystemExplorer(directory: string): void; // Opens local directory in system explorer + Perf: Perf; + RebootToAlternateSystemPartition: any; + RebootToFactoryTestImage: any; - RegisterForBatteryStateChanges(callback: (batteryStateChange: BatteryStateChange) => void): Unregisterable | any; + RegisterForAirplaneModeChanges(callback: (airplaneModeChange: AirplaneModeChange) => void): Unregisterable | any; - RegisterForFormatStorageProgress(callback: () => void): Unregisterable | any; // {"flProgress":0,"rtEstimatedCompletionTime":0,"eStage":1} + RegisterForBatteryStateChanges(callback: (batteryStateChange: BatteryStateChange) => void): Unregisterable | any; - RegisterForOnResumeFromSuspend(callback: () => void): Unregisterable | any; + RegisterForFormatStorageProgress(callback: () => void): Unregisterable | any; // {"flProgress":0,"rtEstimatedCompletionTime":0,"eStage":1} - RegisterForOnSuspendRequest(callback: () => void): Unregisterable | any; + RegisterForOnResumeFromSuspend(callback: () => void): Unregisterable | any; - RegisterForSettingsChanges: Unregisterable | any; // deserialize binary - Report: Report; + RegisterForOnSuspendRequest(callback: () => void): Unregisterable | any; - /** - * Restarts the system. - */ - RestartPC(): any; + RegisterForSettingsChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; // deserialize binary + Report: Report; - SetAirplaneMode(enabled: boolean): void; + /** + * Restarts the system. + */ + RestartPC(): any; - SetLegacyAmpControl: any; + SetAirplaneMode(value: boolean): void; - ShutdownPC(): any; + SetLegacyAmpControl: any; - SteamRuntimeSystemInfo: any; + ShutdownPC(): any; - /** - * Suspends the system. - */ - SuspendPC(): any; + SteamRuntimeSystemInfo(): Promise; - /** - * Switches to desktop mode. - */ - SwitchToDesktop(): any; + /** + * Suspends the system. + */ + SuspendPC(): any; + + /** + * Switches to desktop mode. + */ + SwitchToDesktop(): any; - UI: SystemUI; - UpdateSettings: any; + UI: SystemUI; + UpdateSettings: any; } export interface UI { - EnsureMainWindowCreated: any; - ExitBigPictureMode: any; - GetDesiredSteamUIWindows: any; - GetOSEndOfLifeInfo: any; - - /** - * Retrieves the current UI mode. - * @returns {Promise} - A Promise that resolves to the current UI mode. - * 4 represents Deck Mode/Big Picture Mode. - * 7 represents Desktop Mode. - */ - GetUIMode(): Promise; - - NotifyAppInitialized: any; - RegisterDesiredSteamUIWindowsChanged: Unregisterable | any; - RegisterForKioskModeResetSignal: Unregisterable | any; - RegisterForUIModeChanged: Unregisterable | any; - ResetErrorCondition: any; - - /** - * Sets the UI mode to the specified value. - * @param {number} mode - The UI mode to set. Use values: - * - 4 for Deck Mode/Big Picture Mode. - * - 7 for Desktop Mode. - * @returns {void} - */ - SetUIMode(mode: number): void; + EnsureMainWindowCreated(): void; + ExitBigPictureMode(): void; + + GetDesiredSteamUIWindows(): Promise; + + /** + * Gets information about whether your OS will be unsupported in the future or not. + * @returns {Promise} + */ + GetOSEndOfLifeInfo(): Promise; + + /** + * Retrieves the current UI mode. + * @returns {Promise} - A Promise that resolves to the current UI mode. + */ + GetUIMode(): Promise; + + NotifyAppInitialized(): void; + RegisterDesiredSteamUIWindowsChanged: Unregisterable | any; + RegisterForErrorCondition(callback: (param0: number, param1: number) => void): Unregisterable | any; + RegisterForKioskModeResetSignal: Unregisterable | any; + RegisterForUIModeChanged(callback: (mode: UIMode) => void): Unregisterable | any; + ResetErrorCondition(): void; + + /** + * Sets the UI mode to the specified value. + * @param {UIMode} mode - The UI mode to set. + * @returns {void} + */ + SetUIMode(mode: UIMode): void; } export interface URL { - ExecuteSteamURL(url: string): void; - GetSteamURLList: any; - GetWebSessionID: any; - RegisterForRunSteamURL: Unregisterable | any; - RegisterForSteamURLChanges: Unregisterable | any; + /** + * Executes a steam:// URL. + * @param url The URL to execute. + */ + ExecuteSteamURL(url: string): void; + + /** + * @remarks The array may be empty. + */ + GetSteamURLList(param0: string[]): Promise; + + GetWebSessionID(): Promise; + + /** + * Registers a callback to be called when a steam:// URL gets executed. + * @param {string} section - `rungameid`, `open`, etc. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForRunSteamURL(section: string, callback: (param0: number, url: string) => void): Unregisterable | any; + + RegisterForSteamURLChanges(callback: () => void): void; } export interface Updates { - ApplyUpdates: any; + ApplyUpdates(param0: string): Promise; - CheckForUpdates(): Promise; // Checks for software updates - GetCurrentOSBranch(): Promise; + CheckForUpdates(): Promise; // Checks for software updates - RegisterForUpdateStateChanges: Unregisterable | any; + GetCurrentOSBranch(): Promise; - // 1 - Stable, 2 - Beta, 3 - Preview - SelectOSBranch(branch: number): any; // enum? + RegisterForUpdateStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + + // 1 - Stable, 2 - Beta, 3 - Preview + SelectOSBranch(branch: number): any; // enum? } export interface User { - AuthorizeMicrotxn(txnId: any): any; - CancelLogin: any; - CancelMicrotxn(txnId: any): any; - CancelShutdown: any; - ChangeUser: any; - Connect(): any; - FlipToLogin: any; - ForceShutdown: any; - ForgetPassword: any; + AuthorizeMicrotxn(txnId: any): any; + CancelLogin: any; + CancelMicrotxn(txnId: any): any; - GetIPCountry(): Promise; + /** + * Tries to cancel Steam shutdown. + * @returns {void} + * @remarks Used in the "Shutting down" dialog. + */ + CancelShutdown(): void; - GetLoginProgress: any; + /** + * Opens the "Change Account" dialog. + * @returns {void} + */ + ChangeUser(): void; - GetLoginUsers(): Promise; + Connect(): Promise; - GoOffline(): void; + FlipToLogin(): void; - GoOnline(): void; + /** + * Forces a shutdown while shutting down. + * @returns {void} + * @remarks Used in the "Shutting down" dialog. + */ + ForceShutdown(): void; - OptOutOfSurvey: any; - PrepareForSystemSuspend: any; - Reconnect: any; + /** + * Forgets an account's password. + * @param {string} accountName - Login of the account to forget. + * @returns {Promise} A Promise that resolves to a boolean indicating whether the operation succeeded or not. + */ + ForgetPassword(accountName: string): Promise; - RegisterForConnectionAttemptsThrottled(callback: (param0: any) => void): Unregisterable | any; + /** + * Gets your country code. + * @returns {Promise} A Promise that resolves to a string containing your country code. + */ + GetIPCountry(): Promise; - RegisterForCurrentUserChanges(callback: (data: any) => void): Unregisterable | any; + GetLoginProgress(callback: (param0: number, param1: number) => void): Unregisterable | any; - RegisterForLoginStateChange(callback: (username: string) => void): Unregisterable | any; + GetLoginUsers(): Promise; - RegisterForPrepareForSystemSuspendProgress(callback: (data: any) => void): Unregisterable | any; + GoOffline(): void; - RegisterForResumeSuspendedGamesProgress: Unregisterable | any; + GoOnline(): void; - RegisterForShutdownDone(callback: () => void): Unregisterable | any; + OptOutOfSurvey(): void; + PrepareForSystemSuspend(): any; + Reconnect(): void; - RegisterForShutdownFailed: Unregisterable | any; + RegisterForConnectionAttemptsThrottled(callback: (param0: any) => void): Unregisterable | any; - /** - * Register a function to be executed when a shutdown start is detected. - * @param callback The function to be executed on shutdown start. - */ - RegisterForShutdownStart(callback: () => void): Unregisterable | any; - - RegisterForShutdownState: Unregisterable | any; - RemoveUser: any; - RequestSupportSystemReport: any; - ResumeSuspendedGames: any; - - // Hardware survey information - RunSurvey(callback: (surveySections: SurveySection[]) => void): void; - - SendSurvey: any; - SetAsyncNotificationEnabled(appId: number, enable: boolean): any; - SetLoginCredentials: any; - SetOOBEComplete: any; - ShouldShowUserChooser: any; - SignOutAndRestart: any; - StartLogin: any; - StartOffline(param0: boolean): any; - - /** - * Restarts the Steam client. - */ - StartRestart(): any; + RegisterForCurrentUserChanges(callback: (data: any) => void): Unregisterable | any; + + RegisterForLoginStateChange(callback: (username: string) => void): Unregisterable | any; + + RegisterForPrepareForSystemSuspendProgress(callback: (data: any) => void): Unregisterable | any; + + RegisterForResumeSuspendedGamesProgress: Unregisterable | any; + + RegisterForShutdownDone(callback: () => void): Unregisterable | any; + + RegisterForShutdownFailed: Unregisterable | any; + + /** + * Register a function to be executed when a shutdown start is detected. + * @param callback The function to be executed on shutdown start. + */ + RegisterForShutdownStart(callback: () => void): Unregisterable | any; + + RegisterForShutdownState: Unregisterable | any; + + /** + * Removes an account from remembered users. + * @param {string} accountName - The account to remove. + * @returns {void} + */ + RemoveUser(accountName: string): void; + + RequestSupportSystemReport: any; + ResumeSuspendedGames(param0: boolean): any; + + // Hardware survey information + RunSurvey(callback: (surveySections: SurveySection[]) => void): void; + + SendSurvey: any; + SetAsyncNotificationEnabled(appId: number, enable: boolean): any; - StartShutdown(flag: boolean): any; + /** + * Sets given login credentials, but don't log in to that account. + * @param {string} accountName - Account name. + * @param {string} password - Account password. + * @param {boolean} rememberMe - Whether to remember that account. + * @returns {void} + */ + SetLoginCredentials(accountName: string, password: string, rememberMe: boolean): void; + + SetOOBEComplete(): void; + ShouldShowUserChooser(): Promise; + + /** + * Signs out and restarts Steam. + * @returnsn {void} + */ + SignOutAndRestart(): void; + + StartLogin(): void; + + // is param0 offline mode? + StartOffline(param0: boolean): any; + + /** + * Restarts the Steam client. + */ + StartRestart(): any; + + StartShutdown(flag: boolean): any; } export interface WebChat { - BSuppressPopupsInRestore: any; - GetCurrentUserAccountID: any; - GetLocalAvatarBase64: any; - GetLocalPersonaName: any; - GetOverlayChatBrowserInfo: any; - GetPrivateConnectString: any; - GetPushToTalkEnabled: any; - GetSignIntoFriendsOnStart: any; - GetUIMode: any; - OnGroupChatUserStateChange: any; - OpenURLInClient(url: string, param1: any, param2: any): any; - RegisterForComputerActiveStateChange: Unregisterable | any; - RegisterForFriendPostMessage: Unregisterable | any; - RegisterForMouseXButtonDown: Unregisterable | any; - RegisterForPushToTalkStateChange: Unregisterable | any; - RegisterForUIModeChange: Unregisterable | any; - RegisterOverlayChatBrowserInfoChanged: Unregisterable | any; - SetActiveClanChatIDs: any; - SetNumChatsWithUnreadPriorityMessages: any; - SetPersonaName: any; - SetPushToMuteEnabled: any; - SetPushToTalkEnabled: any; - SetPushToTalkHotKey: any; - SetPushToTalkMouseButton: any; - SetVoiceChatActive: any; - SetVoiceChatStatus: any; - ShowChatRoomGroupDialog: any; - ShowFriendChatDialog: any; - UnregisterForMouseXButtonDown: any; + BSuppressPopupsInRestore(): Promise; + + /** + * Gets your Steam3 ID. + * @returns {Promise} A Promise that resolves to a Steam3 ID. + */ + GetCurrentUserAccountID(): Promise; + + /** + * Gets the current user's 64x64 avatar as a data URL. + * @returns {Promise} A Promise that resolves to the data URL. + */ + GetLocalAvatarBase64(): Promise; + + /** + * Gets the current user's nickname. + * @returns {Promise} A Promise that resolves to the nickname. + */ + GetLocalPersonaName(): Promise; + + GetOverlayChatBrowserInfo(): Promise; + + // param0 - appid ? + GetPrivateConnectString(param0: number): Promise; + + /** + * Gets information about push-to-Talk. + * @returns {Promise} + */ + GetPushToTalkEnabled(): Promise; + + /** + * Gets the "Sign in to friends when Steam starts" option value. + * @returns {Promise} A Promise that resolves to a boolean indicating whether the option is enabled or not. + */ + GetSignIntoFriendsOnStart(): Promise; + + /** + * Retrieves the current UI mode. + * @returns {Promise} - A Promise that resolves to the current UI mode. + */ + GetUIMode(): Promise; + + OnGroupChatUserStateChange(chatGroupId: any, accountId: any, param2: any): any; + + OnNewGroupChatMsgAdded( + groupId: number, + chatId: number, + accountId: number, + timestamp: number, + param4: number, + message: string, + ): any; + + // Opens the URL in default web browser, despite what the name says ? + OpenURLInClient(url: string, pid: number, forceExternal: boolean): void; + + /** + * Registers a callback function to be called when the computer's active state changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @todo Changes to 2 after 10 seconds? + * @todo Does not affect the keyboard? + */ + RegisterForComputerActiveStateChange( + callback: (state: ComputerActiveState, time: number) => void, + ): Unregisterable | any; + + /** + * @todo WebChat.ShowFriendChatDialog does this. + */ + RegisterForFriendPostMessage(callback: (data: FriendChatDialogData) => void): Unregisterable | any; + + /** + * @returns {void} + * @todo To unregister, use WebChat.UnregisterForMouseXButtonDown() ? + */ + RegisterForMouseXButtonDown(callback: any): void; + + /** + * Registers a callback function to be called when the push-to-talk state changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForPushToTalkStateChange(callback: (state: boolean) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the UI mode is changed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForUIModeChange(callback: (mode: UIMode) => void): Unregisterable | any; + + RegisterOverlayChatBrowserInfoChanged(callback: any): Unregisterable | any; + SetActiveClanChatIDs(param0: any[]): any; + SetNumChatsWithUnreadPriorityMessages(param0: number): void; + SetPersonaName: any; + SetPushToMuteEnabled(value: boolean): any; + SetPushToTalkEnabled(value: boolean): any; + SetPushToTalkHotKey(param0: number): void; + SetPushToTalkMouseButton(param0: number): void; + SetVoiceChatActive: any; + SetVoiceChatStatus: any; + ShowChatRoomGroupDialog: any; + + /** + * @todo Does not actually show the dialog. + */ + ShowFriendChatDialog(steamid: string): void; + + UnregisterForMouseXButtonDown(): void; } export interface WebUITransport { - GetTransportInfo(): any; + GetTransportInfo(): Promise; } +/** + * Represents functionality for managing Steam's windows. + */ export interface Window { - BringToFront(param0: any): any; // param0 optional? - Close(): any; - DefaultMonitorHasFullscreenWindow: any; - FlashWindow: any; - GetDefaultMonitorDimensions: any; - GetMousePositionDetails: any; - GetWindowDimensions: any; - GetWindowRestoreDetails(callback: (param0: any) => void): any; - HideWindow(): any; - IsWindowMaximized: any; - IsWindowMinimized: any; - MarkLastFocused: any; - Minimize: any; - MoveTo(x: number, y: number, ratio: number): any; - MoveToLocation: any; - // Takes param0 from callback of GetWindowRestoreDetails - PositionWindowRelative(param0: any, x: number, y: number, width: number, height: number): any; - ProcessShuttingDown: any; - ResizeTo(width: number, height: number, ratio: number): any; - RestoreWindowSizeAndPosition: any; - SetAutoDisplayScale(param0: any): any; - SetComposition(uiComposition: UIComposition, appIds: number[], param2: number): any; - SetHideOnClose(param0: boolean): any; - SetKeyFocus: any; - SetManualDisplayScaleFactor(param0: any): any; - SetMaxSize: any; - SetMinSize: any; - SetModal: any; - SetResizeGrip(width: number, height: number): any; - SetWindowIcon: any; - ShowWindow(): any; - StopFlashWindow: any; - ToggleFullscreen: any; - ToggleMaximize: any; + BringToFront(forceOS: WindowBringToFront | undefined): any; + + /** + * @todo Shuts down Steam too? + */ + Close(): any; + + /** + * Is the Steam window fullscreen? + * @param {function} callback - The callback function to be called to receive the fullscreen state. + * @returns {void} + */ + DefaultMonitorHasFullscreenWindow(callback: (fullscreen: boolean) => void): void; + + /** + * Flashes the window in the taskbar. + * @returns {void} + */ + FlashWindow(): void; + + /** + * @todo Returns 0? + */ + GetDefaultMonitorDimensions(callback: (param0: number) => void): void; + + GetMousePositionDetails(callback: (details: string) => void): void; + + /** + * Gets the window X position. + * @param {function} callback - The callback function to be called to receive the X position. + * @returns {void} + */ + GetWindowDimensions(callback: (x: number) => void): void; + + GetWindowRestoreDetails(callback: (details: string) => void): void; + + /** + * Hides the window. + * @returns {void} + */ + HideWindow(): void; + + /** + * Is the window maximized? + * @param {function} callback - The callback function to be called to receive the maximized state. + * @returns {void} + */ + IsWindowMaximized(callback: (maximized: boolean) => void): void; + + /** + * Is the window minimized? + * @param {function} callback - The callback function to be called to receive the minimized state. + * @returns {void} + */ + IsWindowMinimized(callback: (minimized: boolean) => void): void; + + MarkLastFocused(): void; + + /** + * Minimizes the window. + * @returns {void} + */ + Minimize(): void; + + /** + * Moves the window to given coordinates. + * @param {number} x - Window X position. + * @param {number} y - Window Y position. + * @param {number | undefined} dpi - Screen DPI. + * @returns {void} + */ + MoveTo(x: number, y: number, dpi: number | undefined): void; + + /** + * Moves the window to a given location. + * @param {string} location - Window location. + * @param {number | undefined} offset - X/Y offset. + * @returns {void} + */ + MoveToLocation(location: WindowLocation, offset: number | undefined): void; + + /** + * Moves the window relatively to given details. + * @param {string} details - Window details string from `Window.GetWindowRestoreDetails`. + * @param {number} x - Window X position. + * @param {number} y - Window Y position. + * @param {number} width - Window width. + * @param {number} height - Window height. + * @returns {void} + * + * @example + * Move the window to bottom right by 50 pixels: + * ``` + * SteamClient.Window.GetWindowRestoreDetails(e => { + * SteamClient.Window.PositionWindowRelative(e, 50, 50, 0, 0); + * }) + * ``` + */ + PositionWindowRelative(details: string, x: number, y: number, width: number, height: number): void; + + ProcessShuttingDown(): Promise; + + /** + * Resizes the window to given dimension. + * @param {number} width - Window width. + * @param {number} height - Window height. + * @param {boolean | number} applyBrowserScaleOrDPIValue + * @returns {void} + */ + ResizeTo(width: number, height: number, applyBrowserScaleOrDPIValue: boolean | number): void; + + /** + * Moves the window to given details. + * @param {string} details - Window details string from `Window.GetWindowRestoreDetails`. + * @returns {void} + */ + RestoreWindowSizeAndPosition(details: string): void; + + SetAutoDisplayScale(value: boolean): void; + SetComposition(uiComposition: UIComposition, appIds: number[], windowId: number): any; + + /** + * Makes the window hide, but not close on pressing the close button. + * @param {boolean} value - Hide on close? + * @returns {void} + */ + SetHideOnClose(value: boolean): void; + + SetKeyFocus(value: boolean): void; + SetManualDisplayScaleFactor(displayScaleFactor: number): void; + + /** + * Sets the window's max size. + * @param {number} width - Window's max width. + * @param {number} height - Window's max height. + * @returns {void} + */ + SetMaxSize(width: number, height: number): void; + + /** + * Sets the window's min size. + * @param {number} width - Window's max width. + * @param {number} height - Window's max height. + * @returns {void} + */ + SetMinSize(width: number, height: number): void; + + SetModal(value: boolean): void; + + /** + * Sets the window's resize grip size. + * @param {number} width - Resize grip width. + * @param {number} height - Resize grip height. + * @returns {void} + */ + SetResizeGrip(width: number, height: number): void; + + /** + * Set the window's icon. + * @param {WindowIcon} icon - The window icon to be used. + * @returns {void} + */ + SetWindowIcon(icon: WindowIcon): void; + + /** + * Shows the window. + * @returns {void} + */ + ShowWindow(): void; + + /** + * Stops the window's taskbar flashing. + * @returns {void} + */ + StopFlashWindow(): void; + + /** + * Toggles the window's fullscreen state. + * @returns {void} + */ + ToggleFullscreen(): void; + + /** + * Toggles the window's maximized state. + * @returns {void} + */ + ToggleMaximize(): void; } export interface SteamClient { - Apps: Apps; - Auth: Auth; - Broadcast: Broadcast; - Browser: Browser; - BrowserView: BrowserView; - ClientNotifications: ClientNotifications; - Cloud: Cloud; - CommunityItems: CommunityItems; - Console: Console; - Customization: Customization; - Downloads: Downloads; - FamilySharing: FamilySharing; - Features: Features; - FriendSettings: FriendSettings; - Friends: Friends; - GameNotes: GameNotes; - GameSessions: GameSessions; - Input: Input; - InstallFolder: InstallFolder; - Installs: Installs; - MachineStorage: Storage; - Messaging: Messaging; - Music: Music; - Notifications: Notifications; - OpenVR: OpenVR; - Overlay: Overlay; - Parental: Parental; - RemotePlay: RemotePlay; - RoamingStorage: Storage; - Screenshots: Screenshots; - ServerBrowser: ServerBrowser; - Settings: Settings; - SharedConnection: SharedConnection; - Stats: Stats; - SteamChina: SteamChina; - Storage: Storage; - Streaming: Streaming; - System: System; - UI: UI; - URL: URL; - Updates: Updates; - User: User; - WebChat: WebChat; - WebUITransport: WebUITransport; - Window: Window; + Apps: Apps; + Auth: Auth; + Broadcast: Broadcast; + Browser: Browser; + BrowserView: BrowserView; + ClientNotifications: ClientNotifications; + Cloud: Cloud; + CommunityItems: CommunityItems; + Console: Console; + Customization: Customization; + Downloads: Downloads; + FamilySharing: FamilySharing; + Features: Features; + FriendSettings: FriendSettings; + Friends: Friends; + GameNotes: GameNotes; + GameSessions: GameSessions; + Input: Input; + InstallFolder: InstallFolder; + Installs: Installs; + MachineStorage: Storage; + Messaging: Messaging; + Music: Music; + Notifications: Notifications; + OpenVR: OpenVR; + Overlay: Overlay; + Parental: Parental; + RemotePlay: RemotePlay; + RoamingStorage: Storage; + Screenshots: Screenshots; + ServerBrowser: ServerBrowser; + Settings: Settings; + SharedConnection: SharedConnection; + Stats: Stats; + SteamChina: SteamChina; + Storage: Storage; + Streaming: Streaming; + System: System; + UI: UI; + URL: URL; + Updates: Updates; + User: User; + WebChat: WebChat; + WebUITransport: WebUITransport; + Window: Window; } export interface SteamShortcut { - appid: number; - data: Shortcut; + appid: number; + data: Shortcut; } export interface Shortcut { - bIsApplication: boolean; - strAppName: string; - strExePath: string; - strArguments: string; - strCmdline: string; - strShortcutPath: string | undefined; - strSortAs: string | undefined; - strIconDataBase64: string | undefined; + bIsApplication: boolean; + strAppName: string; + strExePath: string; + strArguments: string; + strCmdline: string; + strShortcutPath: string | undefined; + strSortAs: string | undefined; + strIconDataBase64: string | undefined; } /** * @prop unAppID is not properly set by Steam for non-steam game shortcuts, so it defaults to 0 for them */ export interface AppLifetimeNotification { - unAppID: number; - nInstanceID: number; - bRunning: boolean; + unAppID: number; + nInstanceID: number; + bRunning: boolean; } export type AppAchievements = { - nAchieved: number; - nTotal: number; - vecAchievedHidden: any[]; - vecHighlight: any[]; - vecUnachieved: any[]; + nAchieved: number; + nTotal: number; + vecAchievedHidden: AppAchievement[]; + vecHighlight: AppAchievement[]; + vecUnachieved: AppAchievement[]; }; -export type AppLanguages = { - strDisplayName: string; - strShortName: string; +export type AppLanguage = { + strDisplayName: string; + /** A localization string for the language. */ + strShortName: string; }; export type LogoPinPositions = 'BottomLeft' | 'UpperLeft' | 'CenterCenter' | 'UpperCenter' | 'BottomCenter'; +export type ServerBrowserTab = 'internet' | 'favorites' | 'history' | 'lan' | 'friends'; + +export type WindowLocation = + | 'upper-left' + | 'lower-left' + | 'center-top' + | 'center-bottom' + | 'center-bottom' + | 'upper-right' + | 'lower-right'; + +export type WindowIcon = 'steam' | 'messages' | 'voice'; + +export type BrowserViewEvent = + | 'alert-dialog' + | 'before-close' + | 'blocked-request' + | 'can-go-back-forward-changed' + | 'confirm-dialog' + | 'favicon-urls-changed' + | 'find-in-page-results' + | 'finished-request' + | 'focus-changed' + | 'full-screen' + | 'history-changed' + | 'load-error' + | 'message' + | 'new-tab' + | 'node-has-focus' + | 'page-security' + | 'set-title' + | 'start-loading' + | 'start-request' + | 'toggle-find-in-page'; + export interface LogoPosition { - pinnedPosition: LogoPinPositions; - nWidthPct: number; - nHeightPct: number; + pinnedPosition: LogoPinPositions; + nWidthPct: number; + nHeightPct: number; } export interface AppData { - details: AppDetails; - // more + details: AppDetails; + // more +} + +export interface AppDeckDerivedProperties { + gamescope_frame_limiter_not_supported?: boolean; + non_deck_display_glyphs: boolean; + primary_player_is_controller_slot_0: boolean; + requires_h264: boolean; + requires_internet_for_setup: boolean; + requires_internet_for_singleplayer: boolean; + requires_manual_keyboard_invoke: false; + requires_non_controller_launcher_nav: false; + small_text: boolean; + supported_input: number; +} + +export interface AppLibraryAssets { + logoPosition?: LogoPosition; + strCapsuleImage: string; + strHeroBlurImage: string; + strHeroImage: string; + strLogoImage: string; +} + +export interface AppBeta { + /** Beta name. */ + strName: string; + /** Beta description. */ + strDescription: string; +} + +export interface DeckCompatTestResult { + // enum ? + test_result: number; + /** A localization string. */ + test_loc_token: string; +} + +export interface AppDLC { + /** Is the DLC availble on the store? */ + bAvailableOnStore: boolean; + bEnabled: boolean; + /** Disk usage, in bytes. */ + lDiskUsageBytes: number; + /** Purchase date. */ + rtPurchaseDate: number; + rtStoreAssetModifyType: number; + /** Store header image filename. */ + strHeaderFilename: string; + /** Display name. */ + strName: string; + /** State (installed/notinstalled). */ + strState: string; + /** App ID. */ + unAppID: number; +} + +export interface AppSoundtrack { + /** Purchase date. */ + rtPurchaseDate: number; + rtStoreAssetModifyType: number; + /** Display name. */ + strName: string; + /** State (installed/notinstalled). */ + strState: string; + /** App ID. */ + unAppID: number; } export interface AppDetails { - achievements: AppAchievements; - bCanMoveInstallFolder: boolean; - bCloudAvailable: boolean; - bCloudEnabledForAccount: boolean; - bCloudEnabledForApp: boolean; - bCloudSyncOnSuspendAvailable: boolean; - bCloudSyncOnSuspendEnabled: boolean; - bCommunityMarketPresence: boolean; - bEnableAllowDesktopConfiguration: boolean; - bFreeRemovableLicense: boolean; - bHasAllLegacyCDKeys: boolean; - bHasAnyLocalContent: boolean; - bHasLockedPrivateBetas: boolean; - bIsExcludedFromSharing: boolean; - bIsSubscribedTo: boolean; - bOverlayEnabled: boolean; - bOverrideInternalResolution: boolean; - bRequiresLegacyCDKey: boolean; - bShortcutIsVR: boolean; - bShowCDKeyInMenus: boolean; - bShowControllerConfig: boolean; - bSupportsCDKeyCopyToClipboard: boolean; - bVRGameTheatreEnabled: boolean; - bWorkshopVisible: boolean; - eAppOwnershipFlags: AppOwnershipFlags | number; // is this a bitmask? - eAutoUpdateValue: number; - eBackgroundDownloads: number; - eCloudSync: number; - eControllerRumblePreference: number; // ControllerRumbleSetting? - eDisplayStatus: DisplayStatus; - eEnableThirdPartyControllerConfiguration: number; - eSteamInputControllerMask: number; - iInstallFolder: number; - lDiskUsageBytes: number; - lDlcUsageBytes: number; - nBuildID: number; - nCompatToolPriority: number; - nPlaytimeForever: number; - nScreenshots: number; - rtLastTimePlayed: number; - rtLastUpdated: number; - rtPurchased: number; - selectedLanguage: { - strDisplayName: string; - strShortName: string; - }; - strCloudBytesAvailable: string; - strCloudBytesUsed: string; - strCompatToolDisplayName: string; - strCompatToolName: string; - strDeveloperName: string; - strDeveloperURL: string; - strDisplayName: string; - strExternalSubscriptionURL: string; - strFlatpakAppID: string; - strHomepageURL: string; - strLaunchOptions: string; - strManualURL: string; - strOwnerSteamID: string; - strResolutionOverride: string; - strSelectedBeta: string; - strShortcutExe: string; - strShortcutLaunchOptions: string; - strShortcutStartDir: string; - strSteamDeckBlogURL: string; - unAppID: number; - vecBetas: any[]; - vecDLC: any[]; - vecDeckCompatTestResults: any[]; - vecLanguages: AppLanguages[]; - vecLegacyCDKeys: any[]; - vecMusicAlbums: any[]; - vecPlatforms: string[]; - vecScreenShots: any[]; - libraryAssets?: { - logoPosition?: LogoPosition; - }; + achievements: AppAchievements; + /** Indicates whether the application is available on the store. */ + bAvailableContentOnStore: boolean; + bCanMoveInstallFolder: boolean; + bCloudAvailable: boolean; + bCloudEnabledForAccount: boolean; + bCloudEnabledForApp: boolean; + bCloudSyncOnSuspendAvailable: boolean; + bCloudSyncOnSuspendEnabled: boolean; + /** Indicates whether the application has community market available. */ + bCommunityMarketPresence: boolean; + bEnableAllowDesktopConfiguration: boolean; + bFreeRemovableLicense: boolean; + bHasAllLegacyCDKeys: boolean; + bHasAnyLocalContent: boolean; + bHasLockedPrivateBetas: boolean; + bIsExcludedFromSharing: boolean; + bIsSubscribedTo: boolean; + bIsThirdPartyUpdater: boolean; + bOverlayEnabled: boolean; + bOverrideInternalResolution: boolean; + bRequiresLegacyCDKey: boolean; + bShortcutIsVR: boolean; + bShowCDKeyInMenus: boolean; + bShowControllerConfig: boolean; + bSupportsCDKeyCopyToClipboard: boolean; + bVRGameTheatreEnabled: boolean; + bWorkshopVisible: boolean; + deckDerivedProperties?: AppDeckDerivedProperties; + eAppOwnershipFlags: AppOwnershipFlags | number; // is this a bitmask? + eAutoUpdateValue: AutoUpdateBehavior; + eBackgroundDownloads: BackgroundDownloadsBehavior; + eCloudSync: number; + eControllerRumblePreference: number; // ControllerRumbleSetting? + eDisplayStatus: DisplayStatus; + eEnableThirdPartyControllerConfiguration: number; + eSteamInputControllerMask: number; + /** + * Index of the install folder. -1 if not installed. + */ + iInstallFolder: number; + /** Disk space required for installation, in bytes. */ + lDiskSpaceRequiredBytes: number; + /** Application disk space usage, in bytes. */ + lDiskUsageBytes: number; + /** DLC disk space usage, in bytes. */ + lDlcUsageBytes: number; + nBuildID: number; + nCompatToolPriority: number; + /** Total play time, in minutes. */ + nPlaytimeForever: number; + /** Screenshot count. */ + nScreenshots: number; + rtLastTimePlayed: number; + rtLastUpdated: number; + rtPurchased: number; + selectedLanguage: AppLanguage; + strCloudBytesAvailable: string; + strCloudBytesUsed: string; + strCompatToolDisplayName: string; + strCompatToolName: string; + strDeveloperName: string; + strDeveloperURL: string; + strDisplayName: string; + strExternalSubscriptionURL: string; + strFlatpakAppID: string; + strHomepageURL: string; + strLaunchOptions: string; + strManualURL: string; + /** Steam64 ID. */ + strOwnerSteamID: string; + strResolutionOverride: string; + strSelectedBeta: string; + strShortcutExe: string; + strShortcutLaunchOptions: string; + strShortcutStartDir: string; + strSteamDeckBlogURL: string; + unAppID: number; + unEntitledContentApp: number; + unTimedTrialSecondsAllowed: number; + unTimedTrialSecondsPlayed: number; + vecBetas: AppBeta[]; + vecChildConfigApps: number[]; + vecDLC: AppDLC[]; + vecDeckCompatTestResults: DeckCompatTestResult[]; + vecLanguages: AppLanguage[]; + vecLegacyCDKeys: any[]; + vecMusicAlbums: AppSoundtrack[]; + /** windows | osx | linux */ + vecPlatforms: string[]; + vecScreenShots: Screenshot[]; + libraryAssets?: AppLibraryAssets; } // Appears to be all optional fields :disaster: export interface SteamAppOverview { - appid: number; - display_name: string; - visible_in_game_list: boolean; - sort_as: string; - - /* - * Possible bitmask values, but I haven't spotted any of them being masked in the app_type field. - * Should be safe as an enum. - */ - app_type: AppType; - mru_index: number | undefined; - rt_recent_activity_time: number; - minutes_playtime_forever: number; - minutes_playtime_last_two_weeks: number; - rt_last_time_played_or_installed: number; - rt_last_time_played: number; - store_tag?: number[]; - association: SteamAppOverviewAssociation[]; - store_category?: number[]; - rt_original_release_date: number; - rt_steam_release_date: number; - icon_hash: string; - controller_support?: AppControllerSupportLevel; // default none - vr_supported?: boolean; - metacritic_score: number; - size_on_disk?: number; - third_party_mod?: boolean; - icon_data?: string; - icon_data_format?: string; - gameid: string; - library_capsule_filename?: string; - per_client_data: SteamAppOverviewClientData[]; - most_available_clientid: string; - selected_clientid?: string; - rt_store_asset_mtime: number; - rt_custom_image_mtime?: number; - optional_parent_app_id?: number; - owner_account_id?: number; - review_score_with_bombs: number; - review_percentage_with_bombs: number; - review_score_without_bombs: number; - review_percentage_without_bombs: number; - library_id?: string; - vr_only?: boolean; - mastersub_appid?: number; - mastersub_includedwith_logo?: string; - site_license_site_name?: string; - shortcut_override_appid?: number; - steam_deck_compat_category: SteamDeckCompatibilityCategory; // Default should be Unknown - rt_last_time_locally_played?: number - rt_purchased_time: number; - header_filename?: string; - - m_setStoreCategories: Set; - m_setStoreTags: Set; - canonicalAppType: number; - local_per_client_data: SteamAppOverviewClientData; - most_available_per_client_data: SteamAppOverviewClientData; - selected_per_client_data: SteamAppOverviewClientData; - m_strPerClientData: Set | undefined; - m_strAssociations: Set | undefined; - - BIsModOrShortcut: () => boolean; - BIsShortcut: () => boolean; + appid: number; + display_name: string; + visible_in_game_list: boolean; + sort_as: string; + + /* + * Possible bitmask values, but I haven't spotted any of them being masked in the app_type field. + * Should be safe as an enum. + */ + app_type: AppType; + mru_index: number | undefined; + rt_recent_activity_time: number; + minutes_playtime_forever: number; + minutes_playtime_last_two_weeks: number; + rt_last_time_played_or_installed: number; + rt_last_time_played: number; + store_tag?: number[]; + association: SteamAppOverviewAssociation[]; + store_category?: number[]; + rt_original_release_date: number; + rt_steam_release_date: number; + icon_hash: string; + controller_support?: AppControllerSupportLevel; // default none + vr_supported?: boolean; + metacritic_score: number; + size_on_disk?: number; + third_party_mod?: boolean; + icon_data?: string; + icon_data_format?: string; + gameid: string; + library_capsule_filename?: string; + per_client_data: SteamAppOverviewClientData[]; + most_available_clientid: string; + selected_clientid?: string; + rt_store_asset_mtime: number; + rt_custom_image_mtime?: number; + optional_parent_app_id?: number; + owner_account_id?: number; + review_score_with_bombs: number; + review_percentage_with_bombs: number; + review_score_without_bombs: number; + review_percentage_without_bombs: number; + library_id?: string; + vr_only?: boolean; + mastersub_appid?: number; + mastersub_includedwith_logo?: string; + site_license_site_name?: string; + shortcut_override_appid?: number; + steam_deck_compat_category: SteamDeckCompatibilityCategory; // Default should be Unknown + rt_last_time_locally_played?: number; + rt_purchased_time: number; + header_filename?: string; + + m_setStoreCategories: Set; + m_setStoreTags: Set; + canonicalAppType: number; + local_per_client_data: SteamAppOverviewClientData; + most_available_per_client_data: SteamAppOverviewClientData; + selected_per_client_data: SteamAppOverviewClientData; + m_strPerClientData: Set | undefined; + m_strAssociations: Set | undefined; + + BIsModOrShortcut: () => boolean; + BIsShortcut: () => boolean; } export interface SteamAppOverviewAssociation { - type: AppAssociationType; // Default should be Invalid - name: string; + type: AppAssociationType; // Default should be Invalid + name: string; } export interface SteamAppOverviewClientData { - clientid: string; - client_name: string; - display_status: DisplayStatus; // Default should be Invalid - status_percentage: number; - active_beta?: string; - installed?: boolean; - bytes_downloaded: string; - bytes_total: string; - streaming_to_local_client?: boolean; - is_available_on_current_platform: boolean; - is_invalid_os_type?: boolean; - playtime_left?: number; - cloud_status: AppCloudStatus; + clientid: string; + client_name: string; + display_status: DisplayStatus; // Default should be Invalid + status_percentage: number; + active_beta?: string; + installed?: boolean; + bytes_downloaded: string; + bytes_total: string; + streaming_to_local_client?: boolean; + is_available_on_current_platform: boolean; + is_invalid_os_type?: boolean; + playtime_left?: number; + cloud_status: AppCloudStatus; +} + +export interface ConflictingFileTimestamp { + rtLocalTime: number; + rtRemoteTime: number; } /** * Represents information about a compatibility tool. */ export interface CompatibilityToolInfo { - /** Name of the compatibility tool. */ - strToolName: string; - /** Display name of the compatibility tool. */ - strDisplayName: string; + /** Name of the compatibility tool. */ + strToolName: string; + /** Display name of the compatibility tool. */ + strDisplayName: string; } /** * Represents information about an installed application. */ export interface AppInfo { - /** ID of the application. */ - nAppID: number; - /** Name of the application. */ - strAppName: string; - /** Sorting information for the application. */ - strSortAs: string; - /** Last played time in Unix Epoch time format. */ - rtLastPlayed: number; - /** Size of used storage by the application. */ - strUsedSize: string; - /** Size of DLC storage used by the application. */ - strDLCSize: string; - /** Size of workshop storage used by the application. */ - strWorkshopSize: string; - /** Size of staged storage used by the application. */ - strStagedSize: string; + /** ID of the application. */ + nAppID: number; + /** Name of the application. */ + strAppName: string; + /** Sorting information for the application. */ + strSortAs: string; + /** Last played time in Unix Epoch time format. */ + rtLastPlayed: number; + /** Size of used storage by the application. */ + strUsedSize: string; + /** Size of DLC storage used by the application. */ + strDLCSize: string; + /** Size of workshop storage used by the application. */ + strWorkshopSize: string; + /** Size of staged storage used by the application. */ + strStagedSize: string; } /** * Represents information about an installation folder. */ export interface SteamInstallFolder extends PotentialInstallFolder { - /** Index of the folder. */ - nFolderIndex: number; - /** Used space in the folder. */ - strUsedSize: string; - /** Size of DLC storage used in the folder. */ - strDLCSize: string; - /** Size of workshop storage used in the folder. */ - strWorkshopSize: string; - /** Size of staged storage used in the folder. */ - strStagedSize: string; - /** Indicates if the folder is set as the default installation folder. */ - bIsDefaultFolder: boolean; - /** Indicates if the folder is currently mounted. */ - bIsMounted: boolean; - /** List of applications installed in the folder. */ - vecApps: AppInfo[]; + /** Index of the folder. */ + nFolderIndex: number; + /** Used space in the folder. */ + strUsedSize: string; + /** Size of DLC storage used in the folder. */ + strDLCSize: string; + /** Size of workshop storage used in the folder. */ + strWorkshopSize: string; + /** Size of staged storage used in the folder. */ + strStagedSize: string; + /** Indicates if the folder is set as the default installation folder. */ + bIsDefaultFolder: boolean; + /** Indicates if the folder is currently mounted. */ + bIsMounted: boolean; + /** List of applications installed in the folder. */ + vecApps: AppInfo[]; } export interface PotentialInstallFolder { - /** Path of the folder. */ - strFolderPath: string; - /** User label for the folder. */ - strUserLabel: string; - /** Name of the drive where the folder is located. */ - strDriveName: string; - /** Total capacity of the folder. */ - strCapacity: string; - /** Available free space in the folder. */ - strFreeSpace: string; - /** Indicates if the folder is on a fixed drive. */ - bIsFixed: boolean; + /** Path of the folder. */ + strFolderPath: string; + /** User label for the folder. */ + strUserLabel: string; + /** Name of the drive where the folder is located. */ + strDriveName: string; + /** Total capacity of the folder. */ + strCapacity: string; + /** Available free space in the folder. */ + strFreeSpace: string; + /** Indicates if the folder is on a fixed drive. */ + bIsFixed: boolean; } export interface AchievementNotification { - achievement: AppAchievements, - nCurrentProgress: number, - nMaxProgress: number, - unAppID: number + achievement: AppAchievements; + nCurrentProgress: number; + nMaxProgress: number; + unAppID: number; } export interface ScreenshotNotification { - details: Screenshot, - hScreenshot: number, - strOperation: string, - unAppID: number, + details: Screenshot; + hScreenshot: number; + strOperation: string; + unAppID: number; } export interface Screenshot { - nAppID: number, - strGameID: string, - hHandle: number, - nWidth: number, - nHeight: number, - nCreated: number, // timestamp - ePrivacy: FilePrivacyState, - strCaption: "", - bSpoilers: boolean, - strUrl: string, - bUploaded: boolean, - ugcHandle: string + nAppID: number; + strGameID: string; + hHandle: number; + nWidth: number; + nHeight: number; + nCreated: number; // timestamp + ePrivacy: FilePrivacyState; + strCaption: ''; + bSpoilers: boolean; + strUrl: string; + bUploaded: boolean; + ugcHandle: string; } - export interface DownloadItem { - active: boolean, - appid: number, - buildid: number, - completed: boolean, - completed_time: number, - deferred_time: number, - downloaded_bytes: number, - launch_on_completion: boolean, - paused: boolean, - queue_index: number, - target_buildid: number, - total_bytes: number, - update_error: string, - update_result: number, - update_type_info: UpdateTypeInfo[] + active: boolean; + appid: number; + buildid: number; + completed: boolean; + completed_time: number; + deferred_time: number; + downloaded_bytes: number; + launch_on_completion: boolean; + paused: boolean; + queue_index: number; + target_buildid: number; + total_bytes: number; + update_error: string; + update_result: number; + update_type_info: UpdateTypeInfo[]; } export interface UpdateTypeInfo { - completed_update: boolean, - downloaded_bytes: number, - has_update: boolean, - total_bytes: number + completed_update: boolean; + downloaded_bytes: number; + has_update: boolean; + total_bytes: number; } export interface DownloadOverview { - lan_peer_hostname: string, - paused: boolean, - throttling_suspended: boolean, - update_appid: number, - update_bytes_downloaded: number, - update_bytes_processed: number, - update_bytes_staged: number, - update_bytes_to_download: number, - update_bytes_to_process: number, - update_bytes_to_stage: number, - update_disc_bytes_per_second: number, - update_is_install: boolean, - update_is_prefetch_estimate: boolean, - update_is_shader: boolean, - update_is_upload: boolean, - update_is_workshop: boolean, - update_network_bytes_per_second: number, - update_peak_network_bytes_per_second: number, - update_seconds_remaining: number, - update_start_time: number, - update_state: "None" | "Starting" | "Updating" | "Stopping" + lan_peer_hostname: string; + paused: boolean; + throttling_suspended: boolean; + update_appid: number; + update_bytes_downloaded: number; + update_bytes_processed: number; + update_bytes_staged: number; + update_bytes_to_download: number; + update_bytes_to_process: number; + update_bytes_to_stage: number; + update_disc_bytes_per_second: number; + update_is_install: boolean; + update_is_prefetch_estimate: boolean; + update_is_shader: boolean; + update_is_upload: boolean; + update_is_workshop: boolean; + update_network_bytes_per_second: number; + update_peak_network_bytes_per_second: number; + update_seconds_remaining: number; + update_start_time: number; + update_state: 'None' | 'Starting' | 'Updating' | 'Stopping'; } export interface InstallInfo { - rgAppIDs: InstallInfoApps[], - eInstallState: number; - nDiskSpaceRequired: number; - nDiskSpaceAvailable: number; - nCurrentDisk: number; - nTotalDisks: number; - bCanChangeInstallFolder: boolean; - iInstallFolder: number; // index of the install folder - iUnmountedFolder: number; - currentAppID: number; - eAppError: AppError; - errorDetail: string; - bSystemMenuShortcut: boolean; - bDesktopShortcut: boolean; - bIsBackupInstall: boolean; - strPeerContentServer: string; - bPeerContentServerOnline: boolean; - bPeerContentServerAvailable: boolean; + rgAppIDs: InstallInfoApps[]; + eInstallState: number; + nDiskSpaceRequired: number; + nDiskSpaceAvailable: number; + nCurrentDisk: number; + nTotalDisks: number; + bCanChangeInstallFolder: boolean; + /** + * Index of the install folder. -1 if not installed. + */ + iInstallFolder: number; + iUnmountedFolder: number; + currentAppID: number; + eAppError: AppError; + errorDetail: string; + bSystemMenuShortcut: boolean; + bDesktopShortcut: boolean; + bIsBackupInstall: boolean; + strPeerContentServer: string; + bPeerContentServerOnline: boolean; + bPeerContentServerAvailable: boolean; } export interface InstallInfoApps { - nAppID: number; - lDiskSpaceRequiredBytes: number; + nAppID: number; + lDiskSpaceRequiredBytes: number; } /** * Represents spew output information. */ export interface SpewOutput { - /** - * The content of the spew output. - */ - spew: string; + /** + * The content of the spew output. + */ + spew: string; - /** - * The type or category of the spew output. - */ - spew_type: string; + /** + * The type or category of the spew output. + */ + spew_type: string; } export interface AuthRefreshInfo { - reason: number; - account_name: string; - login_id_token: string; + reason: number; + account_name: string; + login_id_token: string; } export interface WorkshopItem { - unAppID: number; - ulPublishedFileID: string; + unAppID: number; + ulPublishedFileID: string; } /** * Represents playtime information for an application. */ export interface Playtime { - /** Total playtime in minutes for the last 2 weeks. */ - nPlaytimeLastTwoWeeks: number; - /** Total playtime in minutes. */ - nPlaytimeForever: number; - /** Last played time in Unix Epoch time format. */ - rtLastTimePlayed: number; + /** Total playtime in minutes for the last 2 weeks. */ + nPlaytimeLastTwoWeeks: number; + /** Total playtime in minutes. */ + nPlaytimeForever: number; + /** Last played time in Unix Epoch time format. */ + rtLastTimePlayed: number; } export interface BrightnessChange { - flBrightness: number; + flBrightness: number; } export interface AirplaneModeChange { - bEnabled: boolean; + bEnabled: boolean; } export interface SystemInfo { - sOSName: string; - sKernelVersion: string; - sBIOSVersion: string; - sHostname: string; - sOSCodename: string; - sOSVariantId: string; - sOSVersionId: string; - sOSBuildId: string; - nSteamVersion: number; - sSteamBuildDate: string; - sSteamAPI: string; - sCPUVendor: string; - sCPUName: string; - nCPUHz: number; - nCPUPhysicalCores: number; - nCPULogicalCores: number; - nSystemRAMSizeMB: number; - sVideoCardName: string; - sVideoDriverVersion: string; - nVideoRAMSizeMB: number; - bIsUnsupportedPrototypeHardware: boolean; + sOSName: string; + sKernelVersion: string; + sBIOSVersion: string; + sHostname: string; + sOSCodename: string; + sOSVariantId: string; + sOSVersionId: string; + sOSBuildId: string; + nSteamVersion: number; + sSteamBuildDate: string; + sSteamAPI: string; + sCPUVendor: string; + sCPUName: string; + nCPUHz: number; + nCPUPhysicalCores: number; + nCPULogicalCores: number; + nSystemRAMSizeMB: number; + sVideoCardName: string; + sVideoDriverVersion: string; + nVideoRAMSizeMB: number; + bIsUnsupportedPrototypeHardware: boolean; } interface Region { - nRegionID: number; - strRegionName: string; + nRegionID: number; + strRegionName: string; } interface Hour { - nHour: number; - strDisplay: string; + nHour: number; + strDisplay: string; } interface AvailableClientBeta { - nBetaID: number; - strName: string; + nBetaID: number; + strName: string; } interface SteamSettings { - bIsInClientBeta: boolean; - bIsSteamSideload: boolean; - eClientBetaState: ClientBetaState; - strSelectedBetaName: string; - nAvailableBetas: number; - bChangeBetaEnabled: boolean; - nSelectedBetaID: number; - vecAvailableClientBetas: AvailableClientBeta[]; - bIsValveEmail: boolean; - bIsInDesktopUIBeta: boolean; - bEnableSoftProcessKill: boolean; - vecValidDownloadRegions: Region[]; - vecValidAutoUpdateRestrictHours: Hour[]; - bCompatEnabled: boolean; - bCompatEnabledForOtherTitles: boolean; - strCompatTool: string; - strDisplayName: string; - bDisplayIsExternal: boolean; - flAutoDisplayScaleFactor: number; - flCurrentDisplayScaleFactor: number; - bDisplayIsUsingAutoScale: boolean; - flMinDisplayScaleFactor: number; - flMaxDisplayScaleFactor: number; - flCurrentUnderscanLevel: number; - bUnderscanEnabled: boolean; - vecNightModeScheduledHours: Hour[]; + bIsInClientBeta: boolean; + bIsSteamSideload: boolean; + eClientBetaState: ClientBetaState; + strSelectedBetaName: string; + nAvailableBetas: number; + bChangeBetaEnabled: boolean; + nSelectedBetaID: number; + vecAvailableClientBetas: AvailableClientBeta[]; + bIsValveEmail: boolean; + bIsInDesktopUIBeta: boolean; + bEnableSoftProcessKill: boolean; + vecValidDownloadRegions: Region[]; + vecValidAutoUpdateRestrictHours: Hour[]; + bCompatEnabled: boolean; + bCompatEnabledForOtherTitles: boolean; + strCompatTool: string; + strDisplayName: string; + bDisplayIsExternal: boolean; + flAutoDisplayScaleFactor: number; + flCurrentDisplayScaleFactor: number; + bDisplayIsUsingAutoScale: boolean; + flMinDisplayScaleFactor: number; + flMaxDisplayScaleFactor: number; + flCurrentUnderscanLevel: number; + bUnderscanEnabled: boolean; + vecNightModeScheduledHours: Hour[]; } export interface PrePurchaseApp { - nAppID: number; - eState: number; // todo: 3 = Preload? 4 - Ready? I got 3 from Starfield preload and 4 with csgo + nAppID: number; + eState: number; // todo: 3 = Preload? 4 - Ready? I got 3 from Starfield preload and 4 with csgo } export interface PrePurchaseInfo { - apps: PrePurchaseApp[]; - lastChangeNumber: number; + apps: PrePurchaseApp[]; + lastChangeNumber: number; } export interface AppAchievement { - strID: string; - strName: string; - strDescription: string; - bAchieved: boolean; - rtUnlocked: number; // epoch time - strImage: string; - bHidden: boolean; - flMinProgress: number; - flCurrentProgress: number; - flMaxProgress: number; - flAchieved: number; + bAchieved: boolean; + bHidden: boolean; + flMinProgress: number; + flCurrentProgress: number; + flMaxProgress: number; + /** How many players have this achievement, in percentage. */ + flAchieved: number; + /** When this achievement was unlocked. */ + rtUnlocked: number; + /** Achievement description. */ + strDescription: string; + /** Achievement ID. */ + strID: string; + /** Achievement icon. */ + strImage: string; + /** Achievement name. */ + strName: string; } export interface AppAchievementData { - rgAchievements: AppAchievement[]; + rgAchievements: AppAchievement[]; } export interface AppAchievementResponse { - result: number; - data: AppAchievementData + result: number; + data: AppAchievementData; } export interface NonSteamApp { - bIsApplication: boolean; - strAppName: string; - strExePath: string; - strArguments: string; - strCmdline: string; - strIconDataBase64: string; + bIsApplication: boolean; + strAppName: string; + strExePath: string; + strArguments: string; + strCmdline: string; + strIconDataBase64: string; } export interface RegisteredSteamDeck { - bRegistered: boolean; - bIgnoreRegistrationPrompt: boolean; - strSteamID: string; - strSerialNumber: string; + bRegistered: boolean; + bIgnoreRegistrationPrompt: boolean; + strSteamID: string; + strSerialNumber: string; } export interface AccountSettings { - strEmail: string; - bEmailValidated: boolean; - bHasAnyVACBans: boolean; - bHasTwoFactor: boolean; - eSteamGuardState: number; - rtSteamGuardEnableTime: number; - bSaveAccountCredentials: boolean; + strEmail: string; + bEmailValidated: boolean; + bHasAnyVACBans: boolean; + bHasTwoFactor: boolean; + eSteamGuardState: number; + rtSteamGuardEnableTime: number; + bSaveAccountCredentials: boolean; } export interface Language { - language: number; - strShortName: string; + language: number; + strShortName: string; } export interface TimeZone { - utcOffset: number; - timezoneID: string; - timezoneLocalizationToken: string; - regionsLocalizationToken: string; + utcOffset: number; + timezoneID: string; + timezoneLocalizationToken: string; + regionsLocalizationToken: string; } export interface AppBackupStatus { - appid: number; - eError: number; // Without confirmation 20 - In progress, 3 - Cancelled? - strBytesToProcess: string; - strBytesProcessed: string; - strTotalBytesWritten: string; + appid: number; + eError: number; // Without confirmation 20 - In progress, 3 - Cancelled? + strBytesToProcess: string; + strBytesProcessed: string; + strTotalBytesWritten: string; } /** * Represents a list of applications with their IDs. */ interface AppList { - /** - * Key-value pairs where the key is the `appId` (e.g., "App_123456") and the value indicates whether the appId is allowed during parental lock. - */ - [appId: string]: number; + /** + * Key-value pairs where the key is the `appId` (e.g., "App_123456") and the value indicates whether the appId is allowed during parental lock. + */ + [appId: string]: number; } /** * Represents the parental settings and restrictions. */ export interface ParentalSettings { - /** - * Indicates whether parental settings are enabled. - */ - enabled: boolean; - /** - * Indicates whether parental settings are locked. - */ - locked: boolean; - /** - * Bitmask representing enabled features. - * - Bit 0: Unknown (@todo Please provide more details if known) - * - Bit 1: Online content & features - Steam Store - * - Bit 2: Online content & features - Community-generated content - * - Bit 3: Online content & features - My online profile, screenshots, and achievements - * - Bit 4: Online content & features - Friends, chat, and groups - * - Bit 5-11: Unknown (@todo Please provide more details if known) - * - Bit 12: Library content - 0: Only games I choose, 1: All games - */ - features: number; - /** - * Indicates whether all apps are allowed. - */ - allowallapps: boolean; - /** - * Base list (type not specified but an object). - * @todo Determine the type of this property. - */ - baselist: any | undefined; - /** - * Custom list of allowed applications. - */ - customlist: AppList; - /** - * Email for recovery (if applicable). - */ - recoveryemail: string | undefined; + /** + * Indicates whether parental settings are enabled. + */ + enabled: boolean; + /** + * Indicates whether parental settings are locked. + */ + locked: boolean; + /** + * Bitmask representing enabled features. + * - Bit 0: Unknown (@todo Please provide more details if known) + * - Bit 1: Online content & features - Steam Store + * - Bit 2: Online content & features - Community-generated content + * - Bit 3: Online content & features - My online profile, screenshots, and achievements + * - Bit 4: Online content & features - Friends, chat, and groups + * - Bit 5-11: Unknown (@todo Please provide more details if known) + * - Bit 12: Library content - 0: Only games I choose, 1: All games + */ + features: number; + /** + * Indicates whether all apps are allowed. + */ + allowallapps: boolean; + /** + * Base list (type not specified but an object). + * @todo Determine the type of this property. + */ + baselist: any | undefined; + /** + * Custom list of allowed applications. + */ + customlist: AppList; + /** + * Email for recovery (if applicable). + */ + recoveryemail: string | undefined; } export interface ConnectivityTestChange { - eConnectivityTestResult: ConnectivityTestResult; - eFakeState: number; - bChecking: boolean; + eConnectivityTestResult: ConnectivityTestResult; + eFakeState: number; + bChecking: boolean; } export interface ControllerStateChange { - unControllerIndex: number; - unPacketNum: number; - /** - * Bitmask representing pressed upper buttons. - * - Bit 0-8: Unknown (@todo Please provide more details if known) - * - Bit 9: L4 - * - Bit 10: R4 - * - Bit 11-13: Unknown (@todo Please provide more details if known) - * - Bit 14: Left Joystick Touch - * - Bit 15: Right Joystick Touch - * - Bit 16-18: Unknown (@todo Please provide more details if known) - * - Bit 19: Quick Access Menu - */ - ulUpperButtons: number; - /** - * Bitmask representing pressed buttons. - * - Bit 0: R2 - * - Bit 1: L2 - * - Bit 2: R1 - * - Bit 3: L1 - * - Bit 4: Y - * - Bit 5: B - * - Bit 6: X - * - Bit 7: A - * - Bit 8: D-Pad Up - * - Bit 9: D-Pad Right - * - Bit 10: D-Pad Left - * - Bit 11: D-Pad Down - * - Bit 12: Select - * - Bit 13: Steam/Home - * - Bit 14: Start - * - Bit 15: L5 - * - Bit 16: R5 - * - Bit 17: Left Touchpad Click - * - Bit 18: Right Touchpad Click - * - Bit 19: Left Touchpad Touch - * - Bit 20: Right Touchpad Touch - * - Bit 21: Unknown (@todo Please provide more details if known) - * - Bit 22: L3 - * - Bit 23-25: Unknown (@todo Please provide more details if known) - * - Bit 26: R3 - * - Bit 27-28: Unknown (@todo Please provide more details if known) - * - Bit 29: Mute (Dualsense) - * - Bit 30-31: Unknown (@todo Please provide more details if known) - */ - ulButtons: number; - sLeftPadX: number; - sLeftPadY: number; - sRightPadX: number; - sRightPadY: number; - sCenterPadX: number; - sCenterPadY: number; - sLeftStickX: number; - sLeftStickY: number; - sRightStickX: number; - sRightStickY: number; - sTriggerL: number; - sTriggerR: number; - flDriftCorrectedQuatW: number; - flDriftCorrectedQuatX: number; - flDriftCorrectedQuatY: number; - flDriftCorrectedQuatZ: number; - flSensorFusionGyroQuatW: number; - flSensorFusionGyroQuatX: number; - flSensorFusionGyroQuatY: number; - flSensorFusionGyroQuatZ: number; - flDeferredSensorFusionGyroQuatW: number; - flDeferredSensorFusionGyroQuatX: number; - flDeferredSensorFusionGyroQuatY: number; - flDeferredSensorFusionGyroQuatZ: number; - flGyroDegreesPerSecondX: number; - flGyroDegreesPerSecondY: number; - flGyroDegreesPerSecondZ: number; - flGravityVectorX: number; - flGravityVectorY: number; - flGravityVectorZ: number; - flAccelerometerNoiseLength: number; - flGyroNoiseLength: number; - flGyroCalibrationProgress: number; - sBatteryLevel: number; - sPressurePadLeft: number; - sPressurePadRight: number; - sPressureBumperLeft: number; - sPressureBumperRight: number; - unHardwareUpdateInMicrosec: number; + unControllerIndex: number; + unPacketNum: number; + /** + * Bitmask representing pressed upper buttons. + * - Bit 0-8: Unknown (@todo Please provide more details if known) + * - Bit 9: L4 + * - Bit 10: R4 + * - Bit 11-13: Unknown (@todo Please provide more details if known) + * - Bit 14: Left Joystick Touch + * - Bit 15: Right Joystick Touch + * - Bit 16-18: Unknown (@todo Please provide more details if known) + * - Bit 19: Quick Access Menu + */ + ulUpperButtons: number; + /** + * Bitmask representing pressed buttons. + * - Bit 0: R2 + * - Bit 1: L2 + * - Bit 2: R1 + * - Bit 3: L1 + * - Bit 4: Y + * - Bit 5: B + * - Bit 6: X + * - Bit 7: A + * - Bit 8: D-Pad Up + * - Bit 9: D-Pad Right + * - Bit 10: D-Pad Left + * - Bit 11: D-Pad Down + * - Bit 12: Select + * - Bit 13: Steam/Home + * - Bit 14: Start + * - Bit 15: L5 + * - Bit 16: R5 + * - Bit 17: Left Touchpad Click + * - Bit 18: Right Touchpad Click + * - Bit 19: Left Touchpad Touch + * - Bit 20: Right Touchpad Touch + * - Bit 21: Unknown (@todo Please provide more details if known) + * - Bit 22: L3 + * - Bit 23-25: Unknown (@todo Please provide more details if known) + * - Bit 26: R3 + * - Bit 27-28: Unknown (@todo Please provide more details if known) + * - Bit 29: Mute (Dualsense) + * - Bit 30-31: Unknown (@todo Please provide more details if known) + */ + ulButtons: number; + sLeftPadX: number; + sLeftPadY: number; + sRightPadX: number; + sRightPadY: number; + sCenterPadX: number; + sCenterPadY: number; + sLeftStickX: number; + sLeftStickY: number; + sRightStickX: number; + sRightStickY: number; + sTriggerL: number; + sTriggerR: number; + flDriftCorrectedQuatW: number; + flDriftCorrectedQuatX: number; + flDriftCorrectedQuatY: number; + flDriftCorrectedQuatZ: number; + flSensorFusionGyroQuatW: number; + flSensorFusionGyroQuatX: number; + flSensorFusionGyroQuatY: number; + flSensorFusionGyroQuatZ: number; + flDeferredSensorFusionGyroQuatW: number; + flDeferredSensorFusionGyroQuatX: number; + flDeferredSensorFusionGyroQuatY: number; + flDeferredSensorFusionGyroQuatZ: number; + flGyroDegreesPerSecondX: number; + flGyroDegreesPerSecondY: number; + flGyroDegreesPerSecondZ: number; + flGravityVectorX: number; + flGravityVectorY: number; + flGravityVectorZ: number; + flAccelerometerNoiseLength: number; + flGyroNoiseLength: number; + flGyroCalibrationProgress: number; + sBatteryLevel: number; + sPressurePadLeft: number; + sPressurePadRight: number; + sPressureBumperLeft: number; + sPressureBumperRight: number; + unHardwareUpdateInMicrosec: number; } export interface ActiveAccount { - strActiveAccountID: string; - strName: string; - strAvatarHash: string; + strActiveAccountID: string; + strName: string; + strAvatarHash: string; } export interface ControllerInfo { - strName: string; - eControllerType: ControllerType; - nXInputIndex: number; - nControllerIndex: number; - eRumblePreference: number; // ControllerRumbleSetting - bWireless: boolean; - unUniqueID: number; - unVendorID: number; - unProductID: number; - unCapabilities: number; - strFirmwareBuildTime: string; - strSerialNumber: string; - strChipID: string; - nLEDColorR: number; - nLEDColorG: number; - nLEDColorB: number; - flLEDBrightness: number; - flLEDSaturation: number; - nTurnOnSound: number; - nTurnOffSound: number; - nLStickDeadzone: number; - nRStickDeadzone: number; - nLHapticStrength: number; - nRHapticStrength: number; - flLPadPressureCurve: number; - flRPadPressureCurve: number; - bHaptics: boolean; - bSWAntiDrift: boolean; - flGyroStationaryTolerance: number; - flAccelerometerStationaryTolerance: number; - bRemoteDevice: boolean; - bNintendoLayout: boolean; - bUseReversedLayout: boolean; - ActiveAccount: ActiveAccount | undefined; - vecAltAccounts: any[]; // The type for this property might need to be more specific based on the actual data structure + strName: string; + eControllerType: ControllerType; + nXInputIndex: number; + nControllerIndex: number; + eRumblePreference: number; // ControllerRumbleSetting + bWireless: boolean; + unUniqueID: number; + unVendorID: number; + unProductID: number; + unCapabilities: number; + strFirmwareBuildTime: string; + strSerialNumber: string; + strChipID: string; + nLEDColorR: number; + nLEDColorG: number; + nLEDColorB: number; + flLEDBrightness: number; + flLEDSaturation: number; + nTurnOnSound: number; + nTurnOffSound: number; + nLStickDeadzone: number; + nRStickDeadzone: number; + nLHapticStrength: number; + nRHapticStrength: number; + flLPadPressureCurve: number; + flRPadPressureCurve: number; + bHaptics: boolean; + bSWAntiDrift: boolean; + flGyroStationaryTolerance: number; + flAccelerometerStationaryTolerance: number; + bRemoteDevice: boolean; + bNintendoLayout: boolean; + bUseReversedLayout: boolean; + ActiveAccount: ActiveAccount | undefined; + vecAltAccounts: any[]; // The type for this property might need to be more specific based on the actual data structure } export interface TouchMenuMessage { - bHasVirtualMenus: boolean; - unControllerIndex: number; - appID: number; + bHasVirtualMenus: boolean; + unControllerIndex: number; + appID: number; } export interface ControllerCommandMessage { - eAction: number; - nControllerIndex: number; + eAction: number; + nControllerIndex: number; } export interface ControllerInputMessage { - nA: number; - bS: boolean; - nC: number; + nA: number; + bS: boolean; + nC: number; } export interface ControllerAnalogInputMessage { - nA: number; - x: number; - y: number; - nC: number; + nA: number; + x: number; + y: number; + nC: number; } export interface FriendSettingsFeature { - feature: string; - bEnabled: boolean; + feature: string; + bEnabled: boolean; } export interface FriendSettingsEnabledFeature { - DoNotDisturb: number; - LoaderWindowSynchronization: number; - NonFriendMessageHandling: number; - NewVoiceHotKeyState: number; - PersonaNotifications: number; - ServerVirtualizedMemberLists: number; - SteamworksChatAPI: number; - FriendsFilter: number; + DoNotDisturb: number; + LoaderWindowSynchronization: number; + NonFriendMessageHandling: number; + NewVoiceHotKeyState: number; + PersonaNotifications: number; + ServerVirtualizedMemberLists: number; + SteamworksChatAPI: number; + FriendsFilter: number; } export interface FriendSettingsChange { - bNotifications_ShowIngame: number; - bNotifications_ShowOnline: number; - bNotifications_ShowMessage: number; - bNotifications_EventsAndAnnouncements: number; - bSounds_PlayIngame: number; - bSounds_PlayOnline: number; - bSounds_PlayMessage: number; - bSounds_EventsAndAnnouncements: number; - bAlwaysNewChatWindow: number; - bForceAlphabeticFriendSorting: number; - nChatFlashMode: number; - bRememberOpenChats: number; - bCompactQuickAccess: number; - bCompactFriendsList: number; - bNotifications_ShowChatRoomNotification: number; - bSounds_PlayChatRoomNotification: number; - bHideOfflineFriendsInTagGroups: number; - bHideCategorizedFriends: number; - bCategorizeInGameFriendsByGame: number; - nChatFontSize: number; - b24HourClock: number; - bDoNotDisturbMode: number; - bDisableEmbedInlining: number; - bSignIntoFriends: number; - bDisableSpellcheck: number; - bDisableRoomEffects: number; - bAnimatedAvatars: number; - featuresEnabled: FriendSettingsEnabledFeature; + bNotifications_ShowIngame: number; + bNotifications_ShowOnline: number; + bNotifications_ShowMessage: number; + bNotifications_EventsAndAnnouncements: number; + bSounds_PlayIngame: number; + bSounds_PlayOnline: number; + bSounds_PlayMessage: number; + bSounds_EventsAndAnnouncements: number; + bAlwaysNewChatWindow: number; + bForceAlphabeticFriendSorting: number; + nChatFlashMode: number; + bRememberOpenChats: number; + bCompactQuickAccess: number; + bCompactFriendsList: number; + bNotifications_ShowChatRoomNotification: number; + bSounds_PlayChatRoomNotification: number; + bHideOfflineFriendsInTagGroups: number; + bHideCategorizedFriends: number; + bCategorizeInGameFriendsByGame: number; + nChatFontSize: number; + b24HourClock: number; + bDoNotDisturbMode: number; + bDisableEmbedInlining: number; + bSignIntoFriends: number; + bDisableSpellcheck: number; + bDisableRoomEffects: number; + bAnimatedAvatars: number; + featuresEnabled: FriendSettingsEnabledFeature; } export interface ProxyInfo { - proxy_mode: number; - address: string; - port: number; - exclude_local: boolean; + proxy_mode: number; + address: string; + port: number; + exclude_local: boolean; } export interface RemotePlayDevice { - clientName: string; - status: string; // "Connected", "Paired", - formFactor: number; - unStreamingSessionID: number; - bCanSuspend: boolean; + clientName: string; + status: string; // "Connected", "Paired", + formFactor: number; + unStreamingSessionID: number; + bCanSuspend: boolean; } export interface RemotePlaySettings { - bRemotePlaySupported: boolean; - bRemotePlayEnabled: boolean; - eRemotePlayP2PScope: number; - bRemotePlayServerConfigAvailable: boolean; - bRemotePlayServerConfigEnabled: boolean; - RemotePlayServerConfig: any; // todo: document {} - bRemotePlayClientConfigEnabled: boolean; - unStreamingSessionID: number; - strStreamingClientName: string; - RemotePlayClientConfig: any; // todo: document {} - nDefaultAudioChannels: number; - bDefaultEncodeNVIDIA: boolean; - bDefaultEncodeAMD: boolean; - bDefaultEncodeIntel: boolean; - nAutomaticResolutionX: number; - nAutomaticResolutionY: number; + bRemotePlaySupported: boolean; + bRemotePlayEnabled: boolean; + eRemotePlayP2PScope: number; + bRemotePlayServerConfigAvailable: boolean; + bRemotePlayServerConfigEnabled: boolean; + RemotePlayServerConfig: any; // todo: document {} + bRemotePlayClientConfigEnabled: boolean; + unStreamingSessionID: number; + strStreamingClientName: string; + RemotePlayClientConfig: any; // todo: document {} + nDefaultAudioChannels: number; + bDefaultEncodeNVIDIA: boolean; + bDefaultEncodeAMD: boolean; + bDefaultEncodeIntel: boolean; + nAutomaticResolutionX: number; + nAutomaticResolutionY: number; } export interface GameAction { - nGameActionID: number; - gameid: string; - strActionName: string; - /* + nGameActionID: number; + gameid: string; + strActionName: string; + /* None - 0 Completed - 1 Cancelled - 2 @@ -3456,826 +4334,1850 @@ export interface GameAction { CreatingProcess - 38 WaitingGameWindow - 39 */ - strTaskName: string; - strTaskDetails: string; - nSecondsRemaing: number; //fixme: not a typo, actually valve - strNumDone: string; - strNumTotal: string; - bWaitingForUI: boolean; + strTaskName: string; + strTaskDetails: string; + nSecondsRemaing: number; //fixme: not a typo, actually valve + strNumDone: string; + strNumTotal: string; + bWaitingForUI: boolean; } export interface MoveContentProgress { - appid: number; - eError: number; // 0 - appear when you open the move dialog and when it's done, 3 - cancelled? but appid is 0?, 20 - in progress - flProgress: number; - strBytesMoved: string; - strTotalBytesToMove: string; - nFilesMoved: number; + appid: number; + eError: number; // 0 - appear when you open the move dialog and when it's done, 3 - cancelled? but appid is 0?, 20 - in progress + flProgress: number; + strBytesMoved: string; + strTotalBytesToMove: string; + nFilesMoved: number; } export interface FolderChange { - folderIndex: number; + folderIndex: number; } export interface MusicTrack { - uSoundtrackAppId: number; - ePlaybackStatus: number;// 1 - playing, 2 - paused - eRepeatStatus: number; - bShuffle: boolean; - nVolume: number; - nActiveTrack: number; - nLengthInMsec: number; + uSoundtrackAppId: number; + ePlaybackStatus: number; // 1 - playing, 2 - paused + eRepeatStatus: number; + bShuffle: boolean; + nVolume: number; + nActiveTrack: number; + nLengthInMsec: number; } export interface SoundtrackDetails { - tracks: Track[]; - metadata: SoundtrackMetadata; - vecAdditionalImageAssetURLs: string[]; - strCoverImageAssetURL: string; + tracks: Track[]; + metadata: SoundtrackMetadata; + vecAdditionalImageAssetURLs: string[]; + strCoverImageAssetURL: string; +} + +export interface StoreTagLocalization { + tag: number; + string: string; } export interface SoundtrackMetadata { - artist: string; + artist: string; } export interface Track { - discNumber: number; - trackNumber: number; - durationSeconds: number; - trackDisplayName: string; + discNumber: number; + trackNumber: number; + durationSeconds: number; + trackDisplayName: string; } export interface EndUserLicenseAgreement { - id: string; - url: string; - version: number; + id: string; + url: string; + version: number; } export interface BroadcastStatus { - broadcastid: string; - nViewers: number; - nRequests: number; - bIsBroadcasting: boolean; - bIsRecordingDesktop: boolean; - eBroadcastReady: number; - bBroadcastCapable: boolean; - bMicrophoneEnabled: boolean; - bMicrophoneActive: boolean; - nCurrentFPS: number; - nUploadKbps: number; + broadcastid: string; + nViewers: number; + nRequests: number; + bIsBroadcasting: boolean; + bIsRecordingDesktop: boolean; + eBroadcastReady: number; + bBroadcastCapable: boolean; + bMicrophoneEnabled: boolean; + bMicrophoneActive: boolean; + nCurrentFPS: number; + nUploadKbps: number; } export interface OverlayBrowserProtocols { - unAppID: number; - strScheme: string; - bAdded: boolean; + unAppID: number; + strScheme: string; + bAdded: boolean; } export interface LaunchOption { - nIndex: number; - strDescription: string; - strGameName: string; + /** + * @remarks This is an integer, despite the prefix. + */ + bIsVRLaunchOption: number; + eType: AppLaunchOptionType; + nIndex: number; + strDescription: string; + strGameName: string; } /** * Represents information about a Bluetooth adapter. */ export interface BluetoothAdapter { - /** - * The unique identifier of the Bluetooth adapter. - */ - nId: number; + /** + * The unique identifier of the Bluetooth adapter. + */ + nId: number; - /** - * The MAC address of the Bluetooth adapter. - */ - sMAC: string; + /** + * The MAC address of the Bluetooth adapter. + */ + sMAC: string; - /** - * The name of the Bluetooth adapter. - */ - sName: string; + /** + * The name of the Bluetooth adapter. + */ + sName: string; - /** - * Indicates whether the Bluetooth adapter is enabled. - */ - bEnabled: boolean; + /** + * Indicates whether the Bluetooth adapter is enabled. + */ + bEnabled: boolean; - /** - * Indicates whether the Bluetooth adapter is in discovering mode. - */ - bDiscovering: boolean; + /** + * Indicates whether the Bluetooth adapter is in discovering mode. + */ + bDiscovering: boolean; } /** * Represents information about a Bluetooth device. */ export interface BluetoothDevice { - /** - * The unique identifier of the Bluetooth device. - */ - nId: number; - - /** - * The ID of the Bluetooth adapter to which this device is discovered by / connected to. - */ - nAdapterId: number; - - /** - * The type of the Bluetooth device (e.g., headphones, mouse, keyboard). - */ - eType: BluetoothDeviceType; - - /** - * The MAC address of the Bluetooth device. - */ - sMAC: string; - - /** - * The name of the Bluetooth device. - */ - sName: string; - - /** - * Indicates whether the Bluetooth device is currently connected to the adapter. - */ - bConnected: boolean; - - /** - * Indicates whether the Bluetooth device is paired to the adapter. - */ - bPaired: boolean; - - /** - * The raw signal strength of the Bluetooth device. - */ - nStrengthRaw: number; + /** + * The unique identifier of the Bluetooth device. + */ + nId: number; + + /** + * The ID of the Bluetooth adapter to which this device is discovered by / connected to. + */ + nAdapterId: number; + + /** + * The type of the Bluetooth device (e.g., headphones, mouse, keyboard). + */ + eType: BluetoothDeviceType; + + /** + * The MAC address of the Bluetooth device. + */ + sMAC: string; + + /** + * The name of the Bluetooth device. + */ + sName: string; + + /** + * Indicates whether the Bluetooth device is currently connected to the adapter. + */ + bConnected: boolean; + + /** + * Indicates whether the Bluetooth device is paired to the adapter. + */ + bPaired: boolean; + + /** + * The raw signal strength of the Bluetooth device. + */ + nStrengthRaw: number; } /** * Represents a change in the state of Bluetooth adapters and devices. */ export interface BluetoothStateChange { - /** - * An array of Bluetooth adapters with their current state. - */ - vecAdapters: BluetoothAdapter[]; + /** + * An array of Bluetooth adapters with their current state. + */ + vecAdapters: BluetoothAdapter[]; - /** - * An array of Bluetooth devices with their current state. - */ - vecDevices: BluetoothDevice[]; + /** + * An array of Bluetooth devices with their current state. + */ + vecDevices: BluetoothDevice[]; - /** - * Indicates whether Bluetooth is enabled (`true`) or disabled (`false`). - */ - bEnabled: boolean; + /** + * Indicates whether Bluetooth is enabled (`true`) or disabled (`false`). + */ + bEnabled: boolean; } /** * Represents the response of an operation. It appears to be not necessary to await for this operation response. It is only used to indicate the result of an operation. */ export interface OperationResponse { - /** - * The result code of the operation (1 for success, 2 for failure). - */ - result: number; + /** + * The result code of the operation (1 for success, 2 for failure). + */ + result: number; - /** - * A message describing the result of the operation. - */ - message: string; + /** + * A message describing the result of the operation. + */ + message: string; } /** * Represents details about a single screenshot upload. */ export interface DetailsForScreenshotUpload { - /** - * The size of the screenshot upload on disk (including thumbnail). - */ - strSizeOnDisk: string; + /** + * The size of the screenshot upload on disk (including thumbnail). + */ + strSizeOnDisk: string; - /** - * The amount of cloud storage available. - */ - strCloudAvailable: string; + /** + * The amount of cloud storage available. + */ + strCloudAvailable: string; - /** - * The total cloud storage. - */ - strCloudTotal: string; + /** + * The total cloud storage. + */ + strCloudTotal: string; } /** * Represents details about multiple screenshot uploads. */ export interface DetailsForScreenshotUploads { - /** - * The total size of all screenshot uploads on disk (sum of sizes including thumbnails). - */ - unSizeOnDisk: number; + /** + * The total size of all screenshot uploads on disk (sum of sizes including thumbnails). + */ + unSizeOnDisk: number; - /** - * The amount of cloud storage available. - */ - strCloudAvailable: string; + /** + * The amount of cloud storage available. + */ + strCloudAvailable: string; - /** - * The total cloud storage. - */ - strCloudTotal: string; + /** + * The total cloud storage. + */ + strCloudTotal: string; } /** * Represents details about an application audio session. */ export interface ApplicationAudio { - /** - * The ID of the application audio. - */ - id: number; + /** + * The ID of the application audio. + */ + id: number; - /** - * The name of the application (e.g., Spotify, YouTube from a browser, etc.). - */ - strName: string; + /** + * The name of the application (e.g., Spotify, YouTube from a browser, etc.). + */ + strName: string; - /** - * The volume level of the application (floating point value between 0 and 1). - */ - flVolume: number; + /** + * The volume level of the application (floating point value between 0 and 1). + */ + flVolume: number; } /** * Represents details about an array of application audio sessions. */ export interface ApplicationsAudio { - /** - * An array of application audio sessions. - */ - apps: ApplicationAudio[]; + /** + * An array of application audio sessions. + */ + apps: ApplicationAudio[]; } /** * Represents details about an audio device. */ export interface Device { - /** - * The identifier of the audio device. - */ - id: number; - - /** - * The name of the audio device. - */ - sName: string; - - /** - * Indicates if the device has audio output. - */ - bHasOutput: boolean; - - /** - * Indicates if the device is the default output device. - */ - bIsDefaultOutputDevice: boolean; - - /** - * The volume level of the audio output device (floating point value between 0 and 1). - */ - flOutputVolume: number; - - /** - * Indicates if the device has audio input. - */ - bHasInput: boolean; - - /** - * Indicates if the device is the default input device. - */ - bIsDefaultInputDevice: boolean; - - /** - * The volume level of the audio input device (floating point value between 0 and 1). - */ - flInputVolume: number; + /** + * The identifier of the audio device. + */ + id: number; + + /** + * The name of the audio device. + */ + sName: string; + + /** + * Indicates if the device has audio output. + */ + bHasOutput: boolean; + + /** + * Indicates if the device is the default output device. + */ + bIsDefaultOutputDevice: boolean; + + /** + * The volume level of the audio output device (floating point value between 0 and 1). + */ + flOutputVolume: number; + + /** + * Indicates if the device has audio input. + */ + bHasInput: boolean; + + /** + * Indicates if the device is the default input device. + */ + bIsDefaultInputDevice: boolean; + + /** + * The volume level of the audio input device (floating point value between 0 and 1). + */ + flInputVolume: number; } /** * Represents details about audio devices and information about the active audio device. */ export interface AudioDeviceInfo { - /** - * The ID of the active output audio device. - */ - activeOutputDeviceId: number; + /** + * The ID of the active output audio device. + */ + activeOutputDeviceId: number; - /** - * The ID of the active input audio device. - */ - activeInputDeviceId: number; + /** + * The ID of the active input audio device. + */ + activeInputDeviceId: number; - /** - * The ID of the overridden output audio device (-1 if not overridden). - */ - overrideOutputDeviceId: number; + /** + * The ID of the overridden output audio device (-1 if not overridden). + */ + overrideOutputDeviceId: number; - /** - * The ID of the overridden input audio device (-1 if not overridden). - */ - overrideInputDeviceId: number; + /** + * The ID of the overridden input audio device (-1 if not overridden). + */ + overrideInputDeviceId: number; - /** - * An array of audio devices. - */ - vecDevices: Device[]; + /** + * An array of audio devices. + */ + vecDevices: Device[]; } export interface BatteryStateChange { - bHasBattery: boolean; - eACState: ACState; - eBatteryState: BatteryState; - flLevel: number; // Battery Percentage in floating point 0-1 - nSecondsRemaining: number; // Appears to be charge time remaining or time remaining on battery - bShutdownRequested: boolean; + bHasBattery: boolean; + eACState: ACState; + eBatteryState: BatteryState; + flLevel: number; // Battery Percentage in floating point 0-1 + nSecondsRemaining: number; // Appears to be charge time remaining or time remaining on battery + bShutdownRequested: boolean; } export interface OSBranch { - eBranch: OSBranchType; // 1 - Stable - sRawName: string; + eBranch: OSBranchType; // 1 - Stable + sRawName: string; } export interface LoginUser { - personaName: string; - accountName: string; - rememberPassword: boolean; - avatarUrl: string; + personaName: string; + accountName: string; + rememberPassword: boolean; + avatarUrl: string; } export interface SurveyEntry { - strName: string; - vecArgs: string[]; + strName: string; + vecArgs: string[]; } export interface SurveySection { - strSectionName: string; - vecEntries: SurveyEntry[]; + strSectionName: string; + vecEntries: SurveyEntry[]; } export interface GameKeyboardMessage { - m_bOpen: boolean; - nAppID: number; - m_dwPID: number; - m_dwOverlayPID: number; - m_hPipe: number; - m_eInputMode: number; - m_eLineInputMode: number; - m_pchDescription: string; - m_unCharMax: number; - m_pchExistingText: string; + m_bOpen: boolean; + nAppID: number; + m_dwPID: number; + m_dwOverlayPID: number; + m_hPipe: number; + m_eInputMode: number; + m_eLineInputMode: number; + m_pchDescription: string; + m_unCharMax: number; + m_pchExistingText: string; } export interface ControllerConfigInfoMessage { - appID: number; + appID: number; } export interface ControllerConfigInfoMessageQuery extends ControllerConfigInfoMessage { - bPersonalQueryDone: boolean; + bPersonalQueryDone: boolean; } export interface ControllerConfigInfoMessageList extends ControllerConfigInfoMessage { - nControllerType: number; - publishedFileID: string; - accountID: number; - Title: string; - Description: string; - URL: string; - timeUpdated: string; - bOfficial: boolean; - bProgenitorOfficial: boolean; - bRecommended: boolean; - bProgenitorRecommended: boolean; - bUsesSIAPI: boolean; - bUsesMouse: boolean; - bUsesKeyboard: boolean; - bUsesGamepad: boolean; - eExportType: number; - playtime: string; - bSelected: boolean; + nControllerType: number; + publishedFileID: string; + accountID: number; + Title: string; + Description: string; + URL: string; + timeUpdated: string; + bOfficial: boolean; + bProgenitorOfficial: boolean; + bRecommended: boolean; + bProgenitorRecommended: boolean; + bUsesSIAPI: boolean; + bUsesMouse: boolean; + bUsesKeyboard: boolean; + bUsesGamepad: boolean; + eExportType: number; + playtime: string; + bSelected: boolean; } export interface ControllerConfigCloudStateChange { - bSyncDone: boolean; - bSyncConflict: boolean; - bSyncError: boolean; + bSyncDone: boolean; + bSyncConflict: boolean; + bSyncError: boolean; +} + +export interface TouchGesture { + eTouchGesture: TouchGestureType; + x: number; + y: number; +} + +export interface BrowserViewInit { + bOnlyAllowTrustedPopups?: boolean; + parentPopupBrowserID?: number; + /** Initial URL to go to. */ + strInitialURL?: string; + strUserAgentIdentifier?: string; + strUserAgentOverride?: string; + strVROverlayKey?: string; +} + +export interface BrowserViewPopup { + /** + * Blur the popup. + * @param {boolean} enabled - Is the blur enabled? + * @param {boolean} backgroundColor + * @param {boolean} blur + * @returns {void} + * @todo backgroundColor is a bool? Whatever that means + */ + AddGlass(enabled: boolean, backgroundColor: boolean, blur: boolean): void; + + /** + * Indicates whether you can go backward in history or not. + * @returns {boolean} true if you can go backward in history, false otherwise. + */ + CanGoBackward(): boolean; + + /** + * Indicates whether you can go forward in history or not. + * @returns {boolean} true if you can go forward in history, false otherwise. + */ + CanGoForward(): boolean; + + // alert() i assume + DialogResponse(param0: boolean): void; + + EnableSteamInput(): void; + + /** + * Find a string in the page. + * @param {string} input - The string to find. + * @param {boolean} param1 - Additional parameter (exact usage may vary). + * @param {boolean} previous - `true` for previous match, `false` for next match. + * @returns {void} + */ + FindInPage(input: string, param1: boolean, previous: boolean): void; + + /** + * Get the current popup position. + * @returns {BrowserViewBounds} The window position. + */ + GetBounds(): BrowserViewBounds; + + /** + * Go back in history. + * @returns {void} + */ + GoBack(): void; + + /** + * Go forward in history. + * @returns {void} + */ + GoForward(): void; + + /** + * @remarks `| number` is used for `BrowserViewContextMenu.custom_commands`. + */ + HandleContextMenuCommand(command: BrowserViewContextMenuCommand | number, param2: BrowserViewContextMenu): void; + + /** + * Load the specified URL. + * @param {string} url - The URL to go to. + * @returns {void} + */ + LoadURL(url: string): void; + + NotifyUserActivation(): void; + + /** + * Paste the current clipboard selection. + * @returns {void} + */ + Paste(): void; + + PostMessage(message: string, args: string): boolean; + + /** + * Reload the page. + * @returns {void} + */ + Reload(): void; + + /** + * Load the specified URL, but don't save history. + * @param {string} url - The URL to go to. + * @returns {void} + */ + ReplaceURL(url: string): void; + + /** + * Define blocked protocols, like https, etc. + * @param protocols The protocols to block, separated by a semicolon. + * @returns {void} + */ + SetBlockedProtocols(protocols: string): void; + + /** + * Sets the browser window position. + * @param {number} x - Browser window X position. + * @param {number} y - Browser window Y position. + * @param {number} width - Browser window width. + * @param {number} height - Browser window height. + * @returns {void} + */ + SetBounds(x: number, y: number, width: number, height: number): void; + + /** + * Sets the browser window focus state. + * @param {boolean} value - Is the window focused? + * @returns {void} + */ + SetFocus(value: boolean): void; + + SetName(browserName: string): void; + + /** + * Registers a callback to be called when a context menu is shown. + * @param {function} callback - The callback function to be called. + */ + SetShowContextMenuCallback(callback: (data: BrowserViewContextMenu) => void): void; + + /** + * Registers a callback to be called when a steam:// protocol URL is loaded. + * @returns {void} + */ + SetSteamURLCallback(callback: (steamURL: string) => void): void; + + /** + * Raises the browser window. + * @returns {void} + */ + SetTopWindow(): void; + + /** + * @todo unconfirmed + */ + SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; + + SetVRKeyboardVisibility(value: boolean): void; + + SetVisible(value: boolean): void; + + /** + * Stop the "find in page" function. + * @returns {void} + */ + StopFindInPage(): void; + + /** + * Stop listening for an event. + * @param {BrowserViewEvent} event - The event to stop listening to. + * @param {function} callback - The callback function to be called. + * @returns {void} + */ + off(event: BrowserViewEvent, callback: (args: any) => void): void; + + /** + * Start listening for an event. + * @param {BrowserViewEvent} event - The event to start listening to. + * @param {function} callback - The callback function to be called. + * @returns {void} + */ + on(event: BrowserViewEvent, callback: (args: any) => void): void; + + /** + * Fires when an `alert()` dialog appears. + */ + on(event: 'alert-dialog', callback: (message: string) => void): void; + + /** + * Fires when the browser is about to get destroyed. + */ + on(event: 'before-close', callback: () => void): void; + + /** + * Fires when a URL gets blocked. + * @todo not SetBlockedProtocols, maybe only steam links + */ + on(event: 'blocked-request', callback: (blockedURL: string) => void): void; + + /** + * Fires when `CanGoBack() or `CanGoForward()` state changes. + */ + on(event: 'can-go-back-forward-changed', callback: (canGoBackward: boolean, canGoForward: boolean) => void): void; + + /** + * Fires when a `confirm()` dialog appears. + */ + on(event: 'confirm-dialog', callback: (message: string) => void): void; + + /** + * Fires when the browser's favicon changes. + */ + on(event: 'favicon-urls-changed', callback: (faviconURLs: string[]) => void): void; + + /** + * Fires when "Find in page" gets its results. + */ + on(event: 'find-in-page-results', callback: (results: number, activeResultIndex: number) => void): void; + + /** + * Fires when the page finishes loading. + */ + on(event: 'finished-request', callback: (currentURL: string, previousURL: string) => void): void; + + /** + * Fires when the browser goes focused or vice versa. + */ + on(event: 'focus-changed', callback: (focused: boolean) => void): void; + + /** + * Fires when the browser goes fullscreen or vice versa. + */ + on(event: 'full-screen', callback: (fullscreen: boolean) => void): void; + + /** + * Fires when history changes occur. + */ + on(event: 'history-changed', callback: (history: BrowserViewHistory) => void): void; + + /** + * Fires when the URL fails to load. + */ + on(event: 'load-error', callback: (errorCode: number, errorURL: string, errorDescription: string) => void): void; + + /** + * @todo Same as PostMessage? + */ + on(event: 'message', callback: (args: any) => void): void; + + on(event: 'new-tab', callback: (args: any) => void): void; + + /** + * Fires when a node gets focused. + */ + on( + event: 'node-has-focus', + callback: (elementIdOrTagName: string, elementTag: string, param2: any, param3: string, param4: boolean) => void, + ): void; + + on(event: 'page-security', callback: (url: string, pageSecurity: BrowserViewPageSecurity) => void): void; + + /** + * Fires when the page's `` changes. + */ + on(event: 'set-title', callback: (title: string) => void): void; + + /** + * Fires when the page starts loading. + */ + on(event: 'start-loading', callback: (url: string, param1: boolean) => void): void; + + /** + * Fires when the page starts loading. + */ + on(event: 'start-request', callback: (url: string) => void): void; + + /** + * Fires when "Find in page" gets toggled. + */ + on(event: 'toggle-find-in-page', callback: () => void): void; +} + +export interface BrowserViewBounds { + x: number; + y: number; + width: number; + height: number; +} + +export interface BrowserViewContextMenuCustomCommand { + id: number; + label: string; +} + +export interface BrowserViewContextMenu { + /** + * Mouse X position inside the browser view. + */ + coord_x: number; + /** + * Mouse Y position inside the browser view. + */ + coord_y: number; + custom_commands: BrowserViewContextMenuCustomCommand[]; + /** + * Bitmask representing edit state. + * @remarks Appears on editable elements like `<input>`, etc. + * @example + * May be used with BrowserViewContextMenuEditFlag: + * ```js + * edit_state_flags & BrowserViewContextMenuEditFlag.CanCut != 0 // Can cut text + * ``` + */ + edit_state_flags?: number; + /** + * The misspelled word the cursor is on. + * @remarks Appears on an editable element with text. + */ + misspelled_word?: string; + /** + * Browser page URL. + * @todo Appears when there is selected text? + */ + link_url?: string; + /** + * Browser page URL. + */ + page_url: string; + /** + * Selected text. + * @remarks Appears when there is selected text. + */ + selection_text?: string; + /** + * Bitmask representing context menu type. + * @example + * May be used with BrowserViewContextMenuTypeFlag: + * ```js + * type_flags & BrowserViewContextMenuTypeFlag.Selection != 0 // Selected text present + * ``` + */ + type_flags: number; + /** + * Browser page URL. + * @todo Appears when there is selected text? + */ + unfiltered_link_url?: string; +} + +export interface BrowserViewHistoryEntry { + url: string; +} + +export interface BrowserViewHistory { + index: number; + entries: BrowserViewHistoryEntry[]; +} + +export interface BrowserViewPageSecurity { + bHasCertError: boolean; + bIsEVCert: boolean; + bIsSecure: boolean; + certExpiry: number; + certName: string; + issuerName: string; + nCertBits: number; +} + +export interface ServerBrowserGame { + /** The ID of the game. */ + appid: number; + /** The ID of the game. */ + gameid: string; + /** The game folder. */ + gamedir: string; + /** The game's name. */ + name: string; +} + +export interface ServerBrowserGameFilter { + /** Has users playing */ + NoEmpty: boolean; + /** Server not full */ + NoFull: boolean; + /** Is not password protected */ + NoPassword: boolean; + /** Anti-cheat */ + Secure: ServerBrowserGameFilterAntiCheat; + /** The ID of the game */ + appid: number; + /** The game folder */ + game: string; + /** Map filter */ + map: string; + /** Latency */ + ping: ServerBrowserGameFilterPing; +} + +export interface ServerBrowserServer { + /** The ID of the game. */ + appid: number; + /** The server IP. */ + ip: string; + /** The server port. */ + port: number; + queryPort: number; + /** Last time played as a UNIX timestamp. */ + lastPlayed: number; +} + +export interface ServerBrowserServerFull extends ServerBrowserServer { + /** Do not refresh if had unsuccessful response? */ + bDoNotRefresh: boolean; + /** Found the server? */ + bHadSuccessfulResponse: boolean; + /** Has password? */ + bPassword: boolean; + /** Is VAC secured? */ + bSecure: boolean; + /** How many bot players there currently are. */ + botPlayers: number; + /** The server's game name/description. */ + gameDesc: string; + /** The game folder. */ + gameDir: string; + /** Server tags, separated by a comma. */ + gameTags: string; + /** Current server map. */ + map: string; + /** Max players on the server. */ + maxPlayers: number; + /** The server name. */ + name: string; + /** The latency to the server. */ + ping: number; + /** How many players there currently are. */ + players: number; + /** The server's game version it is running on. */ + serverVersion: number; + steamID: string; +} + +export interface ServerBrowserFriendServer { + /** The ID of the game. */ + appid: number; + /** Non-Steam server? */ + bNonSteamServer: boolean; + gameText: string; + /** The ID of the game. */ + gameid: string; + steamIDLobby: string; +} + +export interface ServerBrowserFavoritesAndHistory { + favorites: ServerBrowserServer[]; + history: ServerBrowserServer[]; +} + +export interface ServerBrowserPlayerRefreshStatus { + bSuccess: boolean; + bRefreshComplete: boolean; +} + +export interface ServerBrowserPlayer extends ServerBrowserPlayerRefreshStatus { + /** Player name. */ + playerName: string; + /** Player score. */ + score: number; + /** Time played on the server. */ + timePlayed: number; +} + +export interface ServerBrowserPreferences { + GameList: string; + filters: ServerBrowserTabFilters; +} + +export interface ServerBrowserTabFilters { + favorites: ServerBrowserGameFilter; + friends: ServerBrowserGameFilter; + history: ServerBrowserGameFilter; + internet: ServerBrowserGameFilter; + lan: ServerBrowserGameFilter; +} + +export interface ServerBrowserDialog { + dialogID: number; + ip: number; + port: number; + queryPort: number; +} + +export interface FileDialog { + /** Whether to choose a directory instead. */ + bChooseDirectory?: boolean; + /** + * Array of file filters. + * @example + * Example from the "Add a Non-Steam Game" dialog: + * ``` + * [ + * { + * strFileTypeName: LocalizationManager.LocalizeString("#AddNonSteam_Filter_Exe_Linux"), + * rFilePatterns: [ "*.application", "*.exe", "*.sh", "*.AppImage" ], + * bUseAsDefault: true, + * }, + * { + * strFileTypeName: LocalizationManager.LocalizeString("#AddNonSteam_Filter_All"), + * rFilePatterns: [ "*" ], + * } + * ] + * ``` + */ + rgFilters?: FileDialogFilter[]; + /** Initially selected file. */ + strInitialFile?: string; + /** Window title. */ + strTitle?: string; +} + +export interface FileDialogFilter { + /** A localization string for the file type. */ + strFileTypeName: string; + /** + * File patterns. + * @example [ "*.application", "*.exe", "*.sh", "*.AppImage" ] + */ + rFilePatterns: string[]; + /** Whether to use this filter by default. */ + bUseAsDefault?: boolean; +} + +export interface OSEndOfLifeInfo { + bOSWillBeUnsupported: boolean; + osType: OSType; +} + +export interface SteamURL { + url: string; + /** + * @todo enum? + */ + feature: number; +} + +export interface SteamURLs { + CommunityImages: SteamURL; + StoreAppImages: SteamURL; + BaseURLSharedCDN: SteamURL; + ClanAssetCDN: SteamURL; + CommunityCDN: SteamURL; + AvatarBaseURL: SteamURL; + StoreCDN: SteamURL; + WebAPI: SteamURL; + LocalSSA: SteamURL; +} + +export interface SteamWindow { + appid: number; + hwndParent: number; + nBrowserID: number; + strAppName: string; + unID: number; + unPID: number; + windowType: number; + x: number; + y: number; +} + +export interface TransportInfo { + authKeyClientdll: string; + authKeySteamUI: string; + portClientdll: number; + portSteamUI: number; +} + +export interface FriendChatDialog { + browserid: number; + btakefocus: string; + command: string; + pid: number; + steamid: string; +} + +export interface FriendChatDialogData { + data: FriendChatDialog; +} + +export interface PushToTalkInfo { + /** Indicates whether push-to-talk is enabled. */ + bEnabled: boolean; + /** Indicates whether push-to-mute is in use instead. */ + bPushToMute: boolean; + /** + * Push-to-talk hotkey. + * @todo enum? + */ + vkHotKey: number; + /** Push-to-talk hotkey name. */ + strKeyName: string; +} + +export interface NotificationOptions { + body: string; + chatroomgroupid?: number; + chatroomid?: number; + icon?: string; + state: string; + /** A Steam64 ID. */ + steamid: string; + tag?: string; + title?: string; +} + +export interface LogonInfo { + bLoggedOn: boolean; + eUniverse: SteamRealm; + strAccountName: string; + strCommunityImagesURL: string; + strPersonaName: string; + /** Steam64 ID. */ + strSteamid: string; + /** Country code. */ + strUserCountry: string; +} + +export interface GameWindowInfo { + bCanClose: boolean; + strTitle: string; + windowid: number; +} + +export interface FocusedApp { + appid: number; + pid: number; + windowid: number; + strExeName: string; +} + +export interface FocusChangeEvent { + focusedApp: FocusedApp; + rgFocusable: FocusedApp[]; } export enum AppArtworkAssetType { - Capsule = 0, - Hero = 1, - Logo = 2, - Header = 3, - Icon = 4, - HeroBlur = 5, + Capsule = 0, + Hero = 1, + Logo = 2, + Header = 3, + Icon = 4, + HeroBlur = 5, } export enum UIComposition { - Hidden = 0, - Notification = 1, - Overlay = 2, - Opaque = 3, - OverlayKeyboard = 4, // Unverified + Hidden = 0, + Notification = 1, + Overlay = 2, + Opaque = 3, + OverlayKeyboard = 4, // Unverified } export enum OSType { - Web = -700, - Ios = -600, - Android = -500, - Android6 = -499, - Android7 = -498, - Android8 = -497, - Android9 = -496, - Ps3os = -300, - Linux = -203, - Linux22 = -202, - Linux24 = -201, - Linux26 = -200, - Linux32 = -199, - Linux35 = -198, - Linux36 = -197, - Linux310 = -196, - Linux316 = -195, - Linux318 = -194, - Linux3x = -193, - Linux4x = -192, - Linux41 = -191, - Linux44 = -190, - Linux49 = -189, - Linux414 = -188, - Linux419 = -187, - Linux5x = -186, - Linux54 = -185, - Linux6x = -184, - Linux7x = -183, - Linux510 = -182, - Macos = -102, - Macos104 = -101, - Macos105 = -100, - Macos1058 = -99, - Macos106_unused1 = -98, - Macos106_unused2 = -97, - Macos106_unused3 = -96, - Macos106 = -95, - Macos1063 = -94, - Macos1064_slgu = -93, - Macos1067 = -92, - Macos1067_unused = -91, - Macos107 = -90, - Macos108 = -89, - Macos109 = -88, - Macos1010 = -87, - Macos1011 = -86, - Macos1012 = -85, - Macos1013 = -84, - Macos1014 = -83, - Macos1015 = -82, - Macos1016 = -81, - Macos11 = -80, - Macos111 = -79, - Macos1017 = -78, - Macos12 = -77, - Macos1018 = -76, - Macos13 = -75, - Macos1019 = -74, - Macos14 = -73, - Macos1020 = -72, - Macos15 = -71, - Unknown = -1, - Windows = 0, - Win311 = 1, - Win95 = 2, - Win98 = 3, - WinME = 4, - WinNT = 5, - Win200 = 6, - WinXP = 7, - Win2003 = 8, - WinVista = 9, - Win7 = 10, - Win2008 = 11, - Win2012 = 12, - Win8 = 13, - Win81 = 14, - Win2012R2 = 15, - Win10 = 16, - Win2016 = 17, - Win2019 = 18, - Win2022 = 19, - Win11 = 20, + Web = -700, + Ios = -600, + Android = -500, + Android6 = -499, + Android7 = -498, + Android8 = -497, + Android9 = -496, + Ps3os = -300, + Linux = -203, + Linux22 = -202, + Linux24 = -201, + Linux26 = -200, + Linux32 = -199, + Linux35 = -198, + Linux36 = -197, + Linux310 = -196, + Linux316 = -195, + Linux318 = -194, + Linux3x = -193, + Linux4x = -192, + Linux41 = -191, + Linux44 = -190, + Linux49 = -189, + Linux414 = -188, + Linux419 = -187, + Linux5x = -186, + Linux54 = -185, + Linux6x = -184, + Linux7x = -183, + Linux510 = -182, + Macos = -102, + Macos104 = -101, + Macos105 = -100, + Macos1058 = -99, + Macos106_unused1 = -98, + Macos106_unused2 = -97, + Macos106_unused3 = -96, + Macos106 = -95, + Macos1063 = -94, + Macos1064_slgu = -93, + Macos1067 = -92, + Macos1067_unused = -91, + Macos107 = -90, + Macos108 = -89, + Macos109 = -88, + Macos1010 = -87, + Macos1011 = -86, + Macos1012 = -85, + Macos1013 = -84, + Macos1014 = -83, + Macos1015 = -82, + Macos1016 = -81, + Macos11 = -80, + Macos111 = -79, + Macos1017 = -78, + Macos12 = -77, + Macos1018 = -76, + Macos13 = -75, + Macos1019 = -74, + Macos14 = -73, + Macos1020 = -72, + Macos15 = -71, + Unknown = -1, + Windows = 0, + Win311 = 1, + Win95 = 2, + Win98 = 3, + WinME = 4, + WinNT = 5, + Win200 = 6, + WinXP = 7, + Win2003 = 8, + WinVista = 9, + Win7 = 10, + Win2008 = 11, + Win2012 = 12, + Win8 = 13, + Win81 = 14, + Win2012R2 = 15, + Win10 = 16, + Win2016 = 17, + Win2019 = 18, + Win2022 = 19, + Win11 = 20, } export enum ControllerType { - None = -1, - Unknown = 0, - UnknownSteamController = 1, - SteamController = 2, // Codename Gordon - SteamControllerV2 = 3, // Codename Headcrab - SteamControllerNeptune = 4, // Steam Deck - FrontPanelBoard = 20, - Generic = 30, - XBox360Controller = 31, - XBoxOneController = 32, - PS3Controller = 33, - PS4Controller = 34, - WiiController = 35, - AppleController = 36, - AndroidController = 37, - SwitchProController = 38, - SwitchJoyConLeft = 39, - SwitchJoyConRight = 40, - SwitchJoyConPair = 41, - SwitchProGenericInputOnlyController = 42, - MobileTouch = 43, - SwitchProXInputSwitchController = 44, - PS5Controller = 45, - XboxEliteController = 46, - LastController = 47, // Unverified - PS5EdgeController = 48, - GenericKeyboard = 400, - GenericMouse = 800, + None = -1, + Unknown = 0, + UnknownSteamController = 1, + SteamController = 2, // Codename Gordon + SteamControllerV2 = 3, // Codename Headcrab + SteamControllerNeptune = 4, // Steam Deck + FrontPanelBoard = 20, + Generic = 30, + XBox360Controller = 31, + XBoxOneController = 32, + PS3Controller = 33, + PS4Controller = 34, + WiiController = 35, + AppleController = 36, + AndroidController = 37, + SwitchProController = 38, + SwitchJoyConLeft = 39, + SwitchJoyConRight = 40, + SwitchJoyConPair = 41, + SwitchProGenericInputOnlyController = 42, + MobileTouch = 43, + SwitchProXInputSwitchController = 44, + PS5Controller = 45, + XboxEliteController = 46, + LastController = 47, // Unverified + PS5EdgeController = 48, + GenericKeyboard = 400, + GenericMouse = 800, } export enum FilePrivacyState { - Invalid = -1, - Private = 2, - FriendsOnly = 4, - Public = 8, - Unlisted = 16, + Invalid = -1, + Private = 2, + FriendsOnly = 4, + Public = 8, + Unlisted = 16, } export enum BluetoothDeviceType { - Invalid = 0, - Unknown = 1, - Phone = 2, - Computer = 3, - Headset = 4, - Headphones = 5, - Speakers = 6, - OtherAudio = 7, - Mouse = 8, - Joystick = 9, - Gamepad = 10, - Keyboard = 11, + Invalid = 0, + Unknown = 1, + Phone = 2, + Computer = 3, + Headset = 4, + Headphones = 5, + Speakers = 6, + OtherAudio = 7, + Mouse = 8, + Joystick = 9, + Gamepad = 10, + Keyboard = 11, } export enum AppAssociationType { - Invalid = 0, - Publisher = 1, - Developer = 2, - Franchise = 3, + Invalid = 0, + Publisher = 1, + Developer = 2, + Franchise = 3, } 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, + 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 enum AppCloudStatus { - Invalid = 0, - Disabled = 1, - Unknown = 2, - Synchronized = 3, - Checking = 4, - OutOfSync = 5, - Uploading = 6, - Downloading = 7, - SyncFailed = 8, - Conflict = 9, - PendingElsewhere = 10, + Invalid = 0, + Disabled = 1, + Unknown = 2, + Synchronized = 3, + Checking = 4, + OutOfSync = 5, + Uploading = 6, + Downloading = 7, + SyncFailed = 8, + Conflict = 9, + PendingElsewhere = 10, } export enum SteamDeckCompatibilityCategory { - Unknown = 0, - Unsupported = 1, - Playable = 2, - Verified = 3, + Unknown = 0, + Unsupported = 1, + Playable = 2, + Verified = 3, } export enum ACState { - Unknown = 0, - Disconnected = 1, - Connected = 2, - ConnectedSlow = 3, + Unknown = 0, + Disconnected = 1, + Connected = 2, + ConnectedSlow = 3, } export enum BatteryState { - Unknown = 0, - Discharging = 1, - Charging = 2, - Full = 3, + Unknown = 0, + Discharging = 1, + Charging = 2, + Full = 3, } export enum OSBranchType { - Unknown = 0, - Release = 1, - ReleaseCandidate = 2, - Beta = 3, - BetaCandidate = 4, - Main = 5, - Staging = 6, + Unknown = 0, + Release = 1, + ReleaseCandidate = 2, + Beta = 3, + BetaCandidate = 4, + Main = 5, + Staging = 6, } export enum AppOwnershipFlags { - None = 0, - Subscribed = 1, - Free = 2, - RegionRestricted = 4, - LowViolence = 8, - InvalidPlatform = 16, - Borrowed = 32, - FreeWeekend = 64, - Retail = 128, - Locked = 256, - Pending = 512, - Expired = 1024, - Permanent = 2048, - Recurring = 4096, - Canceled = 8192, - AutoGrant = 16384, - PendingGift = 32768, - RentalNotActivated = 65536, - Rental = 131072, - SiteLicense = 262144, - LegacyFreeSub = 524288, - InvalidOSType = 1048576, - TimedTrial = 2097152, + None = 0, + Subscribed = 1, + Free = 2, + RegionRestricted = 4, + LowViolence = 8, + InvalidPlatform = 16, + Borrowed = 32, + FreeWeekend = 64, + Retail = 128, + Locked = 256, + Pending = 512, + Expired = 1024, + Permanent = 2048, + Recurring = 4096, + Canceled = 8192, + AutoGrant = 16384, + PendingGift = 32768, + RentalNotActivated = 65536, + Rental = 131072, + SiteLicense = 262144, + LegacyFreeSub = 524288, + InvalidOSType = 1048576, + TimedTrial = 2097152, } export enum AppError { - None = 0, - Unspecified = 1, - Paused = 2, - Canceled = 3, - Suspended = 4, - NoSubscription = 5, - NoConnection = 6, - Timeout = 7, - MissingKey = 8, - MissingConfig = 9, - DiskReadFailure = 10, - DiskWriteFailure = 11, - NotEnoughDiskSpace = 12, - CorruptGameFiles = 13, - WaitingForNextDisk = 14, - InvalidInstallPath = 15, - AppRunning = 16, - DependencyFailure = 17, - NotInstalled = 18, - UpdateRequired = 19, - Busy = 20, - NoDownloadSources = 21, - InvalidAppConfig = 22, - InvalidDepotConfig = 23, - MissingManifest = 24, - NotReleased = 25, - RegionRestricted = 26, - CorruptDepotCache = 27, - MissingExecutable = 28, - InvalidPlatform = 29, - InvalidFileSystem = 30, - CorruptUpdateFiles = 31, - DownloadDisabled = 32, - SharedLibraryLocked = 33, - PendingLicense = 34, - OtherSessionPlaying = 35, - CorruptDownload = 36, - CorruptDisk = 37, - FilePermissions = 38, - FileLocked = 39, - MissingContent = 40, - Requires64BitOS = 41, - MissingUpdateFiles = 42, - NotEnoughDiskQuota = 43, - LockedSiteLicense = 44, - ParentalBlocked = 45, - SpawnProcess = 46, - ClientOutOfDate = 47, - PlaytimeExceeded = 48, - CorruptFileSignature = 49, - MissingGameFiles = 50, - CompatToolFailed = 51, - RemovedInstallPath = 52, - InvalidBackupPath = 53, - InvalidPasscode = 54, - SelfUpdating = 55, - ParentalPlaytimeExceeded = 56, - Max = 57 + None = 0, + Unspecified = 1, + Paused = 2, + Canceled = 3, + Suspended = 4, + NoSubscription = 5, + NoConnection = 6, + Timeout = 7, + MissingKey = 8, + MissingConfig = 9, + DiskReadFailure = 10, + DiskWriteFailure = 11, + NotEnoughDiskSpace = 12, + CorruptGameFiles = 13, + WaitingForNextDisk = 14, + InvalidInstallPath = 15, + AppRunning = 16, + DependencyFailure = 17, + NotInstalled = 18, + UpdateRequired = 19, + Busy = 20, + NoDownloadSources = 21, + InvalidAppConfig = 22, + InvalidDepotConfig = 23, + MissingManifest = 24, + NotReleased = 25, + RegionRestricted = 26, + CorruptDepotCache = 27, + MissingExecutable = 28, + InvalidPlatform = 29, + InvalidFileSystem = 30, + CorruptUpdateFiles = 31, + DownloadDisabled = 32, + SharedLibraryLocked = 33, + PendingLicense = 34, + OtherSessionPlaying = 35, + CorruptDownload = 36, + CorruptDisk = 37, + FilePermissions = 38, + FileLocked = 39, + MissingContent = 40, + Requires64BitOS = 41, + MissingUpdateFiles = 42, + NotEnoughDiskQuota = 43, + LockedSiteLicense = 44, + ParentalBlocked = 45, + SpawnProcess = 46, + ClientOutOfDate = 47, + PlaytimeExceeded = 48, + CorruptFileSignature = 49, + MissingGameFiles = 50, + CompatToolFailed = 51, + RemovedInstallPath = 52, + InvalidBackupPath = 53, + InvalidPasscode = 54, + SelfUpdating = 55, + ParentalPlaytimeExceeded = 56, + Max = 57, } export enum ClientBetaState { - None = 0, - NoneChosen = 1, - NoneChosenNonAdmin = 2, - InBeta = 3, - InBetaNonAdmin = 4, + None = 0, + NoneChosen = 1, + NoneChosenNonAdmin = 2, + InBeta = 3, + InBetaNonAdmin = 4, } export enum ConnectivityTestResult { - Unknown = 0, - Connected = 1, - CaptivePortal = 2, - TimedOut = 3, - Failed = 4, - WifiDisabled = 5, - NoLAN = 6, + Unknown = 0, + Connected = 1, + CaptivePortal = 2, + TimedOut = 3, + Failed = 4, + WifiDisabled = 5, + NoLAN = 6, } export enum ControllerRumbleSetting { - ControllerPreference = 0, - Off = 1, - On = 2, + ControllerPreference = 0, + Off = 1, + On = 2, } export enum AppControllerSupportLevel { - None = 0, - Partial = 1, - Full = 2, + None = 0, + Partial = 1, + Full = 2, } export enum AppType { - DepotOnly = -2147483648, - Invalid = 0, - Game = 1, - Application = 2, - Tool = 4, - Demo = 8, - Deprecated = 16, - DLC = 32, - Guide = 64, - Driver = 128, - Config = 256, - Hardware = 512, - Franchise = 1024, - Video = 2048, - Plugin = 4096, - MusicAlbum = 8192, - Series = 16384, - Comic = 32768, - Beta = 65536, - Shortcut = 1073741824, + DepotOnly = -2147483648, + Invalid = 0, + Game = 1, + Application = 2, + Tool = 4, + Demo = 8, + Deprecated = 16, + DLC = 32, + Guide = 64, + Driver = 128, + Config = 256, + Hardware = 512, + Franchise = 1024, + Video = 2048, + Plugin = 4096, + MusicAlbum = 8192, + Series = 16384, + Comic = 32768, + Beta = 65536, + Shortcut = 1073741824, } export enum AutoUpdateBehavior { - Always = 0, // (Always keep this game updated) - Launch = 1, // (Only update this game when I launch it) - HighPriority = 2, // (High priority) + Always = 0, // (Always keep this game updated) + Launch = 1, // (Only update this game when I launch it) + HighPriority = 2, // (High priority) } export enum BackgroundDownloadsBehavior { - Pause = 0, - Always = 1, - Never = 2, + Pause = 0, + Always = 1, + Never = 2, +} + +export enum SteamRealm { + Unknown = 0, + Global = 1, + China = 2, +} + +/** + * @remarks Not present in any of the Steam files, source: https://gist.github.com/Ne3tCode/fc424ae2bd723d9ccb236eeccce66316#file-steammobile_friendsui_enums-steamd-L1308-L1340 + */ +export enum AppLaunchSource { + None = 0, + _2ftLibraryDetails = 100, + _2ftLibraryListView = 101, + _2ftLibraryGrid = 103, + InstallSubComplete = 104, + DownloadsPage = 105, + RemoteClientStartStreaming = 106, + _2ftMiniModeList = 107, + _10ft = 200, + DashAppLaunchCmdLine = 300, + DashGameIdLaunchCmdLine = 301, + RunByGameDir = 302, + SubCmdRunDashGame = 303, + SteamURL_Launch = 400, + SteamURL_Run = 401, + SteamURL_JoinLobby = 402, + SteamURL_RunGame = 403, + SteamURL_RunGameIdOrJumplist = 404, + SteamURL_RunSafe = 405, + TrayIcon = 500, + LibraryLeftColumnContextMenu = 600, + LibraryLeftColumnDoubleClick = 601, + Dota2Launcher = 700, + IRunGameEngine = 800, + DRMFailureResponse = 801, + DRMDataRequest = 802, + CloudFilePanel = 803, + DiscoveredAlreadyRunning = 804, + GameActionJoinParty = 900, + AppPortraitContextMenu = 1000, +} + +export enum AppLaunchOptionType { + None = 0, + Default = 1, + SafeMode = 2, + Multiplayer = 3, + Config = 4, + OpenVR = 5, + Server = 6, + Editor = 7, + Manual = 8, + Benchmark = 9, + Option1 = 10, + Option2 = 11, + Option3 = 12, + OculusVR = 13, + OpenVROverlay = 14, + OSVR = 15, + OpenXR = 16, + Dialog = 1e3, +} + +/** + * @remarks Not present in any of the Steam files. This is only present as localization strings, whose tokens start with `#Steam_AppUpdateError_`. + */ +export enum AppUpdateError { + None = 0, + Unspecified = 1, + Paused = 2, + Canceled = 3, + Suspended = 4, + NoSubscription = 5, + NoConnection = 6, + Timeout = 7, + MissingKey = 8, + MissingConfig = 9, + DiskReadFailure = 10, + DiskWriteFailure = 11, + NotEnoughDiskSpace = 12, + CorruptGameFiles = 13, + WaitingForNextDisk = 14, + InvalidInstallPath = 15, + AppRunning = 16, + DependencyFailure = 17, + NotInstalled = 18, + UpdateRequired = 19, + Busy = 20, + NoDownloadSources = 21, + InvalidAppConfig = 22, + InvalidDepotConfig = 23, + MissingManifest = 24, + NotReleased = 25, + RegionRestricted = 26, + CorruptDepotCache = 27, + MissingExecutable = 28, + InvalidPlatform = 29, + InvalidFileSystem = 30, + CorruptUpdateFiles = 31, + DownloadDisabled = 32, + SharedLibraryLocked = 33, + PendingLicense = 34, + OtherSessionPlaying = 35, + CorruptDownload = 36, + CorruptDisk = 37, + FilePermissions = 38, + FileLocked = 39, + MissingContent = 40, + Requires64BitOS = 41, + MissingUpdateFiles = 42, + NotEnoughDiskQuota = 43, + LockedSiteLicense = 44, + ParentalControlBlocked = 45, + CreateProcessFailure = 46, + SteamClientOutdated = 47, + PlaytimeExceeded = 48, + CorruptFileSignature = 49, + MissingInstalledFiles = 50, + CompatibilityToolFailure = 51, + UnmountedUninstallPath = 52, + InvalidBackupPath = 53, + InvalidPasscode = 54, + ThirdPartyUpdater = 55, + ParentalPlaytimeExceeded = 56, +} + +export enum ClientUINotification { + GroupChatMessage = 1, + FriendChatMessage = 2, + FriendPersonaState = 3, +} + +export enum MusicRepeatStatus { + None = 0, + All = 1, + Once = 2, + Max = 3, +} + +export enum JoinServerError { + PingFailed = -3, + Connecting = -2, + Pinging = -1, + None = 0, + VACBanned = 1, + ServerFull = 2, + ModNotInstalled = 3, + AppNotFound = 4, + NotInitialized = 5, +} + +export enum ServerBrowserGameFilterAntiCheat { + All = 0, + Secure = 1, + NotSecure = 2, +} + +export enum ServerBrowserGameFilterPing { + All = 0, + LessThan50 = 50, + LessThan100 = 100, + LessThan150 = 150, + LessThan250 = 250, +} + +export enum UIMode { + Unknown = -1, + GamePad = 4, + Desktop = 7, +} + +export enum WindowBringToFront { + Invalid = 0, + ForceOS = 1, + WithoutForcingOS = 2, +} + +export enum ComputerActiveState { + Invalid = 0, + Active = 1, + Idle = 2, +} + +export enum ClientUsedInputType { + Keyboard = 0, + Mouse = 1, + Controller = 2, + Max = 3, +} + +export enum TouchGestureType { + None = 0, + Touch = 1, + Tap = 2, + DoubleTap = 3, + ShortPress = 4, + LongPress = 5, + LongTap = 6, + TwoFingerTap = 7, + TapCancelled = 8, + PinchBegin = 9, + PinchUpdate = 10, + PinchEnd = 11, + FlingStart = 12, + FlingCancelled = 13, +} + +export enum BrowserViewContextMenuCommand { + Close = -1, + OpenDevTools = 26500, + CloseDevTools = 26501, + InspectElement = 26502, + OpenLinkInNewTab = 26503, +} + +export enum BrowserViewContextMenuTypeFlag { + None = 0, + Page = 1 << 0, + Frame = 1 << 1, + Link = 1 << 2, + Media = 1 << 3, + Selection = 1 << 4, + Editable = 1 << 5, +} + +export enum BrowserViewContextMenuEditFlag { + None = 0, + CanUndo = 1 << 0, + CanRedo = 1 << 1, + CanCut = 1 << 2, + CanCopy = 1 << 3, + CanPaste = 1 << 4, + CanDelete = 1 << 5, + CanSelectAll = 1 << 6, + CanTranslate = 1 << 7, +} + +export enum Result { + OK = 1, + Fail = 2, + NoConnection = 3, + InvalidPassword = 5, + LoggedInElsewhere = 6, + InvalidProtocolVer = 7, + InvalidParam = 8, + FileNotFound = 9, + Busy = 10, + InvalidState = 11, + InvalidName = 12, + InvalidEmail = 13, + DuplicateName = 14, + AccessDenied = 15, + Timeout = 16, + Banned = 17, + AccountNotFound = 18, + InvalidSteamID = 19, + ServiceUnavailable = 20, + NotLoggedOn = 21, + Pending = 22, + EncryptionFailure = 23, + InsufficientPrivilege = 24, + LimitExceeded = 25, + Revoked = 26, + Expired = 27, + AlreadyRedeemed = 28, + DuplicateRequest = 29, + AlreadyOwned = 30, + IPNotFound = 31, + PersistFailed = 32, + LockingFailed = 33, + LogonSessionReplaced = 34, + ConnectFailed = 35, + HandshakeFailed = 36, + IOFailure = 37, + RemoteDisconnect = 38, + ShoppingCartNotFound = 39, + Blocked = 40, + Ignored = 41, + NoMatch = 42, + AccountDisabled = 43, + ServiceReadOnly = 44, + AccountNotFeatured = 45, + AdministratorOK = 46, + ContentVersion = 47, + TryAnotherCM = 48, + PasswordRequiredToKickSession = 49, + AlreadyLoggedInElsewhere = 50, + Suspended = 51, + Cancelled = 52, + DataCorruption = 53, + DiskFull = 54, + RemoteCallFailed = 55, + PasswordUnset = 56, + ExternalAccountUnlinked = 57, + PSNTicketInvalid = 58, + ExternalAccountAlreadyLinked = 59, + RemoteFileConflict = 60, + IllegalPassword = 61, + SameAsPreviousValue = 62, + AccountLogonDenied = 63, + CannotUseOldPassword = 64, + InvalidLoginAuthCode = 65, + AccountLogonDeniedNoMail = 66, + HardwareNotCapableOfIPT = 67, + IPTInitError = 68, + ParentalControlRestricted = 69, + FacebookQueryError = 70, + ExpiredLoginAuthCode = 71, + IPLoginRestrictionFailed = 72, + AccountLockedDown = 73, + AccountLogonDeniedVerifiedEmailRequired = 74, + NoMatchingURL = 75, + BadResponse = 76, + RequirePasswordReEntry = 77, + ValueOutOfRange = 78, + UnexpectedError = 79, + Disabled = 80, + InvalidCEGSubmission = 81, + RestrictedDevice = 82, + RegionLocked = 83, + RateLimitExceeded = 84, + AccountLoginDeniedNeedTwoFactor = 85, + ItemDeleted = 86, + AccountLoginDeniedThrottle = 87, + TwoFactorCodeMismatch = 88, + TwoFactorActivationCodeMismatch = 89, + AccountAssociatedToMultiplePartners = 90, + NotModified = 91, + NoMobileDevice = 92, + TimeNotSynced = 93, + SmsCodeFailed = 94, + AccountLimitExceeded = 95, + AccountActivityLimitExceeded = 96, + PhoneActivityLimitExceeded = 97, + RefundToWallet = 98, + EmailSendFailure = 99, + NotSettled = 100, + NeedCaptcha = 101, + GSLTDenied = 102, + GSOwnerDenied = 103, + InvalidItemType = 104, + IPBanned = 105, + GSLTExpired = 106, + InsufficientFunds = 107, + TooManyPending = 108, + NoSiteLicensesFound = 109, + WGNetworkSendExceeded = 110, + AccountNotFriends = 111, + LimitedUserAccount = 112, } +/** + * @todo May be useful for ParentalSettings.feature ? + */ +export enum ParentalFeature { + Invalid = 0, + Store = 1, + Community = 2, + Profile = 3, + Friends = 4, + News = 5, + Trading = 6, + Settings = 7, + Console = 8, + Browser = 9, + ParentalSetup = 10, + Library = 11, + Test = 12, + SiteLicense = 13, + KioskMode = 14, + Max = 15, +} export interface Unregisterable { - /** - * Unregister the callback. - */ - unregister(): void; -} \ No newline at end of file + /** + * Unregister the callback. + */ + unregister(): void; +} From 67089bcc5dbd8a4f0f55b03005dc3af2fabf7091 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Tue, 28 Nov 2023 22:33:42 +0800 Subject: [PATCH 22/46] change: Fix formatting style --- src/globals/SteamClient.ts | 9687 ++++++++++++++++++------------------ 1 file changed, 4919 insertions(+), 4768 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index d326fd8b..401e53a5 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -6,454 +6,459 @@ declare global { * Represents various functions related to Steam applications. */ export interface Apps { - /** - * Adds a non-Steam application shortcut to the local Steam library. - * @param {string} appName - The name of the non-Steam application. - * @param {string} executablePath - The path to the executable file of the non-Steam application. - * @param {string} directory - The working directory for the non-Steam application. - * @param {string} launchOptions - Options to be passed when launching the non-Steam application. - * @returns {Promise<number>} - A Promise that resolves to a unique AppID assigned to the added non-Steam application shortcut. - */ - AddShortcut(appName: string, executablePath: string, directory: string, launchOptions: string): Promise<number>; - - /** - * Adds user tags to specified apps in the Steam library. - * @param {number[]} appIds - The IDs of the apps to which user tags will be added. - * @param {string} userTag - The user tag to be added. - * @returns {void} - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - AddUserTagToApps(appIds: number[], userTag: string): void; + /** + * Adds a non-Steam application shortcut to the local Steam library. + * @param {string} appName - The name of the non-Steam application. + * @param {string} executablePath - The path to the executable file of the non-Steam application. + * @param {string} directory - The working directory for the non-Steam application. + * @param {string} launchOptions - Options to be passed when launching the non-Steam application. + * @returns {Promise<number>} - A Promise that resolves to a unique AppID assigned to the added non-Steam application shortcut. + */ + AddShortcut(appName: string, executablePath: string, directory: string, launchOptions: string): Promise<number>; + + /** + * Adds user tags to specified apps in the Steam library. + * @param {number[]} appIds - The IDs of the apps to which user tags will be added. + * @param {string} userTag - The user tag to be added. + * @returns {void} + * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. + */ + AddUserTagToApps(appIds: number[], userTag: string): void; - /** - * Backups an app to the specified path. - * @param {number} appId - The ID of the application to back up. - * @param {string} backupToPath - The path to store the backup. - * @returns {number} A Promise that resolves to a number. This value may be "20" for backup busy and "0" for success. - */ - BackupFilesForApp(appId: number, backupToPath: string): Promise<number>; + /** + * Backups an app to the specified path. + * @param {number} appId - The ID of the application to back up. + * @param {string} backupToPath - The path to store the backup. + * @returns {number} A Promise that resolves to a number. This value may be "20" for backup busy and "0" for success. + */ + BackupFilesForApp(appId: number, backupToPath: string): Promise<number>; - /** - * Opens the screenshot folder for a specific app. - * @param {string} appId - The ID of the app to browse screenshots for. - * @param {number} handle - The screenshot handle to use. - * @returns {void} - */ - BrowseScreenshotForApp(appId: string, handle: number): void; + /** + * Opens the screenshot folder for a specific app. + * @param {string} appId - The ID of the app to browse screenshots for. + * @param {number} handle - The screenshot handle to use. + * @returns {void} + */ + BrowseScreenshotForApp(appId: string, handle: number): void; - /** - * Opens the screenshot folder for a specific app. - * @param {string} appId - The ID of the app to browse screenshots for. - * @returns {void} - */ - BrowseScreenshotsForApp(appId: string): void; + /** + * Opens the screenshot folder for a specific app. + * @param {string} appId - The ID of the app to browse screenshots for. + * @returns {void} + */ + BrowseScreenshotsForApp(appId: string): void; - /** - * Cancels the current backup process. - * @returns {void} - */ - CancelBackup(): void; + /** + * Cancels the current backup process. + * @returns {void} + */ + CancelBackup(): void; - CancelGameAction: any; + CancelGameAction: any; - /** - * Cancels the launch of an application with the specified ID. - * @param {string} appId - The ID of the application whose launch is to be canceled. - * @returns {void} - */ - CancelLaunch(appId: string): void; - - /** - * Clears existing user tags on a specified application and sets new user tags. - * @param {number} appId - The ID of the application to clear and set user tags for. - * @param {string[]} userTags - An array of user tags to set for the application. - * @returns {void} - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - ClearAndSetUserTagsOnApp(appId: number, userTags: string[]): void; + /** + * Cancels the launch of an application with the specified ID. + * @param {string} appId - The ID of the application whose launch is to be canceled. + * @returns {void} + */ + CancelLaunch(appId: string): void; + + /** + * Clears existing user tags on a specified application and sets new user tags. + * @param {number} appId - The ID of the application to clear and set user tags for. + * @param {string[]} userTags - An array of user tags to set for the application. + * @returns {void} + * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. + */ + ClearAndSetUserTagsOnApp(appId: number, userTags: string[]): void; - /** - * Clears the custom artwork for a given application. - * @param {number} appId - The ID of the application to clear custom artwork for. - * @param {AppArtworkAssetType} assetType - The type of artwork to clear. - */ - ClearCustomArtworkForApp(appId: number, assetType: AppArtworkAssetType): Promise<void>; + /** + * Clears the custom artwork for a given application. + * @param {number} appId - The ID of the application to clear custom artwork for. + * @param {AppArtworkAssetType} assetType - The type of artwork to clear. + */ + ClearCustomArtworkForApp(appId: number, assetType: AppArtworkAssetType): Promise<void>; - /** - * Clears the custom logo position for a specific application. - * @param {number} appId - The ID of the application. - * @returns {Promise<void>} - A Promise that resolves once the custom logo position is cleared. - */ - ClearCustomLogoPositionForApp(appId: number): Promise<void>; + /** + * Clears the custom logo position for a specific application. + * @param {number} appId - The ID of the application. + * @returns {Promise<void>} - A Promise that resolves once the custom logo position is cleared. + */ + ClearCustomLogoPositionForApp(appId: number): Promise<void>; - ClearProton: any; + ClearProton: any; - /** - * Clears user tags on a list of specified applications. - * @param {number[]} appIds - An array of application IDs for which to clear user tags. - * @returns {void} - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - ClearUserTagsOnApps(appIds: number[]): void; + /** + * Clears user tags on a list of specified applications. + * @param {number[]} appIds - An array of application IDs for which to clear user tags. + * @returns {void} + * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. + */ + ClearUserTagsOnApps(appIds: number[]): void; - ContinueGameAction: any; + ContinueGameAction: any; - /** - * Creates a Steam application shortcut on the desktop. - * @param {number} appId - The ID of the application for which to create a desktop shortcut. - * @returns {void} - */ - CreateDesktopShortcutForApp(appId: number): void; - - /** - * Download a workshop item. - * @param {number} appId - The ID of the application. - * @param {string} itemId - The ID of the workshop item. - * @param {boolean} param1 - Additional parameter (exact usage may vary). - * @returns {void} - */ - DownloadWorkshopItem(appId: number, itemId: string, param1: boolean): void; - - /** - * Retrieves achievements within a specified time range for a given app. - * @param {number} appId - The ID of the application. - * @param {number} start - The start of the time range as a Unix timestamp. - * @param {number} end - The end of the time range as a Unix timestamp. - * @returns {Promise<AppAchievement[]>} - A Promise that resolves to an array of AppAchievement objects. - */ - GetAchievementsInTimeRange(appId: number, start: number, end: number): Promise<AppAchievement[]>; + /** + * Creates a Steam application shortcut on the desktop. + * @param {number} appId - The ID of the application for which to create a desktop shortcut. + * @returns {void} + */ + CreateDesktopShortcutForApp(appId: number): void; + + /** + * Download a workshop item. + * @param {number} appId - The ID of the application. + * @param {string} itemId - The ID of the workshop item. + * @param {boolean} param1 - Additional parameter (exact usage may vary). + * @returns {void} + */ + DownloadWorkshopItem(appId: number, itemId: string, param1: boolean): void; + + /** + * Retrieves achievements within a specified time range for a given app. + * @param {number} appId - The ID of the application. + * @param {number} start - The start of the time range as a Unix timestamp. + * @param {number} end - The end of the time range as a Unix timestamp. + * @returns {Promise<AppAchievement[]>} - A Promise that resolves to an array of AppAchievement objects. + */ + GetAchievementsInTimeRange(appId: number, start: number, end: number): Promise<AppAchievement[]>; - /** - * Retrieves a list of active game actions, such as launching an application. - * @returns {Promise<GameAction[]>} A Promise that resolves to an array of active game actions. - */ - GetActiveGameActions(): Promise<GameAction[]>; + /** + * Retrieves a list of active game actions, such as launching an application. + * @returns {Promise<GameAction[]>} A Promise that resolves to an array of active game actions. + */ + GetActiveGameActions(): Promise<GameAction[]>; - /** - * Retrieves a list of available compatibility tools for a specific application. - * @param {number} appId - The ID of the application to retrieve compatibility tools for. - * @returns {Promise<CompatibilityToolInfo[]>} A Promise that resolves to an array of CompatibilityToolInfo objects. - */ - GetAvailableCompatTools(appId: number): Promise<CompatibilityToolInfo[]>; + /** + * Retrieves a list of available compatibility tools for a specific application. + * @param {number} appId - The ID of the application to retrieve compatibility tools for. + * @returns {Promise<CompatibilityToolInfo[]>} A Promise that resolves to an array of CompatibilityToolInfo objects. + */ + GetAvailableCompatTools(appId: number): Promise<CompatibilityToolInfo[]>; - /** - * Represents a function to retrieve the name of the application in a backup folder. - * @param {string} appBackupPath - The path to the application's backup folder. - * @returns {Promise<string | undefined>} - A Promise that resolves to the name of the application in the backup folder, or undefined if the path is invalid. - * @remarks This function checks for the "sku.sis" file in that path. - */ - GetBackupsInFolder(appBackupPath: string): Promise<string | undefined>; + /** + * Represents a function to retrieve the name of the application in a backup folder. + * @param {string} appBackupPath - The path to the application's backup folder. + * @returns {Promise<string | undefined>} - A Promise that resolves to the name of the application in the backup folder, or undefined if the path is invalid. + * @remarks This function checks for the "sku.sis" file in that path. + */ + GetBackupsInFolder(appBackupPath: string): Promise<string | undefined>; - /** - * @param appId - The ID of the application. - * @returns {Promise<string>} - A Promise that resolves to a stringified object. - */ - GetCachedAppDetails(appId: number): Promise<string>; // todo: Parsing nightmare + /** + * @param appId - The ID of the application. + * @returns {Promise<string>} - A Promise that resolves to a stringified object. + */ + GetCachedAppDetails(appId: number): Promise<string>; // todo: Parsing nightmare - GetCloudPendingRemoteOperations(appId: number): Promise<any>; - GetConflictingFileTimestamps(appId: number): Promise<ConflictingFileTimestamp>; + GetCloudPendingRemoteOperations(appId: number): Promise<any>; - /** - * Retrieves details for a specific screenshot upload. - * @param {string} appId - The ID of the application. - * @param {number} hHandle - The handle of the screenshot upload. - * @returns {Promise<DetailsForScreenshotUpload>} - A Promise that resolves to details about the screenshot upload. - */ - GetDetailsForScreenshotUpload(appId: string, hHandle: number): Promise<DetailsForScreenshotUpload>; + GetConflictingFileTimestamps(appId: number): Promise<ConflictingFileTimestamp>; - /** - * Retrieves details for multiple screenshot uploads. - * @param {string} appId - The ID of the application. - * @param {number[]} hHandles - An array of handles of the screenshot uploads. - * @returns {Promise<DetailsForScreenshotUploads>} - A Promise that resolves to details about the screenshot uploads. - */ - GetDetailsForScreenshotUploads(appId: string, hHandles: number[]): Promise<DetailsForScreenshotUploads>; + /** + * Retrieves details for a specific screenshot upload. + * @param {string} appId - The ID of the application. + * @param {number} hHandle - The handle of the screenshot upload. + * @returns {Promise<DetailsForScreenshotUpload>} - A Promise that resolves to details about the screenshot upload. + */ + GetDetailsForScreenshotUpload(appId: string, hHandle: number): Promise<DetailsForScreenshotUpload>; - /** - * Retrieves a list of downloaded workshop items for a specific application. - * @param {number} appId - The ID of the application to retrieve downloaded workshop items for. - * @returns {Promise<WorkshopItem[]>} - A Promise that resolves to an array of downloaded workshop items for the specified application. - */ - GetDownloadedWorkshopItems(appId: number): Promise<WorkshopItem[]>; + /** + * Retrieves details for multiple screenshot uploads. + * @param {string} appId - The ID of the application. + * @param {number[]} hHandles - An array of handles of the screenshot uploads. + * @returns {Promise<DetailsForScreenshotUploads>} - A Promise that resolves to details about the screenshot uploads. + */ + GetDetailsForScreenshotUploads(appId: string, hHandles: number[]): Promise<DetailsForScreenshotUploads>; - GetDurationControlInfo(appId: number): Promise<any>; // {"bApplicable": true} - overlay usage? + /** + * Retrieves a list of downloaded workshop items for a specific application. + * @param {number} appId - The ID of the application to retrieve downloaded workshop items for. + * @returns {Promise<WorkshopItem[]>} - A Promise that resolves to an array of downloaded workshop items for the specified application. + */ + GetDownloadedWorkshopItems(appId: number): Promise<WorkshopItem[]>; - /** - * Retrieves achievement information for a specific application for a given friend. - * @param {string} appId - The ID of the application to retrieve achievement information for. - * @param {string} friendSteam64Id - The Steam64 ID of the friend for whom to retrieve achievement information. - * @returns {Promise<AppAchievementResponse>} - A Promise that resolves to an object containing achievement information for the specified friend and application. - */ - GetFriendAchievementsForApp(appId: string, friendSteam64Id: string): Promise<AppAchievementResponse>; + GetDurationControlInfo(appId: number): Promise<any>; // {"bApplicable": true} - overlay usage? - /** - * Retrieves a list of friends who play the specified application. - * @param {number} appId - The ID of the application. - * @returns {Promise<string[]>} A Promise that resolves to an array of Steam64 IDs representing friends who play the application. - */ - GetFriendsWhoPlay(appId: number): Promise<string[]>; - - GetGameActionDetails(appId: number, callback: (gameAction: GameAction) => void): void; - - GetGameActionForApp( - appId: string, - callback: ( - param0: number /*flag check? for validity*/, - appId: number | string, - param2: string /* "LaunchApp", need to look for more to document*/, - ) => void, - ): void; - - /** - * Retrieves launch options for a specified application. - * These options may include different configurations or settings for launching the application, such as DirectX, Vulkan, OpenGL, 32-bit, 64-bit, etc. - * This function does not retrieve launch/argument options inputted by the user. - * @param {number} appId - The ID of the application. - * @returns {Promise<LaunchOption[]>} - A Promise that resolves to an array of launch options for the specified application. - */ - GetLaunchOptionsForApp(appId: number): Promise<LaunchOption[]>; + /** + * Retrieves achievement information for a specific application for a given friend. + * @param {string} appId - The ID of the application to retrieve achievement information for. + * @param {string} friendSteam64Id - The Steam64 ID of the friend for whom to retrieve achievement information. + * @returns {Promise<AppAchievementResponse>} - A Promise that resolves to an object containing achievement information for the specified friend and application. + */ + GetFriendAchievementsForApp(appId: string, friendSteam64Id: string): Promise<AppAchievementResponse>; - /** - * @todo Returns an empty ArrayBuffer? - */ - GetLibraryBootstrapData(): Promise<ArrayBuffer>; // CLibraryBootstrapData - binary deserializer??? + /** + * Retrieves a list of friends who play the specified application. + * @param {number} appId - The ID of the application. + * @returns {Promise<string[]>} A Promise that resolves to an array of Steam64 IDs representing friends who play the application. + */ + GetFriendsWhoPlay(appId: number): Promise<string[]>; + + GetGameActionDetails(appId: number, callback: (gameAction: GameAction) => void): void; + + GetGameActionForApp( + appId: string, + callback: ( + param0: number /*flag check? for validity*/, + appId: number | string, + param2: string /* "LaunchApp", need to look for more to document*/, + ) => void, + ): void; + + /** + * Retrieves launch options for a specified application. + * These options may include different configurations or settings for launching the application, such as DirectX, Vulkan, OpenGL, 32-bit, 64-bit, etc. + * This function does not retrieve launch/argument options inputted by the user. + * @param {number} appId - The ID of the application. + * @returns {Promise<LaunchOption[]>} - A Promise that resolves to an array of launch options for the specified application. + */ + GetLaunchOptionsForApp(appId: number): Promise<LaunchOption[]>; - /** - * Retrieves achievement information for the authenticated user in a specific Steam application. - * @param {string} appId - The ID of the application to retrieve achievement information for. - * @returns {Promise<AppAchievementResponse>} A Promise that resolves to an AppAchievementResponse object containing the achievement information for the authenticated user in the specified application. - */ - GetMyAchievementsForApp(appId: string): Promise<AppAchievementResponse>; + /** + * @todo Returns an empty ArrayBuffer? + */ + GetLibraryBootstrapData(): Promise<ArrayBuffer>; // CLibraryBootstrapData - binary deserializer??? - /** - * Retrieves the playtime information for a specific application. - * @param {number} appId - The ID of the application to get playtime information for. - * @returns {Promise<Playtime | undefined>} A Promise that resolves to playtime information or undefined if not available. - */ - GetPlaytime(appId: number): Promise<Playtime | undefined>; + /** + * Retrieves achievement information for the authenticated user in a specific Steam application. + * @param {string} appId - The ID of the application to retrieve achievement information for. + * @returns {Promise<AppAchievementResponse>} A Promise that resolves to an AppAchievementResponse object containing the achievement information for the authenticated user in the specified application. + */ + GetMyAchievementsForApp(appId: string): Promise<AppAchievementResponse>; - GetPrePurchasedApps(appIds: number[]): Promise<PrePurchaseInfo>; + /** + * Retrieves the playtime information for a specific application. + * @param {number} appId - The ID of the application to get playtime information for. + * @returns {Promise<Playtime | undefined>} A Promise that resolves to playtime information or undefined if not available. + */ + GetPlaytime(appId: number): Promise<Playtime | undefined>; - /** - * Retrieves the resolution override for a specific application. - * @param {number} appId - The ID of the application to retrieve the resolution override for. - * @returns {Promise<string>} A Promise that resolves to a string of the resolution override. - */ - GetResolutionOverrideForApp(appId: number): Promise<string>; + GetPrePurchasedApps(appIds: number[]): Promise<PrePurchaseInfo>; - /** - * Represents a function to retrieve detailed information about a specific screenshot. - * @param {string} appId - The ID of the application the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @returns {Promise<Screenshot>} - A Promise that resolves to detailed information about the specified screenshot. - */ - GetScreenshotInfo(appId: string, hHandle: number): Promise<Screenshot>; - - /** - * Represents a function to retrieve screenshots within a specified time range. - * @param {number} appId - The ID of the application. - * @param {number} start - The start of the time range as a Unix timestamp. - * @param {number} end - The end of the time range as a Unix timestamp. - * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of screenshots taken within the specified time range. - */ - GetScreenshotsInTimeRange(appId: number, start: number, end: number): Promise<Screenshot[]>; + /** + * Retrieves the resolution override for a specific application. + * @param {number} appId - The ID of the application to retrieve the resolution override for. + * @returns {Promise<string>} A Promise that resolves to a string of the resolution override. + */ + GetResolutionOverrideForApp(appId: number): Promise<string>; - /** - * Represents a function to retrieve shortcut data for a list of non-Steam app IDs. - * @param {number[]} appIds - An array of non-Steam application IDs. - * @returns {Promise<Shortcut[]>} - A Promise that resolves to an array of Shortcut objects for the specified non-Steam app IDs. - */ - GetShortcutData(appIds: number[]): Promise<Shortcut[]>; + /** + * Represents a function to retrieve detailed information about a specific screenshot. + * @param {string} appId - The ID of the application the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @returns {Promise<Screenshot>} - A Promise that resolves to detailed information about the specified screenshot. + */ + GetScreenshotInfo(appId: string, hHandle: number): Promise<Screenshot>; + + /** + * Represents a function to retrieve screenshots within a specified time range. + * @param {number} appId - The ID of the application. + * @param {number} start - The start of the time range as a Unix timestamp. + * @param {number} end - The end of the time range as a Unix timestamp. + * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of screenshots taken within the specified time range. + */ + GetScreenshotsInTimeRange(appId: number, start: number, end: number): Promise<Screenshot[]>; - /** - * Retrieves shortcut data for a given shortcut file path. - * @param {string} pathToShortcut The path to the shortcut file. - * @returns {Promise<Shortcut>} A Promise that resolves to the shortcut data. - */ - GetShortcutDataForPath(pathToShortcut: string): Promise<Shortcut>; + /** + * Represents a function to retrieve shortcut data for a list of non-Steam app IDs. + * @param {number[]} appIds - An array of non-Steam application IDs. + * @returns {Promise<Shortcut[]>} - A Promise that resolves to an array of Shortcut objects for the specified non-Steam app IDs. + */ + GetShortcutData(appIds: number[]): Promise<Shortcut[]>; - /** - * Represents a function to retrieve details about a soundtrack associated with a soundtrack application. - * The soundtrack has to be installed. - * @param {number} appId - The ID of the soundtrack application. - * @returns {Promise<SoundtrackDetails>} - A Promise that resolves to the details of the soundtrack associated with the specified soundtrack application. - */ - GetSoundtrackDetails(appId: number): Promise<SoundtrackDetails>; + /** + * Retrieves shortcut data for a given shortcut file path. + * @param {string} pathToShortcut The path to the shortcut file. + * @returns {Promise<Shortcut>} A Promise that resolves to the shortcut data. + */ + GetShortcutDataForPath(pathToShortcut: string): Promise<Shortcut>; - // [...appStore.m_mapStoreTagLocalization.keys()] - GetStoreTagLocalization(tags: number[]): Promise<StoreTagLocalization[]>; + /** + * Represents a function to retrieve details about a soundtrack associated with a soundtrack application. + * The soundtrack has to be installed. + * @param {number} appId - The ID of the soundtrack application. + * @returns {Promise<SoundtrackDetails>} - A Promise that resolves to the details of the soundtrack associated with the specified soundtrack application. + */ + GetSoundtrackDetails(appId: number): Promise<SoundtrackDetails>; - /** - * Retrieves a list of subscribed workshop items for a specific application. - * @param {number} appId - The ID of the application to retrieve subscribed workshop items for. - * @returns {Promise<WorkshopItem[]>} - A Promise that resolves to an array of subscribed workshop items for the specified application. - */ - GetSubscribedWorkshopItems(appId: number): Promise<WorkshopItem[]>; + // [...appStore.m_mapStoreTagLocalization.keys()] + GetStoreTagLocalization(tags: number[]): Promise<StoreTagLocalization[]>; - InstallFlatpakAppAndCreateShortcut(appName: string, appCommandLineOptions: string): Promise<any>; // returns {"appid":0,"strInstallOutput":""} - JoinAppContentBeta(appId: number, param1: any): any; - JoinAppContentBetaByPassword(appId: number, param1: any): any; + /** + * Retrieves a list of subscribed workshop items for a specific application. + * @param {number} appId - The ID of the application to retrieve subscribed workshop items for. + * @returns {Promise<WorkshopItem[]>} - A Promise that resolves to an array of subscribed workshop items for the specified application. + */ + GetSubscribedWorkshopItems(appId: number): Promise<WorkshopItem[]>; - ListFlatpakApps(): Promise<any>; + InstallFlatpakAppAndCreateShortcut(appName: string, appCommandLineOptions: string): Promise<any>; // returns {"appid":0,"strInstallOutput":""} + JoinAppContentBeta(appId: number, param1: any): any; - LoadEula(appId: number): Promise<EndUserLicenseAgreement[]>; // Doesn't bring up the EULA dialog, just returns the eula data - MarkEulaAccepted: any; - MarkEulaRejected: any; + JoinAppContentBetaByPassword(appId: number, param1: any): any; - /** - * Opens the settings dialog for a specific application. - * @param {number} appId - The ID of the application for which to open the settings dialog. - * @param {string} section - The section (tab) to switch to. - * @returns {void} - */ - OpenAppSettingsDialog(appId: number, section: string): void; + ListFlatpakApps(): Promise<any>; - PromptToChangeShortcut(): Promise<any>; // todo: unknown, prompts file picker + LoadEula(appId: number): Promise<EndUserLicenseAgreement[]>; // Doesn't bring up the EULA dialog, just returns the eula data + MarkEulaAccepted: any; + MarkEulaRejected: any; - /** - * Raises the window for a given application. - * @param {string} appId - The ID of the application to raise the window of. - * @returns {Promise<number>} - A Promise that resolves to a number. - * @todo Returns a result enum? 1 if ok, 2 if not running - */ - RaiseWindowForGame(appId: number): Promise<number>; // ResumeGameInProgress + /** + * Opens the settings dialog for a specific application. + * @param {number} appId - The ID of the application for which to open the settings dialog. + * @param {string} section - The section (tab) to switch to. + * @returns {void} + */ + OpenAppSettingsDialog(appId: number, section: string): void; - /** - * Registers a callback function to be called when achievement changes occur. - * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAchievementChanges(callback: () => void): Unregisterable | any; + PromptToChangeShortcut(): Promise<any>; // todo: unknown, prompts file picker - RegisterForAppBackupStatus(callback: (appBackupStatus: AppBackupStatus) => void): Unregisterable | any; + /** + * Raises the window for a given application. + * @param {string} appId - The ID of the application to raise the window of. + * @returns {Promise<number>} - A Promise that resolves to a number. + * @todo Returns a result enum? 1 if ok, 2 if not running + */ + RaiseWindowForGame(appId: number): Promise<number>; // ResumeGameInProgress - /** - * Registers a callback function to be called when app details change. - * @param appId The ID of the application to monitor. - * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; + /** + * Registers a callback function to be called when achievement changes occur. + * @param callback The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAchievementChanges(callback: () => void): Unregisterable | any; - /** - * @todo Calls the callback on launching a game - * @todo Doesn't return anything? - */ - RegisterForAppOverviewChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; // CAppOverview_Change - binary deserializer??? + RegisterForAppBackupStatus(callback: (appBackupStatus: AppBackupStatus) => void): Unregisterable | any; - RegisterForDRMFailureResponse( - callback: (appid: number, eResult: number, errorCode: number) => void, - ): Unregisterable | any; + /** + * Registers a callback function to be called when app details change. + * @param appId The ID of the application to monitor. + * @param callback The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; - /** - * Registers a callback function to be called when a game action ends. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionEnd(callback: (gameActionIdentifier: number) => void): Unregisterable | any; + /** + * @todo Calls the callback on launching a game + * @todo Doesn't return anything? + */ + RegisterForAppOverviewChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; // CAppOverview_Change - binary deserializer??? - RegisterForGameActionShowError: Unregisterable | any; + RegisterForDRMFailureResponse( + callback: (appid: number, eResult: number, errorCode: number) => void, + ): Unregisterable | any; - /** - * Registers a callback function to be called when a game action UI is shown. - * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; // todo: no idea what this callback is from + /** + * Registers a callback function to be called when a game action ends. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionEnd(callback: (gameActionIdentifier: number) => void): Unregisterable | any; - /** - * Registers a callback function to be called when a game action starts. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionStart( - callback: (gameActionIdentifier: number, appId: string, action: string, param3: number) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a game action task changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionTaskChange( - callback: ( - gameActionIdentifier: number, - appId: string, - action: string, - requestedAction: string, - param4: string, - ) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a user requests a game action. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionUserRequest( - callback: ( - gameActionIdentifier: number, - appId: string, - action: string, - requestedAction: string, - appId2: string, - ) => void, - ): Unregisterable | any; - - RegisterForLocalizationChanges(callback: (param0: ArrayBuffer) => void): Unregisterable | any; - - RegisterForPrePurchasedAppChanges(callback: () => void): Unregisterable | any; // Unknown, did have it show up a few times, but not callback parameters - RegisterForShowMarketingMessageDialog: Unregisterable | any; - - /** - * Registers a callback function to be notified when workshop items are added or removed from a Steam application. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForWorkshopChanges(callback: (appId: number) => void): Unregisterable | any; + RegisterForGameActionShowError: Unregisterable | any; - RegisterForWorkshopItemDownloads( - appId: number, - callback: (appId: number, publishedFileId: string, param2: number) => void, - ): Unregisterable | any; + /** + * Registers a callback function to be called when a game action UI is shown. + * @param callback The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; // todo: no idea what this callback is from - /** - * Removes a non-Steam application shortcut from the Steam library. - * @param {number} appId - The ID of the application for which to remove the shortcut. - * @returns {void} - */ - RemoveShortcut(appId: number): void; - - /** - * Removes a user tag from multiple Steam applications. - * @param {number[]} appIds - An array of application IDs from which the user tag should be removed. - * @param {string} userTag - The user tag to be removed. - * @returns {void} - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - RemoveUserTagFromApps(appIds: number[], userTag: string): void; - - ReportLibraryAssetCacheMiss(appId: number, assetType: AppArtworkAssetType): void; - ReportMarketingMessageDialogShown(): void; - RequestIconDataForApp(appId: number): any; - RequestLegacyCDKeysForApp(appId: number): any; - - // collectionStore.GetCollection('hidden').allApps.map(e => e.appid) - // May be broken? - ResetHiddenState(appIds: number[]): Promise<void>; - - /** - * Runs a game with specified parameters. - * @param {string} appId - The ID of the application to run. - * @param {string} launchOptions - Additional launch options for the application. - * @param {number} param2 - Additional parameter (exact usage may vary). - * @param {AppLaunchSource} launchSource - * @remarks `launchOptions` is appended before the ones specified in the application's settings. - * @returns {void} - */ - RunGame(appId: string, launchOptions: string, param2: number, param3: AppLaunchSource): void; + /** + * Registers a callback function to be called when a game action starts. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionStart( + callback: (gameActionIdentifier: number, appId: string, action: string, param3: number) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a game action task changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionTaskChange( + callback: ( + gameActionIdentifier: number, + appId: string, + action: string, + requestedAction: string, + param4: string, + ) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a user requests a game action. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionUserRequest( + callback: ( + gameActionIdentifier: number, + appId: string, + action: string, + requestedAction: string, + appId2: string, + ) => void, + ): Unregisterable | any; + + RegisterForLocalizationChanges(callback: (param0: ArrayBuffer) => void): Unregisterable | any; + + RegisterForPrePurchasedAppChanges(callback: () => void): Unregisterable | any; // Unknown, did have it show up a few times, but not callback parameters + RegisterForShowMarketingMessageDialog: Unregisterable | any; + + /** + * Registers a callback function to be notified when workshop items are added or removed from a Steam application. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForWorkshopChanges(callback: (appId: number) => void): Unregisterable | any; + + RegisterForWorkshopItemDownloads( + appId: number, + callback: (appId: number, publishedFileId: string, param2: number) => void, + ): Unregisterable | any; + + /** + * Removes a non-Steam application shortcut from the Steam library. + * @param {number} appId - The ID of the application for which to remove the shortcut. + * @returns {void} + */ + RemoveShortcut(appId: number): void; + + /** + * Removes a user tag from multiple Steam applications. + * @param {number[]} appIds - An array of application IDs from which the user tag should be removed. + * @param {string} userTag - The user tag to be removed. + * @returns {void} + * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. + */ + RemoveUserTagFromApps(appIds: number[], userTag: string): void; + + ReportLibraryAssetCacheMiss(appId: number, assetType: AppArtworkAssetType): void; + + ReportMarketingMessageDialogShown(): void; + + RequestIconDataForApp(appId: number): any; + + RequestLegacyCDKeysForApp(appId: number): any; + + // collectionStore.GetCollection('hidden').allApps.map(e => e.appid) + // May be broken? + ResetHiddenState(appIds: number[]): Promise<void>; - /* + /** + * Runs a game with specified parameters. + * @param {string} appId - The ID of the application to run. + * @param {string} launchOptions - Additional launch options for the application. + * @param {number} param2 - Additional parameter (exact usage may vary). + * @param {AppLaunchSource} launchSource + * @remarks `launchOptions` is appended before the ones specified in the application's settings. + * @returns {void} + */ + RunGame(appId: string, launchOptions: string, param2: number, param3: AppLaunchSource): void; + + /* function u(e, t) { return t instanceof Map || t instanceof Set ? Array.from(t) : t; } @@ -461,593 +466,608 @@ export interface Apps { JSON.stringify(this.m_achievementProgress, u) ); */ - SaveAchievementProgressCache(progress: string): any; - - /** - * Scans the system for installed non-Steam applications. - * @returns {Promise<NonSteamApp[]>} A Promise that resolves to an array of NonSteamApp objects representing installed non-Steam applications. - * @remarks This function scans the user's system for installed applications that are not part of the Steam library. It does not scan for shortcuts added to the Steam library. - * - * On Linux, it scans inside /usr/share/applications and $XDG_DATA_HOME/applications. - */ - ScanForInstalledNonSteamApps(): Promise<NonSteamApp[]>; - - /** - * Sets the automatic update behavior for a Steam application. - * @param {number} appId - The ID of the application to set the update behavior for. - * @param {AutoUpdateBehavior} mode - The update behavior mode to set. - * @returns {void} - * @remarks This function only works with installed Steam applications. - */ - SetAppAutoUpdateBehavior(appId: number, mode: AutoUpdateBehavior): void; - - /** - * Sets the background downloads behavior for a specific Steam application. - * @param {number} appId - The ID of the application to set the background downloads behavior for. - * @param {BackgroundDownloadsBehavior} mode - The background downloads mode to set. - * @returns {void} - * @remarks This function only works with installed Steam applications. - */ - SetAppBackgroundDownloadsBehavior(appId: number, mode: BackgroundDownloadsBehavior): void; + SaveAchievementProgressCache(progress: string): any; + + /** + * Scans the system for installed non-Steam applications. + * @returns {Promise<NonSteamApp[]>} A Promise that resolves to an array of NonSteamApp objects representing installed non-Steam applications. + * @remarks This function scans the user's system for installed applications that are not part of the Steam library. It does not scan for shortcuts added to the Steam library. + * + * On Linux, it scans inside /usr/share/applications and $XDG_DATA_HOME/applications. + */ + ScanForInstalledNonSteamApps(): Promise<NonSteamApp[]>; + + /** + * Sets the automatic update behavior for a Steam application. + * @param {number} appId - The ID of the application to set the update behavior for. + * @param {AutoUpdateBehavior} mode - The update behavior mode to set. + * @returns {void} + * @remarks This function only works with installed Steam applications. + */ + SetAppAutoUpdateBehavior(appId: number, mode: AutoUpdateBehavior): void; + + /** + * Sets the background downloads behavior for a specific Steam application. + * @param {number} appId - The ID of the application to set the background downloads behavior for. + * @param {BackgroundDownloadsBehavior} mode - The background downloads mode to set. + * @returns {void} + * @remarks This function only works with installed Steam applications. + */ + SetAppBackgroundDownloadsBehavior(appId: number, mode: BackgroundDownloadsBehavior): void; - /** - * Sets the current language for a specific Steam application. - * @param {number} appId - The ID of the application to set the current language for. - * @param {string} language - The language to set, represented as a language (e.g., "english", "spanish", "tchinese", "schinese"). - * @returns {void} - */ - SetAppCurrentLanguage(appId: number, language: string): void; - - /** - * Sets the hidden status of a specific Steam application. - * @param {number} appId - The ID of the application to set the hidden status for. - * @param {boolean} value - The value indicating whether the application should be hidden (true) or not (false). - * @returns {void} - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file to set the hidden status of the specified application. - */ - SetAppHidden(appId: number, value: boolean): void; + /** + * Sets the current language for a specific Steam application. + * @param {number} appId - The ID of the application to set the current language for. + * @param {string} language - The language to set, represented as a language (e.g., "english", "spanish", "tchinese", "schinese"). + * @returns {void} + */ + SetAppCurrentLanguage(appId: number, language: string): void; + + /** + * Sets the hidden status of a specific Steam application. + * @param {number} appId - The ID of the application to set the hidden status for. + * @param {boolean} value - The value indicating whether the application should be hidden (true) or not (false). + * @returns {void} + * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file to set the hidden status of the specified application. + */ + SetAppHidden(appId: number, value: boolean): void; - /** - * Sets launch options for a Steam application. - * @param {number} appId - The ID of the application to set launch options for. - * @param {string} launchOptions - The launch options to be set for the application. - * @returns {void} - */ - SetAppLaunchOptions(appId: number, launchOptions: string): void; + /** + * Sets launch options for a Steam application. + * @param {number} appId - The ID of the application to set launch options for. + * @param {string} launchOptions - The launch options to be set for the application. + * @returns {void} + */ + SetAppLaunchOptions(appId: number, launchOptions: string): void; - /** - * Sets a resolution override for a Steam application. - * @param {number} appId - The ID of the application to set the resolution override for. - * @param {string} resolution - The resolution to be set for the application. It can be "Default", "Native", or other compatible resolutions for the user's monitor. - * @returns {void} - */ - SetAppResolutionOverride(appId: number, resolution: string): any; - - SetCachedAppDetails(appId: number, details: string): any; - SetControllerRumblePreference(appId: number, param1: number): any; // param1 - enum for preference - - /** - * Sets the custom artwork for a given application. - * @param {number} appId - The ID of the application to set custom artwork for. - * @param {string} base64Image - Base64 encoded image. - * @param {string} imageType - "jpeg" or "png". - * @param {AppArtworkAssetType} assetType - The type of artwork to set. - * @returns {Promise<any>} A Promise that resolves after the custom artwork is set. - */ - SetCustomArtworkForApp( - appId: number, - base64Image: string, - imageType: string, - assetType: AppArtworkAssetType, - ): Promise<any>; - - SetCustomLogoPositionForApp(appId: number, details: string): Promise<void>; // I've tried sending escaped LogoPosition JSON, but it doesn't seem to work - - SetDLCEnabled(appId: number, appDLCId: number, value: boolean): void; - - /** - * Set a local screenshot's caption. - * @param {string} appId - The application ID the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @param {string} caption - * @returns {void} - */ - SetLocalScreenshotCaption(appId: string, hHandle: any, caption: string): void; + /** + * Sets a resolution override for a Steam application. + * @param {number} appId - The ID of the application to set the resolution override for. + * @param {string} resolution - The resolution to be set for the application. It can be "Default", "Native", or other compatible resolutions for the user's monitor. + * @returns {void} + */ + SetAppResolutionOverride(appId: number, resolution: string): any; - /** - * Set a local screenshot's privacy state. - * @param {string} appId - The application ID the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @param {FilePrivacyState} privacy - Screenshot privacy state. - */ - SetLocalScreenshotPrivacy(appId: string, hHandle: any, privacy: FilePrivacyState): void; + SetCachedAppDetails(appId: number, details: string): any; - /** - * Set a local screenshot's spoiler state. - * @param {string} appId - The application ID the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @param {boolean} spoilered - Is the screenshot spoilered? - */ - SetLocalScreenshotSpoiler(appId: string, hHandle: any, spoilered: boolean): void; + SetControllerRumblePreference(appId: number, param1: number): any; // param1 - enum for preference - /** - * Sets the icon for a non-Steam application shortcut. - * @param {string} appId - The ID of the application to set the shortcut icon for. - * @param {string} iconPath - The path to the icon image (can be png or tga format). - * @returns {void} - */ - SetShortcutIcon(appId: number, iconPath: string): void; + /** + * Sets the custom artwork for a given application. + * @param {number} appId - The ID of the application to set custom artwork for. + * @param {string} base64Image - Base64 encoded image. + * @param {string} imageType - "jpeg" or "png". + * @param {AppArtworkAssetType} assetType - The type of artwork to set. + * @returns {Promise<any>} A Promise that resolves after the custom artwork is set. + */ + SetCustomArtworkForApp( + appId: number, + base64Image: string, + imageType: string, + assetType: AppArtworkAssetType, + ): Promise<any>; + + SetCustomLogoPositionForApp(appId: number, details: string): Promise<void>; // I've tried sending escaped LogoPosition JSON, but it doesn't seem to work + + SetDLCEnabled(appId: number, appDLCId: number, value: boolean): void; + + /** + * Set a local screenshot's caption. + * @param {string} appId - The application ID the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @param {string} caption + * @returns {void} + */ + SetLocalScreenshotCaption(appId: string, hHandle: any, caption: string): void; - /** - * Sets whether a non-Steam application shortcut should be included in the VR library. - * @param {number} appId The ID of the application to set the VR status for. - * @param {boolean} value A boolean indicating whether the application should be included in the VR library. - * @returns {void} - */ - SetShortcutIsVR(appId: number, value: boolean): void; + /** + * Set a local screenshot's privacy state. + * @param {string} appId - The application ID the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @param {FilePrivacyState} privacy - Screenshot privacy state. + */ + SetLocalScreenshotPrivacy(appId: string, hHandle: any, privacy: FilePrivacyState): void; - /** - * Sets launch options for a non-Steam application shortcut. - * @param {number} appId - The ID of the application to set the launch options for. - * @param {string} launchOptions - The launch options to be used when starting the application. - * @returns {void} - */ - SetShortcutLaunchOptions(appId: number, launchOptions: string): void; + /** + * Set a local screenshot's spoiler state. + * @param {string} appId - The application ID the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @param {boolean} spoilered - Is the screenshot spoilered? + */ + SetLocalScreenshotSpoiler(appId: string, hHandle: any, spoilered: boolean): void; - /** - * Sets the name for a non-Steam application shortcut. - * @param {number} appId - The ID of the application to set the shortcut name for. - * @param {string} shortcutName - The name to be displayed for the application shortcut. - * @returns {void} - */ - SetShortcutName(appId: number, shortcutName: string): void; + /** + * Sets the icon for a non-Steam application shortcut. + * @param {string} appId - The ID of the application to set the shortcut icon for. + * @param {string} iconPath - The path to the icon image (can be png or tga format). + * @returns {void} + */ + SetShortcutIcon(appId: number, iconPath: string): void; - /** - * Sets the starting directory for a non-Steam application shortcut. - * @param {number} appId - The ID of the application to set the starting directory for. - * @param {string} directory - The directory from which the application should be launched. - * @returns {void} - */ - SetShortcutStartDir(appId: number, directory: string): void; + /** + * Sets whether a non-Steam application shortcut should be included in the VR library. + * @param {number} appId The ID of the application to set the VR status for. + * @param {boolean} value A boolean indicating whether the application should be included in the VR library. + * @returns {void} + */ + SetShortcutIsVR(appId: number, value: boolean): void; - /** - * Sets the client ID for streaming for a specific application. - * @param {number} appId - The ID of the application. - * @param {string} clientId - The client ID for streaming. - */ - SetStreamingClientForApp(appId: number, clientId: string): void; + /** + * Sets launch options for a non-Steam application shortcut. + * @param {number} appId - The ID of the application to set the launch options for. + * @param {string} launchOptions - The launch options to be used when starting the application. + * @returns {void} + */ + SetShortcutLaunchOptions(appId: number, launchOptions: string): void; - SetThirdPartyControllerConfiguration: any; + /** + * Sets the name for a non-Steam application shortcut. + * @param {number} appId - The ID of the application to set the shortcut name for. + * @param {string} shortcutName - The name to be displayed for the application shortcut. + * @returns {void} + */ + SetShortcutName(appId: number, shortcutName: string): void; - /** - * Opens the controller configurator for a specific application. - * @param {number} appId - The ID of the application for which to open the controller configurator. - * @returns {void} - */ - ShowControllerConfigurator(appId: number): void; + /** + * Sets the starting directory for a non-Steam application shortcut. + * @param {number} appId - The ID of the application to set the starting directory for. + * @param {string} directory - The directory from which the application should be launched. + * @returns {void} + */ + SetShortcutStartDir(appId: number, directory: string): void; - /** - * Opens the Steam store page for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} - */ - ShowStore(appId: number): void; + /** + * Sets the client ID for streaming for a specific application. + * @param {number} appId - The ID of the application. + * @param {string} clientId - The client ID for streaming. + */ + SetStreamingClientForApp(appId: number, clientId: string): void; - /** - * Specifies a compatibility tool by its name for a given application. If strToolName is an empty string, the specified application will no longer use a compatibility tool. - * @param {number} appId - The ID of the application to specify compatibility tool for. - * @param {string} strToolName - The name of the compatibility tool to specify. - * @returns {void} - */ - SpecifyCompatTool(appId: number, strToolName: string): void; + SetThirdPartyControllerConfiguration: any; - StreamGame(appId: number, clientId: string, param2: number): void; + /** + * Opens the controller configurator for a specific application. + * @param {number} appId - The ID of the application for which to open the controller configurator. + * @returns {void} + */ + ShowControllerConfigurator(appId: number): void; - /** - * Subscribes or unsubscribes from a workshop item for a specific app. - * @param {number} appId - The ID of the application. - * @param {string} workshopId - The ID of the workshop item. - * @param {boolean} subscribed - True to subscribe, false to unsubscribe. - * @returns {void} - */ - SubscribeWorkshopItem(appId: number, workshopId: string, subscribed: boolean): void; + /** + * Opens the Steam store page for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + */ + ShowStore(appId: number): void; - /** - * Terminates a running application. - * @param {string} appId - The ID of the application to terminate. - * @param {boolean} param1 - Additional parameter. Exact usage may vary. - * @returns {void} - */ - TerminateApp(appId: string, param1: boolean): void; + /** + * Specifies a compatibility tool by its name for a given application. If strToolName is an empty string, the specified application will no longer use a compatibility tool. + * @param {number} appId - The ID of the application to specify compatibility tool for. + * @param {string} strToolName - The name of the compatibility tool to specify. + * @returns {void} + */ + SpecifyCompatTool(appId: number, strToolName: string): void; - // "#AppProperties_SteamInputDesktopConfigInLauncher" - ToggleAllowDesktopConfiguration(appId: number): any; + StreamGame(appId: number, clientId: string, param2: number): void; - ToggleAppFamilyBlockedState(appId: number): any; + /** + * Subscribes or unsubscribes from a workshop item for a specific app. + * @param {number} appId - The ID of the application. + * @param {string} workshopId - The ID of the workshop item. + * @param {boolean} subscribed - True to subscribe, false to unsubscribe. + * @returns {void} + */ + SubscribeWorkshopItem(appId: number, workshopId: string, subscribed: boolean): void; - /** - * Toggles the Steam Cloud synchronization for game saves for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - ToggleAppSteamCloudEnabled(appId: number): void; + /** + * Terminates a running application. + * @param {string} appId - The ID of the application to terminate. + * @param {boolean} param1 - Additional parameter. Exact usage may vary. + * @returns {void} + */ + TerminateApp(appId: string, param1: boolean): void; - // "#AppProperties_EnableSteamCloudSyncOnSuspend" - ToggleAppSteamCloudSyncOnSuspendEnabled(appId: number): any; + // "#AppProperties_SteamInputDesktopConfigInLauncher" + ToggleAllowDesktopConfiguration(appId: number): any; - /** - * Toggles the Steam Overlay setting for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} - */ - ToggleEnableSteamOverlayForApp(appId: number): void; + ToggleAppFamilyBlockedState(appId: number): any; - // "#AppProperties_ResolutionOverride_Internal" - ToggleOverrideResolutionForInternalDisplay(appId: number): any; + /** + * Toggles the Steam Cloud synchronization for game saves for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. + */ + ToggleAppSteamCloudEnabled(appId: number): void; - UninstallFlatpakApp(app: string): Promise<boolean>; + // "#AppProperties_EnableSteamCloudSyncOnSuspend" + ToggleAppSteamCloudSyncOnSuspendEnabled(appId: number): any; - /** - * Verifies the integrity of an app's files. - * @param {number} appId - The ID of the app to verify. - */ - VerifyApp(appId: number): Promise<any>; // todo: returns {"nGameActionID":9} + /** + * Toggles the Steam Overlay setting for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + */ + ToggleEnableSteamOverlayForApp(appId: number): void; + + // "#AppProperties_ResolutionOverride_Internal" + ToggleOverrideResolutionForInternalDisplay(appId: number): any; + + UninstallFlatpakApp(app: string): Promise<boolean>; + + /** + * Verifies the integrity of an app's files. + * @param {number} appId - The ID of the app to verify. + */ + VerifyApp(appId: number): Promise<any>; // todo: returns {"nGameActionID":9} } export interface Auth { - GetLocalHostname(): Promise<string>; + GetLocalHostname(): Promise<string>; - GetMachineID(): Promise<ArrayBuffer>; + GetMachineID(): Promise<ArrayBuffer>; - GetRefreshInfo(): Promise<AuthRefreshInfo>; + GetRefreshInfo(): Promise<AuthRefreshInfo>; - GetSteamGuardData: any; + GetSteamGuardData: any; - IsSecureComputer(): Promise<boolean>; + IsSecureComputer(): Promise<boolean>; - SetLoginToken(refreshToken: string, accountName: string): any; - SetSteamGuardData(accountName: string, newGuardData: string): any; - StartSignInFromCache(param0: any, login: string): Promise<any>; + SetLoginToken(refreshToken: string, accountName: string): any; + + SetSteamGuardData(accountName: string, newGuardData: string): any; + + StartSignInFromCache(param0: any, login: string): Promise<any>; } // Broadcasting support hasn't been implemented on Linux yet export interface Broadcast { - /** - * Approves a viewer request for the broadcast. - * @param {string} steamId64 - The SteamID64 of the user whose request is to be approved. - * @param {number} param1 - Unknown parameter. - */ - ApproveViewerRequest(steamId64: string, param1: number): void; + /** + * Approves a viewer request for the broadcast. + * @param {string} steamId64 - The SteamID64 of the user whose request is to be approved. + * @param {number} param1 - Unknown parameter. + */ + ApproveViewerRequest(steamId64: string, param1: number): void; - /** - * Invites a user identified by their SteamID64 to watch the broadcast. - * @param {string} steamId64 - The SteamID64 of the user to invite. - * @returns {Promise<number>} - A Promise indicating the result of the invitation (1 for success, 2 for error). - */ - InviteToWatch(steamId64: string): Promise<number>; + /** + * Invites a user identified by their SteamID64 to watch the broadcast. + * @param {string} steamId64 - The SteamID64 of the user to invite. + * @returns {Promise<number>} - A Promise indicating the result of the invitation (1 for success, 2 for error). + */ + InviteToWatch(steamId64: string): Promise<number>; - /** - * Registers a callback to be called when the broadcast status changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForBroadcastStatus(callback: (broadcastStatus: BroadcastStatus) => void): Unregisterable | any; + /** + * Registers a callback to be called when the broadcast status changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForBroadcastStatus(callback: (broadcastStatus: BroadcastStatus) => void): Unregisterable | any; - /** - * Registers a callback to be called when viewer requests are received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForViewerRequests( - callback: (viewerFriendCode: number, param1: number, param2: number) => void, - ): Unregisterable | any; - - /** - * Rejects a viewer request for the broadcast. - * @param {string} steamId64 - The SteamID64 of the user whose request is to be rejected. - * @param {number} param1 - Unknown parameter. - */ - RejectViewerRequest(steamId64: string, param1: number): void; + /** + * Registers a callback to be called when viewer requests are received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForViewerRequests( + callback: (viewerFriendCode: number, param1: number, param2: number) => void, + ): Unregisterable | any; + + /** + * Rejects a viewer request for the broadcast. + * @param {string} steamId64 - The SteamID64 of the user whose request is to be rejected. + * @param {number} param1 - Unknown parameter. + */ + RejectViewerRequest(steamId64: string, param1: number): void; - /** - * Stops the broadcast. - * @returns {void} - */ - StopBroadcasting(): void; + /** + * Stops the broadcast. + * @returns {void} + */ + StopBroadcasting(): void; } export interface Browser { - BIsDirectHWNDBrowser: any; - BIsPopupWindow: any; - BIsVROverlayBrowser: any; - ClearAllBrowsingData(): void; - ClearHistory(): void; + BIsDirectHWNDBrowser: any; + BIsPopupWindow: any; + BIsVROverlayBrowser: any; - CloseDevTools(): void; + ClearAllBrowsingData(): void; - GetBrowserID(): Promise<number>; + ClearHistory(): void; - GetSteamBrowserID(): Promise<number>; // 16-bit unsigned integer? + CloseDevTools(): void; - /** - * Hides the mouse cursor until input. - * @returns {void} - */ - HideCursorUntilMouseEvent(): void; + GetBrowserID(): Promise<number>; - InspectElement(clientY: number, clientX: number): void; // yup that's right, clientY and clientX are reversed + GetSteamBrowserID(): Promise<number>; // 16-bit unsigned integer? - NotifyUserActivation(): void; + /** + * Hides the mouse cursor until input. + * @returns {void} + */ + HideCursorUntilMouseEvent(): void; - OpenDevTools(): void; + InspectElement(clientY: number, clientX: number): void; // yup that's right, clientY and clientX are reversed - /** - * @todo unconfirmed - */ - RegisterForGestureEvents(callback: (gesture: TouchGesture) => void): Unregisterable | any; - RegisterForOpenNewTab: Unregisterable | any; - SetShouldExitSteamOnBrowserClosed(value: boolean): any; - SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; - - /** - * Prompts and downloads a file. - * @param {string} url - The URL of the file to download. - * @returns {void} - */ - StartDownload(url: string): void; + NotifyUserActivation(): void; + + OpenDevTools(): void; + + /** + * @todo unconfirmed + */ + RegisterForGestureEvents(callback: (gesture: TouchGesture) => void): Unregisterable | any; + + RegisterForOpenNewTab: Unregisterable | any; + + SetShouldExitSteamOnBrowserClosed(value: boolean): any; + + SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; + + /** + * Prompts and downloads a file. + * @param {string} url - The URL of the file to download. + * @returns {void} + */ + StartDownload(url: string): void; } export interface BrowserView { - Create(browser: BrowserViewInit | undefined): BrowserViewPopup; + Create(browser: BrowserViewInit | undefined): BrowserViewPopup; - CreatePopup(browser: BrowserViewInit | undefined): { - strCreateURL: string; - browserView: BrowserViewPopup; - }; + CreatePopup(browser: BrowserViewInit | undefined): { + strCreateURL: string; + browserView: BrowserViewPopup; + }; - Destroy(browser: BrowserViewInit): void; + Destroy(browser: BrowserViewInit): void; - PostMessageToParent(message: string, args: string): void; + PostMessageToParent(message: string, args: string): void; } export interface ClientNotifications { - /** - * Displays a Steam notification. - * @param {ClientUINotification} notification - Notification type. - * @param {string} options - Stringified object of `NotificationOptions`. - * @param {function} callback - */ - DisplayClientNotification(notification: ClientUINotification, options: string, callback: any): void; + /** + * Displays a Steam notification. + * @param {ClientUINotification} notification - Notification type. + * @param {string} options - Stringified object of `NotificationOptions`. + * @param {function} callback + */ + DisplayClientNotification(notification: ClientUINotification, options: string, callback: any): void; - OnRespondToClientNotification: any; + OnRespondToClientNotification: any; } export interface Cloud { - ResolveAppSyncConflict(appId: number, keepLocal: boolean): any; - RetryAppSync(appId: number): any; + ResolveAppSyncConflict(appId: number, keepLocal: boolean): any; + + RetryAppSync(appId: number): any; } export interface CommunityItems { - DownloadItemAsset(communityItemId: string, param1: any, param2: string): any; - GetItemAssetPath(communityItemId: string, param1: any, param2: string): any; - RemoveDownloadedItemAsset(communityItemId: string, param1: any, param2: string): any; + DownloadItemAsset(communityItemId: string, param1: any, param2: string): any; + + GetItemAssetPath(communityItemId: string, param1: any, param2: string): any; + + RemoveDownloadedItemAsset(communityItemId: string, param1: any, param2: string): any; } /** * Represents the console functionality for executing commands and handling spew output. */ export interface Console { - /** - * Executes a console command. - * @param {string} command - The command to execute in the console. - * @returns {void} - */ - ExecCommand(command: string): void; + /** + * Executes a console command. + * @param {string} command - The command to execute in the console. + * @returns {void} + */ + ExecCommand(command: string): void; - /** - * Retrieves autocomplete suggestions for a given console command. - * @param {string} command - The console command to provide autocomplete suggestions for. - * @returns {Promise<string[]>} - A Promise that resolves to an array of autocomplete suggestions. - */ - GetAutocompleteSuggestions(command: string): Promise<string[]>; + /** + * Retrieves autocomplete suggestions for a given console command. + * @param {string} command - The console command to provide autocomplete suggestions for. + * @returns {Promise<string[]>} - A Promise that resolves to an array of autocomplete suggestions. + */ + GetAutocompleteSuggestions(command: string): Promise<string[]>; - /** - * Registers a callback function to receive spew output. - * @param {function} callback - The callback function that will receive spew output. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForSpewOutput(callback: (spewOutput: SpewOutput) => void): Unregisterable | any; + /** + * Registers a callback function to receive spew output. + * @param {function} callback - The callback function that will receive spew output. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForSpewOutput(callback: (spewOutput: SpewOutput) => void): Unregisterable | any; } export interface Customization { - GenerateLocalStartupMoviesThumbnails(param0: number): Promise<any>; - GetDownloadedStartupMovies(param0: string): Promise<any>; - GetLocalStartupMovies(): Promise<any>; + GenerateLocalStartupMoviesThumbnails(param0: number): Promise<any>; + + GetDownloadedStartupMovies(param0: string): Promise<any>; + + GetLocalStartupMovies(): Promise<any>; } /** * Represents functions related to managing downloads in Steam. */ export interface Downloads { - /** - * Enables or disables all downloads in Steam. - * @param {boolean} enable - True to enable downloads, false to disable. - */ - EnableAllDownloads(enable: boolean): void; + /** + * Enables or disables all downloads in Steam. + * @param {boolean} enable - True to enable downloads, false to disable. + */ + EnableAllDownloads(enable: boolean): void; - /** - * Moves the update for a specific app down the download queue. - * @param {number} appId - The ID of the application to move. - * @returns {void} - */ - MoveAppUpdateDown(appId: number): void; + /** + * Moves the update for a specific app down the download queue. + * @param {number} appId - The ID of the application to move. + * @returns {void} + */ + MoveAppUpdateDown(appId: number): void; - /** - * Moves the update for a specific app up the download queue. - * @param {number} appId - The ID of the application to move. - * @returns {void} - */ - MoveAppUpdateUp(appId: number): void; + /** + * Moves the update for a specific app up the download queue. + * @param {number} appId - The ID of the application to move. + * @returns {void} + */ + MoveAppUpdateUp(appId: number): void; - PauseAppUpdate(appId: number): void; // Broken? It seems to be removing it from download list like RemoveFromDownloadList + PauseAppUpdate(appId: number): void; // Broken? It seems to be removing it from download list like RemoveFromDownloadList - /** - * Adds the update for a specific app to the download queue. - * @param {number} appId - The ID of the application to queue. - * @returns {void} - */ - QueueAppUpdate(appId: number): void; + /** + * Adds the update for a specific app to the download queue. + * @param {number} appId - The ID of the application to queue. + * @returns {void} + */ + QueueAppUpdate(appId: number): void; - /** - * Registers a callback function to be called when download items change. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDownloadItems( - callback: (isDownloading: boolean, downloadItems: DownloadItem[]) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when download overview changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDownloadOverview(callback: (downloadOverview: DownloadOverview) => void): Unregisterable | any; + /** + * Registers a callback function to be called when download items change. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDownloadItems( + callback: (isDownloading: boolean, downloadItems: DownloadItem[]) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when download overview changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDownloadOverview(callback: (downloadOverview: DownloadOverview) => void): Unregisterable | any; - /** - * Removes the update for a specific app from the download list and places it in the unscheduled list. - * @param {number} appId - The ID of the application to remove. - * @returns {void} - */ - RemoveFromDownloadList(appId: number): void; + /** + * Removes the update for a specific app from the download list and places it in the unscheduled list. + * @param {number} appId - The ID of the application to remove. + * @returns {void} + */ + RemoveFromDownloadList(appId: number): void; - /** - * Resumes the update for a specific app in the queue. - * @param {number} appId - The ID of the application to resume. - * @returns {void} - */ - ResumeAppUpdate(appId: number): void; + /** + * Resumes the update for a specific app in the queue. + * @param {number} appId - The ID of the application to resume. + * @returns {void} + */ + ResumeAppUpdate(appId: number): void; - /** - * Sets an app to launch when its download is complete. - * @param {number} appId - The ID of the application to set. - * @returns {void} - * @todo: unsure if this toggles though - */ - SetLaunchOnUpdateComplete(appId: number): void; - - /** - * Sets the queue index for an app in the download queue. - * @param {number} appId - The ID of the application to set the index for. - * @param {number} index - The index to set. - * @returns {void} - * @remarks Index of 0 is the current download in progress. - */ - SetQueueIndex(appId: number, index: number): void; + /** + * Sets an app to launch when its download is complete. + * @param {number} appId - The ID of the application to set. + * @returns {void} + * @todo: unsure if this toggles though + */ + SetLaunchOnUpdateComplete(appId: number): void; + + /** + * Sets the queue index for an app in the download queue. + * @param {number} appId - The ID of the application to set the index for. + * @param {number} index - The index to set. + * @returns {void} + * @remarks Index of 0 is the current download in progress. + */ + SetQueueIndex(appId: number, index: number): void; - /** - * Suspends or resumes download throttling. - * @param {boolean} suspend - Whether to suspend or resume download throttling. - * @returns {void} - */ - SuspendDownloadThrottling(suspend: boolean): void; + /** + * Suspends or resumes download throttling. + * @param {boolean} suspend - Whether to suspend or resume download throttling. + * @returns {void} + */ + SuspendDownloadThrottling(suspend: boolean): void; - /** - * Suspends or resumes local transfers. - * @param {boolean} suspend - Whether to suspend or resume local transfers. - * @returns {void} - */ - SuspendLanPeerContent(suspend: boolean): void; + /** + * Suspends or resumes local transfers. + * @param {boolean} suspend - Whether to suspend or resume local transfers. + * @returns {void} + */ + SuspendLanPeerContent(suspend: boolean): void; } /** * Represents functions related to Steam Family Sharing. */ export interface FamilySharing { - /** - * Authorizes library sharing on the local device. - * @returns {Promise<number>} A Promise that resolves to a status code. - */ - AuthorizeLocalDevice(): Promise<number>; + /** + * Authorizes library sharing on the local device. + * @returns {Promise<number>} A Promise that resolves to a status code. + */ + AuthorizeLocalDevice(): Promise<number>; - /** - * Deauthorizes library sharing on the local device. - * @returns {Promise<number>} A Promise that resolves to a status code. - */ - DeauthorizeLocalDevice(): Promise<number>; + /** + * Deauthorizes library sharing on the local device. + * @returns {Promise<number>} A Promise that resolves to a status code. + */ + DeauthorizeLocalDevice(): Promise<number>; - RegisterForKickedBorrower: any; + RegisterForKickedBorrower: any; - RequestLocalDeviceAuthorization(steam64Id: string): Promise<number>; + RequestLocalDeviceAuthorization(steam64Id: string): Promise<number>; - // param0 - account id? - UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise<number>; + // param0 - account id? + UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise<number>; } export interface Features { - SteamInitsPopups(): boolean; + SteamInitsPopups(): boolean; } /** * Represents friend settings and configuration. */ export interface FriendSettings { - /** - * Retrieves a list of enabled friend settings features. - * @returns {Promise<FriendSettingsFeature[]>} - A Promise that resolves to an array of enabled friend settings features. - */ - GetEnabledFeatures(): Promise<FriendSettingsFeature[]>; + /** + * Retrieves a list of enabled friend settings features. + * @returns {Promise<FriendSettingsFeature[]>} - A Promise that resolves to an array of enabled friend settings features. + */ + GetEnabledFeatures(): Promise<FriendSettingsFeature[]>; - /** - * Registers a callback function to be notified of friend settings changes. - * @param callback - The callback function to be called when friend settings change. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @todo The callback receives an escaped JSON object string as "settingsChanges", which should be parsed into FriendSettingsChange object. - */ - RegisterForSettingsChanges(callback: (settingsChanges: string) => void): Unregisterable | any; + /** + * Registers a callback function to be notified of friend settings changes. + * @param callback - The callback function to be called when friend settings change. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @todo The callback receives an escaped JSON object string as "settingsChanges", which should be parsed into FriendSettingsChange object. + */ + RegisterForSettingsChanges(callback: (settingsChanges: string) => void): Unregisterable | any; - SetFriendSettings(details: string): any; // stringified object + SetFriendSettings(details: string): any; // stringified object } /** * Represents functions related to managing friends in Steam. */ export interface Friends { - /** - * Adds a user to the friend list. - * @param {string} steamId - The Steam ID of the user to add as a friend. - * @returns {Promise<boolean>} A Promise that resolves to true if the friend was added successfully, false otherwise. - */ - AddFriend(steamId: string): Promise<boolean>; + /** + * Adds a user to the friend list. + * @param {string} steamId - The Steam ID of the user to add as a friend. + * @returns {Promise<boolean>} A Promise that resolves to true if the friend was added successfully, false otherwise. + */ + AddFriend(steamId: string): Promise<boolean>; - GetCoplayData(): Promise<any>; // {"recentUsers":[], "currentUsers":[]} - InviteUserToCurrentGame: any; + GetCoplayData(): Promise<any>; // {"recentUsers":[], "currentUsers":[]} + InviteUserToCurrentGame: any; - /** - * Invites a user to a specific game. - * @param {string} steamId - The Steam ID of the user to invite. - * @param {number} appId - The ID of the game to invite the user to. - * @param {string} connectString - Additional parameters for the invitation. - * @returns {Promise<boolean>} A Promise that resolves to true if the user was invited successfully, false otherwise. - */ - InviteUserToGame(steamId: string, appId: number, connectString: string): Promise<boolean>; - InviteUserToLobby: any; - InviteUserToRemotePlayTogetherCurrentGame: any; - RegisterForVoiceChatStatus: any; - - /** - * Removes a user from the friend list. - * @param {string} steamId - The Steam ID of the user to remove from the friend list. - * @returns {Promise<boolean>} A Promise that resolves to true if the friend was removed successfully, false otherwise. - */ - RemoveFriend(steamId: string): Promise<boolean>; + /** + * Invites a user to a specific game. + * @param {string} steamId - The Steam ID of the user to invite. + * @param {number} appId - The ID of the game to invite the user to. + * @param {string} connectString - Additional parameters for the invitation. + * @returns {Promise<boolean>} A Promise that resolves to true if the user was invited successfully, false otherwise. + */ + InviteUserToGame(steamId: string, appId: number, connectString: string): Promise<boolean>; + + InviteUserToLobby: any; + InviteUserToRemotePlayTogetherCurrentGame: any; + RegisterForVoiceChatStatus: any; + + /** + * Removes a user from the friend list. + * @param {string} steamId - The Steam ID of the user to remove from the friend list. + * @returns {Promise<boolean>} A Promise that resolves to true if the friend was removed successfully, false otherwise. + */ + RemoveFriend(steamId: string): Promise<boolean>; } export interface GameNotes { - DeleteImage(param0: any): any; - DeleteNotes: any; - /* + DeleteImage(param0: any): any; + + DeleteNotes: any; + /* FilenameForNotes(e) { return "appid" in e ? `notes_${Number(e.appid)}` : `notes_shortcut_${h(e.shortcut)}` } @@ -1055,995 +1075,1074 @@ export interface GameNotes { return "appid" in e ? `notes_${Number(e.appid)}_images/` : `notes_shortcut_${h(e.shortcut)}_images/` } */ - // {"result":1,"notes":"<escaped json>"} - // <escaped json> example: {"notes":[{"id":"lmuudzqn","appid":1716740,"ordinal":0,"time_created":1695401684,"time_modified":1695403395,"title":"Old Earth Cuisine 1:","content":"[h1]Old Earth Cuisine 1:[/h1][list][*][p]Red Meat[/p][/*][/list][h1]Beverage Development 2:[/h1][list][*][p]Tranquilitea Sunray[/p][/*][/list][p][/p]"}]} - GetNotes(filenameForNotes: string, directoryForNoteImages: string): Promise<any>; - GetNotesMetadata: any; - GetNumNotes: any; - GetQuota: any; + // {"result":1,"notes":"<escaped json>"} + // <escaped json> example: {"notes":[{"id":"lmuudzqn","appid":1716740,"ordinal":0,"time_created":1695401684,"time_modified":1695403395,"title":"Old Earth Cuisine 1:","content":"[h1]Old Earth Cuisine 1:[/h1][list][*][p]Red Meat[/p][/*][/list][h1]Beverage Development 2:[/h1][list][*][p]Tranquilitea Sunray[/p][/*][/list][p][/p]"}]} + GetNotes(filenameForNotes: string, directoryForNoteImages: string): Promise<any>; + + GetNotesMetadata: any; + GetNumNotes: any; + GetQuota: any; + + IterateNotes(appId: number, length: number): any; // Results array of {"result":1,"filename":"","filesize":0,"timestamp":0} + ResolveSyncConflicts: any; + + SaveNotes(filenameForNotes: string, param1: string): Promise<any>; // param1 - notes like escaped json in GetNotes + SyncToClient(): Promise<any>; - IterateNotes(appId: number, length: number): any; // Results array of {"result":1,"filename":"","filesize":0,"timestamp":0} - ResolveSyncConflicts: any; - SaveNotes(filenameForNotes: string, param1: string): Promise<any>; // param1 - notes like escaped json in GetNotes - SyncToClient(): Promise<any>; - SyncToServer(): Promise<any>; - UploadImage: any; + SyncToServer(): Promise<any>; + + UploadImage: any; } /** * Represents functions related to Steam Game Sessions. */ export interface GameSessions { - /** - * Registers a callback function to be called when an achievement notification is received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAchievementNotification( - callback: (achievementNotification: AchievementNotification) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when an app lifetime notification is received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppLifetimeNotifications( - callback: (appLifetimeNotification: AppLifetimeNotification) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a screenshot notification is received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForScreenshotNotification( - callback: (screenshotNotification: ScreenshotNotification) => void, - ): Unregisterable | any; + /** + * Registers a callback function to be called when an achievement notification is received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAchievementNotification( + callback: (achievementNotification: AchievementNotification) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when an app lifetime notification is received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppLifetimeNotifications( + callback: (appLifetimeNotification: AppLifetimeNotification) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a screenshot notification is received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForScreenshotNotification( + callback: (screenshotNotification: ScreenshotNotification) => void, + ): Unregisterable | any; } /** * Represents functions related to input and controllers in Steam. */ export interface Input { - /** - * Checks if the specified controller is a Steam Controller. - * @param {function} callback - The callback function to receive the result. - */ - BIsSteamController(callback: (steamController: boolean) => void): void; + /** + * Checks if the specified controller is a Steam Controller. + * @param {function} callback - The callback function to receive the result. + */ + BIsSteamController(callback: (steamController: boolean) => void): void; - /** - * Checks if the specified controller supports LED color. - * @param {function} callback - The callback function to receive the result. - */ - BSupportsControllerLEDColor(callback: (supportControllerLEDColor: boolean) => void): void; - - CalibrateControllerIMU(param0: any): any; // param0 - m_controllerStateDeviceIdx - CalibrateControllerJoystick(param0: any): any; // param0 - m_controllerStateDeviceIdx - CalibrateControllerTrackpads(param0: any): any; // param0 - m_controllerStateDeviceIdx - CancelGyroSWCalibration(): any; - ClearSelectedConfigForApp(appId: number, controllerIndex: number): any; - CloseDesktopConfigurator: any; - - /** - * Writes text. - * @param {string} textToWrite - The text to write. - * @returns {void} - */ - ControllerKeyboardSendText(textToWrite: string): void; - - /** - * Sets a specified key's pressed state. - * @param {number} keyIndex - The key index to set the state for. - * @param {boolean} state - true for pressed, false otherwise. - * @returns {void} - * @example - * Send paste command: - * ``` - * SteamClient.Input.ControllerKeyboardSetKeyState(103, true); - * SteamClient.Input.ControllerKeyboardSetKeyState(25, true); - * SteamClient.Input.ControllerKeyboardSetKeyState(25, false); - * SteamClient.Input.ControllerKeyboardSetKeyState(103, false); - * ``` - */ - ControllerKeyboardSetKeyState(keyIndex: number, state: boolean): void; - - DeauthorizeControllerAccount: any; - DecrementCloudedControllerConfigsCounter(): any; - DeletePersonalControllerConfiguration: any; - DuplicateControllerConfigurationSourceMode: any; - EndControllerDeviceSupportFlow(): any; - ExportCurrentControllerConfiguration: any; - ForceConfiguratorFocus: any; - ForceSimpleHapticEvent: any; - FreeControllerConfig: any; - - GetConfigForAppAndController(appId: number, unControllerIndex: number): any; - - /** - * Retrieves the controller mapping string for the specified controller index. - * @param {number} unControllerIndex - The controller index. - * @returns {Promise<string>} - A Promise that resolves to the controller mapping string. - */ - GetControllerMappingString(unControllerIndex: number): Promise<string>; - - GetControllerPreviouslySeen: any; - - GetSteamControllerDongleState(): Promise<boolean>; - GetTouchMenuIconsForApp(appId: number): Promise<any>; - GetXboxDriverInstallState(): Promise<any>; // "{"nResult":0}" - IdentifyController(controllerIndex: number): any; - InitControllerSounds(): any; - InitializeControllerPersonalizationSettings: any; - ModalKeyboardDismissed(): void; - OpenDesktopConfigurator: any; - PreviewConfiguForAppAndController(appId: number): any; - PreviewControllerLEDColor(flHue: number, flSaturation: number, flBrightness: number): any; - QueryControllerConfigsForApp(appId: number): any; - RegisterForActiveControllerChanges: Unregisterable | any; // {"nActiveController":0} - RegisterForConfigSelectionChanges(callback: (param0: number, param1: number) => void): Unregisterable | any; - - RegisterForControllerAccountChanges: Unregisterable | any; - - RegisterForControllerAnalogInputMessages( - callback: (controllerAnalogInputMessages: ControllerAnalogInputMessage[]) => void, - ): Unregisterable | any; - - RegisterForControllerCommandMessages( - callback: (controllerCommandMessage: ControllerCommandMessage) => void, - ): Unregisterable | any; - - /** - * Registers a callback for changes in controller configuration cloud state. - * @param {(controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void} callback - The callback function for config cloud state changes. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForControllerConfigCloudStateChanges( - callback: (controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void, - ): Unregisterable | any; - - /** - * Registers a callback for receiving controller configuration info messages (controller layouts query, personal controller layout query). - * @param {(controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[]) => void} callback - The callback function for controller config info messages. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @remarks Do Not Use, this will break the controller layout selection unless you know what you are doing. - */ - RegisterForControllerConfigInfoMessages( - callback: ( - controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[], - ) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be invoked when controller input messages are received. - * @param {(controllerInputMessages: ControllerInputMessage[]) => void} callback - The callback function to be invoked when controller input messages are received. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForControllerInputMessages( - callback: (controllerInputMessages: ControllerInputMessage[]) => void, - ): Unregisterable | any; + /** + * Checks if the specified controller supports LED color. + * @param {function} callback - The callback function to receive the result. + */ + BSupportsControllerLEDColor(callback: (supportControllerLEDColor: boolean) => void): void; - RegisterForControllerListChanges(callback: (controllerListChanges: ControllerInfo[]) => void): Unregisterable | any; + CalibrateControllerIMU(param0: any): any; // param0 - m_controllerStateDeviceIdx + CalibrateControllerJoystick(param0: any): any; // param0 - m_controllerStateDeviceIdx + CalibrateControllerTrackpads(param0: any): any; // param0 - m_controllerStateDeviceIdx + CancelGyroSWCalibration(): any; - /** - * Registers a callback for changes in the controller state (buttons presses, triggers presses, joystick changes etc...). - * @param {(controllerStateChanges: ControllerStateChange[]) => void} callback - The callback function for controller state changes. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForControllerStateChanges( - callback: (controllerStateChanges: ControllerStateChange[]) => void, - ): Unregisterable | any; + ClearSelectedConfigForApp(appId: number, controllerIndex: number): any; - RegisterForDualSenseUpdateNotification: Unregisterable | any; + CloseDesktopConfigurator: any; - /** - * Registers a callback for receiving game keyboard messages (text field popup for inputting text for games when in character creation or etc...). - * @param {(gameKeyboardMessage: GameKeyboardMessage) => void} callback - The callback function for game keyboard messages. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameKeyboardMessages(callback: (gameKeyboardMessage: GameKeyboardMessage) => void): Unregisterable | any; - - RegisterForRemotePlayConfigChanges: Unregisterable | any; - RegisterForShowControllerLayoutPreviewMessages: Unregisterable | any; - RegisterForTouchMenuInputMessages: Unregisterable | any; - - RegisterForTouchMenuMessages(callback: (touchMenuMessage: TouchMenuMessage) => void): Unregisterable | any; - - RegisterForUIVisualization: Unregisterable | any; - - RegisterForUnboundControllerListChanges(callback: (param0: any) => void): Unregisterable | any; // param0 is an array - RegisterForUserDismissKeyboardMessages: Unregisterable | any; - RegisterForUserKeyboardMessages: Unregisterable | any; - RequestGyroActive: any; - RequestRemotePlayControllerConfigs: any; - ResetControllerBindings(param0: any): any; - ResolveCloudedControllerConfigConflict: any; - RestoreControllerPersonalizationSettings(controllerIndex: number): any; - SaveControllerCalibration: any; - SaveControllerPersonalizationSettings: any; - SaveControllerSounds: any; - SaveEditingControllerConfiguration(controllerIndex: number, sharedConfig: boolean): any; - SetActiveControllerAccount: any; - SetControllerConfigurationModeShiftBinding: any; - SetControllerHapticSetting: any; - SetControllerMappingString(mapping: string): void; - SetControllerName: any; - SetControllerNintendoLayoutSetting: any; - SetControllerPersonalizationName: any; - //param0 - nLStickDeadzone, bSWAntiDrift, nRHapticStrength, flRPadPressureCurve - SetControllerPersonalizationSetting(param0: string, param1: number): any; - //param0 - flGyroStationaryTolerance, flAccelerometerStationaryTolerance - SetControllerPersonalizationSettingFloat(param0: string, param1: number): any; - SetControllerRumbleSetting: any; - SetCursorActionset: any; - SetEditingControllerConfigurationActionSet: any; - SetEditingControllerConfigurationInputActivator: any; - SetEditingControllerConfigurationInputActivatorEnabled: any; - SetEditingControllerConfigurationInputBinding: any; - SetEditingControllerConfigurationMiscSetting: any; - SetEditingControllerConfigurationSourceMode: any; - SetGamepadKeyboardText(param0: boolean, param1: string): any; - SetKeyboardActionset(param0: boolean): any; - - /** - * Sets the mouse position. - * @param {number} pid - 0 - * @param {number} x - Mouse X position. - * @param {number} y - Mouse Y position. - * @returns {void} - */ - SetMousePosition(pid: number, x: number, y: number): void; - - SetSelectedConfigForApp(): any; - SetSteamControllerDonglePairingMode: any; - SetVirtualMenuKeySelected(unControllerIndex: number, unMenuIndex: number, param2: number): any; // - SetWebBrowserActionset: any; - SetXboxDriverInstallState(param0: any): any; // state - - /** - * Opens the Steam Input controller settings. - * This function displays the Steam Input controller settings for configuration. - * @returns {void} - */ - ShowControllerSettings(): void; - - StandaloneKeyboardDismissed(): any; - StartControllerDeviceSupportFlow(param0: any, param1: any, callback: (param2: any) => void): any; - StartEditingControllerConfigurationForAppIDAndControllerIndex: any; - StartGyroSWCalibration: any; - StopEditingControllerConfiguration: any; - SwapControllerModeInputBindings: any; - SwapControllerOrder: any; - SyncCloudedControllerConfigs(): any; - - // type - enum - TriggerHapticPulse(controllerIndex: number, type: number, param2: number): any; - TriggerSimpleHapticEvent( - controllerIndex: number, - type: number, - intensity: number, - dbGain: number, - param4: number, - ): any; - - UnregisterForControllerStateChanges(): void; - UnregisterForUIVisualization(controllerIndex: number): any; - UploadChangesForCloudedControllerConfigs(): any; + /** + * Writes text. + * @param {string} textToWrite - The text to write. + * @returns {void} + */ + ControllerKeyboardSendText(textToWrite: string): void; + + /** + * Sets a specified key's pressed state. + * @param {number} keyIndex - The key index to set the state for. + * @param {boolean} state - true for pressed, false otherwise. + * @returns {void} + * @example + * Send paste command: + * ``` + * SteamClient.Input.ControllerKeyboardSetKeyState(103, true); + * SteamClient.Input.ControllerKeyboardSetKeyState(25, true); + * SteamClient.Input.ControllerKeyboardSetKeyState(25, false); + * SteamClient.Input.ControllerKeyboardSetKeyState(103, false); + * ``` + */ + ControllerKeyboardSetKeyState(keyIndex: number, state: boolean): void; + + DeauthorizeControllerAccount: any; + + DecrementCloudedControllerConfigsCounter(): any; + + DeletePersonalControllerConfiguration: any; + DuplicateControllerConfigurationSourceMode: any; + + EndControllerDeviceSupportFlow(): any; + + ExportCurrentControllerConfiguration: any; + ForceConfiguratorFocus: any; + ForceSimpleHapticEvent: any; + FreeControllerConfig: any; + + GetConfigForAppAndController(appId: number, unControllerIndex: number): any; + + /** + * Retrieves the controller mapping string for the specified controller index. + * @param {number} unControllerIndex - The controller index. + * @returns {Promise<string>} - A Promise that resolves to the controller mapping string. + */ + GetControllerMappingString(unControllerIndex: number): Promise<string>; + + GetControllerPreviouslySeen: any; + + GetSteamControllerDongleState(): Promise<boolean>; + + GetTouchMenuIconsForApp(appId: number): Promise<any>; + + GetXboxDriverInstallState(): Promise<any>; // "{"nResult":0}" + IdentifyController(controllerIndex: number): any; + + InitControllerSounds(): any; + + InitializeControllerPersonalizationSettings: any; + + ModalKeyboardDismissed(): void; + + OpenDesktopConfigurator: any; + + PreviewConfiguForAppAndController(appId: number): any; + + PreviewControllerLEDColor(flHue: number, flSaturation: number, flBrightness: number): any; + + QueryControllerConfigsForApp(appId: number): any; + + RegisterForActiveControllerChanges: Unregisterable | any; // {"nActiveController":0} + RegisterForConfigSelectionChanges(callback: (param0: number, param1: number) => void): Unregisterable | any; + + RegisterForControllerAccountChanges: Unregisterable | any; + + RegisterForControllerAnalogInputMessages( + callback: (controllerAnalogInputMessages: ControllerAnalogInputMessage[]) => void, + ): Unregisterable | any; + + RegisterForControllerCommandMessages( + callback: (controllerCommandMessage: ControllerCommandMessage) => void, + ): Unregisterable | any; + + /** + * Registers a callback for changes in controller configuration cloud state. + * @param {(controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void} callback - The callback function for config cloud state changes. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForControllerConfigCloudStateChanges( + callback: (controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void, + ): Unregisterable | any; + + /** + * Registers a callback for receiving controller configuration info messages (controller layouts query, personal controller layout query). + * @param {(controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[]) => void} callback - The callback function for controller config info messages. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @remarks Do Not Use, this will break the controller layout selection unless you know what you are doing. + */ + RegisterForControllerConfigInfoMessages( + callback: ( + controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[], + ) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be invoked when controller input messages are received. + * @param {(controllerInputMessages: ControllerInputMessage[]) => void} callback - The callback function to be invoked when controller input messages are received. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForControllerInputMessages( + callback: (controllerInputMessages: ControllerInputMessage[]) => void, + ): Unregisterable | any; + + RegisterForControllerListChanges(callback: (controllerListChanges: ControllerInfo[]) => void): Unregisterable | any; + + /** + * Registers a callback for changes in the controller state (buttons presses, triggers presses, joystick changes etc...). + * @param {(controllerStateChanges: ControllerStateChange[]) => void} callback - The callback function for controller state changes. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForControllerStateChanges( + callback: (controllerStateChanges: ControllerStateChange[]) => void, + ): Unregisterable | any; + + RegisterForDualSenseUpdateNotification: Unregisterable | any; + + /** + * Registers a callback for receiving game keyboard messages (text field popup for inputting text for games when in character creation or etc...). + * @param {(gameKeyboardMessage: GameKeyboardMessage) => void} callback - The callback function for game keyboard messages. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameKeyboardMessages(callback: (gameKeyboardMessage: GameKeyboardMessage) => void): Unregisterable | any; + + RegisterForRemotePlayConfigChanges: Unregisterable | any; + RegisterForShowControllerLayoutPreviewMessages: Unregisterable | any; + RegisterForTouchMenuInputMessages: Unregisterable | any; + + RegisterForTouchMenuMessages(callback: (touchMenuMessage: TouchMenuMessage) => void): Unregisterable | any; + + RegisterForUIVisualization: Unregisterable | any; + + RegisterForUnboundControllerListChanges(callback: (param0: any) => void): Unregisterable | any; // param0 is an array + RegisterForUserDismissKeyboardMessages: Unregisterable | any; + RegisterForUserKeyboardMessages: Unregisterable | any; + RequestGyroActive: any; + RequestRemotePlayControllerConfigs: any; + + ResetControllerBindings(param0: any): any; + + ResolveCloudedControllerConfigConflict: any; + + RestoreControllerPersonalizationSettings(controllerIndex: number): any; + + SaveControllerCalibration: any; + SaveControllerPersonalizationSettings: any; + SaveControllerSounds: any; + + SaveEditingControllerConfiguration(controllerIndex: number, sharedConfig: boolean): any; + + SetActiveControllerAccount: any; + SetControllerConfigurationModeShiftBinding: any; + SetControllerHapticSetting: any; + + SetControllerMappingString(mapping: string): void; + + SetControllerName: any; + SetControllerNintendoLayoutSetting: any; + SetControllerPersonalizationName: any; + + //param0 - nLStickDeadzone, bSWAntiDrift, nRHapticStrength, flRPadPressureCurve + SetControllerPersonalizationSetting(param0: string, param1: number): any; + + //param0 - flGyroStationaryTolerance, flAccelerometerStationaryTolerance + SetControllerPersonalizationSettingFloat(param0: string, param1: number): any; + + SetControllerRumbleSetting: any; + SetCursorActionset: any; + SetEditingControllerConfigurationActionSet: any; + SetEditingControllerConfigurationInputActivator: any; + SetEditingControllerConfigurationInputActivatorEnabled: any; + SetEditingControllerConfigurationInputBinding: any; + SetEditingControllerConfigurationMiscSetting: any; + SetEditingControllerConfigurationSourceMode: any; + + SetGamepadKeyboardText(param0: boolean, param1: string): any; + + SetKeyboardActionset(param0: boolean): any; + + /** + * Sets the mouse position. + * @param {number} pid - 0 + * @param {number} x - Mouse X position. + * @param {number} y - Mouse Y position. + * @returns {void} + */ + SetMousePosition(pid: number, x: number, y: number): void; + + SetSelectedConfigForApp(): any; + + SetSteamControllerDonglePairingMode: any; + + SetVirtualMenuKeySelected(unControllerIndex: number, unMenuIndex: number, param2: number): any; // + SetWebBrowserActionset: any; + + SetXboxDriverInstallState(param0: any): any; // state + + /** + * Opens the Steam Input controller settings. + * This function displays the Steam Input controller settings for configuration. + * @returns {void} + */ + ShowControllerSettings(): void; + + StandaloneKeyboardDismissed(): any; + + StartControllerDeviceSupportFlow(param0: any, param1: any, callback: (param2: any) => void): any; + + StartEditingControllerConfigurationForAppIDAndControllerIndex: any; + StartGyroSWCalibration: any; + StopEditingControllerConfiguration: any; + SwapControllerModeInputBindings: any; + SwapControllerOrder: any; + + SyncCloudedControllerConfigs(): any; + + // type - enum + TriggerHapticPulse(controllerIndex: number, type: number, param2: number): any; + + TriggerSimpleHapticEvent( + controllerIndex: number, + type: number, + intensity: number, + dbGain: number, + param4: number, + ): any; + + UnregisterForControllerStateChanges(): void; + + UnregisterForUIVisualization(controllerIndex: number): any; + + UploadChangesForCloudedControllerConfigs(): any; } /** * Represents functions related to Steam Install Folders. */ export interface InstallFolder { - /** - * Adds a Steam Library folder to the Steam client. - * @param {string} steamLibraryPath - The path of the Steam Library folder to be added. - * @returns {Promise<number>} - A Promise that resolves to the index of the added folder. - */ - AddInstallFolder(steamLibraryPath: string): Promise<number>; + /** + * Adds a Steam Library folder to the Steam client. + * @param {string} steamLibraryPath - The path of the Steam Library folder to be added. + * @returns {Promise<number>} - A Promise that resolves to the index of the added folder. + */ + AddInstallFolder(steamLibraryPath: string): Promise<number>; - /** - * Opens the file explorer to browse files in a specific Steam Library folder. - * @param {number} folderIndex - The index of the folder to be opened. - * @returns {void} - */ - BrowseFilesInFolder(folderIndex: number): void; + /** + * Opens the file explorer to browse files in a specific Steam Library folder. + * @param {number} folderIndex - The index of the folder to be opened. + * @returns {void} + */ + BrowseFilesInFolder(folderIndex: number): void; - /** - * Cancels the current move operation for moving game content. - * @returns {void} - */ - CancelMove(): void; + /** + * Cancels the current move operation for moving game content. + * @returns {void} + */ + CancelMove(): void; - /** - * Retrieves a list of installed Steam Library folders. - * @returns {Promise<SteamInstallFolder[]>} - A Promise that resolves to an array of SteamInstallFolder objects. - */ - GetInstallFolders(): Promise<SteamInstallFolder[]>; + /** + * Retrieves a list of installed Steam Library folders. + * @returns {Promise<SteamInstallFolder[]>} - A Promise that resolves to an array of SteamInstallFolder objects. + */ + GetInstallFolders(): Promise<SteamInstallFolder[]>; - /** - * Retrieves a list of potential Steam Library folders that can be added. - * @returns {Promise<PotentialInstallFolder[]>} - A Promise that resolves to an array of PotentialInstallFolder objects. - */ - GetPotentialFolders(): Promise<PotentialInstallFolder[]>; + /** + * Retrieves a list of potential Steam Library folders that can be added. + * @returns {Promise<PotentialInstallFolder[]>} - A Promise that resolves to an array of PotentialInstallFolder objects. + */ + GetPotentialFolders(): Promise<PotentialInstallFolder[]>; - /** - * Moves the installation folder for a specific app to another Steam Library folder. - * @param {number} appId - The ID of the application to be moved. - * @param {number} folderIndex - The index of the target Steam Library folder. - * @returns {void} - */ - MoveInstallFolderForApp(appId: number, folderIndex: number): void; + /** + * Moves the installation folder for a specific app to another Steam Library folder. + * @param {number} appId - The ID of the application to be moved. + * @param {number} folderIndex - The index of the target Steam Library folder. + * @returns {void} + */ + MoveInstallFolderForApp(appId: number, folderIndex: number): void; - /** - * Refreshes the list of installed Steam Library folders. - * @returns {any} - A Promise or response indicating the refresh operation. - */ - RefreshFolders(): any; + /** + * Refreshes the list of installed Steam Library folders. + * @returns {any} - A Promise or response indicating the refresh operation. + */ + RefreshFolders(): any; - /** - * Registers a callback function to be called when changes occur in Steam Install Folders. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForInstallFolderChanges(callback: (folderChange: FolderChange) => void): Unregisterable | any; + /** + * Registers a callback function to be called when changes occur in Steam Install Folders. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForInstallFolderChanges(callback: (folderChange: FolderChange) => void): Unregisterable | any; - /** - * Registers a callback function to be called when moving game content progresses. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMoveContentProgress(callback: (moveContentProgress: MoveContentProgress) => void): Unregisterable | any; + /** + * Registers a callback function to be called when moving game content progresses. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMoveContentProgress(callback: (moveContentProgress: MoveContentProgress) => void): Unregisterable | any; - /** - * Registers a callback function to be called when repairing an install folder is finished. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForRepairFolderFinished(callback: (folderChange: FolderChange) => void): Unregisterable | any; + /** + * Registers a callback function to be called when repairing an install folder is finished. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForRepairFolderFinished(callback: (folderChange: FolderChange) => void): Unregisterable | any; - /** - * Removes a Steam Library folder from the Steam client. - * @param {number} folderIndex - The index of the folder to be removed. - * @returns {void} - */ - RemoveInstallFolder(folderIndex: number): void; + /** + * Removes a Steam Library folder from the Steam client. + * @param {number} folderIndex - The index of the folder to be removed. + * @returns {void} + */ + RemoveInstallFolder(folderIndex: number): void; - /** - * Repairs an installed Steam Library folder. - * @param {number} folderIndex - The index of the folder to be repaired. - * @returns {void} - */ - RepairInstallFolder(folderIndex: number): void; + /** + * Repairs an installed Steam Library folder. + * @param {number} folderIndex - The index of the folder to be repaired. + * @returns {void} + */ + RepairInstallFolder(folderIndex: number): void; - /** - * Sets a specific Steam Library folder as the default install folder. - * @param {number} folderIndex - The index of the folder to be set as default. - * @returns {void} - */ - SetDefaultInstallFolder(folderIndex: number): void; + /** + * Sets a specific Steam Library folder as the default install folder. + * @param {number} folderIndex - The index of the folder to be set as default. + * @returns {void} + */ + SetDefaultInstallFolder(folderIndex: number): void; - /** - * Sets a user-defined label for a specific Steam Library folder. - * @param {number} folderIndex - The index of the folder to be labeled. - * @param {string} userLabel - The label to be assigned to the folder. - * @returns {void} - */ - SetFolderLabel(folderIndex: number, userLabel: string): void; + /** + * Sets a user-defined label for a specific Steam Library folder. + * @param {number} folderIndex - The index of the folder to be labeled. + * @param {string} userLabel - The label to be assigned to the folder. + * @returns {void} + */ + SetFolderLabel(folderIndex: number, userLabel: string): void; } /** * Represents functions related to managing installs and installation wizards in Steam. */ export interface Installs { - /** - * Cancels the installation wizard if it is open. - * @returns {void} - */ - CancelInstall(): void; + /** + * Cancels the installation wizard if it is open. + * @returns {void} + */ + CancelInstall(): void; - /** - * Continues and starts the installation if the wizard is still open. - * @returns {void} - */ - ContinueInstall(): void; + /** + * Continues and starts the installation if the wizard is still open. + * @returns {void} + */ + ContinueInstall(): void; - /** - * Retrieves information from the last opened or currently opened installation wizard. - * @returns {Promise<InstallInfo>} A Promise that resolves to the InstallInfo. - */ - GetInstallManagerInfo(): Promise<InstallInfo>; + /** + * Retrieves information from the last opened or currently opened installation wizard. + * @returns {Promise<InstallInfo>} A Promise that resolves to the InstallInfo. + */ + GetInstallManagerInfo(): Promise<InstallInfo>; - /** - * Opens the restore from backup installer wizard for a specific app. - * @param {string} appBackupPath - The backup path of the app. - * @returns {void} - */ - OpenInstallBackup(appBackupPath: string): void; + /** + * Opens the restore from backup installer wizard for a specific app. + * @param {string} appBackupPath - The backup path of the app. + * @returns {void} + */ + OpenInstallBackup(appBackupPath: string): void; - /** - * Opens the installation wizard for specified app IDs. - * @param {number[]} appIds - An array of app IDs to install. - * @returns {void} - */ - OpenInstallWizard(appIds: number[]): void; + /** + * Opens the installation wizard for specified app IDs. + * @param {number[]} appIds - An array of app IDs to install. + * @returns {void} + */ + OpenInstallWizard(appIds: number[]): void; - /** - * Opens the uninstall wizard for specified app IDs. - * @param {number[]} appIds - An array of app IDs to uninstall. - * @param {boolean} dontPrompt - Whether to *not* prompt the user to uninstall. - * @returns {void} - */ - OpenUninstallWizard(appIds: number[], dontPrompt: boolean): void; + /** + * Opens the uninstall wizard for specified app IDs. + * @param {number[]} appIds - An array of app IDs to uninstall. + * @param {boolean} dontPrompt - Whether to *not* prompt the user to uninstall. + * @returns {void} + */ + OpenUninstallWizard(appIds: number[], dontPrompt: boolean): void; - RegisterForShowConfirmUninstall: Unregisterable | any; // Broken? doesn't seem to work + RegisterForShowConfirmUninstall: Unregisterable | any; // Broken? doesn't seem to work - /** - * Registers a callback function to be called when the "Failed Uninstall" dialog is shown. - * @param {function} callback - The callback function to be called when the dialog is shown. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForShowFailedUninstall(callback: (appId: number, reason: AppUpdateError) => void): Unregisterable | any; + /** + * Registers a callback function to be called when the "Failed Uninstall" dialog is shown. + * @param {function} callback - The callback function to be called when the dialog is shown. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForShowFailedUninstall(callback: (appId: number, reason: AppUpdateError) => void): Unregisterable | any; - /** - * Registers a callback function to be called when the installation wizard is shown. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForShowInstallWizard(callback: (data: InstallInfo) => void): Unregisterable | any; + /** + * Registers a callback function to be called when the installation wizard is shown. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForShowInstallWizard(callback: (data: InstallInfo) => void): Unregisterable | any; - RegisterForShowRegisterCDKey: any; + RegisterForShowRegisterCDKey: any; - /** - * Sets a list of app identifiers for downloads in the installation wizard. - * @param {number[]} appIds - An array of app IDs to set. - * @returns {void} - * @remarks The wizard will not reflect this change immediately, but changing another option will. - */ - SetAppList(appIds: number[]): void; - - /** - * Sets the options for creating shortcuts in the installation wizard. - * @param {boolean} bDesktopShortcut - Whether to create a desktop shortcut. - * @param {boolean} bSystemMenuShortcut - Whether to create a system menu shortcut. - * @returns {void} - * @remarks The wizard will not reflect this change immediately, but changing another option will. - */ - SetCreateShortcuts(bDesktopShortcut: boolean, bSystemMenuShortcut: boolean): void; + /** + * Sets a list of app identifiers for downloads in the installation wizard. + * @param {number[]} appIds - An array of app IDs to set. + * @returns {void} + * @remarks The wizard will not reflect this change immediately, but changing another option will. + */ + SetAppList(appIds: number[]): void; + + /** + * Sets the options for creating shortcuts in the installation wizard. + * @param {boolean} bDesktopShortcut - Whether to create a desktop shortcut. + * @param {boolean} bSystemMenuShortcut - Whether to create a system menu shortcut. + * @returns {void} + * @remarks The wizard will not reflect this change immediately, but changing another option will. + */ + SetCreateShortcuts(bDesktopShortcut: boolean, bSystemMenuShortcut: boolean): void; - /** - * Sets the install folder for the installation wizard using an install folder index. - * @param {number} folderIndex - The index of the install folder. - * @returns {void} - * @remarks The wizard will not reflect this change immediately, but changing another option will. - */ - SetInstallFolder(folderIndex: number): void; + /** + * Sets the install folder for the installation wizard using an install folder index. + * @param {number} folderIndex - The index of the install folder. + * @returns {void} + * @remarks The wizard will not reflect this change immediately, but changing another option will. + */ + SetInstallFolder(folderIndex: number): void; } export interface Messaging { - // section - "ContentManagement", "JumpList", "PostToLibrary" - // seems multipurpose - // callback arguments are the same as in PostMessage - RegisterForMessages( - section: string, - callback: (section: string, param1: string, message: string) => void, - ): Unregisterable | any; - - /* + // section - "ContentManagement", "JumpList", "PostToLibrary" + // seems multipurpose + // callback arguments are the same as in PostMessage + RegisterForMessages( + section: string, + callback: (section: string, param1: string, message: string) => void, + ): Unregisterable | any; + + /* function m(e) { SteamClient.Messaging.PostMessage("LibraryCommands", "ShowFriendChatDialog", JSON.stringify({ steamid: e.persona.m_steamid.ConvertTo64BitString() })) } */ - PostMessage(section: string, param1: string, message: string): void; + PostMessage(section: string, param1: string, message: string): void; } /** * Represents functions related to controlling music playback in the Steam client. */ export interface Music { - /** - * Decreases the music volume by 10%. - */ - DecreaseVolume(): void; + /** + * Decreases the music volume by 10%. + */ + DecreaseVolume(): void; - /** - * Increases the music volume by 10%. - */ - IncreaseVolume(): void; + /** + * Increases the music volume by 10%. + */ + IncreaseVolume(): void; - /** - * @param {number} param0 - Unknown parameter usage. - * @param {number} param1 - Unknown parameter usage. - * @todo: unknown parameter usages, I have tried soundtrack identifier + track index and in reverse as well - */ - PlayEntry(param0: number, param1: number): void; + /** + * @param {number} param0 - Unknown parameter usage. + * @param {number} param1 - Unknown parameter usage. + * @todo: unknown parameter usages, I have tried soundtrack identifier + track index and in reverse as well + */ + PlayEntry(param0: number, param1: number): void; - /** - * Plays the next track in the music playlist. - */ - PlayNext(): void; + /** + * Plays the next track in the music playlist. + */ + PlayNext(): void; - /** - * Plays the previous track in the music playlist. - */ - PlayPrevious(): void; + /** + * Plays the previous track in the music playlist. + */ + PlayPrevious(): void; - /** - * Registers a callback function to be called when music playback changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMusicPlaybackChanges(callback: (param0: boolean | MusicTrack) => void): Unregisterable | any; + /** + * Registers a callback function to be called when music playback changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMusicPlaybackChanges(callback: (param0: boolean | MusicTrack) => void): Unregisterable | any; - /** - * Registers a callback function to be called when the music playback position changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMusicPlaybackPosition(callback: (position: number) => void): Unregisterable | any; + /** + * Registers a callback function to be called when the music playback position changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMusicPlaybackPosition(callback: (position: number) => void): Unregisterable | any; - /** - * Sets the playback position of the music track. - * @param {number} position - The position to set in seconds. - */ - SetPlaybackPosition(position: number): void; + /** + * Sets the playback position of the music track. + * @param {number} position - The position to set in seconds. + */ + SetPlaybackPosition(position: number): void; - /** - * Sets the repeat status for music playback. - * @param {MusicRepeatStatus} status - The repeat status. - */ - SetPlayingRepeatStatus(status: MusicRepeatStatus): void; + /** + * Sets the repeat status for music playback. + * @param {MusicRepeatStatus} status - The repeat status. + */ + SetPlayingRepeatStatus(status: MusicRepeatStatus): void; - /** - * Sets the shuffle status for music playback. - * @param {boolean} value - True to enable shuffle, false to disable shuffle. - */ - SetPlayingShuffled(value: boolean): void; + /** + * Sets the shuffle status for music playback. + * @param {boolean} value - True to enable shuffle, false to disable shuffle. + */ + SetPlayingShuffled(value: boolean): void; - /** - * Sets the volume for music playback. - * @param {number} volume - The volume level to set. - * @remarks Ranges from 0 to 100. - */ - SetVolume(volume: number): void; + /** + * Sets the volume for music playback. + * @param {number} volume - The volume level to set. + * @remarks Ranges from 0 to 100. + */ + SetVolume(volume: number): void; - /** - * Toggles the mute state of the music volume. - */ - ToggleMuteVolume(): void; + /** + * Toggles the mute state of the music volume. + */ + ToggleMuteVolume(): void; - /** - * Toggles between play and pause for music playback. - */ - TogglePlayPause(): void; + /** + * Toggles between play and pause for music playback. + */ + TogglePlayPause(): void; } export interface Notifications { - RegisterForNotifications( - callback: (notificationIndex: number, type: ClientUINotification, param2: ArrayBuffer) => void, - ): Unregisterable | any; + RegisterForNotifications( + callback: (notificationIndex: number, type: ClientUINotification, param2: ArrayBuffer) => void, + ): Unregisterable | any; } export interface VRDevice { - BIsConnected: any; - BVRDeviceSeenRecently: any; - RegisterForDeviceConnectivityChange: Unregisterable | any; + BIsConnected: any; + BVRDeviceSeenRecently: any; + RegisterForDeviceConnectivityChange: Unregisterable | any; } export interface DeviceProperties { - GetBoolDeviceProperty: any; - GetDoubleDeviceProperty: any; - GetFloatDeviceProperty: any; - GetInt32DeviceProperty: any; - GetStringDeviceProperty: any; - RegisterForDevicePropertyChange: Unregisterable | any; + GetBoolDeviceProperty: any; + GetDoubleDeviceProperty: any; + GetFloatDeviceProperty: any; + GetInt32DeviceProperty: any; + GetStringDeviceProperty: any; + RegisterForDevicePropertyChange: Unregisterable | any; } export interface Keyboard { - Hide(): any; - RegisterForStatus: Unregisterable | any; - SendDone(): any; - SendText(key: string): any; //??? - Show(): any; + Hide(): any; + + RegisterForStatus: Unregisterable | any; + + SendDone(): any; + + SendText(key: string): any; //??? + Show(): any; } export interface PathProperties { - GetBoolPathProperty: any; - GetDoublePathProperty: any; - GetFloatPathProperty: any; - GetInt32PathProperty: any; - GetStringPathProperty: any; - RegisterForPathPropertyChange: any; - SetBoolPathProperty: any; - SetDoublePathProperty: any; - SetFloatPathProperty: any; - SetInt32PathProperty: any; - SetStringPathProperty: any; + GetBoolPathProperty: any; + GetDoublePathProperty: any; + GetFloatPathProperty: any; + GetInt32PathProperty: any; + GetStringPathProperty: any; + RegisterForPathPropertyChange: any; + SetBoolPathProperty: any; + SetDoublePathProperty: any; + SetFloatPathProperty: any; + SetInt32PathProperty: any; + SetStringPathProperty: any; } export interface VROverlay { - HideDashboard: any; - RegisterForButtonPress: Unregisterable | any; - RegisterForCursorMovement: Unregisterable | any; - RegisterForVisibilityChanged: Unregisterable | any; - ShowDashboard: any; + HideDashboard: any; + RegisterForButtonPress: Unregisterable | any; + RegisterForCursorMovement: Unregisterable | any; + RegisterForVisibilityChanged: Unregisterable | any; + ShowDashboard: any; } export interface OpenVR { - Device: VRDevice; - DeviceProperties: DeviceProperties; - GetWebSecret(): Promise<string>; - InstallVR(): any; - Keyboard: Keyboard; - PathProperties: PathProperties; - QuitAllVR(): any; - RegisterForButtonPress: Unregisterable | any; - RegisterForHMDActivityLevelChanged: Unregisterable | any; - RegisterForInstallDialog: Unregisterable | any; - RegisterStartupErrors: Unregisterable | any; - RegisterForVRHardwareDetected: Unregisterable | any; - SetOverlayInteractionAffordance: any; - ShowNotification(title: string, description: string): any; - StartVR: any; - TriggerOverlayHapticEffect: any; - VROverlay: VROverlay; + Device: VRDevice; + DeviceProperties: DeviceProperties; + + GetWebSecret(): Promise<string>; + + InstallVR(): any; + + Keyboard: Keyboard; + PathProperties: PathProperties; + + QuitAllVR(): any; + + RegisterForButtonPress: Unregisterable | any; + RegisterForHMDActivityLevelChanged: Unregisterable | any; + RegisterForInstallDialog: Unregisterable | any; + RegisterStartupErrors: Unregisterable | any; + RegisterForVRHardwareDetected: Unregisterable | any; + SetOverlayInteractionAffordance: any; + + ShowNotification(title: string, description: string): any; + + StartVR: any; + TriggerOverlayHapticEffect: any; + VROverlay: VROverlay; } export interface Overlay { - /** - * Destroys the gamepad UI desktop configurator window if open. - * @returns {void} - */ - DestroyGamePadUIDesktopConfiguratorWindow(): void; + /** + * Destroys the gamepad UI desktop configurator window if open. + * @returns {void} + */ + DestroyGamePadUIDesktopConfiguratorWindow(): void; - GetOverlayBrowserInfo(): any; - HandleGameWebCallback(url: string): any; - HandleProtocolForOverlayBrowser(appId: number, protocol: string): any; - RegisterForActivateOverlayRequests: Unregisterable | any; + GetOverlayBrowserInfo(): any; - /** - * Registers a callback function to be called when a microtransaction authorization is requested. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMicroTxnAuth( - callback: (appId: number, microTxnId: string, realm: SteamRealm, microTxnUrl: string) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a microtransaction authorization is dismissed by the user in Steam's authorization page. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMicroTxnAuthDismiss(callback: (appId: number, microTxnId: string) => void): Unregisterable | any; + HandleGameWebCallback(url: string): any; - RegisterForNotificationPositionChanged( - callback: (appId: any, position: any, horizontalInset: number, verticalInset: number) => void, - ): Unregisterable | any; + HandleProtocolForOverlayBrowser(appId: number, protocol: string): any; - /** - * Registers a callback function to be called when an overlay is activated or closed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForOverlayActivated( - callback: (popUpContextId: number, appId: number, active: boolean, param3: boolean) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when the overlay browser protocols change. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForOverlayBrowserProtocols( - callback: (browseProtocols: OverlayBrowserProtocols) => void, - ): Unregisterable | any; - - /** - * Registers **the** callback function to be called when the overlay browser information changes. - * @param {function} callback - The callback function to be called when the overlay browser information changes. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @remarks Do Not Use, this will break the overlay unless you know what you are doing. - */ - RegisterOverlayBrowserInfoChanged(callback: () => void): Unregisterable | any; + RegisterForActivateOverlayRequests: Unregisterable | any; + + /** + * Registers a callback function to be called when a microtransaction authorization is requested. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMicroTxnAuth( + callback: (appId: number, microTxnId: string, realm: SteamRealm, microTxnUrl: string) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a microtransaction authorization is dismissed by the user in Steam's authorization page. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMicroTxnAuthDismiss(callback: (appId: number, microTxnId: string) => void): Unregisterable | any; + + RegisterForNotificationPositionChanged( + callback: (appId: any, position: any, horizontalInset: number, verticalInset: number) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when an overlay is activated or closed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForOverlayActivated( + callback: (popUpContextId: number, appId: number, active: boolean, param3: boolean) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when the overlay browser protocols change. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForOverlayBrowserProtocols( + callback: (browseProtocols: OverlayBrowserProtocols) => void, + ): Unregisterable | any; + + /** + * Registers **the** callback function to be called when the overlay browser information changes. + * @param {function} callback - The callback function to be called when the overlay browser information changes. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @remarks Do Not Use, this will break the overlay unless you know what you are doing. + */ + RegisterOverlayBrowserInfoChanged(callback: () => void): Unregisterable | any; - SetOverlayState(appId: number, uiComposition: UIComposition): any; + SetOverlayState(appId: number, uiComposition: UIComposition): any; } /** * Interface for managing parental control settings. */ export interface Parental { - /** - * Locks the parental control settings. - * @returns {void} - */ - LockParentalLock(): void; + /** + * Locks the parental control settings. + * @returns {void} + */ + LockParentalLock(): void; - /** - * Registers a callback function to be invoked when parental settings change. - * @param {(parentalSettings: ParentalSettings) => void} callback - The callback function to be invoked when parental settings change. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForParentalSettingsChanges(callback: (parentalSettings: ParentalSettings) => void): Unregisterable | any; + /** + * Registers a callback function to be invoked when parental settings change. + * @param {(parentalSettings: ParentalSettings) => void} callback - The callback function to be invoked when parental settings change. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForParentalSettingsChanges(callback: (parentalSettings: ParentalSettings) => void): Unregisterable | any; - /** - * Unlocks the parental lock with the provided PIN. - * @param {string} pin - The 4-digit PIN to unlock the parental lock. - * @param {boolean} param1 - Additional parameter. // Todo: Unknown usage. - * @returns {Promise<Result>} - A Promise that resolves to a number representing the result of the unlock operation. - */ - UnlockParentalLock(pin: string, param1: boolean): Promise<Result>; + /** + * Unlocks the parental lock with the provided PIN. + * @param {string} pin - The 4-digit PIN to unlock the parental lock. + * @param {boolean} param1 - Additional parameter. // Todo: Unknown usage. + * @returns {Promise<Result>} - A Promise that resolves to a number representing the result of the unlock operation. + */ + UnlockParentalLock(pin: string, param1: boolean): Promise<Result>; } export interface RemotePlay { - BCanAcceptInviteForGame: any; - BCanCreateInviteForGame: any; + BCanAcceptInviteForGame: any; + BCanCreateInviteForGame: any; + + BCanHostIsolatedGameAudio(): Promise<boolean>; + + BEnabled(): Promise<boolean>; + + BRemotePlayTogetherGuestOnPhoneOrTablet(steam64Id: string, guestId: number): Promise<boolean>; + + BRemotePlayTogetherGuestSupported(): Promise<boolean>; + + CancelInviteAndSession(steam64Id: string): any; + + CancelInviteAndSessionWithGuestID(steam64Id: string, guestId: number): any; + + CloseGroup(): Promise<number>; + + CreateGroup: any; + + CreateInviteAndSession(steam64Id: string, param1: any): any; + + CreateInviteAndSessionWithGuestID(steam64Id: string, guestId: number, param2: any): any; + + GetClientStreamingBitrate(): Promise<number>; //todo: -1 not streaming?? + GetClientStreamingQuality(): Promise<number>; //todo: -1 not streaming?? + GetControllerType(param0: number): Promise<ControllerType>; // todo: param0 with value 0 is host controller type - param0 is likely an index of clients or guestId? + GetGameSystemVolume(): Promise<number>; + + GetPerUserInputSettings(steam64Id: string): any; + + GetPerUserInputSettingsWithGuestID(steam64Id: string, guestId: number): any; - BCanHostIsolatedGameAudio(): Promise<boolean>; + IdentifyController: any; + InstallAudioDriver: any; + InstallInputDriver: any; + MoveControllerToSlot: any; + RegisterForAdditionalParentalBlocks: Unregisterable | any; + RegisterForAudioDriverPrompt: Unregisterable | any; + RegisterForBitrateOverride: Unregisterable | any; + RegisterForControllerIndexSet: Unregisterable | any; - BEnabled(): Promise<boolean>; + RegisterForDevicesChanges(callback: (devicesChange: RemotePlayDevice[]) => void): Unregisterable | any; - BRemotePlayTogetherGuestOnPhoneOrTablet(steam64Id: string, guestId: number): Promise<boolean>; + RegisterForGroupCreated: Unregisterable | any; + RegisterForGroupDisbanded: Unregisterable | any; + RegisterForInputDriverPrompt: Unregisterable | any; + RegisterForInputDriverRestartNotice: Unregisterable | any; - BRemotePlayTogetherGuestSupported(): Promise<boolean>; + RegisterForInputUsed( + callback: (steam64Id: string, type: ClientUsedInputType, guestId: number) => void, + ): Unregisterable | any; // only fires on host - CancelInviteAndSession(steam64Id: string): any; - CancelInviteAndSessionWithGuestID(steam64Id: string, guestId: number): any; - CloseGroup(): Promise<number>; - CreateGroup: any; - CreateInviteAndSession(steam64Id: string, param1: any): any; - CreateInviteAndSessionWithGuestID(steam64Id: string, guestId: number, param2: any): any; + RegisterForInviteResult: Unregisterable | any; - GetClientStreamingBitrate(): Promise<number>; //todo: -1 not streaming?? - GetClientStreamingQuality(): Promise<number>; //todo: -1 not streaming?? - GetControllerType(param0: number): Promise<ControllerType>; // todo: param0 with value 0 is host controller type - param0 is likely an index of clients or guestId? - GetGameSystemVolume(): Promise<number>; + RegisterForNetworkUtilizationUpdate( + callback: (steam64Id: string, guestId: number, networkUtilization: number, networkDuration: number) => void, + ): Unregisterable | any; // only fires on host - GetPerUserInputSettings(steam64Id: string): any; - GetPerUserInputSettingsWithGuestID(steam64Id: string, guestId: number): any; - IdentifyController: any; - InstallAudioDriver: any; - InstallInputDriver: any; - MoveControllerToSlot: any; - RegisterForAdditionalParentalBlocks: Unregisterable | any; - RegisterForAudioDriverPrompt: Unregisterable | any; - RegisterForBitrateOverride: Unregisterable | any; - RegisterForControllerIndexSet: Unregisterable | any; + RegisterForPlaceholderStateChanged(callback: (isShowingPlaceholder: boolean) => void): Unregisterable | any; - RegisterForDevicesChanges(callback: (devicesChange: RemotePlayDevice[]) => void): Unregisterable | any; + RegisterForPlayerInputSettingsChanged: Unregisterable | any; - RegisterForGroupCreated: Unregisterable | any; - RegisterForGroupDisbanded: Unregisterable | any; - RegisterForInputDriverPrompt: Unregisterable | any; - RegisterForInputDriverRestartNotice: Unregisterable | any; + RegisterForQualityOverride(callback: (hostStreamingQualityOverride: number) => void): Unregisterable | any; - RegisterForInputUsed( - callback: (steam64Id: string, type: ClientUsedInputType, guestId: number) => void, - ): Unregisterable | any; // only fires on host + RegisterForRemoteClientLaunchFailed: Unregisterable | any; - RegisterForInviteResult: Unregisterable | any; + RegisterForRemoteClientStarted(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client - RegisterForNetworkUtilizationUpdate( - callback: (steam64Id: string, guestId: number, networkUtilization: number, networkDuration: number) => void, - ): Unregisterable | any; // only fires on host + RegisterForRemoteClientStopped(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client - RegisterForPlaceholderStateChanged(callback: (isShowingPlaceholder: boolean) => void): Unregisterable | any; - RegisterForPlayerInputSettingsChanged: Unregisterable | any; - RegisterForQualityOverride(callback: (hostStreamingQualityOverride: number) => void): Unregisterable | any; - RegisterForRemoteClientLaunchFailed: Unregisterable | any; + RegisterForSessionStarted(callback: (steam64Id: any, gameId: any, guestId: any) => void): Unregisterable | any; - RegisterForRemoteClientStarted(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client + RegisterForSessionStopped(callback: (steam64Id: any, guestId: any) => void): Unregisterable | any; - RegisterForRemoteClientStopped(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client + RegisterForSettingsChanges(callback: (remotePlaySettings: RemotePlaySettings) => void): Unregisterable | any; - RegisterForSessionStarted(callback: (steam64Id: any, gameId: any, guestId: any) => void): Unregisterable | any; - RegisterForSessionStopped(callback: (steam64Id: any, guestId: any) => void): Unregisterable | any; + SetClientStreamingBitrate(bitrate: number): void; - RegisterForSettingsChanges(callback: (remotePlaySettings: RemotePlaySettings) => void): Unregisterable | any; + SetClientStreamingQuality(quality: number): void; - SetClientStreamingBitrate(bitrate: number): void; - SetClientStreamingQuality(quality: number): void; + SetGameSystemVolume(volume: number): void; - SetGameSystemVolume(volume: number): void; + SetPerUserControllerInputEnabled(steam64Id: string, enabled: boolean): any; - SetPerUserControllerInputEnabled(steam64Id: string, enabled: boolean): any; - SetPerUserControllerInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; - SetPerUserKeyboardInputEnabled(steam64Id: string, enabled: boolean): any; - SetPerUserKeyboardInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; - SetPerUserMouseInputEnabled(steam64Id: string, enabled: boolean): any; - SetPerUserMouseInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; - SetRemoteDeviceAuthorized: any; - SetRemoteDevicePIN(pin: number): void; - SetRemotePlayEnabled(enabled: boolean): void; - SetStreamingClientConfig: any; - SetStreamingClientConfigEnabled: any; - SetStreamingDesktopToRemotePlayTogetherEnabled(enabled: boolean): any; - SetStreamingP2PScope: any; - SetStreamingServerConfig: any; - SetStreamingServerConfigEnabled: any; + SetPerUserControllerInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; - StopStreamingClient(): void; + SetPerUserKeyboardInputEnabled(steam64Id: string, enabled: boolean): any; - StopStreamingSession: any; - StopStreamingSessionAndSuspendDevice: any; - UnlockH264(): any; + SetPerUserKeyboardInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; - UnpairRemoteDevices(): void; // unpairs all devices + SetPerUserMouseInputEnabled(steam64Id: string, enabled: boolean): any; + + SetPerUserMouseInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; + + SetRemoteDeviceAuthorized: any; + + SetRemoteDevicePIN(pin: number): void; + + SetRemotePlayEnabled(enabled: boolean): void; + + SetStreamingClientConfig: any; + SetStreamingClientConfigEnabled: any; + + SetStreamingDesktopToRemotePlayTogetherEnabled(enabled: boolean): any; + + SetStreamingP2PScope: any; + SetStreamingServerConfig: any; + SetStreamingServerConfigEnabled: any; + + StopStreamingClient(): void; + + StopStreamingSession: any; + StopStreamingSessionAndSuspendDevice: any; + + UnlockH264(): any; + + UnpairRemoteDevices(): void; // unpairs all devices } /** * Interface for managing screenshots. */ export interface Screenshots { - /** - * Deletes a local screenshot. - * @param {string} appId - The ID of the application. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {Promise<boolean>} - A Promise that resolves to a boolean value indicating whether the deletion was successful. - */ - DeleteLocalScreenshot(appId: string, screenshotIndex: number): Promise<boolean>; + /** + * Deletes a local screenshot. + * @param {string} appId - The ID of the application. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {Promise<boolean>} - A Promise that resolves to a boolean value indicating whether the deletion was successful. + */ + DeleteLocalScreenshot(appId: string, screenshotIndex: number): Promise<boolean>; - /** - * Retrieves all local screenshots for all applications. - * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects. - */ - GetAllAppsLocalScreenshots(): Promise<Screenshot[]>; + /** + * Retrieves all local screenshots for all applications. + * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects. + */ + GetAllAppsLocalScreenshots(): Promise<Screenshot[]>; - /** - * Retrieves the count of all local screenshots for all applications. - * @returns {Promise<number>} - A Promise that resolves to the count of local screenshots. - */ - GetAllAppsLocalScreenshotsCount(): Promise<number>; + /** + * Retrieves the count of all local screenshots for all applications. + * @returns {Promise<number>} - A Promise that resolves to the count of local screenshots. + */ + GetAllAppsLocalScreenshotsCount(): Promise<number>; - /** - * Retrieves a range of local screenshots for all applications. - * @param {number} start - The starting index of the screenshot range. - * @param {number} end - The ending index of the screenshot range. - * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects within the specified range. - */ - GetAllAppsLocalScreenshotsRange(start: number, end: number): Promise<Screenshot[]>; + /** + * Retrieves a range of local screenshots for all applications. + * @param {number} start - The starting index of the screenshot range. + * @param {number} end - The ending index of the screenshot range. + * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects within the specified range. + */ + GetAllAppsLocalScreenshotsRange(start: number, end: number): Promise<Screenshot[]>; - /** - * Retrieves all local screenshots. - * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects. - */ - GetAllLocalScreenshots(): Promise<Screenshot[]>; + /** + * Retrieves all local screenshots. + * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects. + */ + GetAllLocalScreenshots(): Promise<Screenshot[]>; - /** - * Retrieves the game associated with a specific local screenshot index. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {Promise<number>} - A Promise that resolves to the ID of the game associated with the screenshot. - */ - GetGameWithLocalScreenshots(screenshotIndex: number): Promise<number>; + /** + * Retrieves the game associated with a specific local screenshot index. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {Promise<number>} - A Promise that resolves to the ID of the game associated with the screenshot. + */ + GetGameWithLocalScreenshots(screenshotIndex: number): Promise<number>; - /** - * Retrieves the last taken local screenshot. - * @returns {Promise<Screenshot>} - A Promise that resolves to the last taken local screenshot. - */ - GetLastScreenshotTaken(): Promise<Screenshot>; + /** + * Retrieves the last taken local screenshot. + * @returns {Promise<Screenshot>} - A Promise that resolves to the last taken local screenshot. + */ + GetLastScreenshotTaken(): Promise<Screenshot>; - /** - * Retrieves a specific local screenshot for an application. - * @param {string} appId - The ID of the application. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {Promise<Screenshot>} - A Promise that resolves to the requested local screenshot. - */ - GetLocalScreenshot(appId: string, screenshotIndex: number): Promise<Screenshot>; + /** + * Retrieves a specific local screenshot for an application. + * @param {string} appId - The ID of the application. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {Promise<Screenshot>} - A Promise that resolves to the requested local screenshot. + */ + GetLocalScreenshot(appId: string, screenshotIndex: number): Promise<Screenshot>; - /** - * Retrieves the count of local screenshots for a specific application. - * @param {number} appId - The ID of the application. - * @returns {Promise<number>} - A Promise that resolves to the count of local screenshots for the application. - */ - GetLocalScreenshotCount(appId: number): Promise<number>; + /** + * Retrieves the count of local screenshots for a specific application. + * @param {number} appId - The ID of the application. + * @returns {Promise<number>} - A Promise that resolves to the count of local screenshots for the application. + */ + GetLocalScreenshotCount(appId: number): Promise<number>; - /** - * Retrieves the number of games with local screenshots. - * @returns {Promise<number>} - A Promise that resolves to the number of games with local screenshots. - */ - GetNumGamesWithLocalScreenshots(): Promise<number>; - - /** - * Opens a local screenshot in the system image viewer. - * If the screenshot index is invalid, this function opens the screenshots directory for the specified application ID. - * @param {string} appId - The ID of the application. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {void} - */ - ShowScreenshotInSystemViewer(appId: string, screenshotIndex: number): void; + /** + * Retrieves the number of games with local screenshots. + * @returns {Promise<number>} - A Promise that resolves to the number of games with local screenshots. + */ + GetNumGamesWithLocalScreenshots(): Promise<number>; + + /** + * Opens a local screenshot in the system image viewer. + * If the screenshot index is invalid, this function opens the screenshots directory for the specified application ID. + * @param {string} appId - The ID of the application. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {void} + */ + ShowScreenshotInSystemViewer(appId: string, screenshotIndex: number): void; - /** - * Opens the folder containing local screenshots for a specific application. - * @param {string} appId - The ID of the application. - * @returns {void} - */ - ShowScreenshotsOnDisk(appId: string): void; - - /** - * Uploads a local screenshot. - * @param {string} appId - The ID of the application. - * @param {number} localScreenshot_hHandle - The handle of the local screenshot. - * @param {number} filePrivacyState - The privacy state of the screenshot file. - * @returns {Promise<boolean>} - A Promise that resolves to a boolean value indicating whether the upload was successful. - */ - UploadLocalScreenshot( - appId: string, - localScreenshot_hHandle: number, - filePrivacyState: FilePrivacyState, - ): Promise<boolean>; + /** + * Opens the folder containing local screenshots for a specific application. + * @param {string} appId - The ID of the application. + * @returns {void} + */ + ShowScreenshotsOnDisk(appId: string): void; + + /** + * Uploads a local screenshot. + * @param {string} appId - The ID of the application. + * @param {number} localScreenshot_hHandle - The handle of the local screenshot. + * @param {number} filePrivacyState - The privacy state of the screenshot file. + * @returns {Promise<boolean>} - A Promise that resolves to a boolean value indicating whether the upload was successful. + */ + UploadLocalScreenshot( + appId: string, + localScreenshot_hHandle: number, + filePrivacyState: FilePrivacyState, + ): Promise<boolean>; } /** * Represents functionality for the server browser. */ export interface ServerBrowser { - /** - * Adds a favorite server. - * @param {ServerBrowserServerFull} server - The server to add. - * @returns {Promise<string>} A Promise that resolves to an empty string if successful, `Invalid/missing IPv4?` if failed. - * @todo Refreshed the favorite servers list upon adding once, but doesn't now. :-( - */ - AddFavoriteServer(server: ServerBrowserServerFull): Promise<string>; + /** + * Adds a favorite server. + * @param {ServerBrowserServerFull} server - The server to add. + * @returns {Promise<string>} A Promise that resolves to an empty string if successful, `Invalid/missing IPv4?` if failed. + * @todo Refreshed the favorite servers list upon adding once, but doesn't now. :-( + */ + AddFavoriteServer(server: ServerBrowserServerFull): Promise<string>; - /** - * Adds a favorite server by IP. - * @param {string} ip - The IP to add to favorite servers. - * @returns {Promise<string>} A Promise that resolves to an empty string if successful, localization string if failed. - */ - AddFavoriteServersByIP(ip: string): Promise<string>; + /** + * Adds a favorite server by IP. + * @param {string} ip - The IP to add to favorite servers. + * @returns {Promise<string>} A Promise that resolves to an empty string if successful, localization string if failed. + */ + AddFavoriteServersByIP(ip: string): Promise<string>; - CancelServerQuery(dialogId: number, queryServer: number): void; + CancelServerQuery(dialogId: number, queryServer: number): void; - /** - * Connects to a server from a given dialog. - * @param {number} dialogId - The dialog ID to use. - * @param {string} password - Server password, empty if none. - * @returns {Promise<JoinServerError>} A Promise that resolves to a connection status. - */ - ConnectToServer(dialogId: number, password: string): Promise<JoinServerError>; + /** + * Connects to a server from a given dialog. + * @param {number} dialogId - The dialog ID to use. + * @param {string} password - Server password, empty if none. + * @returns {Promise<JoinServerError>} A Promise that resolves to a connection status. + */ + ConnectToServer(dialogId: number, password: string): Promise<JoinServerError>; - /** - * Creates a server info dialog, on which your friend is playing on. - * @param {number} pid - 0 - * @param {string} steamId - A Steam64 ID of a friend. - * @returns {void} - */ - CreateFriendGameInfoDialog(pid: number, steamId: string): void; - - /** - * Creates a server info dialog. - * @param {string} ip - The IP to create a dialog for. - * @param {number} port - The IP's port. - * @param {number} queryPort - - * @returns {Promise<number>} A Promise that resolves to the current dialog ID. - */ - CreateServerGameInfoDialog(ip: string, port: number, queryPort: number): Promise<number>; - - /** - * Retrieves the server list. - * @param {number} appId - The game ID, 0 for every game. - * @param {ServerBrowserTab} queryType - The tab to use. - * @param {string[]} filters - Server filters. - * @param {function} serverCallback - What to do with the found server? - * @param {function} requestCompletedCallback - The callback function to be called when the request is completed. - * @returns {Promise<number>} A Promise that resolves to the current server list request ID. - * @throws Throws if the query type is unknown. - * @throws Throws if the filter list isn't key/value pairs, i.e. of an even length. - * @remarks Stops at 10000 if there are more servers to be found. - * @example - * Filter examples, may be combined: - * ``` - * [ 'gamedir', 'cstrike' ] // Doesn't work? - * [ 'hasplayers', '1' ] // Only works with "1"? - * [ 'notfull', '1' ] // Doesn't work? - * [ 'map', 'cs_office' ] // Has to be an exact match! - * ``` - */ + /** + * Creates a server info dialog, on which your friend is playing on. + * @param {number} pid - 0 + * @param {string} steamId - A Steam64 ID of a friend. + * @returns {void} + */ + CreateFriendGameInfoDialog(pid: number, steamId: string): void; + + /** + * Creates a server info dialog. + * @param {string} ip - The IP to create a dialog for. + * @param {number} port - The IP's port. + * @param {number} queryPort - + * @returns {Promise<number>} A Promise that resolves to the current dialog ID. + */ + CreateServerGameInfoDialog(ip: string, port: number, queryPort: number): Promise<number>; + + /** + * Retrieves the server list. + * @param {number} appId - The game ID, 0 for every game. + * @param {ServerBrowserTab} queryType - The tab to use. + * @param {string[]} filters - Server filters. + * @param {function} serverCallback - What to do with the found server? + * @param {function} requestCompletedCallback - The callback function to be called when the request is completed. + * @returns {Promise<number>} A Promise that resolves to the current server list request ID. + * @throws Throws if the query type is unknown. + * @throws Throws if the filter list isn't key/value pairs, i.e. of an even length. + * @remarks Stops at 10000 if there are more servers to be found. + * @example + * Filter examples, may be combined: + * ``` + * [ 'gamedir', 'cstrike' ] // Doesn't work? + * [ 'hasplayers', '1' ] // Only works with "1"? + * [ 'notfull', '1' ] // Doesn't work? + * [ 'map', 'cs_office' ] // Has to be an exact match! + * ``` + */ - /* + /* The enum in question: (t = @@ -2073,1246 +2172,1298 @@ export interface ServerBrowser { : '#ServerBrowser_NoFriendsServers' : 'BUGBUG'), */ - CreateServerListRequest( - appId: number, - queryType: ServerBrowserTab, - filters: string[], - serverCallback: (server: ServerBrowserServerFull) => void, - requestCompletedCallback: (response: number) => void, - ): Promise<number | OperationResponse>; - - /** - * Destroys the game info dialog functions (but not the window). - * @param {number} dialogId - The dialog ID to use. - * @returns {void} - * @remarks ServerBrowser.CancelServerQuery may throw if it tries to ping the server. - */ - DestroyGameInfoDialog(dialogId: number): void; + CreateServerListRequest( + appId: number, + queryType: ServerBrowserTab, + filters: string[], + serverCallback: (server: ServerBrowserServerFull) => void, + requestCompletedCallback: (response: number) => void, + ): Promise<number | OperationResponse>; + + /** + * Destroys the game info dialog functions (but not the window). + * @param {number} dialogId - The dialog ID to use. + * @returns {void} + * @remarks ServerBrowser.CancelServerQuery may throw if it tries to ping the server. + */ + DestroyGameInfoDialog(dialogId: number): void; - /** - * Stops retrieving the server list. - * @param {number} activeServerListRequestId - The active server request ID to use. - * @returns {void} - */ - DestroyServerListRequest(activeServerListRequestId: number): void; + /** + * Stops retrieving the server list. + * @param {number} activeServerListRequestId - The active server request ID to use. + * @returns {void} + */ + DestroyServerListRequest(activeServerListRequestId: number): void; - /** - * Gets a list of games that support the server browser feature. - * @returns {Promise<ServerBrowserGame[]>} A Promise that resolves to a list of games. - */ - GetMultiplayerGames(): Promise<ServerBrowserGame[]>; + /** + * Gets a list of games that support the server browser feature. + * @returns {Promise<ServerBrowserGame[]>} A Promise that resolves to a list of games. + */ + GetMultiplayerGames(): Promise<ServerBrowserGame[]>; - /** - * Gets the server browser preferences. - * @returns {Promise<ServerBrowserPreferences>} A Promise that resolves to server browser preferences. - */ - GetServerListPreferences(): Promise<ServerBrowserPreferences>; + /** + * Gets the server browser preferences. + * @returns {Promise<ServerBrowserPreferences>} A Promise that resolves to server browser preferences. + */ + GetServerListPreferences(): Promise<ServerBrowserPreferences>; - /** - * Pings the server of a specified dialog ID. - * @param {number} dialogId - The dialog ID to use. - * @returns {Promise<number | OperationResponse>} - */ - PingServer(dialogId: number): Promise<number | OperationResponse>; + /** + * Pings the server of a specified dialog ID. + * @param {number} dialogId - The dialog ID to use. + * @returns {Promise<number | OperationResponse>} + */ + PingServer(dialogId: number): Promise<number | OperationResponse>; - /** - * Registers a callback function to be called when a server gets added to favorite servers. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. - */ - RegisterForFavorites(callback: (list: ServerBrowserFavoritesAndHistory) => void): Unregisterable | any; + /** + * Registers a callback function to be called when a server gets added to favorite servers. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForFavorites(callback: (list: ServerBrowserFavoritesAndHistory) => void): Unregisterable | any; - /** - * Registers a callback function to be called when idk - * @param {number} dialogId - The dialog ID to use. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. - */ - RegisterForFriendGamePlayed( - dialogId: number, - callback: (server: ServerBrowserFriendServer) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a server info dialog opens. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. - */ - RegisterForGameInfoDialogs(callback: (dialogs: ServerBrowserDialog[]) => void): Unregisterable | any; + /** + * Registers a callback function to be called when idk + * @param {number} dialogId - The dialog ID to use. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForFriendGamePlayed( + dialogId: number, + callback: (server: ServerBrowserFriendServer) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a server info dialog opens. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForGameInfoDialogs(callback: (dialogs: ServerBrowserDialog[]) => void): Unregisterable | any; - /** - * Registers a callback function to be called when player details get requested. - * @param {number} dialogId - The dialog ID to use. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. - */ - RegisterForPlayerDetails( - dialogId: number, - callback: (player: ServerBrowserPlayer | ServerBrowserPlayerRefreshStatus) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a server gets pinged. - * @param {number} dialogId - The dialog ID to use. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. - */ - RegisterForServerInfo(dialogId: number, callback: (server: ServerBrowserServerFull) => void): Unregisterable | any; + /** + * Registers a callback function to be called when player details get requested. + * @param {number} dialogId - The dialog ID to use. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForPlayerDetails( + dialogId: number, + callback: (player: ServerBrowserPlayer | ServerBrowserPlayerRefreshStatus) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a server gets pinged. + * @param {number} dialogId - The dialog ID to use. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForServerInfo(dialogId: number, callback: (server: ServerBrowserServerFull) => void): Unregisterable | any; - /** - * Removes a server from favorite servers. - * @param {ServerBrowserServer} server - The server to remove. - * @returns {void} - */ - RemoveFavoriteServer(server: ServerBrowserServer): void; + /** + * Removes a server from favorite servers. + * @param {ServerBrowserServer} server - The server to remove. + * @returns {void} + */ + RemoveFavoriteServer(server: ServerBrowserServer): void; - /** - * Removes a server from history of played servers. - * @param {ServerBrowserServer} server - The server to remove. - * @returns {void} - */ - RemoveHistoryServer(server: ServerBrowserServer): void; + /** + * Removes a server from history of played servers. + * @param {ServerBrowserServer} server - The server to remove. + * @returns {void} + */ + RemoveHistoryServer(server: ServerBrowserServer): void; - /** - * Requests player details for a specific dialog. - * @param {number} dialogId - The dialog ID to use. - * @returns {Promise<number | OperationResponse>} - */ - RequestPlayerDetails(dialogId: number): Promise<number | OperationResponse>; + /** + * Requests player details for a specific dialog. + * @param {number} dialogId - The dialog ID to use. + * @returns {Promise<number | OperationResponse>} + */ + RequestPlayerDetails(dialogId: number): Promise<number | OperationResponse>; - /** - * Sets the server browser preferences. - * @param {ServerBrowserPreferences} prefs - Server list preferences. - * @returns {void} - */ - SetServerListPreferences(prefs: ServerBrowserPreferences): void; + /** + * Sets the server browser preferences. + * @param {ServerBrowserPreferences} prefs - Server list preferences. + * @returns {void} + */ + SetServerListPreferences(prefs: ServerBrowserPreferences): void; } export interface Settings { - AddClientBeta(param0: any, name: string): any; + AddClientBeta(param0: any, name: string): any; - /** - * Clears HTTP cache in `<STEAMPATH>/appcache/httpcache`. - * @returns {void} - */ - ClearAllHTTPCaches(): void; + /** + * Clears HTTP cache in `<STEAMPATH>/appcache/httpcache`. + * @returns {void} + */ + ClearAllHTTPCaches(): void; - /** - * Clears download cache and logs you out. - * @returns {void} - */ - ClearDownloadCache(): void; + /** + * Clears download cache and logs you out. + * @returns {void} + */ + ClearDownloadCache(): void; - GetAccountSettings(): Promise<AccountSettings>; + GetAccountSettings(): Promise<AccountSettings>; - GetAppUsesP2PVoice(appId: number): Promise<boolean>; + GetAppUsesP2PVoice(appId: number): Promise<boolean>; - GetAvailableLanguages(): Promise<Language[]>; + GetAvailableLanguages(): Promise<Language[]>; - GetAvailableTimeZones(): Promise<TimeZone[]>; + GetAvailableTimeZones(): Promise<TimeZone[]>; - // Returns the current language "english" - GetCurrentLanguage(): Promise<string>; + // Returns the current language "english" + GetCurrentLanguage(): Promise<string>; - GetGlobalCompatTools(): Promise<CompatibilityToolInfo[]>; + GetGlobalCompatTools(): Promise<CompatibilityToolInfo[]>; - GetMonitorInfo(): Promise<ArrayBuffer>; + GetMonitorInfo(): Promise<ArrayBuffer>; - GetOOBETestMode(): Promise<boolean>; + GetOOBETestMode(): Promise<boolean>; - GetRegisteredSteamDeck(): Promise<RegisteredSteamDeck>; + GetRegisteredSteamDeck(): Promise<RegisteredSteamDeck>; - // Returns the current timezone - GetTimeZone(): Promise<string>; + // Returns the current timezone + GetTimeZone(): Promise<string>; - GetWindowed(): Promise<boolean>; + GetWindowed(): Promise<boolean>; - IgnoreSteamDeckRewards(): void; + IgnoreSteamDeckRewards(): void; - /** - * Opens the Windows microphones dialog. - * @returns {void} - */ - OpenWindowsMicSettings(): void; + /** + * Opens the Windows microphones dialog. + * @returns {void} + */ + OpenWindowsMicSettings(): void; - RegisterForMicVolumeUpdates: Unregisterable | any; - RegisterForSettingsArrayChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterForMicVolumeUpdates: Unregisterable | any; - RegisterForSettingsChanges(callback: (steamSettings: SteamSettings) => void): Unregisterable | any; + RegisterForSettingsArrayChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - RegisterForTimeZoneChange(callback: (timezoneId: string) => void): Unregisterable | any; // When timezone is changed from settings, callback will return new timezoneId - ReinitMicSettings(): void; - RequestDeviceAuthInfo(): void; - // - SelectClientBeta(nBetaID: any): any; + RegisterForSettingsChanges(callback: (steamSettings: SteamSettings) => void): Unregisterable | any; - // Get from available languages - SetCurrentLanguage(strShortName: string): void; + RegisterForTimeZoneChange(callback: (timezoneId: string) => void): Unregisterable | any; // When timezone is changed from settings, callback will return new timezoneId + ReinitMicSettings(): void; - SetEnableSoftProcessKill(value: boolean): void; // Default value is false, this is Valve internal menu + RequestDeviceAuthInfo(): void; - SetHostname(hostname: string): void; - SetMicTestMode: any; + // + SelectClientBeta(nBetaID: any): any; - SetOOBETestMode(value: boolean): void; + // Get from available languages + SetCurrentLanguage(strShortName: string): void; - SetPreferredMonitor(monitor: string): void; - SetRegisteredSteamDeck: any; + SetEnableSoftProcessKill(value: boolean): void; // Default value is false, this is Valve internal menu - /** - * Sets the "Don't save account credentials on this computer" option. - * @param {boolean} value - Whether to save account credentials. - * @returns {void} - */ - SetSaveAccountCredentials(value: boolean): void; + SetHostname(hostname: string): void; + + SetMicTestMode: any; + + SetOOBETestMode(value: boolean): void; - SetSetting: any; - SetSteamPlayEnabled(value: boolean): void; + SetPreferredMonitor(monitor: string): void; - SetTimeZone(timezoneId: string): void; // You can get valid timezoneIds from GetAvailableTimeZones() - SetUseNintendoButtonLayout: any; - SetWindowed(value: boolean): void; + SetRegisteredSteamDeck: any; - SpecifyGlobalCompatTool(strToolName: string): void; + /** + * Sets the "Don't save account credentials on this computer" option. + * @param {boolean} value - Whether to save account credentials. + * @returns {void} + */ + SetSaveAccountCredentials(value: boolean): void; + + SetSetting: any; + + SetSteamPlayEnabled(value: boolean): void; + + SetTimeZone(timezoneId: string): void; // You can get valid timezoneIds from GetAvailableTimeZones() + SetUseNintendoButtonLayout: any; - // "{"result":2,"message":""}" - ToggleSteamInstall(): any; + SetWindowed(value: boolean): void; + + SpecifyGlobalCompatTool(strToolName: string): void; + + // "{"result":2,"message":""}" + ToggleSteamInstall(): any; } export interface SharedConnection { - // hSharedConnection is the number from AllocateSharedConnection() - AllocateSharedConnection(): Promise<number>; - // if no such number, sends this warning: - // src\clientdll\clientsharedconnection.cpp (154) : m_mapSharedConnections.HasElement( hSharedConnection ) - Close(hSharedConnection: number): void; - RegisterOnBinaryMessageReceived(hSharedConnection: number, callback: (param0: any) => void): Unregisterable | any; - RegisterOnLogonInfoChanged(hSharedConnection: number, callback: (info: LogonInfo) => void): Unregisterable | any; - RegisterOnMessageReceived(hSharedConnection: number, callback: (param0: any) => void): Unregisterable | any; - SendMsg: any; - SendMsgAndAwaitBinaryResponse: any; - SubscribeToClientServiceMethod(hSharedConnection: number, param1: any): any; - SubscribeToEMsg(hSharedConnection: number, param1: any): any; + // hSharedConnection is the number from AllocateSharedConnection() + AllocateSharedConnection(): Promise<number>; + + // if no such number, sends this warning: + // src\clientdll\clientsharedconnection.cpp (154) : m_mapSharedConnections.HasElement( hSharedConnection ) + Close(hSharedConnection: number): void; + + RegisterOnBinaryMessageReceived(hSharedConnection: number, callback: (param0: any) => void): Unregisterable | any; + + RegisterOnLogonInfoChanged(hSharedConnection: number, callback: (info: LogonInfo) => void): Unregisterable | any; + + RegisterOnMessageReceived(hSharedConnection: number, callback: (param0: any) => void): Unregisterable | any; + + SendMsg: any; + SendMsgAndAwaitBinaryResponse: any; + + SubscribeToClientServiceMethod(hSharedConnection: number, param1: any): any; + + SubscribeToEMsg(hSharedConnection: number, param1: any): any; } export interface Stats { - // param0 - AppDetailsReviewSection, Showcases, LibraryReviewSpotlight - // param1 - - // AppDetailsReviewSection: PositiveClicked, NegativeClicked, NeutralClicked, PositiveReviewPosted, NegativeReviewPosted, EditClicked, ReviewCanceled - // LibraryReviewSpotlight: ReviseClicked, PositiveClicked, ReviseCloseClicked, NegativeClicked, PositiveRevisePosted, NegativeRevisePosted, ReviseCanceled, ReviewCanceled, CloseClicked - // Showcases: Delete, Save-Modify, Save-New - RecordActivationEvent(param0: string, param1: string): any; - RecordDisplayEvent: any; + // param0 - AppDetailsReviewSection, Showcases, LibraryReviewSpotlight + // param1 - + // AppDetailsReviewSection: PositiveClicked, NegativeClicked, NeutralClicked, PositiveReviewPosted, NegativeReviewPosted, EditClicked, ReviewCanceled + // LibraryReviewSpotlight: ReviseClicked, PositiveClicked, ReviseCloseClicked, NegativeClicked, PositiveRevisePosted, NegativeRevisePosted, ReviseCanceled, ReviewCanceled, CloseClicked + // Showcases: Delete, Save-Modify, Save-New + RecordActivationEvent(param0: string, param1: string): any; + + RecordDisplayEvent: any; } export interface SteamChina { - GetCustomLauncherAppID: any; + GetCustomLauncherAppID: any; } export interface Storage { - DeleteKey: any; - GetJSON: any; - GetString: any; - SetObject: any; - SetString: any; + DeleteKey: any; + GetJSON: any; + GetString: any; + SetObject: any; + SetString: any; } export interface Streaming { - AcceptStreamingEULA: any; - CancelStreamGame(): void; // existing stream + AcceptStreamingEULA: any; - /** - * Registers a callback function to be called when the streaming client finishes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStreamingClientFinished(callback: (param0: number, description: string) => void): Unregisterable | any; + CancelStreamGame(): void; // existing stream - /** - * Registers a callback function to be called when there is progress in the launch of the streaming client. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStreamingClientLaunchProgress( - callback: (actionType: string, taskDetails: string, done: number, total: number) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when the streaming client is started (e.g., when clicking the stream button). - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStreamingClientStarted(callback: (appId: number) => void): Unregisterable | any; + /** + * Registers a callback function to be called when the streaming client finishes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingClientFinished(callback: (param0: number, description: string) => void): Unregisterable | any; - /** - * Registers a callback function to be called when the streaming launch is complete. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @todo `code` is likely a code, 1 being it started, 10 being host computer is updating game, `result` just returns "complete" - */ - RegisterForStreamingLaunchComplete(callback: (code: number, result: string) => void): Unregisterable | any; + /** + * Registers a callback function to be called when there is progress in the launch of the streaming client. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingClientLaunchProgress( + callback: (actionType: string, taskDetails: string, done: number, total: number) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when the streaming client is started (e.g., when clicking the stream button). + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingClientStarted(callback: (appId: number) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the streaming launch is complete. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @todo `code` is likely a code, 1 being it started, 10 being host computer is updating game, `result` just returns "complete" + */ + RegisterForStreamingLaunchComplete(callback: (code: number, result: string) => void): Unregisterable | any; - RegisterForStreamingShowEula: Unregisterable | any; - RegisterForStreamingShowIntro: Unregisterable | any; + RegisterForStreamingShowEula: Unregisterable | any; + RegisterForStreamingShowIntro: Unregisterable | any; - /** - * Registers a callback function to be called when the streaming client receives launch options from the host. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStreamingShowLaunchOptions( - callback: (appId: number, launchOptions: LaunchOption[]) => void, - ): Unregisterable | any; // Callback when streaming client receives launch options from host + /** + * Registers a callback function to be called when the streaming client receives launch options from the host. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingShowLaunchOptions( + callback: (appId: number, launchOptions: LaunchOption[]) => void, + ): Unregisterable | any; // Callback when streaming client receives launch options from host - StreamingContinueStreamGame(): void; // existing game running on another streaming capable device - StreamingSetLaunchOption: any; + StreamingContinueStreamGame(): void; // existing game running on another streaming capable device + StreamingSetLaunchOption: any; } /** * Represents various functions related to Steam system audio. */ export interface Audio { - /** - * Clears the default device override for a specified audio type. - * @param {number} audioType - The audio type (0 for input, 1 for output). - * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. - */ - ClearDefaultDeviceOverride(audioType: number): Promise<OperationResponse>; + /** + * Clears the default device override for a specified audio type. + * @param {number} audioType - The audio type (0 for input, 1 for output). + * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. + */ + ClearDefaultDeviceOverride(audioType: number): Promise<OperationResponse>; - /** - * Retrieves information about audio applications. - * @returns {Promise<ApplicationsAudio>} - A Promise that resolves to information about audio applications. - */ - GetApps(): Promise<ApplicationsAudio>; + /** + * Retrieves information about audio applications. + * @returns {Promise<ApplicationsAudio>} - A Promise that resolves to information about audio applications. + */ + GetApps(): Promise<ApplicationsAudio>; - /** - * Retrieves information about audio devices. - * @returns {Promise<AudioDeviceInfo>} - A Promise that resolves to information about audio devices. - */ - GetDevices(): Promise<AudioDeviceInfo>; + /** + * Retrieves information about audio devices. + * @returns {Promise<AudioDeviceInfo>} - A Promise that resolves to information about audio devices. + */ + GetDevices(): Promise<AudioDeviceInfo>; - /** - * Registers a callback to be called when a new audio application is added. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppAdded(callback: (appAudioAdded: ApplicationAudio) => void): Unregisterable | any; + /** + * Registers a callback to be called when a new audio application is added. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppAdded(callback: (appAudioAdded: ApplicationAudio) => void): Unregisterable | any; - /** - * Registers a callback to be called when an audio application is removed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppRemoved(callback: (appAudioId: number) => void): Unregisterable | any; + /** + * Registers a callback to be called when an audio application is removed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppRemoved(callback: (appAudioId: number) => void): Unregisterable | any; - /** - * Registers a callback to be called when the volume of an audio application changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppVolumeChanged(callback: (appAudioId: number, volume: number) => void): Unregisterable | any; + /** + * Registers a callback to be called when the volume of an audio application changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppVolumeChanged(callback: (appAudioId: number, volume: number) => void): Unregisterable | any; - /** - * Registers a callback to be called when a new audio device is added. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDeviceAdded(callback: (audioDevice: Device) => void): Unregisterable | any; + /** + * Registers a callback to be called when a new audio device is added. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceAdded(callback: (audioDevice: Device) => void): Unregisterable | any; - /** - * Registers a callback to be called when an audio device is removed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDeviceRemoved(callback: (audioDeviceId: number) => void): Unregisterable | any; + /** + * Registers a callback to be called when an audio device is removed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceRemoved(callback: (audioDeviceId: number) => void): Unregisterable | any; - /** - * Registers a callback to be called when the volume of an audio device changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDeviceVolumeChanged( - callback: (audioDeviceId: number, audioType: number, volume: number) => void, - ): Unregisterable | any; + /** + * Registers a callback to be called when the volume of an audio device changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceVolumeChanged( + callback: (audioDeviceId: number, audioType: number, volume: number) => void, + ): Unregisterable | any; - RegisterForServiceConnectionStateChanges: Unregisterable | any; + RegisterForServiceConnectionStateChanges: Unregisterable | any; - /** - * Registers a callback to be called when volume buttons are pressed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForVolumeButtonPressed(callback: (volumeUpPressed: boolean) => void): Unregisterable | any; + /** + * Registers a callback to be called when volume buttons are pressed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForVolumeButtonPressed(callback: (volumeUpPressed: boolean) => void): Unregisterable | any; - /** - * Sets the volume of an audio application. - * @param {number} appAudioId - The ID of the audio application. - * @param {number} volume - The volume level (floating point value between 0 and 1). - * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. - */ - SetAppVolume(appAudioId: number, volume: number): Promise<OperationResponse>; + /** + * Sets the volume of an audio application. + * @param {number} appAudioId - The ID of the audio application. + * @param {number} volume - The volume level (floating point value between 0 and 1). + * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. + */ + SetAppVolume(appAudioId: number, volume: number): Promise<OperationResponse>; - /** - * Sets the default device override for a specified audio type. - * @param {number} audioDeviceId - The ID of the audio device. - * @param {number} audioType - The audio type (0 for input, 1 for output). - * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. - */ - SetDefaultDeviceOverride(audioDeviceId: number, audioType: number): Promise<OperationResponse>; - - /** - * Sets the volume of an audio device. - * @param {number} audioDeviceId - The ID of the audio device. - * @param {number} audioType - The audio type (0 for input, 1 for output). - * @param {number} volume - The volume level (floating point value between 0 and 1). - * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. - */ - SetDeviceVolume(audioDeviceId: number, audioType: number, volume: number): Promise<OperationResponse>; + /** + * Sets the default device override for a specified audio type. + * @param {number} audioDeviceId - The ID of the audio device. + * @param {number} audioType - The audio type (0 for input, 1 for output). + * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. + */ + SetDefaultDeviceOverride(audioDeviceId: number, audioType: number): Promise<OperationResponse>; + + /** + * Sets the volume of an audio device. + * @param {number} audioDeviceId - The ID of the audio device. + * @param {number} audioType - The audio type (0 for input, 1 for output). + * @param {number} volume - The volume level (floating point value between 0 and 1). + * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. + */ + SetDeviceVolume(audioDeviceId: number, audioType: number, volume: number): Promise<OperationResponse>; } export interface AudioDevice { - RegisterForStateChanges: Unregisterable | any; - UpdateSomething: any; + RegisterForStateChanges: Unregisterable | any; + UpdateSomething: any; } /** * Provides functionality for managing Bluetooth devices and interactions. */ export interface Bluetooth { - /** - * Cancels an ongoing pairing request with a Bluetooth device. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the Bluetooth device to cancel pairing with. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the cancellation. - */ - CancelPairing(adapterId: number, deviceId: number): Promise<OperationResponse>; + /** + * Cancels an ongoing pairing request with a Bluetooth device. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the Bluetooth device to cancel pairing with. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the cancellation. + */ + CancelPairing(adapterId: number, deviceId: number): Promise<OperationResponse>; - /** - * Connects to a paired Bluetooth device using the specified adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the paired Bluetooth device to connect to. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the connection attempt. - */ - Connect(adapterId: number, deviceId: number): Promise<OperationResponse>; + /** + * Connects to a paired Bluetooth device using the specified adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the paired Bluetooth device to connect to. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the connection attempt. + */ + Connect(adapterId: number, deviceId: number): Promise<OperationResponse>; - /** - * Disconnects from a currently connected Bluetooth device using the specified adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the connected Bluetooth device to disconnect from. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the disconnection. - */ - Disconnect(adapterId: number, deviceId: number): Promise<OperationResponse>; + /** + * Disconnects from a currently connected Bluetooth device using the specified adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the connected Bluetooth device to disconnect from. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the disconnection. + */ + Disconnect(adapterId: number, deviceId: number): Promise<OperationResponse>; - /** - * Initiates pairing with a Bluetooth device using the specified adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the Bluetooth device to initiate pairing with. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the pairing attempt. - */ - Pair(adapterId: number, deviceId: number): Promise<OperationResponse>; + /** + * Initiates pairing with a Bluetooth device using the specified adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the Bluetooth device to initiate pairing with. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the pairing attempt. + */ + Pair(adapterId: number, deviceId: number): Promise<OperationResponse>; - /** - * Registers a callback function to be called when the Bluetooth state changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStateChanges(callback: (bluetoothStateChange: BluetoothStateChange) => void): Unregisterable | any; + /** + * Registers a callback function to be called when the Bluetooth state changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStateChanges(callback: (bluetoothStateChange: BluetoothStateChange) => void): Unregisterable | any; - /** - * Sets whether the Bluetooth adapter should be in discovering mode. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {boolean} value - `true` to enable discovering mode, `false` to disable it. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the operation. - */ - SetAdapterDiscovering(adapterId: number, value: boolean): Promise<OperationResponse>; + /** + * Sets whether the Bluetooth adapter should be in discovering mode. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {boolean} value - `true` to enable discovering mode, `false` to disable it. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the operation. + */ + SetAdapterDiscovering(adapterId: number, value: boolean): Promise<OperationResponse>; - /** - * Enables or disables Bluetooth functionality. - * @param {boolean} bluetooth - `true` to enable Bluetooth, `false` to disable it. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the operation. - */ - SetEnabled(bluetooth: boolean): Promise<OperationResponse>; + /** + * Enables or disables Bluetooth functionality. + * @param {boolean} bluetooth - `true` to enable Bluetooth, `false` to disable it. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the operation. + */ + SetEnabled(bluetooth: boolean): Promise<OperationResponse>; - /** - * Unpairs a Bluetooth device from the adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the Bluetooth device to unpair with. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the unpairing request. - */ - UnPair(adapterId: number, deviceId: number): Promise<OperationResponse>; + /** + * Unpairs a Bluetooth device from the adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the Bluetooth device to unpair with. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the unpairing request. + */ + UnPair(adapterId: number, deviceId: number): Promise<OperationResponse>; } export interface Devkit { - DeveloperModeChanged: any; - RegisterForPairingPrompt: Unregisterable | any; - RespondToPairingPrompt: any; - SetPairing: any; + DeveloperModeChanged: any; + RegisterForPairingPrompt: Unregisterable | any; + RespondToPairingPrompt: any; + SetPairing: any; } export interface Display { - EnableUnderscan(param0: boolean): any; + EnableUnderscan(param0: boolean): any; - RegisterForBrightnessChanges(callback: (brightnessChanges: BrightnessChange) => void): Unregisterable | any; + RegisterForBrightnessChanges(callback: (brightnessChanges: BrightnessChange) => void): Unregisterable | any; - SetBrightness(brightness: number): any; + SetBrightness(brightness: number): any; - SetUnderscanLevel(param0: any): any; + SetUnderscanLevel(param0: any): any; } // CMsgSystemDisplayManagerState, CMsgSystemDisplayManagerSetMode export interface DisplayManager { - ClearModeOverride(displayId: any): any; - GetState: any; - RegisterForStateChanges(callback: () => void): Unregisterable | any; - SetCompatibilityMode(displayId: any): any; - SetGamescopeInternalResolution(width: number, height: number): any; - SetMode(base64: string): any; // + ClearModeOverride(displayId: any): any; + + GetState: any; + + RegisterForStateChanges(callback: () => void): Unregisterable | any; + + SetCompatibilityMode(displayId: any): any; + + SetGamescopeInternalResolution(width: number, height: number): any; + + SetMode(base64: string): any; // } // CMsgSystemDockUpdateFirmware, CMsgSystemDockState export interface Dock { - DisarmSafetyNet(): void; + DisarmSafetyNet(): void; - RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; // Deserialize binary + RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; // Deserialize binary - UpdateFirmware(base64String: string): any; // serialize base64 string + UpdateFirmware(base64String: string): any; // serialize base64 string } export interface WirelessNetwork { - Forget: any; - SetAutoconnect: any; + Forget: any; + SetAutoconnect: any; } export interface NetworkDevice { - Connect(param0: any): any; // some base64 serialized string - Disconnect: any; - WirelessNetwork: WirelessNetwork; + Connect(param0: any): any; // some base64 serialized string + Disconnect: any; + WirelessNetwork: WirelessNetwork; } export interface Network { - Device: NetworkDevice; + Device: NetworkDevice; - ForceRefresh(): Promise<OperationResponse>; + ForceRefresh(): Promise<OperationResponse>; - ForceTestConnectivity(): void; + ForceTestConnectivity(): void; - GetProxyInfo(): Promise<ProxyInfo>; + GetProxyInfo(): Promise<ProxyInfo>; - RegisterForAppSummaryUpdate: Unregisterable | any; - RegisterForConnectionStateUpdate: Unregisterable | any; + RegisterForAppSummaryUpdate: Unregisterable | any; + RegisterForConnectionStateUpdate: Unregisterable | any; - RegisterForConnectivityTestChanges( - callback: (connectivityTestChange: ConnectivityTestChange) => void, - ): Unregisterable | any; + RegisterForConnectivityTestChanges( + callback: (connectivityTestChange: ConnectivityTestChange) => void, + ): Unregisterable | any; - RegisterForDeviceChanges(callback: (param0: any) => void): Unregisterable | any; + RegisterForDeviceChanges(callback: (param0: any) => void): Unregisterable | any; - SetFakeLocalSystemState(param0: any): any; // enums + SetFakeLocalSystemState(param0: any): any; // enums - SetProxyInfo(mode: number, address: string, port: number, excludeLocal: boolean): void; + SetProxyInfo(mode: number, address: string, port: number, excludeLocal: boolean): void; - SetWifiEnabled(value: boolean): Promise<OperationResponse>; + SetWifiEnabled(value: boolean): Promise<OperationResponse>; - StartScanningForNetworks(): Promise<OperationResponse>; + StartScanningForNetworks(): Promise<OperationResponse>; - StopScanningForNetworks(): Promise<OperationResponse>; + StopScanningForNetworks(): Promise<OperationResponse>; } // CMsgSystemPerfUpdateSettings, CMsgSystemPerfState, CMsgSystemPerfSettings export interface Perf { - RegisterForDiagnosticInfoChanges(callback: (param0: any) => void): Unregisterable | any; // deserialize binary - RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; // deserialize binary - UpdateSettings(base64: string): any; // serialize + RegisterForDiagnosticInfoChanges(callback: (param0: any) => void): Unregisterable | any; // deserialize binary + RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; // deserialize binary + UpdateSettings(base64: string): any; // serialize } // CMsgGenerateSystemReportReply export interface Report { - GenerateSystemReport: any; - SaveToDesktop: any; - Submit: any; + GenerateSystemReport: any; + SaveToDesktop: any; + Submit: any; } export interface SystemUI { - CloseGameWindow(appId: number, windowId: number): void; - GetGameWindowsInfo(appId: number, windowIds: number[]): Promise<GameWindowInfo>; - RegisterForFocusChangeEvents(callback: (event: FocusChangeEvent) => void): Unregisterable | any; - RegisterForOverlayGameWindowFocusChanged(callback: (param0: number, param1: number) => void): Unregisterable | any; - RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable | any; // eKey + CloseGameWindow(appId: number, windowId: number): void; + + GetGameWindowsInfo(appId: number, windowIds: number[]): Promise<GameWindowInfo>; + + RegisterForFocusChangeEvents(callback: (event: FocusChangeEvent) => void): Unregisterable | any; + + RegisterForOverlayGameWindowFocusChanged(callback: (param0: number, param1: number) => void): Unregisterable | any; + + RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable | any; // eKey } export interface System { - Audio: Audio; - AudioDevice: AudioDevice; - Bluetooth: Bluetooth; - Devkit: Devkit; - Display: Display; - DisplayManager: DisplayManager; - Dock: Dock; - ExitFakeCaptivePortal(): any; - FactoryReset(): any; - FormatStorage(forceFormat: boolean): any; + Audio: Audio; + AudioDevice: AudioDevice; + Bluetooth: Bluetooth; + Devkit: Devkit; + Display: Display; + DisplayManager: DisplayManager; + Dock: Dock; - GetLegacyAmpControlEnabled(): Promise<any>; // {"bAvailable":true,"bEnabled":false} + ExitFakeCaptivePortal(): any; - GetOSType(): Promise<OSType>; + FactoryReset(): any; - GetSystemInfo(): Promise<SystemInfo>; + FormatStorage(forceFormat: boolean): any; - IsDeckFactoryImage(): Promise<boolean>; + GetLegacyAmpControlEnabled(): Promise<any>; // {"bAvailable":true,"bEnabled":false} - IsSteamInTournamentMode(): Promise<boolean>; + GetOSType(): Promise<OSType>; - Network: Network; - NotifyGameOverlayStateChanged(latestAppOverlayStateActive: boolean, appId: number): any; + GetSystemInfo(): Promise<SystemInfo>; - /** - * Open a dialog for choosing a file. - * @param {FileDialog} prefs - Dialog preferences. - * @returns {Promise<string>} A Promise that resolves to the selected file name. - * @throws Throws if no file was selected. - */ - OpenFileDialog(prefs: FileDialog): Promise<string | OperationResponse>; + IsDeckFactoryImage(): Promise<boolean>; - /** - * Open a URL in the default web browser. - * @returns {void} - */ - OpenInSystemBrowser(url: string): void; + IsSteamInTournamentMode(): Promise<boolean>; + + Network: Network; + + NotifyGameOverlayStateChanged(latestAppOverlayStateActive: boolean, appId: number): any; - OpenLocalDirectoryInSystemExplorer(directory: string): void; // Opens local directory in system explorer - Perf: Perf; - RebootToAlternateSystemPartition: any; - RebootToFactoryTestImage: any; + /** + * Open a dialog for choosing a file. + * @param {FileDialog} prefs - Dialog preferences. + * @returns {Promise<string>} A Promise that resolves to the selected file name. + * @throws Throws if no file was selected. + */ + OpenFileDialog(prefs: FileDialog): Promise<string | OperationResponse>; + + /** + * Open a URL in the default web browser. + * @returns {void} + */ + OpenInSystemBrowser(url: string): void; - RegisterForAirplaneModeChanges(callback: (airplaneModeChange: AirplaneModeChange) => void): Unregisterable | any; + OpenLocalDirectoryInSystemExplorer(directory: string): void; // Opens local directory in system explorer + Perf: Perf; + RebootToAlternateSystemPartition: any; + RebootToFactoryTestImage: any; - RegisterForBatteryStateChanges(callback: (batteryStateChange: BatteryStateChange) => void): Unregisterable | any; + RegisterForAirplaneModeChanges(callback: (airplaneModeChange: AirplaneModeChange) => void): Unregisterable | any; - RegisterForFormatStorageProgress(callback: () => void): Unregisterable | any; // {"flProgress":0,"rtEstimatedCompletionTime":0,"eStage":1} + RegisterForBatteryStateChanges(callback: (batteryStateChange: BatteryStateChange) => void): Unregisterable | any; - RegisterForOnResumeFromSuspend(callback: () => void): Unregisterable | any; + RegisterForFormatStorageProgress(callback: () => void): Unregisterable | any; // {"flProgress":0,"rtEstimatedCompletionTime":0,"eStage":1} - RegisterForOnSuspendRequest(callback: () => void): Unregisterable | any; + RegisterForOnResumeFromSuspend(callback: () => void): Unregisterable | any; - RegisterForSettingsChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; // deserialize binary - Report: Report; + RegisterForOnSuspendRequest(callback: () => void): Unregisterable | any; - /** - * Restarts the system. - */ - RestartPC(): any; + RegisterForSettingsChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; // deserialize binary + Report: Report; - SetAirplaneMode(value: boolean): void; + /** + * Restarts the system. + */ + RestartPC(): any; - SetLegacyAmpControl: any; + SetAirplaneMode(value: boolean): void; - ShutdownPC(): any; + SetLegacyAmpControl: any; - SteamRuntimeSystemInfo(): Promise<string>; + ShutdownPC(): any; - /** - * Suspends the system. - */ - SuspendPC(): any; + SteamRuntimeSystemInfo(): Promise<string>; - /** - * Switches to desktop mode. - */ - SwitchToDesktop(): any; + /** + * Suspends the system. + */ + SuspendPC(): any; - UI: SystemUI; - UpdateSettings: any; + /** + * Switches to desktop mode. + */ + SwitchToDesktop(): any; + + UI: SystemUI; + UpdateSettings: any; } export interface UI { - EnsureMainWindowCreated(): void; - ExitBigPictureMode(): void; + EnsureMainWindowCreated(): void; - GetDesiredSteamUIWindows(): Promise<SteamWindow[]>; + ExitBigPictureMode(): void; - /** - * Gets information about whether your OS will be unsupported in the future or not. - * @returns {Promise<OSEndOfLifeInfo>} - */ - GetOSEndOfLifeInfo(): Promise<OSEndOfLifeInfo>; + GetDesiredSteamUIWindows(): Promise<SteamWindow[]>; - /** - * Retrieves the current UI mode. - * @returns {Promise<UIMode>} - A Promise that resolves to the current UI mode. - */ - GetUIMode(): Promise<UIMode>; - - NotifyAppInitialized(): void; - RegisterDesiredSteamUIWindowsChanged: Unregisterable | any; - RegisterForErrorCondition(callback: (param0: number, param1: number) => void): Unregisterable | any; - RegisterForKioskModeResetSignal: Unregisterable | any; - RegisterForUIModeChanged(callback: (mode: UIMode) => void): Unregisterable | any; - ResetErrorCondition(): void; - - /** - * Sets the UI mode to the specified value. - * @param {UIMode} mode - The UI mode to set. - * @returns {void} - */ - SetUIMode(mode: UIMode): void; + /** + * Gets information about whether your OS will be unsupported in the future or not. + * @returns {Promise<OSEndOfLifeInfo>} + */ + GetOSEndOfLifeInfo(): Promise<OSEndOfLifeInfo>; + + /** + * Retrieves the current UI mode. + * @returns {Promise<UIMode>} - A Promise that resolves to the current UI mode. + */ + GetUIMode(): Promise<UIMode>; + + NotifyAppInitialized(): void; + + RegisterDesiredSteamUIWindowsChanged: Unregisterable | any; + + RegisterForErrorCondition(callback: (param0: number, param1: number) => void): Unregisterable | any; + + RegisterForKioskModeResetSignal: Unregisterable | any; + + RegisterForUIModeChanged(callback: (mode: UIMode) => void): Unregisterable | any; + + ResetErrorCondition(): void; + + /** + * Sets the UI mode to the specified value. + * @param {UIMode} mode - The UI mode to set. + * @returns {void} + */ + SetUIMode(mode: UIMode): void; } export interface URL { - /** - * Executes a steam:// URL. - * @param url The URL to execute. - */ - ExecuteSteamURL(url: string): void; + /** + * Executes a steam:// URL. + * @param url The URL to execute. + */ + ExecuteSteamURL(url: string): void; - /** - * @remarks The array may be empty. - */ - GetSteamURLList(param0: string[]): Promise<SteamURLs>; + /** + * @remarks The array may be empty. + */ + GetSteamURLList(param0: string[]): Promise<SteamURLs>; - GetWebSessionID(): Promise<string>; + GetWebSessionID(): Promise<string>; - /** - * Registers a callback to be called when a steam:// URL gets executed. - * @param {string} section - `rungameid`, `open`, etc. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForRunSteamURL(section: string, callback: (param0: number, url: string) => void): Unregisterable | any; + /** + * Registers a callback to be called when a steam:// URL gets executed. + * @param {string} section - `rungameid`, `open`, etc. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForRunSteamURL(section: string, callback: (param0: number, url: string) => void): Unregisterable | any; - RegisterForSteamURLChanges(callback: () => void): void; + RegisterForSteamURLChanges(callback: () => void): void; } export interface Updates { - ApplyUpdates(param0: string): Promise<OperationResponse>; + ApplyUpdates(param0: string): Promise<OperationResponse>; - CheckForUpdates(): Promise<OperationResponse>; // Checks for software updates + CheckForUpdates(): Promise<OperationResponse>; // Checks for software updates - GetCurrentOSBranch(): Promise<OSBranch>; + GetCurrentOSBranch(): Promise<OSBranch>; - RegisterForUpdateStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterForUpdateStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - // 1 - Stable, 2 - Beta, 3 - Preview - SelectOSBranch(branch: number): any; // enum? + // 1 - Stable, 2 - Beta, 3 - Preview + SelectOSBranch(branch: number): any; // enum? } export interface User { - AuthorizeMicrotxn(txnId: any): any; - CancelLogin: any; - CancelMicrotxn(txnId: any): any; - - /** - * Tries to cancel Steam shutdown. - * @returns {void} - * @remarks Used in the "Shutting down" dialog. - */ - CancelShutdown(): void; + AuthorizeMicrotxn(txnId: any): any; - /** - * Opens the "Change Account" dialog. - * @returns {void} - */ - ChangeUser(): void; + CancelLogin: any; - Connect(): Promise<OperationResponse>; + CancelMicrotxn(txnId: any): any; - FlipToLogin(): void; + /** + * Tries to cancel Steam shutdown. + * @returns {void} + * @remarks Used in the "Shutting down" dialog. + */ + CancelShutdown(): void; - /** - * Forces a shutdown while shutting down. - * @returns {void} - * @remarks Used in the "Shutting down" dialog. - */ - ForceShutdown(): void; + /** + * Opens the "Change Account" dialog. + * @returns {void} + */ + ChangeUser(): void; - /** - * Forgets an account's password. - * @param {string} accountName - Login of the account to forget. - * @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the operation succeeded or not. - */ - ForgetPassword(accountName: string): Promise<boolean>; + Connect(): Promise<OperationResponse>; - /** - * Gets your country code. - * @returns {Promise<string>} A Promise that resolves to a string containing your country code. - */ - GetIPCountry(): Promise<string>; + FlipToLogin(): void; + + /** + * Forces a shutdown while shutting down. + * @returns {void} + * @remarks Used in the "Shutting down" dialog. + */ + ForceShutdown(): void; + + /** + * Forgets an account's password. + * @param {string} accountName - Login of the account to forget. + * @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the operation succeeded or not. + */ + ForgetPassword(accountName: string): Promise<boolean>; - GetLoginProgress(callback: (param0: number, param1: number) => void): Unregisterable | any; + /** + * Gets your country code. + * @returns {Promise<string>} A Promise that resolves to a string containing your country code. + */ + GetIPCountry(): Promise<string>; - GetLoginUsers(): Promise<LoginUser[]>; + GetLoginProgress(callback: (param0: number, param1: number) => void): Unregisterable | any; - GoOffline(): void; + GetLoginUsers(): Promise<LoginUser[]>; - GoOnline(): void; + GoOffline(): void; - OptOutOfSurvey(): void; - PrepareForSystemSuspend(): any; - Reconnect(): void; + GoOnline(): void; - RegisterForConnectionAttemptsThrottled(callback: (param0: any) => void): Unregisterable | any; + OptOutOfSurvey(): void; - RegisterForCurrentUserChanges(callback: (data: any) => void): Unregisterable | any; + PrepareForSystemSuspend(): any; - RegisterForLoginStateChange(callback: (username: string) => void): Unregisterable | any; + Reconnect(): void; - RegisterForPrepareForSystemSuspendProgress(callback: (data: any) => void): Unregisterable | any; + RegisterForConnectionAttemptsThrottled(callback: (param0: any) => void): Unregisterable | any; - RegisterForResumeSuspendedGamesProgress: Unregisterable | any; + RegisterForCurrentUserChanges(callback: (data: any) => void): Unregisterable | any; - RegisterForShutdownDone(callback: () => void): Unregisterable | any; + RegisterForLoginStateChange(callback: (username: string) => void): Unregisterable | any; - RegisterForShutdownFailed: Unregisterable | any; + RegisterForPrepareForSystemSuspendProgress(callback: (data: any) => void): Unregisterable | any; - /** - * Register a function to be executed when a shutdown start is detected. - * @param callback The function to be executed on shutdown start. - */ - RegisterForShutdownStart(callback: () => void): Unregisterable | any; + RegisterForResumeSuspendedGamesProgress: Unregisterable | any; - RegisterForShutdownState: Unregisterable | any; + RegisterForShutdownDone(callback: () => void): Unregisterable | any; - /** - * Removes an account from remembered users. - * @param {string} accountName - The account to remove. - * @returns {void} - */ - RemoveUser(accountName: string): void; + RegisterForShutdownFailed: Unregisterable | any; - RequestSupportSystemReport: any; - ResumeSuspendedGames(param0: boolean): any; + /** + * Register a function to be executed when a shutdown start is detected. + * @param callback The function to be executed on shutdown start. + */ + RegisterForShutdownStart(callback: () => void): Unregisterable | any; - // Hardware survey information - RunSurvey(callback: (surveySections: SurveySection[]) => void): void; + RegisterForShutdownState: Unregisterable | any; - SendSurvey: any; - SetAsyncNotificationEnabled(appId: number, enable: boolean): any; + /** + * Removes an account from remembered users. + * @param {string} accountName - The account to remove. + * @returns {void} + */ + RemoveUser(accountName: string): void; - /** - * Sets given login credentials, but don't log in to that account. - * @param {string} accountName - Account name. - * @param {string} password - Account password. - * @param {boolean} rememberMe - Whether to remember that account. - * @returns {void} - */ - SetLoginCredentials(accountName: string, password: string, rememberMe: boolean): void; + RequestSupportSystemReport: any; - SetOOBEComplete(): void; - ShouldShowUserChooser(): Promise<boolean>; + ResumeSuspendedGames(param0: boolean): any; - /** - * Signs out and restarts Steam. - * @returnsn {void} - */ - SignOutAndRestart(): void; + // Hardware survey information + RunSurvey(callback: (surveySections: SurveySection[]) => void): void; - StartLogin(): void; + SendSurvey: any; - // is param0 offline mode? - StartOffline(param0: boolean): any; + SetAsyncNotificationEnabled(appId: number, enable: boolean): any; - /** - * Restarts the Steam client. - */ - StartRestart(): any; + /** + * Sets given login credentials, but don't log in to that account. + * @param {string} accountName - Account name. + * @param {string} password - Account password. + * @param {boolean} rememberMe - Whether to remember that account. + * @returns {void} + */ + SetLoginCredentials(accountName: string, password: string, rememberMe: boolean): void; + + SetOOBEComplete(): void; + + ShouldShowUserChooser(): Promise<boolean>; + + /** + * Signs out and restarts Steam. + * @returnsn {void} + */ + SignOutAndRestart(): void; + + StartLogin(): void; + + // is param0 offline mode? + StartOffline(param0: boolean): any; - StartShutdown(flag: boolean): any; + /** + * Restarts the Steam client. + */ + StartRestart(): any; + + StartShutdown(flag: boolean): any; } export interface WebChat { - BSuppressPopupsInRestore(): Promise<boolean>; + BSuppressPopupsInRestore(): Promise<boolean>; - /** - * Gets your Steam3 ID. - * @returns {Promise<number>} A Promise that resolves to a Steam3 ID. - */ - GetCurrentUserAccountID(): Promise<number>; + /** + * Gets your Steam3 ID. + * @returns {Promise<number>} A Promise that resolves to a Steam3 ID. + */ + GetCurrentUserAccountID(): Promise<number>; - /** - * Gets the current user's 64x64 avatar as a data URL. - * @returns {Promise<string>} A Promise that resolves to the data URL. - */ - GetLocalAvatarBase64(): Promise<string>; + /** + * Gets the current user's 64x64 avatar as a data URL. + * @returns {Promise<string>} A Promise that resolves to the data URL. + */ + GetLocalAvatarBase64(): Promise<string>; - /** - * Gets the current user's nickname. - * @returns {Promise<string>} A Promise that resolves to the nickname. - */ - GetLocalPersonaName(): Promise<string>; + /** + * Gets the current user's nickname. + * @returns {Promise<string>} A Promise that resolves to the nickname. + */ + GetLocalPersonaName(): Promise<string>; - GetOverlayChatBrowserInfo(): Promise<any[]>; + GetOverlayChatBrowserInfo(): Promise<any[]>; - // param0 - appid ? - GetPrivateConnectString(param0: number): Promise<string>; + // param0 - appid ? + GetPrivateConnectString(param0: number): Promise<string>; - /** - * Gets information about push-to-Talk. - * @returns {Promise<PushToTalkInfo>} - */ - GetPushToTalkEnabled(): Promise<PushToTalkInfo>; + /** + * Gets information about push-to-Talk. + * @returns {Promise<PushToTalkInfo>} + */ + GetPushToTalkEnabled(): Promise<PushToTalkInfo>; - /** - * Gets the "Sign in to friends when Steam starts" option value. - * @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the option is enabled or not. - */ - GetSignIntoFriendsOnStart(): Promise<boolean>; + /** + * Gets the "Sign in to friends when Steam starts" option value. + * @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the option is enabled or not. + */ + GetSignIntoFriendsOnStart(): Promise<boolean>; - /** - * Retrieves the current UI mode. - * @returns {Promise<UIMode>} - A Promise that resolves to the current UI mode. - */ - GetUIMode(): Promise<UIMode>; - - OnGroupChatUserStateChange(chatGroupId: any, accountId: any, param2: any): any; - - OnNewGroupChatMsgAdded( - groupId: number, - chatId: number, - accountId: number, - timestamp: number, - param4: number, - message: string, - ): any; - - // Opens the URL in default web browser, despite what the name says ? - OpenURLInClient(url: string, pid: number, forceExternal: boolean): void; - - /** - * Registers a callback function to be called when the computer's active state changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @todo Changes to 2 after 10 seconds? - * @todo Does not affect the keyboard? - */ - RegisterForComputerActiveStateChange( - callback: (state: ComputerActiveState, time: number) => void, - ): Unregisterable | any; + /** + * Retrieves the current UI mode. + * @returns {Promise<UIMode>} - A Promise that resolves to the current UI mode. + */ + GetUIMode(): Promise<UIMode>; + + OnGroupChatUserStateChange(chatGroupId: any, accountId: any, param2: any): any; + + OnNewGroupChatMsgAdded( + groupId: number, + chatId: number, + accountId: number, + timestamp: number, + param4: number, + message: string, + ): any; + + // Opens the URL in default web browser, despite what the name says ? + OpenURLInClient(url: string, pid: number, forceExternal: boolean): void; + + /** + * Registers a callback function to be called when the computer's active state changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @todo Changes to 2 after 10 seconds? + * @todo Does not affect the keyboard? + */ + RegisterForComputerActiveStateChange( + callback: (state: ComputerActiveState, time: number) => void, + ): Unregisterable | any; - /** - * @todo WebChat.ShowFriendChatDialog does this. - */ - RegisterForFriendPostMessage(callback: (data: FriendChatDialogData) => void): Unregisterable | any; + /** + * @todo WebChat.ShowFriendChatDialog does this. + */ + RegisterForFriendPostMessage(callback: (data: FriendChatDialogData) => void): Unregisterable | any; - /** - * @returns {void} - * @todo To unregister, use WebChat.UnregisterForMouseXButtonDown() ? - */ - RegisterForMouseXButtonDown(callback: any): void; + /** + * @returns {void} + * @todo To unregister, use WebChat.UnregisterForMouseXButtonDown() ? + */ + RegisterForMouseXButtonDown(callback: any): void; - /** - * Registers a callback function to be called when the push-to-talk state changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForPushToTalkStateChange(callback: (state: boolean) => void): Unregisterable | any; + /** + * Registers a callback function to be called when the push-to-talk state changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForPushToTalkStateChange(callback: (state: boolean) => void): Unregisterable | any; - /** - * Registers a callback function to be called when the UI mode is changed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForUIModeChange(callback: (mode: UIMode) => void): Unregisterable | any; - - RegisterOverlayChatBrowserInfoChanged(callback: any): Unregisterable | any; - SetActiveClanChatIDs(param0: any[]): any; - SetNumChatsWithUnreadPriorityMessages(param0: number): void; - SetPersonaName: any; - SetPushToMuteEnabled(value: boolean): any; - SetPushToTalkEnabled(value: boolean): any; - SetPushToTalkHotKey(param0: number): void; - SetPushToTalkMouseButton(param0: number): void; - SetVoiceChatActive: any; - SetVoiceChatStatus: any; - ShowChatRoomGroupDialog: any; - - /** - * @todo Does not actually show the dialog. - */ - ShowFriendChatDialog(steamid: string): void; + /** + * Registers a callback function to be called when the UI mode is changed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForUIModeChange(callback: (mode: UIMode) => void): Unregisterable | any; + + RegisterOverlayChatBrowserInfoChanged(callback: any): Unregisterable | any; + + SetActiveClanChatIDs(param0: any[]): any; + + SetNumChatsWithUnreadPriorityMessages(param0: number): void; + + SetPersonaName: any; + + SetPushToMuteEnabled(value: boolean): any; + + SetPushToTalkEnabled(value: boolean): any; + + SetPushToTalkHotKey(param0: number): void; - UnregisterForMouseXButtonDown(): void; + SetPushToTalkMouseButton(param0: number): void; + + SetVoiceChatActive: any; + SetVoiceChatStatus: any; + ShowChatRoomGroupDialog: any; + + /** + * @todo Does not actually show the dialog. + */ + ShowFriendChatDialog(steamid: string): void; + + UnregisterForMouseXButtonDown(): void; } export interface WebUITransport { - GetTransportInfo(): Promise<TransportInfo>; + GetTransportInfo(): Promise<TransportInfo>; } /** * Represents functionality for managing Steam's windows. */ export interface Window { - BringToFront(forceOS: WindowBringToFront | undefined): any; + BringToFront(forceOS: WindowBringToFront | undefined): any; - /** - * @todo Shuts down Steam too? - */ - Close(): any; + /** + * @todo Shuts down Steam too? + */ + Close(): any; - /** - * Is the Steam window fullscreen? - * @param {function} callback - The callback function to be called to receive the fullscreen state. - * @returns {void} - */ - DefaultMonitorHasFullscreenWindow(callback: (fullscreen: boolean) => void): void; + /** + * Is the Steam window fullscreen? + * @param {function} callback - The callback function to be called to receive the fullscreen state. + * @returns {void} + */ + DefaultMonitorHasFullscreenWindow(callback: (fullscreen: boolean) => void): void; - /** - * Flashes the window in the taskbar. - * @returns {void} - */ - FlashWindow(): void; + /** + * Flashes the window in the taskbar. + * @returns {void} + */ + FlashWindow(): void; - /** - * @todo Returns 0? - */ - GetDefaultMonitorDimensions(callback: (param0: number) => void): void; + /** + * @todo Returns 0? + */ + GetDefaultMonitorDimensions(callback: (param0: number) => void): void; - GetMousePositionDetails(callback: (details: string) => void): void; + GetMousePositionDetails(callback: (details: string) => void): void; - /** - * Gets the window X position. - * @param {function} callback - The callback function to be called to receive the X position. - * @returns {void} - */ - GetWindowDimensions(callback: (x: number) => void): void; + /** + * Gets the window X position. + * @param {function} callback - The callback function to be called to receive the X position. + * @returns {void} + */ + GetWindowDimensions(callback: (x: number) => void): void; + + GetWindowRestoreDetails(callback: (details: string) => void): void; + + /** + * Hides the window. + * @returns {void} + */ + HideWindow(): void; - GetWindowRestoreDetails(callback: (details: string) => void): void; + /** + * Is the window maximized? + * @param {function} callback - The callback function to be called to receive the maximized state. + * @returns {void} + */ + IsWindowMaximized(callback: (maximized: boolean) => void): void; - /** - * Hides the window. - * @returns {void} - */ - HideWindow(): void; + /** + * Is the window minimized? + * @param {function} callback - The callback function to be called to receive the minimized state. + * @returns {void} + */ + IsWindowMinimized(callback: (minimized: boolean) => void): void; - /** - * Is the window maximized? - * @param {function} callback - The callback function to be called to receive the maximized state. - * @returns {void} - */ - IsWindowMaximized(callback: (maximized: boolean) => void): void; + MarkLastFocused(): void; - /** - * Is the window minimized? - * @param {function} callback - The callback function to be called to receive the minimized state. - * @returns {void} - */ - IsWindowMinimized(callback: (minimized: boolean) => void): void; + /** + * Minimizes the window. + * @returns {void} + */ + Minimize(): void; + + /** + * Moves the window to given coordinates. + * @param {number} x - Window X position. + * @param {number} y - Window Y position. + * @param {number | undefined} dpi - Screen DPI. + * @returns {void} + */ + MoveTo(x: number, y: number, dpi: number | undefined): void; - MarkLastFocused(): void; + /** + * Moves the window to a given location. + * @param {string} location - Window location. + * @param {number | undefined} offset - X/Y offset. + * @returns {void} + */ + MoveToLocation(location: WindowLocation, offset: number | undefined): void; + + /** + * Moves the window relatively to given details. + * @param {string} details - Window details string from `Window.GetWindowRestoreDetails`. + * @param {number} x - Window X position. + * @param {number} y - Window Y position. + * @param {number} width - Window width. + * @param {number} height - Window height. + * @returns {void} + * + * @example + * Move the window to bottom right by 50 pixels: + * ``` + * SteamClient.Window.GetWindowRestoreDetails(e => { + * SteamClient.Window.PositionWindowRelative(e, 50, 50, 0, 0); + * }) + * ``` + */ + PositionWindowRelative(details: string, x: number, y: number, width: number, height: number): void; - /** - * Minimizes the window. - * @returns {void} - */ - Minimize(): void; - - /** - * Moves the window to given coordinates. - * @param {number} x - Window X position. - * @param {number} y - Window Y position. - * @param {number | undefined} dpi - Screen DPI. - * @returns {void} - */ - MoveTo(x: number, y: number, dpi: number | undefined): void; + ProcessShuttingDown(): Promise<boolean>; - /** - * Moves the window to a given location. - * @param {string} location - Window location. - * @param {number | undefined} offset - X/Y offset. - * @returns {void} - */ - MoveToLocation(location: WindowLocation, offset: number | undefined): void; - - /** - * Moves the window relatively to given details. - * @param {string} details - Window details string from `Window.GetWindowRestoreDetails`. - * @param {number} x - Window X position. - * @param {number} y - Window Y position. - * @param {number} width - Window width. - * @param {number} height - Window height. - * @returns {void} - * - * @example - * Move the window to bottom right by 50 pixels: - * ``` - * SteamClient.Window.GetWindowRestoreDetails(e => { - * SteamClient.Window.PositionWindowRelative(e, 50, 50, 0, 0); - * }) - * ``` - */ - PositionWindowRelative(details: string, x: number, y: number, width: number, height: number): void; + /** + * Resizes the window to given dimension. + * @param {number} width - Window width. + * @param {number} height - Window height. + * @param {boolean | number} applyBrowserScaleOrDPIValue + * @returns {void} + */ + ResizeTo(width: number, height: number, applyBrowserScaleOrDPIValue: boolean | number): void; - ProcessShuttingDown(): Promise<boolean>; + /** + * Moves the window to given details. + * @param {string} details - Window details string from `Window.GetWindowRestoreDetails`. + * @returns {void} + */ + RestoreWindowSizeAndPosition(details: string): void; - /** - * Resizes the window to given dimension. - * @param {number} width - Window width. - * @param {number} height - Window height. - * @param {boolean | number} applyBrowserScaleOrDPIValue - * @returns {void} - */ - ResizeTo(width: number, height: number, applyBrowserScaleOrDPIValue: boolean | number): void; + SetAutoDisplayScale(value: boolean): void; - /** - * Moves the window to given details. - * @param {string} details - Window details string from `Window.GetWindowRestoreDetails`. - * @returns {void} - */ - RestoreWindowSizeAndPosition(details: string): void; + SetComposition(uiComposition: UIComposition, appIds: number[], windowId: number): any; - SetAutoDisplayScale(value: boolean): void; - SetComposition(uiComposition: UIComposition, appIds: number[], windowId: number): any; + /** + * Makes the window hide, but not close on pressing the close button. + * @param {boolean} value - Hide on close? + * @returns {void} + */ + SetHideOnClose(value: boolean): void; - /** - * Makes the window hide, but not close on pressing the close button. - * @param {boolean} value - Hide on close? - * @returns {void} - */ - SetHideOnClose(value: boolean): void; + SetKeyFocus(value: boolean): void; - SetKeyFocus(value: boolean): void; - SetManualDisplayScaleFactor(displayScaleFactor: number): void; + SetManualDisplayScaleFactor(displayScaleFactor: number): void; - /** - * Sets the window's max size. - * @param {number} width - Window's max width. - * @param {number} height - Window's max height. - * @returns {void} - */ - SetMaxSize(width: number, height: number): void; + /** + * Sets the window's max size. + * @param {number} width - Window's max width. + * @param {number} height - Window's max height. + * @returns {void} + */ + SetMaxSize(width: number, height: number): void; - /** - * Sets the window's min size. - * @param {number} width - Window's max width. - * @param {number} height - Window's max height. - * @returns {void} - */ - SetMinSize(width: number, height: number): void; + /** + * Sets the window's min size. + * @param {number} width - Window's max width. + * @param {number} height - Window's max height. + * @returns {void} + */ + SetMinSize(width: number, height: number): void; - SetModal(value: boolean): void; + SetModal(value: boolean): void; - /** - * Sets the window's resize grip size. - * @param {number} width - Resize grip width. - * @param {number} height - Resize grip height. - * @returns {void} - */ - SetResizeGrip(width: number, height: number): void; + /** + * Sets the window's resize grip size. + * @param {number} width - Resize grip width. + * @param {number} height - Resize grip height. + * @returns {void} + */ + SetResizeGrip(width: number, height: number): void; - /** - * Set the window's icon. - * @param {WindowIcon} icon - The window icon to be used. - * @returns {void} - */ - SetWindowIcon(icon: WindowIcon): void; + /** + * Set the window's icon. + * @param {WindowIcon} icon - The window icon to be used. + * @returns {void} + */ + SetWindowIcon(icon: WindowIcon): void; - /** - * Shows the window. - * @returns {void} - */ - ShowWindow(): void; + /** + * Shows the window. + * @returns {void} + */ + ShowWindow(): void; - /** - * Stops the window's taskbar flashing. - * @returns {void} - */ - StopFlashWindow(): void; + /** + * Stops the window's taskbar flashing. + * @returns {void} + */ + StopFlashWindow(): void; - /** - * Toggles the window's fullscreen state. - * @returns {void} - */ - ToggleFullscreen(): void; + /** + * Toggles the window's fullscreen state. + * @returns {void} + */ + ToggleFullscreen(): void; - /** - * Toggles the window's maximized state. - * @returns {void} - */ - ToggleMaximize(): void; + /** + * Toggles the window's maximized state. + * @returns {void} + */ + ToggleMaximize(): void; } export interface SteamClient { - Apps: Apps; - Auth: Auth; - Broadcast: Broadcast; - Browser: Browser; - BrowserView: BrowserView; - ClientNotifications: ClientNotifications; - Cloud: Cloud; - CommunityItems: CommunityItems; - Console: Console; - Customization: Customization; - Downloads: Downloads; - FamilySharing: FamilySharing; - Features: Features; - FriendSettings: FriendSettings; - Friends: Friends; - GameNotes: GameNotes; - GameSessions: GameSessions; - Input: Input; - InstallFolder: InstallFolder; - Installs: Installs; - MachineStorage: Storage; - Messaging: Messaging; - Music: Music; - Notifications: Notifications; - OpenVR: OpenVR; - Overlay: Overlay; - Parental: Parental; - RemotePlay: RemotePlay; - RoamingStorage: Storage; - Screenshots: Screenshots; - ServerBrowser: ServerBrowser; - Settings: Settings; - SharedConnection: SharedConnection; - Stats: Stats; - SteamChina: SteamChina; - Storage: Storage; - Streaming: Streaming; - System: System; - UI: UI; - URL: URL; - Updates: Updates; - User: User; - WebChat: WebChat; - WebUITransport: WebUITransport; - Window: Window; + Apps: Apps; + Auth: Auth; + Broadcast: Broadcast; + Browser: Browser; + BrowserView: BrowserView; + ClientNotifications: ClientNotifications; + Cloud: Cloud; + CommunityItems: CommunityItems; + Console: Console; + Customization: Customization; + Downloads: Downloads; + FamilySharing: FamilySharing; + Features: Features; + FriendSettings: FriendSettings; + Friends: Friends; + GameNotes: GameNotes; + GameSessions: GameSessions; + Input: Input; + InstallFolder: InstallFolder; + Installs: Installs; + MachineStorage: Storage; + Messaging: Messaging; + Music: Music; + Notifications: Notifications; + OpenVR: OpenVR; + Overlay: Overlay; + Parental: Parental; + RemotePlay: RemotePlay; + RoamingStorage: Storage; + Screenshots: Screenshots; + ServerBrowser: ServerBrowser; + Settings: Settings; + SharedConnection: SharedConnection; + Stats: Stats; + SteamChina: SteamChina; + Storage: Storage; + Streaming: Streaming; + System: System; + UI: UI; + URL: URL; + Updates: Updates; + User: User; + WebChat: WebChat; + WebUITransport: WebUITransport; + Window: Window; } export interface SteamShortcut { - appid: number; - data: Shortcut; + appid: number; + data: Shortcut; } export interface Shortcut { - bIsApplication: boolean; - strAppName: string; - strExePath: string; - strArguments: string; - strCmdline: string; - strShortcutPath: string | undefined; - strSortAs: string | undefined; - strIconDataBase64: string | undefined; + bIsApplication: boolean; + strAppName: string; + strExePath: string; + strArguments: string; + strCmdline: string; + strShortcutPath: string | undefined; + strSortAs: string | undefined; + strIconDataBase64: string | undefined; } /** * @prop unAppID is not properly set by Steam for non-steam game shortcuts, so it defaults to 0 for them */ export interface AppLifetimeNotification { - unAppID: number; - nInstanceID: number; - bRunning: boolean; + unAppID: number; + nInstanceID: number; + bRunning: boolean; } export type AppAchievements = { - nAchieved: number; - nTotal: number; - vecAchievedHidden: AppAchievement[]; - vecHighlight: AppAchievement[]; - vecUnachieved: AppAchievement[]; + nAchieved: number; + nTotal: number; + vecAchievedHidden: AppAchievement[]; + vecHighlight: AppAchievement[]; + vecUnachieved: AppAchievement[]; }; export type AppLanguage = { - strDisplayName: string; - /** A localization string for the language. */ - strShortName: string; + strDisplayName: string; + /** A localization string for the language. */ + strShortName: string; }; export type LogoPinPositions = 'BottomLeft' | 'UpperLeft' | 'CenterCenter' | 'UpperCenter' | 'BottomCenter'; @@ -3320,979 +3471,979 @@ export type LogoPinPositions = 'BottomLeft' | 'UpperLeft' | 'CenterCenter' | 'Up export type ServerBrowserTab = 'internet' | 'favorites' | 'history' | 'lan' | 'friends'; export type WindowLocation = - | 'upper-left' - | 'lower-left' - | 'center-top' - | 'center-bottom' - | 'center-bottom' - | 'upper-right' - | 'lower-right'; + | 'upper-left' + | 'lower-left' + | 'center-top' + | 'center-bottom' + | 'center-bottom' + | 'upper-right' + | 'lower-right'; export type WindowIcon = 'steam' | 'messages' | 'voice'; export type BrowserViewEvent = - | 'alert-dialog' - | 'before-close' - | 'blocked-request' - | 'can-go-back-forward-changed' - | 'confirm-dialog' - | 'favicon-urls-changed' - | 'find-in-page-results' - | 'finished-request' - | 'focus-changed' - | 'full-screen' - | 'history-changed' - | 'load-error' - | 'message' - | 'new-tab' - | 'node-has-focus' - | 'page-security' - | 'set-title' - | 'start-loading' - | 'start-request' - | 'toggle-find-in-page'; + | 'alert-dialog' + | 'before-close' + | 'blocked-request' + | 'can-go-back-forward-changed' + | 'confirm-dialog' + | 'favicon-urls-changed' + | 'find-in-page-results' + | 'finished-request' + | 'focus-changed' + | 'full-screen' + | 'history-changed' + | 'load-error' + | 'message' + | 'new-tab' + | 'node-has-focus' + | 'page-security' + | 'set-title' + | 'start-loading' + | 'start-request' + | 'toggle-find-in-page'; export interface LogoPosition { - pinnedPosition: LogoPinPositions; - nWidthPct: number; - nHeightPct: number; + pinnedPosition: LogoPinPositions; + nWidthPct: number; + nHeightPct: number; } export interface AppData { - details: AppDetails; - // more + details: AppDetails; + // more } export interface AppDeckDerivedProperties { - gamescope_frame_limiter_not_supported?: boolean; - non_deck_display_glyphs: boolean; - primary_player_is_controller_slot_0: boolean; - requires_h264: boolean; - requires_internet_for_setup: boolean; - requires_internet_for_singleplayer: boolean; - requires_manual_keyboard_invoke: false; - requires_non_controller_launcher_nav: false; - small_text: boolean; - supported_input: number; + gamescope_frame_limiter_not_supported?: boolean; + non_deck_display_glyphs: boolean; + primary_player_is_controller_slot_0: boolean; + requires_h264: boolean; + requires_internet_for_setup: boolean; + requires_internet_for_singleplayer: boolean; + requires_manual_keyboard_invoke: false; + requires_non_controller_launcher_nav: false; + small_text: boolean; + supported_input: number; } export interface AppLibraryAssets { - logoPosition?: LogoPosition; - strCapsuleImage: string; - strHeroBlurImage: string; - strHeroImage: string; - strLogoImage: string; + logoPosition?: LogoPosition; + strCapsuleImage: string; + strHeroBlurImage: string; + strHeroImage: string; + strLogoImage: string; } export interface AppBeta { - /** Beta name. */ - strName: string; - /** Beta description. */ - strDescription: string; + /** Beta name. */ + strName: string; + /** Beta description. */ + strDescription: string; } export interface DeckCompatTestResult { - // enum ? - test_result: number; - /** A localization string. */ - test_loc_token: string; + // enum ? + test_result: number; + /** A localization string. */ + test_loc_token: string; } export interface AppDLC { - /** Is the DLC availble on the store? */ - bAvailableOnStore: boolean; - bEnabled: boolean; - /** Disk usage, in bytes. */ - lDiskUsageBytes: number; - /** Purchase date. */ - rtPurchaseDate: number; - rtStoreAssetModifyType: number; - /** Store header image filename. */ - strHeaderFilename: string; - /** Display name. */ - strName: string; - /** State (installed/notinstalled). */ - strState: string; - /** App ID. */ - unAppID: number; + /** Is the DLC availble on the store? */ + bAvailableOnStore: boolean; + bEnabled: boolean; + /** Disk usage, in bytes. */ + lDiskUsageBytes: number; + /** Purchase date. */ + rtPurchaseDate: number; + rtStoreAssetModifyType: number; + /** Store header image filename. */ + strHeaderFilename: string; + /** Display name. */ + strName: string; + /** State (installed/notinstalled). */ + strState: string; + /** App ID. */ + unAppID: number; } export interface AppSoundtrack { - /** Purchase date. */ - rtPurchaseDate: number; - rtStoreAssetModifyType: number; - /** Display name. */ - strName: string; - /** State (installed/notinstalled). */ - strState: string; - /** App ID. */ - unAppID: number; + /** Purchase date. */ + rtPurchaseDate: number; + rtStoreAssetModifyType: number; + /** Display name. */ + strName: string; + /** State (installed/notinstalled). */ + strState: string; + /** App ID. */ + unAppID: number; } export interface AppDetails { - achievements: AppAchievements; - /** Indicates whether the application is available on the store. */ - bAvailableContentOnStore: boolean; - bCanMoveInstallFolder: boolean; - bCloudAvailable: boolean; - bCloudEnabledForAccount: boolean; - bCloudEnabledForApp: boolean; - bCloudSyncOnSuspendAvailable: boolean; - bCloudSyncOnSuspendEnabled: boolean; - /** Indicates whether the application has community market available. */ - bCommunityMarketPresence: boolean; - bEnableAllowDesktopConfiguration: boolean; - bFreeRemovableLicense: boolean; - bHasAllLegacyCDKeys: boolean; - bHasAnyLocalContent: boolean; - bHasLockedPrivateBetas: boolean; - bIsExcludedFromSharing: boolean; - bIsSubscribedTo: boolean; - bIsThirdPartyUpdater: boolean; - bOverlayEnabled: boolean; - bOverrideInternalResolution: boolean; - bRequiresLegacyCDKey: boolean; - bShortcutIsVR: boolean; - bShowCDKeyInMenus: boolean; - bShowControllerConfig: boolean; - bSupportsCDKeyCopyToClipboard: boolean; - bVRGameTheatreEnabled: boolean; - bWorkshopVisible: boolean; - deckDerivedProperties?: AppDeckDerivedProperties; - eAppOwnershipFlags: AppOwnershipFlags | number; // is this a bitmask? - eAutoUpdateValue: AutoUpdateBehavior; - eBackgroundDownloads: BackgroundDownloadsBehavior; - eCloudSync: number; - eControllerRumblePreference: number; // ControllerRumbleSetting? - eDisplayStatus: DisplayStatus; - eEnableThirdPartyControllerConfiguration: number; - eSteamInputControllerMask: number; - /** - * Index of the install folder. -1 if not installed. - */ - iInstallFolder: number; - /** Disk space required for installation, in bytes. */ - lDiskSpaceRequiredBytes: number; - /** Application disk space usage, in bytes. */ - lDiskUsageBytes: number; - /** DLC disk space usage, in bytes. */ - lDlcUsageBytes: number; - nBuildID: number; - nCompatToolPriority: number; - /** Total play time, in minutes. */ - nPlaytimeForever: number; - /** Screenshot count. */ - nScreenshots: number; - rtLastTimePlayed: number; - rtLastUpdated: number; - rtPurchased: number; - selectedLanguage: AppLanguage; - strCloudBytesAvailable: string; - strCloudBytesUsed: string; - strCompatToolDisplayName: string; - strCompatToolName: string; - strDeveloperName: string; - strDeveloperURL: string; - strDisplayName: string; - strExternalSubscriptionURL: string; - strFlatpakAppID: string; - strHomepageURL: string; - strLaunchOptions: string; - strManualURL: string; - /** Steam64 ID. */ - strOwnerSteamID: string; - strResolutionOverride: string; - strSelectedBeta: string; - strShortcutExe: string; - strShortcutLaunchOptions: string; - strShortcutStartDir: string; - strSteamDeckBlogURL: string; - unAppID: number; - unEntitledContentApp: number; - unTimedTrialSecondsAllowed: number; - unTimedTrialSecondsPlayed: number; - vecBetas: AppBeta[]; - vecChildConfigApps: number[]; - vecDLC: AppDLC[]; - vecDeckCompatTestResults: DeckCompatTestResult[]; - vecLanguages: AppLanguage[]; - vecLegacyCDKeys: any[]; - vecMusicAlbums: AppSoundtrack[]; - /** windows | osx | linux */ - vecPlatforms: string[]; - vecScreenShots: Screenshot[]; - libraryAssets?: AppLibraryAssets; + achievements: AppAchievements; + /** Indicates whether the application is available on the store. */ + bAvailableContentOnStore: boolean; + bCanMoveInstallFolder: boolean; + bCloudAvailable: boolean; + bCloudEnabledForAccount: boolean; + bCloudEnabledForApp: boolean; + bCloudSyncOnSuspendAvailable: boolean; + bCloudSyncOnSuspendEnabled: boolean; + /** Indicates whether the application has community market available. */ + bCommunityMarketPresence: boolean; + bEnableAllowDesktopConfiguration: boolean; + bFreeRemovableLicense: boolean; + bHasAllLegacyCDKeys: boolean; + bHasAnyLocalContent: boolean; + bHasLockedPrivateBetas: boolean; + bIsExcludedFromSharing: boolean; + bIsSubscribedTo: boolean; + bIsThirdPartyUpdater: boolean; + bOverlayEnabled: boolean; + bOverrideInternalResolution: boolean; + bRequiresLegacyCDKey: boolean; + bShortcutIsVR: boolean; + bShowCDKeyInMenus: boolean; + bShowControllerConfig: boolean; + bSupportsCDKeyCopyToClipboard: boolean; + bVRGameTheatreEnabled: boolean; + bWorkshopVisible: boolean; + deckDerivedProperties?: AppDeckDerivedProperties; + eAppOwnershipFlags: AppOwnershipFlags | number; // is this a bitmask? + eAutoUpdateValue: AutoUpdateBehavior; + eBackgroundDownloads: BackgroundDownloadsBehavior; + eCloudSync: number; + eControllerRumblePreference: number; // ControllerRumbleSetting? + eDisplayStatus: DisplayStatus; + eEnableThirdPartyControllerConfiguration: number; + eSteamInputControllerMask: number; + /** + * Index of the install folder. -1 if not installed. + */ + iInstallFolder: number; + /** Disk space required for installation, in bytes. */ + lDiskSpaceRequiredBytes: number; + /** Application disk space usage, in bytes. */ + lDiskUsageBytes: number; + /** DLC disk space usage, in bytes. */ + lDlcUsageBytes: number; + nBuildID: number; + nCompatToolPriority: number; + /** Total play time, in minutes. */ + nPlaytimeForever: number; + /** Screenshot count. */ + nScreenshots: number; + rtLastTimePlayed: number; + rtLastUpdated: number; + rtPurchased: number; + selectedLanguage: AppLanguage; + strCloudBytesAvailable: string; + strCloudBytesUsed: string; + strCompatToolDisplayName: string; + strCompatToolName: string; + strDeveloperName: string; + strDeveloperURL: string; + strDisplayName: string; + strExternalSubscriptionURL: string; + strFlatpakAppID: string; + strHomepageURL: string; + strLaunchOptions: string; + strManualURL: string; + /** Steam64 ID. */ + strOwnerSteamID: string; + strResolutionOverride: string; + strSelectedBeta: string; + strShortcutExe: string; + strShortcutLaunchOptions: string; + strShortcutStartDir: string; + strSteamDeckBlogURL: string; + unAppID: number; + unEntitledContentApp: number; + unTimedTrialSecondsAllowed: number; + unTimedTrialSecondsPlayed: number; + vecBetas: AppBeta[]; + vecChildConfigApps: number[]; + vecDLC: AppDLC[]; + vecDeckCompatTestResults: DeckCompatTestResult[]; + vecLanguages: AppLanguage[]; + vecLegacyCDKeys: any[]; + vecMusicAlbums: AppSoundtrack[]; + /** windows | osx | linux */ + vecPlatforms: string[]; + vecScreenShots: Screenshot[]; + libraryAssets?: AppLibraryAssets; } // Appears to be all optional fields :disaster: export interface SteamAppOverview { - appid: number; - display_name: string; - visible_in_game_list: boolean; - sort_as: string; + appid: number; + display_name: string; + visible_in_game_list: boolean; + sort_as: string; - /* + /* * Possible bitmask values, but I haven't spotted any of them being masked in the app_type field. * Should be safe as an enum. */ - app_type: AppType; - mru_index: number | undefined; - rt_recent_activity_time: number; - minutes_playtime_forever: number; - minutes_playtime_last_two_weeks: number; - rt_last_time_played_or_installed: number; - rt_last_time_played: number; - store_tag?: number[]; - association: SteamAppOverviewAssociation[]; - store_category?: number[]; - rt_original_release_date: number; - rt_steam_release_date: number; - icon_hash: string; - controller_support?: AppControllerSupportLevel; // default none - vr_supported?: boolean; - metacritic_score: number; - size_on_disk?: number; - third_party_mod?: boolean; - icon_data?: string; - icon_data_format?: string; - gameid: string; - library_capsule_filename?: string; - per_client_data: SteamAppOverviewClientData[]; - most_available_clientid: string; - selected_clientid?: string; - rt_store_asset_mtime: number; - rt_custom_image_mtime?: number; - optional_parent_app_id?: number; - owner_account_id?: number; - review_score_with_bombs: number; - review_percentage_with_bombs: number; - review_score_without_bombs: number; - review_percentage_without_bombs: number; - library_id?: string; - vr_only?: boolean; - mastersub_appid?: number; - mastersub_includedwith_logo?: string; - site_license_site_name?: string; - shortcut_override_appid?: number; - steam_deck_compat_category: SteamDeckCompatibilityCategory; // Default should be Unknown - rt_last_time_locally_played?: number; - rt_purchased_time: number; - header_filename?: string; - - m_setStoreCategories: Set<number>; - m_setStoreTags: Set<number>; - canonicalAppType: number; - local_per_client_data: SteamAppOverviewClientData; - most_available_per_client_data: SteamAppOverviewClientData; - selected_per_client_data: SteamAppOverviewClientData; - m_strPerClientData: Set<any> | undefined; - m_strAssociations: Set<any> | undefined; - - BIsModOrShortcut: () => boolean; - BIsShortcut: () => boolean; + app_type: AppType; + mru_index: number | undefined; + rt_recent_activity_time: number; + minutes_playtime_forever: number; + minutes_playtime_last_two_weeks: number; + rt_last_time_played_or_installed: number; + rt_last_time_played: number; + store_tag?: number[]; + association: SteamAppOverviewAssociation[]; + store_category?: number[]; + rt_original_release_date: number; + rt_steam_release_date: number; + icon_hash: string; + controller_support?: AppControllerSupportLevel; // default none + vr_supported?: boolean; + metacritic_score: number; + size_on_disk?: number; + third_party_mod?: boolean; + icon_data?: string; + icon_data_format?: string; + gameid: string; + library_capsule_filename?: string; + per_client_data: SteamAppOverviewClientData[]; + most_available_clientid: string; + selected_clientid?: string; + rt_store_asset_mtime: number; + rt_custom_image_mtime?: number; + optional_parent_app_id?: number; + owner_account_id?: number; + review_score_with_bombs: number; + review_percentage_with_bombs: number; + review_score_without_bombs: number; + review_percentage_without_bombs: number; + library_id?: string; + vr_only?: boolean; + mastersub_appid?: number; + mastersub_includedwith_logo?: string; + site_license_site_name?: string; + shortcut_override_appid?: number; + steam_deck_compat_category: SteamDeckCompatibilityCategory; // Default should be Unknown + rt_last_time_locally_played?: number; + rt_purchased_time: number; + header_filename?: string; + + m_setStoreCategories: Set<number>; + m_setStoreTags: Set<number>; + canonicalAppType: number; + local_per_client_data: SteamAppOverviewClientData; + most_available_per_client_data: SteamAppOverviewClientData; + selected_per_client_data: SteamAppOverviewClientData; + m_strPerClientData: Set<any> | undefined; + m_strAssociations: Set<any> | undefined; + + BIsModOrShortcut: () => boolean; + BIsShortcut: () => boolean; } export interface SteamAppOverviewAssociation { - type: AppAssociationType; // Default should be Invalid - name: string; + type: AppAssociationType; // Default should be Invalid + name: string; } export interface SteamAppOverviewClientData { - clientid: string; - client_name: string; - display_status: DisplayStatus; // Default should be Invalid - status_percentage: number; - active_beta?: string; - installed?: boolean; - bytes_downloaded: string; - bytes_total: string; - streaming_to_local_client?: boolean; - is_available_on_current_platform: boolean; - is_invalid_os_type?: boolean; - playtime_left?: number; - cloud_status: AppCloudStatus; + clientid: string; + client_name: string; + display_status: DisplayStatus; // Default should be Invalid + status_percentage: number; + active_beta?: string; + installed?: boolean; + bytes_downloaded: string; + bytes_total: string; + streaming_to_local_client?: boolean; + is_available_on_current_platform: boolean; + is_invalid_os_type?: boolean; + playtime_left?: number; + cloud_status: AppCloudStatus; } export interface ConflictingFileTimestamp { - rtLocalTime: number; - rtRemoteTime: number; + rtLocalTime: number; + rtRemoteTime: number; } /** * Represents information about a compatibility tool. */ export interface CompatibilityToolInfo { - /** Name of the compatibility tool. */ - strToolName: string; - /** Display name of the compatibility tool. */ - strDisplayName: string; + /** Name of the compatibility tool. */ + strToolName: string; + /** Display name of the compatibility tool. */ + strDisplayName: string; } /** * Represents information about an installed application. */ export interface AppInfo { - /** ID of the application. */ - nAppID: number; - /** Name of the application. */ - strAppName: string; - /** Sorting information for the application. */ - strSortAs: string; - /** Last played time in Unix Epoch time format. */ - rtLastPlayed: number; - /** Size of used storage by the application. */ - strUsedSize: string; - /** Size of DLC storage used by the application. */ - strDLCSize: string; - /** Size of workshop storage used by the application. */ - strWorkshopSize: string; - /** Size of staged storage used by the application. */ - strStagedSize: string; + /** ID of the application. */ + nAppID: number; + /** Name of the application. */ + strAppName: string; + /** Sorting information for the application. */ + strSortAs: string; + /** Last played time in Unix Epoch time format. */ + rtLastPlayed: number; + /** Size of used storage by the application. */ + strUsedSize: string; + /** Size of DLC storage used by the application. */ + strDLCSize: string; + /** Size of workshop storage used by the application. */ + strWorkshopSize: string; + /** Size of staged storage used by the application. */ + strStagedSize: string; } /** * Represents information about an installation folder. */ export interface SteamInstallFolder extends PotentialInstallFolder { - /** Index of the folder. */ - nFolderIndex: number; - /** Used space in the folder. */ - strUsedSize: string; - /** Size of DLC storage used in the folder. */ - strDLCSize: string; - /** Size of workshop storage used in the folder. */ - strWorkshopSize: string; - /** Size of staged storage used in the folder. */ - strStagedSize: string; - /** Indicates if the folder is set as the default installation folder. */ - bIsDefaultFolder: boolean; - /** Indicates if the folder is currently mounted. */ - bIsMounted: boolean; - /** List of applications installed in the folder. */ - vecApps: AppInfo[]; + /** Index of the folder. */ + nFolderIndex: number; + /** Used space in the folder. */ + strUsedSize: string; + /** Size of DLC storage used in the folder. */ + strDLCSize: string; + /** Size of workshop storage used in the folder. */ + strWorkshopSize: string; + /** Size of staged storage used in the folder. */ + strStagedSize: string; + /** Indicates if the folder is set as the default installation folder. */ + bIsDefaultFolder: boolean; + /** Indicates if the folder is currently mounted. */ + bIsMounted: boolean; + /** List of applications installed in the folder. */ + vecApps: AppInfo[]; } export interface PotentialInstallFolder { - /** Path of the folder. */ - strFolderPath: string; - /** User label for the folder. */ - strUserLabel: string; - /** Name of the drive where the folder is located. */ - strDriveName: string; - /** Total capacity of the folder. */ - strCapacity: string; - /** Available free space in the folder. */ - strFreeSpace: string; - /** Indicates if the folder is on a fixed drive. */ - bIsFixed: boolean; + /** Path of the folder. */ + strFolderPath: string; + /** User label for the folder. */ + strUserLabel: string; + /** Name of the drive where the folder is located. */ + strDriveName: string; + /** Total capacity of the folder. */ + strCapacity: string; + /** Available free space in the folder. */ + strFreeSpace: string; + /** Indicates if the folder is on a fixed drive. */ + bIsFixed: boolean; } export interface AchievementNotification { - achievement: AppAchievements; - nCurrentProgress: number; - nMaxProgress: number; - unAppID: number; + achievement: AppAchievements; + nCurrentProgress: number; + nMaxProgress: number; + unAppID: number; } export interface ScreenshotNotification { - details: Screenshot; - hScreenshot: number; - strOperation: string; - unAppID: number; + details: Screenshot; + hScreenshot: number; + strOperation: string; + unAppID: number; } export interface Screenshot { - nAppID: number; - strGameID: string; - hHandle: number; - nWidth: number; - nHeight: number; - nCreated: number; // timestamp - ePrivacy: FilePrivacyState; - strCaption: ''; - bSpoilers: boolean; - strUrl: string; - bUploaded: boolean; - ugcHandle: string; + nAppID: number; + strGameID: string; + hHandle: number; + nWidth: number; + nHeight: number; + nCreated: number; // timestamp + ePrivacy: FilePrivacyState; + strCaption: ''; + bSpoilers: boolean; + strUrl: string; + bUploaded: boolean; + ugcHandle: string; } export interface DownloadItem { - active: boolean; - appid: number; - buildid: number; - completed: boolean; - completed_time: number; - deferred_time: number; - downloaded_bytes: number; - launch_on_completion: boolean; - paused: boolean; - queue_index: number; - target_buildid: number; - total_bytes: number; - update_error: string; - update_result: number; - update_type_info: UpdateTypeInfo[]; + active: boolean; + appid: number; + buildid: number; + completed: boolean; + completed_time: number; + deferred_time: number; + downloaded_bytes: number; + launch_on_completion: boolean; + paused: boolean; + queue_index: number; + target_buildid: number; + total_bytes: number; + update_error: string; + update_result: number; + update_type_info: UpdateTypeInfo[]; } export interface UpdateTypeInfo { - completed_update: boolean; - downloaded_bytes: number; - has_update: boolean; - total_bytes: number; + completed_update: boolean; + downloaded_bytes: number; + has_update: boolean; + total_bytes: number; } export interface DownloadOverview { - lan_peer_hostname: string; - paused: boolean; - throttling_suspended: boolean; - update_appid: number; - update_bytes_downloaded: number; - update_bytes_processed: number; - update_bytes_staged: number; - update_bytes_to_download: number; - update_bytes_to_process: number; - update_bytes_to_stage: number; - update_disc_bytes_per_second: number; - update_is_install: boolean; - update_is_prefetch_estimate: boolean; - update_is_shader: boolean; - update_is_upload: boolean; - update_is_workshop: boolean; - update_network_bytes_per_second: number; - update_peak_network_bytes_per_second: number; - update_seconds_remaining: number; - update_start_time: number; - update_state: 'None' | 'Starting' | 'Updating' | 'Stopping'; + lan_peer_hostname: string; + paused: boolean; + throttling_suspended: boolean; + update_appid: number; + update_bytes_downloaded: number; + update_bytes_processed: number; + update_bytes_staged: number; + update_bytes_to_download: number; + update_bytes_to_process: number; + update_bytes_to_stage: number; + update_disc_bytes_per_second: number; + update_is_install: boolean; + update_is_prefetch_estimate: boolean; + update_is_shader: boolean; + update_is_upload: boolean; + update_is_workshop: boolean; + update_network_bytes_per_second: number; + update_peak_network_bytes_per_second: number; + update_seconds_remaining: number; + update_start_time: number; + update_state: 'None' | 'Starting' | 'Updating' | 'Stopping'; } export interface InstallInfo { - rgAppIDs: InstallInfoApps[]; - eInstallState: number; - nDiskSpaceRequired: number; - nDiskSpaceAvailable: number; - nCurrentDisk: number; - nTotalDisks: number; - bCanChangeInstallFolder: boolean; - /** - * Index of the install folder. -1 if not installed. - */ - iInstallFolder: number; - iUnmountedFolder: number; - currentAppID: number; - eAppError: AppError; - errorDetail: string; - bSystemMenuShortcut: boolean; - bDesktopShortcut: boolean; - bIsBackupInstall: boolean; - strPeerContentServer: string; - bPeerContentServerOnline: boolean; - bPeerContentServerAvailable: boolean; + rgAppIDs: InstallInfoApps[]; + eInstallState: number; + nDiskSpaceRequired: number; + nDiskSpaceAvailable: number; + nCurrentDisk: number; + nTotalDisks: number; + bCanChangeInstallFolder: boolean; + /** + * Index of the install folder. -1 if not installed. + */ + iInstallFolder: number; + iUnmountedFolder: number; + currentAppID: number; + eAppError: AppError; + errorDetail: string; + bSystemMenuShortcut: boolean; + bDesktopShortcut: boolean; + bIsBackupInstall: boolean; + strPeerContentServer: string; + bPeerContentServerOnline: boolean; + bPeerContentServerAvailable: boolean; } export interface InstallInfoApps { - nAppID: number; - lDiskSpaceRequiredBytes: number; + nAppID: number; + lDiskSpaceRequiredBytes: number; } /** * Represents spew output information. */ export interface SpewOutput { - /** - * The content of the spew output. - */ - spew: string; + /** + * The content of the spew output. + */ + spew: string; - /** - * The type or category of the spew output. - */ - spew_type: string; + /** + * The type or category of the spew output. + */ + spew_type: string; } export interface AuthRefreshInfo { - reason: number; - account_name: string; - login_id_token: string; + reason: number; + account_name: string; + login_id_token: string; } export interface WorkshopItem { - unAppID: number; - ulPublishedFileID: string; + unAppID: number; + ulPublishedFileID: string; } /** * Represents playtime information for an application. */ export interface Playtime { - /** Total playtime in minutes for the last 2 weeks. */ - nPlaytimeLastTwoWeeks: number; - /** Total playtime in minutes. */ - nPlaytimeForever: number; - /** Last played time in Unix Epoch time format. */ - rtLastTimePlayed: number; + /** Total playtime in minutes for the last 2 weeks. */ + nPlaytimeLastTwoWeeks: number; + /** Total playtime in minutes. */ + nPlaytimeForever: number; + /** Last played time in Unix Epoch time format. */ + rtLastTimePlayed: number; } export interface BrightnessChange { - flBrightness: number; + flBrightness: number; } export interface AirplaneModeChange { - bEnabled: boolean; + bEnabled: boolean; } export interface SystemInfo { - sOSName: string; - sKernelVersion: string; - sBIOSVersion: string; - sHostname: string; - sOSCodename: string; - sOSVariantId: string; - sOSVersionId: string; - sOSBuildId: string; - nSteamVersion: number; - sSteamBuildDate: string; - sSteamAPI: string; - sCPUVendor: string; - sCPUName: string; - nCPUHz: number; - nCPUPhysicalCores: number; - nCPULogicalCores: number; - nSystemRAMSizeMB: number; - sVideoCardName: string; - sVideoDriverVersion: string; - nVideoRAMSizeMB: number; - bIsUnsupportedPrototypeHardware: boolean; + sOSName: string; + sKernelVersion: string; + sBIOSVersion: string; + sHostname: string; + sOSCodename: string; + sOSVariantId: string; + sOSVersionId: string; + sOSBuildId: string; + nSteamVersion: number; + sSteamBuildDate: string; + sSteamAPI: string; + sCPUVendor: string; + sCPUName: string; + nCPUHz: number; + nCPUPhysicalCores: number; + nCPULogicalCores: number; + nSystemRAMSizeMB: number; + sVideoCardName: string; + sVideoDriverVersion: string; + nVideoRAMSizeMB: number; + bIsUnsupportedPrototypeHardware: boolean; } interface Region { - nRegionID: number; - strRegionName: string; + nRegionID: number; + strRegionName: string; } interface Hour { - nHour: number; - strDisplay: string; + nHour: number; + strDisplay: string; } interface AvailableClientBeta { - nBetaID: number; - strName: string; + nBetaID: number; + strName: string; } interface SteamSettings { - bIsInClientBeta: boolean; - bIsSteamSideload: boolean; - eClientBetaState: ClientBetaState; - strSelectedBetaName: string; - nAvailableBetas: number; - bChangeBetaEnabled: boolean; - nSelectedBetaID: number; - vecAvailableClientBetas: AvailableClientBeta[]; - bIsValveEmail: boolean; - bIsInDesktopUIBeta: boolean; - bEnableSoftProcessKill: boolean; - vecValidDownloadRegions: Region[]; - vecValidAutoUpdateRestrictHours: Hour[]; - bCompatEnabled: boolean; - bCompatEnabledForOtherTitles: boolean; - strCompatTool: string; - strDisplayName: string; - bDisplayIsExternal: boolean; - flAutoDisplayScaleFactor: number; - flCurrentDisplayScaleFactor: number; - bDisplayIsUsingAutoScale: boolean; - flMinDisplayScaleFactor: number; - flMaxDisplayScaleFactor: number; - flCurrentUnderscanLevel: number; - bUnderscanEnabled: boolean; - vecNightModeScheduledHours: Hour[]; + bIsInClientBeta: boolean; + bIsSteamSideload: boolean; + eClientBetaState: ClientBetaState; + strSelectedBetaName: string; + nAvailableBetas: number; + bChangeBetaEnabled: boolean; + nSelectedBetaID: number; + vecAvailableClientBetas: AvailableClientBeta[]; + bIsValveEmail: boolean; + bIsInDesktopUIBeta: boolean; + bEnableSoftProcessKill: boolean; + vecValidDownloadRegions: Region[]; + vecValidAutoUpdateRestrictHours: Hour[]; + bCompatEnabled: boolean; + bCompatEnabledForOtherTitles: boolean; + strCompatTool: string; + strDisplayName: string; + bDisplayIsExternal: boolean; + flAutoDisplayScaleFactor: number; + flCurrentDisplayScaleFactor: number; + bDisplayIsUsingAutoScale: boolean; + flMinDisplayScaleFactor: number; + flMaxDisplayScaleFactor: number; + flCurrentUnderscanLevel: number; + bUnderscanEnabled: boolean; + vecNightModeScheduledHours: Hour[]; } export interface PrePurchaseApp { - nAppID: number; - eState: number; // todo: 3 = Preload? 4 - Ready? I got 3 from Starfield preload and 4 with csgo + nAppID: number; + eState: number; // todo: 3 = Preload? 4 - Ready? I got 3 from Starfield preload and 4 with csgo } export interface PrePurchaseInfo { - apps: PrePurchaseApp[]; - lastChangeNumber: number; + apps: PrePurchaseApp[]; + lastChangeNumber: number; } export interface AppAchievement { - bAchieved: boolean; - bHidden: boolean; - flMinProgress: number; - flCurrentProgress: number; - flMaxProgress: number; - /** How many players have this achievement, in percentage. */ - flAchieved: number; - /** When this achievement was unlocked. */ - rtUnlocked: number; - /** Achievement description. */ - strDescription: string; - /** Achievement ID. */ - strID: string; - /** Achievement icon. */ - strImage: string; - /** Achievement name. */ - strName: string; + bAchieved: boolean; + bHidden: boolean; + flMinProgress: number; + flCurrentProgress: number; + flMaxProgress: number; + /** How many players have this achievement, in percentage. */ + flAchieved: number; + /** When this achievement was unlocked. */ + rtUnlocked: number; + /** Achievement description. */ + strDescription: string; + /** Achievement ID. */ + strID: string; + /** Achievement icon. */ + strImage: string; + /** Achievement name. */ + strName: string; } export interface AppAchievementData { - rgAchievements: AppAchievement[]; + rgAchievements: AppAchievement[]; } export interface AppAchievementResponse { - result: number; - data: AppAchievementData; + result: number; + data: AppAchievementData; } export interface NonSteamApp { - bIsApplication: boolean; - strAppName: string; - strExePath: string; - strArguments: string; - strCmdline: string; - strIconDataBase64: string; + bIsApplication: boolean; + strAppName: string; + strExePath: string; + strArguments: string; + strCmdline: string; + strIconDataBase64: string; } export interface RegisteredSteamDeck { - bRegistered: boolean; - bIgnoreRegistrationPrompt: boolean; - strSteamID: string; - strSerialNumber: string; + bRegistered: boolean; + bIgnoreRegistrationPrompt: boolean; + strSteamID: string; + strSerialNumber: string; } export interface AccountSettings { - strEmail: string; - bEmailValidated: boolean; - bHasAnyVACBans: boolean; - bHasTwoFactor: boolean; - eSteamGuardState: number; - rtSteamGuardEnableTime: number; - bSaveAccountCredentials: boolean; + strEmail: string; + bEmailValidated: boolean; + bHasAnyVACBans: boolean; + bHasTwoFactor: boolean; + eSteamGuardState: number; + rtSteamGuardEnableTime: number; + bSaveAccountCredentials: boolean; } export interface Language { - language: number; - strShortName: string; + language: number; + strShortName: string; } export interface TimeZone { - utcOffset: number; - timezoneID: string; - timezoneLocalizationToken: string; - regionsLocalizationToken: string; + utcOffset: number; + timezoneID: string; + timezoneLocalizationToken: string; + regionsLocalizationToken: string; } export interface AppBackupStatus { - appid: number; - eError: number; // Without confirmation 20 - In progress, 3 - Cancelled? - strBytesToProcess: string; - strBytesProcessed: string; - strTotalBytesWritten: string; + appid: number; + eError: number; // Without confirmation 20 - In progress, 3 - Cancelled? + strBytesToProcess: string; + strBytesProcessed: string; + strTotalBytesWritten: string; } /** * Represents a list of applications with their IDs. */ interface AppList { - /** - * Key-value pairs where the key is the `appId` (e.g., "App_123456") and the value indicates whether the appId is allowed during parental lock. - */ - [appId: string]: number; + /** + * Key-value pairs where the key is the `appId` (e.g., "App_123456") and the value indicates whether the appId is allowed during parental lock. + */ + [appId: string]: number; } /** * Represents the parental settings and restrictions. */ export interface ParentalSettings { - /** - * Indicates whether parental settings are enabled. - */ - enabled: boolean; - /** - * Indicates whether parental settings are locked. - */ - locked: boolean; - /** - * Bitmask representing enabled features. - * - Bit 0: Unknown (@todo Please provide more details if known) - * - Bit 1: Online content & features - Steam Store - * - Bit 2: Online content & features - Community-generated content - * - Bit 3: Online content & features - My online profile, screenshots, and achievements - * - Bit 4: Online content & features - Friends, chat, and groups - * - Bit 5-11: Unknown (@todo Please provide more details if known) - * - Bit 12: Library content - 0: Only games I choose, 1: All games - */ - features: number; - /** - * Indicates whether all apps are allowed. - */ - allowallapps: boolean; - /** - * Base list (type not specified but an object). - * @todo Determine the type of this property. - */ - baselist: any | undefined; - /** - * Custom list of allowed applications. - */ - customlist: AppList; - /** - * Email for recovery (if applicable). - */ - recoveryemail: string | undefined; + /** + * Indicates whether parental settings are enabled. + */ + enabled: boolean; + /** + * Indicates whether parental settings are locked. + */ + locked: boolean; + /** + * Bitmask representing enabled features. + * - Bit 0: Unknown (@todo Please provide more details if known) + * - Bit 1: Online content & features - Steam Store + * - Bit 2: Online content & features - Community-generated content + * - Bit 3: Online content & features - My online profile, screenshots, and achievements + * - Bit 4: Online content & features - Friends, chat, and groups + * - Bit 5-11: Unknown (@todo Please provide more details if known) + * - Bit 12: Library content - 0: Only games I choose, 1: All games + */ + features: number; + /** + * Indicates whether all apps are allowed. + */ + allowallapps: boolean; + /** + * Base list (type not specified but an object). + * @todo Determine the type of this property. + */ + baselist: any | undefined; + /** + * Custom list of allowed applications. + */ + customlist: AppList; + /** + * Email for recovery (if applicable). + */ + recoveryemail: string | undefined; } export interface ConnectivityTestChange { - eConnectivityTestResult: ConnectivityTestResult; - eFakeState: number; - bChecking: boolean; + eConnectivityTestResult: ConnectivityTestResult; + eFakeState: number; + bChecking: boolean; } export interface ControllerStateChange { - unControllerIndex: number; - unPacketNum: number; - /** - * Bitmask representing pressed upper buttons. - * - Bit 0-8: Unknown (@todo Please provide more details if known) - * - Bit 9: L4 - * - Bit 10: R4 - * - Bit 11-13: Unknown (@todo Please provide more details if known) - * - Bit 14: Left Joystick Touch - * - Bit 15: Right Joystick Touch - * - Bit 16-18: Unknown (@todo Please provide more details if known) - * - Bit 19: Quick Access Menu - */ - ulUpperButtons: number; - /** - * Bitmask representing pressed buttons. - * - Bit 0: R2 - * - Bit 1: L2 - * - Bit 2: R1 - * - Bit 3: L1 - * - Bit 4: Y - * - Bit 5: B - * - Bit 6: X - * - Bit 7: A - * - Bit 8: D-Pad Up - * - Bit 9: D-Pad Right - * - Bit 10: D-Pad Left - * - Bit 11: D-Pad Down - * - Bit 12: Select - * - Bit 13: Steam/Home - * - Bit 14: Start - * - Bit 15: L5 - * - Bit 16: R5 - * - Bit 17: Left Touchpad Click - * - Bit 18: Right Touchpad Click - * - Bit 19: Left Touchpad Touch - * - Bit 20: Right Touchpad Touch - * - Bit 21: Unknown (@todo Please provide more details if known) - * - Bit 22: L3 - * - Bit 23-25: Unknown (@todo Please provide more details if known) - * - Bit 26: R3 - * - Bit 27-28: Unknown (@todo Please provide more details if known) - * - Bit 29: Mute (Dualsense) - * - Bit 30-31: Unknown (@todo Please provide more details if known) - */ - ulButtons: number; - sLeftPadX: number; - sLeftPadY: number; - sRightPadX: number; - sRightPadY: number; - sCenterPadX: number; - sCenterPadY: number; - sLeftStickX: number; - sLeftStickY: number; - sRightStickX: number; - sRightStickY: number; - sTriggerL: number; - sTriggerR: number; - flDriftCorrectedQuatW: number; - flDriftCorrectedQuatX: number; - flDriftCorrectedQuatY: number; - flDriftCorrectedQuatZ: number; - flSensorFusionGyroQuatW: number; - flSensorFusionGyroQuatX: number; - flSensorFusionGyroQuatY: number; - flSensorFusionGyroQuatZ: number; - flDeferredSensorFusionGyroQuatW: number; - flDeferredSensorFusionGyroQuatX: number; - flDeferredSensorFusionGyroQuatY: number; - flDeferredSensorFusionGyroQuatZ: number; - flGyroDegreesPerSecondX: number; - flGyroDegreesPerSecondY: number; - flGyroDegreesPerSecondZ: number; - flGravityVectorX: number; - flGravityVectorY: number; - flGravityVectorZ: number; - flAccelerometerNoiseLength: number; - flGyroNoiseLength: number; - flGyroCalibrationProgress: number; - sBatteryLevel: number; - sPressurePadLeft: number; - sPressurePadRight: number; - sPressureBumperLeft: number; - sPressureBumperRight: number; - unHardwareUpdateInMicrosec: number; + unControllerIndex: number; + unPacketNum: number; + /** + * Bitmask representing pressed upper buttons. + * - Bit 0-8: Unknown (@todo Please provide more details if known) + * - Bit 9: L4 + * - Bit 10: R4 + * - Bit 11-13: Unknown (@todo Please provide more details if known) + * - Bit 14: Left Joystick Touch + * - Bit 15: Right Joystick Touch + * - Bit 16-18: Unknown (@todo Please provide more details if known) + * - Bit 19: Quick Access Menu + */ + ulUpperButtons: number; + /** + * Bitmask representing pressed buttons. + * - Bit 0: R2 + * - Bit 1: L2 + * - Bit 2: R1 + * - Bit 3: L1 + * - Bit 4: Y + * - Bit 5: B + * - Bit 6: X + * - Bit 7: A + * - Bit 8: D-Pad Up + * - Bit 9: D-Pad Right + * - Bit 10: D-Pad Left + * - Bit 11: D-Pad Down + * - Bit 12: Select + * - Bit 13: Steam/Home + * - Bit 14: Start + * - Bit 15: L5 + * - Bit 16: R5 + * - Bit 17: Left Touchpad Click + * - Bit 18: Right Touchpad Click + * - Bit 19: Left Touchpad Touch + * - Bit 20: Right Touchpad Touch + * - Bit 21: Unknown (@todo Please provide more details if known) + * - Bit 22: L3 + * - Bit 23-25: Unknown (@todo Please provide more details if known) + * - Bit 26: R3 + * - Bit 27-28: Unknown (@todo Please provide more details if known) + * - Bit 29: Mute (Dualsense) + * - Bit 30-31: Unknown (@todo Please provide more details if known) + */ + ulButtons: number; + sLeftPadX: number; + sLeftPadY: number; + sRightPadX: number; + sRightPadY: number; + sCenterPadX: number; + sCenterPadY: number; + sLeftStickX: number; + sLeftStickY: number; + sRightStickX: number; + sRightStickY: number; + sTriggerL: number; + sTriggerR: number; + flDriftCorrectedQuatW: number; + flDriftCorrectedQuatX: number; + flDriftCorrectedQuatY: number; + flDriftCorrectedQuatZ: number; + flSensorFusionGyroQuatW: number; + flSensorFusionGyroQuatX: number; + flSensorFusionGyroQuatY: number; + flSensorFusionGyroQuatZ: number; + flDeferredSensorFusionGyroQuatW: number; + flDeferredSensorFusionGyroQuatX: number; + flDeferredSensorFusionGyroQuatY: number; + flDeferredSensorFusionGyroQuatZ: number; + flGyroDegreesPerSecondX: number; + flGyroDegreesPerSecondY: number; + flGyroDegreesPerSecondZ: number; + flGravityVectorX: number; + flGravityVectorY: number; + flGravityVectorZ: number; + flAccelerometerNoiseLength: number; + flGyroNoiseLength: number; + flGyroCalibrationProgress: number; + sBatteryLevel: number; + sPressurePadLeft: number; + sPressurePadRight: number; + sPressureBumperLeft: number; + sPressureBumperRight: number; + unHardwareUpdateInMicrosec: number; } export interface ActiveAccount { - strActiveAccountID: string; - strName: string; - strAvatarHash: string; + strActiveAccountID: string; + strName: string; + strAvatarHash: string; } export interface ControllerInfo { - strName: string; - eControllerType: ControllerType; - nXInputIndex: number; - nControllerIndex: number; - eRumblePreference: number; // ControllerRumbleSetting - bWireless: boolean; - unUniqueID: number; - unVendorID: number; - unProductID: number; - unCapabilities: number; - strFirmwareBuildTime: string; - strSerialNumber: string; - strChipID: string; - nLEDColorR: number; - nLEDColorG: number; - nLEDColorB: number; - flLEDBrightness: number; - flLEDSaturation: number; - nTurnOnSound: number; - nTurnOffSound: number; - nLStickDeadzone: number; - nRStickDeadzone: number; - nLHapticStrength: number; - nRHapticStrength: number; - flLPadPressureCurve: number; - flRPadPressureCurve: number; - bHaptics: boolean; - bSWAntiDrift: boolean; - flGyroStationaryTolerance: number; - flAccelerometerStationaryTolerance: number; - bRemoteDevice: boolean; - bNintendoLayout: boolean; - bUseReversedLayout: boolean; - ActiveAccount: ActiveAccount | undefined; - vecAltAccounts: any[]; // The type for this property might need to be more specific based on the actual data structure + strName: string; + eControllerType: ControllerType; + nXInputIndex: number; + nControllerIndex: number; + eRumblePreference: number; // ControllerRumbleSetting + bWireless: boolean; + unUniqueID: number; + unVendorID: number; + unProductID: number; + unCapabilities: number; + strFirmwareBuildTime: string; + strSerialNumber: string; + strChipID: string; + nLEDColorR: number; + nLEDColorG: number; + nLEDColorB: number; + flLEDBrightness: number; + flLEDSaturation: number; + nTurnOnSound: number; + nTurnOffSound: number; + nLStickDeadzone: number; + nRStickDeadzone: number; + nLHapticStrength: number; + nRHapticStrength: number; + flLPadPressureCurve: number; + flRPadPressureCurve: number; + bHaptics: boolean; + bSWAntiDrift: boolean; + flGyroStationaryTolerance: number; + flAccelerometerStationaryTolerance: number; + bRemoteDevice: boolean; + bNintendoLayout: boolean; + bUseReversedLayout: boolean; + ActiveAccount: ActiveAccount | undefined; + vecAltAccounts: any[]; // The type for this property might need to be more specific based on the actual data structure } export interface TouchMenuMessage { - bHasVirtualMenus: boolean; - unControllerIndex: number; - appID: number; + bHasVirtualMenus: boolean; + unControllerIndex: number; + appID: number; } export interface ControllerCommandMessage { - eAction: number; - nControllerIndex: number; + eAction: number; + nControllerIndex: number; } export interface ControllerInputMessage { - nA: number; - bS: boolean; - nC: number; + nA: number; + bS: boolean; + nC: number; } export interface ControllerAnalogInputMessage { - nA: number; - x: number; - y: number; - nC: number; + nA: number; + x: number; + y: number; + nC: number; } export interface FriendSettingsFeature { - feature: string; - bEnabled: boolean; + feature: string; + bEnabled: boolean; } export interface FriendSettingsEnabledFeature { - DoNotDisturb: number; - LoaderWindowSynchronization: number; - NonFriendMessageHandling: number; - NewVoiceHotKeyState: number; - PersonaNotifications: number; - ServerVirtualizedMemberLists: number; - SteamworksChatAPI: number; - FriendsFilter: number; + DoNotDisturb: number; + LoaderWindowSynchronization: number; + NonFriendMessageHandling: number; + NewVoiceHotKeyState: number; + PersonaNotifications: number; + ServerVirtualizedMemberLists: number; + SteamworksChatAPI: number; + FriendsFilter: number; } export interface FriendSettingsChange { - bNotifications_ShowIngame: number; - bNotifications_ShowOnline: number; - bNotifications_ShowMessage: number; - bNotifications_EventsAndAnnouncements: number; - bSounds_PlayIngame: number; - bSounds_PlayOnline: number; - bSounds_PlayMessage: number; - bSounds_EventsAndAnnouncements: number; - bAlwaysNewChatWindow: number; - bForceAlphabeticFriendSorting: number; - nChatFlashMode: number; - bRememberOpenChats: number; - bCompactQuickAccess: number; - bCompactFriendsList: number; - bNotifications_ShowChatRoomNotification: number; - bSounds_PlayChatRoomNotification: number; - bHideOfflineFriendsInTagGroups: number; - bHideCategorizedFriends: number; - bCategorizeInGameFriendsByGame: number; - nChatFontSize: number; - b24HourClock: number; - bDoNotDisturbMode: number; - bDisableEmbedInlining: number; - bSignIntoFriends: number; - bDisableSpellcheck: number; - bDisableRoomEffects: number; - bAnimatedAvatars: number; - featuresEnabled: FriendSettingsEnabledFeature; + bNotifications_ShowIngame: number; + bNotifications_ShowOnline: number; + bNotifications_ShowMessage: number; + bNotifications_EventsAndAnnouncements: number; + bSounds_PlayIngame: number; + bSounds_PlayOnline: number; + bSounds_PlayMessage: number; + bSounds_EventsAndAnnouncements: number; + bAlwaysNewChatWindow: number; + bForceAlphabeticFriendSorting: number; + nChatFlashMode: number; + bRememberOpenChats: number; + bCompactQuickAccess: number; + bCompactFriendsList: number; + bNotifications_ShowChatRoomNotification: number; + bSounds_PlayChatRoomNotification: number; + bHideOfflineFriendsInTagGroups: number; + bHideCategorizedFriends: number; + bCategorizeInGameFriendsByGame: number; + nChatFontSize: number; + b24HourClock: number; + bDoNotDisturbMode: number; + bDisableEmbedInlining: number; + bSignIntoFriends: number; + bDisableSpellcheck: number; + bDisableRoomEffects: number; + bAnimatedAvatars: number; + featuresEnabled: FriendSettingsEnabledFeature; } export interface ProxyInfo { - proxy_mode: number; - address: string; - port: number; - exclude_local: boolean; + proxy_mode: number; + address: string; + port: number; + exclude_local: boolean; } export interface RemotePlayDevice { - clientName: string; - status: string; // "Connected", "Paired", - formFactor: number; - unStreamingSessionID: number; - bCanSuspend: boolean; + clientName: string; + status: string; // "Connected", "Paired", + formFactor: number; + unStreamingSessionID: number; + bCanSuspend: boolean; } export interface RemotePlaySettings { - bRemotePlaySupported: boolean; - bRemotePlayEnabled: boolean; - eRemotePlayP2PScope: number; - bRemotePlayServerConfigAvailable: boolean; - bRemotePlayServerConfigEnabled: boolean; - RemotePlayServerConfig: any; // todo: document {} - bRemotePlayClientConfigEnabled: boolean; - unStreamingSessionID: number; - strStreamingClientName: string; - RemotePlayClientConfig: any; // todo: document {} - nDefaultAudioChannels: number; - bDefaultEncodeNVIDIA: boolean; - bDefaultEncodeAMD: boolean; - bDefaultEncodeIntel: boolean; - nAutomaticResolutionX: number; - nAutomaticResolutionY: number; + bRemotePlaySupported: boolean; + bRemotePlayEnabled: boolean; + eRemotePlayP2PScope: number; + bRemotePlayServerConfigAvailable: boolean; + bRemotePlayServerConfigEnabled: boolean; + RemotePlayServerConfig: any; // todo: document {} + bRemotePlayClientConfigEnabled: boolean; + unStreamingSessionID: number; + strStreamingClientName: string; + RemotePlayClientConfig: any; // todo: document {} + nDefaultAudioChannels: number; + bDefaultEncodeNVIDIA: boolean; + bDefaultEncodeAMD: boolean; + bDefaultEncodeIntel: boolean; + nAutomaticResolutionX: number; + nAutomaticResolutionY: number; } export interface GameAction { - nGameActionID: number; - gameid: string; - strActionName: string; - /* + nGameActionID: number; + gameid: string; + strActionName: string; + /* None - 0 Completed - 1 Cancelled - 2 @@ -4334,1850 +4485,1850 @@ export interface GameAction { CreatingProcess - 38 WaitingGameWindow - 39 */ - strTaskName: string; - strTaskDetails: string; - nSecondsRemaing: number; //fixme: not a typo, actually valve - strNumDone: string; - strNumTotal: string; - bWaitingForUI: boolean; + strTaskName: string; + strTaskDetails: string; + nSecondsRemaing: number; //fixme: not a typo, actually valve + strNumDone: string; + strNumTotal: string; + bWaitingForUI: boolean; } export interface MoveContentProgress { - appid: number; - eError: number; // 0 - appear when you open the move dialog and when it's done, 3 - cancelled? but appid is 0?, 20 - in progress - flProgress: number; - strBytesMoved: string; - strTotalBytesToMove: string; - nFilesMoved: number; + appid: number; + eError: number; // 0 - appear when you open the move dialog and when it's done, 3 - cancelled? but appid is 0?, 20 - in progress + flProgress: number; + strBytesMoved: string; + strTotalBytesToMove: string; + nFilesMoved: number; } export interface FolderChange { - folderIndex: number; + folderIndex: number; } export interface MusicTrack { - uSoundtrackAppId: number; - ePlaybackStatus: number; // 1 - playing, 2 - paused - eRepeatStatus: number; - bShuffle: boolean; - nVolume: number; - nActiveTrack: number; - nLengthInMsec: number; + uSoundtrackAppId: number; + ePlaybackStatus: number; // 1 - playing, 2 - paused + eRepeatStatus: number; + bShuffle: boolean; + nVolume: number; + nActiveTrack: number; + nLengthInMsec: number; } export interface SoundtrackDetails { - tracks: Track[]; - metadata: SoundtrackMetadata; - vecAdditionalImageAssetURLs: string[]; - strCoverImageAssetURL: string; + tracks: Track[]; + metadata: SoundtrackMetadata; + vecAdditionalImageAssetURLs: string[]; + strCoverImageAssetURL: string; } export interface StoreTagLocalization { - tag: number; - string: string; + tag: number; + string: string; } export interface SoundtrackMetadata { - artist: string; + artist: string; } export interface Track { - discNumber: number; - trackNumber: number; - durationSeconds: number; - trackDisplayName: string; + discNumber: number; + trackNumber: number; + durationSeconds: number; + trackDisplayName: string; } export interface EndUserLicenseAgreement { - id: string; - url: string; - version: number; + id: string; + url: string; + version: number; } export interface BroadcastStatus { - broadcastid: string; - nViewers: number; - nRequests: number; - bIsBroadcasting: boolean; - bIsRecordingDesktop: boolean; - eBroadcastReady: number; - bBroadcastCapable: boolean; - bMicrophoneEnabled: boolean; - bMicrophoneActive: boolean; - nCurrentFPS: number; - nUploadKbps: number; + broadcastid: string; + nViewers: number; + nRequests: number; + bIsBroadcasting: boolean; + bIsRecordingDesktop: boolean; + eBroadcastReady: number; + bBroadcastCapable: boolean; + bMicrophoneEnabled: boolean; + bMicrophoneActive: boolean; + nCurrentFPS: number; + nUploadKbps: number; } export interface OverlayBrowserProtocols { - unAppID: number; - strScheme: string; - bAdded: boolean; + unAppID: number; + strScheme: string; + bAdded: boolean; } export interface LaunchOption { - /** - * @remarks This is an integer, despite the prefix. - */ - bIsVRLaunchOption: number; - eType: AppLaunchOptionType; - nIndex: number; - strDescription: string; - strGameName: string; + /** + * @remarks This is an integer, despite the prefix. + */ + bIsVRLaunchOption: number; + eType: AppLaunchOptionType; + nIndex: number; + strDescription: string; + strGameName: string; } /** * Represents information about a Bluetooth adapter. */ export interface BluetoothAdapter { - /** - * The unique identifier of the Bluetooth adapter. - */ - nId: number; + /** + * The unique identifier of the Bluetooth adapter. + */ + nId: number; - /** - * The MAC address of the Bluetooth adapter. - */ - sMAC: string; + /** + * The MAC address of the Bluetooth adapter. + */ + sMAC: string; - /** - * The name of the Bluetooth adapter. - */ - sName: string; + /** + * The name of the Bluetooth adapter. + */ + sName: string; - /** - * Indicates whether the Bluetooth adapter is enabled. - */ - bEnabled: boolean; + /** + * Indicates whether the Bluetooth adapter is enabled. + */ + bEnabled: boolean; - /** - * Indicates whether the Bluetooth adapter is in discovering mode. - */ - bDiscovering: boolean; + /** + * Indicates whether the Bluetooth adapter is in discovering mode. + */ + bDiscovering: boolean; } /** * Represents information about a Bluetooth device. */ export interface BluetoothDevice { - /** - * The unique identifier of the Bluetooth device. - */ - nId: number; + /** + * The unique identifier of the Bluetooth device. + */ + nId: number; - /** - * The ID of the Bluetooth adapter to which this device is discovered by / connected to. - */ - nAdapterId: number; + /** + * The ID of the Bluetooth adapter to which this device is discovered by / connected to. + */ + nAdapterId: number; - /** - * The type of the Bluetooth device (e.g., headphones, mouse, keyboard). - */ - eType: BluetoothDeviceType; + /** + * The type of the Bluetooth device (e.g., headphones, mouse, keyboard). + */ + eType: BluetoothDeviceType; - /** - * The MAC address of the Bluetooth device. - */ - sMAC: string; + /** + * The MAC address of the Bluetooth device. + */ + sMAC: string; - /** - * The name of the Bluetooth device. - */ - sName: string; + /** + * The name of the Bluetooth device. + */ + sName: string; - /** - * Indicates whether the Bluetooth device is currently connected to the adapter. - */ - bConnected: boolean; + /** + * Indicates whether the Bluetooth device is currently connected to the adapter. + */ + bConnected: boolean; - /** - * Indicates whether the Bluetooth device is paired to the adapter. - */ - bPaired: boolean; + /** + * Indicates whether the Bluetooth device is paired to the adapter. + */ + bPaired: boolean; - /** - * The raw signal strength of the Bluetooth device. - */ - nStrengthRaw: number; + /** + * The raw signal strength of the Bluetooth device. + */ + nStrengthRaw: number; } /** * Represents a change in the state of Bluetooth adapters and devices. */ export interface BluetoothStateChange { - /** - * An array of Bluetooth adapters with their current state. - */ - vecAdapters: BluetoothAdapter[]; + /** + * An array of Bluetooth adapters with their current state. + */ + vecAdapters: BluetoothAdapter[]; - /** - * An array of Bluetooth devices with their current state. - */ - vecDevices: BluetoothDevice[]; + /** + * An array of Bluetooth devices with their current state. + */ + vecDevices: BluetoothDevice[]; - /** - * Indicates whether Bluetooth is enabled (`true`) or disabled (`false`). - */ - bEnabled: boolean; + /** + * Indicates whether Bluetooth is enabled (`true`) or disabled (`false`). + */ + bEnabled: boolean; } /** * Represents the response of an operation. It appears to be not necessary to await for this operation response. It is only used to indicate the result of an operation. */ export interface OperationResponse { - /** - * The result code of the operation (1 for success, 2 for failure). - */ - result: number; + /** + * The result code of the operation (1 for success, 2 for failure). + */ + result: number; - /** - * A message describing the result of the operation. - */ - message: string; + /** + * A message describing the result of the operation. + */ + message: string; } /** * Represents details about a single screenshot upload. */ export interface DetailsForScreenshotUpload { - /** - * The size of the screenshot upload on disk (including thumbnail). - */ - strSizeOnDisk: string; + /** + * The size of the screenshot upload on disk (including thumbnail). + */ + strSizeOnDisk: string; - /** - * The amount of cloud storage available. - */ - strCloudAvailable: string; + /** + * The amount of cloud storage available. + */ + strCloudAvailable: string; - /** - * The total cloud storage. - */ - strCloudTotal: string; + /** + * The total cloud storage. + */ + strCloudTotal: string; } /** * Represents details about multiple screenshot uploads. */ export interface DetailsForScreenshotUploads { - /** - * The total size of all screenshot uploads on disk (sum of sizes including thumbnails). - */ - unSizeOnDisk: number; + /** + * The total size of all screenshot uploads on disk (sum of sizes including thumbnails). + */ + unSizeOnDisk: number; - /** - * The amount of cloud storage available. - */ - strCloudAvailable: string; + /** + * The amount of cloud storage available. + */ + strCloudAvailable: string; - /** - * The total cloud storage. - */ - strCloudTotal: string; + /** + * The total cloud storage. + */ + strCloudTotal: string; } /** * Represents details about an application audio session. */ export interface ApplicationAudio { - /** - * The ID of the application audio. - */ - id: number; + /** + * The ID of the application audio. + */ + id: number; - /** - * The name of the application (e.g., Spotify, YouTube from a browser, etc.). - */ - strName: string; + /** + * The name of the application (e.g., Spotify, YouTube from a browser, etc.). + */ + strName: string; - /** - * The volume level of the application (floating point value between 0 and 1). - */ - flVolume: number; + /** + * The volume level of the application (floating point value between 0 and 1). + */ + flVolume: number; } /** * Represents details about an array of application audio sessions. */ export interface ApplicationsAudio { - /** - * An array of application audio sessions. - */ - apps: ApplicationAudio[]; + /** + * An array of application audio sessions. + */ + apps: ApplicationAudio[]; } /** * Represents details about an audio device. */ export interface Device { - /** - * The identifier of the audio device. - */ - id: number; + /** + * The identifier of the audio device. + */ + id: number; - /** - * The name of the audio device. - */ - sName: string; + /** + * The name of the audio device. + */ + sName: string; - /** - * Indicates if the device has audio output. - */ - bHasOutput: boolean; + /** + * Indicates if the device has audio output. + */ + bHasOutput: boolean; - /** - * Indicates if the device is the default output device. - */ - bIsDefaultOutputDevice: boolean; + /** + * Indicates if the device is the default output device. + */ + bIsDefaultOutputDevice: boolean; - /** - * The volume level of the audio output device (floating point value between 0 and 1). - */ - flOutputVolume: number; + /** + * The volume level of the audio output device (floating point value between 0 and 1). + */ + flOutputVolume: number; - /** - * Indicates if the device has audio input. - */ - bHasInput: boolean; + /** + * Indicates if the device has audio input. + */ + bHasInput: boolean; - /** - * Indicates if the device is the default input device. - */ - bIsDefaultInputDevice: boolean; + /** + * Indicates if the device is the default input device. + */ + bIsDefaultInputDevice: boolean; - /** - * The volume level of the audio input device (floating point value between 0 and 1). - */ - flInputVolume: number; + /** + * The volume level of the audio input device (floating point value between 0 and 1). + */ + flInputVolume: number; } /** * Represents details about audio devices and information about the active audio device. */ export interface AudioDeviceInfo { - /** - * The ID of the active output audio device. - */ - activeOutputDeviceId: number; + /** + * The ID of the active output audio device. + */ + activeOutputDeviceId: number; - /** - * The ID of the active input audio device. - */ - activeInputDeviceId: number; + /** + * The ID of the active input audio device. + */ + activeInputDeviceId: number; - /** - * The ID of the overridden output audio device (-1 if not overridden). - */ - overrideOutputDeviceId: number; + /** + * The ID of the overridden output audio device (-1 if not overridden). + */ + overrideOutputDeviceId: number; - /** - * The ID of the overridden input audio device (-1 if not overridden). - */ - overrideInputDeviceId: number; + /** + * The ID of the overridden input audio device (-1 if not overridden). + */ + overrideInputDeviceId: number; - /** - * An array of audio devices. - */ - vecDevices: Device[]; + /** + * An array of audio devices. + */ + vecDevices: Device[]; } export interface BatteryStateChange { - bHasBattery: boolean; - eACState: ACState; - eBatteryState: BatteryState; - flLevel: number; // Battery Percentage in floating point 0-1 - nSecondsRemaining: number; // Appears to be charge time remaining or time remaining on battery - bShutdownRequested: boolean; + bHasBattery: boolean; + eACState: ACState; + eBatteryState: BatteryState; + flLevel: number; // Battery Percentage in floating point 0-1 + nSecondsRemaining: number; // Appears to be charge time remaining or time remaining on battery + bShutdownRequested: boolean; } export interface OSBranch { - eBranch: OSBranchType; // 1 - Stable - sRawName: string; + eBranch: OSBranchType; // 1 - Stable + sRawName: string; } export interface LoginUser { - personaName: string; - accountName: string; - rememberPassword: boolean; - avatarUrl: string; + personaName: string; + accountName: string; + rememberPassword: boolean; + avatarUrl: string; } export interface SurveyEntry { - strName: string; - vecArgs: string[]; + strName: string; + vecArgs: string[]; } export interface SurveySection { - strSectionName: string; - vecEntries: SurveyEntry[]; + strSectionName: string; + vecEntries: SurveyEntry[]; } export interface GameKeyboardMessage { - m_bOpen: boolean; - nAppID: number; - m_dwPID: number; - m_dwOverlayPID: number; - m_hPipe: number; - m_eInputMode: number; - m_eLineInputMode: number; - m_pchDescription: string; - m_unCharMax: number; - m_pchExistingText: string; + m_bOpen: boolean; + nAppID: number; + m_dwPID: number; + m_dwOverlayPID: number; + m_hPipe: number; + m_eInputMode: number; + m_eLineInputMode: number; + m_pchDescription: string; + m_unCharMax: number; + m_pchExistingText: string; } export interface ControllerConfigInfoMessage { - appID: number; + appID: number; } export interface ControllerConfigInfoMessageQuery extends ControllerConfigInfoMessage { - bPersonalQueryDone: boolean; + bPersonalQueryDone: boolean; } export interface ControllerConfigInfoMessageList extends ControllerConfigInfoMessage { - nControllerType: number; - publishedFileID: string; - accountID: number; - Title: string; - Description: string; - URL: string; - timeUpdated: string; - bOfficial: boolean; - bProgenitorOfficial: boolean; - bRecommended: boolean; - bProgenitorRecommended: boolean; - bUsesSIAPI: boolean; - bUsesMouse: boolean; - bUsesKeyboard: boolean; - bUsesGamepad: boolean; - eExportType: number; - playtime: string; - bSelected: boolean; + nControllerType: number; + publishedFileID: string; + accountID: number; + Title: string; + Description: string; + URL: string; + timeUpdated: string; + bOfficial: boolean; + bProgenitorOfficial: boolean; + bRecommended: boolean; + bProgenitorRecommended: boolean; + bUsesSIAPI: boolean; + bUsesMouse: boolean; + bUsesKeyboard: boolean; + bUsesGamepad: boolean; + eExportType: number; + playtime: string; + bSelected: boolean; } export interface ControllerConfigCloudStateChange { - bSyncDone: boolean; - bSyncConflict: boolean; - bSyncError: boolean; + bSyncDone: boolean; + bSyncConflict: boolean; + bSyncError: boolean; } export interface TouchGesture { - eTouchGesture: TouchGestureType; - x: number; - y: number; + eTouchGesture: TouchGestureType; + x: number; + y: number; } export interface BrowserViewInit { - bOnlyAllowTrustedPopups?: boolean; - parentPopupBrowserID?: number; - /** Initial URL to go to. */ - strInitialURL?: string; - strUserAgentIdentifier?: string; - strUserAgentOverride?: string; - strVROverlayKey?: string; + bOnlyAllowTrustedPopups?: boolean; + parentPopupBrowserID?: number; + /** Initial URL to go to. */ + strInitialURL?: string; + strUserAgentIdentifier?: string; + strUserAgentOverride?: string; + strVROverlayKey?: string; } export interface BrowserViewPopup { - /** - * Blur the popup. - * @param {boolean} enabled - Is the blur enabled? - * @param {boolean} backgroundColor - * @param {boolean} blur - * @returns {void} - * @todo backgroundColor is a bool? Whatever that means - */ - AddGlass(enabled: boolean, backgroundColor: boolean, blur: boolean): void; + /** + * Blur the popup. + * @param {boolean} enabled - Is the blur enabled? + * @param {boolean} backgroundColor + * @param {boolean} blur + * @returns {void} + * @todo backgroundColor is a bool? Whatever that means + */ + AddGlass(enabled: boolean, backgroundColor: boolean, blur: boolean): void; - /** - * Indicates whether you can go backward in history or not. - * @returns {boolean} true if you can go backward in history, false otherwise. - */ - CanGoBackward(): boolean; + /** + * Indicates whether you can go backward in history or not. + * @returns {boolean} true if you can go backward in history, false otherwise. + */ + CanGoBackward(): boolean; - /** - * Indicates whether you can go forward in history or not. - * @returns {boolean} true if you can go forward in history, false otherwise. - */ - CanGoForward(): boolean; + /** + * Indicates whether you can go forward in history or not. + * @returns {boolean} true if you can go forward in history, false otherwise. + */ + CanGoForward(): boolean; - // alert() i assume - DialogResponse(param0: boolean): void; + // alert() i assume + DialogResponse(param0: boolean): void; - EnableSteamInput(): void; + EnableSteamInput(): void; - /** - * Find a string in the page. - * @param {string} input - The string to find. - * @param {boolean} param1 - Additional parameter (exact usage may vary). - * @param {boolean} previous - `true` for previous match, `false` for next match. - * @returns {void} - */ - FindInPage(input: string, param1: boolean, previous: boolean): void; + /** + * Find a string in the page. + * @param {string} input - The string to find. + * @param {boolean} param1 - Additional parameter (exact usage may vary). + * @param {boolean} previous - `true` for previous match, `false` for next match. + * @returns {void} + */ + FindInPage(input: string, param1: boolean, previous: boolean): void; - /** - * Get the current popup position. - * @returns {BrowserViewBounds} The window position. - */ - GetBounds(): BrowserViewBounds; + /** + * Get the current popup position. + * @returns {BrowserViewBounds} The window position. + */ + GetBounds(): BrowserViewBounds; - /** - * Go back in history. - * @returns {void} - */ - GoBack(): void; + /** + * Go back in history. + * @returns {void} + */ + GoBack(): void; - /** - * Go forward in history. - * @returns {void} - */ - GoForward(): void; + /** + * Go forward in history. + * @returns {void} + */ + GoForward(): void; - /** - * @remarks `| number` is used for `BrowserViewContextMenu.custom_commands`. - */ - HandleContextMenuCommand(command: BrowserViewContextMenuCommand | number, param2: BrowserViewContextMenu): void; + /** + * @remarks `| number` is used for `BrowserViewContextMenu.custom_commands`. + */ + HandleContextMenuCommand(command: BrowserViewContextMenuCommand | number, param2: BrowserViewContextMenu): void; - /** - * Load the specified URL. - * @param {string} url - The URL to go to. - * @returns {void} - */ - LoadURL(url: string): void; + /** + * Load the specified URL. + * @param {string} url - The URL to go to. + * @returns {void} + */ + LoadURL(url: string): void; - NotifyUserActivation(): void; + NotifyUserActivation(): void; - /** - * Paste the current clipboard selection. - * @returns {void} - */ - Paste(): void; + /** + * Paste the current clipboard selection. + * @returns {void} + */ + Paste(): void; - PostMessage(message: string, args: string): boolean; + PostMessage(message: string, args: string): boolean; - /** - * Reload the page. - * @returns {void} - */ - Reload(): void; + /** + * Reload the page. + * @returns {void} + */ + Reload(): void; - /** - * Load the specified URL, but don't save history. - * @param {string} url - The URL to go to. - * @returns {void} - */ - ReplaceURL(url: string): void; + /** + * Load the specified URL, but don't save history. + * @param {string} url - The URL to go to. + * @returns {void} + */ + ReplaceURL(url: string): void; - /** - * Define blocked protocols, like https, etc. - * @param protocols The protocols to block, separated by a semicolon. - * @returns {void} - */ - SetBlockedProtocols(protocols: string): void; - - /** - * Sets the browser window position. - * @param {number} x - Browser window X position. - * @param {number} y - Browser window Y position. - * @param {number} width - Browser window width. - * @param {number} height - Browser window height. - * @returns {void} - */ - SetBounds(x: number, y: number, width: number, height: number): void; + /** + * Define blocked protocols, like https, etc. + * @param protocols The protocols to block, separated by a semicolon. + * @returns {void} + */ + SetBlockedProtocols(protocols: string): void; + + /** + * Sets the browser window position. + * @param {number} x - Browser window X position. + * @param {number} y - Browser window Y position. + * @param {number} width - Browser window width. + * @param {number} height - Browser window height. + * @returns {void} + */ + SetBounds(x: number, y: number, width: number, height: number): void; - /** - * Sets the browser window focus state. - * @param {boolean} value - Is the window focused? - * @returns {void} - */ - SetFocus(value: boolean): void; + /** + * Sets the browser window focus state. + * @param {boolean} value - Is the window focused? + * @returns {void} + */ + SetFocus(value: boolean): void; - SetName(browserName: string): void; + SetName(browserName: string): void; - /** - * Registers a callback to be called when a context menu is shown. - * @param {function} callback - The callback function to be called. - */ - SetShowContextMenuCallback(callback: (data: BrowserViewContextMenu) => void): void; + /** + * Registers a callback to be called when a context menu is shown. + * @param {function} callback - The callback function to be called. + */ + SetShowContextMenuCallback(callback: (data: BrowserViewContextMenu) => void): void; - /** - * Registers a callback to be called when a steam:// protocol URL is loaded. - * @returns {void} - */ - SetSteamURLCallback(callback: (steamURL: string) => void): void; + /** + * Registers a callback to be called when a steam:// protocol URL is loaded. + * @returns {void} + */ + SetSteamURLCallback(callback: (steamURL: string) => void): void; - /** - * Raises the browser window. - * @returns {void} - */ - SetTopWindow(): void; + /** + * Raises the browser window. + * @returns {void} + */ + SetTopWindow(): void; - /** - * @todo unconfirmed - */ - SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; + /** + * @todo unconfirmed + */ + SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; - SetVRKeyboardVisibility(value: boolean): void; + SetVRKeyboardVisibility(value: boolean): void; - SetVisible(value: boolean): void; + SetVisible(value: boolean): void; - /** - * Stop the "find in page" function. - * @returns {void} - */ - StopFindInPage(): void; + /** + * Stop the "find in page" function. + * @returns {void} + */ + StopFindInPage(): void; - /** - * Stop listening for an event. - * @param {BrowserViewEvent} event - The event to stop listening to. - * @param {function} callback - The callback function to be called. - * @returns {void} - */ - off(event: BrowserViewEvent, callback: (args: any) => void): void; + /** + * Stop listening for an event. + * @param {BrowserViewEvent} event - The event to stop listening to. + * @param {function} callback - The callback function to be called. + * @returns {void} + */ + off(event: BrowserViewEvent, callback: (args: any) => void): void; - /** - * Start listening for an event. - * @param {BrowserViewEvent} event - The event to start listening to. - * @param {function} callback - The callback function to be called. - * @returns {void} - */ - on(event: BrowserViewEvent, callback: (args: any) => void): void; + /** + * Start listening for an event. + * @param {BrowserViewEvent} event - The event to start listening to. + * @param {function} callback - The callback function to be called. + * @returns {void} + */ + on(event: BrowserViewEvent, callback: (args: any) => void): void; - /** - * Fires when an `alert()` dialog appears. - */ - on(event: 'alert-dialog', callback: (message: string) => void): void; + /** + * Fires when an `alert()` dialog appears. + */ + on(event: 'alert-dialog', callback: (message: string) => void): void; - /** - * Fires when the browser is about to get destroyed. - */ - on(event: 'before-close', callback: () => void): void; + /** + * Fires when the browser is about to get destroyed. + */ + on(event: 'before-close', callback: () => void): void; - /** - * Fires when a URL gets blocked. - * @todo not SetBlockedProtocols, maybe only steam links - */ - on(event: 'blocked-request', callback: (blockedURL: string) => void): void; + /** + * Fires when a URL gets blocked. + * @todo not SetBlockedProtocols, maybe only steam links + */ + on(event: 'blocked-request', callback: (blockedURL: string) => void): void; - /** - * Fires when `CanGoBack() or `CanGoForward()` state changes. - */ - on(event: 'can-go-back-forward-changed', callback: (canGoBackward: boolean, canGoForward: boolean) => void): void; + /** + * Fires when `CanGoBack() or `CanGoForward()` state changes. + */ + on(event: 'can-go-back-forward-changed', callback: (canGoBackward: boolean, canGoForward: boolean) => void): void; - /** - * Fires when a `confirm()` dialog appears. - */ - on(event: 'confirm-dialog', callback: (message: string) => void): void; + /** + * Fires when a `confirm()` dialog appears. + */ + on(event: 'confirm-dialog', callback: (message: string) => void): void; - /** - * Fires when the browser's favicon changes. - */ - on(event: 'favicon-urls-changed', callback: (faviconURLs: string[]) => void): void; + /** + * Fires when the browser's favicon changes. + */ + on(event: 'favicon-urls-changed', callback: (faviconURLs: string[]) => void): void; - /** - * Fires when "Find in page" gets its results. - */ - on(event: 'find-in-page-results', callback: (results: number, activeResultIndex: number) => void): void; + /** + * Fires when "Find in page" gets its results. + */ + on(event: 'find-in-page-results', callback: (results: number, activeResultIndex: number) => void): void; - /** - * Fires when the page finishes loading. - */ - on(event: 'finished-request', callback: (currentURL: string, previousURL: string) => void): void; + /** + * Fires when the page finishes loading. + */ + on(event: 'finished-request', callback: (currentURL: string, previousURL: string) => void): void; - /** - * Fires when the browser goes focused or vice versa. - */ - on(event: 'focus-changed', callback: (focused: boolean) => void): void; + /** + * Fires when the browser goes focused or vice versa. + */ + on(event: 'focus-changed', callback: (focused: boolean) => void): void; - /** - * Fires when the browser goes fullscreen or vice versa. - */ - on(event: 'full-screen', callback: (fullscreen: boolean) => void): void; + /** + * Fires when the browser goes fullscreen or vice versa. + */ + on(event: 'full-screen', callback: (fullscreen: boolean) => void): void; - /** - * Fires when history changes occur. - */ - on(event: 'history-changed', callback: (history: BrowserViewHistory) => void): void; + /** + * Fires when history changes occur. + */ + on(event: 'history-changed', callback: (history: BrowserViewHistory) => void): void; - /** - * Fires when the URL fails to load. - */ - on(event: 'load-error', callback: (errorCode: number, errorURL: string, errorDescription: string) => void): void; + /** + * Fires when the URL fails to load. + */ + on(event: 'load-error', callback: (errorCode: number, errorURL: string, errorDescription: string) => void): void; - /** - * @todo Same as PostMessage? - */ - on(event: 'message', callback: (args: any) => void): void; + /** + * @todo Same as PostMessage? + */ + on(event: 'message', callback: (args: any) => void): void; - on(event: 'new-tab', callback: (args: any) => void): void; + on(event: 'new-tab', callback: (args: any) => void): void; - /** - * Fires when a node gets focused. - */ - on( - event: 'node-has-focus', - callback: (elementIdOrTagName: string, elementTag: string, param2: any, param3: string, param4: boolean) => void, - ): void; + /** + * Fires when a node gets focused. + */ + on( + event: 'node-has-focus', + callback: (elementIdOrTagName: string, elementTag: string, param2: any, param3: string, param4: boolean) => void, + ): void; - on(event: 'page-security', callback: (url: string, pageSecurity: BrowserViewPageSecurity) => void): void; + on(event: 'page-security', callback: (url: string, pageSecurity: BrowserViewPageSecurity) => void): void; - /** - * Fires when the page's `<title>` changes. - */ - on(event: 'set-title', callback: (title: string) => void): void; + /** + * Fires when the page's `<title>` changes. + */ + on(event: 'set-title', callback: (title: string) => void): void; - /** - * Fires when the page starts loading. - */ - on(event: 'start-loading', callback: (url: string, param1: boolean) => void): void; + /** + * Fires when the page starts loading. + */ + on(event: 'start-loading', callback: (url: string, param1: boolean) => void): void; - /** - * Fires when the page starts loading. - */ - on(event: 'start-request', callback: (url: string) => void): void; + /** + * Fires when the page starts loading. + */ + on(event: 'start-request', callback: (url: string) => void): void; - /** - * Fires when "Find in page" gets toggled. - */ - on(event: 'toggle-find-in-page', callback: () => void): void; + /** + * Fires when "Find in page" gets toggled. + */ + on(event: 'toggle-find-in-page', callback: () => void): void; } export interface BrowserViewBounds { - x: number; - y: number; - width: number; - height: number; + x: number; + y: number; + width: number; + height: number; } export interface BrowserViewContextMenuCustomCommand { - id: number; - label: string; + id: number; + label: string; } export interface BrowserViewContextMenu { - /** - * Mouse X position inside the browser view. - */ - coord_x: number; - /** - * Mouse Y position inside the browser view. - */ - coord_y: number; - custom_commands: BrowserViewContextMenuCustomCommand[]; - /** - * Bitmask representing edit state. - * @remarks Appears on editable elements like `<input>`, etc. - * @example - * May be used with BrowserViewContextMenuEditFlag: - * ```js - * edit_state_flags & BrowserViewContextMenuEditFlag.CanCut != 0 // Can cut text - * ``` - */ - edit_state_flags?: number; - /** - * The misspelled word the cursor is on. - * @remarks Appears on an editable element with text. - */ - misspelled_word?: string; - /** - * Browser page URL. - * @todo Appears when there is selected text? - */ - link_url?: string; - /** - * Browser page URL. - */ - page_url: string; - /** - * Selected text. - * @remarks Appears when there is selected text. - */ - selection_text?: string; - /** - * Bitmask representing context menu type. - * @example - * May be used with BrowserViewContextMenuTypeFlag: - * ```js - * type_flags & BrowserViewContextMenuTypeFlag.Selection != 0 // Selected text present - * ``` - */ - type_flags: number; - /** - * Browser page URL. - * @todo Appears when there is selected text? - */ - unfiltered_link_url?: string; + /** + * Mouse X position inside the browser view. + */ + coord_x: number; + /** + * Mouse Y position inside the browser view. + */ + coord_y: number; + custom_commands: BrowserViewContextMenuCustomCommand[]; + /** + * Bitmask representing edit state. + * @remarks Appears on editable elements like `<input>`, etc. + * @example + * May be used with BrowserViewContextMenuEditFlag: + * ```js + * edit_state_flags & BrowserViewContextMenuEditFlag.CanCut != 0 // Can cut text + * ``` + */ + edit_state_flags?: number; + /** + * The misspelled word the cursor is on. + * @remarks Appears on an editable element with text. + */ + misspelled_word?: string; + /** + * Browser page URL. + * @todo Appears when there is selected text? + */ + link_url?: string; + /** + * Browser page URL. + */ + page_url: string; + /** + * Selected text. + * @remarks Appears when there is selected text. + */ + selection_text?: string; + /** + * Bitmask representing context menu type. + * @example + * May be used with BrowserViewContextMenuTypeFlag: + * ```js + * type_flags & BrowserViewContextMenuTypeFlag.Selection != 0 // Selected text present + * ``` + */ + type_flags: number; + /** + * Browser page URL. + * @todo Appears when there is selected text? + */ + unfiltered_link_url?: string; } export interface BrowserViewHistoryEntry { - url: string; + url: string; } export interface BrowserViewHistory { - index: number; - entries: BrowserViewHistoryEntry[]; + index: number; + entries: BrowserViewHistoryEntry[]; } export interface BrowserViewPageSecurity { - bHasCertError: boolean; - bIsEVCert: boolean; - bIsSecure: boolean; - certExpiry: number; - certName: string; - issuerName: string; - nCertBits: number; + bHasCertError: boolean; + bIsEVCert: boolean; + bIsSecure: boolean; + certExpiry: number; + certName: string; + issuerName: string; + nCertBits: number; } export interface ServerBrowserGame { - /** The ID of the game. */ - appid: number; - /** The ID of the game. */ - gameid: string; - /** The game folder. */ - gamedir: string; - /** The game's name. */ - name: string; + /** The ID of the game. */ + appid: number; + /** The ID of the game. */ + gameid: string; + /** The game folder. */ + gamedir: string; + /** The game's name. */ + name: string; } export interface ServerBrowserGameFilter { - /** Has users playing */ - NoEmpty: boolean; - /** Server not full */ - NoFull: boolean; - /** Is not password protected */ - NoPassword: boolean; - /** Anti-cheat */ - Secure: ServerBrowserGameFilterAntiCheat; - /** The ID of the game */ - appid: number; - /** The game folder */ - game: string; - /** Map filter */ - map: string; - /** Latency */ - ping: ServerBrowserGameFilterPing; + /** Has users playing */ + NoEmpty: boolean; + /** Server not full */ + NoFull: boolean; + /** Is not password protected */ + NoPassword: boolean; + /** Anti-cheat */ + Secure: ServerBrowserGameFilterAntiCheat; + /** The ID of the game */ + appid: number; + /** The game folder */ + game: string; + /** Map filter */ + map: string; + /** Latency */ + ping: ServerBrowserGameFilterPing; } export interface ServerBrowserServer { - /** The ID of the game. */ - appid: number; - /** The server IP. */ - ip: string; - /** The server port. */ - port: number; - queryPort: number; - /** Last time played as a UNIX timestamp. */ - lastPlayed: number; + /** The ID of the game. */ + appid: number; + /** The server IP. */ + ip: string; + /** The server port. */ + port: number; + queryPort: number; + /** Last time played as a UNIX timestamp. */ + lastPlayed: number; } export interface ServerBrowserServerFull extends ServerBrowserServer { - /** Do not refresh if had unsuccessful response? */ - bDoNotRefresh: boolean; - /** Found the server? */ - bHadSuccessfulResponse: boolean; - /** Has password? */ - bPassword: boolean; - /** Is VAC secured? */ - bSecure: boolean; - /** How many bot players there currently are. */ - botPlayers: number; - /** The server's game name/description. */ - gameDesc: string; - /** The game folder. */ - gameDir: string; - /** Server tags, separated by a comma. */ - gameTags: string; - /** Current server map. */ - map: string; - /** Max players on the server. */ - maxPlayers: number; - /** The server name. */ - name: string; - /** The latency to the server. */ - ping: number; - /** How many players there currently are. */ - players: number; - /** The server's game version it is running on. */ - serverVersion: number; - steamID: string; + /** Do not refresh if had unsuccessful response? */ + bDoNotRefresh: boolean; + /** Found the server? */ + bHadSuccessfulResponse: boolean; + /** Has password? */ + bPassword: boolean; + /** Is VAC secured? */ + bSecure: boolean; + /** How many bot players there currently are. */ + botPlayers: number; + /** The server's game name/description. */ + gameDesc: string; + /** The game folder. */ + gameDir: string; + /** Server tags, separated by a comma. */ + gameTags: string; + /** Current server map. */ + map: string; + /** Max players on the server. */ + maxPlayers: number; + /** The server name. */ + name: string; + /** The latency to the server. */ + ping: number; + /** How many players there currently are. */ + players: number; + /** The server's game version it is running on. */ + serverVersion: number; + steamID: string; } export interface ServerBrowserFriendServer { - /** The ID of the game. */ - appid: number; - /** Non-Steam server? */ - bNonSteamServer: boolean; - gameText: string; - /** The ID of the game. */ - gameid: string; - steamIDLobby: string; + /** The ID of the game. */ + appid: number; + /** Non-Steam server? */ + bNonSteamServer: boolean; + gameText: string; + /** The ID of the game. */ + gameid: string; + steamIDLobby: string; } export interface ServerBrowserFavoritesAndHistory { - favorites: ServerBrowserServer[]; - history: ServerBrowserServer[]; + favorites: ServerBrowserServer[]; + history: ServerBrowserServer[]; } export interface ServerBrowserPlayerRefreshStatus { - bSuccess: boolean; - bRefreshComplete: boolean; + bSuccess: boolean; + bRefreshComplete: boolean; } export interface ServerBrowserPlayer extends ServerBrowserPlayerRefreshStatus { - /** Player name. */ - playerName: string; - /** Player score. */ - score: number; - /** Time played on the server. */ - timePlayed: number; + /** Player name. */ + playerName: string; + /** Player score. */ + score: number; + /** Time played on the server. */ + timePlayed: number; } export interface ServerBrowserPreferences { - GameList: string; - filters: ServerBrowserTabFilters; + GameList: string; + filters: ServerBrowserTabFilters; } export interface ServerBrowserTabFilters { - favorites: ServerBrowserGameFilter; - friends: ServerBrowserGameFilter; - history: ServerBrowserGameFilter; - internet: ServerBrowserGameFilter; - lan: ServerBrowserGameFilter; + favorites: ServerBrowserGameFilter; + friends: ServerBrowserGameFilter; + history: ServerBrowserGameFilter; + internet: ServerBrowserGameFilter; + lan: ServerBrowserGameFilter; } export interface ServerBrowserDialog { - dialogID: number; - ip: number; - port: number; - queryPort: number; + dialogID: number; + ip: number; + port: number; + queryPort: number; } export interface FileDialog { - /** Whether to choose a directory instead. */ - bChooseDirectory?: boolean; - /** - * Array of file filters. - * @example - * Example from the "Add a Non-Steam Game" dialog: - * ``` - * [ - * { - * strFileTypeName: LocalizationManager.LocalizeString("#AddNonSteam_Filter_Exe_Linux"), - * rFilePatterns: [ "*.application", "*.exe", "*.sh", "*.AppImage" ], - * bUseAsDefault: true, - * }, - * { - * strFileTypeName: LocalizationManager.LocalizeString("#AddNonSteam_Filter_All"), - * rFilePatterns: [ "*" ], - * } - * ] - * ``` - */ - rgFilters?: FileDialogFilter[]; - /** Initially selected file. */ - strInitialFile?: string; - /** Window title. */ - strTitle?: string; + /** Whether to choose a directory instead. */ + bChooseDirectory?: boolean; + /** + * Array of file filters. + * @example + * Example from the "Add a Non-Steam Game" dialog: + * ``` + * [ + * { + * strFileTypeName: LocalizationManager.LocalizeString("#AddNonSteam_Filter_Exe_Linux"), + * rFilePatterns: [ "*.application", "*.exe", "*.sh", "*.AppImage" ], + * bUseAsDefault: true, + * }, + * { + * strFileTypeName: LocalizationManager.LocalizeString("#AddNonSteam_Filter_All"), + * rFilePatterns: [ "*" ], + * } + * ] + * ``` + */ + rgFilters?: FileDialogFilter[]; + /** Initially selected file. */ + strInitialFile?: string; + /** Window title. */ + strTitle?: string; } export interface FileDialogFilter { - /** A localization string for the file type. */ - strFileTypeName: string; - /** - * File patterns. - * @example [ "*.application", "*.exe", "*.sh", "*.AppImage" ] - */ - rFilePatterns: string[]; - /** Whether to use this filter by default. */ - bUseAsDefault?: boolean; + /** A localization string for the file type. */ + strFileTypeName: string; + /** + * File patterns. + * @example [ "*.application", "*.exe", "*.sh", "*.AppImage" ] + */ + rFilePatterns: string[]; + /** Whether to use this filter by default. */ + bUseAsDefault?: boolean; } export interface OSEndOfLifeInfo { - bOSWillBeUnsupported: boolean; - osType: OSType; + bOSWillBeUnsupported: boolean; + osType: OSType; } export interface SteamURL { - url: string; - /** - * @todo enum? - */ - feature: number; + url: string; + /** + * @todo enum? + */ + feature: number; } export interface SteamURLs { - CommunityImages: SteamURL; - StoreAppImages: SteamURL; - BaseURLSharedCDN: SteamURL; - ClanAssetCDN: SteamURL; - CommunityCDN: SteamURL; - AvatarBaseURL: SteamURL; - StoreCDN: SteamURL; - WebAPI: SteamURL; - LocalSSA: SteamURL; + CommunityImages: SteamURL; + StoreAppImages: SteamURL; + BaseURLSharedCDN: SteamURL; + ClanAssetCDN: SteamURL; + CommunityCDN: SteamURL; + AvatarBaseURL: SteamURL; + StoreCDN: SteamURL; + WebAPI: SteamURL; + LocalSSA: SteamURL; } export interface SteamWindow { - appid: number; - hwndParent: number; - nBrowserID: number; - strAppName: string; - unID: number; - unPID: number; - windowType: number; - x: number; - y: number; + appid: number; + hwndParent: number; + nBrowserID: number; + strAppName: string; + unID: number; + unPID: number; + windowType: number; + x: number; + y: number; } export interface TransportInfo { - authKeyClientdll: string; - authKeySteamUI: string; - portClientdll: number; - portSteamUI: number; + authKeyClientdll: string; + authKeySteamUI: string; + portClientdll: number; + portSteamUI: number; } export interface FriendChatDialog { - browserid: number; - btakefocus: string; - command: string; - pid: number; - steamid: string; + browserid: number; + btakefocus: string; + command: string; + pid: number; + steamid: string; } export interface FriendChatDialogData { - data: FriendChatDialog; + data: FriendChatDialog; } export interface PushToTalkInfo { - /** Indicates whether push-to-talk is enabled. */ - bEnabled: boolean; - /** Indicates whether push-to-mute is in use instead. */ - bPushToMute: boolean; - /** - * Push-to-talk hotkey. - * @todo enum? - */ - vkHotKey: number; - /** Push-to-talk hotkey name. */ - strKeyName: string; + /** Indicates whether push-to-talk is enabled. */ + bEnabled: boolean; + /** Indicates whether push-to-mute is in use instead. */ + bPushToMute: boolean; + /** + * Push-to-talk hotkey. + * @todo enum? + */ + vkHotKey: number; + /** Push-to-talk hotkey name. */ + strKeyName: string; } export interface NotificationOptions { - body: string; - chatroomgroupid?: number; - chatroomid?: number; - icon?: string; - state: string; - /** A Steam64 ID. */ - steamid: string; - tag?: string; - title?: string; + body: string; + chatroomgroupid?: number; + chatroomid?: number; + icon?: string; + state: string; + /** A Steam64 ID. */ + steamid: string; + tag?: string; + title?: string; } export interface LogonInfo { - bLoggedOn: boolean; - eUniverse: SteamRealm; - strAccountName: string; - strCommunityImagesURL: string; - strPersonaName: string; - /** Steam64 ID. */ - strSteamid: string; - /** Country code. */ - strUserCountry: string; + bLoggedOn: boolean; + eUniverse: SteamRealm; + strAccountName: string; + strCommunityImagesURL: string; + strPersonaName: string; + /** Steam64 ID. */ + strSteamid: string; + /** Country code. */ + strUserCountry: string; } export interface GameWindowInfo { - bCanClose: boolean; - strTitle: string; - windowid: number; + bCanClose: boolean; + strTitle: string; + windowid: number; } export interface FocusedApp { - appid: number; - pid: number; - windowid: number; - strExeName: string; + appid: number; + pid: number; + windowid: number; + strExeName: string; } export interface FocusChangeEvent { - focusedApp: FocusedApp; - rgFocusable: FocusedApp[]; + focusedApp: FocusedApp; + rgFocusable: FocusedApp[]; } export enum AppArtworkAssetType { - Capsule = 0, - Hero = 1, - Logo = 2, - Header = 3, - Icon = 4, - HeroBlur = 5, + Capsule = 0, + Hero = 1, + Logo = 2, + Header = 3, + Icon = 4, + HeroBlur = 5, } export enum UIComposition { - Hidden = 0, - Notification = 1, - Overlay = 2, - Opaque = 3, - OverlayKeyboard = 4, // Unverified + Hidden = 0, + Notification = 1, + Overlay = 2, + Opaque = 3, + OverlayKeyboard = 4, // Unverified } export enum OSType { - Web = -700, - Ios = -600, - Android = -500, - Android6 = -499, - Android7 = -498, - Android8 = -497, - Android9 = -496, - Ps3os = -300, - Linux = -203, - Linux22 = -202, - Linux24 = -201, - Linux26 = -200, - Linux32 = -199, - Linux35 = -198, - Linux36 = -197, - Linux310 = -196, - Linux316 = -195, - Linux318 = -194, - Linux3x = -193, - Linux4x = -192, - Linux41 = -191, - Linux44 = -190, - Linux49 = -189, - Linux414 = -188, - Linux419 = -187, - Linux5x = -186, - Linux54 = -185, - Linux6x = -184, - Linux7x = -183, - Linux510 = -182, - Macos = -102, - Macos104 = -101, - Macos105 = -100, - Macos1058 = -99, - Macos106_unused1 = -98, - Macos106_unused2 = -97, - Macos106_unused3 = -96, - Macos106 = -95, - Macos1063 = -94, - Macos1064_slgu = -93, - Macos1067 = -92, - Macos1067_unused = -91, - Macos107 = -90, - Macos108 = -89, - Macos109 = -88, - Macos1010 = -87, - Macos1011 = -86, - Macos1012 = -85, - Macos1013 = -84, - Macos1014 = -83, - Macos1015 = -82, - Macos1016 = -81, - Macos11 = -80, - Macos111 = -79, - Macos1017 = -78, - Macos12 = -77, - Macos1018 = -76, - Macos13 = -75, - Macos1019 = -74, - Macos14 = -73, - Macos1020 = -72, - Macos15 = -71, - Unknown = -1, - Windows = 0, - Win311 = 1, - Win95 = 2, - Win98 = 3, - WinME = 4, - WinNT = 5, - Win200 = 6, - WinXP = 7, - Win2003 = 8, - WinVista = 9, - Win7 = 10, - Win2008 = 11, - Win2012 = 12, - Win8 = 13, - Win81 = 14, - Win2012R2 = 15, - Win10 = 16, - Win2016 = 17, - Win2019 = 18, - Win2022 = 19, - Win11 = 20, + Web = -700, + Ios = -600, + Android = -500, + Android6 = -499, + Android7 = -498, + Android8 = -497, + Android9 = -496, + Ps3os = -300, + Linux = -203, + Linux22 = -202, + Linux24 = -201, + Linux26 = -200, + Linux32 = -199, + Linux35 = -198, + Linux36 = -197, + Linux310 = -196, + Linux316 = -195, + Linux318 = -194, + Linux3x = -193, + Linux4x = -192, + Linux41 = -191, + Linux44 = -190, + Linux49 = -189, + Linux414 = -188, + Linux419 = -187, + Linux5x = -186, + Linux54 = -185, + Linux6x = -184, + Linux7x = -183, + Linux510 = -182, + Macos = -102, + Macos104 = -101, + Macos105 = -100, + Macos1058 = -99, + Macos106_unused1 = -98, + Macos106_unused2 = -97, + Macos106_unused3 = -96, + Macos106 = -95, + Macos1063 = -94, + Macos1064_slgu = -93, + Macos1067 = -92, + Macos1067_unused = -91, + Macos107 = -90, + Macos108 = -89, + Macos109 = -88, + Macos1010 = -87, + Macos1011 = -86, + Macos1012 = -85, + Macos1013 = -84, + Macos1014 = -83, + Macos1015 = -82, + Macos1016 = -81, + Macos11 = -80, + Macos111 = -79, + Macos1017 = -78, + Macos12 = -77, + Macos1018 = -76, + Macos13 = -75, + Macos1019 = -74, + Macos14 = -73, + Macos1020 = -72, + Macos15 = -71, + Unknown = -1, + Windows = 0, + Win311 = 1, + Win95 = 2, + Win98 = 3, + WinME = 4, + WinNT = 5, + Win200 = 6, + WinXP = 7, + Win2003 = 8, + WinVista = 9, + Win7 = 10, + Win2008 = 11, + Win2012 = 12, + Win8 = 13, + Win81 = 14, + Win2012R2 = 15, + Win10 = 16, + Win2016 = 17, + Win2019 = 18, + Win2022 = 19, + Win11 = 20, } export enum ControllerType { - None = -1, - Unknown = 0, - UnknownSteamController = 1, - SteamController = 2, // Codename Gordon - SteamControllerV2 = 3, // Codename Headcrab - SteamControllerNeptune = 4, // Steam Deck - FrontPanelBoard = 20, - Generic = 30, - XBox360Controller = 31, - XBoxOneController = 32, - PS3Controller = 33, - PS4Controller = 34, - WiiController = 35, - AppleController = 36, - AndroidController = 37, - SwitchProController = 38, - SwitchJoyConLeft = 39, - SwitchJoyConRight = 40, - SwitchJoyConPair = 41, - SwitchProGenericInputOnlyController = 42, - MobileTouch = 43, - SwitchProXInputSwitchController = 44, - PS5Controller = 45, - XboxEliteController = 46, - LastController = 47, // Unverified - PS5EdgeController = 48, - GenericKeyboard = 400, - GenericMouse = 800, + None = -1, + Unknown = 0, + UnknownSteamController = 1, + SteamController = 2, // Codename Gordon + SteamControllerV2 = 3, // Codename Headcrab + SteamControllerNeptune = 4, // Steam Deck + FrontPanelBoard = 20, + Generic = 30, + XBox360Controller = 31, + XBoxOneController = 32, + PS3Controller = 33, + PS4Controller = 34, + WiiController = 35, + AppleController = 36, + AndroidController = 37, + SwitchProController = 38, + SwitchJoyConLeft = 39, + SwitchJoyConRight = 40, + SwitchJoyConPair = 41, + SwitchProGenericInputOnlyController = 42, + MobileTouch = 43, + SwitchProXInputSwitchController = 44, + PS5Controller = 45, + XboxEliteController = 46, + LastController = 47, // Unverified + PS5EdgeController = 48, + GenericKeyboard = 400, + GenericMouse = 800, } export enum FilePrivacyState { - Invalid = -1, - Private = 2, - FriendsOnly = 4, - Public = 8, - Unlisted = 16, + Invalid = -1, + Private = 2, + FriendsOnly = 4, + Public = 8, + Unlisted = 16, } export enum BluetoothDeviceType { - Invalid = 0, - Unknown = 1, - Phone = 2, - Computer = 3, - Headset = 4, - Headphones = 5, - Speakers = 6, - OtherAudio = 7, - Mouse = 8, - Joystick = 9, - Gamepad = 10, - Keyboard = 11, + Invalid = 0, + Unknown = 1, + Phone = 2, + Computer = 3, + Headset = 4, + Headphones = 5, + Speakers = 6, + OtherAudio = 7, + Mouse = 8, + Joystick = 9, + Gamepad = 10, + Keyboard = 11, } export enum AppAssociationType { - Invalid = 0, - Publisher = 1, - Developer = 2, - Franchise = 3, + Invalid = 0, + Publisher = 1, + Developer = 2, + Franchise = 3, } 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, + 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 enum AppCloudStatus { - Invalid = 0, - Disabled = 1, - Unknown = 2, - Synchronized = 3, - Checking = 4, - OutOfSync = 5, - Uploading = 6, - Downloading = 7, - SyncFailed = 8, - Conflict = 9, - PendingElsewhere = 10, + Invalid = 0, + Disabled = 1, + Unknown = 2, + Synchronized = 3, + Checking = 4, + OutOfSync = 5, + Uploading = 6, + Downloading = 7, + SyncFailed = 8, + Conflict = 9, + PendingElsewhere = 10, } export enum SteamDeckCompatibilityCategory { - Unknown = 0, - Unsupported = 1, - Playable = 2, - Verified = 3, + Unknown = 0, + Unsupported = 1, + Playable = 2, + Verified = 3, } export enum ACState { - Unknown = 0, - Disconnected = 1, - Connected = 2, - ConnectedSlow = 3, + Unknown = 0, + Disconnected = 1, + Connected = 2, + ConnectedSlow = 3, } export enum BatteryState { - Unknown = 0, - Discharging = 1, - Charging = 2, - Full = 3, + Unknown = 0, + Discharging = 1, + Charging = 2, + Full = 3, } export enum OSBranchType { - Unknown = 0, - Release = 1, - ReleaseCandidate = 2, - Beta = 3, - BetaCandidate = 4, - Main = 5, - Staging = 6, + Unknown = 0, + Release = 1, + ReleaseCandidate = 2, + Beta = 3, + BetaCandidate = 4, + Main = 5, + Staging = 6, } export enum AppOwnershipFlags { - None = 0, - Subscribed = 1, - Free = 2, - RegionRestricted = 4, - LowViolence = 8, - InvalidPlatform = 16, - Borrowed = 32, - FreeWeekend = 64, - Retail = 128, - Locked = 256, - Pending = 512, - Expired = 1024, - Permanent = 2048, - Recurring = 4096, - Canceled = 8192, - AutoGrant = 16384, - PendingGift = 32768, - RentalNotActivated = 65536, - Rental = 131072, - SiteLicense = 262144, - LegacyFreeSub = 524288, - InvalidOSType = 1048576, - TimedTrial = 2097152, + None = 0, + Subscribed = 1, + Free = 2, + RegionRestricted = 4, + LowViolence = 8, + InvalidPlatform = 16, + Borrowed = 32, + FreeWeekend = 64, + Retail = 128, + Locked = 256, + Pending = 512, + Expired = 1024, + Permanent = 2048, + Recurring = 4096, + Canceled = 8192, + AutoGrant = 16384, + PendingGift = 32768, + RentalNotActivated = 65536, + Rental = 131072, + SiteLicense = 262144, + LegacyFreeSub = 524288, + InvalidOSType = 1048576, + TimedTrial = 2097152, } export enum AppError { - None = 0, - Unspecified = 1, - Paused = 2, - Canceled = 3, - Suspended = 4, - NoSubscription = 5, - NoConnection = 6, - Timeout = 7, - MissingKey = 8, - MissingConfig = 9, - DiskReadFailure = 10, - DiskWriteFailure = 11, - NotEnoughDiskSpace = 12, - CorruptGameFiles = 13, - WaitingForNextDisk = 14, - InvalidInstallPath = 15, - AppRunning = 16, - DependencyFailure = 17, - NotInstalled = 18, - UpdateRequired = 19, - Busy = 20, - NoDownloadSources = 21, - InvalidAppConfig = 22, - InvalidDepotConfig = 23, - MissingManifest = 24, - NotReleased = 25, - RegionRestricted = 26, - CorruptDepotCache = 27, - MissingExecutable = 28, - InvalidPlatform = 29, - InvalidFileSystem = 30, - CorruptUpdateFiles = 31, - DownloadDisabled = 32, - SharedLibraryLocked = 33, - PendingLicense = 34, - OtherSessionPlaying = 35, - CorruptDownload = 36, - CorruptDisk = 37, - FilePermissions = 38, - FileLocked = 39, - MissingContent = 40, - Requires64BitOS = 41, - MissingUpdateFiles = 42, - NotEnoughDiskQuota = 43, - LockedSiteLicense = 44, - ParentalBlocked = 45, - SpawnProcess = 46, - ClientOutOfDate = 47, - PlaytimeExceeded = 48, - CorruptFileSignature = 49, - MissingGameFiles = 50, - CompatToolFailed = 51, - RemovedInstallPath = 52, - InvalidBackupPath = 53, - InvalidPasscode = 54, - SelfUpdating = 55, - ParentalPlaytimeExceeded = 56, - Max = 57, + None = 0, + Unspecified = 1, + Paused = 2, + Canceled = 3, + Suspended = 4, + NoSubscription = 5, + NoConnection = 6, + Timeout = 7, + MissingKey = 8, + MissingConfig = 9, + DiskReadFailure = 10, + DiskWriteFailure = 11, + NotEnoughDiskSpace = 12, + CorruptGameFiles = 13, + WaitingForNextDisk = 14, + InvalidInstallPath = 15, + AppRunning = 16, + DependencyFailure = 17, + NotInstalled = 18, + UpdateRequired = 19, + Busy = 20, + NoDownloadSources = 21, + InvalidAppConfig = 22, + InvalidDepotConfig = 23, + MissingManifest = 24, + NotReleased = 25, + RegionRestricted = 26, + CorruptDepotCache = 27, + MissingExecutable = 28, + InvalidPlatform = 29, + InvalidFileSystem = 30, + CorruptUpdateFiles = 31, + DownloadDisabled = 32, + SharedLibraryLocked = 33, + PendingLicense = 34, + OtherSessionPlaying = 35, + CorruptDownload = 36, + CorruptDisk = 37, + FilePermissions = 38, + FileLocked = 39, + MissingContent = 40, + Requires64BitOS = 41, + MissingUpdateFiles = 42, + NotEnoughDiskQuota = 43, + LockedSiteLicense = 44, + ParentalBlocked = 45, + SpawnProcess = 46, + ClientOutOfDate = 47, + PlaytimeExceeded = 48, + CorruptFileSignature = 49, + MissingGameFiles = 50, + CompatToolFailed = 51, + RemovedInstallPath = 52, + InvalidBackupPath = 53, + InvalidPasscode = 54, + SelfUpdating = 55, + ParentalPlaytimeExceeded = 56, + Max = 57, } export enum ClientBetaState { - None = 0, - NoneChosen = 1, - NoneChosenNonAdmin = 2, - InBeta = 3, - InBetaNonAdmin = 4, + None = 0, + NoneChosen = 1, + NoneChosenNonAdmin = 2, + InBeta = 3, + InBetaNonAdmin = 4, } export enum ConnectivityTestResult { - Unknown = 0, - Connected = 1, - CaptivePortal = 2, - TimedOut = 3, - Failed = 4, - WifiDisabled = 5, - NoLAN = 6, + Unknown = 0, + Connected = 1, + CaptivePortal = 2, + TimedOut = 3, + Failed = 4, + WifiDisabled = 5, + NoLAN = 6, } export enum ControllerRumbleSetting { - ControllerPreference = 0, - Off = 1, - On = 2, + ControllerPreference = 0, + Off = 1, + On = 2, } export enum AppControllerSupportLevel { - None = 0, - Partial = 1, - Full = 2, + None = 0, + Partial = 1, + Full = 2, } export enum AppType { - DepotOnly = -2147483648, - Invalid = 0, - Game = 1, - Application = 2, - Tool = 4, - Demo = 8, - Deprecated = 16, - DLC = 32, - Guide = 64, - Driver = 128, - Config = 256, - Hardware = 512, - Franchise = 1024, - Video = 2048, - Plugin = 4096, - MusicAlbum = 8192, - Series = 16384, - Comic = 32768, - Beta = 65536, - Shortcut = 1073741824, + DepotOnly = -2147483648, + Invalid = 0, + Game = 1, + Application = 2, + Tool = 4, + Demo = 8, + Deprecated = 16, + DLC = 32, + Guide = 64, + Driver = 128, + Config = 256, + Hardware = 512, + Franchise = 1024, + Video = 2048, + Plugin = 4096, + MusicAlbum = 8192, + Series = 16384, + Comic = 32768, + Beta = 65536, + Shortcut = 1073741824, } export enum AutoUpdateBehavior { - Always = 0, // (Always keep this game updated) - Launch = 1, // (Only update this game when I launch it) - HighPriority = 2, // (High priority) + Always = 0, // (Always keep this game updated) + Launch = 1, // (Only update this game when I launch it) + HighPriority = 2, // (High priority) } export enum BackgroundDownloadsBehavior { - Pause = 0, - Always = 1, - Never = 2, + Pause = 0, + Always = 1, + Never = 2, } export enum SteamRealm { - Unknown = 0, - Global = 1, - China = 2, + Unknown = 0, + Global = 1, + China = 2, } /** * @remarks Not present in any of the Steam files, source: https://gist.github.com/Ne3tCode/fc424ae2bd723d9ccb236eeccce66316#file-steammobile_friendsui_enums-steamd-L1308-L1340 */ export enum AppLaunchSource { - None = 0, - _2ftLibraryDetails = 100, - _2ftLibraryListView = 101, - _2ftLibraryGrid = 103, - InstallSubComplete = 104, - DownloadsPage = 105, - RemoteClientStartStreaming = 106, - _2ftMiniModeList = 107, - _10ft = 200, - DashAppLaunchCmdLine = 300, - DashGameIdLaunchCmdLine = 301, - RunByGameDir = 302, - SubCmdRunDashGame = 303, - SteamURL_Launch = 400, - SteamURL_Run = 401, - SteamURL_JoinLobby = 402, - SteamURL_RunGame = 403, - SteamURL_RunGameIdOrJumplist = 404, - SteamURL_RunSafe = 405, - TrayIcon = 500, - LibraryLeftColumnContextMenu = 600, - LibraryLeftColumnDoubleClick = 601, - Dota2Launcher = 700, - IRunGameEngine = 800, - DRMFailureResponse = 801, - DRMDataRequest = 802, - CloudFilePanel = 803, - DiscoveredAlreadyRunning = 804, - GameActionJoinParty = 900, - AppPortraitContextMenu = 1000, + None = 0, + _2ftLibraryDetails = 100, + _2ftLibraryListView = 101, + _2ftLibraryGrid = 103, + InstallSubComplete = 104, + DownloadsPage = 105, + RemoteClientStartStreaming = 106, + _2ftMiniModeList = 107, + _10ft = 200, + DashAppLaunchCmdLine = 300, + DashGameIdLaunchCmdLine = 301, + RunByGameDir = 302, + SubCmdRunDashGame = 303, + SteamURL_Launch = 400, + SteamURL_Run = 401, + SteamURL_JoinLobby = 402, + SteamURL_RunGame = 403, + SteamURL_RunGameIdOrJumplist = 404, + SteamURL_RunSafe = 405, + TrayIcon = 500, + LibraryLeftColumnContextMenu = 600, + LibraryLeftColumnDoubleClick = 601, + Dota2Launcher = 700, + IRunGameEngine = 800, + DRMFailureResponse = 801, + DRMDataRequest = 802, + CloudFilePanel = 803, + DiscoveredAlreadyRunning = 804, + GameActionJoinParty = 900, + AppPortraitContextMenu = 1000, } export enum AppLaunchOptionType { - None = 0, - Default = 1, - SafeMode = 2, - Multiplayer = 3, - Config = 4, - OpenVR = 5, - Server = 6, - Editor = 7, - Manual = 8, - Benchmark = 9, - Option1 = 10, - Option2 = 11, - Option3 = 12, - OculusVR = 13, - OpenVROverlay = 14, - OSVR = 15, - OpenXR = 16, - Dialog = 1e3, + None = 0, + Default = 1, + SafeMode = 2, + Multiplayer = 3, + Config = 4, + OpenVR = 5, + Server = 6, + Editor = 7, + Manual = 8, + Benchmark = 9, + Option1 = 10, + Option2 = 11, + Option3 = 12, + OculusVR = 13, + OpenVROverlay = 14, + OSVR = 15, + OpenXR = 16, + Dialog = 1e3, } /** * @remarks Not present in any of the Steam files. This is only present as localization strings, whose tokens start with `#Steam_AppUpdateError_`. */ export enum AppUpdateError { - None = 0, - Unspecified = 1, - Paused = 2, - Canceled = 3, - Suspended = 4, - NoSubscription = 5, - NoConnection = 6, - Timeout = 7, - MissingKey = 8, - MissingConfig = 9, - DiskReadFailure = 10, - DiskWriteFailure = 11, - NotEnoughDiskSpace = 12, - CorruptGameFiles = 13, - WaitingForNextDisk = 14, - InvalidInstallPath = 15, - AppRunning = 16, - DependencyFailure = 17, - NotInstalled = 18, - UpdateRequired = 19, - Busy = 20, - NoDownloadSources = 21, - InvalidAppConfig = 22, - InvalidDepotConfig = 23, - MissingManifest = 24, - NotReleased = 25, - RegionRestricted = 26, - CorruptDepotCache = 27, - MissingExecutable = 28, - InvalidPlatform = 29, - InvalidFileSystem = 30, - CorruptUpdateFiles = 31, - DownloadDisabled = 32, - SharedLibraryLocked = 33, - PendingLicense = 34, - OtherSessionPlaying = 35, - CorruptDownload = 36, - CorruptDisk = 37, - FilePermissions = 38, - FileLocked = 39, - MissingContent = 40, - Requires64BitOS = 41, - MissingUpdateFiles = 42, - NotEnoughDiskQuota = 43, - LockedSiteLicense = 44, - ParentalControlBlocked = 45, - CreateProcessFailure = 46, - SteamClientOutdated = 47, - PlaytimeExceeded = 48, - CorruptFileSignature = 49, - MissingInstalledFiles = 50, - CompatibilityToolFailure = 51, - UnmountedUninstallPath = 52, - InvalidBackupPath = 53, - InvalidPasscode = 54, - ThirdPartyUpdater = 55, - ParentalPlaytimeExceeded = 56, + None = 0, + Unspecified = 1, + Paused = 2, + Canceled = 3, + Suspended = 4, + NoSubscription = 5, + NoConnection = 6, + Timeout = 7, + MissingKey = 8, + MissingConfig = 9, + DiskReadFailure = 10, + DiskWriteFailure = 11, + NotEnoughDiskSpace = 12, + CorruptGameFiles = 13, + WaitingForNextDisk = 14, + InvalidInstallPath = 15, + AppRunning = 16, + DependencyFailure = 17, + NotInstalled = 18, + UpdateRequired = 19, + Busy = 20, + NoDownloadSources = 21, + InvalidAppConfig = 22, + InvalidDepotConfig = 23, + MissingManifest = 24, + NotReleased = 25, + RegionRestricted = 26, + CorruptDepotCache = 27, + MissingExecutable = 28, + InvalidPlatform = 29, + InvalidFileSystem = 30, + CorruptUpdateFiles = 31, + DownloadDisabled = 32, + SharedLibraryLocked = 33, + PendingLicense = 34, + OtherSessionPlaying = 35, + CorruptDownload = 36, + CorruptDisk = 37, + FilePermissions = 38, + FileLocked = 39, + MissingContent = 40, + Requires64BitOS = 41, + MissingUpdateFiles = 42, + NotEnoughDiskQuota = 43, + LockedSiteLicense = 44, + ParentalControlBlocked = 45, + CreateProcessFailure = 46, + SteamClientOutdated = 47, + PlaytimeExceeded = 48, + CorruptFileSignature = 49, + MissingInstalledFiles = 50, + CompatibilityToolFailure = 51, + UnmountedUninstallPath = 52, + InvalidBackupPath = 53, + InvalidPasscode = 54, + ThirdPartyUpdater = 55, + ParentalPlaytimeExceeded = 56, } export enum ClientUINotification { - GroupChatMessage = 1, - FriendChatMessage = 2, - FriendPersonaState = 3, + GroupChatMessage = 1, + FriendChatMessage = 2, + FriendPersonaState = 3, } export enum MusicRepeatStatus { - None = 0, - All = 1, - Once = 2, - Max = 3, + None = 0, + All = 1, + Once = 2, + Max = 3, } export enum JoinServerError { - PingFailed = -3, - Connecting = -2, - Pinging = -1, - None = 0, - VACBanned = 1, - ServerFull = 2, - ModNotInstalled = 3, - AppNotFound = 4, - NotInitialized = 5, + PingFailed = -3, + Connecting = -2, + Pinging = -1, + None = 0, + VACBanned = 1, + ServerFull = 2, + ModNotInstalled = 3, + AppNotFound = 4, + NotInitialized = 5, } export enum ServerBrowserGameFilterAntiCheat { - All = 0, - Secure = 1, - NotSecure = 2, + All = 0, + Secure = 1, + NotSecure = 2, } export enum ServerBrowserGameFilterPing { - All = 0, - LessThan50 = 50, - LessThan100 = 100, - LessThan150 = 150, - LessThan250 = 250, + All = 0, + LessThan50 = 50, + LessThan100 = 100, + LessThan150 = 150, + LessThan250 = 250, } export enum UIMode { - Unknown = -1, - GamePad = 4, - Desktop = 7, + Unknown = -1, + GamePad = 4, + Desktop = 7, } export enum WindowBringToFront { - Invalid = 0, - ForceOS = 1, - WithoutForcingOS = 2, + Invalid = 0, + ForceOS = 1, + WithoutForcingOS = 2, } export enum ComputerActiveState { - Invalid = 0, - Active = 1, - Idle = 2, + Invalid = 0, + Active = 1, + Idle = 2, } export enum ClientUsedInputType { - Keyboard = 0, - Mouse = 1, - Controller = 2, - Max = 3, + Keyboard = 0, + Mouse = 1, + Controller = 2, + Max = 3, } export enum TouchGestureType { - None = 0, - Touch = 1, - Tap = 2, - DoubleTap = 3, - ShortPress = 4, - LongPress = 5, - LongTap = 6, - TwoFingerTap = 7, - TapCancelled = 8, - PinchBegin = 9, - PinchUpdate = 10, - PinchEnd = 11, - FlingStart = 12, - FlingCancelled = 13, + None = 0, + Touch = 1, + Tap = 2, + DoubleTap = 3, + ShortPress = 4, + LongPress = 5, + LongTap = 6, + TwoFingerTap = 7, + TapCancelled = 8, + PinchBegin = 9, + PinchUpdate = 10, + PinchEnd = 11, + FlingStart = 12, + FlingCancelled = 13, } export enum BrowserViewContextMenuCommand { - Close = -1, - OpenDevTools = 26500, - CloseDevTools = 26501, - InspectElement = 26502, - OpenLinkInNewTab = 26503, + Close = -1, + OpenDevTools = 26500, + CloseDevTools = 26501, + InspectElement = 26502, + OpenLinkInNewTab = 26503, } export enum BrowserViewContextMenuTypeFlag { - None = 0, - Page = 1 << 0, - Frame = 1 << 1, - Link = 1 << 2, - Media = 1 << 3, - Selection = 1 << 4, - Editable = 1 << 5, + None = 0, + Page = 1 << 0, + Frame = 1 << 1, + Link = 1 << 2, + Media = 1 << 3, + Selection = 1 << 4, + Editable = 1 << 5, } export enum BrowserViewContextMenuEditFlag { - None = 0, - CanUndo = 1 << 0, - CanRedo = 1 << 1, - CanCut = 1 << 2, - CanCopy = 1 << 3, - CanPaste = 1 << 4, - CanDelete = 1 << 5, - CanSelectAll = 1 << 6, - CanTranslate = 1 << 7, + None = 0, + CanUndo = 1 << 0, + CanRedo = 1 << 1, + CanCut = 1 << 2, + CanCopy = 1 << 3, + CanPaste = 1 << 4, + CanDelete = 1 << 5, + CanSelectAll = 1 << 6, + CanTranslate = 1 << 7, } export enum Result { - OK = 1, - Fail = 2, - NoConnection = 3, - InvalidPassword = 5, - LoggedInElsewhere = 6, - InvalidProtocolVer = 7, - InvalidParam = 8, - FileNotFound = 9, - Busy = 10, - InvalidState = 11, - InvalidName = 12, - InvalidEmail = 13, - DuplicateName = 14, - AccessDenied = 15, - Timeout = 16, - Banned = 17, - AccountNotFound = 18, - InvalidSteamID = 19, - ServiceUnavailable = 20, - NotLoggedOn = 21, - Pending = 22, - EncryptionFailure = 23, - InsufficientPrivilege = 24, - LimitExceeded = 25, - Revoked = 26, - Expired = 27, - AlreadyRedeemed = 28, - DuplicateRequest = 29, - AlreadyOwned = 30, - IPNotFound = 31, - PersistFailed = 32, - LockingFailed = 33, - LogonSessionReplaced = 34, - ConnectFailed = 35, - HandshakeFailed = 36, - IOFailure = 37, - RemoteDisconnect = 38, - ShoppingCartNotFound = 39, - Blocked = 40, - Ignored = 41, - NoMatch = 42, - AccountDisabled = 43, - ServiceReadOnly = 44, - AccountNotFeatured = 45, - AdministratorOK = 46, - ContentVersion = 47, - TryAnotherCM = 48, - PasswordRequiredToKickSession = 49, - AlreadyLoggedInElsewhere = 50, - Suspended = 51, - Cancelled = 52, - DataCorruption = 53, - DiskFull = 54, - RemoteCallFailed = 55, - PasswordUnset = 56, - ExternalAccountUnlinked = 57, - PSNTicketInvalid = 58, - ExternalAccountAlreadyLinked = 59, - RemoteFileConflict = 60, - IllegalPassword = 61, - SameAsPreviousValue = 62, - AccountLogonDenied = 63, - CannotUseOldPassword = 64, - InvalidLoginAuthCode = 65, - AccountLogonDeniedNoMail = 66, - HardwareNotCapableOfIPT = 67, - IPTInitError = 68, - ParentalControlRestricted = 69, - FacebookQueryError = 70, - ExpiredLoginAuthCode = 71, - IPLoginRestrictionFailed = 72, - AccountLockedDown = 73, - AccountLogonDeniedVerifiedEmailRequired = 74, - NoMatchingURL = 75, - BadResponse = 76, - RequirePasswordReEntry = 77, - ValueOutOfRange = 78, - UnexpectedError = 79, - Disabled = 80, - InvalidCEGSubmission = 81, - RestrictedDevice = 82, - RegionLocked = 83, - RateLimitExceeded = 84, - AccountLoginDeniedNeedTwoFactor = 85, - ItemDeleted = 86, - AccountLoginDeniedThrottle = 87, - TwoFactorCodeMismatch = 88, - TwoFactorActivationCodeMismatch = 89, - AccountAssociatedToMultiplePartners = 90, - NotModified = 91, - NoMobileDevice = 92, - TimeNotSynced = 93, - SmsCodeFailed = 94, - AccountLimitExceeded = 95, - AccountActivityLimitExceeded = 96, - PhoneActivityLimitExceeded = 97, - RefundToWallet = 98, - EmailSendFailure = 99, - NotSettled = 100, - NeedCaptcha = 101, - GSLTDenied = 102, - GSOwnerDenied = 103, - InvalidItemType = 104, - IPBanned = 105, - GSLTExpired = 106, - InsufficientFunds = 107, - TooManyPending = 108, - NoSiteLicensesFound = 109, - WGNetworkSendExceeded = 110, - AccountNotFriends = 111, - LimitedUserAccount = 112, + OK = 1, + Fail = 2, + NoConnection = 3, + InvalidPassword = 5, + LoggedInElsewhere = 6, + InvalidProtocolVer = 7, + InvalidParam = 8, + FileNotFound = 9, + Busy = 10, + InvalidState = 11, + InvalidName = 12, + InvalidEmail = 13, + DuplicateName = 14, + AccessDenied = 15, + Timeout = 16, + Banned = 17, + AccountNotFound = 18, + InvalidSteamID = 19, + ServiceUnavailable = 20, + NotLoggedOn = 21, + Pending = 22, + EncryptionFailure = 23, + InsufficientPrivilege = 24, + LimitExceeded = 25, + Revoked = 26, + Expired = 27, + AlreadyRedeemed = 28, + DuplicateRequest = 29, + AlreadyOwned = 30, + IPNotFound = 31, + PersistFailed = 32, + LockingFailed = 33, + LogonSessionReplaced = 34, + ConnectFailed = 35, + HandshakeFailed = 36, + IOFailure = 37, + RemoteDisconnect = 38, + ShoppingCartNotFound = 39, + Blocked = 40, + Ignored = 41, + NoMatch = 42, + AccountDisabled = 43, + ServiceReadOnly = 44, + AccountNotFeatured = 45, + AdministratorOK = 46, + ContentVersion = 47, + TryAnotherCM = 48, + PasswordRequiredToKickSession = 49, + AlreadyLoggedInElsewhere = 50, + Suspended = 51, + Cancelled = 52, + DataCorruption = 53, + DiskFull = 54, + RemoteCallFailed = 55, + PasswordUnset = 56, + ExternalAccountUnlinked = 57, + PSNTicketInvalid = 58, + ExternalAccountAlreadyLinked = 59, + RemoteFileConflict = 60, + IllegalPassword = 61, + SameAsPreviousValue = 62, + AccountLogonDenied = 63, + CannotUseOldPassword = 64, + InvalidLoginAuthCode = 65, + AccountLogonDeniedNoMail = 66, + HardwareNotCapableOfIPT = 67, + IPTInitError = 68, + ParentalControlRestricted = 69, + FacebookQueryError = 70, + ExpiredLoginAuthCode = 71, + IPLoginRestrictionFailed = 72, + AccountLockedDown = 73, + AccountLogonDeniedVerifiedEmailRequired = 74, + NoMatchingURL = 75, + BadResponse = 76, + RequirePasswordReEntry = 77, + ValueOutOfRange = 78, + UnexpectedError = 79, + Disabled = 80, + InvalidCEGSubmission = 81, + RestrictedDevice = 82, + RegionLocked = 83, + RateLimitExceeded = 84, + AccountLoginDeniedNeedTwoFactor = 85, + ItemDeleted = 86, + AccountLoginDeniedThrottle = 87, + TwoFactorCodeMismatch = 88, + TwoFactorActivationCodeMismatch = 89, + AccountAssociatedToMultiplePartners = 90, + NotModified = 91, + NoMobileDevice = 92, + TimeNotSynced = 93, + SmsCodeFailed = 94, + AccountLimitExceeded = 95, + AccountActivityLimitExceeded = 96, + PhoneActivityLimitExceeded = 97, + RefundToWallet = 98, + EmailSendFailure = 99, + NotSettled = 100, + NeedCaptcha = 101, + GSLTDenied = 102, + GSOwnerDenied = 103, + InvalidItemType = 104, + IPBanned = 105, + GSLTExpired = 106, + InsufficientFunds = 107, + TooManyPending = 108, + NoSiteLicensesFound = 109, + WGNetworkSendExceeded = 110, + AccountNotFriends = 111, + LimitedUserAccount = 112, } /** * @todo May be useful for ParentalSettings.feature ? */ export enum ParentalFeature { - Invalid = 0, - Store = 1, - Community = 2, - Profile = 3, - Friends = 4, - News = 5, - Trading = 6, - Settings = 7, - Console = 8, - Browser = 9, - ParentalSetup = 10, - Library = 11, - Test = 12, - SiteLicense = 13, - KioskMode = 14, - Max = 15, + Invalid = 0, + Store = 1, + Community = 2, + Profile = 3, + Friends = 4, + News = 5, + Trading = 6, + Settings = 7, + Console = 8, + Browser = 9, + ParentalSetup = 10, + Library = 11, + Test = 12, + SiteLicense = 13, + KioskMode = 14, + Max = 15, } export interface Unregisterable { - /** - * Unregister the callback. - */ - unregister(): void; + /** + * Unregister the callback. + */ + unregister(): void; } From 7263d28341b227b5d88ec73933e4a3f5ba32992d Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:18:39 +0000 Subject: [PATCH 23/46] docs(SteamClient): document protobufs & System.Report --- src/globals/SteamClient.ts | 714 +++++++++++++++++++++++++++++++++++-- 1 file changed, 686 insertions(+), 28 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 401e53a5..42254bb3 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -215,9 +215,10 @@ export interface Apps { GetLaunchOptionsForApp(appId: number): Promise<LaunchOption[]>; /** - * @todo Returns an empty ArrayBuffer? + * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link LibraryBootstrapData}. + * @todo Returns an empty {@link LibraryBootstrapData}? */ - GetLibraryBootstrapData(): Promise<ArrayBuffer>; // CLibraryBootstrapData - binary deserializer??? + GetLibraryBootstrapData(): Promise<ArrayBuffer>; /** * Retrieves achievement information for the authenticated user in a specific Steam application. @@ -338,10 +339,10 @@ export interface Apps { RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; /** - * @todo Calls the callback on launching a game - * @todo Doesn't return anything? + * If `data` is deserialized, returns {@link AppOverview_Change}. + * @remarks This is not a mistake, it doesn't return anything. */ - RegisterForAppOverviewChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; // CAppOverview_Change - binary deserializer??? + RegisterForAppOverviewChanges(callback: (data: ArrayBuffer) => void): void; RegisterForDRMFailureResponse( callback: (appid: number, eResult: number, errorCode: number) => void, @@ -402,7 +403,10 @@ export interface Apps { ) => void, ): Unregisterable | any; - RegisterForLocalizationChanges(callback: (param0: ArrayBuffer) => void): Unregisterable | any; + /** + * @todo returns undefined (now)? + */ + RegisterForLocalizationChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; RegisterForPrePurchasedAppChanges(callback: () => void): Unregisterable | any; // Unknown, did have it show up a few times, but not callback parameters RegisterForShowMarketingMessageDialog: Unregisterable | any; @@ -704,6 +708,9 @@ export interface Apps { export interface Auth { GetLocalHostname(): Promise<string>; + /** + * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link Authentication_DeviceDetails}. + */ GetMachineID(): Promise<ArrayBuffer>; GetRefreshInfo(): Promise<AuthRefreshInfo>; @@ -1683,8 +1690,13 @@ export interface Music { } export interface Notifications { + /** + * If `data` is deserialized, returns {@link ClientNotificationFriendMessage}, + * or {@link ClientNotificationGroupChatMessage}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForNotifications( - callback: (notificationIndex: number, type: ClientUINotification, param2: ArrayBuffer) => void, + callback: (notificationIndex: number, type: ClientUINotification, data: ArrayBuffer) => void, ): Unregisterable | any; } @@ -2315,6 +2327,9 @@ export interface Settings { GetGlobalCompatTools(): Promise<CompatibilityToolInfo[]>; + /** + * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link MsgMonitorInfo}. + */ GetMonitorInfo(): Promise<ArrayBuffer>; GetOOBETestMode(): Promise<boolean>; @@ -2336,6 +2351,10 @@ export interface Settings { RegisterForMicVolumeUpdates: Unregisterable | any; + /** + * If `data` is deserialized, returns {@link MsgClientSettings}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ RegisterForSettingsArrayChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; RegisterForSettingsChanges(callback: (steamSettings: SteamSettings) => void): Unregisterable | any; @@ -2423,11 +2442,17 @@ export interface SteamChina { } export interface Storage { - DeleteKey: any; - GetJSON: any; - GetString: any; - SetObject: any; - SetString: any; + DeleteKey: Promise<OperationResponse | void>; + /** + * @remarks Use {@link SetObject} to set. + */ + GetJSON: Promise<OperationResponse | string>; + GetString: Promise<OperationResponse | string>; + /** + * @remarks Use {@link SetObject} to get. + */ + SetObject: Promise<OperationResponse | void>; + SetString: Promise<OperationResponse | void>; } export interface Streaming { @@ -2585,7 +2610,11 @@ export interface Audio { } export interface AudioDevice { - RegisterForStateChanges: Unregisterable | any; + /** + * If `data` is deserialized, returns {@link MsgSystemAudioManagerState}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; UpdateSomething: any; } @@ -2692,7 +2721,11 @@ export interface DisplayManager { export interface Dock { DisarmSafetyNet(): void; - RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; // Deserialize binary + /** + * If `data` is deserialized, returns {@link MsgSystemDockState}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; UpdateFirmware(base64String: string): any; // serialize base64 string } @@ -2718,13 +2751,21 @@ export interface Network { GetProxyInfo(): Promise<ProxyInfo>; RegisterForAppSummaryUpdate: Unregisterable | any; + + /** + * @todo {@link GameNetworkingUI_ConnectionState}, unconfirmed + */ RegisterForConnectionStateUpdate: Unregisterable | any; RegisterForConnectivityTestChanges( callback: (connectivityTestChange: ConnectivityTestChange) => void, ): Unregisterable | any; - RegisterForDeviceChanges(callback: (param0: any) => void): Unregisterable | any; + /** + * If `data` is deserialized, returns {@link MsgNetworkDevicesData}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; SetFakeLocalSystemState(param0: any): any; // enums @@ -2739,16 +2780,38 @@ export interface Network { // CMsgSystemPerfUpdateSettings, CMsgSystemPerfState, CMsgSystemPerfSettings export interface Perf { - RegisterForDiagnosticInfoChanges(callback: (param0: any) => void): Unregisterable | any; // deserialize binary - RegisterForStateChanges(callback: (param0: any) => void): Unregisterable | any; // deserialize binary + /** + * If `data` is deserialized, returns {@link MsgSystemPerfDiagnosticInfo}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDiagnosticInfoChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + + /** + * If `data` is deserialized, returns {@link MsgSystemPerfState}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + UpdateSettings(base64: string): any; // serialize } -// CMsgGenerateSystemReportReply export interface Report { - GenerateSystemReport: any; - SaveToDesktop: any; - Submit: any; + /** + * Generates a system report located in /tmp/steamXXXXXX (https://steamloopback.host/systemreports). + */ + GenerateSystemReport(): Promise<SystemReportReply>; + + /** + * Saves a report in the Desktop directory. + * @param reportId The report ID (file name) to save. + */ + SaveToDesktop(reportId: string): Promise<OperationResponse>; + + /** + * @param reportId The report ID (file name) to submit. + * @todo times out ({@link Result.Timeout}) + */ + Submit(reportId: string): Promise<OperationResponse>; } export interface SystemUI { @@ -2821,7 +2884,10 @@ export interface System { RegisterForOnSuspendRequest(callback: () => void): Unregisterable | any; - RegisterForSettingsChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; // deserialize binary + /** + * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link MsgSystemManagerSettings}. + */ + RegisterForSettingsChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; Report: Report; /** @@ -2922,6 +2988,10 @@ export interface Updates { GetCurrentOSBranch(): Promise<OSBranch>; + /** + * If `data` is deserialized, returns {@link MsgSystemUpdateState}. + * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. + */ RegisterForUpdateStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; // 1 - Stable, 2 - Beta, 3 - Preview @@ -3683,9 +3753,9 @@ export interface SteamAppOverview { sort_as: string; /* - * Possible bitmask values, but I haven't spotted any of them being masked in the app_type field. - * Should be safe as an enum. - */ + * Possible bitmask values, but I haven't spotted any of them being masked in the app_type field. + * Should be safe as an enum. + */ app_type: AppType; mru_index: number | undefined; rt_recent_activity_time: number; @@ -4676,9 +4746,9 @@ export interface BluetoothStateChange { */ export interface OperationResponse { /** - * The result code of the operation (1 for success, 2 for failure). + * The result code of the operation. */ - result: number; + result: Result; /** * A message describing the result of the operation. @@ -4686,6 +4756,13 @@ export interface OperationResponse { message: string; } +export interface SystemReportReply extends OperationResponse { + /** + * If deserialized, returns {@link MsgGenerateSystemReportReply}. + */ + reply: ArrayBuffer; +} + /** * Represents details about a single screenshot upload. */ @@ -5164,7 +5241,13 @@ export interface BrowserViewPopup { */ on( event: 'node-has-focus', - callback: (elementIdOrTagName: string, elementTag: string, param2: any, param3: string, param4: boolean) => void, + callback: ( + elementIdOrTagName: string, + elementTag: string, + param2: any, + param3: string, + param4: boolean, + ) => void, ): void; on(event: 'page-security', callback: (url: string, pageSecurity: BrowserViewPageSecurity) => void): void; @@ -5552,6 +5635,503 @@ export interface FocusChangeEvent { rgFocusable: FocusedApp[]; } +export interface UpdateApplyResult { + type: UpdaterType; + eresult: Result; + requires_client_restart: boolean; + requires_system_restart: boolean; +} + +export interface UpdateCheckResult { + type: UpdaterType; + eresult: Result; + rtime_checked: number; + available: boolean; +} + +export interface NetworkDeviceIPv4Address { + ip: number; + netmask: number; +} + +export interface NetworkDeviceIPv6Address { + ip: string; +} + +export interface NetworkDeviceIP { + dns_ip: number[]; + gateway_ip: number; + is_default_route: boolean; + is_dhcp_enabled: boolean; + is_enabled: boolean; +} + +export interface NetworkDeviceIPv4 extends NetworkDeviceIP { + addresses: NetworkDeviceIPv4Address[]; +} + +export interface NetworkDeviceIPv6 extends NetworkDeviceIP { + addresses: NetworkDeviceIPv6Address[]; +} + +export interface WirelessAP { + esecurity: WirelessAPSecurity; + estrength: WirelessAPStrength; + id: number; + is_active: boolean; + is_autoconnect: boolean; + password: string; + ssid: string; + strength_raw: number; + user_name?: string; +} + +export interface NetworkDevice_Wireless { + aps: WirelessAP[]; + /** + * @remarks Not present if wired. + * @todo enum + */ + esecurity_supported?: number; +} + +export interface NetworkDevice_Wired { + friendly_name: string; + is_cable_present: boolean; + speed_mbit: number; +} + +export interface NetworkDevice { + estate: NetworkDeviceState; + etype: NetworkDeviceType; + id: number; + ipv4: NetworkDeviceIPv4; + ipv6: NetworkDeviceIPv6; + mac: string; + product: string; + vendor: string; + /** + * @remarks Present only if wired. + */ + wired?: NetworkDevice_Wired; + /** + * @remarks Present even if wired. + */ + wireless: NetworkDevice_Wireless; +} + +export interface Hotkey { + alt_key: boolean; + ctrl_key: boolean; + display_name: string; + key_code: number; + meta_key: boolean; + shift_key: boolean; +} + +/** + * JsPb message class. + */ +export interface JsPbMessageClass { + /** + * @todo Returns {@link JsPbMessage}, but not sure how to do it for the messages. + */ + deserializeBinary(data: ArrayBuffer): any; +} + +/** + * Deserialized JsPb message. + */ +export interface JsPbMessage { + array: any[]; + arrayIndexOffset_: number; + convertedPrimitiveFields_: any; + messageId_?: string; + pivot_: number; + wrappers_: any; + + getClassName(): string; + serializeBase64String(): string; + serializeBinary(): Uint8Array; + /** + * Converts the message to an object. + */ + toObject(includeJsPbInstance: boolean): any; +} + +/** + * CLibraryBootstrapData + */ +export interface LibraryBootstrapData extends JsPbMessage { + app_data(): any[]; + + add_app_data(param0: any, param1: any): any; + set_app_data(param0: any): any; +} + +/** + * CAppOverview_Change + */ +export interface AppOverview_Change extends JsPbMessage { + app_overview(): SteamAppOverview[]; + full_update(): boolean; + removed_appid(): any[]; + update_complete(): boolean; + + add_app_overview(param0: any, param1: any): any; + add_removed_appid(param0: any, param1: any): any; + set_app_overview(param0: any): any; + set_full_update(param0: any): any; + set_removed_appid(param0: any): any; + set_update_complete(param0: any): any; +} + +/** + * CAuthentication_DeviceDetails + * + * `deserializeBinary` argument: + * ``` + * [ + * await SteamClient.System.GetOSType(), + * await SteamClient.Auth.GetLocalHostname(), + * await SteamClient.Auth.GetMachineID(), + * ]; + * ``` + */ +export interface Authentication_DeviceDetails extends JsPbMessage { + client_count(): any; + device_friendly_name(): any; + gaming_device_type(): any; + machine_id(): any; + os_type(): any; + platform_type(): any; + + set_client_count(): any; + set_device_friendly_name(): any; + set_gaming_device_type(): any; + set_machine_id(): any; + set_os_type(): any; + set_platform_type(): any; +} + +/** + * CMsgMonitorInfo + */ +export interface MsgMonitorInfo extends JsPbMessage { + monitors(): any[]; + selected_display_name(): any; + + add_monitors(param0: any, param1: any): any; + set_monitors(param0: any): any; + set_selected_display_name(param0: any): any; +} + +/** + * CMsgSystemManagerSettings + */ +export interface MsgSystemManagerSettings extends JsPbMessage { + display_adaptive_brightness_enabled(): boolean; + display_colorgamut(): number; + display_colorgamut_labelset(): number; + display_colortemp(): number; + display_colortemp_default(): number; + display_colortemp_enabled(): boolean; + display_diagnostics_enabled(): boolean; + display_nightmode_blend(): number; + display_nightmode_enabled(): boolean; + display_nightmode_maxhue(): number; + display_nightmode_maxsat(): number; + display_nightmode_schedule_enabled(): boolean; + display_nightmode_schedule_endtime(): number; + display_nightmode_schedule_starttime(): number; + display_nightmode_tintstrength(): number; + display_nightmode_uiexp(): number; + fan_control_mode(): number; + idle_backlight_dim_ac_seconds(): number; + idle_backlight_dim_battery_seconds(): number; + idle_suspend_ac_seconds(): number; + idle_suspend_battery_seconds(): number; + idle_suspend_supressed(): boolean; + is_adaptive_brightness_available(): boolean; + is_display_brightness_available(): boolean; + is_display_colormanagement_available(): boolean; + is_display_colortemp_available(): boolean; + is_fan_control_available(): boolean; + is_wifi_powersave_enabled(): boolean; +} + +/** + * CMsgSystemAudioManagerState + * @todo unconfirmed + */ +export interface MsgSystemAudioManagerState extends JsPbMessage { + counter(): number; + hw(): any; + rtime_filter(): any; +} + +/** + * CMsgSystemUpdateState + */ +export interface MsgSystemUpdateState extends JsPbMessage { + state(): UpdaterState; + supports_os_updates(): boolean; + update_apply_results(): UpdateApplyResult[]; + update_check_results(): UpdateCheckResult[]; +} + +/** + * CMsgSystemDockState + */ +export interface MsgSystemDockState extends JsPbMessage { + update_state(): any; +} + +/** + * CMsgSystemPerfDiagnosticInfo + * @todo unconfirmed + */ +export interface MsgSystemPerfDiagnosticInfo extends JsPbMessage { + battery_temp_c(): number; + entries(): any; + interfaces(): any; +} + +/** + * CMsgSystemPerfState + * @todo unconfirmed + */ +export interface MsgSystemPerfState extends JsPbMessage { + active_profile_game_id(): string; + current_game_id(): string; + limits(): any; + settings(): any; +} + +/** + * CMsgGenerateSystemReportReply + */ +export interface MsgGenerateSystemReportReply extends JsPbMessage { + /** + * The report file name. + */ + report_id(): string; + set_report_id(param0: any): any; +} + +/** + * CMsgNetworkDevicesData + */ +export interface MsgNetworkDevicesData extends JsPbMessage { + devices(): NetworkDevice[]; + is_wifi_enabled(): boolean; + is_wifi_scanning_enabled(): boolean; +} + +/** + * CMsgClientSettings + */ +export interface MsgClientSettings extends JsPbMessage { + always_show_user_chooser(): boolean; + always_use_gamepadui_overlay(): boolean; + auto_scale_factor(): number; + bigpicture_windowed(): boolean; + broadcast_bitrate(): number; + broadcast_chat_corner(): number; + broadcast_encoding_option(): BroadcastEncoderSetting; + broadcast_output_height(): number; + broadcast_output_width(): number; + broadcast_permissions(): BroadcastPermission; + broadcast_record_all_audio(): boolean; + broadcast_record_all_video(): boolean; + broadcast_record_microphone(): boolean; + broadcast_show_live_reminder(): boolean; + broadcast_show_upload_stats(): boolean; + cef_remote_debugging_enabled(): boolean; + cloud_enabled(): boolean; + controller_combine_nintendo_joycons(): boolean; + controller_generic_support(): boolean; + controller_guide_button_focus_steam(): boolean; + controller_power_off_timeout(): number; + controller_ps_support(): number; + controller_switch_support(): boolean; + controller_xbox_driver(): boolean; + controller_xbox_support(): boolean; + default_ping_rate(): number; + disable_all_toasts(): boolean; + disable_toasts_in_game(): boolean; + display_name(): string; + download_peer_content(): number; + download_rate_bits_per_s(): boolean; + download_region(): number; + download_throttle_rate(): number; + download_throttle_while_streaming(): boolean; + download_while_app_running(): boolean; + enable_dpi_scaling(): boolean; + enable_gpu_accelerated_webviews(): boolean; + enable_hardware_video_decoding(): boolean; + enable_marketing_messages(): boolean; + enable_overlay(): boolean; + enable_screenshot_notification(): boolean; + enable_screenshot_sound(): boolean; + enable_shader_background_processing(): boolean; + enable_shader_precache(): boolean; + enable_ui_sounds(): boolean; + force_deck_perf_tab(): boolean; + force_fake_mandatory_update(): boolean; + force_oobe(): boolean; + g_background_mk(): Hotkey; + g_background_tg(): Hotkey; + game_notes_enable_spellcheck(): boolean; + gamescope_app_target_framerate(): number; + gamescope_disable_framelimit(): boolean; + gamescope_display_refresh_rate(): number; + gamescope_enable_app_target_framerate(): boolean; + gamescope_hdr_visualization(): HDRVisualization; + in_client_beta(): boolean; + is_external_display(): boolean; + is_steam_sideloaded(): boolean; + jumplist_flags(): number; + library_disable_community_content(): boolean; + library_display_icon_in_game_list(): boolean; + library_display_size(): number; + library_low_bandwidth_mode(): boolean; + library_low_perf_mode(): boolean; + library_whats_new_show_only_product_updates(): boolean; + max_scale_factor(): number; + min_scale_factor(): number; + music_download_high_quality(): boolean; + music_pause_on_app_start(): boolean; + music_pause_on_voice_chat(): boolean; + music_playlist_notification(): boolean; + music_volume(): number; + needs_steam_service_repair(): boolean; + no_save_personal_info(): boolean; + oobe_test_mode_enabled(): boolean; + overlay_fps_counter_corner(): number; + overlay_fps_counter_high_contrast(): boolean; + overlay_key(): Hotkey; + overlay_restore_browser_tabs(): boolean; + overlay_scale_interface(): boolean; + overlay_tabs(): string; + overlay_toolbar_list_view(): boolean; + override_browser_composer_mode(): number; + play_sound_on_toast(): boolean; + preferred_monitor(): string; + ready_to_play_includes_streaming(): boolean; + restrict_auto_updates(): boolean; + restrict_auto_updates_end(): number; + restrict_auto_updates_start(): number; + run_at_startup(): boolean; + save_uncompressed_screenshots(): boolean; + screenshot_items_per_row(): number; + screenshot_key(): Hotkey; + screenshots_path(): string; + server_ping_rate(): number; + shader_precached_size(): string; + show_family_sharing_notifications(): boolean; + show_screenshot_manager(): boolean; + show_steam_deck_info(): boolean; + show_store_content_on_home(): boolean; + show_timestamps_in_console(): boolean; + skip_steamvr_install_dialog(): boolean; + small_mode(): boolean; + smooth_scroll_webviews(): boolean; + start_in_big_picture_mode(): boolean; + start_page(): string; + startup_movie_id(): string; + startup_movie_local_path(): string; + startup_movie_shuffle(): boolean; + startup_movie_used_for_resume(): boolean; + steam_cef_gpu_blocklist_disabled(): boolean; + steam_input_configurator_error_msg_enable(): boolean; + steam_networking_share_ip(): number; + steam_os_underscan_enabled(): boolean; + steam_os_underscan_level(): number; + turn_off_controller_on_exit(): boolean; + voice_mic_device_name(): string; + voice_mic_input_gain(): number; + voice_push_to_talk_key(): Hotkey; + voice_push_to_talk_setting(): number; + voice_speaker_output_gain(): number; + web_browser_home(): string; +} + +/** + * CGameNetworkingUI_ConnectionState + */ +export interface GameNetworkingUI_ConnectionState extends JsPbMessage { + connection_key(): string; + appid(): number; + connection_id_local(): number; + identity_local(): string; + identity_remote(): string; + connection_state(): number; + start_time(): number; + close_time(): number; + close_reason(): number; + close_message(): string; + status_loc_token(): string; + transport_kind(): number; + sdrpopid_local(): string; + sdrpopid_remote(): string; + address_remote(): string; + p2p_routing(): any; + ping_interior(): number; + ping_remote_front(): number; + ping_default_internet_route(): number; + e2e_quality_local(): any; + e2e_quality_remote(): any; + e2e_quality_remote_instantaneous_time(): string; + e2e_quality_remote_lifetime_time(): string; + front_quality_local(): any; + front_quality_remote(): any; + front_quality_remote_instantaneous_time(): string; + front_quality_remote_lifetime_time(): string; +} + +/** + * CMsgHotkey + */ +export interface MsgHotkey extends JsPbMessage { + key_code(): number; + alt_key(): boolean; + shift_key(): boolean; + ctrl_key(): boolean; + meta_key(): boolean; + display_name(): string; +} + +/** + * CClientNotificationGroupChatMessage + */ +export interface ClientNotificationGroupChatMessage extends JsPbMessage { + tag(): string; + /** A Steam64 ID. */ + steamid_sender(): string; + chat_group_id(): string; + chat_id(): string; + title(): string; + body(): string; + rawbody(): string; + icon(): string; + notificationid(): number; +} + +/** + * CClientNotificationFriendMessage + */ +export interface ClientNotificationFriendMessage extends JsPbMessage { + body(): string; + icon(): string; + notificationid(): number; + response_steamurl(): string; + /** A Steam64 ID. */ + steamid(): string; + tag(): string; + title(): string; +} + export enum AppArtworkAssetType { Capsule = 0, Hero = 1, @@ -6190,6 +6770,48 @@ export enum BrowserViewContextMenuEditFlag { CanTranslate = 1 << 7, } +export enum HDRVisualization { + None, + Heatmap, + Analysis, + HeatmapExtended, + HeatmapClassic, +} + +export enum BroadcastPermission { + Disabled, + FriendsApprove, + FriendsAllowed, + Public, + Subscribers, +} + +export enum BroadcastEncoderSetting { + BestQuality, + BestPerformance, +} + +export enum UpdaterState { + Invalid = 0, + UpToDate = 2, + Checking = 3, + Available = 4, + Applying = 5, + ClientRestartPending = 6, + SystemRestartPending = 7, +} + +export enum UpdaterType { + Invalid, + Client, + OS, + BIOS, + Aggregated, + Test1, + Test2, + Dummy, +} + export enum Result { OK = 1, Fail = 2, @@ -6304,6 +6926,42 @@ export enum Result { LimitedUserAccount = 112, } +export enum WirelessAPSecurity { + None = 0, + StaticWep = 1 << 0, + DynamicWep = 1 << 1, + Wpa = 1 << 2, + WpaEnterprise = 1 << 3, + Wpa2 = 1 << 4, + Wpa2Enterprise = 1 << 5, + Unsupported = 1 << 15, +} + +export enum WirelessAPStrength { + None, + Weak, + Ok, + Good, + Excellent, +} + +export enum NetworkDeviceState { + NotPresent, + Failed, + Disconnected, + Disconnecting, + Connecting, + Connected, + Retrying, +} + +export enum NetworkDeviceType { + Unknown, + Wired, + Wireless, + Virtual, +} + /** * @todo May be useful for ParentalSettings.feature ? */ From b3c539f5e8e17dd7c81ef9be134d4d92e6184771 Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Fri, 1 Dec 2023 16:40:56 +0000 Subject: [PATCH 24/46] docs(SteamClient): document CMsgMonitorInfo --- src/globals/SteamClient.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 42254bb3..0602aa58 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -5729,6 +5729,14 @@ export interface Hotkey { shift_key: boolean; } +/** + * @todo Doesn't work on Linux ? + */ +export interface Monitor { + monitor_device_name: string; + monitor_display_name: string; +} + /** * JsPb message class. */ @@ -5818,8 +5826,8 @@ export interface Authentication_DeviceDetails extends JsPbMessage { * CMsgMonitorInfo */ export interface MsgMonitorInfo extends JsPbMessage { - monitors(): any[]; - selected_display_name(): any; + monitors(): Monitor[]; + selected_display_name(): string; add_monitors(param0: any, param1: any): any; set_monitors(param0: any): any; From 217e5d428968e39b7748f9b24069ccaafd355c99 Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Thu, 14 Dec 2023 16:43:30 +0000 Subject: [PATCH 25/46] docs(SteamClient): document remaining messages --- src/globals/SteamClient.ts | 482 ++++++++++++++++++++++++++++++++++--- 1 file changed, 451 insertions(+), 31 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 0602aa58..9a9795f9 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -216,7 +216,6 @@ export interface Apps { /** * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link LibraryBootstrapData}. - * @todo Returns an empty {@link LibraryBootstrapData}? */ GetLibraryBootstrapData(): Promise<ArrayBuffer>; @@ -5635,6 +5634,12 @@ export interface FocusChangeEvent { rgFocusable: FocusedApp[]; } +export interface AppBootstrapData { + appid: number; + hidden: boolean; + user_tag: string[]; +} + export interface UpdateApplyResult { type: UpdaterType; eresult: Result; @@ -5649,6 +5654,26 @@ export interface UpdateCheckResult { available: boolean; } +export interface UpdateProgress { + stage_progress: number | undefined; + stage_size_bytes: number | undefined; + rtime_estimated_completion: number | undefined; +} + +export interface SystemPerfNetworkInterface { + name: string | undefined; + timestamp: number | undefined; + tx_bytes_total: number | undefined; + rx_bytes_total: number | undefined; + tx_bytes_per_sec: number | undefined; + rx_bytes_per_sec: number | undefined; +} + +export interface SystemPerfDiagnosticEntry { + name: string | undefined; + value: string | undefined; +} + export interface NetworkDeviceIPv4Address { ip: number; netmask: number; @@ -5737,6 +5762,299 @@ export interface Monitor { monitor_display_name: string; } +export interface SystemDockUpdateState { + state: UpdaterState | undefined; + rtime_last_checked: number | undefined; + version_current: string | undefined; + version_available: string | undefined; + stage_progress: number | undefined; + rtime_estimated_completion: number | undefined; + old_fw_workaround: number | undefined; +} + +export interface SystemPerfLimits { + cpu_governor_manual_min_mhz: number | undefined; + cpu_governor_manual_max_mhz: number | undefined; + fsr_sharpness_min: number | undefined; + fsr_sharpness_max: number | undefined; + gpu_performance_manual_min_mhz: number | undefined; + gpu_performance_manual_max_mhz: number | undefined; + perf_overlay_is_standalone: boolean | undefined; + is_dynamic_vrs_available: boolean | undefined; + is_manual_display_refresh_rate_available: boolean | undefined; + gpu_performance_levels_available: GPUPerformanceLevel[]; + display_refresh_manual_hz_min: number | undefined; + display_refresh_manual_hz_max: number | undefined; + fps_limit_options: number[] | undefined; + tdp_limit_min: number | undefined; + tdp_limit_max: number | undefined; + is_nis_supported: boolean | undefined; + nis_sharpness_min: number | undefined; + nis_sharpness_max: number | undefined; + display_external_refresh_manual_hz_min: number | undefined; + display_external_refresh_manual_hz_max: number | undefined; + fps_limit_options_external: number[] | undefined; + is_tearing_supported: boolean | undefined; + is_vrr_supported: boolean | undefined; + is_dynamic_refresh_rate_in_steam_supported: boolean | undefined; + is_split_scaling_and_filtering_supported: boolean | undefined; + split_scaling_filters_available: SplitScalingFilter[]; + split_scaling_scalers_available: SplitScalingScaler[]; + is_hdr_supported: boolean | undefined; + display_refresh_manual_hz_oc_max: number | undefined; + disable_refresh_rate_management: boolean | undefined; +} + +export interface SystemPerfSettingsGlobal { + diagnostic_update_rate: number; + system_trace_service_state: SystemServiceState; + graphics_profiling_service_state: SystemServiceState; + perf_overlay_service_state: SystemServiceState; + perf_overlay_level: GraphicsPerfOverlayLevel; + is_show_perf_overlay_over_steam_enabled: boolean; + is_advanced_settings_enabled: boolean; + allow_external_display_refresh_control: boolean; + is_hdr_enabled: boolean; + hdr_on_sdr_tonemap_operator: HDRToneMapOperator; + is_hdr_debug_heatmap_enabled: boolean; + force_hdr_wide_gammut_for_sdr: boolean; + allow_experimental_hdr: boolean; + sdr_to_hdr_brightness: number; + debug_force_hdr_support: boolean; + force_hdr_10pq_output_debug: boolean; + is_display_oc_enabled: boolean; + is_color_management_enabled: boolean; +} + +export interface SystemPerfSettingsPerApp { + gpu_performance_manual_mhz: number | undefined; + fps_limit: number | undefined; + is_variable_resolution_enabled: boolean | undefined; + is_dynamic_refresh_rate_enabled: boolean | undefined; + tdp_limit: number | undefined; + cpu_governor: CPUGovernor | undefined; + cpu_governor_manual_mhz: number | undefined; + scaling_filter: number | undefined; + fsr_sharpness: number | undefined; + is_fps_limit_enabled: boolean | undefined; + is_tdp_limit_enabled: boolean | undefined; + is_low_latency_mode_enabled: boolean | undefined; + display_refresh_manual_hz: number | undefined; + is_game_perf_profile_enabled: boolean | undefined; + gpu_performance_level: GPUPerformanceLevel | undefined; + nis_sharpness: number | undefined; + display_external_refresh_manual_hz: number | undefined; + fps_limit_external: number | undefined; + is_tearing_enabled: boolean | undefined; + is_vrr_enabled: boolean | undefined; + is_composite_debug_enabled: boolean | undefined; + force_composite: boolean | undefined; + use_dynamic_refresh_rate_in_steam: boolean | undefined; + split_scaling_filter: SplitScalingFilter | undefined; + split_scaling_scaler: SplitScalingScaler | undefined; +} + +export interface SystemPerfSettings { + global: SystemPerfSettingsGlobal | undefined; + per_app: SystemPerfSettingsPerApp | undefined; +} + +export interface SteamDatagramLinkInstantaneousStats { + out_packets_per_sec_x10: number | undefined; + out_bytes_per_sec: number | undefined; + in_packets_per_sec_x10: number | undefined; + in_bytes_per_sec: number | undefined; + ping_ms: number | undefined; + packets_dropped_pct: number | undefined; + packets_weird_sequence_pct: number | undefined; + peak_jitter_usec: number | undefined; +} + +export interface SteamDatagramLinkLifetimeStats { + connected_seconds: number | undefined; + packets_sent: number | undefined; + kb_sent: number | undefined; + packets_recv: number | undefined; + kb_recv: number | undefined; + packets_recv_sequenced: number | undefined; + packets_recv_dropped: number | undefined; + packets_recv_out_of_order: number | undefined; + packets_recv_out_of_order_corrected: number | undefined; + packets_recv_duplicate: number | undefined; + packets_recv_lurch: number | undefined; + multipath_packets_recv_sequenced: number[]; + multipath_packets_recv_later: number[]; + multipath_send_enabled: number | undefined; + quality_histogram_100: number | undefined; + quality_histogram_99: number | undefined; + quality_histogram_97: number | undefined; + quality_histogram_95: number | undefined; + quality_histogram_90: number | undefined; + quality_histogram_75: number | undefined; + quality_histogram_50: number | undefined; + quality_histogram_1: number | undefined; + quality_histogram_dead: number | undefined; + quality_ntile_2nd: number | undefined; + quality_ntile_5th: number | undefined; + quality_ntile_25th: number | undefined; + quality_ntile_50th: number | undefined; + ping_histogram_25: number | undefined; + ping_histogram_50: number | undefined; + ping_histogram_75: number | undefined; + ping_histogram_100: number | undefined; + ping_histogram_125: number | undefined; + ping_histogram_150: number | undefined; + ping_histogram_200: number | undefined; + ping_histogram_300: number | undefined; + ping_histogram_max: number | undefined; + ping_ntile_5th: number | undefined; + ping_ntile_50th: number | undefined; + ping_ntile_75th: number | undefined; + ping_ntile_95th: number | undefined; + ping_ntile_98th: number | undefined; + jitter_histogram_negligible: number | undefined; + jitter_histogram_1: number | undefined; + jitter_histogram_2: number | undefined; + jitter_histogram_5: number | undefined; + jitter_histogram_10: number | undefined; + jitter_histogram_20: number | undefined; + txspeed_max: number | undefined; + txspeed_histogram_16: number | undefined; + txspeed_histogram_32: number | undefined; + txspeed_histogram_64: number | undefined; + txspeed_histogram_128: number | undefined; + txspeed_histogram_256: number | undefined; + txspeed_histogram_512: number | undefined; + txspeed_histogram_1024: number | undefined; + txspeed_histogram_max: number | undefined; + txspeed_ntile_5th: number | undefined; + txspeed_ntile_50th: number | undefined; + txspeed_ntile_75th: number | undefined; + txspeed_ntile_95th: number | undefined; + txspeed_ntile_98th: number | undefined; + rxspeed_max: number | undefined; + rxspeed_histogram_16: number | undefined; + rxspeed_histogram_32: number | undefined; + rxspeed_histogram_64: number | undefined; + rxspeed_histogram_128: number | undefined; + rxspeed_histogram_256: number | undefined; + rxspeed_histogram_512: number | undefined; + rxspeed_histogram_1024: number | undefined; + rxspeed_histogram_max: number | undefined; + rxspeed_ntile_5th: number | undefined; + rxspeed_ntile_50th: number | undefined; + rxspeed_ntile_75th: number | undefined; + rxspeed_ntile_95th: number | undefined; + rxspeed_ntile_98th: number | undefined; +} + +export interface SteamDatagramConnectionQuality { + instantaneous: SteamDatagramLinkInstantaneousStats | undefined; + lifetime: SteamDatagramLinkLifetimeStats | undefined; +} + +export interface SteamNetworkingICESessionSummary { + failure_reason_code: number | undefined; + local_candidate_types: number | undefined; + remote_candidate_types: number | undefined; + initial_route_kind: number | undefined; + initial_ping: number | undefined; + initial_score: number | undefined; + negotiation_ms: number | undefined; + best_route_kind: number | undefined; + best_ping: number | undefined; + best_score: number | undefined; + best_time: number | undefined; + selected_seconds: number | undefined; + user_settings: number | undefined; + ice_enable_var: number | undefined; + local_candidate_types_allowed: number | undefined; +} + +export interface SteamNetworkingP2PSDRRoutingSummary { + initial_ping: number | undefined; + initial_ping_front_local: number | undefined; + initial_ping_front_remote: number | undefined; + initial_score: number | undefined; + initial_pop_local: number | undefined; + initial_pop_remote: number | undefined; + best_ping: number | undefined; + best_ping_front_local: number | undefined; + best_ping_front_remote: number | undefined; + best_score: number | undefined; + best_pop_local: number | undefined; + best_pop_remote: number | undefined; + best_time: number | undefined; + negotiation_ms: number | undefined; + selected_seconds: number | undefined; +} + +export interface SteamDatagramP2PRoutingSummary { + ice: SteamNetworkingICESessionSummary | undefined; + sdr: SteamNetworkingP2PSDRRoutingSummary | undefined; +} + +export interface MsgSystemAudioVolumeChannelEntry { + echannel: SystemAudioChannel | undefined; + volume: number | undefined; +} + +export interface MsgSystemAudioVolume { + entries: MsgSystemAudioVolumeChannelEntry[] | undefined; + is_muted: boolean | undefined; +} + +export interface MsgSystemAudioManagerObject { + id: number | undefined; + rtime_last_update: number | undefined; +} + +export interface MsgSystemAudioManagerDevice { + base: MsgSystemAudioManagerObject | undefined; + name: string | undefined; + nick: string | undefined; + description: string | undefined; + api: string | undefined; +} + +export interface MsgSystemAudioManagerNode { + base: MsgSystemAudioManagerObject | undefined; + device_id: number | undefined; + name: string | undefined; + nick: string | undefined; + description: string | undefined; + edirection: SystemAudioDirection | undefined; + volume: MsgSystemAudioVolume | undefined; +} + +export interface MsgSystemAudioManagerPort { + base: MsgSystemAudioManagerObject | undefined; + node_id: number | undefined; + name: string | undefined; + alias: string | undefined; + etype: SystemAudioPortType | undefined; + edirection: SystemAudioPortDirection | undefined; + is_physical: boolean | undefined; + is_terminal: boolean | undefined; + is_control: boolean | undefined; + is_monitor: boolean | undefined; +} + +export interface MsgSystemAudioManagerLink { + base: MsgSystemAudioManagerObject | undefined; + output_node_id: number | undefined; + output_port_id: number | undefined; + input_node_id: number | undefined; + input_port_id: number | undefined; +} + +export interface MsgSystemAudioManagerStateHW { + devices: MsgSystemAudioManagerDevice[]; + nodes: MsgSystemAudioManagerNode[]; + ports: MsgSystemAudioManagerPort[]; + links: MsgSystemAudioManagerLink[]; +} + /** * JsPb message class. */ @@ -5771,7 +6089,7 @@ export interface JsPbMessage { * CLibraryBootstrapData */ export interface LibraryBootstrapData extends JsPbMessage { - app_data(): any[]; + app_data(): AppBootstrapData[]; add_app_data(param0: any, param1: any): any; set_app_data(param0: any): any; @@ -5783,7 +6101,7 @@ export interface LibraryBootstrapData extends JsPbMessage { export interface AppOverview_Change extends JsPbMessage { app_overview(): SteamAppOverview[]; full_update(): boolean; - removed_appid(): any[]; + removed_appid(): number[]; update_complete(): boolean; add_app_overview(param0: any, param1: any): any; @@ -5807,12 +6125,12 @@ export interface AppOverview_Change extends JsPbMessage { * ``` */ export interface Authentication_DeviceDetails extends JsPbMessage { - client_count(): any; - device_friendly_name(): any; - gaming_device_type(): any; - machine_id(): any; - os_type(): any; - platform_type(): any; + client_count(): number | undefined; + device_friendly_name(): string | undefined; + gaming_device_type(): GamingDeviceType | undefined; + machine_id(): Uint8Array | string; + os_type(): OSType | undefined; + platform_type(): AuthTokenPlatformType | undefined; set_client_count(): any; set_device_friendly_name(): any; @@ -5870,20 +6188,20 @@ export interface MsgSystemManagerSettings extends JsPbMessage { /** * CMsgSystemAudioManagerState - * @todo unconfirmed */ export interface MsgSystemAudioManagerState extends JsPbMessage { - counter(): number; - hw(): any; - rtime_filter(): any; + counter(): number | undefined; + hw(): MsgSystemAudioManagerStateHW | undefined; + rtime_filter(): number | undefined; } /** * CMsgSystemUpdateState */ export interface MsgSystemUpdateState extends JsPbMessage { - state(): UpdaterState; - supports_os_updates(): boolean; + state(): UpdaterState | undefined; + progress(): UpdateProgress | undefined; + supports_os_updates(): boolean | undefined; update_apply_results(): UpdateApplyResult[]; update_check_results(): UpdateCheckResult[]; } @@ -5892,28 +6210,26 @@ export interface MsgSystemUpdateState extends JsPbMessage { * CMsgSystemDockState */ export interface MsgSystemDockState extends JsPbMessage { - update_state(): any; + update_state(): SystemDockUpdateState | undefined; } /** * CMsgSystemPerfDiagnosticInfo - * @todo unconfirmed */ export interface MsgSystemPerfDiagnosticInfo extends JsPbMessage { - battery_temp_c(): number; - entries(): any; - interfaces(): any; + battery_temp_c(): number | undefined; + entries(): SystemPerfDiagnosticEntry[] | undefined; + interfaces(): SystemPerfNetworkInterface[] | undefined; } /** * CMsgSystemPerfState - * @todo unconfirmed */ export interface MsgSystemPerfState extends JsPbMessage { - active_profile_game_id(): string; - current_game_id(): string; - limits(): any; - settings(): any; + active_profile_game_id(): string | undefined; + current_game_id(): string | undefined; + limits(): SystemPerfLimits | undefined; + settings(): SystemPerfSettings | undefined; } /** @@ -5923,7 +6239,7 @@ export interface MsgGenerateSystemReportReply extends JsPbMessage { /** * The report file name. */ - report_id(): string; + report_id(): string | undefined; set_report_id(param0: any): any; } @@ -6084,16 +6400,16 @@ export interface GameNetworkingUI_ConnectionState extends JsPbMessage { sdrpopid_local(): string; sdrpopid_remote(): string; address_remote(): string; - p2p_routing(): any; + p2p_routing(): SteamDatagramP2PRoutingSummary; ping_interior(): number; ping_remote_front(): number; ping_default_internet_route(): number; - e2e_quality_local(): any; - e2e_quality_remote(): any; + e2e_quality_local(): SteamDatagramConnectionQuality; + e2e_quality_remote(): SteamDatagramConnectionQuality; e2e_quality_remote_instantaneous_time(): string; e2e_quality_remote_lifetime_time(): string; - front_quality_local(): any; - front_quality_remote(): any; + front_quality_local(): SteamDatagramConnectionQuality; + front_quality_remote(): SteamDatagramConnectionQuality; front_quality_remote_instantaneous_time(): string; front_quality_remote_lifetime_time(): string; } @@ -6934,6 +7250,110 @@ export enum Result { LimitedUserAccount = 112, } +export enum AuthTokenPlatformType { + Unknown, + SteamClient, + WebBrowser, + MobileApp, +} + +export enum SystemAudioDirection { + Invalid, + Input, + Output, +} + +export enum SystemAudioChannel { + Invalid, + Aggregated, + FrontLeft, + FrontRight, + LFE, + BackLeft, + BackRight, + FrontCenter, + Unknown, + Mono, +} + +export enum SystemAudioPortType { + Invalid, + Unknown, + Audio32f, + Midi8b, + Video32RGBA, +} + +export enum SystemAudioPortDirection { + Invalid, + Input, + Output, +} + +export enum CPUGovernor { + Invalid, + Perf, + Powersave, + Manual, +} + +export enum GPUPerformanceLevel { + Invalid, + Auto, + Manual, + Low, + High, + Profiling, +} + +export enum SplitScalingFilter { + Invalid, + Linear, + Nearest, + FSR, + NIS, +} + +export enum SplitScalingScaler { + Invalid, + Auto, + Integer, + Fit, + Fill, + Stretch, +} + +export enum SystemServiceState { + Unavailable, + Disabled, + Enabled, +} + +export enum GraphicsPerfOverlayLevel { + Hidden, + Basic, + Medium, + Full, + Minimal, +} + +export enum HDRToneMapOperator { + Invalid, + Uncharted, + Reinhard, +} + +export enum GamingDeviceType { + Unknown = 0, + StandardPC = 1, + Console = 256, + PS3 = 272, + Steambox = 288, + Handheld = 512, + Phone = 528, + SteamDeck = 544, +} + export enum WirelessAPSecurity { None = 0, StaticWep = 1 << 0, From 54c4edbbf14812947e51f9d4a8ab3fa9828eac5b Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Thu, 14 Dec 2023 19:45:29 +0000 Subject: [PATCH 26/46] docs(SteamClient): update interfaces to Steam Version 1702515219 Steam Version: 1702515219 Steam Client Build Date: Thu, Dec 14 00:36 UTC -08:00 --- src/globals/SteamClient.ts | 89 ++++++++++++++++++++++++++++++++------ 1 file changed, 76 insertions(+), 13 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 9a9795f9..947fba72 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -284,6 +284,15 @@ export interface Apps { // [...appStore.m_mapStoreTagLocalization.keys()] GetStoreTagLocalization(tags: number[]): Promise<StoreTagLocalization[]>; + /** + * Retrieves a list of subscribed workshop item details for a specific application. + * @param {number} appId - The ID of the application to retrieve subscribed workshop item details for. + * @param {string[]} itemIds - Workshop item IDs to retrieve details for. + * @returns {Promise<WorkshopItemDetails[] | OperationResponse>} - A Promise that resolves to an array of subscribed workshop item details for the specified application. + * @throws Throws if the query failed. + */ + GetSubscribedWorkshopItemDetails(appId: number, itemIds: string[]): Promise<WorkshopItemDetails[] | OperationResponse>; + /** * Retrieves a list of subscribed workshop items for a specific application. * @param {number} appId - The ID of the application to retrieve subscribed workshop items for. @@ -302,6 +311,16 @@ export interface Apps { MarkEulaAccepted: any; MarkEulaRejected: any; + /** + * Move specified workshop item load order. + * @param appId - The ID of the application. + * @param oldOrder - The item to move, referenced by its position number. + * @param newOrder - The position number to move the item to. + * @returns {void} + * @remarks Orders are zero-indexed. + */ + MoveWorkshopItemLoadOrder(appId: number, oldOrder: number, newOrder: number): void; + /** * Opens the settings dialog for a specific application. * @param {number} appId - The ID of the application for which to open the settings dialog. @@ -628,6 +647,24 @@ export interface Apps { SetThirdPartyControllerConfiguration: any; + /** + * Sets the workshop items disabled state. + * @param {number} appId - The ID of the application. + * @param {string[]} itemIds - Workshop item IDs to change the state for. + * @param {boolean} value - `true` to disable, `false` otherwise. + * @returns {void} + */ + SetWorkshopItemsDisabledLocally(appId: number, itemIds: string[], value: boolean): void; + + /** + * Sets the workshop items load order for a specified application. + * @param {number} appId - The ID of the application. + * @param {string[]} itemIds - Workshop item IDs. + * @returns {void} + * @remarks `itemIds` has to be the full list of subscribed items, otherwise the specified items get moved to the last position. + */ + SetWorkshopItemsLoadOrder(appId: number, itemIds: string[]): void; + /** * Opens the controller configurator for a specific application. * @param {number} appId - The ID of the application for which to open the controller configurator. @@ -1001,6 +1038,8 @@ export interface FamilySharing { */ DeauthorizeLocalDevice(): Promise<number>; + GetFamilyGroupInfo(): Promise<string>; + RegisterForKickedBorrower: any; RequestLocalDeviceAuthorization(steam64Id: string): Promise<number>; @@ -1136,18 +1175,6 @@ export interface GameSessions { * Represents functions related to input and controllers in Steam. */ export interface Input { - /** - * Checks if the specified controller is a Steam Controller. - * @param {function} callback - The callback function to receive the result. - */ - BIsSteamController(callback: (steamController: boolean) => void): void; - - /** - * Checks if the specified controller supports LED color. - * @param {function} callback - The callback function to receive the result. - */ - BSupportsControllerLEDColor(callback: (supportControllerLEDColor: boolean) => void): void; - CalibrateControllerIMU(param0: any): any; // param0 - m_controllerStateDeviceIdx CalibrateControllerJoystick(param0: any): any; // param0 - m_controllerStateDeviceIdx CalibrateControllerTrackpads(param0: any): any; // param0 - m_controllerStateDeviceIdx @@ -1701,8 +1728,8 @@ export interface Notifications { export interface VRDevice { BIsConnected: any; - BVRDeviceSeenRecently: any; RegisterForDeviceConnectivityChange: Unregisterable | any; + RegisterForVRDeviceSeenRecently: Unregisterable | any; } export interface DeviceProperties { @@ -4035,6 +4062,42 @@ export interface AuthRefreshInfo { login_id_token: string; } +export interface WorkshopItemDetails { + /** + * Required items' IDs. + */ + children: string[]; + eresult: Result; + /** + * Item size, in byts. + */ + file_size: string; + /** + * @todo enum? + */ + file_type: number; + /** + * Item preview image URL. + */ + preview_url: string; + /** + * Item ID. + */ + publishedfileid: string; + /** + * Item description. + */ + short_description: string; + /** + * Item tags. + */ + tags: string[]; + /** + * Item title. + */ + title: string; +} + export interface WorkshopItem { unAppID: number; ulPublishedFileID: string; From d3bdf057dca8a4ac2ab5573fd8ba467cf27f0479 Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Sat, 6 Jan 2024 13:38:10 +0000 Subject: [PATCH 27/46] docs(SteamClient): update interfaces to Steam Version 1704329464 Steam Version: 1704329464 Steam Client Build Date: Thu, Jan 4 12:23 AM UTC -08:00 --- src/globals/SteamClient.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 947fba72..f63a1342 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -1048,10 +1048,6 @@ export interface FamilySharing { UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise<number>; } -export interface Features { - SteamInitsPopups(): boolean; -} - /** * Represents friend settings and configuration. */ @@ -3488,7 +3484,6 @@ export interface SteamClient { Customization: Customization; Downloads: Downloads; FamilySharing: FamilySharing; - Features: Features; FriendSettings: FriendSettings; Friends: Friends; GameNotes: GameNotes; @@ -6435,6 +6430,7 @@ export interface MsgClientSettings extends JsPbMessage { steam_networking_share_ip(): number; steam_os_underscan_enabled(): boolean; steam_os_underscan_level(): number; + steamos_status_led_brightness(): number; turn_off_controller_on_exit(): boolean; voice_mic_device_name(): string; voice_mic_input_gain(): number; From 24e49f5bd917ddf99a7f41816fac060a2d15765c Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Fri, 19 Jan 2024 10:10:53 +0000 Subject: [PATCH 28/46] docs(SteamClient): update interfaces to Steam Version 1705630720 Steam Version: 1705630720 Steam Client Build Date: Fri, Jan 19 1:58 AM UTC -08:00 --- src/globals/SteamClient.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index f63a1342..e8bd5d76 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -25,6 +25,8 @@ export interface Apps { */ AddUserTagToApps(appIds: number[], userTag: string): void; + ArePrivateAppsEnabled(): Promise<boolean>; + /** * Backups an app to the specified path. * @param {number} appId - The ID of the application to back up. @@ -842,6 +844,12 @@ export interface Browser { RegisterForOpenNewTab: Unregisterable | any; + /** + * Restarts the browser. + * @returns {void} + */ + RestartJSContext(): void; + SetShouldExitSteamOnBrowserClosed(value: boolean): any; SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; @@ -1768,6 +1776,7 @@ export interface VROverlay { RegisterForCursorMovement: Unregisterable | any; RegisterForVisibilityChanged: Unregisterable | any; ShowDashboard: any; + SwitchToDashboardOverlay(param0: string): void; } export interface OpenVR { From f7b346f60a7eee49323f802eac4c41d0bfc75fee Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Sat, 3 Feb 2024 09:12:42 +0000 Subject: [PATCH 29/46] docs(SteamClient): update interfaces to Steam Version 1706914901 Steam Version: 1706914901 Steam Client Build Date: Fri, Feb 2 8:46 PM UTC -08:00 --- src/globals/SteamClient.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index e8bd5d76..ac6fdf4c 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -850,6 +850,8 @@ export interface Browser { */ RestartJSContext(): void; + SetBackgroundThrottlingDisabled(value: boolean): void; + SetShouldExitSteamOnBrowserClosed(value: boolean): any; SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; @@ -1770,8 +1772,15 @@ export interface PathProperties { SetStringPathProperty: any; } +export interface VRNotifications { + HideCustomNotification: any; + RegisterForNotificationEvent: Unregisterable | any; + ShowCustomNotification: any; +} + export interface VROverlay { HideDashboard: any; + IsDashboardVisible(): Promise<boolean>; RegisterForButtonPress: Unregisterable | any; RegisterForCursorMovement: Unregisterable | any; RegisterForVisibilityChanged: Unregisterable | any; @@ -1799,10 +1808,9 @@ export interface OpenVR { RegisterForVRHardwareDetected: Unregisterable | any; SetOverlayInteractionAffordance: any; - ShowNotification(title: string, description: string): any; - StartVR: any; TriggerOverlayHapticEffect: any; + VRNotifications: VRNotifications; VROverlay: VROverlay; } From 314e19ce5e46895b314bd6df4756d12ea80677ce Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Sat, 9 Mar 2024 14:46:30 +0000 Subject: [PATCH 30/46] docs(SteamClient): update interfaces to Steam Version 1709920887 Steam Version: 1709920887 Steam Client Build Date: Thu, Mar 7 5:29 PM UTC -08:00 --- src/globals/SteamClient.ts | 46 +++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index ac6fdf4c..49f01eab 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -1048,11 +1048,13 @@ export interface FamilySharing { */ DeauthorizeLocalDevice(): Promise<number>; + GetAvailableLenders(appId: number): Promise<Lender[]>; GetFamilyGroupInfo(): Promise<string>; RegisterForKickedBorrower: any; RequestLocalDeviceAuthorization(steam64Id: string): Promise<number>; + SetPreferredLender(appId: number, param1: number): Promise<number>; // param0 - account id? UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise<number>; @@ -1783,6 +1785,7 @@ export interface VROverlay { IsDashboardVisible(): Promise<boolean>; RegisterForButtonPress: Unregisterable | any; RegisterForCursorMovement: Unregisterable | any; + RegisterForThumbnailChanged: Unregisterable | any; RegisterForVisibilityChanged: Unregisterable | any; ShowDashboard: any; SwitchToDashboardOverlay(param0: string): void; @@ -1792,6 +1795,10 @@ export interface OpenVR { Device: VRDevice; DeviceProperties: DeviceProperties; + /** + * @throws OperationResponse if mutual capabilities haven't been loaded. + */ + GetMutualCapabilities(): Promise<any>; GetWebSecret(): Promise<string>; InstallVR(): any; @@ -1804,8 +1811,10 @@ export interface OpenVR { RegisterForButtonPress: Unregisterable | any; RegisterForHMDActivityLevelChanged: Unregisterable | any; RegisterForInstallDialog: Unregisterable | any; - RegisterStartupErrors: Unregisterable | any; + RegisterForStartupErrors: Unregisterable | any; RegisterForVRHardwareDetected: Unregisterable | any; + RegisterForVRModeChange(callback: (param0: boolean) => void): Unregisterable | any; + RegisterForVRSceneAppChange(callback: (param0: number) => void): Unregisterable | any; SetOverlayInteractionAffordance: any; StartVR: any; @@ -2869,6 +2878,13 @@ export interface System { Audio: Audio; AudioDevice: AudioDevice; Bluetooth: Bluetooth; + /** + * Creates a temporary folder. + * @param path The folder to create. + * @returns The created path. + * @todo Does this support relative paths ? this has some weird behavior + */ + CreateTempPath(path: string): Promise<string>; Devkit: Devkit; Display: Display; DisplayManager: DisplayManager; @@ -2890,6 +2906,14 @@ export interface System { IsSteamInTournamentMode(): Promise<boolean>; + /** + * Moves a file. + * @param target Target file/folder. + * @param destination Destination path. + * @remarks Does not throw on error. + */ + MoveFile(target: string, destination: string): void; + Network: Network; NotifyGameOverlayStateChanged(latestAppOverlayStateActive: boolean, appId: number): any; @@ -4024,6 +4048,17 @@ export interface DownloadOverview { update_state: 'None' | 'Starting' | 'Updating' | 'Stopping'; } +export interface Lender { + /** + * A Steam64 ID. + */ + steamid: string; + appid: number; + numDlc: number; + bPreferred: boolean; + vecDLC: any[]; +} + export interface InstallInfo { rgAppIDs: InstallInfoApps[]; eInstallState: number; @@ -6357,6 +6392,7 @@ export interface MsgClientSettings extends JsPbMessage { controller_xbox_driver(): boolean; controller_xbox_support(): boolean; default_ping_rate(): number; + developer_dummy_setting(): boolean; disable_all_toasts(): boolean; disable_toasts_in_game(): boolean; display_name(): string; @@ -6366,6 +6402,7 @@ export interface MsgClientSettings extends JsPbMessage { download_throttle_rate(): number; download_throttle_while_streaming(): boolean; download_while_app_running(): boolean; + enable_avif_screenshots(): boolean; enable_dpi_scaling(): boolean; enable_gpu_accelerated_webviews(): boolean; enable_hardware_video_decoding(): boolean; @@ -6384,9 +6421,13 @@ export interface MsgClientSettings extends JsPbMessage { game_notes_enable_spellcheck(): boolean; gamescope_app_target_framerate(): number; gamescope_disable_framelimit(): boolean; + gamescope_disable_mura_correction(): boolean; gamescope_display_refresh_rate(): number; gamescope_enable_app_target_framerate(): boolean; gamescope_hdr_visualization(): HDRVisualization; + gamescope_include_steamui_in_screenshots(): boolean; + gamescope_use_game_refresh_rate_in_steam(): boolean; + hdr_compat_testing(): boolean; in_client_beta(): boolean; is_external_display(): boolean; is_steam_sideloaded(): boolean; @@ -6734,6 +6775,9 @@ export enum DisplayStatus { CloudError = 34, CloudOutOfDate = 35, Terminating = 36, + OwnerLocked, + DownloadFailed, + UpdateFailed, } export enum AppCloudStatus { From caafb6caf9a3ddb6b71286afe63faf1736314ee1 Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Thu, 21 Mar 2024 16:35:00 +0000 Subject: [PATCH 31/46] docs(SteamClient): update interfaces to Steam Version 1710786209 Steam Version: 1710786209 Steam Client Build Date: Mon, Mar 18 7:07 PM UTC -08:00 --- src/globals/SteamClient.ts | 42 ++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 49f01eab..0ebe9921 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -25,8 +25,6 @@ export interface Apps { */ AddUserTagToApps(appIds: number[], userTag: string): void; - ArePrivateAppsEnabled(): Promise<boolean>; - /** * Backups an app to the specified path. * @param {number} appId - The ID of the application to back up. @@ -811,10 +809,7 @@ export interface Broadcast { } export interface Browser { - BIsDirectHWNDBrowser: any; - BIsPopupWindow: any; - BIsVROverlayBrowser: any; - + AddWordToDictionary(word: string): void; ClearAllBrowsingData(): void; ClearHistory(): void; @@ -823,6 +818,8 @@ export interface Browser { GetBrowserID(): Promise<number>; + GetSpellingSuggestions(word: string): string[]; + GetSteamBrowserID(): Promise<number>; // 16-bit unsigned integer? /** @@ -837,6 +834,11 @@ export interface Browser { OpenDevTools(): void; + /** + * Pastes the clipboard contents. + */ + Paste(): void; + /** * @todo unconfirmed */ @@ -844,6 +846,8 @@ export interface Browser { RegisterForOpenNewTab: Unregisterable | any; + ReplaceMisspelling: any; + /** * Restarts the browser. * @returns {void} @@ -852,6 +856,8 @@ export interface Browser { SetBackgroundThrottlingDisabled(value: boolean): void; + SetPendingFilePath(path: string): Promise<boolean>; + SetShouldExitSteamOnBrowserClosed(value: boolean): any; SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; @@ -2090,7 +2096,7 @@ export interface Screenshots { * @param {number} screenshotIndex - The index of the local screenshot. * @returns {Promise<Screenshot>} - A Promise that resolves to the requested local screenshot. */ - GetLocalScreenshot(appId: string, screenshotIndex: number): Promise<Screenshot>; + GetLocalScreenshotByHandle(appId: string, screenshotIndex: number): Promise<Screenshot>; /** * Retrieves the count of local screenshots for a specific application. @@ -2105,6 +2111,13 @@ export interface Screenshots { */ GetNumGamesWithLocalScreenshots(): Promise<number>; + /** + * Gets total screenshot usage in the specified library folder. + * @param path Library folder path. + * @returns {Promise<number>} A Promise that resolves to the number of taken space in bytes. + */ + GetTotalDiskSpaceUsage(path: string): Promise<number>; + /** * Opens a local screenshot in the system image viewer. * If the screenshot index is invalid, this function opens the screenshots directory for the specified application ID. @@ -2878,6 +2891,12 @@ export interface System { Audio: Audio; AudioDevice: AudioDevice; Bluetooth: Bluetooth; + /** + * Copies specified files to clipboard. + * Does not throw if not found. + * @param paths File paths to copy. + */ + CopyFilesToClipboard(paths: string[]): void; /** * Creates a temporary folder. * @param path The folder to create. @@ -6392,7 +6411,6 @@ export interface MsgClientSettings extends JsPbMessage { controller_xbox_driver(): boolean; controller_xbox_support(): boolean; default_ping_rate(): number; - developer_dummy_setting(): boolean; disable_all_toasts(): boolean; disable_toasts_in_game(): boolean; display_name(): string; @@ -6427,6 +6445,7 @@ export interface MsgClientSettings extends JsPbMessage { gamescope_hdr_visualization(): HDRVisualization; gamescope_include_steamui_in_screenshots(): boolean; gamescope_use_game_refresh_rate_in_steam(): boolean; + gamestream_hardware_video_encode(): boolean; hdr_compat_testing(): boolean; in_client_beta(): boolean; is_external_display(): boolean; @@ -6468,6 +6487,13 @@ export interface MsgClientSettings extends JsPbMessage { screenshot_key(): Hotkey; screenshots_path(): string; server_ping_rate(): number; + setting_validation_bool(): boolean; + setting_validation_enum(): HDRVisualization; + setting_validation_int32(): number; + setting_validation_uint32(): number; + setting_validation_uint64(): number; + setting_validation_float(): number; + setting_validation_string(): string; shader_precached_size(): string; show_family_sharing_notifications(): boolean; show_screenshot_manager(): boolean; From 620e0332a0076c3f77767c1372e2b846a9dfa227 Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Sat, 23 Mar 2024 14:20:07 +0000 Subject: [PATCH 32/46] docs(SteamClient): document even more interfaces --- src/globals/SteamClient.ts | 661 +++++++++++++++++++++++++++++++------ 1 file changed, 557 insertions(+), 104 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 0ebe9921..6a80ef4e 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -199,9 +199,12 @@ export interface Apps { GetGameActionForApp( appId: string, callback: ( - param0: number /*flag check? for validity*/, + gameActionId: number, + /** + * This parameter is a number only with the value `0`. + */ appId: number | string, - param2: string /* "LaunchApp", need to look for more to document*/, + taskName: AppAction, ) => void, ): void; @@ -307,6 +310,9 @@ export interface Apps { ListFlatpakApps(): Promise<any>; + /** + * @throws if the user does not own the app or no EULA. + */ LoadEula(appId: number): Promise<EndUserLicenseAgreement[]>; // Doesn't bring up the EULA dialog, just returns the eula data MarkEulaAccepted: any; MarkEulaRejected: any; @@ -373,7 +379,8 @@ export interface Apps { */ RegisterForGameActionEnd(callback: (gameActionIdentifier: number) => void): Unregisterable | any; - RegisterForGameActionShowError: Unregisterable | any; + // "error" is a localization token + RegisterForGameActionShowError(callback: (gameActionId: number, appId: string, actionName: string, error: string, param4: string) => void): Unregisterable | any; /** * Registers a callback function to be called when a game action UI is shown. @@ -388,7 +395,7 @@ export interface Apps { * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForGameActionStart( - callback: (gameActionIdentifier: number, appId: string, action: string, param3: number) => void, + callback: (gameActionIdentifier: number, appId: string, action: string, param3: AppLaunchSource) => void, ): Unregisterable | any; /** @@ -470,7 +477,7 @@ export interface Apps { ResetHiddenState(appIds: number[]): Promise<void>; /** - * Runs a game with specified parameters. + * Runs a game with specified parameters. Focuses the game if already launched. * @param {string} appId - The ID of the application to run. * @param {string} launchOptions - Additional launch options for the application. * @param {number} param2 - Additional parameter (exact usage may vary). @@ -871,9 +878,12 @@ export interface Browser { } export interface BrowserView { - Create(browser: BrowserViewInit | undefined): BrowserViewPopup; + Create(browser?: BrowserViewInit): BrowserViewPopup; - CreatePopup(browser: BrowserViewInit | undefined): { + CreatePopup(browser?: BrowserViewInit): { + /** + * URL for usage with `window.open()`. + */ strCreateURL: string; browserView: BrowserViewPopup; }; @@ -892,7 +902,11 @@ export interface ClientNotifications { */ DisplayClientNotification(notification: ClientUINotification, options: string, callback: any): void; - OnRespondToClientNotification: any; + /** + * @param notificationId The ID of the notification to handle. + * @param handleAction `true` to habdle the associated notification action, `false` otherwise. + */ + OnRespondToClientNotification(notificationId: number, handleAction: boolean): void; } export interface Cloud { @@ -1098,7 +1112,10 @@ export interface Friends { */ AddFriend(steamId: string): Promise<boolean>; - GetCoplayData(): Promise<any>; // {"recentUsers":[], "currentUsers":[]} + GetCoplayData(): Promise<{ + currentUsers: CoplayUser[]; + recentUsers: CoplayUser[]; + }>; InviteUserToCurrentGame: any; /** @@ -1207,7 +1224,7 @@ export interface Input { /** * Sets a specified key's pressed state. - * @param {number} keyIndex - The key index to set the state for. + * @param {EHIDKeyboardKey} keyIndex - The key index to set the state for. * @param {boolean} state - true for pressed, false otherwise. * @returns {void} * @example @@ -1219,7 +1236,7 @@ export interface Input { * SteamClient.Input.ControllerKeyboardSetKeyState(103, false); * ``` */ - ControllerKeyboardSetKeyState(keyIndex: number, state: boolean): void; + ControllerKeyboardSetKeyState(keyIndex: EHIDKeyboardKey, state: boolean): void; DeauthorizeControllerAccount: any; @@ -1836,7 +1853,7 @@ export interface Overlay { */ DestroyGamePadUIDesktopConfiguratorWindow(): void; - GetOverlayBrowserInfo(): any; + GetOverlayBrowserInfo(): Promise<OverlayBrowserInfo[]>; HandleGameWebCallback(url: string): any; @@ -1861,7 +1878,7 @@ export interface Overlay { RegisterForMicroTxnAuthDismiss(callback: (appId: number, microTxnId: string) => void): Unregisterable | any; RegisterForNotificationPositionChanged( - callback: (appId: any, position: any, horizontalInset: number, verticalInset: number) => void, + callback: (appId: any, position: NotificationPosition, horizontalInset: number, verticalInset: number) => void, ): Unregisterable | any; /** @@ -1870,7 +1887,7 @@ export interface Overlay { * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForOverlayActivated( - callback: (popUpContextId: number, appId: number, active: boolean, param3: boolean) => void, + callback: (overlayProcessPid: number, appId: number, active: boolean, param3: boolean) => void, ): Unregisterable | any; /** @@ -2361,10 +2378,10 @@ export interface ServerBrowser { } export interface Settings { - AddClientBeta(param0: any, name: string): any; + AddClientBeta(name: string, password: string): void; /** - * Clears HTTP cache in `<STEAMPATH>/appcache/httpcache`. + * Clears HTTP cache located in `<STEAMPATH>/appcache/httpcache`. * @returns {void} */ ClearAllHTTPCaches(): void; @@ -2473,7 +2490,7 @@ export interface SharedConnection { // src\clientdll\clientsharedconnection.cpp (154) : m_mapSharedConnections.HasElement( hSharedConnection ) Close(hSharedConnection: number): void; - RegisterOnBinaryMessageReceived(hSharedConnection: number, callback: (param0: any) => void): Unregisterable | any; + RegisterOnBinaryMessageReceived(hSharedConnection: number, callback: (data: ArrayBuffer) => void): Unregisterable | any; RegisterOnLogonInfoChanged(hSharedConnection: number, callback: (info: LogonInfo) => void): Unregisterable | any; @@ -2499,21 +2516,26 @@ export interface Stats { } export interface SteamChina { - GetCustomLauncherAppID: any; + GetCustomLauncherAppID(): Promise<number>; } +/** + * SteamClient.MachineStorage affects the "STEAMPATH/config/config.vdf" file. + * SteamClient.RoamingStorage affects the "STEAMPATH/userdata/STEAMID3/7/remote/sharedconfig.vdf" file. + * SteamClient.Storage affects the "STEAMPATH/userdata/STEAMID3/config/localconfig.vdf" file. + */ export interface Storage { - DeleteKey: Promise<OperationResponse | void>; + DeleteKey(key: string): Promise<OperationResponse | void>; /** * @remarks Use {@link SetObject} to set. */ - GetJSON: Promise<OperationResponse | string>; - GetString: Promise<OperationResponse | string>; + GetJSON(key: string): Promise<OperationResponse | string>; + GetString(key: string): Promise<OperationResponse | string>; /** * @remarks Use {@link SetObject} to get. */ - SetObject: Promise<OperationResponse | void>; - SetString: Promise<OperationResponse | void>; + SetObject(key: string, value: any): Promise<OperationResponse | void>; + SetString(key: string, value: string): Promise<OperationResponse | void>; } export interface Streaming { @@ -2828,7 +2850,7 @@ export interface Network { */ RegisterForDeviceChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - SetFakeLocalSystemState(param0: any): any; // enums + SetFakeLocalSystemState(state: ENetFakeLocalSystemState): void; SetProxyInfo(mode: number, address: string, port: number, excludeLocal: boolean): void; @@ -2859,8 +2881,9 @@ export interface Perf { export interface Report { /** * Generates a system report located in /tmp/steamXXXXXX (https://steamloopback.host/systemreports). + * @throws OperationResponse */ - GenerateSystemReport(): Promise<SystemReportReply>; + GenerateSystemReport(): Promise<SystemReportReply | OperationResponse>; /** * Saves a report in the Desktop directory. @@ -2882,7 +2905,8 @@ export interface SystemUI { RegisterForFocusChangeEvents(callback: (event: FocusChangeEvent) => void): Unregisterable | any; - RegisterForOverlayGameWindowFocusChanged(callback: (param0: number, param1: number) => void): Unregisterable | any; + // appId is 0 if unknown app is focused + RegisterForOverlayGameWindowFocusChanged(callback: (appId: number, param1: number) => void): Unregisterable | any; RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable | any; // eKey } @@ -3138,11 +3162,11 @@ export interface User { Reconnect(): void; - RegisterForConnectionAttemptsThrottled(callback: (param0: any) => void): Unregisterable | any; + RegisterForConnectionAttemptsThrottled(callback: (data: ConnectionAttempt) => void): Unregisterable | any; - RegisterForCurrentUserChanges(callback: (data: any) => void): Unregisterable | any; + RegisterForCurrentUserChanges(callback: (user: CurrentUser) => void): void; - RegisterForLoginStateChange(callback: (username: string) => void): Unregisterable | any; + RegisterForLoginStateChange(callback: (accountName: string, loginState: ELoginState, loginResult: number, loginPercentage: number, param4: number) => void): Unregisterable | any; RegisterForPrepareForSystemSuspendProgress(callback: (data: any) => void): Unregisterable | any; @@ -3167,7 +3191,9 @@ export interface User { */ RemoveUser(accountName: string): void; - RequestSupportSystemReport: any; + RequestSupportSystemReport(reportId: string): Promise<{ + bSuccess: boolean; + }>; ResumeSuspendedGames(param0: boolean): any; @@ -3231,7 +3257,7 @@ export interface WebChat { */ GetLocalPersonaName(): Promise<string>; - GetOverlayChatBrowserInfo(): Promise<any[]>; + GetOverlayChatBrowserInfo(): Promise<OverlayBrowserInfo[]>; // param0 - appid ? GetPrivateConnectString(param0: number): Promise<string>; @@ -3338,9 +3364,10 @@ export interface WebUITransport { /** * Represents functionality for managing Steam's windows. + * Note that methods here have to be called from the window you want to use. */ export interface Window { - BringToFront(forceOS: WindowBringToFront | undefined): any; + BringToFront(forceOS?: WindowBringToFront): any; /** * @todo Shuts down Steam too? @@ -3444,6 +3471,7 @@ export interface Window { /** * Resizes the window to given dimension. + * The window has to be created with the resizable flag. * @param {number} width - Window width. * @param {number} height - Window height. * @param {boolean | number} applyBrowserScaleOrDPIValue @@ -3493,6 +3521,7 @@ export interface Window { /** * Sets the window's resize grip size. + * The window has to be created with the resize grip flag. * @param {number} width - Resize grip width. * @param {number} height - Resize grip height. * @returns {void} @@ -3617,6 +3646,50 @@ export type AppLanguage = { strShortName: string; }; +export type AppAction = "LaunchApp" | "VerifyApp"; + +export type LaunchAppTask = + | "None" + | "Completed" + | "Cancelled" + | "Failed" + | "Starting" + | "ConnectingToSteam" + | "RequestingLicense" + | "UpdatingAppInfo" + | "UpdatingAppTicket" + | "UnlockingH264" + | "WaitingOnWideVineUpdate" + | "ShowCheckSystem" + | "CheckTimedTrial" + | "GetDurationControl" + | "ShowDurationControl" + | "ShowLaunchOption" + | "ShowEula" + | "ShowVR2DWarning" + | "ShowVROculusOnly" + | "ShowVRStreamingLaunch" + | "ShowGameArgs" + | "ShowCDKey" + | "WaitingPrevProcess" + | "DownloadingDepots" + | "DownloadingWorkshop" + | "UpdatingDRM" + | "GettingLegacyKey" + | "ProcessingInstallScript" + | "RunningInstallScript" + | "SynchronizingCloud" + | "SynchronizingControllerConfig" + | "ShowNoControllerConfig" + | "ProcessingShaderCache" + | "VerifyingFiles" + | "KickingOtherSession" + | "WaitingOpenVRAppQuit" + | "SiteLicenseSeatCheckout" + | "DelayLaunch" + | "CreatingProcess" + | "WaitingGameWindow" + export type LogoPinPositions = 'BottomLeft' | 'UpperLeft' | 'CenterCenter' | 'UpperCenter' | 'BottomCenter'; export type ServerBrowserTab = 'internet' | 'favorites' | 'history' | 'lan' | 'friends'; @@ -3764,10 +3837,22 @@ export interface AppDetails { eAppOwnershipFlags: AppOwnershipFlags | number; // is this a bitmask? eAutoUpdateValue: AutoUpdateBehavior; eBackgroundDownloads: BackgroundDownloadsBehavior; + /** + * @todo enum + */ eCloudSync: number; + /** + * @todo enum + */ eControllerRumblePreference: number; // ControllerRumbleSetting? eDisplayStatus: DisplayStatus; + /** + * @todo enum + */ eEnableThirdPartyControllerConfiguration: number; + /** + * @todo enum + */ eSteamInputControllerMask: number; /** * Index of the install folder. -1 if not installed. @@ -3999,7 +4084,7 @@ export interface AchievementNotification { export interface ScreenshotNotification { details: Screenshot; hScreenshot: number; - strOperation: string; + strOperation: "deleted" | "written"; unAppID: number; } @@ -4019,50 +4104,89 @@ export interface Screenshot { } export interface DownloadItem { + /** True if this app is currently downloading */ active: boolean; + /** Appid of app */ appid: number; + /** Current build ID for the installed app, zero if the app isn't installed yet */ buildid: number; + /** True if this update has been completed */ completed: boolean; + /** For completed downloads, time of completion, 0 if not completed */ completed_time: number; deferred_time: number; + /** Bytes already downloaded, sum across all content types */ downloaded_bytes: number; + /** If true, game will launch when its download completes successfully */ launch_on_completion: boolean; + /** True if this app has been paused by the user or the system */ paused: boolean; + /** Queue index, -1 if the item is unqueued */ queue_index: number; + /** Build ID that this download is moving towards. This can be the same as buildid.*/ target_buildid: number; + /** Total bytes to download, sum across all content types */ total_bytes: number; + /** + * Update error description, when paused and there has been an error. + * Unlocalized and shouldn't be displayed to the user. + */ update_error: string; - update_result: number; + update_result: AppUpdateError; update_type_info: UpdateTypeInfo[]; } export interface UpdateTypeInfo { + /** True if this content type had an update and it has completed */ completed_update: boolean; + /** Bytes already downloaded for this content type */ downloaded_bytes: number; + /** True if this content type has or had an update */ has_update: boolean; + /** Total bytes to download for this content type */ total_bytes: number; } export interface DownloadOverview { + /** Set if we are downloading from LAN peer content server */ lan_peer_hostname: string; + /** True if all downloads are paused */ paused: boolean; + /** True if download throttling has been temporarily suspended for the current download */ throttling_suspended: boolean; + /** Appid of currently updating app */ update_appid: number; + /** Bytes already downloaded */ update_bytes_downloaded: number; + /** Bytes already processed in current phase - resets to zero when update stage changes */ update_bytes_processed: number; + /** Bytes already staged */ update_bytes_staged: number; + /** Total bytes to download */ update_bytes_to_download: number; + /** Total bytes to process in current phase - resets to zero when update stage changes */ update_bytes_to_process: number; + /** Total bytes to be staged */ update_bytes_to_stage: number; + /** Current disk throughput estimate */ update_disc_bytes_per_second: number; + /** True if the current update is an initial install */ update_is_install: boolean; + /** True if download and staging sizes are prefetch estimates */ update_is_prefetch_estimate: boolean; + /** True if the current update is for shader update */ update_is_shader: boolean; + /** True if the client is running in peer content server mode serving other peers */ update_is_upload: boolean; + /** True if the current update is for workshop content */ update_is_workshop: boolean; + /** Current bandwidth estimate for download */ update_network_bytes_per_second: number; + /** Peak bandwidth estimate for download */ update_peak_network_bytes_per_second: number; + /** Estimate of remaining time (in seconds) until download completes (not including staging) */ update_seconds_remaining: number; + /** Time current update started */ update_start_time: number; update_state: 'None' | 'Starting' | 'Updating' | 'Stopping'; } @@ -4080,7 +4204,7 @@ export interface Lender { export interface InstallInfo { rgAppIDs: InstallInfoApps[]; - eInstallState: number; + eInstallState: EInstallManagerState; nDiskSpaceRequired: number; nDiskSpaceAvailable: number; nCurrentDisk: number; @@ -4119,7 +4243,7 @@ export interface SpewOutput { /** * The type or category of the spew output. */ - spew_type: string; + spew_type: "error" | "info" | "input"; } export interface AuthRefreshInfo { @@ -4139,9 +4263,9 @@ export interface WorkshopItemDetails { */ file_size: string; /** - * @todo enum? + * Workshop file type. */ - file_type: number; + file_type: WorkshopFileType; /** * Item preview image URL. */ @@ -4259,7 +4383,7 @@ interface SteamSettings { export interface PrePurchaseApp { nAppID: number; - eState: number; // todo: 3 = Preload? 4 - Ready? I got 3 from Starfield preload and 4 with csgo + eState: EAppReleaseState; } export interface PrePurchaseInfo { @@ -4317,13 +4441,13 @@ export interface AccountSettings { bEmailValidated: boolean; bHasAnyVACBans: boolean; bHasTwoFactor: boolean; - eSteamGuardState: number; + eSteamGuardState: ESteamGuardState; rtSteamGuardEnableTime: number; bSaveAccountCredentials: boolean; } export interface Language { - language: number; + language: ELanguage; strShortName: string; } @@ -4336,7 +4460,7 @@ export interface TimeZone { export interface AppBackupStatus { appid: number; - eError: number; // Without confirmation 20 - In progress, 3 - Cancelled? + eError: AppUpdateError; strBytesToProcess: string; strBytesProcessed: string; strTotalBytesWritten: string; @@ -4396,7 +4520,7 @@ export interface ParentalSettings { export interface ConnectivityTestChange { eConnectivityTestResult: ConnectivityTestResult; - eFakeState: number; + eFakeState: ENetFakeLocalSystemState; bChecking: boolean; } @@ -4539,6 +4663,9 @@ export interface TouchMenuMessage { } export interface ControllerCommandMessage { + /** + * @todo enum + */ eAction: number; nControllerIndex: number; } @@ -4556,6 +4683,12 @@ export interface ControllerAnalogInputMessage { nC: number; } +export interface CoplayUser { + accountid: number; + rtTimePlayed: number; + appid: number; +} + export interface FriendSettingsFeature { feature: string; bEnabled: boolean; @@ -4621,7 +4754,7 @@ export interface RemotePlayDevice { export interface RemotePlaySettings { bRemotePlaySupported: boolean; bRemotePlayEnabled: boolean; - eRemotePlayP2PScope: number; + eRemotePlayP2PScope: EStreamP2PScope; bRemotePlayServerConfigAvailable: boolean; bRemotePlayServerConfigEnabled: boolean; RemotePlayServerConfig: any; // todo: document {} @@ -4640,51 +4773,10 @@ export interface RemotePlaySettings { export interface GameAction { nGameActionID: number; gameid: string; - strActionName: string; - /* - None - 0 - Completed - 1 - Cancelled - 2 - Failed - 3 - Starting - 4 - ConnectingToSteam - 5 - RequestingLicense - 6 - UpdatingAppInfo - 7 - UpdatingAppTicket - 8 - UnlockingH264 - 9 - WaitingOnWideVineUpdate - 10 - ShowCheckSystem - 11 - CheckTimedTrial - 12 - GetDurationControl - 13 - ShowDurationControl - 14 - ShowLaunchOption - 15 - ShowEula - 16 - ShowVR2DWarning - 17 - ShowVROculusOnly - 18 - ShowVRStreamingLaunch - 19 - ShowGameArgs - 20 - ShowCDKey - 21 - WaitingPrevProcess - 22 - DownloadingDepots - 23 - DownloadingWorkshop - 24 - UpdatingDRM - 25 - GettingLegacyKey - 26 - ProcessingInstallScript - 27 - RunningInstallScript - 28 - SynchronizingCloud - 29 - SynchronizingControllerConfig - 30 - ShowNoControllerConfig - 31 - ProcessingShaderCache - 32 - VerifyingFiles - 33 - KickingOtherSession - 34 - WaitingOpenVRAppQuit - 35 - SiteLicenseSeatCheckout - 36 - DelayLaunch - 37 - CreatingProcess - 38 - WaitingGameWindow - 39 - */ - strTaskName: string; + strActionName: AppAction; + strTaskName: LaunchAppTask; strTaskDetails: string; + nLaunchOption: number; nSecondsRemaing: number; //fixme: not a typo, actually valve strNumDone: string; strNumTotal: string; @@ -4693,7 +4785,7 @@ export interface GameAction { export interface MoveContentProgress { appid: number; - eError: number; // 0 - appear when you open the move dialog and when it's done, 3 - cancelled? but appid is 0?, 20 - in progress + eError: AppUpdateError; flProgress: number; strBytesMoved: string; strTotalBytesToMove: string; @@ -4706,8 +4798,8 @@ export interface FolderChange { export interface MusicTrack { uSoundtrackAppId: number; - ePlaybackStatus: number; // 1 - playing, 2 - paused - eRepeatStatus: number; + ePlaybackStatus: EMusicPlaybackStatus; + eRepeatStatus: EMusicRepeatStatus; bShuffle: boolean; nVolume: number; nActiveTrack: number; @@ -4749,7 +4841,7 @@ export interface BroadcastStatus { nRequests: number; bIsBroadcasting: boolean; bIsRecordingDesktop: boolean; - eBroadcastReady: number; + eBroadcastReady: Result; bBroadcastCapable: boolean; bMicrophoneEnabled: boolean; bMicrophoneActive: boolean; @@ -4765,11 +4857,18 @@ export interface OverlayBrowserProtocols { export interface LaunchOption { /** - * @remarks This is an integer, despite the prefix. + * @remarks This is an integer, despite the prefix. 0 if false, 1 if true. + */ + bIsLaunchOptionTypeExemptFromGameTheater: number; + /** + * @remarks This is an integer, despite the prefix. 0 if false, 1 if true. */ bIsVRLaunchOption: number; eType: AppLaunchOptionType; nIndex: number; + /** + * Label localization string. + */ strDescription: string; strGameName: string; } @@ -5057,6 +5156,37 @@ export interface LoginUser { avatarUrl: string; } +export interface ConnectionAttempt { + rtCooldownExpiration: number; +} + +export interface CurrentUser { + NotificationCounts: { + async_game_updates: number; + comments: number; + gifts: number; + help_request_replies: number; + inventory_items: number; + invites: number; + moderator_messages: number; + offline_messages: number; + trade_offers: number; + }; + bHWSurveyPending: boolean; + bIsLimited: boolean; + bIsOfflineMode: boolean; + bPromptToChangePassword: boolean; + bSupportAckOnlyMessages: boolean; + bSupportAlertActive: boolean; + bSupportPopupMessage: boolean; + clientinstanceid: string; + strAccountBalance: string; + strAccountBalancePending: string; + strAccountName: string; + strFamilyGroupID: string; + strSteamID: string; +} + export interface SurveyEntry { strName: string; vecArgs: string[]; @@ -5104,7 +5234,10 @@ export interface ControllerConfigInfoMessageList extends ControllerConfigInfoMes bUsesMouse: boolean; bUsesKeyboard: boolean; bUsesGamepad: boolean; - eExportType: number; + /** + * @todo unconfirmed + */ + eExportType: EControllerConfigExportType; playtime: string; bSelected: boolean; } @@ -5683,6 +5816,9 @@ export interface SteamWindow { strAppName: string; unID: number; unPID: number; + /** + * @todo enum + */ windowType: number; x: number; y: number; @@ -5745,6 +5881,21 @@ export interface LogonInfo { strUserCountry: string; } +export interface OverlayBrowserInfo { + appID: number; + eBrowserType: BrowserType; + eUIMode: UIMode; + flDisplayScale?: number; + gameID: string; + nBrowserID: number; + nScreenHeight: number; + nScreenWidth: number; + /** + * The PID of the overlay process. + */ + unPID: number; +} + export interface GameWindowInfo { bCanClose: boolean; strTitle: string; @@ -5829,7 +5980,7 @@ export interface NetworkDeviceIPv6 extends NetworkDeviceIP { } export interface WirelessAP { - esecurity: WirelessAPSecurity; + esecurity: WirelessAPSecurityFlags; estrength: WirelessAPStrength; id: number; is_active: boolean; @@ -6198,13 +6349,6 @@ export interface JsPbMessageClass { * Deserialized JsPb message. */ export interface JsPbMessage { - array: any[]; - arrayIndexOffset_: number; - convertedPrimitiveFields_: any; - messageId_?: string; - pivot_: number; - wrappers_: any; - getClassName(): string; serializeBase64String(): string; serializeBinary(): Uint8Array; @@ -6608,12 +6752,29 @@ export enum AppArtworkAssetType { HeroBlur = 5, } +/** + * Controls how Gamescope renders the GamepadUI window when a game is running. + */ export enum UIComposition { + /** Steam is not rendered on the screen. */ Hidden = 0, + /** + * Transparent divs will allow pixels from the app behind Steam to penetrate. + * Input goes to **the app**. + */ Notification = 1, + /** + * Transparent divs will allow pixels from the app behind Steam to penetrate. + * Input goes to **Steam**. + */ Overlay = 2, + /** Take all of the pixels on the screen, nothing "behind" Steam is shown. */ Opaque = 3, - OverlayKeyboard = 4, // Unverified + /** + * Special composition mode that matches Overlay, but forwards synthetic keyboard + * events to the Gamescope foreground app (game) instead of Steam. + */ + OverlayKeyboard = 4, } export enum OSType { @@ -6938,6 +7099,294 @@ export enum AppError { Max = 57, } +export enum BrowserType { + OffScreen, + OpenVROverlay, + OpenVROverlay_Dashboard, + DirectHWND, + DirectHWND_Borderless, + DirectHWND_Hidden, + ChildHWNDNative, + Transparent_Toplevel, + OffScreen_SharedTexture, + OffScreen_GameOverlay, + OffScreen_GameOverlay_SharedTexture, + Offscreen_FriendsUI, + Offscreen_SteamUI, + OpenVROverlay_Subview, +} + +export enum NotificationPosition { + TopLeft, + TopRight, + BottomLeft, + BottomRight, +} + +export enum WorkshopFileType { + Community, + Microtransaction, + Collection, + Art, + Video, + Screenshot, + Game, + Software, + Concept, + WebGuide, + IntegratedGuide, + Merch, + ControllerBinding, + SteamworksAccessInvite, + SteamVideo, + GameManagedItem, +} + +export enum EInstallManagerState { + None, + Setup, + WaitLicense, + FreeLicense, + ShowCDKey, + WaitAppInfo, + ShowPassword, + ShowConfig, + ShowEULAs, + CreateApps, + ReadFromMedia, + ShowChangeMedia, + WaitLegacyCDKeys, + ShowSignup, + Complete, + Failed, + Canceled, +} + +export enum EAppReleaseState { + Unknown, + Unavailable, + Prerelease, + PreloadOnly, + Released, + Disabled, +} + +export enum EControllerConfigExportType { + Unknown, + PersonalLocal, + PersonalCloud, + Community, + Template, + Official, + OfficialDefault, +} + +export enum EMusicPlaybackStatus { + Undefined, + Playing, + Paused, + Idle, +} + +export enum EMusicRepeatStatus { + None, + All, + Once, + Max, +} + +export enum EStreamP2PScope { + Automatic, + Disabled, + OnlyMe, + Friends, + Everyone, +} + +/** + * @todo unconfirmed, taken from localization strings + */ +export enum ESteamGuardState { + EmailUnverified, + Protected, + Disabled, + Offline, + NotEnabled, +} + +export enum ENetFakeLocalSystemState { + Normal, + NoLAN, + CaptivePortal_Redirected, + CaptivePortal_InPlace, + NoInternet, + NoSteam, +} + +export enum ELanguage { + None = -1, + English, + German, + French, + Italian, + Korean, + Spanish, + SimplifiedChinese, + TraditionalChinese, + Russian, + Thai, + Japanese, + Portuguese, + Polish, + Danish, + Dutch, + Finnish, + Norwegian, + Swedish, + Hungarian, + Czech, + Romanian, + Turkish, + Brazilian, + Bulgarian, + Greek, + Arabic, + Ukrainian, + LatamSpanish, + Vietnamese, + SteamChina_SChinese, + Max, +} + +export enum EHIDKeyboardKey { + Invalid, + BeforeFirst = 3, + A, + B, + C, + D, + E, + F, + G, + H, + I, + J, + K, + L, + M, + N, + O, + P, + Q, + R, + S, + T, + U, + V, + W, + X, + Y, + Z, + Key_1, + Key_2, + Key_3, + Key_4, + Key_5, + Key_6, + Key_7, + Key_8, + Key_9, + Key_0, + Return, + Escape, + Backspace, + Tab, + Space, + Dash, + Equals, + LeftBracket, + RightBracket, + Backslash, + Unused1, + Semicolon, + SingleQuote, + Backtick, + Comma, + Period, + ForwardSlash, + CapsLock, + F1, + F2, + F3, + F4, + F5, + F6, + F7, + F8, + F9, + F10, + F11, + F12, + PrintScreen, + ScrollLock, + Break, + Insert, + Home, + PageUp, + Delete, + End, + PageDown, + RightArrow, + LeftArrow, + DownArrow, + UpArrow, + NumLock, + KeypadForwardSlash, + KeypadAsterisk, + KeypadDash, + KeypadPlus, + KeypadEnter, + Keypad_1, + Keypad_2, + Keypad_3, + Keypad_4, + Keypad_5, + Keypad_6, + Keypad_7, + Keypad_8, + Keypad_9, + Keypad_0, + KeypadPeriod, + LAlt, + LShift, + LWin, + LControl, + RAlt, + RShift, + RWin, + RControl, + VolUp, + VolDown, + Mute, + Play, + Stop, + Next, + Prev, + AfterLast, +} + +export enum ELoginState { + None, + WelcomeDialog, + WaitingForCreateUser, + WaitingForCredentials, + WaitingForNetwork, + WaitingForServerResponse, + WaitingForLibraryReady, + Success, + Quit, +} + export enum ClientBetaState { None = 0, NoneChosen = 1, @@ -7500,7 +7949,7 @@ export enum GamingDeviceType { SteamDeck = 544, } -export enum WirelessAPSecurity { +export enum WirelessAPSecurityFlags { None = 0, StaticWep = 1 << 0, DynamicWep = 1 << 1, @@ -7508,6 +7957,10 @@ export enum WirelessAPSecurity { WpaEnterprise = 1 << 3, Wpa2 = 1 << 4, Wpa2Enterprise = 1 << 5, + /** + * Special value to indicate that this platform does not support + * the security methods required to connect to an access point + */ Unsupported = 1 << 15, } From 2ca0a37b832306bf108cb8d0e3fe28abffceb3fe Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Sun, 24 Mar 2024 14:13:00 +0800 Subject: [PATCH 33/46] new: Document some SteamClient interfaces - part 15 --- src/globals/SteamClient.ts | 381 ++++++++++++++++++++++++++++++++++--- 1 file changed, 354 insertions(+), 27 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 6a80ef4e..20ab380e 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -485,7 +485,7 @@ export interface Apps { * @remarks `launchOptions` is appended before the ones specified in the application's settings. * @returns {void} */ - RunGame(appId: string, launchOptions: string, param2: number, param3: AppLaunchSource): void; + RunGame(appId: string, launchOptions: string, param2: number, launchSource: AppLaunchSource): void; /* function u(e, t) { @@ -817,6 +817,7 @@ export interface Broadcast { export interface Browser { AddWordToDictionary(word: string): void; + ClearAllBrowsingData(): void; ClearHistory(): void; @@ -1069,11 +1070,13 @@ export interface FamilySharing { DeauthorizeLocalDevice(): Promise<number>; GetAvailableLenders(appId: number): Promise<Lender[]>; + GetFamilyGroupInfo(): Promise<string>; RegisterForKickedBorrower: any; RequestLocalDeviceAuthorization(steam64Id: string): Promise<number>; + SetPreferredLender(appId: number, param1: number): Promise<number>; // param0 - account id? @@ -1116,6 +1119,7 @@ export interface Friends { currentUsers: CoplayUser[]; recentUsers: CoplayUser[]; }>; + InviteUserToCurrentGame: any; /** @@ -1206,9 +1210,12 @@ export interface GameSessions { * Represents functions related to input and controllers in Steam. */ export interface Input { - CalibrateControllerIMU(param0: any): any; // param0 - m_controllerStateDeviceIdx - CalibrateControllerJoystick(param0: any): any; // param0 - m_controllerStateDeviceIdx - CalibrateControllerTrackpads(param0: any): any; // param0 - m_controllerStateDeviceIdx + CalibrateControllerIMU(controllerIndex: any): any; + + CalibrateControllerJoystick(controllerIndex: any): any; + + CalibrateControllerTrackpads(controllerIndex: any): any; + CancelGyroSWCalibration(): any; ClearSelectedConfigForApp(appId: number, controllerIndex: number): any; @@ -1230,10 +1237,10 @@ export interface Input { * @example * Send paste command: * ``` - * SteamClient.Input.ControllerKeyboardSetKeyState(103, true); - * SteamClient.Input.ControllerKeyboardSetKeyState(25, true); - * SteamClient.Input.ControllerKeyboardSetKeyState(25, false); - * SteamClient.Input.ControllerKeyboardSetKeyState(103, false); + * SteamClient.Input.ControllerKeyboardSetKeyState(EHIDKeyboardKey.LControl, true); + * SteamClient.Input.ControllerKeyboardSetKeyState(EHIDKeyboardKey.V, true); + * SteamClient.Input.ControllerKeyboardSetKeyState(EHIDKeyboardKey.V, false); + * SteamClient.Input.ControllerKeyboardSetKeyState(EHIDKeyboardKey.LControl, false); * ``` */ ControllerKeyboardSetKeyState(keyIndex: EHIDKeyboardKey, state: boolean): void; @@ -1249,7 +1256,9 @@ export interface Input { ExportCurrentControllerConfiguration: any; ForceConfiguratorFocus: any; - ForceSimpleHapticEvent: any; + + ForceSimpleHapticEvent(param0: number, param1: number, param2: number, param3: number, param4: number): any; + FreeControllerConfig: any; GetConfigForAppAndController(appId: number, unControllerIndex: number): any; @@ -1261,7 +1270,7 @@ export interface Input { */ GetControllerMappingString(unControllerIndex: number): Promise<string>; - GetControllerPreviouslySeen: any; + GetControllerPreviouslySeen(): Promise<number[]>; GetSteamControllerDongleState(): Promise<boolean>; @@ -1272,7 +1281,7 @@ export interface Input { InitControllerSounds(): any; - InitializeControllerPersonalizationSettings: any; + InitializeControllerPersonalizationSettings(controllerIndex: number): any; ModalKeyboardDismissed(): void; @@ -1338,7 +1347,7 @@ export interface Input { callback: (controllerStateChanges: ControllerStateChange[]) => void, ): Unregisterable | any; - RegisterForDualSenseUpdateNotification: Unregisterable | any; + RegisterForDualSenseUpdateNotification(callback: (m_strDualSenseUpdateProduct: string) => void): Unregisterable | any; /** * Registers a callback for receiving game keyboard messages (text field popup for inputting text for games when in character creation or etc...). @@ -1355,7 +1364,7 @@ export interface Input { RegisterForUIVisualization: Unregisterable | any; - RegisterForUnboundControllerListChanges(callback: (param0: any) => void): Unregisterable | any; // param0 is an array + RegisterForUnboundControllerListChanges(callback: (m_unboundControllerList: any) => void): Unregisterable | any; // param0 is an array RegisterForUserDismissKeyboardMessages: Unregisterable | any; RegisterForUserKeyboardMessages: Unregisterable | any; RequestGyroActive: any; @@ -1367,7 +1376,8 @@ export interface Input { RestoreControllerPersonalizationSettings(controllerIndex: number): any; - SaveControllerCalibration: any; + SaveControllerCalibration(controllerIndex: number): any; + SaveControllerPersonalizationSettings: any; SaveControllerSounds: any; @@ -1375,21 +1385,54 @@ export interface Input { SetActiveControllerAccount: any; SetControllerConfigurationModeShiftBinding: any; - SetControllerHapticSetting: any; + + SetControllerHapticSetting(controllerIndex: number, eHapticSetting: any): any; SetControllerMappingString(mapping: string): void; - SetControllerName: any; + SetControllerName(controllerIndex: number, controllerName: string): any; + SetControllerNintendoLayoutSetting: any; SetControllerPersonalizationName: any; //param0 - nLStickDeadzone, bSWAntiDrift, nRHapticStrength, flRPadPressureCurve + /* + SteamClient.Input.SetControllerPersonalizationSetting("nLStickDeadzone", e.nLStickDeadzone), + SteamClient.Input.SetControllerPersonalizationSetting("nRStickDeadzone", e.nRStickDeadzone), + SteamClient.Input.SetControllerPersonalizationSetting("bSWAntiDrift", e.bSWAntiDrift ? 1 : 0), + SteamClient.Input.SetControllerPersonalizationSetting("nLHapticStrength", e.nLHapticStrength), + SteamClient.Input.SetControllerPersonalizationSetting("nRHapticStrength", e.nRHapticStrength), + SteamClient.Input.SetControllerPersonalizationSetting("flLPadPressureCurve", 100 * e.flLPadPressureCurve), + SteamClient.Input.SetControllerPersonalizationSetting("flRPadPressureCurve", 100 * e.flRPadPressureCurve), + SteamClient.Input.SetControllerPersonalizationSetting("ePlayerSlotLEDSetting", e), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nGyroSampleAngleOffsetX", e.nGyroSampleAngleOffsetX), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.bMomentumEnabled", e.bMomentumEnabled ? 1 : 0), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nMomentumFrictionX", e.nMomentumFrictionX), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nMomentumFrictionY", e.nMomentumFrictionY), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nAccerationLevel", e.nAccerationLevel), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.bInvertX", e.bInvertX ? 1 : 0), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.bInvertY", e.bInvertY ? 1 : 0), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nRotationAngle", e.nRotationAngle), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nTriggerClamping", e.nTriggerClamping), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nTriggerClampingAmount", e.nTriggerClampingAmount), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nGyroEnableButton", e.nGyroEnableButton), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nGyroEnableButtonBehavior", e.nGyroEnableButtonBehavior), + */ SetControllerPersonalizationSetting(param0: string, param1: number): any; - //param0 - flGyroStationaryTolerance, flAccelerometerStationaryTolerance + //param0 - flGyroStationaryTolerance, flAccelerometerStationaryTolerance, + /* + SteamClient.Input.SetControllerPersonalizationSettingFloat("GyroPreferenceData.flGyroNaturalSensitivity", e.flGyroNaturalSensitivity), + SteamClient.Input.SetControllerPersonalizationSettingFloat("GyroPreferenceData.flGyroXYRatio", e.flGyroXYRatio), + SteamClient.Input.SetControllerPersonalizationSettingFloat("GyroPreferenceData.flGyroSpeedDeadzone", e.flGyroSpeedDeadzone), + SteamClient.Input.SetControllerPersonalizationSettingFloat("GyroPreferenceData.flGyroPrecisionSpeed", e.flGyroPrecisionSpeed), + SteamClient.Input.SetControllerPersonalizationSettingFloat("flGyroStationaryTolerance", e.flGyroStationaryTolerance), + SteamClient.Input.SetControllerPersonalizationSettingFloat("flAccelerometerStationaryTolerance", e.flAccelerometerStationaryTolerance), + */ SetControllerPersonalizationSettingFloat(param0: string, param1: number): any; - SetControllerRumbleSetting: any; + SetControllerRumbleSetting(controllerIndex: number, rumblePreference: any): any; + SetCursorActionset: any; SetEditingControllerConfigurationActionSet: any; SetEditingControllerConfigurationInputActivator: any; @@ -1413,7 +1456,7 @@ export interface Input { SetSelectedConfigForApp(): any; - SetSteamControllerDonglePairingMode: any; + SetSteamControllerDonglePairingMode(bEnable: boolean, bSilent: boolean): any; SetVirtualMenuKeySelected(unControllerIndex: number, unMenuIndex: number, param2: number): any; // SetWebBrowserActionset: any; @@ -1431,8 +1474,24 @@ export interface Input { StartControllerDeviceSupportFlow(param0: any, param1: any, callback: (param2: any) => void): any; - StartEditingControllerConfigurationForAppIDAndControllerIndex: any; - StartGyroSWCalibration: any; + /* + this.m_updatingEditingConfigurationPromise = SteamClient.Input.StartEditingControllerConfigurationForAppIDAndControllerIndex(e, t).then((n=>{ + const o = c.bE.deserializeBinary(n).toObject(); + f.Debug("Loaded controller config for appid", e, n, o), + (0, + i.z)((()=>this.UpdateEditingConfiguration(e, t, o))) + } + )).catch((n=>{ + f.Debug("Loading controller config for appid rejected", e, n), + (0, + i.z)((()=>this.UpdateEditingConfiguration(e, t, null))) + } + )) + */ + StartEditingControllerConfigurationForAppIDAndControllerIndex(m_appId: number, m_unControllerIndex: number): Promise<any>; + + StartGyroSWCalibration(callback: () => void): any; + StopEditingControllerConfiguration: any; SwapControllerModeInputBindings: any; SwapControllerOrder: any; @@ -1760,7 +1819,8 @@ export interface Notifications { export interface VRDevice { BIsConnected: any; RegisterForDeviceConnectivityChange: Unregisterable | any; - RegisterForVRDeviceSeenRecently: Unregisterable | any; + + RegisterForVRDeviceSeenRecently(callback: (m_bVRDeviceSeenRecently: any) => void): Unregisterable | any; } export interface DeviceProperties { @@ -1775,7 +1835,7 @@ export interface DeviceProperties { export interface Keyboard { Hide(): any; - RegisterForStatus: Unregisterable | any; + RegisterForStatus(callback: (m_bIsKeyboardOpen: boolean, m_eKeyboardFlags: any, m_sInitialKeyboardText: string) => void): Unregisterable | any; SendDone(): any; @@ -1805,12 +1865,15 @@ export interface VRNotifications { export interface VROverlay { HideDashboard: any; + IsDashboardVisible(): Promise<boolean>; + RegisterForButtonPress: Unregisterable | any; RegisterForCursorMovement: Unregisterable | any; RegisterForThumbnailChanged: Unregisterable | any; RegisterForVisibilityChanged: Unregisterable | any; ShowDashboard: any; + SwitchToDashboardOverlay(param0: string): void; } @@ -1822,6 +1885,7 @@ export interface OpenVR { * @throws OperationResponse if mutual capabilities haven't been loaded. */ GetMutualCapabilities(): Promise<any>; + GetWebSecret(): Promise<string>; InstallVR(): any; @@ -1832,12 +1896,19 @@ export interface OpenVR { QuitAllVR(): any; RegisterForButtonPress: Unregisterable | any; - RegisterForHMDActivityLevelChanged: Unregisterable | any; + + RegisterForHMDActivityLevelChanged(callback: (m_eHMDActivityLevel: any) => void): Unregisterable | any; + RegisterForInstallDialog: Unregisterable | any; - RegisterForStartupErrors: Unregisterable | any; - RegisterForVRHardwareDetected: Unregisterable | any; - RegisterForVRModeChange(callback: (param0: boolean) => void): Unregisterable | any; + + RegisterForStartupErrors(callback: (clientError: any, initError: any, initErrorString: string) => void): Unregisterable | any; + + RegisterForVRHardwareDetected(callback: (m_bHMDPresent: any, m_bHMDHardwareDetected: any, m_strHMDName: any) => void): Unregisterable | any; + + RegisterForVRModeChange(callback: (m_bIsVRRunning: boolean) => void): Unregisterable | any; + RegisterForVRSceneAppChange(callback: (param0: number) => void): Unregisterable | any; + SetOverlayInteractionAffordance: any; StartVR: any; @@ -2526,15 +2597,19 @@ export interface SteamChina { */ export interface Storage { DeleteKey(key: string): Promise<OperationResponse | void>; + /** * @remarks Use {@link SetObject} to set. */ GetJSON(key: string): Promise<OperationResponse | string>; + GetString(key: string): Promise<OperationResponse | string>; + /** * @remarks Use {@link SetObject} to get. */ SetObject(key: string, value: any): Promise<OperationResponse | void>; + SetString(key: string, value: string): Promise<OperationResponse | void>; } @@ -2698,6 +2773,7 @@ export interface AudioDevice { * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + UpdateSomething: any; } @@ -2915,12 +2991,14 @@ export interface System { Audio: Audio; AudioDevice: AudioDevice; Bluetooth: Bluetooth; + /** * Copies specified files to clipboard. * Does not throw if not found. * @param paths File paths to copy. */ CopyFilesToClipboard(paths: string[]): void; + /** * Creates a temporary folder. * @param path The folder to create. @@ -2928,6 +3006,7 @@ export interface System { * @todo Does this support relative paths ? this has some weird behavior */ CreateTempPath(path: string): Promise<string>; + Devkit: Devkit; Display: Display; DisplayManager: DisplayManager; @@ -2994,6 +3073,7 @@ export interface System { * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link MsgSystemManagerSettings}. */ RegisterForSettingsChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + Report: Report; /** @@ -6350,8 +6430,11 @@ export interface JsPbMessageClass { */ export interface JsPbMessage { getClassName(): string; + serializeBase64String(): string; + serializeBinary(): Uint8Array; + /** * Converts the message to an object. */ @@ -6365,6 +6448,7 @@ export interface LibraryBootstrapData extends JsPbMessage { app_data(): AppBootstrapData[]; add_app_data(param0: any, param1: any): any; + set_app_data(param0: any): any; } @@ -6373,15 +6457,23 @@ export interface LibraryBootstrapData extends JsPbMessage { */ export interface AppOverview_Change extends JsPbMessage { app_overview(): SteamAppOverview[]; + full_update(): boolean; + removed_appid(): number[]; + update_complete(): boolean; add_app_overview(param0: any, param1: any): any; + add_removed_appid(param0: any, param1: any): any; + set_app_overview(param0: any): any; + set_full_update(param0: any): any; + set_removed_appid(param0: any): any; + set_update_complete(param0: any): any; } @@ -6399,17 +6491,27 @@ export interface AppOverview_Change extends JsPbMessage { */ export interface Authentication_DeviceDetails extends JsPbMessage { client_count(): number | undefined; + device_friendly_name(): string | undefined; + gaming_device_type(): GamingDeviceType | undefined; + machine_id(): Uint8Array | string; + os_type(): OSType | undefined; + platform_type(): AuthTokenPlatformType | undefined; set_client_count(): any; + set_device_friendly_name(): any; + set_gaming_device_type(): any; + set_machine_id(): any; + set_os_type(): any; + set_platform_type(): any; } @@ -6418,10 +6520,13 @@ export interface Authentication_DeviceDetails extends JsPbMessage { */ export interface MsgMonitorInfo extends JsPbMessage { monitors(): Monitor[]; + selected_display_name(): string; add_monitors(param0: any, param1: any): any; + set_monitors(param0: any): any; + set_selected_display_name(param0: any): any; } @@ -6430,32 +6535,59 @@ export interface MsgMonitorInfo extends JsPbMessage { */ export interface MsgSystemManagerSettings extends JsPbMessage { display_adaptive_brightness_enabled(): boolean; + display_colorgamut(): number; + display_colorgamut_labelset(): number; + display_colortemp(): number; + display_colortemp_default(): number; + display_colortemp_enabled(): boolean; + display_diagnostics_enabled(): boolean; + display_nightmode_blend(): number; + display_nightmode_enabled(): boolean; + display_nightmode_maxhue(): number; + display_nightmode_maxsat(): number; + display_nightmode_schedule_enabled(): boolean; + display_nightmode_schedule_endtime(): number; + display_nightmode_schedule_starttime(): number; + display_nightmode_tintstrength(): number; + display_nightmode_uiexp(): number; + fan_control_mode(): number; + idle_backlight_dim_ac_seconds(): number; + idle_backlight_dim_battery_seconds(): number; + idle_suspend_ac_seconds(): number; + idle_suspend_battery_seconds(): number; + idle_suspend_supressed(): boolean; + is_adaptive_brightness_available(): boolean; + is_display_brightness_available(): boolean; + is_display_colormanagement_available(): boolean; + is_display_colortemp_available(): boolean; + is_fan_control_available(): boolean; + is_wifi_powersave_enabled(): boolean; } @@ -6464,7 +6596,9 @@ export interface MsgSystemManagerSettings extends JsPbMessage { */ export interface MsgSystemAudioManagerState extends JsPbMessage { counter(): number | undefined; + hw(): MsgSystemAudioManagerStateHW | undefined; + rtime_filter(): number | undefined; } @@ -6473,9 +6607,13 @@ export interface MsgSystemAudioManagerState extends JsPbMessage { */ export interface MsgSystemUpdateState extends JsPbMessage { state(): UpdaterState | undefined; + progress(): UpdateProgress | undefined; + supports_os_updates(): boolean | undefined; + update_apply_results(): UpdateApplyResult[]; + update_check_results(): UpdateCheckResult[]; } @@ -6491,7 +6629,9 @@ export interface MsgSystemDockState extends JsPbMessage { */ export interface MsgSystemPerfDiagnosticInfo extends JsPbMessage { battery_temp_c(): number | undefined; + entries(): SystemPerfDiagnosticEntry[] | undefined; + interfaces(): SystemPerfNetworkInterface[] | undefined; } @@ -6500,8 +6640,11 @@ export interface MsgSystemPerfDiagnosticInfo extends JsPbMessage { */ export interface MsgSystemPerfState extends JsPbMessage { active_profile_game_id(): string | undefined; + current_game_id(): string | undefined; + limits(): SystemPerfLimits | undefined; + settings(): SystemPerfSettings | undefined; } @@ -6513,6 +6656,7 @@ export interface MsgGenerateSystemReportReply extends JsPbMessage { * The report file name. */ report_id(): string | undefined; + set_report_id(param0: any): any; } @@ -6521,7 +6665,9 @@ export interface MsgGenerateSystemReportReply extends JsPbMessage { */ export interface MsgNetworkDevicesData extends JsPbMessage { devices(): NetworkDevice[]; + is_wifi_enabled(): boolean; + is_wifi_scanning_enabled(): boolean; } @@ -6530,141 +6676,277 @@ export interface MsgNetworkDevicesData extends JsPbMessage { */ export interface MsgClientSettings extends JsPbMessage { always_show_user_chooser(): boolean; + always_use_gamepadui_overlay(): boolean; + auto_scale_factor(): number; + bigpicture_windowed(): boolean; + broadcast_bitrate(): number; + broadcast_chat_corner(): number; + broadcast_encoding_option(): BroadcastEncoderSetting; + broadcast_output_height(): number; + broadcast_output_width(): number; + broadcast_permissions(): BroadcastPermission; + broadcast_record_all_audio(): boolean; + broadcast_record_all_video(): boolean; + broadcast_record_microphone(): boolean; + broadcast_show_live_reminder(): boolean; + broadcast_show_upload_stats(): boolean; + cef_remote_debugging_enabled(): boolean; + cloud_enabled(): boolean; + controller_combine_nintendo_joycons(): boolean; + controller_generic_support(): boolean; + controller_guide_button_focus_steam(): boolean; + controller_power_off_timeout(): number; + controller_ps_support(): number; + controller_switch_support(): boolean; + controller_xbox_driver(): boolean; + controller_xbox_support(): boolean; + default_ping_rate(): number; + disable_all_toasts(): boolean; + disable_toasts_in_game(): boolean; + display_name(): string; + download_peer_content(): number; + download_rate_bits_per_s(): boolean; + download_region(): number; + download_throttle_rate(): number; + download_throttle_while_streaming(): boolean; + download_while_app_running(): boolean; + enable_avif_screenshots(): boolean; + enable_dpi_scaling(): boolean; + enable_gpu_accelerated_webviews(): boolean; + enable_hardware_video_decoding(): boolean; + enable_marketing_messages(): boolean; + enable_overlay(): boolean; + enable_screenshot_notification(): boolean; + enable_screenshot_sound(): boolean; + enable_shader_background_processing(): boolean; + enable_shader_precache(): boolean; + enable_ui_sounds(): boolean; + force_deck_perf_tab(): boolean; + force_fake_mandatory_update(): boolean; + force_oobe(): boolean; + g_background_mk(): Hotkey; + g_background_tg(): Hotkey; + game_notes_enable_spellcheck(): boolean; + gamescope_app_target_framerate(): number; + gamescope_disable_framelimit(): boolean; + gamescope_disable_mura_correction(): boolean; + gamescope_display_refresh_rate(): number; + gamescope_enable_app_target_framerate(): boolean; + gamescope_hdr_visualization(): HDRVisualization; + gamescope_include_steamui_in_screenshots(): boolean; + gamescope_use_game_refresh_rate_in_steam(): boolean; + gamestream_hardware_video_encode(): boolean; + hdr_compat_testing(): boolean; + in_client_beta(): boolean; + is_external_display(): boolean; + is_steam_sideloaded(): boolean; + jumplist_flags(): number; + library_disable_community_content(): boolean; + library_display_icon_in_game_list(): boolean; + library_display_size(): number; + library_low_bandwidth_mode(): boolean; + library_low_perf_mode(): boolean; + library_whats_new_show_only_product_updates(): boolean; + max_scale_factor(): number; + min_scale_factor(): number; + music_download_high_quality(): boolean; + music_pause_on_app_start(): boolean; + music_pause_on_voice_chat(): boolean; + music_playlist_notification(): boolean; + music_volume(): number; + needs_steam_service_repair(): boolean; + no_save_personal_info(): boolean; + oobe_test_mode_enabled(): boolean; + overlay_fps_counter_corner(): number; + overlay_fps_counter_high_contrast(): boolean; + overlay_key(): Hotkey; + overlay_restore_browser_tabs(): boolean; + overlay_scale_interface(): boolean; + overlay_tabs(): string; + overlay_toolbar_list_view(): boolean; + override_browser_composer_mode(): number; + play_sound_on_toast(): boolean; + preferred_monitor(): string; + ready_to_play_includes_streaming(): boolean; + restrict_auto_updates(): boolean; + restrict_auto_updates_end(): number; + restrict_auto_updates_start(): number; + run_at_startup(): boolean; + save_uncompressed_screenshots(): boolean; + screenshot_items_per_row(): number; + screenshot_key(): Hotkey; + screenshots_path(): string; + server_ping_rate(): number; + setting_validation_bool(): boolean; + setting_validation_enum(): HDRVisualization; + setting_validation_int32(): number; + setting_validation_uint32(): number; + setting_validation_uint64(): number; + setting_validation_float(): number; + setting_validation_string(): string; + shader_precached_size(): string; + show_family_sharing_notifications(): boolean; + show_screenshot_manager(): boolean; + show_steam_deck_info(): boolean; + show_store_content_on_home(): boolean; + show_timestamps_in_console(): boolean; + skip_steamvr_install_dialog(): boolean; + small_mode(): boolean; + smooth_scroll_webviews(): boolean; + start_in_big_picture_mode(): boolean; + start_page(): string; + startup_movie_id(): string; + startup_movie_local_path(): string; + startup_movie_shuffle(): boolean; + startup_movie_used_for_resume(): boolean; + steam_cef_gpu_blocklist_disabled(): boolean; + steam_input_configurator_error_msg_enable(): boolean; + steam_networking_share_ip(): number; + steam_os_underscan_enabled(): boolean; + steam_os_underscan_level(): number; + steamos_status_led_brightness(): number; + turn_off_controller_on_exit(): boolean; + voice_mic_device_name(): string; + voice_mic_input_gain(): number; + voice_push_to_talk_key(): Hotkey; + voice_push_to_talk_setting(): number; + voice_speaker_output_gain(): number; + web_browser_home(): string; } @@ -6673,31 +6955,57 @@ export interface MsgClientSettings extends JsPbMessage { */ export interface GameNetworkingUI_ConnectionState extends JsPbMessage { connection_key(): string; + appid(): number; + connection_id_local(): number; + identity_local(): string; + identity_remote(): string; + connection_state(): number; + start_time(): number; + close_time(): number; + close_reason(): number; + close_message(): string; + status_loc_token(): string; + transport_kind(): number; + sdrpopid_local(): string; + sdrpopid_remote(): string; + address_remote(): string; + p2p_routing(): SteamDatagramP2PRoutingSummary; + ping_interior(): number; + ping_remote_front(): number; + ping_default_internet_route(): number; + e2e_quality_local(): SteamDatagramConnectionQuality; + e2e_quality_remote(): SteamDatagramConnectionQuality; + e2e_quality_remote_instantaneous_time(): string; + e2e_quality_remote_lifetime_time(): string; + front_quality_local(): SteamDatagramConnectionQuality; + front_quality_remote(): SteamDatagramConnectionQuality; + front_quality_remote_instantaneous_time(): string; + front_quality_remote_lifetime_time(): string; } @@ -6706,10 +7014,15 @@ export interface GameNetworkingUI_ConnectionState extends JsPbMessage { */ export interface MsgHotkey extends JsPbMessage { key_code(): number; + alt_key(): boolean; + shift_key(): boolean; + ctrl_key(): boolean; + meta_key(): boolean; + display_name(): string; } @@ -6718,14 +7031,22 @@ export interface MsgHotkey extends JsPbMessage { */ export interface ClientNotificationGroupChatMessage extends JsPbMessage { tag(): string; + /** A Steam64 ID. */ steamid_sender(): string; + chat_group_id(): string; + chat_id(): string; + title(): string; + body(): string; + rawbody(): string; + icon(): string; + notificationid(): number; } @@ -6734,12 +7055,18 @@ export interface ClientNotificationGroupChatMessage extends JsPbMessage { */ export interface ClientNotificationFriendMessage extends JsPbMessage { body(): string; + icon(): string; + notificationid(): number; + response_steamurl(): string; + /** A Steam64 ID. */ steamid(): string; + tag(): string; + title(): string; } From 8bd92b5b5e337b7d1cb6b87b607bfbaeb1d4ad29 Mon Sep 17 00:00:00 2001 From: Party Wumpus <48649272+PartyWumpus@users.noreply.github.com> Date: Sun, 24 Mar 2024 15:55:57 +0000 Subject: [PATCH 34/46] Fix QAM button bit number --- src/globals/SteamClient.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 20ab380e..f9d49f3b 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -4615,8 +4615,8 @@ export interface ControllerStateChange { * - Bit 11-13: Unknown (@todo Please provide more details if known) * - Bit 14: Left Joystick Touch * - Bit 15: Right Joystick Touch - * - Bit 16-18: Unknown (@todo Please provide more details if known) - * - Bit 19: Quick Access Menu + * - Bit 16-17: Unknown (@todo Please provide more details if known) + * - Bit 18: Quick Access Menu */ ulUpperButtons: number; /** From cc40e8187749f370318c6d9b9406a4ea9dc16ed3 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:45:01 +0800 Subject: [PATCH 35/46] new: Document some SteamClient interfaces - part 16 --- src/globals/SteamClient.ts | 358 +++++++++++++++++++++++++++---------- 1 file changed, 265 insertions(+), 93 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index f9d49f3b..28fd8647 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -25,6 +25,12 @@ export interface Apps { */ AddUserTagToApps(appIds: number[], userTag: string): void; + /** + * Retrieves whether private apps are enabled. + * @returns {Promise<boolean>} - A Promise that resolves to true if private applications are enabled, otherwise false. + */ + ArePrivateAppsEnabled(): Promise<boolean>; + /** * Backups an app to the specified path. * @param {number} appId - The ID of the application to back up. @@ -54,7 +60,12 @@ export interface Apps { */ CancelBackup(): void; - CancelGameAction: any; + /** + * Cancels a specific game action. + * @param {number} gameActionId - The ID of the game action to cancel. + * @returns {void} + */ + CancelGameAction(gameActionId: number): void; /** * Cancels the launch of an application with the specified ID. @@ -86,7 +97,7 @@ export interface Apps { */ ClearCustomLogoPositionForApp(appId: number): Promise<void>; - ClearProton: any; + ClearProton(appId: number): Promise<any>; /** * Clears user tags on a list of specified applications. @@ -96,7 +107,14 @@ export interface Apps { */ ClearUserTagsOnApps(appIds: number[]): void; - ContinueGameAction: any; + /** + * Continues a specific game action. + * @param {number} gameActionId - The ID of the game action to continue. + * @param {string} actionType - The type of action to perform during continuation. + * @returns {void} + * @remarks actionType - "SkipShaders", "skip", "ShowDurationControl" todo: + */ + ContinueGameAction(gameActionId: number, actionType: string): void; /** * Creates a Steam application shortcut on the desktop. @@ -145,6 +163,7 @@ export interface Apps { GetBackupsInFolder(appBackupPath: string): Promise<string | undefined>; /** + * Retrieves cached details for a specific application. * @param appId - The ID of the application. * @returns {Promise<string>} - A Promise that resolves to a stringified object. */ @@ -177,7 +196,7 @@ export interface Apps { */ GetDownloadedWorkshopItems(appId: number): Promise<WorkshopItem[]>; - GetDurationControlInfo(appId: number): Promise<any>; // {"bApplicable": true} - overlay usage? + GetDurationControlInfo(appId: number): Promise<any>; // any - {"bApplicable": true} - overlay usage? /** * Retrieves achievement information for a specific application for a given friend. @@ -194,6 +213,14 @@ export interface Apps { */ GetFriendsWhoPlay(appId: number): Promise<string[]>; + /** + * Retrieves details of a game action. + * @param {number} appId - The ID of the application. + * @param {Function} callback - The callback function to handle the retrieved game action details and state. + * @param {GameAction} callback.gameAction - The game action received in the callback. + * @param {StateManager} callback.state - The state manager received in the callback. + * @returns {void} + */ GetGameActionDetails(appId: number, callback: (gameAction: GameAction) => void): void; GetGameActionForApp( @@ -304,9 +331,9 @@ export interface Apps { GetSubscribedWorkshopItems(appId: number): Promise<WorkshopItem[]>; InstallFlatpakAppAndCreateShortcut(appName: string, appCommandLineOptions: string): Promise<any>; // returns {"appid":0,"strInstallOutput":""} - JoinAppContentBeta(appId: number, param1: any): any; + JoinAppContentBeta(appId: number, name: string): any; - JoinAppContentBetaByPassword(appId: number, param1: any): any; + JoinAppContentBetaByPassword(appId: number, accessCode: any): Promise<any>; // any.strName ListFlatpakApps(): Promise<any>; @@ -314,7 +341,8 @@ export interface Apps { * @throws if the user does not own the app or no EULA. */ LoadEula(appId: number): Promise<EndUserLicenseAgreement[]>; // Doesn't bring up the EULA dialog, just returns the eula data - MarkEulaAccepted: any; + MarkEulaAccepted(param0: any, param1: any, param2: any): any; + MarkEulaRejected: any; /** @@ -335,8 +363,6 @@ export interface Apps { */ OpenAppSettingsDialog(appId: number, section: string): void; - PromptToChangeShortcut(): Promise<any>; // todo: unknown, prompts file picker - /** * Raises the window for a given application. * @param {string} appId - The ID of the application to raise the window of. @@ -532,6 +558,14 @@ export interface Apps { */ SetAppCurrentLanguage(appId: number, language: string): void; + /** + * Sets the blocked state for apps. + * @param {number[]} appIds - An array of app IDs to set the blocked state for. + * @param {boolean} state - The state to set (true for blocked, false for unblocked). + * @returns {void} + */ + SetAppFamilyBlockedState(appIds: number[], state: boolean): void; + /** * Sets the hidden status of a specific Steam application. * @param {number} appId - The ID of the application to set the hidden status for. @@ -557,7 +591,14 @@ export interface Apps { */ SetAppResolutionOverride(appId: number, resolution: string): any; - SetCachedAppDetails(appId: number, details: string): any; + /** + * Sets cached details for a specific application. + * @param {number} appId - The ID of the application. + * @param {string} details - The details to be cached, a stringified object. + * @returns {Promise<any>} - A Promise that resolves when the details are successfully cached. + * todo: might return boolean? + */ + SetCachedAppDetails(appId: number, details: string): Promise<any>; SetControllerRumblePreference(appId: number, param1: number): any; // param1 - enum for preference @@ -569,15 +610,23 @@ export interface Apps { * @param {AppArtworkAssetType} assetType - The type of artwork to set. * @returns {Promise<any>} A Promise that resolves after the custom artwork is set. */ - SetCustomArtworkForApp( - appId: number, - base64Image: string, - imageType: string, - assetType: AppArtworkAssetType, - ): Promise<any>; + SetCustomArtworkForApp(appId: number, base64Image: string, imageType: string, assetType: AppArtworkAssetType): Promise<any>; - SetCustomLogoPositionForApp(appId: number, details: string): Promise<void>; // I've tried sending escaped LogoPosition JSON, but it doesn't seem to work + /** + * Sets a custom logo position for a specific app. + * @param {number} appId - The ID of the application. + * @param {string} details - The details of the custom logo position, expected to be a stringified {@link LogoPositionForApp} object. + * @returns {Promise<void>} - A Promise that resolves when the custom logo position is successfully set. + */ + SetCustomLogoPositionForApp(appId: number, details: string): Promise<void>; + /** + * Sets the enabled state for downloadable content (DLC) of a specific app. + * @param {number} appId - The ID of the parent application. + * @param {number} appDLCId - The ID of the DLC to set the state for. + * @param {boolean} value - The value to set (true for enabled, false for disabled). + * @returns {void} + */ SetDLCEnabled(appId: number, appDLCId: number, value: boolean): void; /** @@ -652,7 +701,7 @@ export interface Apps { */ SetStreamingClientForApp(appId: number, clientId: string): void; - SetThirdPartyControllerConfiguration: any; + SetThirdPartyControllerConfiguration(appId: number, param1: number): any; /** * Sets the workshop items disabled state. @@ -716,8 +765,6 @@ export interface Apps { // "#AppProperties_SteamInputDesktopConfigInLauncher" ToggleAllowDesktopConfiguration(appId: number): any; - ToggleAppFamilyBlockedState(appId: number): any; - /** * Toggles the Steam Cloud synchronization for game saves for a specific application. * @param {number} appId - The ID of the application. @@ -758,7 +805,7 @@ export interface Auth { GetRefreshInfo(): Promise<AuthRefreshInfo>; - GetSteamGuardData: any; + GetSteamGuardData(param0: any): any; IsSecureComputer(): Promise<boolean>; @@ -769,7 +816,6 @@ export interface Auth { StartSignInFromCache(param0: any, login: string): Promise<any>; } -// Broadcasting support hasn't been implemented on Linux yet export interface Broadcast { /** * Approves a viewer request for the broadcast. @@ -911,12 +957,40 @@ export interface ClientNotifications { } export interface Cloud { - ResolveAppSyncConflict(appId: number, keepLocal: boolean): any; + /** + * Resolves a synchronization conflict for an app in the cloud. + * @param {number} appId - The ID of the app with the sync conflict. + * @param {boolean} keepLocal - Whether to keep the local version during conflict resolution. + * @returns {any} - Returns data related to resolving the sync conflict. + */ + ResolveAppSyncConflict(appId: number, keepLocal: boolean): void; - RetryAppSync(appId: number): any; + /** + * Retries syncing an app with the cloud. + * @param {number} appId - The ID of the app to retry syncing. + * @returns {any} - Returns data related to retrying the app sync. + */ + RetryAppSync(appId: number): void; } export interface CommunityItems { + /* + DownloadMovie(e) { + return (0, o.mG)(this, void 0, void 0, (function* () { + if (0 != e.movie_webm_local_path.length) return !0; + let t = yield SteamClient.CommunityItems.DownloadItemAsset(e.communityitemid, w, e.movie_webm), + n = 1 == t.result; + if (n) { + e.movie_webm_local_path = t.path; + let n = []; + this.m_startupMovies.forEach((t => { + t.movie_webm == e.movie_webm ? n.push(e) : n.push(t) + })), this.m_startupMovies = n + } + return n + })) + } + */ DownloadItemAsset(communityItemId: string, param1: any, param2: string): any; GetItemAssetPath(communityItemId: string, param1: any, param2: string): any; @@ -951,11 +1025,12 @@ export interface Console { } export interface Customization { - GenerateLocalStartupMoviesThumbnails(param0: number): Promise<any>; + GenerateLocalStartupMoviesThumbnails(param0: number): Promise<number>; - GetDownloadedStartupMovies(param0: string): Promise<any>; + //param0: "startupmovies" + GetDownloadedStartupMovies(param0: string): Promise<StartupMovie[]>; - GetLocalStartupMovies(): Promise<any>; + GetLocalStartupMovies(): Promise<StartupMovie[]>; } /** @@ -1060,6 +1135,9 @@ export interface FamilySharing { /** * Authorizes library sharing on the local device. * @returns {Promise<number>} A Promise that resolves to a status code. + * FamilySettings_SteamGuardRequired - 18 + * FamilySettings_LimitExceeded - 25 + * FamilySettings_FailedToAuthorize - any other number */ AuthorizeLocalDevice(): Promise<number>; @@ -1080,6 +1158,7 @@ export interface FamilySharing { SetPreferredLender(appId: number, param1: number): Promise<number>; // param0 - account id? + // return FamilySettings_TooManyBorrowers - 25, FamilySettings_FailedToUpdateBorrower - any number that's not 1 or previous UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise<number>; } @@ -1097,7 +1176,7 @@ export interface FriendSettings { * Registers a callback function to be notified of friend settings changes. * @param callback - The callback function to be called when friend settings change. * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @todo The callback receives an escaped JSON object string as "settingsChanges", which should be parsed into FriendSettingsChange object. + * @remarks The callback receives an escaped JSON object string as "settingsChanges", which should be parsed into {@link FriendSettingsChange} object. */ RegisterForSettingsChanges(callback: (settingsChanges: string) => void): Unregisterable | any; @@ -1115,12 +1194,10 @@ export interface Friends { */ AddFriend(steamId: string): Promise<boolean>; - GetCoplayData(): Promise<{ - currentUsers: CoplayUser[]; - recentUsers: CoplayUser[]; - }>; + GetCoplayData(): Promise<CoplayData>; - InviteUserToCurrentGame: any; + //(e.ConvertTo64BitString(), t.steamidTarget) + InviteUserToCurrentGame(param0: any, param1: any): any; /** * Invites a user to a specific game. @@ -1131,9 +1208,13 @@ export interface Friends { */ InviteUserToGame(steamId: string, appId: number, connectString: string): Promise<boolean>; - InviteUserToLobby: any; - InviteUserToRemotePlayTogetherCurrentGame: any; - RegisterForVoiceChatStatus: any; + //(e.ConvertTo64BitString(), t.steamidTarget) + InviteUserToLobby(param0: any, param1: any): any; + + //(e.ConvertTo64BitString()) + InviteUserToRemotePlayTogetherCurrentGame(param0: any): any; + + RegisterForVoiceChatStatus(callback: (status: any) => void): any; /** * Removes a user from the friend list. @@ -1249,17 +1330,20 @@ export interface Input { DecrementCloudedControllerConfigsCounter(): any; - DeletePersonalControllerConfiguration: any; - DuplicateControllerConfigurationSourceMode: any; + DeletePersonalControllerConfiguration(param0: any): any; + + //f.Debug("sending to client"), this.SetEditingConfigurationValue(e, t, c.QU, (e => SteamClient.Input.DuplicateControllerConfigurationSourceMode(this.m_unControllerIndex, e))), this.SaveEditingConfiguration(e), this + DuplicateControllerConfigurationSourceMode(controllerIndex: number, param1: any): any; EndControllerDeviceSupportFlow(): any; - ExportCurrentControllerConfiguration: any; - ForceConfiguratorFocus: any; + ExportCurrentControllerConfiguration(controllerIndex: number, appId: number, param2: number, title: string, description: string, param5: string): Promise<any>; + + ForceConfiguratorFocus(param0: boolean): any; ForceSimpleHapticEvent(param0: number, param1: number, param2: number, param3: number, param4: number): any; - FreeControllerConfig: any; + FreeControllerConfig(m_ChordSummaryConfiguration: any): any; GetConfigForAppAndController(appId: number, unControllerIndex: number): any; @@ -1287,13 +1371,15 @@ export interface Input { OpenDesktopConfigurator: any; - PreviewConfiguForAppAndController(appId: number): any; + PreviewConfigForAppAndController(appId: number, controllerIndex: number, workshopUri: string): any; PreviewControllerLEDColor(flHue: number, flSaturation: number, flBrightness: number): any; - QueryControllerConfigsForApp(appId: number): any; + QueryControllerConfigsForApp(appId: number, controllerIndex: number, param2: boolean): any; RegisterForActiveControllerChanges: Unregisterable | any; // {"nActiveController":0} + //param0 - e possibly appid? + //param1 - some index? RegisterForConfigSelectionChanges(callback: (param0: number, param1: number) => void): Unregisterable | any; RegisterForControllerAccountChanges: Unregisterable | any; @@ -1356,35 +1442,59 @@ export interface Input { */ RegisterForGameKeyboardMessages(callback: (gameKeyboardMessage: GameKeyboardMessage) => void): Unregisterable | any; - RegisterForRemotePlayConfigChanges: Unregisterable | any; - RegisterForShowControllerLayoutPreviewMessages: Unregisterable | any; - RegisterForTouchMenuInputMessages: Unregisterable | any; + RegisterForRemotePlayConfigChanges(callback: () => void): Unregisterable | any; + + //data.appId, data.ulConfigId + RegisterForShowControllerLayoutPreviewMessages(callback: (data: any) => void): Unregisterable | any; + + /* + onTouchMenuInput(e) { + for (let t = 0; t < e.length; t++) { + const n = this.TouchMenuGetKey(e[t]), o = this.m_mapActiveTouchMenus.get(n); + void 0 !== o && o.updateTouchMenuState(e[t]) + } + } + */ + RegisterForTouchMenuInputMessages(callback: (inputs: number[]) => void): Unregisterable | any; RegisterForTouchMenuMessages(callback: (touchMenuMessage: TouchMenuMessage) => void): Unregisterable | any; - RegisterForUIVisualization: Unregisterable | any; + //param0 - index? + RegisterForUIVisualization(param0: any, param1: any, param2: any): Unregisterable | any; RegisterForUnboundControllerListChanges(callback: (m_unboundControllerList: any) => void): Unregisterable | any; // param0 is an array - RegisterForUserDismissKeyboardMessages: Unregisterable | any; + + /* + OnDismissKeyboardMessage(e) { + this.m_WindowStore.SteamUIWindows.forEach((e => e.VirtualKeyboardManager.SetVirtualKeyboardHidden(e.BrowserWindow))) + } + */ + RegisterForUserDismissKeyboardMessages(callback: (param0: any) => void): Unregisterable | any; + RegisterForUserKeyboardMessages: Unregisterable | any; - RequestGyroActive: any; - RequestRemotePlayControllerConfigs: any; + + RequestGyroActive(controllerIndex: number, param1: boolean): any; + + RequestRemotePlayControllerConfigs(param0: any): any; ResetControllerBindings(param0: any): any; - ResolveCloudedControllerConfigConflict: any; + ResolveCloudedControllerConfigConflict(param0: any): any; RestoreControllerPersonalizationSettings(controllerIndex: number): any; SaveControllerCalibration(controllerIndex: number): any; - SaveControllerPersonalizationSettings: any; + SaveControllerPersonalizationSettings(param0: any): any; + SaveControllerSounds: any; SaveEditingControllerConfiguration(controllerIndex: number, sharedConfig: boolean): any; SetActiveControllerAccount: any; - SetControllerConfigurationModeShiftBinding: any; + + //this.SetEditingConfigurationValue(e, t, c.sL, (e => SteamClient.Input.SetControllerConfigurationModeShiftBinding(this.m_unControllerIndex, e))) + SetControllerConfigurationModeShiftBinding(controllerIndex: number, param1: any): any; SetControllerHapticSetting(controllerIndex: number, eHapticSetting: any): any; @@ -1433,17 +1543,48 @@ export interface Input { SetControllerRumbleSetting(controllerIndex: number, rumblePreference: any): any; - SetCursorActionset: any; - SetEditingControllerConfigurationActionSet: any; - SetEditingControllerConfigurationInputActivator: any; - SetEditingControllerConfigurationInputActivatorEnabled: any; - SetEditingControllerConfigurationInputBinding: any; - SetEditingControllerConfigurationMiscSetting: any; - SetEditingControllerConfigurationSourceMode: any; + SetCursorActionset(param0: boolean): any; + + SetDualSenseUpdateNotification(param0: boolean): any + + /* + SetEditingConfigurationValue(e, t, n, o) { + const a = new r.BinaryWriter; + n.serializeBinaryToWriter(n.fromObject(t), a); + const s = a.getResultBase64String(); + f.Debug("SetEditingConfigurationValue serializeBinaryToWriter", (0, i.ZN)(t), s), this.EditingConfigurationWillUpdate(), this.m_updatingEditingConfigurationPromise = o(s).then((t => { + if (null == t) return f.Debug("SetEditingConfigurationValue returned nothing."), void (0, i.z)((() => this.UpdateEditingConfiguration(e, this.m_unControllerIndex, this.EditingConfiguration))); + const n = c.bE.deserializeBinary(t).toObject(); + f.Debug("SetEditingConfigurationValue returned controller configuration.", n), this.UpdateEditingConfiguration(e, this.m_unControllerIndex, n), this.m_nEditNumber++, -1 == n.url.indexOf("autosave://") && this.SaveEditingConfiguration(e) + })).catch((e => { + f.Error("SetEditingConfigurationValue fail:", o, l.jt(e.result), e.message), this.m_bIsUpdatingActiveConfiguration = !1 + })) + } + + SetControllerActionSet(e, t) { + this.SetEditingConfigurationValue(e, t, c.X3, (e => SteamClient.Input.SetEditingControllerConfigurationActionSet(this.m_unControllerIndex, e))) + } + */ + SetEditingControllerConfigurationActionSet(controllerIndex: number, param1: any): any; + + //this.SetEditingConfigurationValue(e, t, c.io, (e => SteamClient.Input.SetEditingControllerConfigurationInputActivator(this.m_unControllerIndex, e))) + SetEditingControllerConfigurationInputActivator(controllerIndex: number, param1: any): any; + + //this.SetEditingConfigurationValue(e, t, c.tH, (e => SteamClient.Input.SetEditingControllerConfigurationInputActivatorEnabled(this.m_unControllerIndex, e))) + SetEditingControllerConfigurationInputActivatorEnabled(controllerIndex: number, param1: any): any; + + //this.SetEditingConfigurationValue(e, t, c.J2, (e => SteamClient.Input.SetEditingControllerConfigurationInputBinding(this.m_unControllerIndex, e))) + SetEditingControllerConfigurationInputBinding(controllerIndex: number, param1: any): any; + + //this.SetEditingConfigurationValue(e, t, c.Sz, (e => SteamClient.Input.SetEditingControllerConfigurationMiscSetting(this.m_unControllerIndex, e))) + SetEditingControllerConfigurationMiscSetting(controllerIndex: number, param1: any): any; + + //f.Debug("sending to client"), this.SetEditingConfigurationValue(e, t, c.QU, (e => SteamClient.Input.SetEditingControllerConfigurationSourceMode(this.m_unControllerIndex, e))) + SetEditingControllerConfigurationSourceMode(controllerIndex: number, param1: any): any; SetGamepadKeyboardText(param0: boolean, param1: string): any; - SetKeyboardActionset(param0: boolean): any; + SetKeyboardActionset(param0: boolean, param1: boolean): any; /** * Sets the mouse position. @@ -1454,12 +1595,12 @@ export interface Input { */ SetMousePosition(pid: number, x: number, y: number): void; - SetSelectedConfigForApp(): any; + SetSelectedConfigForApp(appId: number, controllerIndex: number, url: string, param3: boolean): any; SetSteamControllerDonglePairingMode(bEnable: boolean, bSilent: boolean): any; - SetVirtualMenuKeySelected(unControllerIndex: number, unMenuIndex: number, param2: number): any; // - SetWebBrowserActionset: any; + SetVirtualMenuKeySelected(unControllerIndex: number, unMenuIndex: number, m_controllerMenuActiveMenuItem: number): any; // + SetWebBrowserActionset(param0: boolean): any; SetXboxDriverInstallState(param0: any): any; // state @@ -1492,20 +1633,26 @@ export interface Input { StartGyroSWCalibration(callback: () => void): any; - StopEditingControllerConfiguration: any; - SwapControllerModeInputBindings: any; - SwapControllerOrder: any; + StopEditingControllerConfiguration(controllerIndex: number): any; + + //this.SetEditingConfigurationValue(e, t, c.Qb, (e => SteamClient.Input.SwapControllerModeInputBindings(this.m_unControllerIndex, e))) + SwapControllerModeInputBindings(controllerIndex: number, param1: any): any; + + SwapControllerOrder(controllerIndex1: number, controllerIndex2: number): any; SyncCloudedControllerConfigs(): any; // type - enum - TriggerHapticPulse(controllerIndex: number, type: number, param2: number): any; + /* + Off - 0, Tick, Click + */ + TriggerHapticPulse(controllerIndex: number, eHapticType: number, param2: number): any; TriggerSimpleHapticEvent( controllerIndex: number, - type: number, - intensity: number, - dbGain: number, + eHapticType: number, + unIntensity: number, + ndBGain: number, param4: number, ): any; @@ -1720,6 +1867,7 @@ export interface Messaging { steamid: e.persona.m_steamid.ConvertTo64BitString() })) } + SteamClient.Messaging.PostMessage("FriendsUI", "AcceptedRemotePlayInvite", JSON.stringify({id: this.appID})) : SteamClient.Messaging.PostMessage("FriendsUI", "AcceptedGameInvite", JSON.stringify({id: this.appID})) */ PostMessage(section: string, param1: string, message: string): void; } @@ -2040,7 +2188,8 @@ export interface RemotePlay { GetPerUserInputSettingsWithGuestID(steam64Id: string, guestId: number): any; - IdentifyController: any; + IdentifyController(nControllerIndex: number): any; + InstallAudioDriver: any; InstallInputDriver: any; MoveControllerToSlot: any; @@ -2614,7 +2763,7 @@ export interface Storage { } export interface Streaming { - AcceptStreamingEULA: any; + AcceptStreamingEULA(param0: any, param1: any, param2: any): any; CancelStreamGame(): void; // existing stream @@ -2623,7 +2772,7 @@ export interface Streaming { * @param {function} callback - The callback function to be called. * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ - RegisterForStreamingClientFinished(callback: (param0: number, description: string) => void): Unregisterable | any; + RegisterForStreamingClientFinished(callback: (code: number, result: string) => void): Unregisterable | any; /** * Registers a callback function to be called when there is progress in the launch of the streaming client. @@ -2649,8 +2798,9 @@ export interface Streaming { */ RegisterForStreamingLaunchComplete(callback: (code: number, result: string) => void): Unregisterable | any; - RegisterForStreamingShowEula: Unregisterable | any; - RegisterForStreamingShowIntro: Unregisterable | any; + RegisterForStreamingShowEula(callback: (appId: number) => any): Unregisterable | any; + + RegisterForStreamingShowIntro(callback: (param0: any, param1: any) => any): Unregisterable | any; /** * Registers a callback function to be called when the streaming client receives launch options from the host. @@ -2662,7 +2812,7 @@ export interface Streaming { ): Unregisterable | any; // Callback when streaming client receives launch options from host StreamingContinueStreamGame(): void; // existing game running on another streaming capable device - StreamingSetLaunchOption: any; + StreamingSetLaunchOption(param0: any): any; } /** @@ -2774,7 +2924,7 @@ export interface AudioDevice { */ RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - UpdateSomething: any; + UpdateSomething(param0: any): any; // e.UpdateSomething(t.serializeBase64String()) } /** @@ -2845,10 +2995,13 @@ export interface Bluetooth { } export interface Devkit { - DeveloperModeChanged: any; - RegisterForPairingPrompt: Unregisterable | any; - RespondToPairingPrompt: any; - SetPairing: any; + DeveloperModeChanged(state: boolean): any; + + RegisterForPairingPrompt(callback: (param0: any) => any): Unregisterable | any; + + RespondToPairingPrompt(param0: any, param1: any): any; + + SetPairing(param0: any): any; } export interface Display { @@ -2890,13 +3043,15 @@ export interface Dock { } export interface WirelessNetwork { - Forget: any; - SetAutoconnect: any; + Forget(deviceId: any, deviceWapId: any): any; + + SetAutoconnect(deviceId: any, deviceWapId: any, autoConnect: boolean): any; } export interface NetworkDevice { Connect(param0: any): any; // some base64 serialized string - Disconnect: any; + Disconnect(deviceId: any): Promise<any>; + WirelessNetwork: WirelessNetwork; } @@ -2909,7 +3064,8 @@ export interface Network { GetProxyInfo(): Promise<ProxyInfo>; - RegisterForAppSummaryUpdate: Unregisterable | any; + // data.nAppID, data.serializedMsg + RegisterForAppSummaryUpdate(callback: (data: any) => any): Unregisterable | any; /** * @todo {@link GameNetworkingUI_ConnectionState}, unconfirmed @@ -3056,8 +3212,10 @@ export interface System { OpenLocalDirectoryInSystemExplorer(directory: string): void; // Opens local directory in system explorer Perf: Perf; - RebootToAlternateSystemPartition: any; - RebootToFactoryTestImage: any; + + RebootToAlternateSystemPartition(): any; + + RebootToFactoryTestImage(param0: any): any; RegisterForAirplaneModeChanges(callback: (airplaneModeChange: AirplaneModeChange) => void): Unregisterable | any; @@ -3124,11 +3282,11 @@ export interface UI { NotifyAppInitialized(): void; - RegisterDesiredSteamUIWindowsChanged: Unregisterable | any; + RegisterDesiredSteamUIWindowsChanged(callback: () => void): Unregisterable | any; RegisterForErrorCondition(callback: (param0: number, param1: number) => void): Unregisterable | any; - RegisterForKioskModeResetSignal: Unregisterable | any; + RegisterForKioskModeResetSignal(callback: () => void): Unregisterable | any; RegisterForUIModeChanged(callback: (mode: UIMode) => void): Unregisterable | any; @@ -3360,7 +3518,7 @@ export interface WebChat { */ GetUIMode(): Promise<UIMode>; - OnGroupChatUserStateChange(chatGroupId: any, accountId: any, param2: any): any; + OnGroupChatUserStateChange(chatGroupId: any, accountId: any, action: any): any; OnNewGroupChatMsgAdded( groupId: number, @@ -3412,9 +3570,9 @@ export interface WebChat { RegisterOverlayChatBrowserInfoChanged(callback: any): Unregisterable | any; - SetActiveClanChatIDs(param0: any[]): any; + SetActiveClanChatIDs(clanChatIds: any[]): any; - SetNumChatsWithUnreadPriorityMessages(param0: number): void; + SetNumChatsWithUnreadPriorityMessages(size: number): void; SetPersonaName: any; @@ -3807,6 +3965,11 @@ export type BrowserViewEvent = | 'start-request' | 'toggle-find-in-page'; +export interface LogoPositionForApp { + nVersion: number; // Usually 1 + logoPosition: LogoPosition; +} + export interface LogoPosition { pinnedPosition: LogoPinPositions; nWidthPct: number; @@ -8338,6 +8501,15 @@ export enum ParentalFeature { Max = 15, } +export interface StartupMovie { + strMovieURL: string; +} + +export interface CoplayData { + currentUsers: CoplayUser[]; + recentUsers: CoplayUser[]; +} + export interface Unregisterable { /** * Unregister the callback. From 4a754b44263312cb57eb04c75344cf2d37cf555e Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Wed, 8 May 2024 09:32:14 +0800 Subject: [PATCH 36/46] change: Update interfaces to Steam Version 1714854927 Steam Version: 1714854927 Steam Client Build Date: Sat, May 4 7:11 AM UTC -08:00 --- src/globals/SteamClient.ts | 713 +++++++++++++++++++------------------ 1 file changed, 359 insertions(+), 354 deletions(-) diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts index 28fd8647..04778f51 100644 --- a/src/globals/SteamClient.ts +++ b/src/globals/SteamClient.ts @@ -25,12 +25,6 @@ export interface Apps { */ AddUserTagToApps(appIds: number[], userTag: string): void; - /** - * Retrieves whether private apps are enabled. - * @returns {Promise<boolean>} - A Promise that resolves to true if private applications are enabled, otherwise false. - */ - ArePrivateAppsEnabled(): Promise<boolean>; - /** * Backups an app to the specified path. * @param {number} appId - The ID of the application to back up. @@ -171,6 +165,8 @@ export interface Apps { GetCloudPendingRemoteOperations(appId: number): Promise<any>; + GetCompatExperiment: any; + GetConflictingFileTimestamps(appId: number): Promise<ConflictingFileTimestamp>; /** @@ -474,6 +470,8 @@ export interface Apps { callback: (appId: number, publishedFileId: string, param2: number) => void, ): Unregisterable | any; + RegisterForWorkshopItemInstalled: any; + /** * Removes a non-Steam application shortcut from the Steam library. * @param {number} appId - The ID of the application for which to remove the shortcut. @@ -735,6 +733,8 @@ export interface Apps { */ ShowStore(appId: number): void; + SpecifyCompatExperiment: any; + /** * Specifies a compatibility tool by its name for a given application. If strToolName is an empty string, the specified application will no longer use a compatibility tool. * @param {number} appId - The ID of the application to specify compatibility tool for. @@ -1635,6 +1635,8 @@ export interface Input { StopEditingControllerConfiguration(controllerIndex: number): any; + SwapControllerConfigurationSourceModes: any; + //this.SetEditingConfigurationValue(e, t, c.Qb, (e => SteamClient.Input.SwapControllerModeInputBindings(this.m_unControllerIndex, e))) SwapControllerModeInputBindings(controllerIndex: number, param1: any): any; @@ -2878,11 +2880,9 @@ export interface Audio { * @param {function} callback - The callback function to be called. * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ - RegisterForDeviceVolumeChanged( - callback: (audioDeviceId: number, audioType: number, volume: number) => void, - ): Unregisterable | any; + RegisterForDeviceVolumeChanged(callback: (audioDeviceId: number, audioType: number, volume: number) => void): Unregisterable | any; - RegisterForServiceConnectionStateChanges: Unregisterable | any; + RegisterForServiceConnectionStateChanges(callback: (param0: any) => void): Unregisterable | any; /** * Registers a callback to be called when volume buttons are pressed. @@ -3140,6 +3140,7 @@ export interface SystemUI { // appId is 0 if unknown app is focused RegisterForOverlayGameWindowFocusChanged(callback: (appId: number, param1: number) => void): Unregisterable | any; + //event.eKey, event.nControllerIndex RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable | any; // eKey } @@ -3284,6 +3285,8 @@ export interface UI { RegisterDesiredSteamUIWindowsChanged(callback: () => void): Unregisterable | any; + RegisterForClientConVar: any; + RegisterForErrorCondition(callback: (param0: number, param1: number) => void): Unregisterable | any; RegisterForKioskModeResetSignal(callback: () => void): Unregisterable | any; @@ -3598,6 +3601,8 @@ export interface WebChat { export interface WebUITransport { GetTransportInfo(): Promise<TransportInfo>; + + NotifyTransportFailure: any; } /** @@ -7452,9 +7457,9 @@ export enum DisplayStatus { CloudError = 34, CloudOutOfDate = 35, Terminating = 36, - OwnerLocked, - DownloadFailed, - UpdateFailed, + OwnerLocked = 37, + DownloadFailed = 38, + UpdateFailed = 39, } export enum AppCloudStatus { @@ -7590,291 +7595,291 @@ export enum AppError { } export enum BrowserType { - OffScreen, - OpenVROverlay, - OpenVROverlay_Dashboard, - DirectHWND, - DirectHWND_Borderless, - DirectHWND_Hidden, - ChildHWNDNative, - Transparent_Toplevel, - OffScreen_SharedTexture, - OffScreen_GameOverlay, - OffScreen_GameOverlay_SharedTexture, - Offscreen_FriendsUI, - Offscreen_SteamUI, - OpenVROverlay_Subview, + OffScreen = 0, + OpenVROverlay = 1, + OpenVROverlay_Dashboard = 2, + DirectHWND = 3, + DirectHWND_Borderless = 4, + DirectHWND_Hidden = 5, + ChildHWNDNative = 6, + Transparent_Toplevel = 7, + OffScreen_SharedTexture = 8, + OffScreen_GameOverlay = 9, + OffScreen_GameOverlay_SharedTexture = 10, + Offscreen_FriendsUI = 11, + Offscreen_SteamUI = 12, + OpenVROverlay_Subview = 13, } export enum NotificationPosition { - TopLeft, - TopRight, - BottomLeft, - BottomRight, + TopLeft = 0, + TopRight = 1, + BottomLeft = 2, + BottomRight = 3, } export enum WorkshopFileType { - Community, - Microtransaction, - Collection, - Art, - Video, - Screenshot, - Game, - Software, - Concept, - WebGuide, - IntegratedGuide, - Merch, - ControllerBinding, - SteamworksAccessInvite, - SteamVideo, - GameManagedItem, + Community = 0, + Microtransaction = 1, + Collection = 2, + Art = 3, + Video = 4, + Screenshot = 5, + Game = 6, + Software = 7, + Concept = 8, + WebGuide = 9, + IntegratedGuide = 10, + Merch = 11, + ControllerBinding = 12, + SteamworksAccessInvite = 13, + SteamVideo = 14, + GameManagedItem = 15, } export enum EInstallManagerState { - None, - Setup, - WaitLicense, - FreeLicense, - ShowCDKey, - WaitAppInfo, - ShowPassword, - ShowConfig, - ShowEULAs, - CreateApps, - ReadFromMedia, - ShowChangeMedia, - WaitLegacyCDKeys, - ShowSignup, - Complete, - Failed, - Canceled, + None = 0, + Setup = 1, + WaitLicense = 2, + FreeLicense = 3, + ShowCDKey = 4, + WaitAppInfo = 5, + ShowPassword = 6, + ShowConfig = 7, + ShowEULAs = 8, + CreateApps = 9, + ReadFromMedia = 10, + ShowChangeMedia = 11, + WaitLegacyCDKeys = 12, + ShowSignup = 13, + Complete = 14, + Failed = 15, + Canceled = 16, } export enum EAppReleaseState { - Unknown, - Unavailable, - Prerelease, - PreloadOnly, - Released, - Disabled, + Unknown = 0, + Unavailable = 1, + Prerelease = 2, + PreloadOnly = 3, + Released = 4, + Disabled = 5, } export enum EControllerConfigExportType { - Unknown, - PersonalLocal, - PersonalCloud, - Community, - Template, - Official, - OfficialDefault, + Unknown = 0, + PersonalLocal = 1, + PersonalCloud = 2, + Community = 3, + Template = 4, + Official = 5, + OfficialDefault = 6, } export enum EMusicPlaybackStatus { - Undefined, - Playing, - Paused, - Idle, + Undefined = 0, + Playing = 1, + Paused = 2, + Idle = 3, } export enum EMusicRepeatStatus { - None, - All, - Once, - Max, + None = 0, + All = 1, + Once = 2, + Max = 3, } export enum EStreamP2PScope { - Automatic, - Disabled, - OnlyMe, - Friends, - Everyone, + Automatic = 0, + Disabled = 1, + OnlyMe = 2, + Friends = 3, + Everyone = 4, } /** * @todo unconfirmed, taken from localization strings */ export enum ESteamGuardState { - EmailUnverified, - Protected, - Disabled, - Offline, - NotEnabled, + EmailUnverified = 0, + Protected = 1, + Disabled = 2, + Offline = 3, + NotEnabled = 4, } export enum ENetFakeLocalSystemState { - Normal, - NoLAN, - CaptivePortal_Redirected, - CaptivePortal_InPlace, - NoInternet, - NoSteam, + Normal = 0, + NoLAN = 1, + CaptivePortal_Redirected = 2, + CaptivePortal_InPlace = 3, + NoInternet = 4, + NoSteam = 5, } export enum ELanguage { None = -1, - English, - German, - French, - Italian, - Korean, - Spanish, - SimplifiedChinese, - TraditionalChinese, - Russian, - Thai, - Japanese, - Portuguese, - Polish, - Danish, - Dutch, - Finnish, - Norwegian, - Swedish, - Hungarian, - Czech, - Romanian, - Turkish, - Brazilian, - Bulgarian, - Greek, - Arabic, - Ukrainian, - LatamSpanish, - Vietnamese, - SteamChina_SChinese, - Max, + English = 0, + German = 1, + French = 2, + Italian = 3, + Korean = 4, + Spanish = 5, + SimplifiedChinese = 6, + TraditionalChinese = 7, + Russian = 8, + Thai = 9, + Japanese = 10, + Portuguese = 11, + Polish = 12, + Danish = 13, + Dutch = 14, + Finnish = 15, + Norwegian = 16, + Swedish = 17, + Hungarian = 18, + Czech = 19, + Romanian = 20, + Turkish = 21, + Brazilian = 22, + Bulgarian = 23, + Greek = 24, + Arabic = 25, + Ukrainian = 26, + LatamSpanish = 27, + Vietnamese = 28, + SteamChina_SChinese = 29, + Max = 30, } export enum EHIDKeyboardKey { - Invalid, + Invalid = 0, BeforeFirst = 3, - A, - B, - C, - D, - E, - F, - G, - H, - I, - J, - K, - L, - M, - N, - O, - P, - Q, - R, - S, - T, - U, - V, - W, - X, - Y, - Z, - Key_1, - Key_2, - Key_3, - Key_4, - Key_5, - Key_6, - Key_7, - Key_8, - Key_9, - Key_0, - Return, - Escape, - Backspace, - Tab, - Space, - Dash, - Equals, - LeftBracket, - RightBracket, - Backslash, - Unused1, - Semicolon, - SingleQuote, - Backtick, - Comma, - Period, - ForwardSlash, - CapsLock, - F1, - F2, - F3, - F4, - F5, - F6, - F7, - F8, - F9, - F10, - F11, - F12, - PrintScreen, - ScrollLock, - Break, - Insert, - Home, - PageUp, - Delete, - End, - PageDown, - RightArrow, - LeftArrow, - DownArrow, - UpArrow, - NumLock, - KeypadForwardSlash, - KeypadAsterisk, - KeypadDash, - KeypadPlus, - KeypadEnter, - Keypad_1, - Keypad_2, - Keypad_3, - Keypad_4, - Keypad_5, - Keypad_6, - Keypad_7, - Keypad_8, - Keypad_9, - Keypad_0, - KeypadPeriod, - LAlt, - LShift, - LWin, - LControl, - RAlt, - RShift, - RWin, - RControl, - VolUp, - VolDown, - Mute, - Play, - Stop, - Next, - Prev, - AfterLast, + A = 4, + B = 5, + C = 6, + D = 7, + E = 8, + F = 9, + G = 10, + H = 11, + I = 12, + J = 13, + K = 14, + L = 15, + M = 16, + N = 17, + O = 18, + P = 19, + Q = 20, + R = 21, + S = 22, + T = 23, + U = 24, + V = 25, + W = 26, + X = 27, + Y = 28, + Z = 29, + Key_1 = 30, + Key_2 = 31, + Key_3 = 32, + Key_4 = 33, + Key_5 = 34, + Key_6 = 35, + Key_7 = 36, + Key_8 = 37, + Key_9 = 38, + Key_0 = 39, + Return = 40, + Escape = 41, + Backspace = 42, + Tab = 43, + Space = 44, + Dash = 45, + Equals = 46, + LeftBracket = 47, + RightBracket = 48, + Backslash = 49, + Unused1 = 50, + Semicolon = 51, + SingleQuote = 52, + Backtick = 53, + Comma = 54, + Period = 55, + ForwardSlash = 56, + CapsLock = 57, + F1 = 58, + F2 = 59, + F3 = 60, + F4 = 61, + F5 = 62, + F6 = 63, + F7 = 64, + F8 = 65, + F9 = 66, + F10 = 67, + F11 = 68, + F12 = 69, + PrintScreen = 70, + ScrollLock = 71, + Break = 72, + Insert = 73, + Home = 74, + PageUp = 75, + Delete = 76, + End = 77, + PageDown = 78, + RightArrow = 79, + LeftArrow = 80, + DownArrow = 81, + UpArrow = 82, + NumLock = 83, + KeypadForwardSlash = 84, + KeypadAsterisk = 85, + KeypadDash = 86, + KeypadPlus = 87, + KeypadEnter = 88, + Keypad_1 = 89, + Keypad_2 = 90, + Keypad_3 = 91, + Keypad_4 = 92, + Keypad_5 = 93, + Keypad_6 = 94, + Keypad_7 = 95, + Keypad_8 = 96, + Keypad_9 = 97, + Keypad_0 = 98, + KeypadPeriod = 99, + LAlt = 100, + LShift = 101, + LWin = 102, + LControl = 103, + RAlt = 104, + RShift = 105, + RWin = 106, + RControl = 107, + VolUp = 108, + VolDown = 109, + Mute = 110, + Play = 111, + Stop = 112, + Next = 113, + Prev = 114, + AfterLast = 115, } export enum ELoginState { - None, - WelcomeDialog, - WaitingForCreateUser, - WaitingForCredentials, - WaitingForNetwork, - WaitingForServerResponse, - WaitingForLibraryReady, - Success, - Quit, + None = 0, + WelcomeDialog = 1, + WaitingForCreateUser = 2, + WaitingForCredentials = 3, + WaitingForNetwork = 4, + WaitingForServerResponse = 5, + WaitingForLibraryReady = 6, + Success = 7, + Quit = 8, } export enum ClientBetaState { @@ -8180,24 +8185,24 @@ export enum BrowserViewContextMenuEditFlag { } export enum HDRVisualization { - None, - Heatmap, - Analysis, - HeatmapExtended, - HeatmapClassic, + None = 0, + Heatmap = 1, + Analysis = 2, + HeatmapExtended = 3, + HeatmapClassic = 4, } export enum BroadcastPermission { - Disabled, - FriendsApprove, - FriendsAllowed, - Public, - Subscribers, + Disabled = 0, + FriendsApprove = 1, + FriendsAllowed = 2, + Public = 3, + Subscribers = 4, } export enum BroadcastEncoderSetting { - BestQuality, - BestPerformance, + BestQuality = 0, + BestPerformance = 1, } export enum UpdaterState { @@ -8211,14 +8216,14 @@ export enum UpdaterState { } export enum UpdaterType { - Invalid, - Client, - OS, - BIOS, - Aggregated, - Test1, - Test2, - Dummy, + Invalid = 0, + Client = 1, + OS = 2, + BIOS = 3, + Aggregated = 4, + Test1 = 5, + Test2 = 6, + Dummy = 7, } export enum Result { @@ -8336,96 +8341,96 @@ export enum Result { } export enum AuthTokenPlatformType { - Unknown, - SteamClient, - WebBrowser, - MobileApp, + Unknown = 0, + SteamClient = 1, + WebBrowser = 2, + MobileApp = 3, } export enum SystemAudioDirection { - Invalid, - Input, - Output, + Invalid = 0, + Input = 1, + Output = 2, } export enum SystemAudioChannel { - Invalid, - Aggregated, - FrontLeft, - FrontRight, - LFE, - BackLeft, - BackRight, - FrontCenter, - Unknown, - Mono, + Invalid = 0, + Aggregated = 1, + FrontLeft = 2, + FrontRight = 3, + LFE = 4, + BackLeft = 5, + BackRight = 6, + FrontCenter = 7, + Unknown = 8, + Mono = 9, } export enum SystemAudioPortType { - Invalid, - Unknown, - Audio32f, - Midi8b, - Video32RGBA, + Invalid = 0, + Unknown = 1, + Audio32f = 2, + Midi8b = 3, + Video32RGBA = 4, } export enum SystemAudioPortDirection { - Invalid, - Input, - Output, + Invalid = 0, + Input = 1, + Output = 2, } export enum CPUGovernor { - Invalid, - Perf, - Powersave, - Manual, + Invalid = 0, + Perf = 1, + Powersave = 2, + Manual = 3, } export enum GPUPerformanceLevel { - Invalid, - Auto, - Manual, - Low, - High, - Profiling, + Invalid = 0, + Auto = 1, + Manual = 2, + Low = 3, + High = 4, + Profiling = 5, } export enum SplitScalingFilter { - Invalid, - Linear, - Nearest, - FSR, - NIS, + Invalid = 0, + Linear = 1, + Nearest = 2, + FSR = 3, + NIS = 4, } export enum SplitScalingScaler { - Invalid, - Auto, - Integer, - Fit, - Fill, - Stretch, + Invalid = 0, + Auto = 1, + Integer = 2, + Fit = 3, + Fill = 4, + Stretch = 5, } export enum SystemServiceState { - Unavailable, - Disabled, - Enabled, + Unavailable = 0, + Disabled = 1, + Enabled = 2, } export enum GraphicsPerfOverlayLevel { - Hidden, - Basic, - Medium, - Full, - Minimal, + Hidden = 0, + Basic = 1, + Medium = 2, + Full = 3, + Minimal = 4, } export enum HDRToneMapOperator { - Invalid, - Uncharted, - Reinhard, + Invalid = 0, + Uncharted = 1, + Reinhard = 2, } export enum GamingDeviceType { @@ -8441,42 +8446,42 @@ export enum GamingDeviceType { export enum WirelessAPSecurityFlags { None = 0, - StaticWep = 1 << 0, - DynamicWep = 1 << 1, - Wpa = 1 << 2, - WpaEnterprise = 1 << 3, - Wpa2 = 1 << 4, - Wpa2Enterprise = 1 << 5, + StaticWep = 1, + DynamicWep = 2, + Wpa = 4, + WpaEnterprise = 8, + Wpa2 = 16, + Wpa2Enterprise = 32, /** * Special value to indicate that this platform does not support * the security methods required to connect to an access point */ - Unsupported = 1 << 15, + Unsupported = 32768, } export enum WirelessAPStrength { - None, - Weak, - Ok, - Good, - Excellent, + None = 0, + Weak = 1, + Ok = 2, + Good = 3, + Excellent = 4, } export enum NetworkDeviceState { - NotPresent, - Failed, - Disconnected, - Disconnecting, - Connecting, - Connected, - Retrying, + NotPresent = 0, + Failed = 1, + Disconnected = 2, + Disconnecting = 3, + Connecting = 4, + Connected = 5, + Retrying = 6, } export enum NetworkDeviceType { - Unknown, - Wired, - Wireless, - Virtual, + Unknown = 0, + Wired = 1, + Wireless = 2, + Virtual = 3, } /** From 4293a213a9d9b9938cb566728d821ab079de9f00 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Fri, 17 May 2024 23:40:55 +0800 Subject: [PATCH 37/46] change: Refactor and reorganize SteamClient --- src/deck-components/steam-client/App.ts | 1729 ++++ src/deck-components/steam-client/Auth.ts | 85 + src/deck-components/steam-client/Broadcast.ts | 60 + src/deck-components/steam-client/Browser.ts | 87 + .../steam-client/ClientNotifications.ts | 21 + src/deck-components/steam-client/Cloud.ts | 16 + .../steam-client/CommunityItems.ts | 24 + src/deck-components/steam-client/Console.ts | 42 + .../steam-client/Customization.ts | 12 + src/deck-components/steam-client/Downloads.ts | 185 + .../steam-client/FamilySharing.ts | 44 + .../steam-client/FriendSettings.ts | 69 + src/deck-components/steam-client/Friends.ts | 51 + src/deck-components/steam-client/GameNotes.ts | 30 + .../steam-client/GameSessions.ts | 57 + src/deck-components/steam-client/Input.ts | 747 ++ .../steam-client/InstallFolder.ts | 175 + src/deck-components/steam-client/Installs.ts | 139 + src/deck-components/steam-client/Messaging.ts | 21 + src/deck-components/steam-client/Music.ts | 106 + .../steam-client/Notifications.ts | 57 + src/deck-components/steam-client/OpenVR.ts | 103 + src/deck-components/steam-client/Overlay.ts | 142 + src/deck-components/steam-client/Parental.ts | 79 + .../steam-client/RemotePlay.ts | 165 + .../steam-client/Screenshots.ts | 131 + .../steam-client/ServerBrowser.ts | 365 + src/deck-components/steam-client/Settings.ts | 567 ++ .../steam-client/SharedConnection.ts | 36 + src/deck-components/steam-client/Stats.ts | 10 + .../steam-client/SteamChina.ts | 3 + src/deck-components/steam-client/Storage.ts | 24 + src/deck-components/steam-client/Streaming.ts | 55 + src/deck-components/steam-client/UI.ts | 69 + src/deck-components/steam-client/URL.ts | 46 + src/deck-components/steam-client/Updates.ts | 90 + src/deck-components/steam-client/User.ts | 193 + src/deck-components/steam-client/WebChat.ts | 157 + .../steam-client/WebUITransport.ts | 12 + src/deck-components/steam-client/Window.ts | 215 + .../browser-view/BrowserViewPopup.ts | 389 + .../steam-client/browser-view/index.ts | 27 + src/deck-components/steam-client/index.ts | 560 ++ .../steam-client/system/Audio.ts | 206 + .../steam-client/system/AudioDevice.ts | 116 + .../steam-client/system/Bluetooth.ts | 178 + .../steam-client/system/Devkit.ts | 11 + .../steam-client/system/Display.ts | 15 + .../steam-client/system/DisplayManager.ts | 16 + .../steam-client/system/Dock.ts | 32 + .../steam-client/system/Perf.ts | 196 + .../steam-client/system/Report.ts | 40 + src/deck-components/steam-client/system/UI.ts | 33 + .../steam-client/system/index.ts | 369 + .../steam-client/system/network/Device.ts | 12 + .../steam-client/system/network/index.ts | 195 + src/globals/SteamClient.ts | 8523 ----------------- src/globals/stores.ts | 4 +- src/modules/Router.ts | 42 +- 59 files changed, 8619 insertions(+), 8564 deletions(-) create mode 100644 src/deck-components/steam-client/App.ts create mode 100644 src/deck-components/steam-client/Auth.ts create mode 100644 src/deck-components/steam-client/Broadcast.ts create mode 100644 src/deck-components/steam-client/Browser.ts create mode 100644 src/deck-components/steam-client/ClientNotifications.ts create mode 100644 src/deck-components/steam-client/Cloud.ts create mode 100644 src/deck-components/steam-client/CommunityItems.ts create mode 100644 src/deck-components/steam-client/Console.ts create mode 100644 src/deck-components/steam-client/Customization.ts create mode 100644 src/deck-components/steam-client/Downloads.ts create mode 100644 src/deck-components/steam-client/FamilySharing.ts create mode 100644 src/deck-components/steam-client/FriendSettings.ts create mode 100644 src/deck-components/steam-client/Friends.ts create mode 100644 src/deck-components/steam-client/GameNotes.ts create mode 100644 src/deck-components/steam-client/GameSessions.ts create mode 100644 src/deck-components/steam-client/Input.ts create mode 100644 src/deck-components/steam-client/InstallFolder.ts create mode 100644 src/deck-components/steam-client/Installs.ts create mode 100644 src/deck-components/steam-client/Messaging.ts create mode 100644 src/deck-components/steam-client/Music.ts create mode 100644 src/deck-components/steam-client/Notifications.ts create mode 100644 src/deck-components/steam-client/OpenVR.ts create mode 100644 src/deck-components/steam-client/Overlay.ts create mode 100644 src/deck-components/steam-client/Parental.ts create mode 100644 src/deck-components/steam-client/RemotePlay.ts create mode 100644 src/deck-components/steam-client/Screenshots.ts create mode 100644 src/deck-components/steam-client/ServerBrowser.ts create mode 100644 src/deck-components/steam-client/Settings.ts create mode 100644 src/deck-components/steam-client/SharedConnection.ts create mode 100644 src/deck-components/steam-client/Stats.ts create mode 100644 src/deck-components/steam-client/SteamChina.ts create mode 100644 src/deck-components/steam-client/Storage.ts create mode 100644 src/deck-components/steam-client/Streaming.ts create mode 100644 src/deck-components/steam-client/UI.ts create mode 100644 src/deck-components/steam-client/URL.ts create mode 100644 src/deck-components/steam-client/Updates.ts create mode 100644 src/deck-components/steam-client/User.ts create mode 100644 src/deck-components/steam-client/WebChat.ts create mode 100644 src/deck-components/steam-client/WebUITransport.ts create mode 100644 src/deck-components/steam-client/Window.ts create mode 100644 src/deck-components/steam-client/browser-view/BrowserViewPopup.ts create mode 100644 src/deck-components/steam-client/browser-view/index.ts create mode 100644 src/deck-components/steam-client/index.ts create mode 100644 src/deck-components/steam-client/system/Audio.ts create mode 100644 src/deck-components/steam-client/system/AudioDevice.ts create mode 100644 src/deck-components/steam-client/system/Bluetooth.ts create mode 100644 src/deck-components/steam-client/system/Devkit.ts create mode 100644 src/deck-components/steam-client/system/Display.ts create mode 100644 src/deck-components/steam-client/system/DisplayManager.ts create mode 100644 src/deck-components/steam-client/system/Dock.ts create mode 100644 src/deck-components/steam-client/system/Perf.ts create mode 100644 src/deck-components/steam-client/system/Report.ts create mode 100644 src/deck-components/steam-client/system/UI.ts create mode 100644 src/deck-components/steam-client/system/index.ts create mode 100644 src/deck-components/steam-client/system/network/Device.ts create mode 100644 src/deck-components/steam-client/system/network/index.ts delete mode 100644 src/globals/SteamClient.ts diff --git a/src/deck-components/steam-client/App.ts b/src/deck-components/steam-client/App.ts new file mode 100644 index 00000000..703d0b62 --- /dev/null +++ b/src/deck-components/steam-client/App.ts @@ -0,0 +1,1729 @@ +import {JsPbMessage, OperationResponse, Result, Unregisterable} from "./index"; +import {FilePrivacyState, Screenshot} from "./Screenshots"; + +/** + * Represents various functions related to Steam applications. + */ +export interface Apps { + /** + * Adds a non-Steam application shortcut to the local Steam library. + * @param {string} appName - The name of the non-Steam application. + * @param {string} executablePath - The path to the executable file of the non-Steam application. + * @param {string} directory - The working directory for the non-Steam application. + * @param {string} launchOptions - Options to be passed when launching the non-Steam application. + * @returns {Promise<number>} - A Promise that resolves to a unique AppID assigned to the added non-Steam application shortcut. + */ + AddShortcut(appName: string, executablePath: string, directory: string, launchOptions: string): Promise<number>; + + /** + * Adds user tags to specified apps in the Steam library. + * @param {number[]} appIds - The IDs of the apps to which user tags will be added. + * @param {string} userTag - The user tag to be added. + * @returns {void} + * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. + */ + AddUserTagToApps(appIds: number[], userTag: string): void; + + /** + * Backups an app to the specified path. + * @param {number} appId - The ID of the application to back up. + * @param {string} backupToPath - The path to store the backup. + * @returns {number} A Promise that resolves to a number. This value may be "20" for backup busy and "0" for success. + */ + BackupFilesForApp(appId: number, backupToPath: string): Promise<number>; + + /** + * Opens the screenshot folder for a specific app. + * @param {string} appId - The ID of the app to browse screenshots for. + * @param {number} handle - The screenshot handle to use. + * @returns {void} + */ + BrowseScreenshotForApp(appId: string, handle: number): void; + + /** + * Opens the screenshot folder for a specific app. + * @param {string} appId - The ID of the app to browse screenshots for. + * @returns {void} + */ + BrowseScreenshotsForApp(appId: string): void; + + /** + * Cancels the current backup process. + * @returns {void} + */ + CancelBackup(): void; + + /** + * Cancels a specific game action. + * @param {number} gameActionId - The ID of the game action to cancel. + * @returns {void} + */ + CancelGameAction(gameActionId: number): void; + + /** + * Cancels the launch of an application with the specified ID. + * @param {string} appId - The ID of the application whose launch is to be canceled. + * @returns {void} + */ + CancelLaunch(appId: string): void; + + /** + * Clears existing user tags on a specified application and sets new user tags. + * @param {number} appId - The ID of the application to clear and set user tags for. + * @param {string[]} userTags - An array of user tags to set for the application. + * @returns {void} + * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. + */ + ClearAndSetUserTagsOnApp(appId: number, userTags: string[]): void; + + /** + * Clears the custom artwork for a given application. + * @param {number} appId - The ID of the application to clear custom artwork for. + * @param {AppArtworkAssetType} assetType - The type of artwork to clear. + */ + ClearCustomArtworkForApp(appId: number, assetType: AppArtworkAssetType): Promise<void>; + + /** + * Clears the custom logo position for a specific application. + * @param {number} appId - The ID of the application. + * @returns {Promise<void>} - A Promise that resolves once the custom logo position is cleared. + */ + ClearCustomLogoPositionForApp(appId: number): Promise<void>; + + ClearProton(appId: number): Promise<any>; + + /** + * Clears user tags on a list of specified applications. + * @param {number[]} appIds - An array of application IDs for which to clear user tags. + * @returns {void} + * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. + */ + ClearUserTagsOnApps(appIds: number[]): void; + + /** + * Continues a specific game action. + * @param {number} gameActionId - The ID of the game action to continue. + * @param {string} actionType - The type of action to perform during continuation. + * @returns {void} + * @remarks actionType - "SkipShaders", "skip", "ShowDurationControl" todo: + */ + ContinueGameAction(gameActionId: number, actionType: string): void; + + /** + * Creates a Steam application shortcut on the desktop. + * @param {number} appId - The ID of the application for which to create a desktop shortcut. + * @returns {void} + */ + CreateDesktopShortcutForApp(appId: number): void; + + /** + * Download a workshop item. + * @param {number} appId - The ID of the application. + * @param {string} itemId - The ID of the workshop item. + * @param {boolean} param1 - Additional parameter (exact usage may vary). + * @returns {void} + */ + DownloadWorkshopItem(appId: number, itemId: string, param1: boolean): void; + + /** + * Retrieves achievements within a specified time range for a given app. + * @param {number} appId - The ID of the application. + * @param {number} start - The start of the time range as a Unix timestamp. + * @param {number} end - The end of the time range as a Unix timestamp. + * @returns {Promise<AppAchievement[]>} - A Promise that resolves to an array of AppAchievement objects. + */ + GetAchievementsInTimeRange(appId: number, start: number, end: number): Promise<AppAchievement[]>; + + /** + * Retrieves a list of active game actions, such as launching an application. + * @returns {Promise<GameAction[]>} A Promise that resolves to an array of active game actions. + */ + GetActiveGameActions(): Promise<GameAction[]>; + + /** + * Retrieves a list of available compatibility tools for a specific application. + * @param {number} appId - The ID of the application to retrieve compatibility tools for. + * @returns {Promise<CompatibilityToolInfo[]>} A Promise that resolves to an array of CompatibilityToolInfo objects. + */ + GetAvailableCompatTools(appId: number): Promise<CompatibilityToolInfo[]>; + + /** + * Represents a function to retrieve the name of the application in a backup folder. + * @param {string} appBackupPath - The path to the application's backup folder. + * @returns {Promise<string | undefined>} - A Promise that resolves to the name of the application in the backup folder, or undefined if the path is invalid. + * @remarks This function checks for the "sku.sis" file in that path. + */ + GetBackupsInFolder(appBackupPath: string): Promise<string | undefined>; + + /** + * Retrieves cached details for a specific application. + * @param appId - The ID of the application. + * @returns {Promise<string>} - A Promise that resolves to a stringified object. + */ + GetCachedAppDetails(appId: number): Promise<string>; // todo: Parsing nightmare + + GetCloudPendingRemoteOperations(appId: number): Promise<any>; + + GetCompatExperiment(param0: number): Promise<any>; + + GetConflictingFileTimestamps(appId: number): Promise<ConflictingFileTimestamp>; + + /** + * Retrieves details for a specific screenshot upload. + * @param {string} appId - The ID of the application. + * @param {number} hHandle - The handle of the screenshot upload. + * @returns {Promise<DetailsForScreenshotUpload>} - A Promise that resolves to details about the screenshot upload. + */ + GetDetailsForScreenshotUpload(appId: string, hHandle: number): Promise<DetailsForScreenshotUpload>; + + /** + * Retrieves details for multiple screenshot uploads. + * @param {string} appId - The ID of the application. + * @param {number[]} hHandles - An array of handles of the screenshot uploads. + * @returns {Promise<DetailsForScreenshotUploads>} - A Promise that resolves to details about the screenshot uploads. + */ + GetDetailsForScreenshotUploads(appId: string, hHandles: number[]): Promise<DetailsForScreenshotUploads>; + + /** + * Retrieves a list of downloaded workshop items for a specific application. + * @param {number} appId - The ID of the application to retrieve downloaded workshop items for. + * @returns {Promise<WorkshopItem[]>} - A Promise that resolves to an array of downloaded workshop items for the specified application. + */ + GetDownloadedWorkshopItems(appId: number): Promise<WorkshopItem[]>; + + GetDurationControlInfo(appId: number): Promise<any>; // any - {"bApplicable": true} - overlay usage? + + /** + * Retrieves achievement information for a specific application for a given friend. + * @param {string} appId - The ID of the application to retrieve achievement information for. + * @param {string} friendSteam64Id - The Steam64 ID of the friend for whom to retrieve achievement information. + * @returns {Promise<AppAchievementResponse>} - A Promise that resolves to an object containing achievement information for the specified friend and application. + */ + GetFriendAchievementsForApp(appId: string, friendSteam64Id: string): Promise<AppAchievementResponse>; + + /** + * Retrieves a list of friends who play the specified application. + * @param {number} appId - The ID of the application. + * @returns {Promise<string[]>} A Promise that resolves to an array of Steam64 IDs representing friends who play the application. + */ + GetFriendsWhoPlay(appId: number): Promise<string[]>; + + /** + * Retrieves details of a game action. + * @param {number} appId - The ID of the application. + * @param {Function} callback - The callback function to handle the retrieved game action details and state. + * @param {GameAction} callback.gameAction - The game action received in the callback. + * @param {state} callback.state - The state manager received in the callback. + * @returns {void} + */ + GetGameActionDetails(appId: number, callback: (gameAction: GameAction) => void): void; + + GetGameActionForApp( + appId: string, + callback: ( + gameActionId: number, + /** + * This parameter is a number only with the value `0`. + */ + appId: number | string, + taskName: AppAction, + ) => void, + ): void; + + /** + * Retrieves launch options for a specified application. + * These options may include different configurations or settings for launching the application, such as DirectX, Vulkan, OpenGL, 32-bit, 64-bit, etc. + * This function does not retrieve launch/argument options inputted by the user. + * @param {number} appId - The ID of the application. + * @returns {Promise<LaunchOption[]>} - A Promise that resolves to an array of launch options for the specified application. + */ + GetLaunchOptionsForApp(appId: number): Promise<LaunchOption[]>; + + /** + * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link LibraryBootstrapData}. + */ + GetLibraryBootstrapData(): Promise<ArrayBuffer>; + + /** + * Retrieves achievement information for the authenticated user in a specific Steam application. + * @param {string} appId - The ID of the application to retrieve achievement information for. + * @returns {Promise<AppAchievementResponse>} A Promise that resolves to an AppAchievementResponse object containing the achievement information for the authenticated user in the specified application. + */ + GetMyAchievementsForApp(appId: string): Promise<AppAchievementResponse>; + + /** + * Retrieves the playtime information for a specific application. + * @param {number} appId - The ID of the application to get playtime information for. + * @returns {Promise<Playtime | undefined>} A Promise that resolves to playtime information or undefined if not available. + */ + GetPlaytime(appId: number): Promise<Playtime | undefined>; + + GetPrePurchasedApps(appIds: number[]): Promise<PrePurchaseInfo>; + + /** + * Retrieves the resolution override for a specific application. + * @param {number} appId - The ID of the application to retrieve the resolution override for. + * @returns {Promise<string>} A Promise that resolves to a string of the resolution override. + */ + GetResolutionOverrideForApp(appId: number): Promise<string>; + + /** + * Represents a function to retrieve detailed information about a specific screenshot. + * @param {string} appId - The ID of the application the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @returns {Promise<Screenshot>} - A Promise that resolves to detailed information about the specified screenshot. + */ + GetScreenshotInfo(appId: string, hHandle: number): Promise<Screenshot>; + + /** + * Represents a function to retrieve screenshots within a specified time range. + * @param {number} appId - The ID of the application. + * @param {number} start - The start of the time range as a Unix timestamp. + * @param {number} end - The end of the time range as a Unix timestamp. + * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of screenshots taken within the specified time range. + */ + GetScreenshotsInTimeRange(appId: number, start: number, end: number): Promise<Screenshot[]>; + + /** + * Represents a function to retrieve shortcut data for a list of non-Steam app IDs. + * @param {number[]} appIds - An array of non-Steam application IDs. + * @returns {Promise<Shortcut[]>} - A Promise that resolves to an array of Shortcut objects for the specified non-Steam app IDs. + */ + GetShortcutData(appIds: number[]): Promise<Shortcut[]>; + + /** + * Retrieves shortcut data for a given shortcut file path. + * @param {string} pathToShortcut The path to the shortcut file. + * @returns {Promise<Shortcut>} A Promise that resolves to the shortcut data. + */ + GetShortcutDataForPath(pathToShortcut: string): Promise<Shortcut>; + + /** + * Represents a function to retrieve details about a soundtrack associated with a soundtrack application. + * The soundtrack has to be installed. + * @param {number} appId - The ID of the soundtrack application. + * @returns {Promise<SoundtrackDetails>} - A Promise that resolves to the details of the soundtrack associated with the specified soundtrack application. + */ + GetSoundtrackDetails(appId: number): Promise<SoundtrackDetails>; + + // [...appStore.m_mapStoreTagLocalization.keys()] + GetStoreTagLocalization(tags: number[]): Promise<StoreTagLocalization[]>; + + /** + * Retrieves a list of subscribed workshop item details for a specific application. + * @param {number} appId - The ID of the application to retrieve subscribed workshop item details for. + * @param {string[]} itemIds - Workshop item IDs to retrieve details for. + * @returns {Promise<WorkshopItemDetails[] | OperationResponse>} - A Promise that resolves to an array of subscribed workshop item details for the specified application. + * @throws Throws if the query failed. + */ + GetSubscribedWorkshopItemDetails(appId: number, itemIds: string[]): Promise<WorkshopItemDetails[] | OperationResponse>; + + /** + * Retrieves a list of subscribed workshop items for a specific application. + * @param {number} appId - The ID of the application to retrieve subscribed workshop items for. + * @returns {Promise<WorkshopItem[]>} - A Promise that resolves to an array of subscribed workshop items for the specified application. + */ + GetSubscribedWorkshopItems(appId: number): Promise<WorkshopItem[]>; + + InstallFlatpakAppAndCreateShortcut(appName: string, appCommandLineOptions: string): Promise<any>; // returns {"appid":0,"strInstallOutput":""} + JoinAppContentBeta(appId: number, name: string): any; + + JoinAppContentBetaByPassword(appId: number, accessCode: any): Promise<any>; // any.strName + + ListFlatpakApps(): Promise<any>; + + /** + * @throws if the user does not own the app or no EULA. + */ + LoadEula(appId: number): Promise<EndUserLicenseAgreement[]>; // Doesn't bring up the EULA dialog, just returns the eula data + MarkEulaAccepted(param0: any, param1: any, param2: any): any; + + MarkEulaRejected: any; + + /** + * Move specified workshop item load order. + * @param appId - The ID of the application. + * @param oldOrder - The item to move, referenced by its position number. + * @param newOrder - The position number to move the item to. + * @returns {void} + * @remarks Orders are zero-indexed. + */ + MoveWorkshopItemLoadOrder(appId: number, oldOrder: number, newOrder: number): void; + + /** + * Opens the settings dialog for a specific application. + * @param {number} appId - The ID of the application for which to open the settings dialog. + * @param {string} section - The section (tab) to switch to. + * @returns {void} + */ + OpenAppSettingsDialog(appId: number, section: string): void; + + /** + * Raises the window for a given application. + * @param {string} appId - The ID of the application to raise the window of. + * @returns {Promise<number>} - A Promise that resolves to a number. + * @todo Returns a result enum? 1 if ok, 2 if not running + */ + RaiseWindowForGame(appId: number): Promise<number>; // ResumeGameInProgress + + /* + "CMsgAchievementChange" + OnAchievementChange(e) { + var t; + const n = l.on.deserializeBinary(e).toObject(), + o = null !== (t = null == n ? void 0 : n.appid) && void 0 !== t ? t : 0; + 0 != o ? (this.m_mapMyAchievements.has(o) || this.m_mapInflightMyAchievementsRequests.has(o)) && this.LoadMyAchievements(o) : console.error("Received invalid appid in OnAchievementChange") + } + + message CMsgAchievementChange { + optional uint32 appid = 1; + } + */ + /** + * Registers a callback function to be called when achievement changes occur. + * @param callback The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAchievementChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + + RegisterForAppBackupStatus(callback: (appBackupStatus: AppBackupStatus) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when app details change. + * @param appId The ID of the application to monitor. + * @param callback The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; + + /* + + message CAppOverview_Change { + repeated .CAppOverview app_overview = 1; + repeated uint32 removed_appid = 2; + optional bool full_update = 3; + optional bool update_complete = 4; + } + */ + /** + * If `data` is deserialized, returns {@link AppOverview_Change}. + * @remarks This is not a mistake, it doesn't return anything. + */ + RegisterForAppOverviewChanges(callback: (data: ArrayBuffer) => void): void; + + RegisterForDRMFailureResponse( + callback: (appid: number, eResult: number, errorCode: number) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a game action ends. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionEnd(callback: (gameActionIdentifier: number) => void): Unregisterable | any; + + // "error" is a localization token + RegisterForGameActionShowError(callback: (gameActionId: number, appId: string, actionName: string, error: string, param4: string) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when a game action UI is shown. + * @param callback The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; // todo: no idea what this callback is from + + /** + * Registers a callback function to be called when a game action starts. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionStart( + callback: (gameActionIdentifier: number, appId: string, action: string, param3: AppLaunchSource) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a game action task changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionTaskChange( + callback: ( + gameActionIdentifier: number, + appId: string, + action: string, + requestedAction: string, + param4: string, + ) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a user requests a game action. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameActionUserRequest( + callback: ( + gameActionIdentifier: number, + appId: string, + action: string, + requestedAction: string, + appId2: string, + ) => void, + ): Unregisterable | any; + + /** + * @todo returns undefined (now)? + */ + RegisterForLocalizationChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + + RegisterForPrePurchasedAppChanges(callback: () => void): Unregisterable | any; // Unknown, did have it show up a few times, but not callback parameters + RegisterForShowMarketingMessageDialog: Unregisterable | any; + + /** + * Registers a callback function to be notified when workshop items are added or removed from a Steam application. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForWorkshopChanges(callback: (appId: number) => void): Unregisterable | any; + + RegisterForWorkshopItemDownloads( + appId: number, + callback: (appId: number, publishedFileId: string, param2: number) => void, + ): Unregisterable | any; + + RegisterForWorkshopItemInstalled: any; + + /** + * Removes a non-Steam application shortcut from the Steam library. + * @param {number} appId - The ID of the application for which to remove the shortcut. + * @returns {void} + */ + RemoveShortcut(appId: number): void; + + /** + * Removes a user tag from multiple Steam applications. + * @param {number[]} appIds - An array of application IDs from which the user tag should be removed. + * @param {string} userTag - The user tag to be removed. + * @returns {void} + * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. + */ + RemoveUserTagFromApps(appIds: number[], userTag: string): void; + + ReportLibraryAssetCacheMiss(appId: number, assetType: AppArtworkAssetType): void; + + ReportMarketingMessageDialogShown(): void; + + RequestIconDataForApp(appId: number): any; + + RequestLegacyCDKeysForApp(appId: number): any; + + // collectionStore.GetCollection('hidden').allApps.map(e => e.appid) + // May be broken? + ResetHiddenState(appIds: number[]): Promise<void>; + + /** + * Runs a game with specified parameters. Focuses the game if already launched. + * @param {string} appId - The ID of the application to run. + * @param {string} launchOptions - Additional launch options for the application. + * @param {number} param2 - Additional parameter (exact usage may vary). + * @param {AppLaunchSource} launchSource + * @remarks `launchOptions` is appended before the ones specified in the application's settings. + * @returns {void} + */ + RunGame(appId: string, launchOptions: string, param2: number, launchSource: AppLaunchSource): void; + + /* + function u(e, t) { + return t instanceof Map || t instanceof Set ? Array.from(t) : t; + } + SteamClient.Apps.SaveAchievementProgressCache( + JSON.stringify(this.m_achievementProgress, u) + ); + */ + SaveAchievementProgressCache(progress: string): any; + + /** + * Scans the system for installed non-Steam applications. + * @returns {Promise<NonSteamApp[]>} A Promise that resolves to an array of NonSteamApp objects representing installed non-Steam applications. + * @remarks This function scans the user's system for installed applications that are not part of the Steam library. It does not scan for shortcuts added to the Steam library. + * + * On Linux, it scans inside /usr/share/applications and $XDG_DATA_HOME/applications. + */ + ScanForInstalledNonSteamApps(): Promise<NonSteamApp[]>; + + /** + * Sets the automatic update behavior for a Steam application. + * @param {number} appId - The ID of the application to set the update behavior for. + * @param {AutoUpdateBehavior} mode - The update behavior mode to set. + * @returns {void} + * @remarks This function only works with installed Steam applications. + */ + SetAppAutoUpdateBehavior(appId: number, mode: AutoUpdateBehavior): void; + + /** + * Sets the background downloads behavior for a specific Steam application. + * @param {number} appId - The ID of the application to set the background downloads behavior for. + * @param {BackgroundDownloadsBehavior} mode - The background downloads mode to set. + * @returns {void} + * @remarks This function only works with installed Steam applications. + */ + SetAppBackgroundDownloadsBehavior(appId: number, mode: BackgroundDownloadsBehavior): void; + + /** + * Sets the current language for a specific Steam application. + * @param {number} appId - The ID of the application to set the current language for. + * @param {string} language - The language to set, represented as a language (e.g., "english", "spanish", "tchinese", "schinese"). + * @returns {void} + */ + SetAppCurrentLanguage(appId: number, language: string): void; + + /** + * Sets the blocked state for apps. + * @param {number[]} appIds - An array of app IDs to set the blocked state for. + * @param {boolean} state - The state to set (true for blocked, false for unblocked). + * @returns {void} + */ + SetAppFamilyBlockedState(appIds: number[], state: boolean): void; + + /** + * Sets the hidden status of a specific Steam application. + * @param {number} appId - The ID of the application to set the hidden status for. + * @param {boolean} value - The value indicating whether the application should be hidden (true) or not (false). + * @returns {void} + * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file to set the hidden status of the specified application. + */ + SetAppHidden(appId: number, value: boolean): void; + + /** + * Sets launch options for a Steam application. + * @param {number} appId - The ID of the application to set launch options for. + * @param {string} launchOptions - The launch options to be set for the application. + * @returns {void} + */ + SetAppLaunchOptions(appId: number, launchOptions: string): void; + + /** + * Sets a resolution override for a Steam application. + * @param {number} appId - The ID of the application to set the resolution override for. + * @param {string} resolution - The resolution to be set for the application. It can be "Default", "Native", or other compatible resolutions for the user's monitor. + * @returns {void} + */ + SetAppResolutionOverride(appId: number, resolution: string): any; + + /** + * Sets cached details for a specific application. + * @param {number} appId - The ID of the application. + * @param {string} details - The details to be cached, a stringified object. + * @returns {Promise<any>} - A Promise that resolves when the details are successfully cached. + * todo: might return boolean? + */ + SetCachedAppDetails(appId: number, details: string): Promise<any>; + + SetControllerRumblePreference(appId: number, param1: number): any; // param1 - enum for preference + + /** + * Sets the custom artwork for a given application. + * @param {number} appId - The ID of the application to set custom artwork for. + * @param {string} base64Image - Base64 encoded image. + * @param {string} imageType - "jpeg" or "png". + * @param {AppArtworkAssetType} assetType - The type of artwork to set. + * @returns {Promise<any>} A Promise that resolves after the custom artwork is set. + */ + SetCustomArtworkForApp(appId: number, base64Image: string, imageType: string, assetType: AppArtworkAssetType): Promise<any>; + + /** + * Sets a custom logo position for a specific app. + * @param {number} appId - The ID of the application. + * @param {string} details - The details of the custom logo position, expected to be a stringified {@link LogoPositionForApp} object. + * @returns {Promise<void>} - A Promise that resolves when the custom logo position is successfully set. + */ + SetCustomLogoPositionForApp(appId: number, details: string): Promise<void>; + + /** + * Sets the enabled state for downloadable content (DLC) of a specific app. + * @param {number} appId - The ID of the parent application. + * @param {number} appDLCId - The ID of the DLC to set the state for. + * @param {boolean} value - The value to set (true for enabled, false for disabled). + * @returns {void} + */ + SetDLCEnabled(appId: number, appDLCId: number, value: boolean): void; + + /** + * Set a local screenshot's caption. + * @param {string} appId - The application ID the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @param {string} caption + * @returns {void} + */ + SetLocalScreenshotCaption(appId: string, hHandle: any, caption: string): void; + + /** + * Set a local screenshot's privacy state. + * @param {string} appId - The application ID the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @param {FilePrivacyState} privacy - Screenshot privacy state. + */ + SetLocalScreenshotPrivacy(appId: string, hHandle: any, privacy: FilePrivacyState): void; + + /** + * Set a local screenshot's spoiler state. + * @param {string} appId - The application ID the screenshot belongs to. + * @param {number} hHandle - The handle of the screenshot. + * @param {boolean} spoilered - Is the screenshot spoilered? + */ + SetLocalScreenshotSpoiler(appId: string, hHandle: any, spoilered: boolean): void; + + /** + * Sets the icon for a non-Steam application shortcut. + * @param {string} appId - The ID of the application to set the shortcut icon for. + * @param {string} iconPath - The path to the icon image (can be png or tga format). + * @returns {void} + */ + SetShortcutIcon(appId: number, iconPath: string): void; + + /** + * Sets whether a non-Steam application shortcut should be included in the VR library. + * @param {number} appId The ID of the application to set the VR status for. + * @param {boolean} value A boolean indicating whether the application should be included in the VR library. + * @returns {void} + */ + SetShortcutIsVR(appId: number, value: boolean): void; + + /** + * Sets launch options for a non-Steam application shortcut. + * @param {number} appId - The ID of the application to set the launch options for. + * @param {string} launchOptions - The launch options to be used when starting the application. + * @returns {void} + */ + SetShortcutLaunchOptions(appId: number, launchOptions: string): void; + + /** + * Sets the name for a non-Steam application shortcut. + * @param {number} appId - The ID of the application to set the shortcut name for. + * @param {string} shortcutName - The name to be displayed for the application shortcut. + * @returns {void} + */ + SetShortcutName(appId: number, shortcutName: string): void; + + /** + * Sets the starting directory for a non-Steam application shortcut. + * @param {number} appId - The ID of the application to set the starting directory for. + * @param {string} directory - The directory from which the application should be launched. + * @returns {void} + */ + SetShortcutStartDir(appId: number, directory: string): void; + + /** + * Sets the client ID for streaming for a specific application. + * @param {number} appId - The ID of the application. + * @param {string} clientId - The client ID for streaming. + */ + SetStreamingClientForApp(appId: number, clientId: string): void; + + SetThirdPartyControllerConfiguration(appId: number, param1: number): any; + + /** + * Sets the workshop items disabled state. + * @param {number} appId - The ID of the application. + * @param {string[]} itemIds - Workshop item IDs to change the state for. + * @param {boolean} value - `true` to disable, `false` otherwise. + * @returns {void} + */ + SetWorkshopItemsDisabledLocally(appId: number, itemIds: string[], value: boolean): void; + + /** + * Sets the workshop items load order for a specified application. + * @param {number} appId - The ID of the application. + * @param {string[]} itemIds - Workshop item IDs. + * @returns {void} + * @remarks `itemIds` has to be the full list of subscribed items, otherwise the specified items get moved to the last position. + */ + SetWorkshopItemsLoadOrder(appId: number, itemIds: string[]): void; + + /** + * Opens the controller configurator for a specific application. + * @param {number} appId - The ID of the application for which to open the controller configurator. + * @returns {void} + */ + ShowControllerConfigurator(appId: number): void; + + /** + * Opens the Steam store page for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + */ + ShowStore(appId: number): void; + + SpecifyCompatExperiment: any; + + /** + * Specifies a compatibility tool by its name for a given application. If strToolName is an empty string, the specified application will no longer use a compatibility tool. + * @param {number} appId - The ID of the application to specify compatibility tool for. + * @param {string} strToolName - The name of the compatibility tool to specify. + * @returns {void} + */ + SpecifyCompatTool(appId: number, strToolName: string): void; + + StreamGame(appId: number, clientId: string, param2: number): void; + + /** + * Subscribes or unsubscribes from a workshop item for a specific app. + * @param {number} appId - The ID of the application. + * @param {string} workshopId - The ID of the workshop item. + * @param {boolean} subscribed - True to subscribe, false to unsubscribe. + * @returns {void} + */ + SubscribeWorkshopItem(appId: number, workshopId: string, subscribed: boolean): void; + + /** + * Terminates a running application. + * @param {string} appId - The ID of the application to terminate. + * @param {boolean} param1 - Additional parameter. Exact usage may vary. + * @returns {void} + */ + TerminateApp(appId: string, param1: boolean): void; + + // "#AppProperties_SteamInputDesktopConfigInLauncher" + ToggleAllowDesktopConfiguration(appId: number): any; + + /** + * Toggles the Steam Cloud synchronization for game saves for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. + */ + ToggleAppSteamCloudEnabled(appId: number): void; + + // "#AppProperties_EnableSteamCloudSyncOnSuspend" + ToggleAppSteamCloudSyncOnSuspendEnabled(appId: number): any; + + /** + * Toggles the Steam Overlay setting for a specific application. + * @param {number} appId - The ID of the application. + * @returns {void} + */ + ToggleEnableSteamOverlayForApp(appId: number): void; + + // "#AppProperties_ResolutionOverride_Internal" + ToggleOverrideResolutionForInternalDisplay(appId: number): any; + + UninstallFlatpakApp(app: string): Promise<boolean>; + + /** + * Verifies the integrity of an app's files. + * @param {number} appId - The ID of the app to verify. + */ + VerifyApp(appId: number): Promise<any>; // todo: returns {"nGameActionID":9} +} + +export enum AppArtworkAssetType { + Capsule = 0, + Hero = 1, + Logo = 2, + Header = 3, + Icon = 4, + HeroBlur = 5, +} + +export type AppAchievements = { + nAchieved: number; + nTotal: number; + vecAchievedHidden: AppAchievement[]; + vecHighlight: AppAchievement[]; + vecUnachieved: AppAchievement[]; +}; + +export interface AppAchievement { + bAchieved: boolean; + bHidden: boolean; + flMinProgress: number; + flCurrentProgress: number; + flMaxProgress: number; + /** How many players have this achievement, in percentage. */ + flAchieved: number; + /** When this achievement was unlocked. */ + rtUnlocked: number; + /** Achievement description. */ + strDescription: string; + /** Achievement ID. */ + strID: string; + /** Achievement icon. */ + strImage: string; + /** Achievement name. */ + strName: string; +} + +export type AppAction = "LaunchApp" | "VerifyApp"; + +export type LaunchAppTask = + | "None" + | "Completed" + | "Cancelled" + | "Failed" + | "Starting" + | "ConnectingToSteam" + | "RequestingLicense" + | "UpdatingAppInfo" + | "UpdatingAppTicket" + | "UnlockingH264" + | "WaitingOnWideVineUpdate" + | "ShowCheckSystem" + | "CheckTimedTrial" + | "GetDurationControl" + | "ShowDurationControl" + | "ShowLaunchOption" + | "ShowEula" + | "ShowVR2DWarning" + | "ShowVROculusOnly" + | "ShowVRStreamingLaunch" + | "ShowGameArgs" + | "ShowCDKey" + | "WaitingPrevProcess" + | "DownloadingDepots" + | "DownloadingWorkshop" + | "UpdatingDRM" + | "GettingLegacyKey" + | "ProcessingInstallScript" + | "RunningInstallScript" + | "SynchronizingCloud" + | "SynchronizingControllerConfig" + | "ShowNoControllerConfig" + | "ProcessingShaderCache" + | "VerifyingFiles" + | "KickingOtherSession" + | "WaitingOpenVRAppQuit" + | "SiteLicenseSeatCheckout" + | "DelayLaunch" + | "CreatingProcess" + | "WaitingGameWindow" + +export interface GameAction { + nGameActionID: number; + gameid: string; + strActionName: AppAction; + strTaskName: LaunchAppTask; + strTaskDetails: string; + nLaunchOption: number; + nSecondsRemaing: number; //fixme: not a typo, actually valve + strNumDone: string; + strNumTotal: string; + bWaitingForUI: boolean; +} + +export interface ConflictingFileTimestamp { + rtLocalTime: number; + rtRemoteTime: number; +} + +/** + * Represents information about a compatibility tool. + */ +export interface CompatibilityToolInfo { + /** Name of the compatibility tool. */ + strToolName: string; + /** Display name of the compatibility tool. */ + strDisplayName: string; +} + + +/** + * Represents details about a single screenshot upload. + */ +export interface DetailsForScreenshotUpload { + /** + * The size of the screenshot upload on disk (including thumbnail). + */ + strSizeOnDisk: string; + + /** + * The amount of cloud storage available. + */ + strCloudAvailable: string; + + /** + * The total cloud storage. + */ + strCloudTotal: string; +} + +/** + * Represents details about multiple screenshot uploads. + */ +export interface DetailsForScreenshotUploads { + /** + * The total size of all screenshot uploads on disk (sum of sizes including thumbnails). + */ + unSizeOnDisk: number; + + /** + * The amount of cloud storage available. + */ + strCloudAvailable: string; + + /** + * The total cloud storage. + */ + strCloudTotal: string; +} + +export interface WorkshopItem { + unAppID: number; + ulPublishedFileID: string; +} + +export interface AppAchievementData { + rgAchievements: AppAchievement[]; +} + +export interface AppAchievementResponse { + result: number; + data: AppAchievementData; +} + +export interface LaunchOption { + /** + * @remarks This is an integer, despite the prefix. 0 if false, 1 if true. + */ + bIsLaunchOptionTypeExemptFromGameTheater: number; + /** + * @remarks This is an integer, despite the prefix. 0 if false, 1 if true. + */ + bIsVRLaunchOption: number; + eType: AppLaunchOptionType; + nIndex: number; + /** + * Label localization string. + */ + strDescription: string; + strGameName: string; +} + +/** + * Represents playtime information for an application. + */ +export interface Playtime { + /** Total playtime in minutes for the last 2 weeks. */ + nPlaytimeLastTwoWeeks: number; + /** Total playtime in minutes. */ + nPlaytimeForever: number; + /** Last played time in Unix Epoch time format. */ + rtLastTimePlayed: number; +} + +export interface PrePurchaseApp { + nAppID: number; + eState: AppReleaseState; +} + +export interface PrePurchaseInfo { + apps: PrePurchaseApp[]; + lastChangeNumber: number; +} + + +export enum AppReleaseState { + Unknown = 0, + Unavailable = 1, + Prerelease = 2, + PreloadOnly = 3, + Released = 4, + Disabled = 5, +} + +export enum AppLaunchOptionType { + None = 0, + Default = 1, + SafeMode = 2, + Multiplayer = 3, + Config = 4, + OpenVR = 5, + Server = 6, + Editor = 7, + Manual = 8, + Benchmark = 9, + Option1 = 10, + Option2 = 11, + Option3 = 12, + OculusVR = 13, + OpenVROverlay = 14, + OSVR = 15, + OpenXR = 16, + Dialog = 1e3, +} + +export interface Shortcut { + bIsApplication: boolean; + strAppName: string; + strExePath: string; + strArguments: string; + strCmdline: string; + strShortcutPath: string | undefined; + strSortAs: string | undefined; + strIconDataBase64: string | undefined; +} + +export interface SoundtrackDetails { + tracks: Track[]; + metadata: SoundtrackMetadata; + vecAdditionalImageAssetURLs: string[]; + strCoverImageAssetURL: string; +} + +export interface Track { + discNumber: number; + trackNumber: number; + durationSeconds: number; + trackDisplayName: string; +} + +export interface SoundtrackMetadata { + artist: string; +} + +export interface StoreTagLocalization { + tag: number; + string: string; +} + +export interface WorkshopItemDetails { + /** + * Required items' IDs. + */ + children: string[]; + eresult: Result; + /** + * Item size, in byts. + */ + file_size: string; + /** + * Workshop file type. + */ + file_type: WorkshopFileType; + /** + * Item preview image URL. + */ + preview_url: string; + /** + * Item ID. + */ + publishedfileid: string; + /** + * Item description. + */ + short_description: string; + /** + * Item tags. + */ + tags: string[]; + /** + * Item title. + */ + title: string; +} + +export enum WorkshopFileType { + Community = 0, + Microtransaction = 1, + Collection = 2, + Art = 3, + Video = 4, + Screenshot = 5, + Game = 6, + Software = 7, + Concept = 8, + WebGuide = 9, + IntegratedGuide = 10, + Merch = 11, + ControllerBinding = 12, + SteamworksAccessInvite = 13, + SteamVideo = 14, + GameManagedItem = 15, +} + +export interface EndUserLicenseAgreement { + id: string; + url: string; + version: number; +} + +export interface AppBackupStatus { + appid: number; + eError: AppError; + strBytesToProcess: string; + strBytesProcessed: string; + strTotalBytesWritten: string; +} + + +/** + * @remarks Not present in any of the Steam files. This is only present as localization strings, whose tokens start with `#Steam_AppUpdateError_`. + */ +export enum AppError { + None = 0, + Unspecified = 1, + Paused = 2, + Canceled = 3, + Suspended = 4, + NoSubscription = 5, + NoConnection = 6, + Timeout = 7, + MissingKey = 8, + MissingConfig = 9, + DiskReadFailure = 10, + DiskWriteFailure = 11, + NotEnoughDiskSpace = 12, + CorruptGameFiles = 13, + WaitingForNextDisk = 14, + InvalidInstallPath = 15, + AppRunning = 16, + DependencyFailure = 17, + NotInstalled = 18, + UpdateRequired = 19, + Busy = 20, + NoDownloadSources = 21, + InvalidAppConfig = 22, + InvalidDepotConfig = 23, + MissingManifest = 24, + NotReleased = 25, + RegionRestricted = 26, + CorruptDepotCache = 27, + MissingExecutable = 28, + InvalidPlatform = 29, + InvalidFileSystem = 30, + CorruptUpdateFiles = 31, + DownloadDisabled = 32, + SharedLibraryLocked = 33, + PendingLicense = 34, + OtherSessionPlaying = 35, + CorruptDownload = 36, + CorruptDisk = 37, + FilePermissions = 38, + FileLocked = 39, + MissingContent = 40, + Requires64BitOS = 41, + MissingUpdateFiles = 42, + NotEnoughDiskQuota = 43, + LockedSiteLicense = 44, + ParentalControlBlocked = 45, + CreateProcessFailure = 46, + SteamClientOutdated = 47, + PlaytimeExceeded = 48, + CorruptFileSignature = 49, + MissingInstalledFiles = 50, + CompatibilityToolFailure = 51, + UnmountedUninstallPath = 52, + InvalidBackupPath = 53, + InvalidPasscode = 54, + ThirdPartyUpdater = 55, + ParentalPlaytimeExceeded = 56, + Max = 57, +} + +export interface AppDetails { + achievements: AppAchievements; + /** Indicates whether the application is available on the store. */ + bAvailableContentOnStore: boolean; + bCanMoveInstallFolder: boolean; + bCloudAvailable: boolean; + bCloudEnabledForAccount: boolean; + bCloudEnabledForApp: boolean; + bCloudSyncOnSuspendAvailable: boolean; + bCloudSyncOnSuspendEnabled: boolean; + /** Indicates whether the application has community market available. */ + bCommunityMarketPresence: boolean; + bEnableAllowDesktopConfiguration: boolean; + bFreeRemovableLicense: boolean; + bHasAllLegacyCDKeys: boolean; + bHasAnyLocalContent: boolean; + bHasLockedPrivateBetas: boolean; + bIsExcludedFromSharing: boolean; + bIsSubscribedTo: boolean; + bIsThirdPartyUpdater: boolean; + bOverlayEnabled: boolean; + bOverrideInternalResolution: boolean; + bRequiresLegacyCDKey: boolean; + bShortcutIsVR: boolean; + bShowCDKeyInMenus: boolean; + bShowControllerConfig: boolean; + bSupportsCDKeyCopyToClipboard: boolean; + bVRGameTheatreEnabled: boolean; + bWorkshopVisible: boolean; + deckDerivedProperties?: AppDeckDerivedProperties; + eAppOwnershipFlags: AppOwnershipFlags | number; // is this a bitmask? + eAutoUpdateValue: AutoUpdateBehavior; + eBackgroundDownloads: BackgroundDownloadsBehavior; + /** + * @todo enum + */ + eCloudSync: number; + /** + * @todo enum + */ + eControllerRumblePreference: number; // ControllerRumbleSetting? + eDisplayStatus: DisplayStatus; + /** + * @todo enum + */ + eEnableThirdPartyControllerConfiguration: number; + /** + * @todo enum + */ + eSteamInputControllerMask: number; + /** + * Index of the install folder. -1 if not installed. + */ + iInstallFolder: number; + /** Disk space required for installation, in bytes. */ + lDiskSpaceRequiredBytes: number; + /** Application disk space usage, in bytes. */ + lDiskUsageBytes: number; + /** DLC disk space usage, in bytes. */ + lDlcUsageBytes: number; + nBuildID: number; + nCompatToolPriority: number; + /** Total play time, in minutes. */ + nPlaytimeForever: number; + /** Screenshot count. */ + nScreenshots: number; + rtLastTimePlayed: number; + rtLastUpdated: number; + rtPurchased: number; + selectedLanguage: AppLanguage; + strCloudBytesAvailable: string; + strCloudBytesUsed: string; + strCompatToolDisplayName: string; + strCompatToolName: string; + strDeveloperName: string; + strDeveloperURL: string; + strDisplayName: string; + strExternalSubscriptionURL: string; + strFlatpakAppID: string; + strHomepageURL: string; + strLaunchOptions: string; + strManualURL: string; + /** Steam64 ID. */ + strOwnerSteamID: string; + strResolutionOverride: string; + strSelectedBeta: string; + strShortcutExe: string; + strShortcutLaunchOptions: string; + strShortcutStartDir: string; + strSteamDeckBlogURL: string; + unAppID: number; + unEntitledContentApp: number; + unTimedTrialSecondsAllowed: number; + unTimedTrialSecondsPlayed: number; + vecBetas: AppBeta[]; + vecChildConfigApps: number[]; + vecDLC: AppDLC[]; + vecDeckCompatTestResults: DeckCompatTestResult[]; + vecLanguages: AppLanguage[]; + vecLegacyCDKeys: any[]; + vecMusicAlbums: AppSoundtrack[]; + /** windows | osx | linux */ + vecPlatforms: string[]; + vecScreenShots: Screenshot[]; + libraryAssets?: AppLibraryAssets; +} + +export interface AppDeckDerivedProperties { + gamescope_frame_limiter_not_supported?: boolean; + non_deck_display_glyphs: boolean; + primary_player_is_controller_slot_0: boolean; + requires_h264: boolean; + requires_internet_for_setup: boolean; + requires_internet_for_singleplayer: boolean; + requires_manual_keyboard_invoke: false; + requires_non_controller_launcher_nav: false; + small_text: boolean; + supported_input: number; +} + +export enum AppOwnershipFlags { + None = 0, + Subscribed = 1, + Free = 2, + RegionRestricted = 4, + LowViolence = 8, + InvalidPlatform = 16, + Borrowed = 32, + FreeWeekend = 64, + Retail = 128, + Locked = 256, + Pending = 512, + Expired = 1024, + Permanent = 2048, + Recurring = 4096, + Canceled = 8192, + AutoGrant = 16384, + PendingGift = 32768, + RentalNotActivated = 65536, + Rental = 131072, + SiteLicense = 262144, + LegacyFreeSub = 524288, + InvalidOSType = 1048576, + TimedTrial = 2097152, +} + +export enum AutoUpdateBehavior { + Always = 0, // (Always keep this game updated) + Launch = 1, // (Only update this game when I launch it) + HighPriority = 2, // (High priority) +} + +export enum BackgroundDownloadsBehavior { + Pause = 0, + Always = 1, + Never = 2, +} + +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, + OwnerLocked = 37, + DownloadFailed = 38, + UpdateFailed = 39, +} + +export type AppLanguage = { + strDisplayName: string; + /** A localization string for the language. */ + strShortName: string; +}; + +export interface AppBeta { + /** Beta name. */ + strName: string; + /** Beta description. */ + strDescription: string; +} + +export interface AppDLC { + /** Is the DLC availble on the store? */ + bAvailableOnStore: boolean; + bEnabled: boolean; + /** Disk usage, in bytes. */ + lDiskUsageBytes: number; + /** Purchase date. */ + rtPurchaseDate: number; + rtStoreAssetModifyType: number; + /** Store header image filename. */ + strHeaderFilename: string; + /** Display name. */ + strName: string; + /** State (installed/notinstalled). */ + strState: string; + /** App ID. */ + unAppID: number; +} + +export interface DeckCompatTestResult { + // enum ? + test_result: number; + /** A localization string. */ + test_loc_token: string; +} + +export interface AppSoundtrack { + /** Purchase date. */ + rtPurchaseDate: number; + rtStoreAssetModifyType: number; + /** Display name. */ + strName: string; + /** State (installed/notinstalled). */ + strState: string; + /** App ID. */ + unAppID: number; +} + +export interface AppLibraryAssets { + logoPosition?: LogoPosition; + strCapsuleImage: string; + strHeroBlurImage: string; + strHeroImage: string; + strLogoImage: string; +} + +export interface LogoPosition { + pinnedPosition: LogoPinPositions; + nWidthPct: number; + nHeightPct: number; +} + +export type LogoPinPositions = 'BottomLeft' | 'UpperLeft' | 'CenterCenter' | 'UpperCenter' | 'BottomCenter'; + +/** + * @remarks Not present in any of the Steam files, source: https://gist.github.com/Ne3tCode/fc424ae2bd723d9ccb236eeccce66316#file-steammobile_friendsui_enums-steamd-L1308-L1340 + */ +export enum AppLaunchSource { + None = 0, + _2ftLibraryDetails = 100, + _2ftLibraryListView = 101, + _2ftLibraryGrid = 103, + InstallSubComplete = 104, + DownloadsPage = 105, + RemoteClientStartStreaming = 106, + _2ftMiniModeList = 107, + _10ft = 200, + DashAppLaunchCmdLine = 300, + DashGameIdLaunchCmdLine = 301, + RunByGameDir = 302, + SubCmdRunDashGame = 303, + SteamURL_Launch = 400, + SteamURL_Run = 401, + SteamURL_JoinLobby = 402, + SteamURL_RunGame = 403, + SteamURL_RunGameIdOrJumplist = 404, + SteamURL_RunSafe = 405, + TrayIcon = 500, + LibraryLeftColumnContextMenu = 600, + LibraryLeftColumnDoubleClick = 601, + Dota2Launcher = 700, + IRunGameEngine = 800, + DRMFailureResponse = 801, + DRMDataRequest = 802, + CloudFilePanel = 803, + DiscoveredAlreadyRunning = 804, + GameActionJoinParty = 900, + AppPortraitContextMenu = 1000, +} + +export interface NonSteamApp { + bIsApplication: boolean; + strAppName: string; + strExePath: string; + strArguments: string; + strCmdline: string; + strIconDataBase64: string; +} + +export interface LogoPositionForApp { + nVersion: number; // Usually 1 + logoPosition: LogoPosition; +} + +/** + * CLibraryBootstrapData + */ +export interface LibraryBootstrapData extends JsPbMessage { + app_data(): AppBootstrapData[]; + + add_app_data(param0: any, param1: any): any; + + set_app_data(param0: any): any; +} + +export interface AppBootstrapData { + appid: number; + hidden: boolean; + user_tag: string[]; +} + +/** + * CAppOverview_Change + */ +export interface AppOverview_Change extends JsPbMessage { + app_overview(): SteamAppOverview[]; + + full_update(): boolean; + + removed_appid(): number[]; + + update_complete(): boolean; + + add_app_overview(param0: any, param1: any): any; + + add_removed_appid(param0: any, param1: any): any; + + set_app_overview(param0: any): any; + + set_full_update(param0: any): any; + + set_removed_appid(param0: any): any; + + set_update_complete(param0: any): any; +} + +// Appears to be all optional fields :disaster: +export interface SteamAppOverview { + appid: number; + display_name: string; + visible_in_game_list: boolean; + sort_as: string; + + /* + * Possible bitmask values, but I haven't spotted any of them being masked in the app_type field. + * Should be safe as an enum. + */ + app_type: AppType; + mru_index: number | undefined; + rt_recent_activity_time: number; + minutes_playtime_forever: number; + minutes_playtime_last_two_weeks: number; + rt_last_time_played_or_installed: number; + rt_last_time_played: number; + store_tag?: number[]; + association: SteamAppOverviewAssociation[]; + store_category?: number[]; + rt_original_release_date: number; + rt_steam_release_date: number; + icon_hash: string; + controller_support?: AppControllerSupportLevel; // default none + vr_supported?: boolean; + metacritic_score: number; + size_on_disk?: number; + third_party_mod?: boolean; + icon_data?: string; + icon_data_format?: string; + gameid: string; + library_capsule_filename?: string; + per_client_data: SteamAppOverviewClientData[]; + most_available_clientid: string; + selected_clientid?: string; + rt_store_asset_mtime: number; + rt_custom_image_mtime?: number; + optional_parent_app_id?: number; + owner_account_id?: number; + review_score_with_bombs: number; + review_percentage_with_bombs: number; + review_score_without_bombs: number; + review_percentage_without_bombs: number; + library_id?: string; + vr_only?: boolean; + mastersub_appid?: number; + mastersub_includedwith_logo?: string; + site_license_site_name?: string; + shortcut_override_appid?: number; + steam_deck_compat_category: SteamDeckCompatibilityCategory; // Default should be Unknown + rt_last_time_locally_played?: number; + rt_purchased_time: number; + header_filename?: string; + local_cache_version?: number; + ps4_controller_support?: AppControllerSupportLevel; + ps5_controller_support?: AppControllerSupportLevel; + gamepad_preferred?: boolean; + + m_setStoreCategories: Set<number>; + m_setStoreTags: Set<number>; + canonicalAppType: number; + local_per_client_data: SteamAppOverviewClientData; + most_available_per_client_data: SteamAppOverviewClientData; + selected_per_client_data: SteamAppOverviewClientData; + m_strPerClientData: Set<any> | undefined; + m_strAssociations: Set<any> | undefined; + + BIsModOrShortcut: () => boolean; + BIsShortcut: () => boolean; +} + +export enum AppType { + DepotOnly = -2147483648, + Invalid = 0, + Game = 1, + Application = 2, + Tool = 4, + Demo = 8, + Deprecated = 16, + DLC = 32, + Guide = 64, + Driver = 128, + Config = 256, + Hardware = 512, + Franchise = 1024, + Video = 2048, + Plugin = 4096, + MusicAlbum = 8192, + Series = 16384, + Comic = 32768, + Beta = 65536, + Shortcut = 1073741824, +} + +export interface SteamAppOverviewAssociation { + type: AppAssociationType; // Default should be Invalid + name: string; +} + +export enum AppAssociationType { + Invalid = 0, + Publisher = 1, + Developer = 2, + Franchise = 3, +} + +export enum AppControllerSupportLevel { + None = 0, + Partial = 1, + Full = 2, +} + +export interface SteamAppOverviewClientData { + clientid: string; + client_name: string; + display_status: DisplayStatus; // Default should be Invalid + status_percentage: number; + active_beta?: string; + installed?: boolean; + bytes_downloaded: string; + bytes_total: string; + streaming_to_local_client?: boolean; + is_available_on_current_platform: boolean; + is_invalid_os_type?: boolean; + playtime_left?: number; + cloud_status: AppCloudStatus; +} + +export enum SteamDeckCompatibilityCategory { + Unknown = 0, + Unsupported = 1, + Playable = 2, + Verified = 3, +} + +export enum AppCloudStatus { + Invalid = 0, + Disabled = 1, + Unknown = 2, + Synchronized = 3, + Checking = 4, + OutOfSync = 5, + Uploading = 6, + Downloading = 7, + SyncFailed = 8, + Conflict = 9, + PendingElsewhere = 10, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Auth.ts b/src/deck-components/steam-client/Auth.ts new file mode 100644 index 00000000..b965ac97 --- /dev/null +++ b/src/deck-components/steam-client/Auth.ts @@ -0,0 +1,85 @@ +import {JsPbMessage} from "./index"; +import {OSType} from "./system"; + +export interface Auth { + GetLocalHostname(): Promise<string>; + + /** + * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link Authentication_DeviceDetails}. + */ + GetMachineID(): Promise<ArrayBuffer>; + + GetRefreshInfo(): Promise<AuthRefreshInfo>; + + GetSteamGuardData(param0: any): any; + + IsSecureComputer(): Promise<boolean>; + + SetLoginToken(refreshToken: string, accountName: string): any; + + SetSteamGuardData(accountName: string, newGuardData: string): any; + + StartSignInFromCache(param0: any, login: string): Promise<any>; +} + +export interface AuthRefreshInfo { + reason: number; + account_name: string; + login_id_token: string; +} + +/** + * CAuthentication_DeviceDetails + * + * `deserializeBinary` argument: + * ``` + * [ + * await SteamClient.System.GetOSType(), + * await SteamClient.Auth.GetLocalHostname(), + * await SteamClient.Auth.GetMachineID(), + * ]; + * ``` + */ +export interface Authentication_DeviceDetails extends JsPbMessage { + client_count(): number | undefined; + + device_friendly_name(): string | undefined; + + gaming_device_type(): GamingDeviceType | undefined; + + machine_id(): Uint8Array | string; + + os_type(): OSType | undefined; + + platform_type(): AuthTokenPlatformType | undefined; + + set_client_count(): any; + + set_device_friendly_name(): any; + + set_gaming_device_type(): any; + + set_machine_id(): any; + + set_os_type(): any; + + set_platform_type(): any; +} + +export enum AuthTokenPlatformType { + Unknown = 0, + SteamClient = 1, + WebBrowser = 2, + MobileApp = 3, +} + +export enum GamingDeviceType { + Unknown = 0, + StandardPC = 1, + Console = 256, + PS3 = 272, + Steambox = 288, + Handheld = 512, + Phone = 528, + SteamDeck = 544, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Broadcast.ts b/src/deck-components/steam-client/Broadcast.ts new file mode 100644 index 00000000..9a32357b --- /dev/null +++ b/src/deck-components/steam-client/Broadcast.ts @@ -0,0 +1,60 @@ +import {Result, Unregisterable} from "./index"; + +export interface Broadcast { + /** + * Approves a viewer request for the broadcast. + * @param {string} steamId64 - The SteamID64 of the user whose request is to be approved. + * @param {number} param1 - Unknown parameter. + */ + ApproveViewerRequest(steamId64: string, param1: number): void; + + /** + * Invites a user identified by their SteamID64 to watch the broadcast. + * @param {string} steamId64 - The SteamID64 of the user to invite. + * @returns {Promise<number>} - A Promise indicating the result of the invitation (1 for success, 2 for error). + */ + InviteToWatch(steamId64: string): Promise<number>; + + /** + * Registers a callback to be called when the broadcast status changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForBroadcastStatus(callback: (broadcastStatus: BroadcastStatus) => void): Unregisterable | any; + + /** + * Registers a callback to be called when viewer requests are received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForViewerRequests( + callback: (viewerFriendCode: number, param1: number, param2: number) => void, + ): Unregisterable | any; + + /** + * Rejects a viewer request for the broadcast. + * @param {string} steamId64 - The SteamID64 of the user whose request is to be rejected. + * @param {number} param1 - Unknown parameter. + */ + RejectViewerRequest(steamId64: string, param1: number): void; + + /** + * Stops the broadcast. + * @returns {void} + */ + StopBroadcasting(): void; +} + +export interface BroadcastStatus { + broadcastid: string; + nViewers: number; + nRequests: number; + bIsBroadcasting: boolean; + bIsRecordingDesktop: boolean; + eBroadcastReady: Result; + bBroadcastCapable: boolean; + bMicrophoneEnabled: boolean; + bMicrophoneActive: boolean; + nCurrentFPS: number; + nUploadKbps: number; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Browser.ts b/src/deck-components/steam-client/Browser.ts new file mode 100644 index 00000000..abfda5d5 --- /dev/null +++ b/src/deck-components/steam-client/Browser.ts @@ -0,0 +1,87 @@ +import {Unregisterable} from "./index"; + +export interface Browser { + AddWordToDictionary(word: string): void; + + ClearAllBrowsingData(): void; + + ClearHistory(): void; + + CloseDevTools(): void; + + GetBrowserID(): Promise<number>; + + GetSpellingSuggestions(word: string): string[]; + + GetSteamBrowserID(): Promise<number>; // 16-bit unsigned integer? + + /** + * Hides the mouse cursor until input. + * @returns {void} + */ + HideCursorUntilMouseEvent(): void; + + InspectElement(clientY: number, clientX: number): void; // yup that's right, clientY and clientX are reversed + + NotifyUserActivation(): void; + + OpenDevTools(): void; + + /** + * Pastes the clipboard contents. + */ + Paste(): void; + + /** + * @todo unconfirmed + */ + RegisterForGestureEvents(callback: (gesture: TouchGesture) => void): Unregisterable | any; + + RegisterForOpenNewTab: Unregisterable | any; + + ReplaceMisspelling: any; + + /** + * Restarts the browser. + * @returns {void} + */ + RestartJSContext(): void; + + SetBackgroundThrottlingDisabled(value: boolean): void; + + SetPendingFilePath(path: string): Promise<boolean>; + + SetShouldExitSteamOnBrowserClosed(value: boolean): any; + + SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; + + /** + * Prompts and downloads a file. + * @param {string} url - The URL of the file to download. + * @returns {void} + */ + StartDownload(url: string): void; +} + +export interface TouchGesture { + eTouchGesture: TouchGestureType; + x: number; + y: number; +} + +export enum TouchGestureType { + None = 0, + Touch = 1, + Tap = 2, + DoubleTap = 3, + ShortPress = 4, + LongPress = 5, + LongTap = 6, + TwoFingerTap = 7, + TapCancelled = 8, + PinchBegin = 9, + PinchUpdate = 10, + PinchEnd = 11, + FlingStart = 12, + FlingCancelled = 13, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/ClientNotifications.ts b/src/deck-components/steam-client/ClientNotifications.ts new file mode 100644 index 00000000..7e0bd1ca --- /dev/null +++ b/src/deck-components/steam-client/ClientNotifications.ts @@ -0,0 +1,21 @@ +export interface ClientNotifications { + /** + * Displays a Steam notification. + * @param {ClientUINotification} notification - Notification type. + * @param {string} options - Stringified object of `NotificationOptions`. + * @param {function} callback + */ + DisplayClientNotification(notification: ClientUINotification, options: string, callback: any): void; + + /** + * @param notificationId The ID of the notification to handle. + * @param handleAction `true` to habdle the associated notification action, `false` otherwise. + */ + OnRespondToClientNotification(notificationId: number, handleAction: boolean): void; +} + +export enum ClientUINotification { + GroupChatMessage = 1, + FriendChatMessage = 2, + FriendPersonaState = 3, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Cloud.ts b/src/deck-components/steam-client/Cloud.ts new file mode 100644 index 00000000..f4141d8d --- /dev/null +++ b/src/deck-components/steam-client/Cloud.ts @@ -0,0 +1,16 @@ +export interface Cloud { + /** + * Resolves a synchronization conflict for an app in the cloud. + * @param {number} appId - The ID of the app with the sync conflict. + * @param {boolean} keepLocal - Whether to keep the local version during conflict resolution. + * @returns {any} - Returns data related to resolving the sync conflict. + */ + ResolveAppSyncConflict(appId: number, keepLocal: boolean): void; + + /** + * Retries syncing an app with the cloud. + * @param {number} appId - The ID of the app to retry syncing. + * @returns {any} - Returns data related to retrying the app sync. + */ + RetryAppSync(appId: number): void; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/CommunityItems.ts b/src/deck-components/steam-client/CommunityItems.ts new file mode 100644 index 00000000..8c27aee5 --- /dev/null +++ b/src/deck-components/steam-client/CommunityItems.ts @@ -0,0 +1,24 @@ +export interface CommunityItems { + /* + DownloadMovie(e) { + return (0, o.mG)(this, void 0, void 0, (function* () { + if (0 != e.movie_webm_local_path.length) return !0; + let t = yield SteamClient.CommunityItems.DownloadItemAsset(e.communityitemid, w, e.movie_webm), + n = 1 == t.result; + if (n) { + e.movie_webm_local_path = t.path; + let n = []; + this.m_startupMovies.forEach((t => { + t.movie_webm == e.movie_webm ? n.push(e) : n.push(t) + })), this.m_startupMovies = n + } + return n + })) + } + */ + DownloadItemAsset(communityItemId: string, param1: any, param2: string): any; + + GetItemAssetPath(communityItemId: string, param1: any, param2: string): any; + + RemoveDownloadedItemAsset(communityItemId: string, param1: any, param2: string): any; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Console.ts b/src/deck-components/steam-client/Console.ts new file mode 100644 index 00000000..ff7d94bb --- /dev/null +++ b/src/deck-components/steam-client/Console.ts @@ -0,0 +1,42 @@ +import {Unregisterable} from "./index"; + +/** + * Represents the console functionality for executing commands and handling spew output. + */ +export interface Console { + /** + * Executes a console command. + * @param {string} command - The command to execute in the console. + * @returns {void} + */ + ExecCommand(command: string): void; + + /** + * Retrieves autocomplete suggestions for a given console command. + * @param {string} command - The console command to provide autocomplete suggestions for. + * @returns {Promise<string[]>} - A Promise that resolves to an array of autocomplete suggestions. + */ + GetAutocompleteSuggestions(command: string): Promise<string[]>; + + /** + * Registers a callback function to receive spew output. + * @param {function} callback - The callback function that will receive spew output. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForSpewOutput(callback: (spewOutput: SpewOutput) => void): Unregisterable | any; +} + +/** + * Represents spew output information. + */ +export interface SpewOutput { + /** + * The content of the spew output. + */ + spew: string; + + /** + * The type or category of the spew output. + */ + spew_type: "error" | "info" | "input"; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Customization.ts b/src/deck-components/steam-client/Customization.ts new file mode 100644 index 00000000..854b2836 --- /dev/null +++ b/src/deck-components/steam-client/Customization.ts @@ -0,0 +1,12 @@ +export interface Customization { + GenerateLocalStartupMoviesThumbnails(param0: number): Promise<number>; + + //param0: "startupmovies" + GetDownloadedStartupMovies(param0: string): Promise<StartupMovie[]>; + + GetLocalStartupMovies(): Promise<StartupMovie[]>; +} + +export interface StartupMovie { + strMovieURL: string; +} diff --git a/src/deck-components/steam-client/Downloads.ts b/src/deck-components/steam-client/Downloads.ts new file mode 100644 index 00000000..b2c4ad15 --- /dev/null +++ b/src/deck-components/steam-client/Downloads.ts @@ -0,0 +1,185 @@ +import {Unregisterable} from "./index"; +import {AppError} from "./App"; + +/** + * Represents functions related to managing downloads in Steam. + */ +export interface Downloads { + /** + * Enables or disables all downloads in Steam. + * @param {boolean} enable - True to enable downloads, false to disable. + */ + EnableAllDownloads(enable: boolean): void; + + /** + * Moves the update for a specific app down the download queue. + * @param {number} appId - The ID of the application to move. + * @returns {void} + */ + MoveAppUpdateDown(appId: number): void; + + /** + * Moves the update for a specific app up the download queue. + * @param {number} appId - The ID of the application to move. + * @returns {void} + */ + MoveAppUpdateUp(appId: number): void; + + PauseAppUpdate(appId: number): void; // Broken? It seems to be removing it from download list like RemoveFromDownloadList + + /** + * Adds the update for a specific app to the download queue. + * @param {number} appId - The ID of the application to queue. + * @returns {void} + */ + QueueAppUpdate(appId: number): void; + + /** + * Registers a callback function to be called when download items change. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDownloadItems( + callback: (isDownloading: boolean, downloadItems: DownloadItem[]) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when download overview changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDownloadOverview(callback: (downloadOverview: DownloadOverview) => void): Unregisterable | any; + + /** + * Removes the update for a specific app from the download list and places it in the unscheduled list. + * @param {number} appId - The ID of the application to remove. + * @returns {void} + */ + RemoveFromDownloadList(appId: number): void; + + /** + * Resumes the update for a specific app in the queue. + * @param {number} appId - The ID of the application to resume. + * @returns {void} + */ + ResumeAppUpdate(appId: number): void; + + /** + * Sets an app to launch when its download is complete. + * @param {number} appId - The ID of the application to set. + * @returns {void} + * @todo: unsure if this toggles though + */ + SetLaunchOnUpdateComplete(appId: number): void; + + /** + * Sets the queue index for an app in the download queue. + * @param {number} appId - The ID of the application to set the index for. + * @param {number} index - The index to set. + * @returns {void} + * @remarks Index of 0 is the current download in progress. + */ + SetQueueIndex(appId: number, index: number): void; + + /** + * Suspends or resumes download throttling. + * @param {boolean} suspend - Whether to suspend or resume download throttling. + * @returns {void} + */ + SuspendDownloadThrottling(suspend: boolean): void; + + /** + * Suspends or resumes local transfers. + * @param {boolean} suspend - Whether to suspend or resume local transfers. + * @returns {void} + */ + SuspendLanPeerContent(suspend: boolean): void; +} + +export interface DownloadItem { + /** True if this app is currently downloading */ + active: boolean; + /** Appid of app */ + appid: number; + /** Current build ID for the installed app, zero if the app isn't installed yet */ + buildid: number; + /** True if this update has been completed */ + completed: boolean; + /** For completed downloads, time of completion, 0 if not completed */ + completed_time: number; + deferred_time: number; + /** Bytes already downloaded, sum across all content types */ + downloaded_bytes: number; + /** If true, game will launch when its download completes successfully */ + launch_on_completion: boolean; + /** True if this app has been paused by the user or the system */ + paused: boolean; + /** Queue index, -1 if the item is unqueued */ + queue_index: number; + /** Build ID that this download is moving towards. This can be the same as buildid.*/ + target_buildid: number; + /** Total bytes to download, sum across all content types */ + total_bytes: number; + /** + * Update error description, when paused and there has been an error. + * Unlocalized and shouldn't be displayed to the user. + */ + update_error: string; + update_result: AppError; + update_type_info: UpdateTypeInfo[]; +} + +export interface DownloadOverview { + /** Set if we are downloading from LAN peer content server */ + lan_peer_hostname: string; + /** True if all downloads are paused */ + paused: boolean; + /** True if download throttling has been temporarily suspended for the current download */ + throttling_suspended: boolean; + /** Appid of currently updating app */ + update_appid: number; + /** Bytes already downloaded */ + update_bytes_downloaded: number; + /** Bytes already processed in current phase - resets to zero when update stage changes */ + update_bytes_processed: number; + /** Bytes already staged */ + update_bytes_staged: number; + /** Total bytes to download */ + update_bytes_to_download: number; + /** Total bytes to process in current phase - resets to zero when update stage changes */ + update_bytes_to_process: number; + /** Total bytes to be staged */ + update_bytes_to_stage: number; + /** Current disk throughput estimate */ + update_disc_bytes_per_second: number; + /** True if the current update is an initial install */ + update_is_install: boolean; + /** True if download and staging sizes are prefetch estimates */ + update_is_prefetch_estimate: boolean; + /** True if the current update is for shader update */ + update_is_shader: boolean; + /** True if the client is running in peer content server mode serving other peers */ + update_is_upload: boolean; + /** True if the current update is for workshop content */ + update_is_workshop: boolean; + /** Current bandwidth estimate for download */ + update_network_bytes_per_second: number; + /** Peak bandwidth estimate for download */ + update_peak_network_bytes_per_second: number; + /** Estimate of remaining time (in seconds) until download completes (not including staging) */ + update_seconds_remaining: number; + /** Time current update started */ + update_start_time: number; + update_state: 'None' | 'Starting' | 'Updating' | 'Stopping'; +} + +export interface UpdateTypeInfo { + /** True if this content type had an update and it has completed */ + completed_update: boolean; + /** Bytes already downloaded for this content type */ + downloaded_bytes: number; + /** True if this content type has or had an update */ + has_update: boolean; + /** Total bytes to download for this content type */ + total_bytes: number; +} diff --git a/src/deck-components/steam-client/FamilySharing.ts b/src/deck-components/steam-client/FamilySharing.ts new file mode 100644 index 00000000..8b3265bc --- /dev/null +++ b/src/deck-components/steam-client/FamilySharing.ts @@ -0,0 +1,44 @@ +/** + * Represents functions related to Steam Family Sharing. + */ +export interface FamilySharing { + /** + * Authorizes library sharing on the local device. + * @returns {Promise<number>} A Promise that resolves to a status code. + * FamilySettings_SteamGuardRequired - 18 + * FamilySettings_LimitExceeded - 25 + * FamilySettings_FailedToAuthorize - any other number + */ + AuthorizeLocalDevice(): Promise<number>; + + /** + * Deauthorizes library sharing on the local device. + * @returns {Promise<number>} A Promise that resolves to a status code. + */ + DeauthorizeLocalDevice(): Promise<number>; + + GetAvailableLenders(appId: number): Promise<Lender[]>; + + GetFamilyGroupInfo(): Promise<string>; + + RegisterForKickedBorrower: any; + + RequestLocalDeviceAuthorization(steam64Id: string): Promise<number>; + + SetPreferredLender(appId: number, param1: number): Promise<number>; + + // param0 - account id? + // return FamilySettings_TooManyBorrowers - 25, FamilySettings_FailedToUpdateBorrower - any number that's not 1 or previous + UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise<number>; +} + +export interface Lender { + /** + * A Steam64 ID. + */ + steamid: string; + appid: number; + numDlc: number; + bPreferred: boolean; + vecDLC: any[]; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/FriendSettings.ts b/src/deck-components/steam-client/FriendSettings.ts new file mode 100644 index 00000000..746986b0 --- /dev/null +++ b/src/deck-components/steam-client/FriendSettings.ts @@ -0,0 +1,69 @@ +import {Unregisterable} from "./index"; + +/** + * Represents friend settings and configuration. + */ +export interface FriendSettings { + /** + * Retrieves a list of enabled friend settings features. + * @returns {Promise<FriendSettingsFeature[]>} - A Promise that resolves to an array of enabled friend settings features. + */ + GetEnabledFeatures(): Promise<FriendSettingsFeature[]>; + + /** + * Registers a callback function to be notified of friend settings changes. + * @param callback - The callback function to be called when friend settings change. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @remarks The callback receives an escaped JSON object string as "settingsChanges", which should be parsed into {@link FriendSettingsChange} object. + */ + RegisterForSettingsChanges(callback: (settingsChanges: string) => void): Unregisterable | any; + + SetFriendSettings(details: string): any; // stringified object +} + +export interface FriendSettingsFeature { + feature: string; + bEnabled: boolean; +} + +export interface FriendSettingsEnabledFeature { + DoNotDisturb: number; + LoaderWindowSynchronization: number; + NonFriendMessageHandling: number; + NewVoiceHotKeyState: number; + PersonaNotifications: number; + ServerVirtualizedMemberLists: number; + SteamworksChatAPI: number; + FriendsFilter: number; +} + +export interface FriendSettingsChange { + bNotifications_ShowIngame: number; + bNotifications_ShowOnline: number; + bNotifications_ShowMessage: number; + bNotifications_EventsAndAnnouncements: number; + bSounds_PlayIngame: number; + bSounds_PlayOnline: number; + bSounds_PlayMessage: number; + bSounds_EventsAndAnnouncements: number; + bAlwaysNewChatWindow: number; + bForceAlphabeticFriendSorting: number; + nChatFlashMode: number; + bRememberOpenChats: number; + bCompactQuickAccess: number; + bCompactFriendsList: number; + bNotifications_ShowChatRoomNotification: number; + bSounds_PlayChatRoomNotification: number; + bHideOfflineFriendsInTagGroups: number; + bHideCategorizedFriends: number; + bCategorizeInGameFriendsByGame: number; + nChatFontSize: number; + b24HourClock: number; + bDoNotDisturbMode: number; + bDisableEmbedInlining: number; + bSignIntoFriends: number; + bDisableSpellcheck: number; + bDisableRoomEffects: number; + bAnimatedAvatars: number; + featuresEnabled: FriendSettingsEnabledFeature; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Friends.ts b/src/deck-components/steam-client/Friends.ts new file mode 100644 index 00000000..5a140f55 --- /dev/null +++ b/src/deck-components/steam-client/Friends.ts @@ -0,0 +1,51 @@ +/** + * Represents functions related to managing friends in Steam. + */ +export interface Friends { + /** + * Adds a user to the friend list. + * @param {string} steamId - The Steam ID of the user to add as a friend. + * @returns {Promise<boolean>} A Promise that resolves to true if the friend was added successfully, false otherwise. + */ + AddFriend(steamId: string): Promise<boolean>; + + GetCoplayData(): Promise<CoplayData>; + + //(e.ConvertTo64BitString(), t.steamidTarget) + InviteUserToCurrentGame(param0: any, param1: any): any; + + /** + * Invites a user to a specific game. + * @param {string} steamId - The Steam ID of the user to invite. + * @param {number} appId - The ID of the game to invite the user to. + * @param {string} connectString - Additional parameters for the invitation. + * @returns {Promise<boolean>} A Promise that resolves to true if the user was invited successfully, false otherwise. + */ + InviteUserToGame(steamId: string, appId: number, connectString: string): Promise<boolean>; + + //(e.ConvertTo64BitString(), t.steamidTarget) + InviteUserToLobby(param0: any, param1: any): any; + + //(e.ConvertTo64BitString()) + InviteUserToRemotePlayTogetherCurrentGame(param0: any): any; + + RegisterForVoiceChatStatus(callback: (status: any) => void): any; + + /** + * Removes a user from the friend list. + * @param {string} steamId - The Steam ID of the user to remove from the friend list. + * @returns {Promise<boolean>} A Promise that resolves to true if the friend was removed successfully, false otherwise. + */ + RemoveFriend(steamId: string): Promise<boolean>; +} + +export interface CoplayData { + currentUsers: CoplayUser[]; + recentUsers: CoplayUser[]; +} + +export interface CoplayUser { + accountid: number; + rtTimePlayed: number; + appid: number; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/GameNotes.ts b/src/deck-components/steam-client/GameNotes.ts new file mode 100644 index 00000000..e9820aa1 --- /dev/null +++ b/src/deck-components/steam-client/GameNotes.ts @@ -0,0 +1,30 @@ +export interface GameNotes { + DeleteImage(param0: any): any; + + DeleteNotes: any; + /* + FilenameForNotes(e) { + return "appid" in e ? `notes_${Number(e.appid)}` : `notes_shortcut_${h(e.shortcut)}` + } + DirectoryForNoteImages(e) { + return "appid" in e ? `notes_${Number(e.appid)}_images/` : `notes_shortcut_${h(e.shortcut)}_images/` + } + */ + // {"result":1,"notes":"<escaped json>"} + // <escaped json> example: {"notes":[{"id":"lmuudzqn","appid":1716740,"ordinal":0,"time_created":1695401684,"time_modified":1695403395,"title":"Old Earth Cuisine 1:","content":"[h1]Old Earth Cuisine 1:[/h1][list][*][p]Red Meat[/p][/*][/list][h1]Beverage Development 2:[/h1][list][*][p]Tranquilitea Sunray[/p][/*][/list][p][/p]"}]} + GetNotes(filenameForNotes: string, directoryForNoteImages: string): Promise<any>; + + GetNotesMetadata: any; + GetNumNotes: any; + GetQuota: any; + + IterateNotes(appId: number, length: number): any; // Results array of {"result":1,"filename":"","filesize":0,"timestamp":0} + ResolveSyncConflicts: any; + + SaveNotes(filenameForNotes: string, param1: string): Promise<any>; // param1 - notes like escaped json in GetNotes + SyncToClient(): Promise<any>; + + SyncToServer(): Promise<any>; + + UploadImage: any; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/GameSessions.ts b/src/deck-components/steam-client/GameSessions.ts new file mode 100644 index 00000000..11946fae --- /dev/null +++ b/src/deck-components/steam-client/GameSessions.ts @@ -0,0 +1,57 @@ +import {Unregisterable} from "./index"; +import {AppAchievements, Screenshot} from "./App"; + +/** + * Represents functions related to Steam Game Sessions. + */ +export interface GameSessions { + /** + * Registers a callback function to be called when an achievement notification is received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAchievementNotification( + callback: (achievementNotification: AchievementNotification) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when an app lifetime notification is received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppLifetimeNotifications( + callback: (appLifetimeNotification: AppLifetimeNotification) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a screenshot notification is received. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForScreenshotNotification( + callback: (screenshotNotification: ScreenshotNotification) => void, + ): Unregisterable | any; +} + +export interface AchievementNotification { + achievement: AppAchievements; + nCurrentProgress: number; + nMaxProgress: number; + unAppID: number; +} + +/** + * @prop unAppID is not properly set by Steam for non-steam game shortcuts, so it defaults to 0 for them + */ +export interface AppLifetimeNotification { + unAppID: number; + nInstanceID: number; + bRunning: boolean; +} + +export interface ScreenshotNotification { + details: Screenshot; + hScreenshot: number; + strOperation: "deleted" | "written"; + unAppID: number; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Input.ts b/src/deck-components/steam-client/Input.ts new file mode 100644 index 00000000..ecc3835a --- /dev/null +++ b/src/deck-components/steam-client/Input.ts @@ -0,0 +1,747 @@ +import {Unregisterable} from "./index"; + +/** + * Represents functions related to input and controllers in Steam. + */ +export interface Input { + CalibrateControllerIMU(controllerIndex: any): any; + + CalibrateControllerJoystick(controllerIndex: any): any; + + CalibrateControllerTrackpads(controllerIndex: any): any; + + CancelGyroSWCalibration(): any; + + ClearSelectedConfigForApp(appId: number, controllerIndex: number): any; + + CloseDesktopConfigurator: any; + + /** + * Writes text. + * @param {string} textToWrite - The text to write. + * @returns {void} + */ + ControllerKeyboardSendText(textToWrite: string): void; + + /** + * Sets a specified key's pressed state. + * @param {HIDKeyboardKey} keyIndex - The key index to set the state for. + * @param {boolean} state - true for pressed, false otherwise. + * @returns {void} + * @example + * Send paste command: + * ``` + * SteamClient.Input.ControllerKeyboardSetKeyState(EHIDKeyboardKey.LControl, true); + * SteamClient.Input.ControllerKeyboardSetKeyState(EHIDKeyboardKey.V, true); + * SteamClient.Input.ControllerKeyboardSetKeyState(EHIDKeyboardKey.V, false); + * SteamClient.Input.ControllerKeyboardSetKeyState(EHIDKeyboardKey.LControl, false); + * ``` + */ + ControllerKeyboardSetKeyState(keyIndex: HIDKeyboardKey, state: boolean): void; + + DeauthorizeControllerAccount: any; + + DecrementCloudedControllerConfigsCounter(): any; + + DeletePersonalControllerConfiguration(param0: any): any; + + //f.Debug("sending to client"), this.SetEditingConfigurationValue(e, t, c.QU, (e => SteamClient.Input.DuplicateControllerConfigurationSourceMode(this.m_unControllerIndex, e))), this.SaveEditingConfiguration(e), this + DuplicateControllerConfigurationSourceMode(controllerIndex: number, param1: any): any; + + EndControllerDeviceSupportFlow(): any; + + ExportCurrentControllerConfiguration(controllerIndex: number, appId: number, param2: number, title: string, description: string, param5: string): Promise<any>; + + ForceConfiguratorFocus(param0: boolean): any; + + ForceSimpleHapticEvent(param0: number, param1: number, param2: number, param3: number, param4: number): any; + + FreeControllerConfig(m_ChordSummaryConfiguration: any): any; + + GetConfigForAppAndController(appId: number, unControllerIndex: number): any; + + /** + * Retrieves the controller mapping string for the specified controller index. + * @param {number} unControllerIndex - The controller index. + * @returns {Promise<string>} - A Promise that resolves to the controller mapping string. + */ + GetControllerMappingString(unControllerIndex: number): Promise<string>; + + GetControllerPreviouslySeen(): Promise<number[]>; + + GetSteamControllerDongleState(): Promise<boolean>; + + GetTouchMenuIconsForApp(appId: number): Promise<any>; + + GetXboxDriverInstallState(): Promise<any>; // "{"nResult":0}" + IdentifyController(controllerIndex: number): any; + + InitControllerSounds(): any; + + InitializeControllerPersonalizationSettings(controllerIndex: number): any; + + ModalKeyboardDismissed(): void; + + OpenDesktopConfigurator: any; + + PreviewConfigForAppAndController(appId: number, controllerIndex: number, workshopUri: string): any; + + PreviewControllerLEDColor(flHue: number, flSaturation: number, flBrightness: number): any; + + QueryControllerConfigsForApp(appId: number, controllerIndex: number, param2: boolean): any; + + RegisterForActiveControllerChanges: Unregisterable | any; // {"nActiveController":0} + //param0 - e possibly appid? + //param1 - some index? + RegisterForConfigSelectionChanges(callback: (param0: number, param1: number) => void): Unregisterable | any; + + RegisterForControllerAccountChanges: Unregisterable | any; + + RegisterForControllerAnalogInputMessages( + callback: (controllerAnalogInputMessages: ControllerAnalogInputMessage[]) => void, + ): Unregisterable | any; + + RegisterForControllerCommandMessages( + callback: (controllerCommandMessage: ControllerCommandMessage) => void, + ): Unregisterable | any; + + /** + * Registers a callback for changes in controller configuration cloud state. + * @param {(controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void} callback - The callback function for config cloud state changes. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForControllerConfigCloudStateChanges( + callback: (controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void, + ): Unregisterable | any; + + /** + * Registers a callback for receiving controller configuration info messages (controller layouts query, personal controller layout query). + * @param {(controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[]) => void} callback - The callback function for controller config info messages. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @remarks Do Not Use, this will break the controller layout selection unless you know what you are doing. + */ + RegisterForControllerConfigInfoMessages( + callback: ( + controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[], + ) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be invoked when controller input messages are received. + * @param {(controllerInputMessages: ControllerInputMessage[]) => void} callback - The callback function to be invoked when controller input messages are received. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForControllerInputMessages( + callback: (controllerInputMessages: ControllerInputMessage[]) => void, + ): Unregisterable | any; + + RegisterForControllerListChanges(callback: (controllerListChanges: ControllerInfo[]) => void): Unregisterable | any; + + /** + * Registers a callback for changes in the controller state (buttons presses, triggers presses, joystick changes etc...). + * @param {(controllerStateChanges: ControllerStateChange[]) => void} callback - The callback function for controller state changes. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForControllerStateChanges( + callback: (controllerStateChanges: ControllerStateChange[]) => void, + ): Unregisterable | any; + + RegisterForDualSenseUpdateNotification(callback: (m_strDualSenseUpdateProduct: string) => void): Unregisterable | any; + + /** + * Registers a callback for receiving game keyboard messages (text field popup for inputting text for games when in character creation or etc...). + * @param {(gameKeyboardMessage: GameKeyboardMessage) => void} callback - The callback function for game keyboard messages. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForGameKeyboardMessages(callback: (gameKeyboardMessage: GameKeyboardMessage) => void): Unregisterable | any; + + RegisterForRemotePlayConfigChanges(callback: () => void): Unregisterable | any; + + //data.appId, data.ulConfigId + RegisterForShowControllerLayoutPreviewMessages(callback: (data: any) => void): Unregisterable | any; + + /* + onTouchMenuInput(e) { + for (let t = 0; t < e.length; t++) { + const n = this.TouchMenuGetKey(e[t]), o = this.m_mapActiveTouchMenus.get(n); + void 0 !== o && o.updateTouchMenuState(e[t]) + } + } + */ + RegisterForTouchMenuInputMessages(callback: (inputs: number[]) => void): Unregisterable | any; + + RegisterForTouchMenuMessages(callback: (touchMenuMessage: TouchMenuMessage) => void): Unregisterable | any; + + //param0 - index? + RegisterForUIVisualization(param0: any, param1: any, param2: any): Unregisterable | any; + + RegisterForUnboundControllerListChanges(callback: (m_unboundControllerList: any) => void): Unregisterable | any; // param0 is an array + + /* + OnDismissKeyboardMessage(e) { + this.m_WindowStore.SteamUIWindows.forEach((e => e.VirtualKeyboardManager.SetVirtualKeyboardHidden(e.BrowserWindow))) + } + */ + RegisterForUserDismissKeyboardMessages(callback: (param0: any) => void): Unregisterable | any; + + RegisterForUserKeyboardMessages: Unregisterable | any; + + RequestGyroActive(controllerIndex: number, param1: boolean): any; + + RequestRemotePlayControllerConfigs(param0: any): any; + + ResetControllerBindings(param0: any): any; + + ResolveCloudedControllerConfigConflict(param0: any): any; + + RestoreControllerPersonalizationSettings(controllerIndex: number): any; + + SaveControllerCalibration(controllerIndex: number): any; + + SaveControllerPersonalizationSettings(param0: any): any; + + SaveControllerSounds: any; + + SaveEditingControllerConfiguration(controllerIndex: number, sharedConfig: boolean): any; + + SetActiveControllerAccount: any; + + //this.SetEditingConfigurationValue(e, t, c.sL, (e => SteamClient.Input.SetControllerConfigurationModeShiftBinding(this.m_unControllerIndex, e))) + SetControllerConfigurationModeShiftBinding(controllerIndex: number, param1: any): any; + + SetControllerHapticSetting(controllerIndex: number, eHapticSetting: any): any; + + SetControllerMappingString(mapping: string): void; + + SetControllerName(controllerIndex: number, controllerName: string): any; + + SetControllerNintendoLayoutSetting: any; + SetControllerPersonalizationName: any; + + //param0 - nLStickDeadzone, bSWAntiDrift, nRHapticStrength, flRPadPressureCurve + /* + SteamClient.Input.SetControllerPersonalizationSetting("nLStickDeadzone", e.nLStickDeadzone), + SteamClient.Input.SetControllerPersonalizationSetting("nRStickDeadzone", e.nRStickDeadzone), + SteamClient.Input.SetControllerPersonalizationSetting("bSWAntiDrift", e.bSWAntiDrift ? 1 : 0), + SteamClient.Input.SetControllerPersonalizationSetting("nLHapticStrength", e.nLHapticStrength), + SteamClient.Input.SetControllerPersonalizationSetting("nRHapticStrength", e.nRHapticStrength), + SteamClient.Input.SetControllerPersonalizationSetting("flLPadPressureCurve", 100 * e.flLPadPressureCurve), + SteamClient.Input.SetControllerPersonalizationSetting("flRPadPressureCurve", 100 * e.flRPadPressureCurve), + SteamClient.Input.SetControllerPersonalizationSetting("ePlayerSlotLEDSetting", e), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nGyroSampleAngleOffsetX", e.nGyroSampleAngleOffsetX), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.bMomentumEnabled", e.bMomentumEnabled ? 1 : 0), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nMomentumFrictionX", e.nMomentumFrictionX), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nMomentumFrictionY", e.nMomentumFrictionY), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nAccerationLevel", e.nAccerationLevel), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.bInvertX", e.bInvertX ? 1 : 0), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.bInvertY", e.bInvertY ? 1 : 0), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nRotationAngle", e.nRotationAngle), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nTriggerClamping", e.nTriggerClamping), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nTriggerClampingAmount", e.nTriggerClampingAmount), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nGyroEnableButton", e.nGyroEnableButton), + SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nGyroEnableButtonBehavior", e.nGyroEnableButtonBehavior), + */ + SetControllerPersonalizationSetting(param0: string, param1: number): any; + + //param0 - flGyroStationaryTolerance, flAccelerometerStationaryTolerance, + /* + SteamClient.Input.SetControllerPersonalizationSettingFloat("GyroPreferenceData.flGyroNaturalSensitivity", e.flGyroNaturalSensitivity), + SteamClient.Input.SetControllerPersonalizationSettingFloat("GyroPreferenceData.flGyroXYRatio", e.flGyroXYRatio), + SteamClient.Input.SetControllerPersonalizationSettingFloat("GyroPreferenceData.flGyroSpeedDeadzone", e.flGyroSpeedDeadzone), + SteamClient.Input.SetControllerPersonalizationSettingFloat("GyroPreferenceData.flGyroPrecisionSpeed", e.flGyroPrecisionSpeed), + SteamClient.Input.SetControllerPersonalizationSettingFloat("flGyroStationaryTolerance", e.flGyroStationaryTolerance), + SteamClient.Input.SetControllerPersonalizationSettingFloat("flAccelerometerStationaryTolerance", e.flAccelerometerStationaryTolerance), + */ + SetControllerPersonalizationSettingFloat(param0: string, param1: number): any; + + SetControllerRumbleSetting(controllerIndex: number, rumblePreference: any): any; + + SetCursorActionset(param0: boolean): any; + + SetDualSenseUpdateNotification(param0: boolean): any + + /* + SetEditingConfigurationValue(e, t, n, o) { + const a = new r.BinaryWriter; + n.serializeBinaryToWriter(n.fromObject(t), a); + const s = a.getResultBase64String(); + f.Debug("SetEditingConfigurationValue serializeBinaryToWriter", (0, i.ZN)(t), s), this.EditingConfigurationWillUpdate(), this.m_updatingEditingConfigurationPromise = o(s).then((t => { + if (null == t) return f.Debug("SetEditingConfigurationValue returned nothing."), void (0, i.z)((() => this.UpdateEditingConfiguration(e, this.m_unControllerIndex, this.EditingConfiguration))); + const n = c.bE.deserializeBinary(t).toObject(); + f.Debug("SetEditingConfigurationValue returned controller configuration.", n), this.UpdateEditingConfiguration(e, this.m_unControllerIndex, n), this.m_nEditNumber++, -1 == n.url.indexOf("autosave://") && this.SaveEditingConfiguration(e) + })).catch((e => { + f.Error("SetEditingConfigurationValue fail:", o, l.jt(e.result), e.message), this.m_bIsUpdatingActiveConfiguration = !1 + })) + } + + SetControllerActionSet(e, t) { + this.SetEditingConfigurationValue(e, t, c.X3, (e => SteamClient.Input.SetEditingControllerConfigurationActionSet(this.m_unControllerIndex, e))) + } + */ + SetEditingControllerConfigurationActionSet(controllerIndex: number, param1: any): any; + + //this.SetEditingConfigurationValue(e, t, c.io, (e => SteamClient.Input.SetEditingControllerConfigurationInputActivator(this.m_unControllerIndex, e))) + SetEditingControllerConfigurationInputActivator(controllerIndex: number, param1: any): any; + + //this.SetEditingConfigurationValue(e, t, c.tH, (e => SteamClient.Input.SetEditingControllerConfigurationInputActivatorEnabled(this.m_unControllerIndex, e))) + SetEditingControllerConfigurationInputActivatorEnabled(controllerIndex: number, param1: any): any; + + //this.SetEditingConfigurationValue(e, t, c.J2, (e => SteamClient.Input.SetEditingControllerConfigurationInputBinding(this.m_unControllerIndex, e))) + SetEditingControllerConfigurationInputBinding(controllerIndex: number, param1: any): any; + + //this.SetEditingConfigurationValue(e, t, c.Sz, (e => SteamClient.Input.SetEditingControllerConfigurationMiscSetting(this.m_unControllerIndex, e))) + SetEditingControllerConfigurationMiscSetting(controllerIndex: number, param1: any): any; + + //f.Debug("sending to client"), this.SetEditingConfigurationValue(e, t, c.QU, (e => SteamClient.Input.SetEditingControllerConfigurationSourceMode(this.m_unControllerIndex, e))) + SetEditingControllerConfigurationSourceMode(controllerIndex: number, param1: any): any; + + SetGamepadKeyboardText(param0: boolean, param1: string): any; + + SetKeyboardActionset(param0: boolean, param1: boolean): any; + + /** + * Sets the mouse position. + * @param {number} pid - 0 + * @param {number} x - Mouse X position. + * @param {number} y - Mouse Y position. + * @returns {void} + */ + SetMousePosition(pid: number, x: number, y: number): void; + + SetSelectedConfigForApp(appId: number, controllerIndex: number, url: string, param3: boolean): any; + + SetSteamControllerDonglePairingMode(bEnable: boolean, bSilent: boolean): any; + + SetVirtualMenuKeySelected(unControllerIndex: number, unMenuIndex: number, m_controllerMenuActiveMenuItem: number): any; // + SetWebBrowserActionset(param0: boolean): any; + + SetXboxDriverInstallState(param0: any): any; // state + + /** + * Opens the Steam Input controller settings. + * This function displays the Steam Input controller settings for configuration. + * @returns {void} + */ + ShowControllerSettings(): void; + + StandaloneKeyboardDismissed(): any; + + StartControllerDeviceSupportFlow(param0: any, param1: any, callback: (param2: any) => void): any; + + /* + this.m_updatingEditingConfigurationPromise = SteamClient.Input.StartEditingControllerConfigurationForAppIDAndControllerIndex(e, t).then((n=>{ + const o = c.bE.deserializeBinary(n).toObject(); + f.Debug("Loaded controller config for appid", e, n, o), + (0, + i.z)((()=>this.UpdateEditingConfiguration(e, t, o))) + } + )).catch((n=>{ + f.Debug("Loading controller config for appid rejected", e, n), + (0, + i.z)((()=>this.UpdateEditingConfiguration(e, t, null))) + } + )) + */ + StartEditingControllerConfigurationForAppIDAndControllerIndex(m_appId: number, m_unControllerIndex: number): Promise<any>; + + StartGyroSWCalibration(callback: () => void): any; + + StopEditingControllerConfiguration(controllerIndex: number): any; + + SwapControllerConfigurationSourceModes: any; + + //this.SetEditingConfigurationValue(e, t, c.Qb, (e => SteamClient.Input.SwapControllerModeInputBindings(this.m_unControllerIndex, e))) + SwapControllerModeInputBindings(controllerIndex: number, param1: any): any; + + SwapControllerOrder(controllerIndex1: number, controllerIndex2: number): any; + + SyncCloudedControllerConfigs(): any; + + // type - enum + /* + Off - 0, Tick, Click + */ + TriggerHapticPulse(controllerIndex: number, eHapticType: number, param2: number): any; + + TriggerSimpleHapticEvent( + controllerIndex: number, + eHapticType: number, + unIntensity: number, + ndBGain: number, + param4: number, + ): any; + + UnregisterForControllerStateChanges(): void; + + UnregisterForUIVisualization(controllerIndex: number): any; + + UploadChangesForCloudedControllerConfigs(): any; +} + +export enum HIDKeyboardKey { + Invalid = 0, + BeforeFirst = 3, + A = 4, + B = 5, + C = 6, + D = 7, + E = 8, + F = 9, + G = 10, + H = 11, + I = 12, + J = 13, + K = 14, + L = 15, + M = 16, + N = 17, + O = 18, + P = 19, + Q = 20, + R = 21, + S = 22, + T = 23, + U = 24, + V = 25, + W = 26, + X = 27, + Y = 28, + Z = 29, + Key_1 = 30, + Key_2 = 31, + Key_3 = 32, + Key_4 = 33, + Key_5 = 34, + Key_6 = 35, + Key_7 = 36, + Key_8 = 37, + Key_9 = 38, + Key_0 = 39, + Return = 40, + Escape = 41, + Backspace = 42, + Tab = 43, + Space = 44, + Dash = 45, + Equals = 46, + LeftBracket = 47, + RightBracket = 48, + Backslash = 49, + Unused1 = 50, + Semicolon = 51, + SingleQuote = 52, + Backtick = 53, + Comma = 54, + Period = 55, + ForwardSlash = 56, + CapsLock = 57, + F1 = 58, + F2 = 59, + F3 = 60, + F4 = 61, + F5 = 62, + F6 = 63, + F7 = 64, + F8 = 65, + F9 = 66, + F10 = 67, + F11 = 68, + F12 = 69, + PrintScreen = 70, + ScrollLock = 71, + Break = 72, + Insert = 73, + Home = 74, + PageUp = 75, + Delete = 76, + End = 77, + PageDown = 78, + RightArrow = 79, + LeftArrow = 80, + DownArrow = 81, + UpArrow = 82, + NumLock = 83, + KeypadForwardSlash = 84, + KeypadAsterisk = 85, + KeypadDash = 86, + KeypadPlus = 87, + KeypadEnter = 88, + Keypad_1 = 89, + Keypad_2 = 90, + Keypad_3 = 91, + Keypad_4 = 92, + Keypad_5 = 93, + Keypad_6 = 94, + Keypad_7 = 95, + Keypad_8 = 96, + Keypad_9 = 97, + Keypad_0 = 98, + KeypadPeriod = 99, + LAlt = 100, + LShift = 101, + LWin = 102, + LControl = 103, + RAlt = 104, + RShift = 105, + RWin = 106, + RControl = 107, + VolUp = 108, + VolDown = 109, + Mute = 110, + Play = 111, + Stop = 112, + Next = 113, + Prev = 114, + AfterLast = 115, +} + +export interface ControllerAnalogInputMessage { + nA: number; + x: number; + y: number; + nC: number; +} + +export interface ControllerCommandMessage { + /** + * @todo enum + */ + eAction: number; + nControllerIndex: number; +} + +export interface ControllerConfigCloudStateChange { + bSyncDone: boolean; + bSyncConflict: boolean; + bSyncError: boolean; +} + +export interface ControllerConfigInfoMessage { + appID: number; +} + +export interface ControllerConfigInfoMessageQuery extends ControllerConfigInfoMessage { + bPersonalQueryDone: boolean; +} + +export interface ControllerConfigInfoMessageList extends ControllerConfigInfoMessage { + nControllerType: number; + publishedFileID: string; + accountID: number; + Title: string; + Description: string; + URL: string; + timeUpdated: string; + bOfficial: boolean; + bProgenitorOfficial: boolean; + bRecommended: boolean; + bProgenitorRecommended: boolean; + bUsesSIAPI: boolean; + bUsesMouse: boolean; + bUsesKeyboard: boolean; + bUsesGamepad: boolean; + /** + * @todo unconfirmed + */ + eExportType: ControllerConfigExportType; + playtime: string; + bSelected: boolean; +} + +export enum ControllerConfigExportType { + Unknown = 0, + PersonalLocal = 1, + PersonalCloud = 2, + Community = 3, + Template = 4, + Official = 5, + OfficialDefault = 6, +} + +export interface ControllerInputMessage { + nA: number; + bS: boolean; + nC: number; +} + +export interface ActiveAccount { + strActiveAccountID: string; + strName: string; + strAvatarHash: string; +} + +export interface ControllerInfo { + strName: string; + eControllerType: ControllerType; + nXInputIndex: number; + nControllerIndex: number; + eRumblePreference: number; // ControllerRumbleSetting + bWireless: boolean; + unUniqueID: number; + unVendorID: number; + unProductID: number; + unCapabilities: number; + strFirmwareBuildTime: string; + strSerialNumber: string; + strChipID: string; + nLEDColorR: number; + nLEDColorG: number; + nLEDColorB: number; + flLEDBrightness: number; + flLEDSaturation: number; + nTurnOnSound: number; + nTurnOffSound: number; + nLStickDeadzone: number; + nRStickDeadzone: number; + nLHapticStrength: number; + nRHapticStrength: number; + flLPadPressureCurve: number; + flRPadPressureCurve: number; + bHaptics: boolean; + bSWAntiDrift: boolean; + flGyroStationaryTolerance: number; + flAccelerometerStationaryTolerance: number; + bRemoteDevice: boolean; + bNintendoLayout: boolean; + bUseReversedLayout: boolean; + ActiveAccount: ActiveAccount | undefined; + vecAltAccounts: any[]; // The type for this property might need to be more specific based on the actual data structure +} + +export enum ControllerType { + None = -1, + Unknown = 0, + UnknownSteamController = 1, + SteamController = 2, // Codename Gordon + SteamControllerV2 = 3, // Codename Headcrab + SteamControllerNeptune = 4, // Steam Deck + FrontPanelBoard = 20, + Generic = 30, + XBox360Controller = 31, + XBoxOneController = 32, + PS3Controller = 33, + PS4Controller = 34, + WiiController = 35, + AppleController = 36, + AndroidController = 37, + SwitchProController = 38, + SwitchJoyConLeft = 39, + SwitchJoyConRight = 40, + SwitchJoyConPair = 41, + SwitchProGenericInputOnlyController = 42, + MobileTouch = 43, + SwitchProXInputSwitchController = 44, + PS5Controller = 45, + XboxEliteController = 46, + LastController = 47, // Unverified + PS5EdgeController = 48, + GenericKeyboard = 400, + GenericMouse = 800, +} + +export interface ControllerStateChange { + unControllerIndex: number; + unPacketNum: number; + /** + * Bitmask representing pressed upper buttons. + * - Bit 0-8: Unknown (@todo Please provide more details if known) + * - Bit 9: L4 + * - Bit 10: R4 + * - Bit 11-13: Unknown (@todo Please provide more details if known) + * - Bit 14: Left Joystick Touch + * - Bit 15: Right Joystick Touch + * - Bit 16-17: Unknown (@todo Please provide more details if known) + * - Bit 18: Quick Access Menu + */ + ulUpperButtons: number; + /** + * Bitmask representing pressed buttons. + * - Bit 0: R2 + * - Bit 1: L2 + * - Bit 2: R1 + * - Bit 3: L1 + * - Bit 4: Y + * - Bit 5: B + * - Bit 6: X + * - Bit 7: A + * - Bit 8: D-Pad Up + * - Bit 9: D-Pad Right + * - Bit 10: D-Pad Left + * - Bit 11: D-Pad Down + * - Bit 12: Select + * - Bit 13: Steam/Home + * - Bit 14: Start + * - Bit 15: L5 + * - Bit 16: R5 + * - Bit 17: Left Touchpad Click + * - Bit 18: Right Touchpad Click + * - Bit 19: Left Touchpad Touch + * - Bit 20: Right Touchpad Touch + * - Bit 21: Unknown (@todo Please provide more details if known) + * - Bit 22: L3 + * - Bit 23-25: Unknown (@todo Please provide more details if known) + * - Bit 26: R3 + * - Bit 27-28: Unknown (@todo Please provide more details if known) + * - Bit 29: Mute (Dualsense) + * - Bit 30-31: Unknown (@todo Please provide more details if known) + */ + ulButtons: number; + sLeftPadX: number; + sLeftPadY: number; + sRightPadX: number; + sRightPadY: number; + sCenterPadX: number; + sCenterPadY: number; + sLeftStickX: number; + sLeftStickY: number; + sRightStickX: number; + sRightStickY: number; + sTriggerL: number; + sTriggerR: number; + flDriftCorrectedQuatW: number; + flDriftCorrectedQuatX: number; + flDriftCorrectedQuatY: number; + flDriftCorrectedQuatZ: number; + flSensorFusionGyroQuatW: number; + flSensorFusionGyroQuatX: number; + flSensorFusionGyroQuatY: number; + flSensorFusionGyroQuatZ: number; + flDeferredSensorFusionGyroQuatW: number; + flDeferredSensorFusionGyroQuatX: number; + flDeferredSensorFusionGyroQuatY: number; + flDeferredSensorFusionGyroQuatZ: number; + flGyroDegreesPerSecondX: number; + flGyroDegreesPerSecondY: number; + flGyroDegreesPerSecondZ: number; + flGravityVectorX: number; + flGravityVectorY: number; + flGravityVectorZ: number; + flAccelerometerNoiseLength: number; + flGyroNoiseLength: number; + flGyroCalibrationProgress: number; + sBatteryLevel: number; + sPressurePadLeft: number; + sPressurePadRight: number; + sPressureBumperLeft: number; + sPressureBumperRight: number; + unHardwareUpdateInMicrosec: number; +} + +export interface GameKeyboardMessage { + m_bOpen: boolean; + nAppID: number; + m_dwPID: number; + m_dwOverlayPID: number; + m_hPipe: number; + m_eInputMode: number; + m_eLineInputMode: number; + m_pchDescription: string; + m_unCharMax: number; + m_pchExistingText: string; +} + +export interface TouchMenuMessage { + bHasVirtualMenus: boolean; + unControllerIndex: number; + appID: number; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/InstallFolder.ts b/src/deck-components/steam-client/InstallFolder.ts new file mode 100644 index 00000000..8f55a339 --- /dev/null +++ b/src/deck-components/steam-client/InstallFolder.ts @@ -0,0 +1,175 @@ +import {Unregisterable} from "./index"; +import {AppError} from "./App"; + +/** + * Represents functions related to Steam Install Folders. + */ +export interface InstallFolder { + /** + * Adds a Steam Library folder to the Steam client. + * @param {string} steamLibraryPath - The path of the Steam Library folder to be added. + * @returns {Promise<number>} - A Promise that resolves to the index of the added folder. + */ + AddInstallFolder(steamLibraryPath: string): Promise<number>; + + /** + * Opens the file explorer to browse files in a specific Steam Library folder. + * @param {number} folderIndex - The index of the folder to be opened. + * @returns {void} + */ + BrowseFilesInFolder(folderIndex: number): void; + + /** + * Cancels the current move operation for moving game content. + * @returns {void} + */ + CancelMove(): void; + + /** + * Retrieves a list of installed Steam Library folders. + * @returns {Promise<SteamInstallFolder[]>} - A Promise that resolves to an array of SteamInstallFolder objects. + */ + GetInstallFolders(): Promise<SteamInstallFolder[]>; + + /** + * Retrieves a list of potential Steam Library folders that can be added. + * @returns {Promise<PotentialInstallFolder[]>} - A Promise that resolves to an array of PotentialInstallFolder objects. + */ + GetPotentialFolders(): Promise<PotentialInstallFolder[]>; + + /** + * Moves the installation folder for a specific app to another Steam Library folder. + * @param {number} appId - The ID of the application to be moved. + * @param {number} folderIndex - The index of the target Steam Library folder. + * @returns {void} + */ + MoveInstallFolderForApp(appId: number, folderIndex: number): void; + + /** + * Refreshes the list of installed Steam Library folders. + * @returns {any} - A Promise or response indicating the refresh operation. + */ + RefreshFolders(): any; + + /** + * Registers a callback function to be called when changes occur in Steam Install Folders. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForInstallFolderChanges(callback: (folderChange: FolderChange) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when moving game content progresses. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMoveContentProgress(callback: (moveContentProgress: MoveContentProgress) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when repairing an install folder is finished. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForRepairFolderFinished(callback: (folderChange: FolderChange) => void): Unregisterable | any; + + /** + * Removes a Steam Library folder from the Steam client. + * @param {number} folderIndex - The index of the folder to be removed. + * @returns {void} + */ + RemoveInstallFolder(folderIndex: number): void; + + /** + * Repairs an installed Steam Library folder. + * @param {number} folderIndex - The index of the folder to be repaired. + * @returns {void} + */ + RepairInstallFolder(folderIndex: number): void; + + /** + * Sets a specific Steam Library folder as the default install folder. + * @param {number} folderIndex - The index of the folder to be set as default. + * @returns {void} + */ + SetDefaultInstallFolder(folderIndex: number): void; + + /** + * Sets a user-defined label for a specific Steam Library folder. + * @param {number} folderIndex - The index of the folder to be labeled. + * @param {string} userLabel - The label to be assigned to the folder. + * @returns {void} + */ + SetFolderLabel(folderIndex: number, userLabel: string): void; +} + +/** + * Represents information about an installation folder. + */ +export interface SteamInstallFolder extends PotentialInstallFolder { + /** Index of the folder. */ + nFolderIndex: number; + /** Used space in the folder. */ + strUsedSize: string; + /** Size of DLC storage used in the folder. */ + strDLCSize: string; + /** Size of workshop storage used in the folder. */ + strWorkshopSize: string; + /** Size of staged storage used in the folder. */ + strStagedSize: string; + /** Indicates if the folder is set as the default installation folder. */ + bIsDefaultFolder: boolean; + /** Indicates if the folder is currently mounted. */ + bIsMounted: boolean; + /** List of applications installed in the folder. */ + vecApps: AppInfo[]; +} + +export interface PotentialInstallFolder { + /** Path of the folder. */ + strFolderPath: string; + /** User label for the folder. */ + strUserLabel: string; + /** Name of the drive where the folder is located. */ + strDriveName: string; + /** Total capacity of the folder. */ + strCapacity: string; + /** Available free space in the folder. */ + strFreeSpace: string; + /** Indicates if the folder is on a fixed drive. */ + bIsFixed: boolean; +} + +/** + * Represents information about an installed application. + */ +export interface AppInfo { + /** ID of the application. */ + nAppID: number; + /** Name of the application. */ + strAppName: string; + /** Sorting information for the application. */ + strSortAs: string; + /** Last played time in Unix Epoch time format. */ + rtLastPlayed: number; + /** Size of used storage by the application. */ + strUsedSize: string; + /** Size of DLC storage used by the application. */ + strDLCSize: string; + /** Size of workshop storage used by the application. */ + strWorkshopSize: string; + /** Size of staged storage used by the application. */ + strStagedSize: string; +} + +export interface FolderChange { + folderIndex: number; +} + +export interface MoveContentProgress { + appid: number; + eError: AppError; + flProgress: number; + strBytesMoved: string; + strTotalBytesToMove: string; + nFilesMoved: number; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Installs.ts b/src/deck-components/steam-client/Installs.ts new file mode 100644 index 00000000..6272eb14 --- /dev/null +++ b/src/deck-components/steam-client/Installs.ts @@ -0,0 +1,139 @@ +import {Unregisterable} from "./index"; +import {AppError} from "./App"; + +/** + * Represents functions related to managing installs and installation wizards in Steam. + */ +export interface Installs { + /** + * Cancels the installation wizard if it is open. + * @returns {void} + */ + CancelInstall(): void; + + /** + * Continues and starts the installation if the wizard is still open. + * @returns {void} + */ + ContinueInstall(): void; + + /** + * Retrieves information from the last opened or currently opened installation wizard. + * @returns {Promise<InstallInfo>} A Promise that resolves to the InstallInfo. + */ + GetInstallManagerInfo(): Promise<InstallInfo>; + + /** + * Opens the restore from backup installer wizard for a specific app. + * @param {string} appBackupPath - The backup path of the app. + * @returns {void} + */ + OpenInstallBackup(appBackupPath: string): void; + + /** + * Opens the installation wizard for specified app IDs. + * @param {number[]} appIds - An array of app IDs to install. + * @returns {void} + */ + OpenInstallWizard(appIds: number[]): void; + + /** + * Opens the uninstall wizard for specified app IDs. + * @param {number[]} appIds - An array of app IDs to uninstall. + * @param {boolean} dontPrompt - Whether to *not* prompt the user to uninstall. + * @returns {void} + */ + OpenUninstallWizard(appIds: number[], dontPrompt: boolean): void; + + RegisterForShowConfirmUninstall: Unregisterable | any; // Broken? doesn't seem to work + + /** + * Registers a callback function to be called when the "Failed Uninstall" dialog is shown. + * @param {function} callback - The callback function to be called when the dialog is shown. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForShowFailedUninstall(callback: (appId: number, reason: AppError) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the installation wizard is shown. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForShowInstallWizard(callback: (data: InstallInfo) => void): Unregisterable | any; + + RegisterForShowRegisterCDKey: any; + + /** + * Sets a list of app identifiers for downloads in the installation wizard. + * @param {number[]} appIds - An array of app IDs to set. + * @returns {void} + * @remarks The wizard will not reflect this change immediately, but changing another option will. + */ + SetAppList(appIds: number[]): void; + + /** + * Sets the options for creating shortcuts in the installation wizard. + * @param {boolean} bDesktopShortcut - Whether to create a desktop shortcut. + * @param {boolean} bSystemMenuShortcut - Whether to create a system menu shortcut. + * @returns {void} + * @remarks The wizard will not reflect this change immediately, but changing another option will. + */ + SetCreateShortcuts(bDesktopShortcut: boolean, bSystemMenuShortcut: boolean): void; + + /** + * Sets the install folder for the installation wizard using an install folder index. + * @param {number} folderIndex - The index of the install folder. + * @returns {void} + * @remarks The wizard will not reflect this change immediately, but changing another option will. + */ + SetInstallFolder(folderIndex: number): void; +} + +export interface InstallInfo { + rgAppIDs: InstallInfoApps[]; + eInstallState: EInstallManagerState; + nDiskSpaceRequired: number; + nDiskSpaceAvailable: number; + nCurrentDisk: number; + nTotalDisks: number; + bCanChangeInstallFolder: boolean; + /** + * Index of the install folder. -1 if not installed. + */ + iInstallFolder: number; + iUnmountedFolder: number; + currentAppID: number; + eAppError: AppError; + errorDetail: string; + bSystemMenuShortcut: boolean; + bDesktopShortcut: boolean; + bIsBackupInstall: boolean; + strPeerContentServer: string; + bPeerContentServerOnline: boolean; + bPeerContentServerAvailable: boolean; +} + +export interface InstallInfoApps { + nAppID: number; + lDiskSpaceRequiredBytes: number; +} + +export enum EInstallManagerState { + None = 0, + Setup = 1, + WaitLicense = 2, + FreeLicense = 3, + ShowCDKey = 4, + WaitAppInfo = 5, + ShowPassword = 6, + ShowConfig = 7, + ShowEULAs = 8, + CreateApps = 9, + ReadFromMedia = 10, + ShowChangeMedia = 11, + WaitLegacyCDKeys = 12, + ShowSignup = 13, + Complete = 14, + Failed = 15, + Canceled = 16, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Messaging.ts b/src/deck-components/steam-client/Messaging.ts new file mode 100644 index 00000000..62505338 --- /dev/null +++ b/src/deck-components/steam-client/Messaging.ts @@ -0,0 +1,21 @@ +import {Unregisterable} from "./index"; + +export interface Messaging { + // section - "ContentManagement", "JumpList", "PostToLibrary" + // seems multipurpose + // callback arguments are the same as in PostMessage + RegisterForMessages( + section: string, + callback: (section: string, param1: string, message: string) => void, + ): Unregisterable | any; + + /* + function m(e) { + SteamClient.Messaging.PostMessage("LibraryCommands", "ShowFriendChatDialog", JSON.stringify({ + steamid: e.persona.m_steamid.ConvertTo64BitString() + })) + } + SteamClient.Messaging.PostMessage("FriendsUI", "AcceptedRemotePlayInvite", JSON.stringify({id: this.appID})) : SteamClient.Messaging.PostMessage("FriendsUI", "AcceptedGameInvite", JSON.stringify({id: this.appID})) + */ + PostMessage(section: string, param1: string, message: string): void; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Music.ts b/src/deck-components/steam-client/Music.ts new file mode 100644 index 00000000..5fb0661e --- /dev/null +++ b/src/deck-components/steam-client/Music.ts @@ -0,0 +1,106 @@ +import {Unregisterable} from "./index"; + +/** + * Represents functions related to controlling music playback in the Steam client. + */ +export interface Music { + /** + * Decreases the music volume by 10%. + */ + DecreaseVolume(): void; + + /** + * Increases the music volume by 10%. + */ + IncreaseVolume(): void; + + /** + * @param {number} param0 - Unknown parameter usage. + * @param {number} param1 - Unknown parameter usage. + * @todo: unknown parameter usages, I have tried soundtrack identifier + track index and in reverse as well + */ + PlayEntry(param0: number, param1: number): void; + + /** + * Plays the next track in the music playlist. + */ + PlayNext(): void; + + /** + * Plays the previous track in the music playlist. + */ + PlayPrevious(): void; + + /** + * Registers a callback function to be called when music playback changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMusicPlaybackChanges(callback: (param0: boolean | MusicTrack) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the music playback position changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMusicPlaybackPosition(callback: (position: number) => void): Unregisterable | any; + + /** + * Sets the playback position of the music track. + * @param {number} position - The position to set in seconds. + */ + SetPlaybackPosition(position: number): void; + + /** + * Sets the repeat status for music playback. + * @param {MusicRepeatStatus} status - The repeat status. + */ + SetPlayingRepeatStatus(status: MusicRepeatStatus): void; + + /** + * Sets the shuffle status for music playback. + * @param {boolean} value - True to enable shuffle, false to disable shuffle. + */ + SetPlayingShuffled(value: boolean): void; + + /** + * Sets the volume for music playback. + * @param {number} volume - The volume level to set. + * @remarks Ranges from 0 to 100. + */ + SetVolume(volume: number): void; + + /** + * Toggles the mute state of the music volume. + */ + ToggleMuteVolume(): void; + + /** + * Toggles between play and pause for music playback. + */ + TogglePlayPause(): void; +} + +export interface MusicTrack { + uSoundtrackAppId: number; + ePlaybackStatus: MusicPlaybackStatus; + eRepeatStatus: MusicRepeatStatus; + bShuffle: boolean; + nVolume: number; + nActiveTrack: number; + nLengthInMsec: number; +} + +export enum MusicPlaybackStatus { + Undefined = 0, + Playing = 1, + Paused = 2, + Idle = 3, +} + +export enum MusicRepeatStatus { + None = 0, + All = 1, + Once = 2, + Max = 3, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Notifications.ts b/src/deck-components/steam-client/Notifications.ts new file mode 100644 index 00000000..2bde10d2 --- /dev/null +++ b/src/deck-components/steam-client/Notifications.ts @@ -0,0 +1,57 @@ +import {ClientUINotification} from "./ClientNotifications"; +import {JsPbMessage, Unregisterable} from "./index"; + +export interface Notifications { + /** + * If `data` is deserialized, returns {@link ClientNotificationFriendMessage}, + * or {@link ClientNotificationGroupChatMessage}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForNotifications( + callback: (notificationIndex: number, type: ClientUINotification, data: ArrayBuffer) => void, + ): Unregisterable | any; +} + +/** + * CClientNotificationGroupChatMessage + */ +export interface ClientNotificationGroupChatMessage extends JsPbMessage { + tag(): string; + + /** A Steam64 ID. */ + steamid_sender(): string; + + chat_group_id(): string; + + chat_id(): string; + + title(): string; + + body(): string; + + rawbody(): string; + + icon(): string; + + notificationid(): number; +} + +/** + * CClientNotificationFriendMessage + */ +export interface ClientNotificationFriendMessage extends JsPbMessage { + body(): string; + + icon(): string; + + notificationid(): number; + + response_steamurl(): string; + + /** A Steam64 ID. */ + steamid(): string; + + tag(): string; + + title(): string; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/OpenVR.ts b/src/deck-components/steam-client/OpenVR.ts new file mode 100644 index 00000000..d89bb3d3 --- /dev/null +++ b/src/deck-components/steam-client/OpenVR.ts @@ -0,0 +1,103 @@ +import {Unregisterable} from "./index"; + + +export interface OpenVR { + Device: VRDevice; + DeviceProperties: DeviceProperties; + + /** + * @throws OperationResponse if mutual capabilities haven't been loaded. + */ + GetMutualCapabilities(): Promise<any>; + + GetWebSecret(): Promise<string>; + + InstallVR(): any; + + Keyboard: Keyboard; + PathProperties: PathProperties; + + QuitAllVR(): any; + + RegisterForButtonPress: Unregisterable | any; + + RegisterForHMDActivityLevelChanged(callback: (m_eHMDActivityLevel: any) => void): Unregisterable | any; + + RegisterForInstallDialog: Unregisterable | any; + + RegisterForStartupErrors(callback: (clientError: any, initError: any, initErrorString: string) => void): Unregisterable | any; + + RegisterForVRHardwareDetected(callback: (m_bHMDPresent: any, m_bHMDHardwareDetected: any, m_strHMDName: any) => void): Unregisterable | any; + + RegisterForVRModeChange(callback: (m_bIsVRRunning: boolean) => void): Unregisterable | any; + + RegisterForVRSceneAppChange(callback: (param0: number) => void): Unregisterable | any; + + SetOverlayInteractionAffordance: any; + + StartVR: any; + TriggerOverlayHapticEffect: any; + VRNotifications: VRNotifications; + VROverlay: VROverlay; +} + +export interface VRDevice { + BIsConnected: any; + RegisterForDeviceConnectivityChange: Unregisterable | any; + + RegisterForVRDeviceSeenRecently(callback: (m_bVRDeviceSeenRecently: any) => void): Unregisterable | any; +} + +export interface DeviceProperties { + GetBoolDeviceProperty: any; + GetDoubleDeviceProperty: any; + GetFloatDeviceProperty: any; + GetInt32DeviceProperty: any; + GetStringDeviceProperty: any; + RegisterForDevicePropertyChange: Unregisterable | any; +} + +export interface Keyboard { + Hide(): any; + + RegisterForStatus(callback: (m_bIsKeyboardOpen: boolean, m_eKeyboardFlags: any, m_sInitialKeyboardText: string) => void): Unregisterable | any; + + SendDone(): any; + + SendText(key: string): any; //??? + Show(): any; +} + +export interface PathProperties { + GetBoolPathProperty: any; + GetDoublePathProperty: any; + GetFloatPathProperty: any; + GetInt32PathProperty: any; + GetStringPathProperty: any; + RegisterForPathPropertyChange: any; + SetBoolPathProperty: any; + SetDoublePathProperty: any; + SetFloatPathProperty: any; + SetInt32PathProperty: any; + SetStringPathProperty: any; +} + +export interface VRNotifications { + HideCustomNotification: any; + RegisterForNotificationEvent: Unregisterable | any; + ShowCustomNotification: any; +} + +export interface VROverlay { + HideDashboard: any; + + IsDashboardVisible(): Promise<boolean>; + + RegisterForButtonPress: Unregisterable | any; + RegisterForCursorMovement: Unregisterable | any; + RegisterForThumbnailChanged: Unregisterable | any; + RegisterForVisibilityChanged: Unregisterable | any; + ShowDashboard: any; + + SwitchToDashboardOverlay(param0: string): void; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Overlay.ts b/src/deck-components/steam-client/Overlay.ts new file mode 100644 index 00000000..1698690e --- /dev/null +++ b/src/deck-components/steam-client/Overlay.ts @@ -0,0 +1,142 @@ +import {Unregisterable} from "./index"; +import {UIMode} from "./UI"; + +export interface Overlay { + /** + * Destroys the gamepad UI desktop configurator window if open. + * @returns {void} + */ + DestroyGamePadUIDesktopConfiguratorWindow(): void; + + GetOverlayBrowserInfo(): Promise<OverlayBrowserInfo[]>; + + HandleGameWebCallback(url: string): any; + + HandleProtocolForOverlayBrowser(appId: number, protocol: string): any; + + RegisterForActivateOverlayRequests: Unregisterable | any; + + /** + * Registers a callback function to be called when a microtransaction authorization is requested. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMicroTxnAuth( + callback: (appId: number, microTxnId: string, realm: SteamRealm, microTxnUrl: string) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a microtransaction authorization is dismissed by the user in Steam's authorization page. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForMicroTxnAuthDismiss(callback: (appId: number, microTxnId: string) => void): Unregisterable | any; + + RegisterForNotificationPositionChanged( + callback: (appId: any, position: NotificationPosition, horizontalInset: number, verticalInset: number) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when an overlay is activated or closed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForOverlayActivated( + callback: (overlayProcessPid: number, appId: number, active: boolean, param3: boolean) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when the overlay browser protocols change. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForOverlayBrowserProtocols( + callback: (browseProtocols: OverlayBrowserProtocols) => void, + ): Unregisterable | any; + + /** + * Registers **the** callback function to be called when the overlay browser information changes. + * @param {function} callback - The callback function to be called when the overlay browser information changes. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @remarks Do Not Use, this will break the overlay unless you know what you are doing. + */ + RegisterOverlayBrowserInfoChanged(callback: () => void): Unregisterable | any; + + SetOverlayState(appId: number, uiComposition: UIComposition): any; +} + +export enum NotificationPosition { + TopLeft = 0, + TopRight = 1, + BottomLeft = 2, + BottomRight = 3, +} + +export interface OverlayBrowserInfo { + appID: number; + eBrowserType: BrowserType; + eUIMode: UIMode; + flDisplayScale?: number; + gameID: string; + nBrowserID: number; + nScreenHeight: number; + nScreenWidth: number; + /** + * The PID of the overlay process. + */ + unPID: number; +} + +export enum BrowserType { + OffScreen = 0, + OpenVROverlay = 1, + OpenVROverlay_Dashboard = 2, + DirectHWND = 3, + DirectHWND_Borderless = 4, + DirectHWND_Hidden = 5, + ChildHWNDNative = 6, + Transparent_Toplevel = 7, + OffScreen_SharedTexture = 8, + OffScreen_GameOverlay = 9, + OffScreen_GameOverlay_SharedTexture = 10, + Offscreen_FriendsUI = 11, + Offscreen_SteamUI = 12, + OpenVROverlay_Subview = 13, +} + +export interface OverlayBrowserProtocols { + unAppID: number; + strScheme: string; + bAdded: boolean; +} + +export enum SteamRealm { + Unknown = 0, + Global = 1, + China = 2, +} + +/** + * Controls how Gamescope renders the GamepadUI window when a game is running. + */ +export enum UIComposition { + /** Steam is not rendered on the screen. */ + Hidden = 0, + /** + * Transparent divs will allow pixels from the app behind Steam to penetrate. + * Input goes to **the app**. + */ + Notification = 1, + /** + * Transparent divs will allow pixels from the app behind Steam to penetrate. + * Input goes to **Steam**. + */ + Overlay = 2, + /** Take all of the pixels on the screen, nothing "behind" Steam is shown. */ + Opaque = 3, + /** + * Special composition mode that matches Overlay, but forwards synthetic keyboard + * events to the Gamescope foreground app (game) instead of Steam. + */ + OverlayKeyboard = 4, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Parental.ts b/src/deck-components/steam-client/Parental.ts new file mode 100644 index 00000000..ccb94cb3 --- /dev/null +++ b/src/deck-components/steam-client/Parental.ts @@ -0,0 +1,79 @@ +import {Result, Unregisterable} from "./index"; + +/** + * Interface for managing parental control settings. + */ +export interface Parental { + /** + * Locks the parental control settings. + * @returns {void} + */ + LockParentalLock(): void; + + /** + * Registers a callback function to be invoked when parental settings change. + * @param {(parentalSettings: ParentalSettings) => void} callback - The callback function to be invoked when parental settings change. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForParentalSettingsChanges(callback: (parentalSettings: ParentalSettings) => void): Unregisterable | any; + + /** + * Unlocks the parental lock with the provided PIN. + * @param {string} pin - The 4-digit PIN to unlock the parental lock. + * @param {boolean} param1 - Additional parameter. // Todo: Unknown usage. + * @returns {Promise<Result>} - A Promise that resolves to a number representing the result of the unlock operation. + */ + UnlockParentalLock(pin: string, param1: boolean): Promise<Result>; +} + +/** + * Represents the parental settings and restrictions. + */ +export interface ParentalSettings { + /** + * Indicates whether parental settings are enabled. + */ + enabled: boolean; + /** + * Indicates whether parental settings are locked. + */ + locked: boolean; + /** + * Bitmask representing enabled features. + * - Bit 0: Unknown (@todo Please provide more details if known) + * - Bit 1: Online content & features - Steam Store + * - Bit 2: Online content & features - Community-generated content + * - Bit 3: Online content & features - My online profile, screenshots, and achievements + * - Bit 4: Online content & features - Friends, chat, and groups + * - Bit 5-11: Unknown (@todo Please provide more details if known) + * - Bit 12: Library content - 0: Only games I choose, 1: All games + */ + features: number; + /** + * Indicates whether all apps are allowed. + */ + allowallapps: boolean; + /** + * Base list (type not specified but an object). + * @todo Determine the type of this property. + */ + baselist: any | undefined; + /** + * Custom list of allowed applications. + */ + customlist: AppList; + /** + * Email for recovery (if applicable). + */ + recoveryemail: string | undefined; +} + +/** + * Represents a list of applications with their IDs. + */ +interface AppList { + /** + * Key-value pairs where the key is the `appId` (e.g., "App_123456") and the value indicates whether the appId is allowed during parental lock. + */ + [appId: string]: number; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/RemotePlay.ts b/src/deck-components/steam-client/RemotePlay.ts new file mode 100644 index 00000000..4d8edcd3 --- /dev/null +++ b/src/deck-components/steam-client/RemotePlay.ts @@ -0,0 +1,165 @@ +import {ControllerType} from "./Input"; +import {Unregisterable} from "./index"; + +export interface RemotePlay { + BCanAcceptInviteForGame: any; + BCanCreateInviteForGame: any; + + BCanHostIsolatedGameAudio(): Promise<boolean>; + + BEnabled(): Promise<boolean>; + + BRemotePlayTogetherGuestOnPhoneOrTablet(steam64Id: string, guestId: number): Promise<boolean>; + + BRemotePlayTogetherGuestSupported(): Promise<boolean>; + + CancelInviteAndSession(steam64Id: string): any; + + CancelInviteAndSessionWithGuestID(steam64Id: string, guestId: number): any; + + CloseGroup(): Promise<number>; + + CreateGroup: any; + + CreateInviteAndSession(steam64Id: string, param1: any): any; + + CreateInviteAndSessionWithGuestID(steam64Id: string, guestId: number, param2: any): any; + + GetClientStreamingBitrate(): Promise<number>; //todo: -1 not streaming?? + GetClientStreamingQuality(): Promise<number>; //todo: -1 not streaming?? + GetControllerType(param0: number): Promise<ControllerType>; // todo: param0 with value 0 is host controller type - param0 is likely an index of clients or guestId? + GetGameSystemVolume(): Promise<number>; + + GetPerUserInputSettings(steam64Id: string): any; + + GetPerUserInputSettingsWithGuestID(steam64Id: string, guestId: number): any; + + IdentifyController(nControllerIndex: number): any; + + InstallAudioDriver: any; + InstallInputDriver: any; + MoveControllerToSlot: any; + RegisterForAdditionalParentalBlocks: Unregisterable | any; + RegisterForAudioDriverPrompt: Unregisterable | any; + RegisterForBitrateOverride: Unregisterable | any; + RegisterForControllerIndexSet: Unregisterable | any; + + RegisterForDevicesChanges(callback: (devicesChange: RemotePlayDevice[]) => void): Unregisterable | any; + + RegisterForGroupCreated: Unregisterable | any; + RegisterForGroupDisbanded: Unregisterable | any; + RegisterForInputDriverPrompt: Unregisterable | any; + RegisterForInputDriverRestartNotice: Unregisterable | any; + + RegisterForInputUsed( + callback: (steam64Id: string, type: ClientUsedInputType, guestId: number) => void, + ): Unregisterable | any; // only fires on host + + RegisterForInviteResult: Unregisterable | any; + + RegisterForNetworkUtilizationUpdate( + callback: (steam64Id: string, guestId: number, networkUtilization: number, networkDuration: number) => void, + ): Unregisterable | any; // only fires on host + + RegisterForPlaceholderStateChanged(callback: (isShowingPlaceholder: boolean) => void): Unregisterable | any; + + RegisterForPlayerInputSettingsChanged: Unregisterable | any; + + RegisterForQualityOverride(callback: (hostStreamingQualityOverride: number) => void): Unregisterable | any; + + RegisterForRemoteClientLaunchFailed: Unregisterable | any; + + RegisterForRemoteClientStarted(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client + + RegisterForRemoteClientStopped(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client + + RegisterForSessionStarted(callback: (steam64Id: any, gameId: any, guestId: any) => void): Unregisterable | any; + + RegisterForSessionStopped(callback: (steam64Id: any, guestId: any) => void): Unregisterable | any; + + RegisterForSettingsChanges(callback: (remotePlaySettings: RemotePlaySettings) => void): Unregisterable | any; + + SetClientStreamingBitrate(bitrate: number): void; + + SetClientStreamingQuality(quality: number): void; + + SetGameSystemVolume(volume: number): void; + + SetPerUserControllerInputEnabled(steam64Id: string, enabled: boolean): any; + + SetPerUserControllerInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; + + SetPerUserKeyboardInputEnabled(steam64Id: string, enabled: boolean): any; + + SetPerUserKeyboardInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; + + SetPerUserMouseInputEnabled(steam64Id: string, enabled: boolean): any; + + SetPerUserMouseInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; + + SetRemoteDeviceAuthorized: any; + + SetRemoteDevicePIN(pin: number): void; + + SetRemotePlayEnabled(enabled: boolean): void; + + SetStreamingClientConfig: any; + SetStreamingClientConfigEnabled: any; + + SetStreamingDesktopToRemotePlayTogetherEnabled(enabled: boolean): any; + + SetStreamingP2PScope: any; + SetStreamingServerConfig: any; + SetStreamingServerConfigEnabled: any; + + StopStreamingClient(): void; + + StopStreamingSession: any; + StopStreamingSessionAndSuspendDevice: any; + + UnlockH264(): any; + + UnpairRemoteDevices(): void; // unpairs all devices +} + +export enum ClientUsedInputType { + Keyboard = 0, + Mouse = 1, + Controller = 2, + Max = 3, +} + +export interface RemotePlayDevice { + clientName: string; + status: string; // "Connected", "Paired", + formFactor: number; + unStreamingSessionID: number; + bCanSuspend: boolean; +} + +export interface RemotePlaySettings { + bRemotePlaySupported: boolean; + bRemotePlayEnabled: boolean; + eRemotePlayP2PScope: StreamP2PScope; + bRemotePlayServerConfigAvailable: boolean; + bRemotePlayServerConfigEnabled: boolean; + RemotePlayServerConfig: any; // todo: document {} + bRemotePlayClientConfigEnabled: boolean; + unStreamingSessionID: number; + strStreamingClientName: string; + RemotePlayClientConfig: any; // todo: document {} + nDefaultAudioChannels: number; + bDefaultEncodeNVIDIA: boolean; + bDefaultEncodeAMD: boolean; + bDefaultEncodeIntel: boolean; + nAutomaticResolutionX: number; + nAutomaticResolutionY: number; +} + +export enum StreamP2PScope { + Automatic = 0, + Disabled = 1, + OnlyMe = 2, + Friends = 3, + Everyone = 4, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Screenshots.ts b/src/deck-components/steam-client/Screenshots.ts new file mode 100644 index 00000000..a5c97f11 --- /dev/null +++ b/src/deck-components/steam-client/Screenshots.ts @@ -0,0 +1,131 @@ +/** + * Interface for managing screenshots. + */ +export interface Screenshots { + /** + * Deletes a local screenshot. + * @param {string} appId - The ID of the application. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {Promise<boolean>} - A Promise that resolves to a boolean value indicating whether the deletion was successful. + */ + DeleteLocalScreenshot(appId: string, screenshotIndex: number): Promise<boolean>; + + /** + * Retrieves all local screenshots for all applications. + * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects. + */ + GetAllAppsLocalScreenshots(): Promise<Screenshot[]>; + + /** + * Retrieves the count of all local screenshots for all applications. + * @returns {Promise<number>} - A Promise that resolves to the count of local screenshots. + */ + GetAllAppsLocalScreenshotsCount(): Promise<number>; + + /** + * Retrieves a range of local screenshots for all applications. + * @param {number} start - The starting index of the screenshot range. + * @param {number} end - The ending index of the screenshot range. + * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects within the specified range. + */ + GetAllAppsLocalScreenshotsRange(start: number, end: number): Promise<Screenshot[]>; + + /** + * Retrieves all local screenshots. + * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects. + */ + GetAllLocalScreenshots(): Promise<Screenshot[]>; + + /** + * Retrieves the game associated with a specific local screenshot index. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {Promise<number>} - A Promise that resolves to the ID of the game associated with the screenshot. + */ + GetGameWithLocalScreenshots(screenshotIndex: number): Promise<number>; + + /** + * Retrieves the last taken local screenshot. + * @returns {Promise<Screenshot>} - A Promise that resolves to the last taken local screenshot. + */ + GetLastScreenshotTaken(): Promise<Screenshot>; + + /** + * Retrieves a specific local screenshot for an application. + * @param {string} appId - The ID of the application. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {Promise<Screenshot>} - A Promise that resolves to the requested local screenshot. + */ + GetLocalScreenshotByHandle(appId: string, screenshotIndex: number): Promise<Screenshot>; + + /** + * Retrieves the count of local screenshots for a specific application. + * @param {number} appId - The ID of the application. + * @returns {Promise<number>} - A Promise that resolves to the count of local screenshots for the application. + */ + GetLocalScreenshotCount(appId: number): Promise<number>; + + /** + * Retrieves the number of games with local screenshots. + * @returns {Promise<number>} - A Promise that resolves to the number of games with local screenshots. + */ + GetNumGamesWithLocalScreenshots(): Promise<number>; + + /** + * Gets total screenshot usage in the specified library folder. + * @param path Library folder path. + * @returns {Promise<number>} A Promise that resolves to the number of taken space in bytes. + */ + GetTotalDiskSpaceUsage(path: string): Promise<number>; + + /** + * Opens a local screenshot in the system image viewer. + * If the screenshot index is invalid, this function opens the screenshots directory for the specified application ID. + * @param {string} appId - The ID of the application. + * @param {number} screenshotIndex - The index of the local screenshot. + * @returns {void} + */ + ShowScreenshotInSystemViewer(appId: string, screenshotIndex: number): void; + + /** + * Opens the folder containing local screenshots for a specific application. + * @param {string} appId - The ID of the application. + * @returns {void} + */ + ShowScreenshotsOnDisk(appId: string): void; + + /** + * Uploads a local screenshot. + * @param {string} appId - The ID of the application. + * @param {number} localScreenshot_hHandle - The handle of the local screenshot. + * @param {number} filePrivacyState - The privacy state of the screenshot file. + * @returns {Promise<boolean>} - A Promise that resolves to a boolean value indicating whether the upload was successful. + */ + UploadLocalScreenshot( + appId: string, + localScreenshot_hHandle: number, + filePrivacyState: FilePrivacyState, + ): Promise<boolean>; +} + +export interface Screenshot { + nAppID: number; + strGameID: string; + hHandle: number; + nWidth: number; + nHeight: number; + nCreated: number; // timestamp + ePrivacy: FilePrivacyState; + strCaption: ''; + bSpoilers: boolean; + strUrl: string; + bUploaded: boolean; + ugcHandle: string; +} + +export enum FilePrivacyState { + Invalid = -1, + Private = 2, + FriendsOnly = 4, + Public = 8, + Unlisted = 16, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/ServerBrowser.ts b/src/deck-components/steam-client/ServerBrowser.ts new file mode 100644 index 00000000..fcfb9dec --- /dev/null +++ b/src/deck-components/steam-client/ServerBrowser.ts @@ -0,0 +1,365 @@ +import {OperationResponse, Unregisterable} from "./index"; + +/** + * Represents functionality for the server browser. + */ +export interface ServerBrowser { + /** + * Adds a favorite server. + * @param {ServerBrowserServerFull} server - The server to add. + * @returns {Promise<string>} A Promise that resolves to an empty string if successful, `Invalid/missing IPv4?` if failed. + * @todo Refreshed the favorite servers list upon adding once, but doesn't now. :-( + */ + AddFavoriteServer(server: ServerBrowserServerFull): Promise<string>; + + /** + * Adds a favorite server by IP. + * @param {string} ip - The IP to add to favorite servers. + * @returns {Promise<string>} A Promise that resolves to an empty string if successful, localization string if failed. + */ + AddFavoriteServersByIP(ip: string): Promise<string>; + + CancelServerQuery(dialogId: number, queryServer: number): void; + + /** + * Connects to a server from a given dialog. + * @param {number} dialogId - The dialog ID to use. + * @param {string} password - Server password, empty if none. + * @returns {Promise<JoinServerError>} A Promise that resolves to a connection status. + */ + ConnectToServer(dialogId: number, password: string): Promise<JoinServerError>; + + /** + * Creates a server info dialog, on which your friend is playing on. + * @param {number} pid - 0 + * @param {string} steamId - A Steam64 ID of a friend. + * @returns {void} + */ + CreateFriendGameInfoDialog(pid: number, steamId: string): void; + + /** + * Creates a server info dialog. + * @param {string} ip - The IP to create a dialog for. + * @param {number} port - The IP's port. + * @param {number} queryPort - + * @returns {Promise<number>} A Promise that resolves to the current dialog ID. + */ + CreateServerGameInfoDialog(ip: string, port: number, queryPort: number): Promise<number>; + + /** + * Retrieves the server list. + * @param {number} appId - The game ID, 0 for every game. + * @param {ServerBrowserTab} queryType - The tab to use. + * @param {string[]} filters - Server filters. + * @param {function} serverCallback - What to do with the found server? + * @param {function} requestCompletedCallback - The callback function to be called when the request is completed. + * @returns {Promise<number>} A Promise that resolves to the current server list request ID. + * @throws Throws if the query type is unknown. + * @throws Throws if the filter list isn't key/value pairs, i.e. of an even length. + * @remarks Stops at 10000 if there are more servers to be found. + * @example + * Filter examples, may be combined: + * ``` + * [ 'gamedir', 'cstrike' ] // Doesn't work? + * [ 'hasplayers', '1' ] // Only works with "1"? + * [ 'notfull', '1' ] // Doesn't work? + * [ 'map', 'cs_office' ] // Has to be an exact match! + * ``` + */ + + /* + The enum in question: + + (t = + 'lan' == this.id + ? this.all_servers.length > 0 + ? '#ServerBrowser_NoServersMatch' + : '#ServerBrowser_NoLanServers' + : 'internet' == this.id + ? this.all_servers.length > 0 + ? '#ServerBrowser_NoInternetGamesMatch' + : e == l.zS.k_EServerFailedToRespond + ? '#ServerBrowser_MasterServerNotResponsive' + : e == l.zS.k_ENoServersListedOnMasterServer + ? '#ServerBrowser_MasterServerHasNoServersListed' + : '#ServerBrowser_NoInternetGamesResponded' + : 'favorites' == this.id + ? this.all_servers.length > 0 + ? '#ServerBrowser_NoServersMatch' + : '#ServerBrowser_NoFavoriteServers' + : 'history' == this.id + ? this.all_servers.length > 0 + ? '#ServerBrowser_NoHistoryServersMatch' + : '#ServerBrowser_NoServersPlayed' + : 'friends' == this.id + ? this.all_servers.length > 0 + ? '#ServerBrowser_NoServersMatch' + : '#ServerBrowser_NoFriendsServers' + : 'BUGBUG'), + */ + CreateServerListRequest( + appId: number, + queryType: ServerBrowserTab, + filters: string[], + serverCallback: (server: ServerBrowserServerFull) => void, + requestCompletedCallback: (response: number) => void, + ): Promise<number | OperationResponse>; + + /** + * Destroys the game info dialog functions (but not the window). + * @param {number} dialogId - The dialog ID to use. + * @returns {void} + * @remarks ServerBrowser.CancelServerQuery may throw if it tries to ping the server. + */ + DestroyGameInfoDialog(dialogId: number): void; + + /** + * Stops retrieving the server list. + * @param {number} activeServerListRequestId - The active server request ID to use. + * @returns {void} + */ + DestroyServerListRequest(activeServerListRequestId: number): void; + + /** + * Gets a list of games that support the server browser feature. + * @returns {Promise<ServerBrowserGame[]>} A Promise that resolves to a list of games. + */ + GetMultiplayerGames(): Promise<ServerBrowserGame[]>; + + /** + * Gets the server browser preferences. + * @returns {Promise<ServerBrowserPreferences>} A Promise that resolves to server browser preferences. + */ + GetServerListPreferences(): Promise<ServerBrowserPreferences>; + + /** + * Pings the server of a specified dialog ID. + * @param {number} dialogId - The dialog ID to use. + * @returns {Promise<number | OperationResponse>} + */ + PingServer(dialogId: number): Promise<number | OperationResponse>; + + /** + * Registers a callback function to be called when a server gets added to favorite servers. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForFavorites(callback: (list: ServerBrowserFavoritesAndHistory) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when idk + * @param {number} dialogId - The dialog ID to use. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForFriendGamePlayed( + dialogId: number, + callback: (server: ServerBrowserFriendServer) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a server info dialog opens. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForGameInfoDialogs(callback: (dialogs: ServerBrowserDialog[]) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when player details get requested. + * @param {number} dialogId - The dialog ID to use. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForPlayerDetails( + dialogId: number, + callback: (player: ServerBrowserPlayer | ServerBrowserPlayerRefreshStatus) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when a server gets pinged. + * @param {number} dialogId - The dialog ID to use. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} An object that can be used to unregister the callback. + */ + RegisterForServerInfo(dialogId: number, callback: (server: ServerBrowserServerFull) => void): Unregisterable | any; + + /** + * Removes a server from favorite servers. + * @param {ServerBrowserServer} server - The server to remove. + * @returns {void} + */ + RemoveFavoriteServer(server: ServerBrowserServer): void; + + /** + * Removes a server from history of played servers. + * @param {ServerBrowserServer} server - The server to remove. + * @returns {void} + */ + RemoveHistoryServer(server: ServerBrowserServer): void; + + /** + * Requests player details for a specific dialog. + * @param {number} dialogId - The dialog ID to use. + * @returns {Promise<number | OperationResponse>} + */ + RequestPlayerDetails(dialogId: number): Promise<number | OperationResponse>; + + /** + * Sets the server browser preferences. + * @param {ServerBrowserPreferences} prefs - Server list preferences. + * @returns {void} + */ + SetServerListPreferences(prefs: ServerBrowserPreferences): void; +} + +export interface ServerBrowserServer { + /** The ID of the game. */ + appid: number; + /** The server IP. */ + ip: string; + /** The server port. */ + port: number; + queryPort: number; + /** Last time played as a UNIX timestamp. */ + lastPlayed: number; +} + +export interface ServerBrowserServerFull extends ServerBrowserServer { + /** Do not refresh if had unsuccessful response? */ + bDoNotRefresh: boolean; + /** Found the server? */ + bHadSuccessfulResponse: boolean; + /** Has password? */ + bPassword: boolean; + /** Is VAC secured? */ + bSecure: boolean; + /** How many bot players there currently are. */ + botPlayers: number; + /** The server's game name/description. */ + gameDesc: string; + /** The game folder. */ + gameDir: string; + /** Server tags, separated by a comma. */ + gameTags: string; + /** Current server map. */ + map: string; + /** Max players on the server. */ + maxPlayers: number; + /** The server name. */ + name: string; + /** The latency to the server. */ + ping: number; + /** How many players there currently are. */ + players: number; + /** The server's game version it is running on. */ + serverVersion: number; + steamID: string; +} + +export enum JoinServerError { + PingFailed = -3, + Connecting = -2, + Pinging = -1, + None = 0, + VACBanned = 1, + ServerFull = 2, + ModNotInstalled = 3, + AppNotFound = 4, + NotInitialized = 5, +} + +export type ServerBrowserTab = 'internet' | 'favorites' | 'history' | 'lan' | 'friends'; + +export interface ServerBrowserGame { + /** The ID of the game. */ + appid: number; + /** The ID of the game. */ + gameid: string; + /** The game folder. */ + gamedir: string; + /** The game's name. */ + name: string; +} + +export interface ServerBrowserPreferences { + GameList: string; + filters: ServerBrowserTabFilters; +} + +export interface ServerBrowserTabFilters { + favorites: ServerBrowserGameFilter; + friends: ServerBrowserGameFilter; + history: ServerBrowserGameFilter; + internet: ServerBrowserGameFilter; + lan: ServerBrowserGameFilter; +} + +export interface ServerBrowserGameFilter { + /** Has users playing */ + NoEmpty: boolean; + /** Server not full */ + NoFull: boolean; + /** Is not password protected */ + NoPassword: boolean; + /** Anti-cheat */ + Secure: ServerBrowserGameFilterAntiCheat; + /** The ID of the game */ + appid: number; + /** The game folder */ + game: string; + /** Map filter */ + map: string; + /** Latency */ + ping: ServerBrowserGameFilterPing; +} + +export enum ServerBrowserGameFilterAntiCheat { + All = 0, + Secure = 1, + NotSecure = 2, +} + +export enum ServerBrowserGameFilterPing { + All = 0, + LessThan50 = 50, + LessThan100 = 100, + LessThan150 = 150, + LessThan250 = 250, +} + +export interface ServerBrowserFavoritesAndHistory { + favorites: ServerBrowserServer[]; + history: ServerBrowserServer[]; +} + +export interface ServerBrowserFriendServer { + /** The ID of the game. */ + appid: number; + /** Non-Steam server? */ + bNonSteamServer: boolean; + gameText: string; + /** The ID of the game. */ + gameid: string; + steamIDLobby: string; +} + +export interface ServerBrowserDialog { + dialogID: number; + ip: number; + port: number; + queryPort: number; +} + +export interface ServerBrowserPlayerRefreshStatus { + bSuccess: boolean; + bRefreshComplete: boolean; +} + +export interface ServerBrowserPlayer extends ServerBrowserPlayerRefreshStatus { + /** Player name. */ + playerName: string; + /** Player score. */ + score: number; + /** Time played on the server. */ + timePlayed: number; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Settings.ts b/src/deck-components/steam-client/Settings.ts new file mode 100644 index 00000000..61e17446 --- /dev/null +++ b/src/deck-components/steam-client/Settings.ts @@ -0,0 +1,567 @@ +import {CompatibilityToolInfo} from "./App"; +import {JsPbMessage, Unregisterable} from "./index"; + +export interface Settings { + AddClientBeta(name: string, password: string): void; + + /** + * Clears HTTP cache located in `<STEAMPATH>/appcache/httpcache`. + * @returns {void} + */ + ClearAllHTTPCaches(): void; + + /** + * Clears download cache and logs you out. + * @returns {void} + */ + ClearDownloadCache(): void; + + GetAccountSettings(): Promise<AccountSettings>; + + GetAppUsesP2PVoice(appId: number): Promise<boolean>; + + GetAvailableLanguages(): Promise<Language[]>; + + GetAvailableTimeZones(): Promise<TimeZone[]>; + + // Returns the current language "english" + GetCurrentLanguage(): Promise<string>; + + GetGlobalCompatTools(): Promise<CompatibilityToolInfo[]>; + + /** + * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link MsgMonitorInfo}. + */ + GetMonitorInfo(): Promise<ArrayBuffer>; + + GetOOBETestMode(): Promise<boolean>; + + GetRegisteredSteamDeck(): Promise<RegisteredSteamDeck>; + + // Returns the current timezone + GetTimeZone(): Promise<string>; + + GetWindowed(): Promise<boolean>; + + IgnoreSteamDeckRewards(): void; + + /** + * Opens the Windows microphones dialog. + * @returns {void} + */ + OpenWindowsMicSettings(): void; + + RegisterForMicVolumeUpdates: Unregisterable | any; + + /** + * If `data` is deserialized, returns {@link MsgClientSettings}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForSettingsArrayChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + + RegisterForSettingsChanges(callback: (steamSettings: SteamSettings) => void): Unregisterable | any; + + RegisterForTimeZoneChange(callback: (timezoneId: string) => void): Unregisterable | any; // When timezone is changed from settings, callback will return new timezoneId + ReinitMicSettings(): void; + + RequestDeviceAuthInfo(): void; + + // + SelectClientBeta(nBetaID: any): any; + + // Get from available languages + SetCurrentLanguage(strShortName: string): void; + + SetEnableSoftProcessKill(value: boolean): void; // Default value is false, this is Valve internal menu + + SetHostname(hostname: string): void; + + SetMicTestMode: any; + + SetOOBETestMode(value: boolean): void; + + SetPreferredMonitor(monitor: string): void; + + SetRegisteredSteamDeck: any; + + /** + * Sets the "Don't save account credentials on this computer" option. + * @param {boolean} value - Whether to save account credentials. + * @returns {void} + */ + SetSaveAccountCredentials(value: boolean): void; + + SetSetting: any; + + SetSteamPlayEnabled(value: boolean): void; + + SetTimeZone(timezoneId: string): void; // You can get valid timezoneIds from GetAvailableTimeZones() + SetUseNintendoButtonLayout: any; + + SetWindowed(value: boolean): void; + + SpecifyGlobalCompatTool(strToolName: string): void; + + // "{"result":2,"message":""}" + ToggleSteamInstall(): any; +} + +export interface AccountSettings { + strEmail: string; + bEmailValidated: boolean; + bHasAnyVACBans: boolean; + bHasTwoFactor: boolean; + eSteamGuardState: ESteamGuardState; + rtSteamGuardEnableTime: number; + bSaveAccountCredentials: boolean; +} + +/** + * @todo unconfirmed, taken from localization strings + */ +export enum ESteamGuardState { + EmailUnverified = 0, + Protected = 1, + Disabled = 2, + Offline = 3, + NotEnabled = 4, +} + +export interface Language { + language: ELanguage; + strShortName: string; +} + +export enum ELanguage { + None = -1, + English = 0, + German = 1, + French = 2, + Italian = 3, + Korean = 4, + Spanish = 5, + SimplifiedChinese = 6, + TraditionalChinese = 7, + Russian = 8, + Thai = 9, + Japanese = 10, + Portuguese = 11, + Polish = 12, + Danish = 13, + Dutch = 14, + Finnish = 15, + Norwegian = 16, + Swedish = 17, + Hungarian = 18, + Czech = 19, + Romanian = 20, + Turkish = 21, + Brazilian = 22, + Bulgarian = 23, + Greek = 24, + Arabic = 25, + Ukrainian = 26, + LatamSpanish = 27, + Vietnamese = 28, + SteamChina_SChinese = 29, + Max = 30, +} +export interface RegisteredSteamDeck { + bRegistered: boolean; + bIgnoreRegistrationPrompt: boolean; + strSteamID: string; + strSerialNumber: string; +} + +export interface TimeZone { + utcOffset: number; + timezoneID: string; + timezoneLocalizationToken: string; + regionsLocalizationToken: string; +} + +interface Region { + nRegionID: number; + strRegionName: string; +} + +interface Hour { + nHour: number; + strDisplay: string; +} + +interface AvailableClientBeta { + nBetaID: number; + strName: string; +} + +interface SteamSettings { + bIsInClientBeta: boolean; + bIsSteamSideload: boolean; + eClientBetaState: ClientBetaState; + strSelectedBetaName: string; + nAvailableBetas: number; + bChangeBetaEnabled: boolean; + nSelectedBetaID: number; + vecAvailableClientBetas: AvailableClientBeta[]; + bIsValveEmail: boolean; + bIsInDesktopUIBeta: boolean; + bEnableSoftProcessKill: boolean; + vecValidDownloadRegions: Region[]; + vecValidAutoUpdateRestrictHours: Hour[]; + bCompatEnabled: boolean; + bCompatEnabledForOtherTitles: boolean; + strCompatTool: string; + strDisplayName: string; + bDisplayIsExternal: boolean; + flAutoDisplayScaleFactor: number; + flCurrentDisplayScaleFactor: number; + bDisplayIsUsingAutoScale: boolean; + flMinDisplayScaleFactor: number; + flMaxDisplayScaleFactor: number; + flCurrentUnderscanLevel: number; + bUnderscanEnabled: boolean; + vecNightModeScheduledHours: Hour[]; +} + +export enum ClientBetaState { + None = 0, + NoneChosen = 1, + NoneChosenNonAdmin = 2, + InBeta = 3, + InBetaNonAdmin = 4, +} + + + +/** + * CMsgMonitorInfo + */ +export interface MsgMonitorInfo extends JsPbMessage { + monitors(): Monitor[]; + + selected_display_name(): string; + + add_monitors(param0: any, param1: any): any; + + set_monitors(param0: any): any; + + set_selected_display_name(param0: any): any; +} + +/** + * @todo Doesn't work on Linux ? + */ +export interface Monitor { + monitor_device_name: string; + monitor_display_name: string; +} + +/** + * CMsgClientSettings + */ +export interface MsgClientSettings extends JsPbMessage { + always_show_user_chooser(): boolean; + + always_use_gamepadui_overlay(): boolean; + + auto_scale_factor(): number; + + bigpicture_windowed(): boolean; + + broadcast_bitrate(): number; + + broadcast_chat_corner(): number; + + broadcast_encoding_option(): BroadcastEncoderSetting; + + broadcast_output_height(): number; + + broadcast_output_width(): number; + + broadcast_permissions(): BroadcastPermission; + + broadcast_record_all_audio(): boolean; + + broadcast_record_all_video(): boolean; + + broadcast_record_microphone(): boolean; + + broadcast_show_live_reminder(): boolean; + + broadcast_show_upload_stats(): boolean; + + cef_remote_debugging_enabled(): boolean; + + cloud_enabled(): boolean; + + controller_combine_nintendo_joycons(): boolean; + + controller_generic_support(): boolean; + + controller_guide_button_focus_steam(): boolean; + + controller_power_off_timeout(): number; + + controller_ps_support(): number; + + controller_switch_support(): boolean; + + controller_xbox_driver(): boolean; + + controller_xbox_support(): boolean; + + default_ping_rate(): number; + + disable_all_toasts(): boolean; + + disable_toasts_in_game(): boolean; + + display_name(): string; + + download_peer_content(): number; + + download_rate_bits_per_s(): boolean; + + download_region(): number; + + download_throttle_rate(): number; + + download_throttle_while_streaming(): boolean; + + download_while_app_running(): boolean; + + enable_avif_screenshots(): boolean; + + enable_dpi_scaling(): boolean; + + enable_gpu_accelerated_webviews(): boolean; + + enable_hardware_video_decoding(): boolean; + + enable_marketing_messages(): boolean; + + enable_overlay(): boolean; + + enable_screenshot_notification(): boolean; + + enable_screenshot_sound(): boolean; + + enable_shader_background_processing(): boolean; + + enable_shader_precache(): boolean; + + enable_ui_sounds(): boolean; + + force_deck_perf_tab(): boolean; + + force_fake_mandatory_update(): boolean; + + force_oobe(): boolean; + + g_background_mk(): Hotkey; + + g_background_tg(): Hotkey; + + game_notes_enable_spellcheck(): boolean; + + gamescope_app_target_framerate(): number; + + gamescope_disable_framelimit(): boolean; + + gamescope_disable_mura_correction(): boolean; + + gamescope_display_refresh_rate(): number; + + gamescope_enable_app_target_framerate(): boolean; + + gamescope_hdr_visualization(): HDRVisualization; + + gamescope_include_steamui_in_screenshots(): boolean; + + gamescope_use_game_refresh_rate_in_steam(): boolean; + + gamestream_hardware_video_encode(): boolean; + + hdr_compat_testing(): boolean; + + in_client_beta(): boolean; + + is_external_display(): boolean; + + is_steam_sideloaded(): boolean; + + jumplist_flags(): number; + + library_disable_community_content(): boolean; + + library_display_icon_in_game_list(): boolean; + + library_display_size(): number; + + library_low_bandwidth_mode(): boolean; + + library_low_perf_mode(): boolean; + + library_whats_new_show_only_product_updates(): boolean; + + max_scale_factor(): number; + + min_scale_factor(): number; + + music_download_high_quality(): boolean; + + music_pause_on_app_start(): boolean; + + music_pause_on_voice_chat(): boolean; + + music_playlist_notification(): boolean; + + music_volume(): number; + + needs_steam_service_repair(): boolean; + + no_save_personal_info(): boolean; + + oobe_test_mode_enabled(): boolean; + + overlay_fps_counter_corner(): number; + + overlay_fps_counter_high_contrast(): boolean; + + overlay_key(): Hotkey; + + overlay_restore_browser_tabs(): boolean; + + overlay_scale_interface(): boolean; + + overlay_tabs(): string; + + overlay_toolbar_list_view(): boolean; + + override_browser_composer_mode(): number; + + play_sound_on_toast(): boolean; + + preferred_monitor(): string; + + ready_to_play_includes_streaming(): boolean; + + restrict_auto_updates(): boolean; + + restrict_auto_updates_end(): number; + + restrict_auto_updates_start(): number; + + run_at_startup(): boolean; + + save_uncompressed_screenshots(): boolean; + + screenshot_items_per_row(): number; + + screenshot_key(): Hotkey; + + screenshots_path(): string; + + server_ping_rate(): number; + + setting_validation_bool(): boolean; + + setting_validation_enum(): HDRVisualization; + + setting_validation_int32(): number; + + setting_validation_uint32(): number; + + setting_validation_uint64(): number; + + setting_validation_float(): number; + + setting_validation_string(): string; + + shader_precached_size(): string; + + show_family_sharing_notifications(): boolean; + + show_screenshot_manager(): boolean; + + show_steam_deck_info(): boolean; + + show_store_content_on_home(): boolean; + + show_timestamps_in_console(): boolean; + + skip_steamvr_install_dialog(): boolean; + + small_mode(): boolean; + + smooth_scroll_webviews(): boolean; + + start_in_big_picture_mode(): boolean; + + start_page(): string; + + startup_movie_id(): string; + + startup_movie_local_path(): string; + + startup_movie_shuffle(): boolean; + + startup_movie_used_for_resume(): boolean; + + steam_cef_gpu_blocklist_disabled(): boolean; + + steam_input_configurator_error_msg_enable(): boolean; + + steam_networking_share_ip(): number; + + steam_os_underscan_enabled(): boolean; + + steam_os_underscan_level(): number; + + steamos_status_led_brightness(): number; + + turn_off_controller_on_exit(): boolean; + + voice_mic_device_name(): string; + + voice_mic_input_gain(): number; + + voice_push_to_talk_key(): Hotkey; + + voice_push_to_talk_setting(): number; + + voice_speaker_output_gain(): number; + + web_browser_home(): string; +} + +export enum BroadcastEncoderSetting { + BestQuality = 0, + BestPerformance = 1, +} + +export enum BroadcastPermission { + Disabled = 0, + FriendsApprove = 1, + FriendsAllowed = 2, + Public = 3, + Subscribers = 4, +} + +export interface Hotkey { + alt_key: boolean; + ctrl_key: boolean; + display_name: string; + key_code: number; + meta_key: boolean; + shift_key: boolean; +} + +export enum HDRVisualization { + None = 0, + Heatmap = 1, + Analysis = 2, + HeatmapExtended = 3, + HeatmapClassic = 4, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/SharedConnection.ts b/src/deck-components/steam-client/SharedConnection.ts new file mode 100644 index 00000000..0945a66e --- /dev/null +++ b/src/deck-components/steam-client/SharedConnection.ts @@ -0,0 +1,36 @@ +import {Unregisterable} from "./index"; +import {SteamRealm} from "./Overlay"; + +export interface SharedConnection { + // hSharedConnection is the number from AllocateSharedConnection() + AllocateSharedConnection(): Promise<number>; + + // if no such number, sends this warning: + // src\clientdll\clientsharedconnection.cpp (154) : m_mapSharedConnections.HasElement( hSharedConnection ) + Close(hSharedConnection: number): void; + + RegisterOnBinaryMessageReceived(hSharedConnection: number, callback: (data: ArrayBuffer) => void): Unregisterable | any; + + RegisterOnLogonInfoChanged(hSharedConnection: number, callback: (info: LogonInfo) => void): Unregisterable | any; + + RegisterOnMessageReceived(hSharedConnection: number, callback: (param0: any) => void): Unregisterable | any; + + SendMsg: any; + SendMsgAndAwaitBinaryResponse: any; + + SubscribeToClientServiceMethod(hSharedConnection: number, param1: any): any; + + SubscribeToEMsg(hSharedConnection: number, param1: any): any; +} + +export interface LogonInfo { + bLoggedOn: boolean; + eUniverse: SteamRealm; + strAccountName: string; + strCommunityImagesURL: string; + strPersonaName: string; + /** Steam64 ID. */ + strSteamid: string; + /** Country code. */ + strUserCountry: string; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Stats.ts b/src/deck-components/steam-client/Stats.ts new file mode 100644 index 00000000..c2fdc15b --- /dev/null +++ b/src/deck-components/steam-client/Stats.ts @@ -0,0 +1,10 @@ +export interface Stats { + // param0 - AppDetailsReviewSection, Showcases, LibraryReviewSpotlight + // param1 - + // AppDetailsReviewSection: PositiveClicked, NegativeClicked, NeutralClicked, PositiveReviewPosted, NegativeReviewPosted, EditClicked, ReviewCanceled + // LibraryReviewSpotlight: ReviseClicked, PositiveClicked, ReviseCloseClicked, NegativeClicked, PositiveRevisePosted, NegativeRevisePosted, ReviseCanceled, ReviewCanceled, CloseClicked + // Showcases: Delete, Save-Modify, Save-New + RecordActivationEvent(param0: string, param1: string): any; + + RecordDisplayEvent: any; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/SteamChina.ts b/src/deck-components/steam-client/SteamChina.ts new file mode 100644 index 00000000..04a3e45e --- /dev/null +++ b/src/deck-components/steam-client/SteamChina.ts @@ -0,0 +1,3 @@ +export interface SteamChina { + GetCustomLauncherAppID(): Promise<number>; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Storage.ts b/src/deck-components/steam-client/Storage.ts new file mode 100644 index 00000000..80e90852 --- /dev/null +++ b/src/deck-components/steam-client/Storage.ts @@ -0,0 +1,24 @@ +import {OperationResponse} from "./index"; + +/** + * SteamClient.MachineStorage affects the "STEAMPATH/config/config.vdf" file. + * SteamClient.RoamingStorage affects the "STEAMPATH/userdata/STEAMID3/7/remote/sharedconfig.vdf" file. + * SteamClient.Storage affects the "STEAMPATH/userdata/STEAMID3/config/localconfig.vdf" file. + */ +export interface Storage { + DeleteKey(key: string): Promise<OperationResponse | void>; + + /** + * @remarks Use {@link SetObject} to set. + */ + GetJSON(key: string): Promise<OperationResponse | string>; + + GetString(key: string): Promise<OperationResponse | string>; + + /** + * @remarks Use {@link SetObject} to get. + */ + SetObject(key: string, value: any): Promise<OperationResponse | void>; + + SetString(key: string, value: string): Promise<OperationResponse | void>; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Streaming.ts b/src/deck-components/steam-client/Streaming.ts new file mode 100644 index 00000000..aadef786 --- /dev/null +++ b/src/deck-components/steam-client/Streaming.ts @@ -0,0 +1,55 @@ +import {Unregisterable} from "./index"; +import {LaunchOption} from "./App"; + +export interface Streaming { + AcceptStreamingEULA(param0: any, param1: any, param2: any): any; + + CancelStreamGame(): void; // existing stream + + /** + * Registers a callback function to be called when the streaming client finishes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingClientFinished(callback: (code: number, result: string) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when there is progress in the launch of the streaming client. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingClientLaunchProgress( + callback: (actionType: string, taskDetails: string, done: number, total: number) => void, + ): Unregisterable | any; + + /** + * Registers a callback function to be called when the streaming client is started (e.g., when clicking the stream button). + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingClientStarted(callback: (appId: number) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the streaming launch is complete. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @todo `code` is likely a code, 1 being it started, 10 being host computer is updating game, `result` just returns "complete" + */ + RegisterForStreamingLaunchComplete(callback: (code: number, result: string) => void): Unregisterable | any; + + RegisterForStreamingShowEula(callback: (appId: number) => any): Unregisterable | any; + + RegisterForStreamingShowIntro(callback: (param0: any, param1: any) => any): Unregisterable | any; + + /** + * Registers a callback function to be called when the streaming client receives launch options from the host. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStreamingShowLaunchOptions( + callback: (appId: number, launchOptions: LaunchOption[]) => void, + ): Unregisterable | any; // Callback when streaming client receives launch options from host + + StreamingContinueStreamGame(): void; // existing game running on another streaming capable device + StreamingSetLaunchOption(param0: any): any; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/UI.ts b/src/deck-components/steam-client/UI.ts new file mode 100644 index 00000000..062cc4ce --- /dev/null +++ b/src/deck-components/steam-client/UI.ts @@ -0,0 +1,69 @@ +import {Unregisterable} from "./index"; +import {OSType} from "./system"; + +export interface UI { + EnsureMainWindowCreated(): void; + + ExitBigPictureMode(): void; + + GetDesiredSteamUIWindows(): Promise<SteamWindow[]>; + + /** + * Gets information about whether your OS will be unsupported in the future or not. + * @returns {Promise<OSEndOfLifeInfo>} + */ + GetOSEndOfLifeInfo(): Promise<OSEndOfLifeInfo>; + + /** + * Retrieves the current UI mode. + * @returns {Promise<UIMode>} - A Promise that resolves to the current UI mode. + */ + GetUIMode(): Promise<UIMode>; + + NotifyAppInitialized(): void; + + RegisterDesiredSteamUIWindowsChanged(callback: () => void): Unregisterable | any; + + RegisterForClientConVar: any; + + RegisterForErrorCondition(callback: (param0: number, param1: number) => void): Unregisterable | any; + + RegisterForKioskModeResetSignal(callback: () => void): Unregisterable | any; + + RegisterForUIModeChanged(callback: (mode: UIMode) => void): Unregisterable | any; + + ResetErrorCondition(): void; + + /** + * Sets the UI mode to the specified value. + * @param {UIMode} mode - The UI mode to set. + * @returns {void} + */ + SetUIMode(mode: UIMode): void; +} + +export enum UIMode { + Unknown = -1, + GamePad = 4, + Desktop = 7, +} + +export interface OSEndOfLifeInfo { + bOSWillBeUnsupported: boolean; + osType: OSType; +} + +export interface SteamWindow { + appid: number; + hwndParent: number; + nBrowserID: number; + strAppName: string; + unID: number; + unPID: number; + /** + * @todo enum + */ + windowType: number; + x: number; + y: number; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/URL.ts b/src/deck-components/steam-client/URL.ts new file mode 100644 index 00000000..1f951028 --- /dev/null +++ b/src/deck-components/steam-client/URL.ts @@ -0,0 +1,46 @@ +import {Unregisterable} from "./index"; + +export interface URL { + /** + * Executes a steam:// URL. + * @param url The URL to execute. + */ + ExecuteSteamURL(url: string): void; + + /** + * @remarks The array may be empty. + */ + GetSteamURLList(param0: string[]): Promise<SteamURLs>; + + GetWebSessionID(): Promise<string>; + + /** + * Registers a callback to be called when a steam:// URL gets executed. + * @param {string} section - `rungameid`, `open`, etc. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForRunSteamURL(section: string, callback: (param0: number, url: string) => void): Unregisterable | any; + + RegisterForSteamURLChanges(callback: () => void): void; +} + +export interface SteamURL { + url: string; + /** + * @todo enum? + */ + feature: number; +} + +export interface SteamURLs { + CommunityImages: SteamURL; + StoreAppImages: SteamURL; + BaseURLSharedCDN: SteamURL; + ClanAssetCDN: SteamURL; + CommunityCDN: SteamURL; + AvatarBaseURL: SteamURL; + StoreCDN: SteamURL; + WebAPI: SteamURL; + LocalSSA: SteamURL; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Updates.ts b/src/deck-components/steam-client/Updates.ts new file mode 100644 index 00000000..85d4bb0a --- /dev/null +++ b/src/deck-components/steam-client/Updates.ts @@ -0,0 +1,90 @@ +import {JsPbMessage, OperationResponse, Result, Unregisterable} from "./index"; + +export interface Updates { + ApplyUpdates(param0: string): Promise<OperationResponse>; + + CheckForUpdates(): Promise<OperationResponse>; // Checks for software updates + + GetCurrentOSBranch(): Promise<OSBranch>; + + /** + * If `data` is deserialized, returns {@link MsgSystemUpdateState}. + * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. + */ + RegisterForUpdateStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + + // 1 - Stable, 2 - Beta, 3 - Preview + SelectOSBranch(branch: number): any; // enum? +} + + +export interface OSBranch { + eBranch: OSBranchType; // 1 - Stable + sRawName: string; +} + +export enum OSBranchType { + Unknown = 0, + Release = 1, + ReleaseCandidate = 2, + Beta = 3, + BetaCandidate = 4, + Main = 5, + Staging = 6, +} + +/** + * CMsgSystemUpdateState + */ +export interface MsgSystemUpdateState extends JsPbMessage { + state(): UpdaterState | undefined; + + progress(): UpdateProgress | undefined; + + supports_os_updates(): boolean | undefined; + + update_apply_results(): UpdateApplyResult[]; + + update_check_results(): UpdateCheckResult[]; +} + +export interface UpdateApplyResult { + type: UpdaterType; + eresult: Result; + requires_client_restart: boolean; + requires_system_restart: boolean; +} + +export interface UpdateCheckResult { + type: UpdaterType; + eresult: Result; + rtime_checked: number; + available: boolean; +} + +export interface UpdateProgress { + stage_progress: number | undefined; + stage_size_bytes: number | undefined; + rtime_estimated_completion: number | undefined; +} + +export enum UpdaterState { + Invalid = 0, + UpToDate = 2, + Checking = 3, + Available = 4, + Applying = 5, + ClientRestartPending = 6, + SystemRestartPending = 7, +} + +export enum UpdaterType { + Invalid = 0, + Client = 1, + OS = 2, + BIOS = 3, + Aggregated = 4, + Test1 = 5, + Test2 = 6, + Dummy = 7, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/User.ts b/src/deck-components/steam-client/User.ts new file mode 100644 index 00000000..3ebdbe5c --- /dev/null +++ b/src/deck-components/steam-client/User.ts @@ -0,0 +1,193 @@ +import {OperationResponse, Unregisterable} from "./index"; + +export interface User { + AuthorizeMicrotxn(txnId: any): any; + + CancelLogin: any; + + CancelMicrotxn(txnId: any): any; + + /** + * Tries to cancel Steam shutdown. + * @returns {void} + * @remarks Used in the "Shutting down" dialog. + */ + CancelShutdown(): void; + + /** + * Opens the "Change Account" dialog. + * @returns {void} + */ + ChangeUser(): void; + + Connect(): Promise<OperationResponse>; + + FlipToLogin(): void; + + /** + * Forces a shutdown while shutting down. + * @returns {void} + * @remarks Used in the "Shutting down" dialog. + */ + ForceShutdown(): void; + + /** + * Forgets an account's password. + * @param {string} accountName - Login of the account to forget. + * @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the operation succeeded or not. + */ + ForgetPassword(accountName: string): Promise<boolean>; + + /** + * Gets your country code. + * @returns {Promise<string>} A Promise that resolves to a string containing your country code. + */ + GetIPCountry(): Promise<string>; + + GetLoginProgress(callback: (param0: number, param1: number) => void): Unregisterable | any; + + GetLoginUsers(): Promise<LoginUser[]>; + + GoOffline(): void; + + GoOnline(): void; + + OptOutOfSurvey(): void; + + PrepareForSystemSuspend(): any; + + Reconnect(): void; + + RegisterForConnectionAttemptsThrottled(callback: (data: ConnectionAttempt) => void): Unregisterable | any; + + RegisterForCurrentUserChanges(callback: (user: CurrentUser) => void): void; + + RegisterForLoginStateChange(callback: (accountName: string, loginState: LoginState, loginResult: number, loginPercentage: number, param4: number) => void): Unregisterable | any; + + RegisterForPrepareForSystemSuspendProgress(callback: (data: any) => void): Unregisterable | any; + + RegisterForResumeSuspendedGamesProgress: Unregisterable | any; + + RegisterForShutdownDone(callback: () => void): Unregisterable | any; + + RegisterForShutdownFailed: Unregisterable | any; + + /** + * Register a function to be executed when a shutdown start is detected. + * @param callback The function to be executed on shutdown start. + */ + RegisterForShutdownStart(callback: () => void): Unregisterable | any; + + RegisterForShutdownState: Unregisterable | any; + + /** + * Removes an account from remembered users. + * @param {string} accountName - The account to remove. + * @returns {void} + */ + RemoveUser(accountName: string): void; + + RequestSupportSystemReport(reportId: string): Promise<{ + bSuccess: boolean; + }>; + + ResumeSuspendedGames(param0: boolean): any; + + // Hardware survey information + RunSurvey(callback: (surveySections: SurveySection[]) => void): void; + + SendSurvey: any; + + SetAsyncNotificationEnabled(appId: number, enable: boolean): any; + + /** + * Sets given login credentials, but don't log in to that account. + * @param {string} accountName - Account name. + * @param {string} password - Account password. + * @param {boolean} rememberMe - Whether to remember that account. + * @returns {void} + */ + SetLoginCredentials(accountName: string, password: string, rememberMe: boolean): void; + + SetOOBEComplete(): void; + + ShouldShowUserChooser(): Promise<boolean>; + + /** + * Signs out and restarts Steam. + * @returnsn {void} + */ + SignOutAndRestart(): void; + + StartLogin(): void; + + // is param0 offline mode? + StartOffline(param0: boolean): any; + + /** + * Restarts the Steam client. + */ + StartRestart(): any; + + StartShutdown(flag: boolean): any; +} + +export interface ConnectionAttempt { + rtCooldownExpiration: number; +} + +export interface CurrentUser { + NotificationCounts: { + async_game_updates: number; + comments: number; + gifts: number; + help_request_replies: number; + inventory_items: number; + invites: number; + moderator_messages: number; + offline_messages: number; + trade_offers: number; + }; + bHWSurveyPending: boolean; + bIsLimited: boolean; + bIsOfflineMode: boolean; + bPromptToChangePassword: boolean; + bSupportAckOnlyMessages: boolean; + bSupportAlertActive: boolean; + bSupportPopupMessage: boolean; + clientinstanceid: string; + strAccountBalance: string; + strAccountBalancePending: string; + strAccountName: string; + strFamilyGroupID: string; + strSteamID: string; +} + +export enum LoginState { + None = 0, + WelcomeDialog = 1, + WaitingForCreateUser = 2, + WaitingForCredentials = 3, + WaitingForNetwork = 4, + WaitingForServerResponse = 5, + WaitingForLibraryReady = 6, + Success = 7, + Quit = 8, +} + +export interface LoginUser { + personaName: string; + accountName: string; + rememberPassword: boolean; + avatarUrl: string; +} + +export interface SurveyEntry { + strName: string; + vecArgs: string[]; +} + +export interface SurveySection { + strSectionName: string; + vecEntries: SurveyEntry[]; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/WebChat.ts b/src/deck-components/steam-client/WebChat.ts new file mode 100644 index 00000000..be8c21f1 --- /dev/null +++ b/src/deck-components/steam-client/WebChat.ts @@ -0,0 +1,157 @@ +import {OverlayBrowserInfo} from "./Overlay"; +import {UIMode} from "./UI"; +import {Unregisterable} from "./index"; + +export interface WebChat { + BSuppressPopupsInRestore(): Promise<boolean>; + + /** + * Gets your Steam3 ID. + * @returns {Promise<number>} A Promise that resolves to a Steam3 ID. + */ + GetCurrentUserAccountID(): Promise<number>; + + /** + * Gets the current user's 64x64 avatar as a data URL. + * @returns {Promise<string>} A Promise that resolves to the data URL. + */ + GetLocalAvatarBase64(): Promise<string>; + + /** + * Gets the current user's nickname. + * @returns {Promise<string>} A Promise that resolves to the nickname. + */ + GetLocalPersonaName(): Promise<string>; + + GetOverlayChatBrowserInfo(): Promise<OverlayBrowserInfo[]>; + + // param0 - appid ? + GetPrivateConnectString(param0: number): Promise<string>; + + /** + * Gets information about push-to-Talk. + * @returns {Promise<PushToTalkInfo>} + */ + GetPushToTalkEnabled(): Promise<PushToTalkInfo>; + + /** + * Gets the "Sign in to friends when Steam starts" option value. + * @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the option is enabled or not. + */ + GetSignIntoFriendsOnStart(): Promise<boolean>; + + /** + * Retrieves the current UI mode. + * @returns {Promise<UIMode>} - A Promise that resolves to the current UI mode. + */ + GetUIMode(): Promise<UIMode>; + + OnGroupChatUserStateChange(chatGroupId: any, accountId: any, action: any): any; + + OnNewGroupChatMsgAdded( + groupId: number, + chatId: number, + accountId: number, + timestamp: number, + param4: number, + message: string, + ): any; + + // Opens the URL in default web browser, despite what the name says ? + OpenURLInClient(url: string, pid: number, forceExternal: boolean): void; + + /** + * Registers a callback function to be called when the computer's active state changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @todo Changes to 2 after 10 seconds? + * @todo Does not affect the keyboard? + */ + RegisterForComputerActiveStateChange( + callback: (state: ComputerActiveState, time: number) => void, + ): Unregisterable | any; + + /** + * @todo WebChat.ShowFriendChatDialog does this. + */ + RegisterForFriendPostMessage(callback: (data: FriendChatDialogData) => void): Unregisterable | any; + + /** + * @returns {void} + * @todo To unregister, use WebChat.UnregisterForMouseXButtonDown() ? + */ + RegisterForMouseXButtonDown(callback: any): void; + + /** + * Registers a callback function to be called when the push-to-talk state changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForPushToTalkStateChange(callback: (state: boolean) => void): Unregisterable | any; + + /** + * Registers a callback function to be called when the UI mode is changed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForUIModeChange(callback: (mode: UIMode) => void): Unregisterable | any; + + RegisterOverlayChatBrowserInfoChanged(callback: any): Unregisterable | any; + + SetActiveClanChatIDs(clanChatIds: any[]): any; + + SetNumChatsWithUnreadPriorityMessages(size: number): void; + + SetPersonaName: any; + + SetPushToMuteEnabled(value: boolean): any; + + SetPushToTalkEnabled(value: boolean): any; + + SetPushToTalkHotKey(param0: number): void; + + SetPushToTalkMouseButton(param0: number): void; + + SetVoiceChatActive: any; + SetVoiceChatStatus: any; + ShowChatRoomGroupDialog: any; + + /** + * @todo Does not actually show the dialog. + */ + ShowFriendChatDialog(steamid: string): void; + + UnregisterForMouseXButtonDown(): void; +} + +export enum ComputerActiveState { + Invalid = 0, + Active = 1, + Idle = 2, +} + +export interface FriendChatDialog { + browserid: number; + btakefocus: string; + command: string; + pid: number; + steamid: string; +} + +export interface FriendChatDialogData { + data: FriendChatDialog; +} + +export interface PushToTalkInfo { + /** Indicates whether push-to-talk is enabled. */ + bEnabled: boolean; + /** Indicates whether push-to-mute is in use instead. */ + bPushToMute: boolean; + /** + * Push-to-talk hotkey. + * @todo enum? + */ + vkHotKey: number; + /** Push-to-talk hotkey name. */ + strKeyName: string; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/WebUITransport.ts b/src/deck-components/steam-client/WebUITransport.ts new file mode 100644 index 00000000..8ed6ee93 --- /dev/null +++ b/src/deck-components/steam-client/WebUITransport.ts @@ -0,0 +1,12 @@ +export interface WebUITransport { + GetTransportInfo(): Promise<TransportInfo>; + + NotifyTransportFailure: any; +} + +export interface TransportInfo { + authKeyClientdll: string; + authKeySteamUI: string; + portClientdll: number; + portSteamUI: number; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/Window.ts b/src/deck-components/steam-client/Window.ts new file mode 100644 index 00000000..39079ed6 --- /dev/null +++ b/src/deck-components/steam-client/Window.ts @@ -0,0 +1,215 @@ +import {UIComposition} from "./Overlay"; + +/** + * Represents functionality for managing Steam's windows. + * Note that methods here have to be called from the window you want to use. + */ +export interface Window { + BringToFront(forceOS?: WindowBringToFront): any; + + /** + * @todo Shuts down Steam too? + */ + Close(): any; + + /** + * Is the Steam window fullscreen? + * @param {function} callback - The callback function to be called to receive the fullscreen state. + * @returns {void} + */ + DefaultMonitorHasFullscreenWindow(callback: (fullscreen: boolean) => void): void; + + /** + * Flashes the window in the taskbar. + * @returns {void} + */ + FlashWindow(): void; + + /** + * @todo Returns 0? + */ + GetDefaultMonitorDimensions(callback: (param0: number) => void): void; + + GetMousePositionDetails(callback: (details: string) => void): void; + + /** + * Gets the window X position. + * @param {function} callback - The callback function to be called to receive the X position. + * @returns {void} + */ + GetWindowDimensions(callback: (x: number) => void): void; + + GetWindowRestoreDetails(callback: (details: string) => void): void; + + /** + * Hides the window. + * @returns {void} + */ + HideWindow(): void; + + /** + * Is the window maximized? + * @param {function} callback - The callback function to be called to receive the maximized state. + * @returns {void} + */ + IsWindowMaximized(callback: (maximized: boolean) => void): void; + + /** + * Is the window minimized? + * @param {function} callback - The callback function to be called to receive the minimized state. + * @returns {void} + */ + IsWindowMinimized(callback: (minimized: boolean) => void): void; + + MarkLastFocused(): void; + + /** + * Minimizes the window. + * @returns {void} + */ + Minimize(): void; + + /** + * Moves the window to given coordinates. + * @param {number} x - Window X position. + * @param {number} y - Window Y position. + * @param {number | undefined} dpi - Screen DPI. + * @returns {void} + */ + MoveTo(x: number, y: number, dpi: number | undefined): void; + + /** + * Moves the window to a given location. + * @param {string} location - Window location. + * @param {number | undefined} offset - X/Y offset. + * @returns {void} + */ + MoveToLocation(location: WindowLocation, offset: number | undefined): void; + + /** + * Moves the window relatively to given details. + * @param {string} details - Window details string from `Window.GetWindowRestoreDetails`. + * @param {number} x - Window X position. + * @param {number} y - Window Y position. + * @param {number} width - Window width. + * @param {number} height - Window height. + * @returns {void} + * + * @example + * Move the window to bottom right by 50 pixels: + * ``` + * SteamClient.Window.GetWindowRestoreDetails(e => { + * SteamClient.Window.PositionWindowRelative(e, 50, 50, 0, 0); + * }) + * ``` + */ + PositionWindowRelative(details: string, x: number, y: number, width: number, height: number): void; + + ProcessShuttingDown(): Promise<boolean>; + + /** + * Resizes the window to given dimension. + * The window has to be created with the resizable flag. + * @param {number} width - Window width. + * @param {number} height - Window height. + * @param {boolean | number} applyBrowserScaleOrDPIValue + * @returns {void} + */ + ResizeTo(width: number, height: number, applyBrowserScaleOrDPIValue: boolean | number): void; + + /** + * Moves the window to given details. + * @param {string} details - Window details string from `Window.GetWindowRestoreDetails`. + * @returns {void} + */ + RestoreWindowSizeAndPosition(details: string): void; + + SetAutoDisplayScale(value: boolean): void; + + SetComposition(uiComposition: UIComposition, appIds: number[], windowId: number): any; + + /** + * Makes the window hide, but not close on pressing the close button. + * @param {boolean} value - Hide on close? + * @returns {void} + */ + SetHideOnClose(value: boolean): void; + + SetKeyFocus(value: boolean): void; + + SetManualDisplayScaleFactor(displayScaleFactor: number): void; + + /** + * Sets the window's max size. + * @param {number} width - Window's max width. + * @param {number} height - Window's max height. + * @returns {void} + */ + SetMaxSize(width: number, height: number): void; + + /** + * Sets the window's min size. + * @param {number} width - Window's max width. + * @param {number} height - Window's max height. + * @returns {void} + */ + SetMinSize(width: number, height: number): void; + + SetModal(value: boolean): void; + + /** + * Sets the window's resize grip size. + * The window has to be created with the resize grip flag. + * @param {number} width - Resize grip width. + * @param {number} height - Resize grip height. + * @returns {void} + */ + SetResizeGrip(width: number, height: number): void; + + /** + * Set the window's icon. + * @param {WindowIcon} icon - The window icon to be used. + * @returns {void} + */ + SetWindowIcon(icon: WindowIcon): void; + + /** + * Shows the window. + * @returns {void} + */ + ShowWindow(): void; + + /** + * Stops the window's taskbar flashing. + * @returns {void} + */ + StopFlashWindow(): void; + + /** + * Toggles the window's fullscreen state. + * @returns {void} + */ + ToggleFullscreen(): void; + + /** + * Toggles the window's maximized state. + * @returns {void} + */ + ToggleMaximize(): void; +} + +export enum WindowBringToFront { + Invalid = 0, + ForceOS = 1, + WithoutForcingOS = 2, +} + +export type WindowLocation = + | 'upper-left' + | 'lower-left' + | 'center-top' + | 'center-bottom' + | 'upper-right' + | 'lower-right'; + +export type WindowIcon = 'steam' | 'messages' | 'voice'; \ No newline at end of file diff --git a/src/deck-components/steam-client/browser-view/BrowserViewPopup.ts b/src/deck-components/steam-client/browser-view/BrowserViewPopup.ts new file mode 100644 index 00000000..91c64f1c --- /dev/null +++ b/src/deck-components/steam-client/browser-view/BrowserViewPopup.ts @@ -0,0 +1,389 @@ +import {TouchGestureType} from "../Browser"; + +export interface BrowserViewPopup { + /** + * Blur the popup. + * @param {boolean} enabled - Is the blur enabled? + * @param {boolean} backgroundColor + * @param {boolean} blur + * @returns {void} + * @todo backgroundColor is a bool? Whatever that means + */ + AddGlass(enabled: boolean, backgroundColor: boolean, blur: boolean): void; + + /** + * Indicates whether you can go backward in history or not. + * @returns {boolean} true if you can go backward in history, false otherwise. + */ + CanGoBackward(): boolean; + + /** + * Indicates whether you can go forward in history or not. + * @returns {boolean} true if you can go forward in history, false otherwise. + */ + CanGoForward(): boolean; + + // alert() i assume + DialogResponse(param0: boolean): void; + + EnableSteamInput(): void; + + /** + * Find a string in the page. + * @param {string} input - The string to find. + * @param {boolean} param1 - Additional parameter (exact usage may vary). + * @param {boolean} previous - `true` for previous match, `false` for next match. + * @returns {void} + */ + FindInPage(input: string, param1: boolean, previous: boolean): void; + + /** + * Get the current popup position. + * @returns {BrowserViewBounds} The window position. + */ + GetBounds(): BrowserViewBounds; + + /** + * Go back in history. + * @returns {void} + */ + GoBack(): void; + + /** + * Go forward in history. + * @returns {void} + */ + GoForward(): void; + + /** + * @remarks `| number` is used for `BrowserViewContextMenu.custom_commands`. + */ + HandleContextMenuCommand(command: BrowserViewContextMenuCommand | number, param2: BrowserViewContextMenu): void; + + /** + * Load the specified URL. + * @param {string} url - The URL to go to. + * @returns {void} + */ + LoadURL(url: string): void; + + NotifyUserActivation(): void; + + /** + * Paste the current clipboard selection. + * @returns {void} + */ + Paste(): void; + + PostMessage(message: string, args: string): boolean; + + /** + * Reload the page. + * @returns {void} + */ + Reload(): void; + + /** + * Load the specified URL, but don't save history. + * @param {string} url - The URL to go to. + * @returns {void} + */ + ReplaceURL(url: string): void; + + /** + * Define blocked protocols, like https, etc. + * @param protocols The protocols to block, separated by a semicolon. + * @returns {void} + */ + SetBlockedProtocols(protocols: string): void; + + /** + * Sets the browser window position. + * @param {number} x - Browser window X position. + * @param {number} y - Browser window Y position. + * @param {number} width - Browser window width. + * @param {number} height - Browser window height. + * @returns {void} + */ + SetBounds(x: number, y: number, width: number, height: number): void; + + /** + * Sets the browser window focus state. + * @param {boolean} value - Is the window focused? + * @returns {void} + */ + SetFocus(value: boolean): void; + + SetName(browserName: string): void; + + /** + * Registers a callback to be called when a context menu is shown. + * @param {function} callback - The callback function to be called. + */ + SetShowContextMenuCallback(callback: (data: BrowserViewContextMenu) => void): void; + + /** + * Registers a callback to be called when a steam:// protocol URL is loaded. + * @returns {void} + */ + SetSteamURLCallback(callback: (steamURL: string) => void): void; + + /** + * Raises the browser window. + * @returns {void} + */ + SetTopWindow(): void; + + /** + * @todo unconfirmed + */ + SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; + + SetVRKeyboardVisibility(value: boolean): void; + + SetVisible(value: boolean): void; + + /** + * Stop the "find in page" function. + * @returns {void} + */ + StopFindInPage(): void; + + /** + * Stop listening for an event. + * @param {BrowserViewEvent} event - The event to stop listening to. + * @param {function} callback - The callback function to be called. + * @returns {void} + */ + off(event: BrowserViewEvent, callback: (args: any) => void): void; + + /** + * Start listening for an event. + * @param {BrowserViewEvent} event - The event to start listening to. + * @param {function} callback - The callback function to be called. + * @returns {void} + */ + on(event: BrowserViewEvent, callback: (args: any) => void): void; + + /** + * Fires when an `alert()` dialog appears. + */ + on(event: 'alert-dialog', callback: (message: string) => void): void; + + /** + * Fires when the browser is about to get destroyed. + */ + on(event: 'before-close', callback: () => void): void; + + /** + * Fires when a URL gets blocked. + * @todo not SetBlockedProtocols, maybe only steam links + */ + on(event: 'blocked-request', callback: (blockedURL: string) => void): void; + + /** + * Fires when `CanGoBack() or `CanGoForward()` state changes. + */ + on(event: 'can-go-back-forward-changed', callback: (canGoBackward: boolean, canGoForward: boolean) => void): void; + + /** + * Fires when a `confirm()` dialog appears. + */ + on(event: 'confirm-dialog', callback: (message: string) => void): void; + + /** + * Fires when the browser's favicon changes. + */ + on(event: 'favicon-urls-changed', callback: (faviconURLs: string[]) => void): void; + + /** + * Fires when "Find in page" gets its results. + */ + on(event: 'find-in-page-results', callback: (results: number, activeResultIndex: number) => void): void; + + /** + * Fires when the page finishes loading. + */ + on(event: 'finished-request', callback: (currentURL: string, previousURL: string) => void): void; + + /** + * Fires when the browser goes focused or vice versa. + */ + on(event: 'focus-changed', callback: (focused: boolean) => void): void; + + /** + * Fires when the browser goes fullscreen or vice versa. + */ + on(event: 'full-screen', callback: (fullscreen: boolean) => void): void; + + /** + * Fires when history changes occur. + */ + on(event: 'history-changed', callback: (history: BrowserViewHistory) => void): void; + + /** + * Fires when the URL fails to load. + */ + on(event: 'load-error', callback: (errorCode: number, errorURL: string, errorDescription: string) => void): void; + + /** + * @todo Same as PostMessage? + */ + on(event: 'message', callback: (args: any) => void): void; + + on(event: 'new-tab', callback: (args: any) => void): void; + + /** + * Fires when a node gets focused. + */ + on( + event: 'node-has-focus', + callback: ( + elementIdOrTagName: string, + elementTag: string, + param2: any, + param3: string, + param4: boolean, + ) => void, + ): void; + + on(event: 'page-security', callback: (url: string, pageSecurity: BrowserViewPageSecurity) => void): void; + + /** + * Fires when the page's `<title>` changes. + */ + on(event: 'set-title', callback: (title: string) => void): void; + + /** + * Fires when the page starts loading. + */ + on(event: 'start-loading', callback: (url: string, param1: boolean) => void): void; + + /** + * Fires when the page starts loading. + */ + on(event: 'start-request', callback: (url: string) => void): void; + + /** + * Fires when "Find in page" gets toggled. + */ + on(event: 'toggle-find-in-page', callback: () => void): void; +} + + +export interface BrowserViewBounds { + x: number; + y: number; + width: number; + height: number; +} + +export interface BrowserViewContextMenu { + /** + * Mouse X position inside the browser view. + */ + coord_x: number; + /** + * Mouse Y position inside the browser view. + */ + coord_y: number; + custom_commands: BrowserViewContextMenuCustomCommand[]; + /** + * Bitmask representing edit state. + * @remarks Appears on editable elements like `<input>`, etc. + * @example + * May be used with BrowserViewContextMenuEditFlag: + * ```js + * edit_state_flags & BrowserViewContextMenuEditFlag.CanCut != 0 // Can cut text + * ``` + */ + edit_state_flags?: number; + /** + * The misspelled word the cursor is on. + * @remarks Appears on an editable element with text. + */ + misspelled_word?: string; + /** + * Browser page URL. + * @todo Appears when there is selected text? + */ + link_url?: string; + /** + * Browser page URL. + */ + page_url: string; + /** + * Selected text. + * @remarks Appears when there is selected text. + */ + selection_text?: string; + /** + * Bitmask representing context menu type. + * @example + * May be used with BrowserViewContextMenuTypeFlag: + * ```js + * type_flags & BrowserViewContextMenuTypeFlag.Selection != 0 // Selected text present + * ``` + */ + type_flags: number; + /** + * Browser page URL. + * @todo Appears when there is selected text? + */ + unfiltered_link_url?: string; +} + +export interface BrowserViewContextMenuCustomCommand { + id: number; + label: string; +} + +export enum BrowserViewContextMenuCommand { + Close = -1, + OpenDevTools = 26500, + CloseDevTools = 26501, + InspectElement = 26502, + OpenLinkInNewTab = 26503, +} + +export type BrowserViewEvent = + | 'alert-dialog' + | 'before-close' + | 'blocked-request' + | 'can-go-back-forward-changed' + | 'confirm-dialog' + | 'favicon-urls-changed' + | 'find-in-page-results' + | 'finished-request' + | 'focus-changed' + | 'full-screen' + | 'history-changed' + | 'load-error' + | 'message' + | 'new-tab' + | 'node-has-focus' + | 'page-security' + | 'set-title' + | 'start-loading' + | 'start-request' + | 'toggle-find-in-page'; + + +export interface BrowserViewHistory { + index: number; + entries: BrowserViewHistoryEntry[]; +} + +export interface BrowserViewHistoryEntry { + url: string; +} + +export interface BrowserViewPageSecurity { + bHasCertError: boolean; + bIsEVCert: boolean; + bIsSecure: boolean; + certExpiry: number; + certName: string; + issuerName: string; + nCertBits: number; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/browser-view/index.ts b/src/deck-components/steam-client/browser-view/index.ts new file mode 100644 index 00000000..acc8b2fa --- /dev/null +++ b/src/deck-components/steam-client/browser-view/index.ts @@ -0,0 +1,27 @@ +import {BrowserViewPopup} from "./BrowserViewPopup"; + +export interface BrowserView { + Create(browser?: BrowserViewInit): BrowserViewPopup; + + CreatePopup(browser?: BrowserViewInit): { + /** + * URL for usage with `window.open()`. + */ + strCreateURL: string; + browserView: BrowserViewPopup; + }; + + Destroy(browser: BrowserViewInit): void; + + PostMessageToParent(message: string, args: string): void; +} + +export interface BrowserViewInit { + bOnlyAllowTrustedPopups?: boolean; + parentPopupBrowserID?: number; + /** Initial URL to go to. */ + strInitialURL?: string; + strUserAgentIdentifier?: string; + strUserAgentOverride?: string; + strVROverlayKey?: string; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/index.ts b/src/deck-components/steam-client/index.ts new file mode 100644 index 00000000..da0895d5 --- /dev/null +++ b/src/deck-components/steam-client/index.ts @@ -0,0 +1,560 @@ +import {AppDetails, Apps, Shortcut} from "./App"; +import {Auth} from "./Auth"; +import {Broadcast} from "./Broadcast"; +import {Browser} from "./Browser"; +import {BrowserView} from "./browser-view"; +import {ClientNotifications} from "./ClientNotifications"; +import {Cloud} from "./Cloud"; +import {CommunityItems} from "./CommunityItems"; +import {Console} from "./Console"; +import {Customization} from "./Customization"; +import {Downloads} from "./Downloads"; +import {FamilySharing} from "./FamilySharing"; +import {FriendSettings} from "./FriendSettings"; +import {Friends} from "./Friends"; +import {GameNotes} from "./GameNotes"; +import {GameSessions} from "./GameSessions"; +import {Input} from "./Input"; +import {InstallFolder} from "./InstallFolder"; +import {Installs} from "./Installs"; +import {Messaging} from "./Messaging"; +import {Music} from "./Music"; +import {Notifications} from "./Notifications"; +import {OpenVR} from "./OpenVR"; +import {Overlay} from "./Overlay"; +import {Storage} from "./Storage"; +import {Parental} from "./Parental"; +import {RemotePlay} from "./RemotePlay"; +import {ServerBrowser} from "./ServerBrowser"; +import {Screenshots} from "./Screenshots"; +import {Settings} from "./Settings"; +import {SharedConnection} from "./SharedConnection"; +import {Stats} from "./Stats"; +import {SteamChina} from "./SteamChina"; +import {Streaming} from "./Streaming"; +import {System} from "./system"; +import {UI} from "./UI"; +import {Updates} from "./Updates"; +import {User} from "./User"; +import {WebChat} from "./WebChat"; +import {WebUITransport} from "./WebUITransport"; +import {Window} from "./Window"; +import {Device} from "./system/network/Device"; + +export interface SteamClient { + Apps: Apps; + Auth: Auth; + Broadcast: Broadcast; + Browser: Browser; + BrowserView: BrowserView; + ClientNotifications: ClientNotifications; + Cloud: Cloud; + CommunityItems: CommunityItems; + Console: Console; + Customization: Customization; + Downloads: Downloads; + FamilySharing: FamilySharing; + Friends: Friends; + FriendSettings: FriendSettings; + GameNotes: GameNotes; + GameSessions: GameSessions; + Input: Input; + InstallFolder: InstallFolder; + Installs: Installs; + MachineStorage: Storage; + Messaging: Messaging; + Music: Music; + Notifications: Notifications; + OpenVR: OpenVR; + Overlay: Overlay; + Parental: Parental; + RemotePlay: RemotePlay; + RoamingStorage: Storage; + Screenshots: Screenshots; + ServerBrowser: ServerBrowser; + Settings: Settings; + SharedConnection: SharedConnection; + Stats: Stats; + SteamChina: SteamChina; + Storage: Storage; + Streaming: Streaming; + System: System; + UI: UI; + URL: URL; + Updates: Updates; + User: User; + WebChat: WebChat; + WebUITransport: WebUITransport; + Window: Window; +} + +export enum Result { + OK = 1, + Fail = 2, + NoConnection = 3, + InvalidPassword = 5, + LoggedInElsewhere = 6, + InvalidProtocolVer = 7, + InvalidParam = 8, + FileNotFound = 9, + Busy = 10, + InvalidState = 11, + InvalidName = 12, + InvalidEmail = 13, + DuplicateName = 14, + AccessDenied = 15, + Timeout = 16, + Banned = 17, + AccountNotFound = 18, + InvalidSteamID = 19, + ServiceUnavailable = 20, + NotLoggedOn = 21, + Pending = 22, + EncryptionFailure = 23, + InsufficientPrivilege = 24, + LimitExceeded = 25, + Revoked = 26, + Expired = 27, + AlreadyRedeemed = 28, + DuplicateRequest = 29, + AlreadyOwned = 30, + IPNotFound = 31, + PersistFailed = 32, + LockingFailed = 33, + LogonSessionReplaced = 34, + ConnectFailed = 35, + HandshakeFailed = 36, + IOFailure = 37, + RemoteDisconnect = 38, + ShoppingCartNotFound = 39, + Blocked = 40, + Ignored = 41, + NoMatch = 42, + AccountDisabled = 43, + ServiceReadOnly = 44, + AccountNotFeatured = 45, + AdministratorOK = 46, + ContentVersion = 47, + TryAnotherCM = 48, + PasswordRequiredToKickSession = 49, + AlreadyLoggedInElsewhere = 50, + Suspended = 51, + Cancelled = 52, + DataCorruption = 53, + DiskFull = 54, + RemoteCallFailed = 55, + PasswordUnset = 56, + ExternalAccountUnlinked = 57, + PSNTicketInvalid = 58, + ExternalAccountAlreadyLinked = 59, + RemoteFileConflict = 60, + IllegalPassword = 61, + SameAsPreviousValue = 62, + AccountLogonDenied = 63, + CannotUseOldPassword = 64, + InvalidLoginAuthCode = 65, + AccountLogonDeniedNoMail = 66, + HardwareNotCapableOfIPT = 67, + IPTInitError = 68, + ParentalControlRestricted = 69, + FacebookQueryError = 70, + ExpiredLoginAuthCode = 71, + IPLoginRestrictionFailed = 72, + AccountLockedDown = 73, + AccountLogonDeniedVerifiedEmailRequired = 74, + NoMatchingURL = 75, + BadResponse = 76, + RequirePasswordReEntry = 77, + ValueOutOfRange = 78, + UnexpectedError = 79, + Disabled = 80, + InvalidCEGSubmission = 81, + RestrictedDevice = 82, + RegionLocked = 83, + RateLimitExceeded = 84, + AccountLoginDeniedNeedTwoFactor = 85, + ItemDeleted = 86, + AccountLoginDeniedThrottle = 87, + TwoFactorCodeMismatch = 88, + TwoFactorActivationCodeMismatch = 89, + AccountAssociatedToMultiplePartners = 90, + NotModified = 91, + NoMobileDevice = 92, + TimeNotSynced = 93, + SmsCodeFailed = 94, + AccountLimitExceeded = 95, + AccountActivityLimitExceeded = 96, + PhoneActivityLimitExceeded = 97, + RefundToWallet = 98, + EmailSendFailure = 99, + NotSettled = 100, + NeedCaptcha = 101, + GSLTDenied = 102, + GSOwnerDenied = 103, + InvalidItemType = 104, + IPBanned = 105, + GSLTExpired = 106, + InsufficientFunds = 107, + TooManyPending = 108, + NoSiteLicensesFound = 109, + WGNetworkSendExceeded = 110, + AccountNotFriends = 111, + LimitedUserAccount = 112, +} + +/** + * Represents the response of an operation. It appears to be not necessary to await for this operation response. It is only used to indicate the result of an operation. + */ +export interface OperationResponse { + /** + * The result code of the operation. + */ + result: Result; + + /** + * A message describing the result of the operation. + */ + message: string; +} + +export interface Unregisterable { + /** + * Unregister the callback. + */ + unregister(): void; +} + +/** + * JsPb message class. + */ +export interface JsPbMessageClass { + /** + * @todo Returns {@link JsPbMessage}, but not sure how to do it for the messages. + */ + deserializeBinary(data: ArrayBuffer): any; +} + +/** + * Deserialized JsPb message. + */ +export interface JsPbMessage { + getClassName(): string; + + serializeBase64String(): string; + + serializeBinary(): Uint8Array; + + /** + * Converts the message to an object. + */ + toObject(includeJsPbInstance: boolean): any; +} + + + + + + +//todo: Organize the interfaces below +export interface SteamShortcut { + appid: number; + data: Shortcut; +} + +export interface AppData { + details: AppDetails; + // more +} + +export interface NotificationOptions { + body: string; + chatroomgroupid?: number; + chatroomid?: number; + icon?: string; + state: string; + /** A Steam64 ID. */ + steamid: string; + tag?: string; + title?: string; +} + +export interface SteamDatagramLinkInstantaneousStats { + out_packets_per_sec_x10: number | undefined; + out_bytes_per_sec: number | undefined; + in_packets_per_sec_x10: number | undefined; + in_bytes_per_sec: number | undefined; + ping_ms: number | undefined; + packets_dropped_pct: number | undefined; + packets_weird_sequence_pct: number | undefined; + peak_jitter_usec: number | undefined; +} + +export interface SteamDatagramLinkLifetimeStats { + connected_seconds: number | undefined; + packets_sent: number | undefined; + kb_sent: number | undefined; + packets_recv: number | undefined; + kb_recv: number | undefined; + packets_recv_sequenced: number | undefined; + packets_recv_dropped: number | undefined; + packets_recv_out_of_order: number | undefined; + packets_recv_out_of_order_corrected: number | undefined; + packets_recv_duplicate: number | undefined; + packets_recv_lurch: number | undefined; + multipath_packets_recv_sequenced: number[]; + multipath_packets_recv_later: number[]; + multipath_send_enabled: number | undefined; + quality_histogram_100: number | undefined; + quality_histogram_99: number | undefined; + quality_histogram_97: number | undefined; + quality_histogram_95: number | undefined; + quality_histogram_90: number | undefined; + quality_histogram_75: number | undefined; + quality_histogram_50: number | undefined; + quality_histogram_1: number | undefined; + quality_histogram_dead: number | undefined; + quality_ntile_2nd: number | undefined; + quality_ntile_5th: number | undefined; + quality_ntile_25th: number | undefined; + quality_ntile_50th: number | undefined; + ping_histogram_25: number | undefined; + ping_histogram_50: number | undefined; + ping_histogram_75: number | undefined; + ping_histogram_100: number | undefined; + ping_histogram_125: number | undefined; + ping_histogram_150: number | undefined; + ping_histogram_200: number | undefined; + ping_histogram_300: number | undefined; + ping_histogram_max: number | undefined; + ping_ntile_5th: number | undefined; + ping_ntile_50th: number | undefined; + ping_ntile_75th: number | undefined; + ping_ntile_95th: number | undefined; + ping_ntile_98th: number | undefined; + jitter_histogram_negligible: number | undefined; + jitter_histogram_1: number | undefined; + jitter_histogram_2: number | undefined; + jitter_histogram_5: number | undefined; + jitter_histogram_10: number | undefined; + jitter_histogram_20: number | undefined; + txspeed_max: number | undefined; + txspeed_histogram_16: number | undefined; + txspeed_histogram_32: number | undefined; + txspeed_histogram_64: number | undefined; + txspeed_histogram_128: number | undefined; + txspeed_histogram_256: number | undefined; + txspeed_histogram_512: number | undefined; + txspeed_histogram_1024: number | undefined; + txspeed_histogram_max: number | undefined; + txspeed_ntile_5th: number | undefined; + txspeed_ntile_50th: number | undefined; + txspeed_ntile_75th: number | undefined; + txspeed_ntile_95th: number | undefined; + txspeed_ntile_98th: number | undefined; + rxspeed_max: number | undefined; + rxspeed_histogram_16: number | undefined; + rxspeed_histogram_32: number | undefined; + rxspeed_histogram_64: number | undefined; + rxspeed_histogram_128: number | undefined; + rxspeed_histogram_256: number | undefined; + rxspeed_histogram_512: number | undefined; + rxspeed_histogram_1024: number | undefined; + rxspeed_histogram_max: number | undefined; + rxspeed_ntile_5th: number | undefined; + rxspeed_ntile_50th: number | undefined; + rxspeed_ntile_75th: number | undefined; + rxspeed_ntile_95th: number | undefined; + rxspeed_ntile_98th: number | undefined; +} + +export interface SteamDatagramConnectionQuality { + instantaneous: SteamDatagramLinkInstantaneousStats | undefined; + lifetime: SteamDatagramLinkLifetimeStats | undefined; +} + +export interface SteamNetworkingICESessionSummary { + failure_reason_code: number | undefined; + local_candidate_types: number | undefined; + remote_candidate_types: number | undefined; + initial_route_kind: number | undefined; + initial_ping: number | undefined; + initial_score: number | undefined; + negotiation_ms: number | undefined; + best_route_kind: number | undefined; + best_ping: number | undefined; + best_score: number | undefined; + best_time: number | undefined; + selected_seconds: number | undefined; + user_settings: number | undefined; + ice_enable_var: number | undefined; + local_candidate_types_allowed: number | undefined; +} + +export interface SteamNetworkingP2PSDRRoutingSummary { + initial_ping: number | undefined; + initial_ping_front_local: number | undefined; + initial_ping_front_remote: number | undefined; + initial_score: number | undefined; + initial_pop_local: number | undefined; + initial_pop_remote: number | undefined; + best_ping: number | undefined; + best_ping_front_local: number | undefined; + best_ping_front_remote: number | undefined; + best_score: number | undefined; + best_pop_local: number | undefined; + best_pop_remote: number | undefined; + best_time: number | undefined; + negotiation_ms: number | undefined; + selected_seconds: number | undefined; +} + +export interface SteamDatagramP2PRoutingSummary { + ice: SteamNetworkingICESessionSummary | undefined; + sdr: SteamNetworkingP2PSDRRoutingSummary | undefined; +} + + +/** + * CMsgNetworkDevicesData + */ +export interface MsgNetworkDevicesData extends JsPbMessage { + devices(): Device[]; + + is_wifi_enabled(): boolean; + + is_wifi_scanning_enabled(): boolean; +} + + +/** + * CGameNetworkingUI_ConnectionState + */ +export interface GameNetworkingUI_ConnectionState extends JsPbMessage { + connection_key(): string; + + appid(): number; + + connection_id_local(): number; + + identity_local(): string; + + identity_remote(): string; + + connection_state(): number; + + start_time(): number; + + close_time(): number; + + close_reason(): number; + + close_message(): string; + + status_loc_token(): string; + + transport_kind(): number; + + sdrpopid_local(): string; + + sdrpopid_remote(): string; + + address_remote(): string; + + p2p_routing(): SteamDatagramP2PRoutingSummary; + + ping_interior(): number; + + ping_remote_front(): number; + + ping_default_internet_route(): number; + + e2e_quality_local(): SteamDatagramConnectionQuality; + + e2e_quality_remote(): SteamDatagramConnectionQuality; + + e2e_quality_remote_instantaneous_time(): string; + + e2e_quality_remote_lifetime_time(): string; + + front_quality_local(): SteamDatagramConnectionQuality; + + front_quality_remote(): SteamDatagramConnectionQuality; + + front_quality_remote_instantaneous_time(): string; + + front_quality_remote_lifetime_time(): string; +} + +/** + * CMsgHotkey + */ +export interface MsgHotkey extends JsPbMessage { + key_code(): number; + + alt_key(): boolean; + + shift_key(): boolean; + + ctrl_key(): boolean; + + meta_key(): boolean; + + display_name(): string; +} + +export enum ControllerRumbleSetting { + ControllerPreference = 0, + Off = 1, + On = 2, +} + +export enum MusicRepeatStatus { + None = 0, + All = 1, + Once = 2, + Max = 3, +} + +export enum BrowserViewContextMenuTypeFlag { + None = 0, + Page = 1 << 0, + Frame = 1 << 1, + Link = 1 << 2, + Media = 1 << 3, + Selection = 1 << 4, + Editable = 1 << 5, +} + +export enum BrowserViewContextMenuEditFlag { + None = 0, + CanUndo = 1 << 0, + CanRedo = 1 << 1, + CanCut = 1 << 2, + CanCopy = 1 << 3, + CanPaste = 1 << 4, + CanDelete = 1 << 5, + CanSelectAll = 1 << 6, + CanTranslate = 1 << 7, +} + +/** + * @todo May be useful for ParentalSettings.feature ? + */ +export enum ParentalFeature { + Invalid = 0, + Store = 1, + Community = 2, + Profile = 3, + Friends = 4, + News = 5, + Trading = 6, + Settings = 7, + Console = 8, + Browser = 9, + ParentalSetup = 10, + Library = 11, + Test = 12, + SiteLicense = 13, + KioskMode = 14, + Max = 15, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/system/Audio.ts b/src/deck-components/steam-client/system/Audio.ts new file mode 100644 index 00000000..5a5a0dea --- /dev/null +++ b/src/deck-components/steam-client/system/Audio.ts @@ -0,0 +1,206 @@ +import {OperationResponse, Unregisterable} from "../index"; + +/** + * Represents various functions related to Steam system audio. + */ +export interface Audio { + /** + * Clears the default device override for a specified audio type. + * @param {number} audioType - The audio type (0 for input, 1 for output). + * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. + */ + ClearDefaultDeviceOverride(audioType: number): Promise<OperationResponse>; + + /** + * Retrieves information about audio applications. + * @returns {Promise<ApplicationsAudio>} - A Promise that resolves to information about audio applications. + */ + GetApps(): Promise<ApplicationsAudio>; + + /** + * Retrieves information about audio devices. + * @returns {Promise<AudioDeviceInfo>} - A Promise that resolves to information about audio devices. + */ + GetDevices(): Promise<AudioDeviceInfo>; + + /** + * Registers a callback to be called when a new audio application is added. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppAdded(callback: (appAudioAdded: ApplicationAudio) => void): Unregisterable | any; + + /** + * Registers a callback to be called when an audio application is removed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppRemoved(callback: (appAudioId: number) => void): Unregisterable | any; + + /** + * Registers a callback to be called when the volume of an audio application changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForAppVolumeChanged(callback: (appAudioId: number, volume: number) => void): Unregisterable | any; + + /** + * Registers a callback to be called when a new audio device is added. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceAdded(callback: (audioDevice: Device) => void): Unregisterable | any; + + /** + * Registers a callback to be called when an audio device is removed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceRemoved(callback: (audioDeviceId: number) => void): Unregisterable | any; + + /** + * Registers a callback to be called when the volume of an audio device changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceVolumeChanged(callback: (audioDeviceId: number, audioType: number, volume: number) => void): Unregisterable | any; + + RegisterForServiceConnectionStateChanges(callback: (param0: any) => void): Unregisterable | any; + + /** + * Registers a callback to be called when volume buttons are pressed. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForVolumeButtonPressed(callback: (volumeUpPressed: boolean) => void): Unregisterable | any; + + /** + * Sets the volume of an audio application. + * @param {number} appAudioId - The ID of the audio application. + * @param {number} volume - The volume level (floating point value between 0 and 1). + * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. + */ + SetAppVolume(appAudioId: number, volume: number): Promise<OperationResponse>; + + /** + * Sets the default device override for a specified audio type. + * @param {number} audioDeviceId - The ID of the audio device. + * @param {number} audioType - The audio type (0 for input, 1 for output). + * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. + */ + SetDefaultDeviceOverride(audioDeviceId: number, audioType: number): Promise<OperationResponse>; + + /** + * Sets the volume of an audio device. + * @param {number} audioDeviceId - The ID of the audio device. + * @param {number} audioType - The audio type (0 for input, 1 for output). + * @param {number} volume - The volume level (floating point value between 0 and 1). + * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. + */ + SetDeviceVolume(audioDeviceId: number, audioType: number, volume: number): Promise<OperationResponse>; +} + +/** + * Represents details about an array of application audio sessions. + */ +export interface ApplicationsAudio { + /** + * An array of application audio sessions. + */ + apps: ApplicationAudio[]; +} + +/** + * Represents details about an application audio session. + */ +export interface ApplicationAudio { + /** + * The ID of the application audio. + */ + id: number; + + /** + * The name of the application (e.g., Spotify, YouTube from a browser, etc.). + */ + strName: string; + + /** + * The volume level of the application (floating point value between 0 and 1). + */ + flVolume: number; +} + +/** + * Represents details about audio devices and information about the active audio device. + */ +export interface AudioDeviceInfo { + /** + * The ID of the active output audio device. + */ + activeOutputDeviceId: number; + + /** + * The ID of the active input audio device. + */ + activeInputDeviceId: number; + + /** + * The ID of the overridden output audio device (-1 if not overridden). + */ + overrideOutputDeviceId: number; + + /** + * The ID of the overridden input audio device (-1 if not overridden). + */ + overrideInputDeviceId: number; + + /** + * An array of audio devices. + */ + vecDevices: Device[]; +} + +/** + * Represents details about an audio device. + */ +export interface Device { + /** + * The identifier of the audio device. + */ + id: number; + + /** + * The name of the audio device. + */ + sName: string; + + /** + * Indicates if the device has audio output. + */ + bHasOutput: boolean; + + /** + * Indicates if the device is the default output device. + */ + bIsDefaultOutputDevice: boolean; + + /** + * The volume level of the audio output device (floating point value between 0 and 1). + */ + flOutputVolume: number; + + /** + * Indicates if the device has audio input. + */ + bHasInput: boolean; + + /** + * Indicates if the device is the default input device. + */ + bIsDefaultInputDevice: boolean; + + /** + * The volume level of the audio input device (floating point value between 0 and 1). + */ + flInputVolume: number; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/system/AudioDevice.ts b/src/deck-components/steam-client/system/AudioDevice.ts new file mode 100644 index 00000000..f9b8d78b --- /dev/null +++ b/src/deck-components/steam-client/system/AudioDevice.ts @@ -0,0 +1,116 @@ +import {JsPbMessage, Unregisterable} from "../index"; + +export interface AudioDevice { + /** + * If `data` is deserialized, returns {@link MsgSystemAudioManagerState}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + + UpdateSomething(param0: any): any; // e.UpdateSomething(t.serializeBase64String()) +} + +/** + * CMsgSystemAudioManagerState + */ +export interface MsgSystemAudioManagerState extends JsPbMessage { + counter(): number | undefined; + + hw(): MsgSystemAudioManagerStateHW | undefined; + + rtime_filter(): number | undefined; +} + +export interface MsgSystemAudioManagerStateHW { + devices: MsgSystemAudioManagerDevice[]; + nodes: MsgSystemAudioManagerNode[]; + ports: MsgSystemAudioManagerPort[]; + links: MsgSystemAudioManagerLink[]; +} + +export interface MsgSystemAudioManagerDevice { + base: MsgSystemAudioManagerObject | undefined; + name: string | undefined; + nick: string | undefined; + description: string | undefined; + api: string | undefined; +} + +export interface MsgSystemAudioManagerNode { + base: MsgSystemAudioManagerObject | undefined; + device_id: number | undefined; + name: string | undefined; + nick: string | undefined; + description: string | undefined; + edirection: SystemAudioDirection | undefined; + volume: MsgSystemAudioVolume | undefined; +} + +export interface MsgSystemAudioManagerPort { + base: MsgSystemAudioManagerObject | undefined; + node_id: number | undefined; + name: string | undefined; + alias: string | undefined; + etype: SystemAudioPortType | undefined; + edirection: SystemAudioPortDirection | undefined; + is_physical: boolean | undefined; + is_terminal: boolean | undefined; + is_control: boolean | undefined; + is_monitor: boolean | undefined; +} + +export interface MsgSystemAudioVolume { + entries: MsgSystemAudioVolumeChannelEntry[] | undefined; + is_muted: boolean | undefined; +} + +export interface MsgSystemAudioVolumeChannelEntry { + echannel: SystemAudioChannel | undefined; + volume: number | undefined; +} + +export interface MsgSystemAudioManagerLink { + base: MsgSystemAudioManagerObject | undefined; + output_node_id: number | undefined; + output_port_id: number | undefined; + input_node_id: number | undefined; + input_port_id: number | undefined; +} + +export interface MsgSystemAudioManagerObject { + id: number | undefined; + rtime_last_update: number | undefined; +} + +export enum SystemAudioDirection { + Invalid = 0, + Input = 1, + Output = 2, +} + +export enum SystemAudioPortDirection { + Invalid = 0, + Input = 1, + Output = 2, +} + +export enum SystemAudioPortType { + Invalid = 0, + Unknown = 1, + Audio32f = 2, + Midi8b = 3, + Video32RGBA = 4, +} + +export enum SystemAudioChannel { + Invalid = 0, + Aggregated = 1, + FrontLeft = 2, + FrontRight = 3, + LFE = 4, + BackLeft = 5, + BackRight = 6, + FrontCenter = 7, + Unknown = 8, + Mono = 9, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/system/Bluetooth.ts b/src/deck-components/steam-client/system/Bluetooth.ts new file mode 100644 index 00000000..f17d4bec --- /dev/null +++ b/src/deck-components/steam-client/system/Bluetooth.ts @@ -0,0 +1,178 @@ +import {OperationResponse, Unregisterable} from "../index"; + +/** + * Provides functionality for managing Bluetooth devices and interactions. + */ +export interface Bluetooth { + /** + * Cancels an ongoing pairing request with a Bluetooth device. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the Bluetooth device to cancel pairing with. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the cancellation. + */ + CancelPairing(adapterId: number, deviceId: number): Promise<OperationResponse>; + + /** + * Connects to a paired Bluetooth device using the specified adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the paired Bluetooth device to connect to. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the connection attempt. + */ + Connect(adapterId: number, deviceId: number): Promise<OperationResponse>; + + /** + * Disconnects from a currently connected Bluetooth device using the specified adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the connected Bluetooth device to disconnect from. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the disconnection. + */ + Disconnect(adapterId: number, deviceId: number): Promise<OperationResponse>; + + /** + * Initiates pairing with a Bluetooth device using the specified adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the Bluetooth device to initiate pairing with. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the pairing attempt. + */ + Pair(adapterId: number, deviceId: number): Promise<OperationResponse>; + + /** + * Registers a callback function to be called when the Bluetooth state changes. + * @param {function} callback - The callback function to be called. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStateChanges(callback: (bluetoothStateChange: BluetoothStateChange) => void): Unregisterable | any; + + /** + * Sets whether the Bluetooth adapter should be in discovering mode. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {boolean} value - `true` to enable discovering mode, `false` to disable it. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the operation. + */ + SetAdapterDiscovering(adapterId: number, value: boolean): Promise<OperationResponse>; + + /** + * Enables or disables Bluetooth functionality. + * @param {boolean} bluetooth - `true` to enable Bluetooth, `false` to disable it. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the operation. + */ + SetEnabled(bluetooth: boolean): Promise<OperationResponse>; + + /** + * Unpairs a Bluetooth device from the adapter. + * @param {number} adapterId - The ID of the Bluetooth adapter. + * @param {number} deviceId - The ID of the Bluetooth device to unpair with. + * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the unpairing request. + */ + UnPair(adapterId: number, deviceId: number): Promise<OperationResponse>; +} + +/** + * Represents a change in the state of Bluetooth adapters and devices. + */ +export interface BluetoothStateChange { + /** + * An array of Bluetooth adapters with their current state. + */ + vecAdapters: BluetoothAdapter[]; + + /** + * An array of Bluetooth devices with their current state. + */ + vecDevices: BluetoothDevice[]; + + /** + * Indicates whether Bluetooth is enabled (`true`) or disabled (`false`). + */ + bEnabled: boolean; +} + +/** + * Represents information about a Bluetooth adapter. + */ +export interface BluetoothAdapter { + /** + * The unique identifier of the Bluetooth adapter. + */ + nId: number; + + /** + * The MAC address of the Bluetooth adapter. + */ + sMAC: string; + + /** + * The name of the Bluetooth adapter. + */ + sName: string; + + /** + * Indicates whether the Bluetooth adapter is enabled. + */ + bEnabled: boolean; + + /** + * Indicates whether the Bluetooth adapter is in discovering mode. + */ + bDiscovering: boolean; +} + +/** + * Represents information about a Bluetooth device. + */ +export interface BluetoothDevice { + /** + * The unique identifier of the Bluetooth device. + */ + nId: number; + + /** + * The ID of the Bluetooth adapter to which this device is discovered by / connected to. + */ + nAdapterId: number; + + /** + * The type of the Bluetooth device (e.g., headphones, mouse, keyboard). + */ + eType: BluetoothDeviceType; + + /** + * The MAC address of the Bluetooth device. + */ + sMAC: string; + + /** + * The name of the Bluetooth device. + */ + sName: string; + + /** + * Indicates whether the Bluetooth device is currently connected to the adapter. + */ + bConnected: boolean; + + /** + * Indicates whether the Bluetooth device is paired to the adapter. + */ + bPaired: boolean; + + /** + * The raw signal strength of the Bluetooth device. + */ + nStrengthRaw: number; +} + +export enum BluetoothDeviceType { + Invalid = 0, + Unknown = 1, + Phone = 2, + Computer = 3, + Headset = 4, + Headphones = 5, + Speakers = 6, + OtherAudio = 7, + Mouse = 8, + Joystick = 9, + Gamepad = 10, + Keyboard = 11, +} \ No newline at end of file diff --git a/src/deck-components/steam-client/system/Devkit.ts b/src/deck-components/steam-client/system/Devkit.ts new file mode 100644 index 00000000..f29f2f1a --- /dev/null +++ b/src/deck-components/steam-client/system/Devkit.ts @@ -0,0 +1,11 @@ +import {Unregisterable} from "../index"; + +export interface Devkit { + DeveloperModeChanged(state: boolean): any; + + RegisterForPairingPrompt(callback: (param0: any) => any): Unregisterable | any; + + RespondToPairingPrompt(param0: any, param1: any): any; + + SetPairing(param0: any): any; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/system/Display.ts b/src/deck-components/steam-client/system/Display.ts new file mode 100644 index 00000000..886dbf82 --- /dev/null +++ b/src/deck-components/steam-client/system/Display.ts @@ -0,0 +1,15 @@ +import {Unregisterable} from "../index"; + +export interface Display { + EnableUnderscan(param0: boolean): any; + + RegisterForBrightnessChanges(callback: (brightnessChanges: BrightnessChange) => void): Unregisterable | any; + + SetBrightness(brightness: number): any; + + SetUnderscanLevel(param0: any): any; +} + +export interface BrightnessChange { + flBrightness: number; +} diff --git a/src/deck-components/steam-client/system/DisplayManager.ts b/src/deck-components/steam-client/system/DisplayManager.ts new file mode 100644 index 00000000..874a072d --- /dev/null +++ b/src/deck-components/steam-client/system/DisplayManager.ts @@ -0,0 +1,16 @@ +import {Unregisterable} from "../index"; + +// CMsgSystemDisplayManagerState, CMsgSystemDisplayManagerSetMode +export interface DisplayManager { + ClearModeOverride(displayId: any): any; + + GetState: any; + + RegisterForStateChanges(callback: () => void): Unregisterable | any; + + SetCompatibilityMode(displayId: any): any; + + SetGamescopeInternalResolution(width: number, height: number): any; + + SetMode(base64: string): any; // +} \ No newline at end of file diff --git a/src/deck-components/steam-client/system/Dock.ts b/src/deck-components/steam-client/system/Dock.ts new file mode 100644 index 00000000..c79e3cf8 --- /dev/null +++ b/src/deck-components/steam-client/system/Dock.ts @@ -0,0 +1,32 @@ +import {JsPbMessage, Unregisterable} from "../index"; +import {UpdaterState} from "../Updates"; + +// CMsgSystemDockUpdateFirmware, CMsgSystemDockState +export interface Dock { + DisarmSafetyNet(): void; + + /** + * If `data` is deserialized, returns {@link MsgSystemDockState}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + + UpdateFirmware(base64String: string): any; // serialize base64 string +} + +/** + * CMsgSystemDockState + */ +export interface MsgSystemDockState extends JsPbMessage { + update_state(): SystemDockUpdateState | undefined; +} + +export interface SystemDockUpdateState { + state: UpdaterState | undefined; + rtime_last_checked: number | undefined; + version_current: string | undefined; + version_available: string | undefined; + stage_progress: number | undefined; + rtime_estimated_completion: number | undefined; + old_fw_workaround: number | undefined; +} diff --git a/src/deck-components/steam-client/system/Perf.ts b/src/deck-components/steam-client/system/Perf.ts new file mode 100644 index 00000000..afcabff4 --- /dev/null +++ b/src/deck-components/steam-client/system/Perf.ts @@ -0,0 +1,196 @@ +import {JsPbMessage, Unregisterable} from "../index"; + +// CMsgSystemPerfUpdateSettings, CMsgSystemPerfState, CMsgSystemPerfSettings +export interface Perf { + /** + * If `data` is deserialized, returns {@link MsgSystemPerfDiagnosticInfo}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDiagnosticInfoChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + + /** + * If `data` is deserialized, returns {@link MsgSystemPerfState}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + + UpdateSettings(base64: string): any; // serialize +} + +/** + * CMsgSystemPerfDiagnosticInfo + */ +export interface MsgSystemPerfDiagnosticInfo extends JsPbMessage { + battery_temp_c(): number | undefined; + + entries(): SystemPerfDiagnosticEntry[] | undefined; + + interfaces(): SystemPerfNetworkInterface[] | undefined; +} + +export interface SystemPerfDiagnosticEntry { + name: string | undefined; + value: string | undefined; +} + +export interface SystemPerfNetworkInterface { + name: string | undefined; + timestamp: number | undefined; + tx_bytes_total: number | undefined; + rx_bytes_total: number | undefined; + tx_bytes_per_sec: number | undefined; + rx_bytes_per_sec: number | undefined; +} + +/** + * CMsgSystemPerfState + */ +export interface MsgSystemPerfState extends JsPbMessage { + active_profile_game_id(): string | undefined; + + current_game_id(): string | undefined; + + limits(): SystemPerfLimits | undefined; + + settings(): SystemPerfSettings | undefined; +} + +export interface SystemPerfLimits { + cpu_governor_manual_min_mhz: number | undefined; + cpu_governor_manual_max_mhz: number | undefined; + fsr_sharpness_min: number | undefined; + fsr_sharpness_max: number | undefined; + gpu_performance_manual_min_mhz: number | undefined; + gpu_performance_manual_max_mhz: number | undefined; + perf_overlay_is_standalone: boolean | undefined; + is_dynamic_vrs_available: boolean | undefined; + is_manual_display_refresh_rate_available: boolean | undefined; + gpu_performance_levels_available: GPUPerformanceLevel[]; + display_refresh_manual_hz_min: number | undefined; + display_refresh_manual_hz_max: number | undefined; + fps_limit_options: number[] | undefined; + tdp_limit_min: number | undefined; + tdp_limit_max: number | undefined; + is_nis_supported: boolean | undefined; + nis_sharpness_min: number | undefined; + nis_sharpness_max: number | undefined; + display_external_refresh_manual_hz_min: number | undefined; + display_external_refresh_manual_hz_max: number | undefined; + fps_limit_options_external: number[] | undefined; + is_tearing_supported: boolean | undefined; + is_vrr_supported: boolean | undefined; + is_dynamic_refresh_rate_in_steam_supported: boolean | undefined; + is_split_scaling_and_filtering_supported: boolean | undefined; + split_scaling_filters_available: SplitScalingFilter[]; + split_scaling_scalers_available: SplitScalingScaler[]; + is_hdr_supported: boolean | undefined; + display_refresh_manual_hz_oc_max: number | undefined; + disable_refresh_rate_management: boolean | undefined; +} + +export enum GPUPerformanceLevel { + Invalid = 0, + Auto = 1, + Manual = 2, + Low = 3, + High = 4, + Profiling = 5, +} + +export enum SplitScalingFilter { + Invalid = 0, + Linear = 1, + Nearest = 2, + FSR = 3, + NIS = 4, +} + +export enum SplitScalingScaler { + Invalid = 0, + Auto = 1, + Integer = 2, + Fit = 3, + Fill = 4, + Stretch = 5, +} + +export interface SystemPerfSettings { + global: SystemPerfSettingsGlobal | undefined; + per_app: SystemPerfSettingsPerApp | undefined; +} + +export interface SystemPerfSettingsGlobal { + diagnostic_update_rate: number; + system_trace_service_state: SystemServiceState; + graphics_profiling_service_state: SystemServiceState; + perf_overlay_service_state: SystemServiceState; + perf_overlay_level: GraphicsPerfOverlayLevel; + is_show_perf_overlay_over_steam_enabled: boolean; + is_advanced_settings_enabled: boolean; + allow_external_display_refresh_control: boolean; + is_hdr_enabled: boolean; + hdr_on_sdr_tonemap_operator: HDRToneMapOperator; + is_hdr_debug_heatmap_enabled: boolean; + force_hdr_wide_gammut_for_sdr: boolean; + allow_experimental_hdr: boolean; + sdr_to_hdr_brightness: number; + debug_force_hdr_support: boolean; + force_hdr_10pq_output_debug: boolean; + is_display_oc_enabled: boolean; + is_color_management_enabled: boolean; +} + +export enum SystemServiceState { + Unavailable = 0, + Disabled = 1, + Enabled = 2, +} + +export enum GraphicsPerfOverlayLevel { + Hidden = 0, + Basic = 1, + Medium = 2, + Full = 3, + Minimal = 4, +} + +export enum HDRToneMapOperator { + Invalid = 0, + Uncharted = 1, + Reinhard = 2, +} + +export interface SystemPerfSettingsPerApp { + gpu_performance_manual_mhz: number | undefined; + fps_limit: number | undefined; + is_variable_resolution_enabled: boolean | undefined; + is_dynamic_refresh_rate_enabled: boolean | undefined; + tdp_limit: number | undefined; + cpu_governor: CPUGovernor | undefined; + cpu_governor_manual_mhz: number | undefined; + scaling_filter: number | undefined; + fsr_sharpness: number | undefined; + is_fps_limit_enabled: boolean | undefined; + is_tdp_limit_enabled: boolean | undefined; + is_low_latency_mode_enabled: boolean | undefined; + display_refresh_manual_hz: number | undefined; + is_game_perf_profile_enabled: boolean | undefined; + gpu_performance_level: GPUPerformanceLevel | undefined; + nis_sharpness: number | undefined; + display_external_refresh_manual_hz: number | undefined; + fps_limit_external: number | undefined; + is_tearing_enabled: boolean | undefined; + is_vrr_enabled: boolean | undefined; + is_composite_debug_enabled: boolean | undefined; + force_composite: boolean | undefined; + use_dynamic_refresh_rate_in_steam: boolean | undefined; + split_scaling_filter: SplitScalingFilter | undefined; + split_scaling_scaler: SplitScalingScaler | undefined; +} + +export enum CPUGovernor { + Invalid = 0, + Perf = 1, + Powersave = 2, + Manual = 3, +} diff --git a/src/deck-components/steam-client/system/Report.ts b/src/deck-components/steam-client/system/Report.ts new file mode 100644 index 00000000..ee1f5dda --- /dev/null +++ b/src/deck-components/steam-client/system/Report.ts @@ -0,0 +1,40 @@ +import {JsPbMessage, OperationResponse} from "../index"; + +export interface Report { + /** + * Generates a system report located in /tmp/steamXXXXXX (https://steamloopback.host/systemreports). + * @throws OperationResponse + */ + GenerateSystemReport(): Promise<SystemReportReply | OperationResponse>; + + /** + * Saves a report in the Desktop directory. + * @param reportId The report ID (file name) to save. + */ + SaveToDesktop(reportId: string): Promise<OperationResponse>; + + /** + * @param reportId The report ID (file name) to submit. + * @todo times out ({@link Result.Timeout}) + */ + Submit(reportId: string): Promise<OperationResponse>; +} + +export interface SystemReportReply extends OperationResponse { + /** + * If deserialized, returns {@link MsgGenerateSystemReportReply}. + */ + reply: ArrayBuffer; +} + +/** + * CMsgGenerateSystemReportReply + */ +export interface MsgGenerateSystemReportReply extends JsPbMessage { + /** + * The report file name. + */ + report_id(): string | undefined; + + set_report_id(param0: any): any; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/system/UI.ts b/src/deck-components/steam-client/system/UI.ts new file mode 100644 index 00000000..84d4d492 --- /dev/null +++ b/src/deck-components/steam-client/system/UI.ts @@ -0,0 +1,33 @@ +import {Unregisterable} from "../index"; + +export interface UI { + CloseGameWindow(appId: number, windowId: number): void; + + GetGameWindowsInfo(appId: number, windowIds: number[]): Promise<GameWindowInfo>; + + RegisterForFocusChangeEvents(callback: (event: FocusChangeEvent) => void): Unregisterable | any; + + // appId is 0 if unknown app is focused + RegisterForOverlayGameWindowFocusChanged(callback: (appId: number, param1: number) => void): Unregisterable | any; + + //event.eKey, event.nControllerIndex + RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable | any; // eKey +} + +export interface FocusChangeEvent { + focusedApp: FocusedApp; + rgFocusable: FocusedApp[]; +} + +export interface FocusedApp { + appid: number; + pid: number; + windowid: number; + strExeName: string; +} + +export interface GameWindowInfo { + bCanClose: boolean; + strTitle: string; + windowid: number; +} diff --git a/src/deck-components/steam-client/system/index.ts b/src/deck-components/steam-client/system/index.ts new file mode 100644 index 00000000..3acf1f05 --- /dev/null +++ b/src/deck-components/steam-client/system/index.ts @@ -0,0 +1,369 @@ +import {JsPbMessage, OperationResponse, Unregisterable} from "../index"; +import {Audio} from "./Audio"; +import {AudioDevice} from "./AudioDevice"; +import {Bluetooth} from "./Bluetooth"; +import {Devkit} from "./Devkit"; +import {Display} from "./Display"; +import {DisplayManager} from "./DisplayManager"; +import {Dock} from "./Dock"; +import {Network} from "./network"; +import {Perf} from "./Perf"; +import {Report} from "./Report"; +import {UI} from "./UI"; + +export interface System { + Audio: Audio; + AudioDevice: AudioDevice; + Bluetooth: Bluetooth; + + /** + * Copies specified files to clipboard. + * Does not throw if not found. + * @param paths File paths to copy. + */ + CopyFilesToClipboard(paths: string[]): void; + + /** + * Creates a temporary folder. + * @param path The folder to create. + * @returns The created path. + * @todo Does this support relative paths ? this has some weird behavior + */ + CreateTempPath(path: string): Promise<string>; + + Devkit: Devkit; + Display: Display; + DisplayManager: DisplayManager; + Dock: Dock; + + ExitFakeCaptivePortal(): any; + + FactoryReset(): any; + + FormatStorage(forceFormat: boolean): any; + + GetLegacyAmpControlEnabled(): Promise<any>; // {"bAvailable":true,"bEnabled":false} + + GetOSType(): Promise<OSType>; + + GetSystemInfo(): Promise<SystemInfo>; + + IsDeckFactoryImage(): Promise<boolean>; + + IsSteamInTournamentMode(): Promise<boolean>; + + /** + * Moves a file. + * @param target Target file/folder. + * @param destination Destination path. + * @remarks Does not throw on error. + */ + MoveFile(target: string, destination: string): void; + + Network: Network; + + NotifyGameOverlayStateChanged(latestAppOverlayStateActive: boolean, appId: number): any; + + /** + * Open a dialog for choosing a file. + * @param {FileDialog} prefs - Dialog preferences. + * @returns {Promise<string>} A Promise that resolves to the selected file name. + * @throws Throws if no file was selected. + */ + OpenFileDialog(prefs: FileDialog): Promise<string | OperationResponse>; + + /** + * Open a URL in the default web browser. + * @returns {void} + */ + OpenInSystemBrowser(url: string): void; + + OpenLocalDirectoryInSystemExplorer(directory: string): void; // Opens local directory in system explorer + Perf: Perf; + + RebootToAlternateSystemPartition(): any; + + RebootToFactoryTestImage(param0: any): any; + + RegisterForAirplaneModeChanges(callback: (airplaneModeChange: AirplaneModeChange) => void): Unregisterable | any; + + RegisterForBatteryStateChanges(callback: (batteryStateChange: BatteryStateChange) => void): Unregisterable | any; + + RegisterForFormatStorageProgress(callback: () => void): Unregisterable | any; // {"flProgress":0,"rtEstimatedCompletionTime":0,"eStage":1} + + RegisterForOnResumeFromSuspend(callback: () => void): Unregisterable | any; + + RegisterForOnSuspendRequest(callback: () => void): Unregisterable | any; + + /** + * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link MsgSystemManagerSettings}. + */ + RegisterForSettingsChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + + Report: Report; + + /** + * Restarts the system. + */ + RestartPC(): any; + + SetAirplaneMode(value: boolean): void; + + SetLegacyAmpControl: any; + + ShutdownPC(): any; + + SteamRuntimeSystemInfo(): Promise<string>; + + /** + * Suspends the system. + */ + SuspendPC(): any; + + /** + * Switches to desktop mode. + */ + SwitchToDesktop(): any; + + UI: UI; + UpdateSettings: any; +} + +export interface AirplaneModeChange { + bEnabled: boolean; +} + +export interface BatteryStateChange { + bHasBattery: boolean; + eACState: ACState; + eBatteryState: BatteryState; + flLevel: number; // Battery Percentage in floating point 0-1 + nSecondsRemaining: number; // Appears to be charge time remaining or time remaining on battery + bShutdownRequested: boolean; +} + +export enum ACState { + Unknown = 0, + Disconnected = 1, + Connected = 2, + ConnectedSlow = 3, +} + +export enum BatteryState { + Unknown = 0, + Discharging = 1, + Charging = 2, + Full = 3, +} + +export interface FileDialog { + /** Whether to choose a directory instead. */ + bChooseDirectory?: boolean; + /** + * Array of file filters. + * @example + * Example from the "Add a Non-Steam Game" dialog: + * ``` + * [ + * { + * strFileTypeName: LocalizationManager.LocalizeString("#AddNonSteam_Filter_Exe_Linux"), + * rFilePatterns: [ "*.application", "*.exe", "*.sh", "*.AppImage" ], + * bUseAsDefault: true, + * }, + * { + * strFileTypeName: LocalizationManager.LocalizeString("#AddNonSteam_Filter_All"), + * rFilePatterns: [ "*" ], + * } + * ] + * ``` + */ + rgFilters?: FileDialogFilter[]; + /** Initially selected file. */ + strInitialFile?: string; + /** Window title. */ + strTitle?: string; +} + +export interface FileDialogFilter { + /** A localization string for the file type. */ + strFileTypeName: string; + /** + * File patterns. + * @example [ "*.application", "*.exe", "*.sh", "*.AppImage" ] + */ + rFilePatterns: string[]; + /** Whether to use this filter by default. */ + bUseAsDefault?: boolean; +} + +export enum OSType { + Web = -700, + Ios = -600, + Android = -500, + Android6 = -499, + Android7 = -498, + Android8 = -497, + Android9 = -496, + Ps3os = -300, + Linux = -203, + Linux22 = -202, + Linux24 = -201, + Linux26 = -200, + Linux32 = -199, + Linux35 = -198, + Linux36 = -197, + Linux310 = -196, + Linux316 = -195, + Linux318 = -194, + Linux3x = -193, + Linux4x = -192, + Linux41 = -191, + Linux44 = -190, + Linux49 = -189, + Linux414 = -188, + Linux419 = -187, + Linux5x = -186, + Linux54 = -185, + Linux6x = -184, + Linux7x = -183, + Linux510 = -182, + Macos = -102, + Macos104 = -101, + Macos105 = -100, + Macos1058 = -99, + Macos106_unused1 = -98, + Macos106_unused2 = -97, + Macos106_unused3 = -96, + Macos106 = -95, + Macos1063 = -94, + Macos1064_slgu = -93, + Macos1067 = -92, + Macos1067_unused = -91, + Macos107 = -90, + Macos108 = -89, + Macos109 = -88, + Macos1010 = -87, + Macos1011 = -86, + Macos1012 = -85, + Macos1013 = -84, + Macos1014 = -83, + Macos1015 = -82, + Macos1016 = -81, + Macos11 = -80, + Macos111 = -79, + Macos1017 = -78, + Macos12 = -77, + Macos1018 = -76, + Macos13 = -75, + Macos1019 = -74, + Macos14 = -73, + Macos1020 = -72, + Macos15 = -71, + Unknown = -1, + Windows = 0, + Win311 = 1, + Win95 = 2, + Win98 = 3, + WinME = 4, + WinNT = 5, + Win200 = 6, + WinXP = 7, + Win2003 = 8, + WinVista = 9, + Win7 = 10, + Win2008 = 11, + Win2012 = 12, + Win8 = 13, + Win81 = 14, + Win2012R2 = 15, + Win10 = 16, + Win2016 = 17, + Win2019 = 18, + Win2022 = 19, + Win11 = 20, +} + +export interface SystemInfo { + sOSName: string; + sKernelVersion: string; + sBIOSVersion: string; + sHostname: string; + sOSCodename: string; + sOSVariantId: string; + sOSVersionId: string; + sOSBuildId: string; + nSteamVersion: number; + sSteamBuildDate: string; + sSteamAPI: string; + sCPUVendor: string; + sCPUName: string; + nCPUHz: number; + nCPUPhysicalCores: number; + nCPULogicalCores: number; + nSystemRAMSizeMB: number; + sVideoCardName: string; + sVideoDriverVersion: string; + nVideoRAMSizeMB: number; + bIsUnsupportedPrototypeHardware: boolean; +} + +/** + * CMsgSystemManagerSettings + */ +export interface MsgSystemManagerSettings extends JsPbMessage { + display_adaptive_brightness_enabled(): boolean; + + display_colorgamut(): number; + + display_colorgamut_labelset(): number; + + display_colortemp(): number; + + display_colortemp_default(): number; + + display_colortemp_enabled(): boolean; + + display_diagnostics_enabled(): boolean; + + display_nightmode_blend(): number; + + display_nightmode_enabled(): boolean; + + display_nightmode_maxhue(): number; + + display_nightmode_maxsat(): number; + + display_nightmode_schedule_enabled(): boolean; + + display_nightmode_schedule_endtime(): number; + + display_nightmode_schedule_starttime(): number; + + display_nightmode_tintstrength(): number; + + display_nightmode_uiexp(): number; + + fan_control_mode(): number; + + idle_backlight_dim_ac_seconds(): number; + + idle_backlight_dim_battery_seconds(): number; + + idle_suspend_ac_seconds(): number; + + idle_suspend_battery_seconds(): number; + + idle_suspend_supressed(): boolean; + + is_adaptive_brightness_available(): boolean; + + is_display_brightness_available(): boolean; + + is_display_colormanagement_available(): boolean; + + is_display_colortemp_available(): boolean; + + is_fan_control_available(): boolean; + + is_wifi_powersave_enabled(): boolean; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/system/network/Device.ts b/src/deck-components/steam-client/system/network/Device.ts new file mode 100644 index 00000000..d65240ad --- /dev/null +++ b/src/deck-components/steam-client/system/network/Device.ts @@ -0,0 +1,12 @@ +export interface Device { + Connect(param0: any): any; // some base64 serialized string + Disconnect(deviceId: any): Promise<any>; + + WirelessNetwork: WirelessNetwork; +} + +export interface WirelessNetwork { + Forget(deviceId: any, deviceWapId: any): any; + + SetAutoconnect(deviceId: any, deviceWapId: any, autoConnect: boolean): any; +} \ No newline at end of file diff --git a/src/deck-components/steam-client/system/network/index.ts b/src/deck-components/steam-client/system/network/index.ts new file mode 100644 index 00000000..f395cbf6 --- /dev/null +++ b/src/deck-components/steam-client/system/network/index.ts @@ -0,0 +1,195 @@ +import {JsPbMessage, OperationResponse, Unregisterable} from "../../index"; +import {Device} from "./Device"; + + +export interface Network { + Device: Device; + + ForceRefresh(): Promise<OperationResponse>; + + ForceTestConnectivity(): void; + + GetProxyInfo(): Promise<ProxyInfo>; + + // data.nAppID, data.serializedMsg + RegisterForAppSummaryUpdate(callback: (data: any) => any): Unregisterable | any; + + /** + * @todo {@link GameNetworkingUI_ConnectionState}, unconfirmed + */ + RegisterForConnectionStateUpdate: Unregisterable | any; + + RegisterForConnectivityTestChanges( + callback: (connectivityTestChange: ConnectivityTestChange) => void, + ): Unregisterable | any; + + /** + * If `data` is deserialized, returns {@link MsgNetworkDevicesData}. + * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + */ + RegisterForDeviceChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + + SetFakeLocalSystemState(state: NetFakeLocalSystemState): void; + + SetProxyInfo(mode: number, address: string, port: number, excludeLocal: boolean): void; + + SetWifiEnabled(value: boolean): Promise<OperationResponse>; + + StartScanningForNetworks(): Promise<OperationResponse>; + + StopScanningForNetworks(): Promise<OperationResponse>; +} + +export interface ConnectivityTestChange { + eConnectivityTestResult: ConnectivityTestResult; + eFakeState: NetFakeLocalSystemState; + bChecking: boolean; +} + +export enum ConnectivityTestResult { + Unknown = 0, + Connected = 1, + CaptivePortal = 2, + TimedOut = 3, + Failed = 4, + WifiDisabled = 5, + NoLAN = 6, +} + +export interface ProxyInfo { + proxy_mode: number; + address: string; + port: number; + exclude_local: boolean; +} + +export enum NetFakeLocalSystemState { + Normal = 0, + NoLAN = 1, + CaptivePortal_Redirected = 2, + CaptivePortal_InPlace = 3, + NoInternet = 4, + NoSteam = 5, +} + +/** + * CMsgNetworkDevicesData + */ +export interface MsgNetworkDevicesData extends JsPbMessage { + devices(): NetworkDevice[]; + + is_wifi_enabled(): boolean; + + is_wifi_scanning_enabled(): boolean; +} + +export interface NetworkDevice_Wireless { + aps: WirelessAP[]; + /** + * @remarks Not present if wired. + * @todo enum + */ + esecurity_supported?: number; +} + +export interface WirelessAP { + esecurity: WirelessAPSecurityFlags; + estrength: WirelessAPStrength; + id: number; + is_active: boolean; + is_autoconnect: boolean; + password: string; + ssid: string; + strength_raw: number; + user_name?: string; +} + +export enum WirelessAPSecurityFlags { + None = 0, + StaticWep = 1, + DynamicWep = 2, + Wpa = 4, + WpaEnterprise = 8, + Wpa2 = 16, + Wpa2Enterprise = 32, + /** + * Special value to indicate that this platform does not support + * the security methods required to connect to an access point + */ + Unsupported = 32768, +} + +export interface NetworkDevice_Wired { + friendly_name: string; + is_cable_present: boolean; + speed_mbit: number; +} + +export interface NetworkDevice { + estate: NetworkDeviceState; + etype: NetworkDeviceType; + id: number; + ipv4: NetworkDeviceIPv4; + ipv6: NetworkDeviceIPv6; + mac: string; + product: string; + vendor: string; + /** + * @remarks Present only if wired. + */ + wired?: NetworkDevice_Wired; + /** + * @remarks Present even if wired. + */ + wireless: NetworkDevice_Wireless; +} + +export interface NetworkDeviceIPv4Address { + ip: number; + netmask: number; +} + +export interface NetworkDeviceIPv6Address { + ip: string; +} + +export interface NetworkDeviceIP { + dns_ip: number[]; + gateway_ip: number; + is_default_route: boolean; + is_dhcp_enabled: boolean; + is_enabled: boolean; +} + +export interface NetworkDeviceIPv4 extends NetworkDeviceIP { + addresses: NetworkDeviceIPv4Address[]; +} + +export interface NetworkDeviceIPv6 extends NetworkDeviceIP { + addresses: NetworkDeviceIPv6Address[]; +} + +export enum NetworkDeviceState { + NotPresent = 0, + Failed = 1, + Disconnected = 2, + Disconnecting = 3, + Connecting = 4, + Connected = 5, + Retrying = 6, +} + +export enum NetworkDeviceType { + Unknown = 0, + Wired = 1, + Wireless = 2, + Virtual = 3, +} + +export enum WirelessAPStrength { + None = 0, + Weak = 1, + Ok = 2, + Good = 3, + Excellent = 4, +} \ No newline at end of file diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts deleted file mode 100644 index 04778f51..00000000 --- a/src/globals/SteamClient.ts +++ /dev/null @@ -1,8523 +0,0 @@ -declare global { - var SteamClient: SteamClient; -} - -/** - * Represents various functions related to Steam applications. - */ -export interface Apps { - /** - * Adds a non-Steam application shortcut to the local Steam library. - * @param {string} appName - The name of the non-Steam application. - * @param {string} executablePath - The path to the executable file of the non-Steam application. - * @param {string} directory - The working directory for the non-Steam application. - * @param {string} launchOptions - Options to be passed when launching the non-Steam application. - * @returns {Promise<number>} - A Promise that resolves to a unique AppID assigned to the added non-Steam application shortcut. - */ - AddShortcut(appName: string, executablePath: string, directory: string, launchOptions: string): Promise<number>; - - /** - * Adds user tags to specified apps in the Steam library. - * @param {number[]} appIds - The IDs of the apps to which user tags will be added. - * @param {string} userTag - The user tag to be added. - * @returns {void} - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - AddUserTagToApps(appIds: number[], userTag: string): void; - - /** - * Backups an app to the specified path. - * @param {number} appId - The ID of the application to back up. - * @param {string} backupToPath - The path to store the backup. - * @returns {number} A Promise that resolves to a number. This value may be "20" for backup busy and "0" for success. - */ - BackupFilesForApp(appId: number, backupToPath: string): Promise<number>; - - /** - * Opens the screenshot folder for a specific app. - * @param {string} appId - The ID of the app to browse screenshots for. - * @param {number} handle - The screenshot handle to use. - * @returns {void} - */ - BrowseScreenshotForApp(appId: string, handle: number): void; - - /** - * Opens the screenshot folder for a specific app. - * @param {string} appId - The ID of the app to browse screenshots for. - * @returns {void} - */ - BrowseScreenshotsForApp(appId: string): void; - - /** - * Cancels the current backup process. - * @returns {void} - */ - CancelBackup(): void; - - /** - * Cancels a specific game action. - * @param {number} gameActionId - The ID of the game action to cancel. - * @returns {void} - */ - CancelGameAction(gameActionId: number): void; - - /** - * Cancels the launch of an application with the specified ID. - * @param {string} appId - The ID of the application whose launch is to be canceled. - * @returns {void} - */ - CancelLaunch(appId: string): void; - - /** - * Clears existing user tags on a specified application and sets new user tags. - * @param {number} appId - The ID of the application to clear and set user tags for. - * @param {string[]} userTags - An array of user tags to set for the application. - * @returns {void} - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - ClearAndSetUserTagsOnApp(appId: number, userTags: string[]): void; - - /** - * Clears the custom artwork for a given application. - * @param {number} appId - The ID of the application to clear custom artwork for. - * @param {AppArtworkAssetType} assetType - The type of artwork to clear. - */ - ClearCustomArtworkForApp(appId: number, assetType: AppArtworkAssetType): Promise<void>; - - /** - * Clears the custom logo position for a specific application. - * @param {number} appId - The ID of the application. - * @returns {Promise<void>} - A Promise that resolves once the custom logo position is cleared. - */ - ClearCustomLogoPositionForApp(appId: number): Promise<void>; - - ClearProton(appId: number): Promise<any>; - - /** - * Clears user tags on a list of specified applications. - * @param {number[]} appIds - An array of application IDs for which to clear user tags. - * @returns {void} - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - ClearUserTagsOnApps(appIds: number[]): void; - - /** - * Continues a specific game action. - * @param {number} gameActionId - The ID of the game action to continue. - * @param {string} actionType - The type of action to perform during continuation. - * @returns {void} - * @remarks actionType - "SkipShaders", "skip", "ShowDurationControl" todo: - */ - ContinueGameAction(gameActionId: number, actionType: string): void; - - /** - * Creates a Steam application shortcut on the desktop. - * @param {number} appId - The ID of the application for which to create a desktop shortcut. - * @returns {void} - */ - CreateDesktopShortcutForApp(appId: number): void; - - /** - * Download a workshop item. - * @param {number} appId - The ID of the application. - * @param {string} itemId - The ID of the workshop item. - * @param {boolean} param1 - Additional parameter (exact usage may vary). - * @returns {void} - */ - DownloadWorkshopItem(appId: number, itemId: string, param1: boolean): void; - - /** - * Retrieves achievements within a specified time range for a given app. - * @param {number} appId - The ID of the application. - * @param {number} start - The start of the time range as a Unix timestamp. - * @param {number} end - The end of the time range as a Unix timestamp. - * @returns {Promise<AppAchievement[]>} - A Promise that resolves to an array of AppAchievement objects. - */ - GetAchievementsInTimeRange(appId: number, start: number, end: number): Promise<AppAchievement[]>; - - /** - * Retrieves a list of active game actions, such as launching an application. - * @returns {Promise<GameAction[]>} A Promise that resolves to an array of active game actions. - */ - GetActiveGameActions(): Promise<GameAction[]>; - - /** - * Retrieves a list of available compatibility tools for a specific application. - * @param {number} appId - The ID of the application to retrieve compatibility tools for. - * @returns {Promise<CompatibilityToolInfo[]>} A Promise that resolves to an array of CompatibilityToolInfo objects. - */ - GetAvailableCompatTools(appId: number): Promise<CompatibilityToolInfo[]>; - - /** - * Represents a function to retrieve the name of the application in a backup folder. - * @param {string} appBackupPath - The path to the application's backup folder. - * @returns {Promise<string | undefined>} - A Promise that resolves to the name of the application in the backup folder, or undefined if the path is invalid. - * @remarks This function checks for the "sku.sis" file in that path. - */ - GetBackupsInFolder(appBackupPath: string): Promise<string | undefined>; - - /** - * Retrieves cached details for a specific application. - * @param appId - The ID of the application. - * @returns {Promise<string>} - A Promise that resolves to a stringified object. - */ - GetCachedAppDetails(appId: number): Promise<string>; // todo: Parsing nightmare - - GetCloudPendingRemoteOperations(appId: number): Promise<any>; - - GetCompatExperiment: any; - - GetConflictingFileTimestamps(appId: number): Promise<ConflictingFileTimestamp>; - - /** - * Retrieves details for a specific screenshot upload. - * @param {string} appId - The ID of the application. - * @param {number} hHandle - The handle of the screenshot upload. - * @returns {Promise<DetailsForScreenshotUpload>} - A Promise that resolves to details about the screenshot upload. - */ - GetDetailsForScreenshotUpload(appId: string, hHandle: number): Promise<DetailsForScreenshotUpload>; - - /** - * Retrieves details for multiple screenshot uploads. - * @param {string} appId - The ID of the application. - * @param {number[]} hHandles - An array of handles of the screenshot uploads. - * @returns {Promise<DetailsForScreenshotUploads>} - A Promise that resolves to details about the screenshot uploads. - */ - GetDetailsForScreenshotUploads(appId: string, hHandles: number[]): Promise<DetailsForScreenshotUploads>; - - /** - * Retrieves a list of downloaded workshop items for a specific application. - * @param {number} appId - The ID of the application to retrieve downloaded workshop items for. - * @returns {Promise<WorkshopItem[]>} - A Promise that resolves to an array of downloaded workshop items for the specified application. - */ - GetDownloadedWorkshopItems(appId: number): Promise<WorkshopItem[]>; - - GetDurationControlInfo(appId: number): Promise<any>; // any - {"bApplicable": true} - overlay usage? - - /** - * Retrieves achievement information for a specific application for a given friend. - * @param {string} appId - The ID of the application to retrieve achievement information for. - * @param {string} friendSteam64Id - The Steam64 ID of the friend for whom to retrieve achievement information. - * @returns {Promise<AppAchievementResponse>} - A Promise that resolves to an object containing achievement information for the specified friend and application. - */ - GetFriendAchievementsForApp(appId: string, friendSteam64Id: string): Promise<AppAchievementResponse>; - - /** - * Retrieves a list of friends who play the specified application. - * @param {number} appId - The ID of the application. - * @returns {Promise<string[]>} A Promise that resolves to an array of Steam64 IDs representing friends who play the application. - */ - GetFriendsWhoPlay(appId: number): Promise<string[]>; - - /** - * Retrieves details of a game action. - * @param {number} appId - The ID of the application. - * @param {Function} callback - The callback function to handle the retrieved game action details and state. - * @param {GameAction} callback.gameAction - The game action received in the callback. - * @param {StateManager} callback.state - The state manager received in the callback. - * @returns {void} - */ - GetGameActionDetails(appId: number, callback: (gameAction: GameAction) => void): void; - - GetGameActionForApp( - appId: string, - callback: ( - gameActionId: number, - /** - * This parameter is a number only with the value `0`. - */ - appId: number | string, - taskName: AppAction, - ) => void, - ): void; - - /** - * Retrieves launch options for a specified application. - * These options may include different configurations or settings for launching the application, such as DirectX, Vulkan, OpenGL, 32-bit, 64-bit, etc. - * This function does not retrieve launch/argument options inputted by the user. - * @param {number} appId - The ID of the application. - * @returns {Promise<LaunchOption[]>} - A Promise that resolves to an array of launch options for the specified application. - */ - GetLaunchOptionsForApp(appId: number): Promise<LaunchOption[]>; - - /** - * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link LibraryBootstrapData}. - */ - GetLibraryBootstrapData(): Promise<ArrayBuffer>; - - /** - * Retrieves achievement information for the authenticated user in a specific Steam application. - * @param {string} appId - The ID of the application to retrieve achievement information for. - * @returns {Promise<AppAchievementResponse>} A Promise that resolves to an AppAchievementResponse object containing the achievement information for the authenticated user in the specified application. - */ - GetMyAchievementsForApp(appId: string): Promise<AppAchievementResponse>; - - /** - * Retrieves the playtime information for a specific application. - * @param {number} appId - The ID of the application to get playtime information for. - * @returns {Promise<Playtime | undefined>} A Promise that resolves to playtime information or undefined if not available. - */ - GetPlaytime(appId: number): Promise<Playtime | undefined>; - - GetPrePurchasedApps(appIds: number[]): Promise<PrePurchaseInfo>; - - /** - * Retrieves the resolution override for a specific application. - * @param {number} appId - The ID of the application to retrieve the resolution override for. - * @returns {Promise<string>} A Promise that resolves to a string of the resolution override. - */ - GetResolutionOverrideForApp(appId: number): Promise<string>; - - /** - * Represents a function to retrieve detailed information about a specific screenshot. - * @param {string} appId - The ID of the application the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @returns {Promise<Screenshot>} - A Promise that resolves to detailed information about the specified screenshot. - */ - GetScreenshotInfo(appId: string, hHandle: number): Promise<Screenshot>; - - /** - * Represents a function to retrieve screenshots within a specified time range. - * @param {number} appId - The ID of the application. - * @param {number} start - The start of the time range as a Unix timestamp. - * @param {number} end - The end of the time range as a Unix timestamp. - * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of screenshots taken within the specified time range. - */ - GetScreenshotsInTimeRange(appId: number, start: number, end: number): Promise<Screenshot[]>; - - /** - * Represents a function to retrieve shortcut data for a list of non-Steam app IDs. - * @param {number[]} appIds - An array of non-Steam application IDs. - * @returns {Promise<Shortcut[]>} - A Promise that resolves to an array of Shortcut objects for the specified non-Steam app IDs. - */ - GetShortcutData(appIds: number[]): Promise<Shortcut[]>; - - /** - * Retrieves shortcut data for a given shortcut file path. - * @param {string} pathToShortcut The path to the shortcut file. - * @returns {Promise<Shortcut>} A Promise that resolves to the shortcut data. - */ - GetShortcutDataForPath(pathToShortcut: string): Promise<Shortcut>; - - /** - * Represents a function to retrieve details about a soundtrack associated with a soundtrack application. - * The soundtrack has to be installed. - * @param {number} appId - The ID of the soundtrack application. - * @returns {Promise<SoundtrackDetails>} - A Promise that resolves to the details of the soundtrack associated with the specified soundtrack application. - */ - GetSoundtrackDetails(appId: number): Promise<SoundtrackDetails>; - - // [...appStore.m_mapStoreTagLocalization.keys()] - GetStoreTagLocalization(tags: number[]): Promise<StoreTagLocalization[]>; - - /** - * Retrieves a list of subscribed workshop item details for a specific application. - * @param {number} appId - The ID of the application to retrieve subscribed workshop item details for. - * @param {string[]} itemIds - Workshop item IDs to retrieve details for. - * @returns {Promise<WorkshopItemDetails[] | OperationResponse>} - A Promise that resolves to an array of subscribed workshop item details for the specified application. - * @throws Throws if the query failed. - */ - GetSubscribedWorkshopItemDetails(appId: number, itemIds: string[]): Promise<WorkshopItemDetails[] | OperationResponse>; - - /** - * Retrieves a list of subscribed workshop items for a specific application. - * @param {number} appId - The ID of the application to retrieve subscribed workshop items for. - * @returns {Promise<WorkshopItem[]>} - A Promise that resolves to an array of subscribed workshop items for the specified application. - */ - GetSubscribedWorkshopItems(appId: number): Promise<WorkshopItem[]>; - - InstallFlatpakAppAndCreateShortcut(appName: string, appCommandLineOptions: string): Promise<any>; // returns {"appid":0,"strInstallOutput":""} - JoinAppContentBeta(appId: number, name: string): any; - - JoinAppContentBetaByPassword(appId: number, accessCode: any): Promise<any>; // any.strName - - ListFlatpakApps(): Promise<any>; - - /** - * @throws if the user does not own the app or no EULA. - */ - LoadEula(appId: number): Promise<EndUserLicenseAgreement[]>; // Doesn't bring up the EULA dialog, just returns the eula data - MarkEulaAccepted(param0: any, param1: any, param2: any): any; - - MarkEulaRejected: any; - - /** - * Move specified workshop item load order. - * @param appId - The ID of the application. - * @param oldOrder - The item to move, referenced by its position number. - * @param newOrder - The position number to move the item to. - * @returns {void} - * @remarks Orders are zero-indexed. - */ - MoveWorkshopItemLoadOrder(appId: number, oldOrder: number, newOrder: number): void; - - /** - * Opens the settings dialog for a specific application. - * @param {number} appId - The ID of the application for which to open the settings dialog. - * @param {string} section - The section (tab) to switch to. - * @returns {void} - */ - OpenAppSettingsDialog(appId: number, section: string): void; - - /** - * Raises the window for a given application. - * @param {string} appId - The ID of the application to raise the window of. - * @returns {Promise<number>} - A Promise that resolves to a number. - * @todo Returns a result enum? 1 if ok, 2 if not running - */ - RaiseWindowForGame(appId: number): Promise<number>; // ResumeGameInProgress - - /** - * Registers a callback function to be called when achievement changes occur. - * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAchievementChanges(callback: () => void): Unregisterable | any; - - RegisterForAppBackupStatus(callback: (appBackupStatus: AppBackupStatus) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when app details change. - * @param appId The ID of the application to monitor. - * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; - - /** - * If `data` is deserialized, returns {@link AppOverview_Change}. - * @remarks This is not a mistake, it doesn't return anything. - */ - RegisterForAppOverviewChanges(callback: (data: ArrayBuffer) => void): void; - - RegisterForDRMFailureResponse( - callback: (appid: number, eResult: number, errorCode: number) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a game action ends. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionEnd(callback: (gameActionIdentifier: number) => void): Unregisterable | any; - - // "error" is a localization token - RegisterForGameActionShowError(callback: (gameActionId: number, appId: string, actionName: string, error: string, param4: string) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when a game action UI is shown. - * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; // todo: no idea what this callback is from - - /** - * Registers a callback function to be called when a game action starts. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionStart( - callback: (gameActionIdentifier: number, appId: string, action: string, param3: AppLaunchSource) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a game action task changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionTaskChange( - callback: ( - gameActionIdentifier: number, - appId: string, - action: string, - requestedAction: string, - param4: string, - ) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a user requests a game action. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameActionUserRequest( - callback: ( - gameActionIdentifier: number, - appId: string, - action: string, - requestedAction: string, - appId2: string, - ) => void, - ): Unregisterable | any; - - /** - * @todo returns undefined (now)? - */ - RegisterForLocalizationChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - - RegisterForPrePurchasedAppChanges(callback: () => void): Unregisterable | any; // Unknown, did have it show up a few times, but not callback parameters - RegisterForShowMarketingMessageDialog: Unregisterable | any; - - /** - * Registers a callback function to be notified when workshop items are added or removed from a Steam application. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForWorkshopChanges(callback: (appId: number) => void): Unregisterable | any; - - RegisterForWorkshopItemDownloads( - appId: number, - callback: (appId: number, publishedFileId: string, param2: number) => void, - ): Unregisterable | any; - - RegisterForWorkshopItemInstalled: any; - - /** - * Removes a non-Steam application shortcut from the Steam library. - * @param {number} appId - The ID of the application for which to remove the shortcut. - * @returns {void} - */ - RemoveShortcut(appId: number): void; - - /** - * Removes a user tag from multiple Steam applications. - * @param {number[]} appIds - An array of application IDs from which the user tag should be removed. - * @param {string} userTag - The user tag to be removed. - * @returns {void} - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - RemoveUserTagFromApps(appIds: number[], userTag: string): void; - - ReportLibraryAssetCacheMiss(appId: number, assetType: AppArtworkAssetType): void; - - ReportMarketingMessageDialogShown(): void; - - RequestIconDataForApp(appId: number): any; - - RequestLegacyCDKeysForApp(appId: number): any; - - // collectionStore.GetCollection('hidden').allApps.map(e => e.appid) - // May be broken? - ResetHiddenState(appIds: number[]): Promise<void>; - - /** - * Runs a game with specified parameters. Focuses the game if already launched. - * @param {string} appId - The ID of the application to run. - * @param {string} launchOptions - Additional launch options for the application. - * @param {number} param2 - Additional parameter (exact usage may vary). - * @param {AppLaunchSource} launchSource - * @remarks `launchOptions` is appended before the ones specified in the application's settings. - * @returns {void} - */ - RunGame(appId: string, launchOptions: string, param2: number, launchSource: AppLaunchSource): void; - - /* - function u(e, t) { - return t instanceof Map || t instanceof Set ? Array.from(t) : t; - } - SteamClient.Apps.SaveAchievementProgressCache( - JSON.stringify(this.m_achievementProgress, u) - ); - */ - SaveAchievementProgressCache(progress: string): any; - - /** - * Scans the system for installed non-Steam applications. - * @returns {Promise<NonSteamApp[]>} A Promise that resolves to an array of NonSteamApp objects representing installed non-Steam applications. - * @remarks This function scans the user's system for installed applications that are not part of the Steam library. It does not scan for shortcuts added to the Steam library. - * - * On Linux, it scans inside /usr/share/applications and $XDG_DATA_HOME/applications. - */ - ScanForInstalledNonSteamApps(): Promise<NonSteamApp[]>; - - /** - * Sets the automatic update behavior for a Steam application. - * @param {number} appId - The ID of the application to set the update behavior for. - * @param {AutoUpdateBehavior} mode - The update behavior mode to set. - * @returns {void} - * @remarks This function only works with installed Steam applications. - */ - SetAppAutoUpdateBehavior(appId: number, mode: AutoUpdateBehavior): void; - - /** - * Sets the background downloads behavior for a specific Steam application. - * @param {number} appId - The ID of the application to set the background downloads behavior for. - * @param {BackgroundDownloadsBehavior} mode - The background downloads mode to set. - * @returns {void} - * @remarks This function only works with installed Steam applications. - */ - SetAppBackgroundDownloadsBehavior(appId: number, mode: BackgroundDownloadsBehavior): void; - - /** - * Sets the current language for a specific Steam application. - * @param {number} appId - The ID of the application to set the current language for. - * @param {string} language - The language to set, represented as a language (e.g., "english", "spanish", "tchinese", "schinese"). - * @returns {void} - */ - SetAppCurrentLanguage(appId: number, language: string): void; - - /** - * Sets the blocked state for apps. - * @param {number[]} appIds - An array of app IDs to set the blocked state for. - * @param {boolean} state - The state to set (true for blocked, false for unblocked). - * @returns {void} - */ - SetAppFamilyBlockedState(appIds: number[], state: boolean): void; - - /** - * Sets the hidden status of a specific Steam application. - * @param {number} appId - The ID of the application to set the hidden status for. - * @param {boolean} value - The value indicating whether the application should be hidden (true) or not (false). - * @returns {void} - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file to set the hidden status of the specified application. - */ - SetAppHidden(appId: number, value: boolean): void; - - /** - * Sets launch options for a Steam application. - * @param {number} appId - The ID of the application to set launch options for. - * @param {string} launchOptions - The launch options to be set for the application. - * @returns {void} - */ - SetAppLaunchOptions(appId: number, launchOptions: string): void; - - /** - * Sets a resolution override for a Steam application. - * @param {number} appId - The ID of the application to set the resolution override for. - * @param {string} resolution - The resolution to be set for the application. It can be "Default", "Native", or other compatible resolutions for the user's monitor. - * @returns {void} - */ - SetAppResolutionOverride(appId: number, resolution: string): any; - - /** - * Sets cached details for a specific application. - * @param {number} appId - The ID of the application. - * @param {string} details - The details to be cached, a stringified object. - * @returns {Promise<any>} - A Promise that resolves when the details are successfully cached. - * todo: might return boolean? - */ - SetCachedAppDetails(appId: number, details: string): Promise<any>; - - SetControllerRumblePreference(appId: number, param1: number): any; // param1 - enum for preference - - /** - * Sets the custom artwork for a given application. - * @param {number} appId - The ID of the application to set custom artwork for. - * @param {string} base64Image - Base64 encoded image. - * @param {string} imageType - "jpeg" or "png". - * @param {AppArtworkAssetType} assetType - The type of artwork to set. - * @returns {Promise<any>} A Promise that resolves after the custom artwork is set. - */ - SetCustomArtworkForApp(appId: number, base64Image: string, imageType: string, assetType: AppArtworkAssetType): Promise<any>; - - /** - * Sets a custom logo position for a specific app. - * @param {number} appId - The ID of the application. - * @param {string} details - The details of the custom logo position, expected to be a stringified {@link LogoPositionForApp} object. - * @returns {Promise<void>} - A Promise that resolves when the custom logo position is successfully set. - */ - SetCustomLogoPositionForApp(appId: number, details: string): Promise<void>; - - /** - * Sets the enabled state for downloadable content (DLC) of a specific app. - * @param {number} appId - The ID of the parent application. - * @param {number} appDLCId - The ID of the DLC to set the state for. - * @param {boolean} value - The value to set (true for enabled, false for disabled). - * @returns {void} - */ - SetDLCEnabled(appId: number, appDLCId: number, value: boolean): void; - - /** - * Set a local screenshot's caption. - * @param {string} appId - The application ID the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @param {string} caption - * @returns {void} - */ - SetLocalScreenshotCaption(appId: string, hHandle: any, caption: string): void; - - /** - * Set a local screenshot's privacy state. - * @param {string} appId - The application ID the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @param {FilePrivacyState} privacy - Screenshot privacy state. - */ - SetLocalScreenshotPrivacy(appId: string, hHandle: any, privacy: FilePrivacyState): void; - - /** - * Set a local screenshot's spoiler state. - * @param {string} appId - The application ID the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @param {boolean} spoilered - Is the screenshot spoilered? - */ - SetLocalScreenshotSpoiler(appId: string, hHandle: any, spoilered: boolean): void; - - /** - * Sets the icon for a non-Steam application shortcut. - * @param {string} appId - The ID of the application to set the shortcut icon for. - * @param {string} iconPath - The path to the icon image (can be png or tga format). - * @returns {void} - */ - SetShortcutIcon(appId: number, iconPath: string): void; - - /** - * Sets whether a non-Steam application shortcut should be included in the VR library. - * @param {number} appId The ID of the application to set the VR status for. - * @param {boolean} value A boolean indicating whether the application should be included in the VR library. - * @returns {void} - */ - SetShortcutIsVR(appId: number, value: boolean): void; - - /** - * Sets launch options for a non-Steam application shortcut. - * @param {number} appId - The ID of the application to set the launch options for. - * @param {string} launchOptions - The launch options to be used when starting the application. - * @returns {void} - */ - SetShortcutLaunchOptions(appId: number, launchOptions: string): void; - - /** - * Sets the name for a non-Steam application shortcut. - * @param {number} appId - The ID of the application to set the shortcut name for. - * @param {string} shortcutName - The name to be displayed for the application shortcut. - * @returns {void} - */ - SetShortcutName(appId: number, shortcutName: string): void; - - /** - * Sets the starting directory for a non-Steam application shortcut. - * @param {number} appId - The ID of the application to set the starting directory for. - * @param {string} directory - The directory from which the application should be launched. - * @returns {void} - */ - SetShortcutStartDir(appId: number, directory: string): void; - - /** - * Sets the client ID for streaming for a specific application. - * @param {number} appId - The ID of the application. - * @param {string} clientId - The client ID for streaming. - */ - SetStreamingClientForApp(appId: number, clientId: string): void; - - SetThirdPartyControllerConfiguration(appId: number, param1: number): any; - - /** - * Sets the workshop items disabled state. - * @param {number} appId - The ID of the application. - * @param {string[]} itemIds - Workshop item IDs to change the state for. - * @param {boolean} value - `true` to disable, `false` otherwise. - * @returns {void} - */ - SetWorkshopItemsDisabledLocally(appId: number, itemIds: string[], value: boolean): void; - - /** - * Sets the workshop items load order for a specified application. - * @param {number} appId - The ID of the application. - * @param {string[]} itemIds - Workshop item IDs. - * @returns {void} - * @remarks `itemIds` has to be the full list of subscribed items, otherwise the specified items get moved to the last position. - */ - SetWorkshopItemsLoadOrder(appId: number, itemIds: string[]): void; - - /** - * Opens the controller configurator for a specific application. - * @param {number} appId - The ID of the application for which to open the controller configurator. - * @returns {void} - */ - ShowControllerConfigurator(appId: number): void; - - /** - * Opens the Steam store page for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} - */ - ShowStore(appId: number): void; - - SpecifyCompatExperiment: any; - - /** - * Specifies a compatibility tool by its name for a given application. If strToolName is an empty string, the specified application will no longer use a compatibility tool. - * @param {number} appId - The ID of the application to specify compatibility tool for. - * @param {string} strToolName - The name of the compatibility tool to specify. - * @returns {void} - */ - SpecifyCompatTool(appId: number, strToolName: string): void; - - StreamGame(appId: number, clientId: string, param2: number): void; - - /** - * Subscribes or unsubscribes from a workshop item for a specific app. - * @param {number} appId - The ID of the application. - * @param {string} workshopId - The ID of the workshop item. - * @param {boolean} subscribed - True to subscribe, false to unsubscribe. - * @returns {void} - */ - SubscribeWorkshopItem(appId: number, workshopId: string, subscribed: boolean): void; - - /** - * Terminates a running application. - * @param {string} appId - The ID of the application to terminate. - * @param {boolean} param1 - Additional parameter. Exact usage may vary. - * @returns {void} - */ - TerminateApp(appId: string, param1: boolean): void; - - // "#AppProperties_SteamInputDesktopConfigInLauncher" - ToggleAllowDesktopConfiguration(appId: number): any; - - /** - * Toggles the Steam Cloud synchronization for game saves for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - ToggleAppSteamCloudEnabled(appId: number): void; - - // "#AppProperties_EnableSteamCloudSyncOnSuspend" - ToggleAppSteamCloudSyncOnSuspendEnabled(appId: number): any; - - /** - * Toggles the Steam Overlay setting for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} - */ - ToggleEnableSteamOverlayForApp(appId: number): void; - - // "#AppProperties_ResolutionOverride_Internal" - ToggleOverrideResolutionForInternalDisplay(appId: number): any; - - UninstallFlatpakApp(app: string): Promise<boolean>; - - /** - * Verifies the integrity of an app's files. - * @param {number} appId - The ID of the app to verify. - */ - VerifyApp(appId: number): Promise<any>; // todo: returns {"nGameActionID":9} -} - -export interface Auth { - GetLocalHostname(): Promise<string>; - - /** - * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link Authentication_DeviceDetails}. - */ - GetMachineID(): Promise<ArrayBuffer>; - - GetRefreshInfo(): Promise<AuthRefreshInfo>; - - GetSteamGuardData(param0: any): any; - - IsSecureComputer(): Promise<boolean>; - - SetLoginToken(refreshToken: string, accountName: string): any; - - SetSteamGuardData(accountName: string, newGuardData: string): any; - - StartSignInFromCache(param0: any, login: string): Promise<any>; -} - -export interface Broadcast { - /** - * Approves a viewer request for the broadcast. - * @param {string} steamId64 - The SteamID64 of the user whose request is to be approved. - * @param {number} param1 - Unknown parameter. - */ - ApproveViewerRequest(steamId64: string, param1: number): void; - - /** - * Invites a user identified by their SteamID64 to watch the broadcast. - * @param {string} steamId64 - The SteamID64 of the user to invite. - * @returns {Promise<number>} - A Promise indicating the result of the invitation (1 for success, 2 for error). - */ - InviteToWatch(steamId64: string): Promise<number>; - - /** - * Registers a callback to be called when the broadcast status changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForBroadcastStatus(callback: (broadcastStatus: BroadcastStatus) => void): Unregisterable | any; - - /** - * Registers a callback to be called when viewer requests are received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForViewerRequests( - callback: (viewerFriendCode: number, param1: number, param2: number) => void, - ): Unregisterable | any; - - /** - * Rejects a viewer request for the broadcast. - * @param {string} steamId64 - The SteamID64 of the user whose request is to be rejected. - * @param {number} param1 - Unknown parameter. - */ - RejectViewerRequest(steamId64: string, param1: number): void; - - /** - * Stops the broadcast. - * @returns {void} - */ - StopBroadcasting(): void; -} - -export interface Browser { - AddWordToDictionary(word: string): void; - - ClearAllBrowsingData(): void; - - ClearHistory(): void; - - CloseDevTools(): void; - - GetBrowserID(): Promise<number>; - - GetSpellingSuggestions(word: string): string[]; - - GetSteamBrowserID(): Promise<number>; // 16-bit unsigned integer? - - /** - * Hides the mouse cursor until input. - * @returns {void} - */ - HideCursorUntilMouseEvent(): void; - - InspectElement(clientY: number, clientX: number): void; // yup that's right, clientY and clientX are reversed - - NotifyUserActivation(): void; - - OpenDevTools(): void; - - /** - * Pastes the clipboard contents. - */ - Paste(): void; - - /** - * @todo unconfirmed - */ - RegisterForGestureEvents(callback: (gesture: TouchGesture) => void): Unregisterable | any; - - RegisterForOpenNewTab: Unregisterable | any; - - ReplaceMisspelling: any; - - /** - * Restarts the browser. - * @returns {void} - */ - RestartJSContext(): void; - - SetBackgroundThrottlingDisabled(value: boolean): void; - - SetPendingFilePath(path: string): Promise<boolean>; - - SetShouldExitSteamOnBrowserClosed(value: boolean): any; - - SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; - - /** - * Prompts and downloads a file. - * @param {string} url - The URL of the file to download. - * @returns {void} - */ - StartDownload(url: string): void; -} - -export interface BrowserView { - Create(browser?: BrowserViewInit): BrowserViewPopup; - - CreatePopup(browser?: BrowserViewInit): { - /** - * URL for usage with `window.open()`. - */ - strCreateURL: string; - browserView: BrowserViewPopup; - }; - - Destroy(browser: BrowserViewInit): void; - - PostMessageToParent(message: string, args: string): void; -} - -export interface ClientNotifications { - /** - * Displays a Steam notification. - * @param {ClientUINotification} notification - Notification type. - * @param {string} options - Stringified object of `NotificationOptions`. - * @param {function} callback - */ - DisplayClientNotification(notification: ClientUINotification, options: string, callback: any): void; - - /** - * @param notificationId The ID of the notification to handle. - * @param handleAction `true` to habdle the associated notification action, `false` otherwise. - */ - OnRespondToClientNotification(notificationId: number, handleAction: boolean): void; -} - -export interface Cloud { - /** - * Resolves a synchronization conflict for an app in the cloud. - * @param {number} appId - The ID of the app with the sync conflict. - * @param {boolean} keepLocal - Whether to keep the local version during conflict resolution. - * @returns {any} - Returns data related to resolving the sync conflict. - */ - ResolveAppSyncConflict(appId: number, keepLocal: boolean): void; - - /** - * Retries syncing an app with the cloud. - * @param {number} appId - The ID of the app to retry syncing. - * @returns {any} - Returns data related to retrying the app sync. - */ - RetryAppSync(appId: number): void; -} - -export interface CommunityItems { - /* - DownloadMovie(e) { - return (0, o.mG)(this, void 0, void 0, (function* () { - if (0 != e.movie_webm_local_path.length) return !0; - let t = yield SteamClient.CommunityItems.DownloadItemAsset(e.communityitemid, w, e.movie_webm), - n = 1 == t.result; - if (n) { - e.movie_webm_local_path = t.path; - let n = []; - this.m_startupMovies.forEach((t => { - t.movie_webm == e.movie_webm ? n.push(e) : n.push(t) - })), this.m_startupMovies = n - } - return n - })) - } - */ - DownloadItemAsset(communityItemId: string, param1: any, param2: string): any; - - GetItemAssetPath(communityItemId: string, param1: any, param2: string): any; - - RemoveDownloadedItemAsset(communityItemId: string, param1: any, param2: string): any; -} - -/** - * Represents the console functionality for executing commands and handling spew output. - */ -export interface Console { - /** - * Executes a console command. - * @param {string} command - The command to execute in the console. - * @returns {void} - */ - ExecCommand(command: string): void; - - /** - * Retrieves autocomplete suggestions for a given console command. - * @param {string} command - The console command to provide autocomplete suggestions for. - * @returns {Promise<string[]>} - A Promise that resolves to an array of autocomplete suggestions. - */ - GetAutocompleteSuggestions(command: string): Promise<string[]>; - - /** - * Registers a callback function to receive spew output. - * @param {function} callback - The callback function that will receive spew output. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForSpewOutput(callback: (spewOutput: SpewOutput) => void): Unregisterable | any; -} - -export interface Customization { - GenerateLocalStartupMoviesThumbnails(param0: number): Promise<number>; - - //param0: "startupmovies" - GetDownloadedStartupMovies(param0: string): Promise<StartupMovie[]>; - - GetLocalStartupMovies(): Promise<StartupMovie[]>; -} - -/** - * Represents functions related to managing downloads in Steam. - */ -export interface Downloads { - /** - * Enables or disables all downloads in Steam. - * @param {boolean} enable - True to enable downloads, false to disable. - */ - EnableAllDownloads(enable: boolean): void; - - /** - * Moves the update for a specific app down the download queue. - * @param {number} appId - The ID of the application to move. - * @returns {void} - */ - MoveAppUpdateDown(appId: number): void; - - /** - * Moves the update for a specific app up the download queue. - * @param {number} appId - The ID of the application to move. - * @returns {void} - */ - MoveAppUpdateUp(appId: number): void; - - PauseAppUpdate(appId: number): void; // Broken? It seems to be removing it from download list like RemoveFromDownloadList - - /** - * Adds the update for a specific app to the download queue. - * @param {number} appId - The ID of the application to queue. - * @returns {void} - */ - QueueAppUpdate(appId: number): void; - - /** - * Registers a callback function to be called when download items change. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDownloadItems( - callback: (isDownloading: boolean, downloadItems: DownloadItem[]) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when download overview changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDownloadOverview(callback: (downloadOverview: DownloadOverview) => void): Unregisterable | any; - - /** - * Removes the update for a specific app from the download list and places it in the unscheduled list. - * @param {number} appId - The ID of the application to remove. - * @returns {void} - */ - RemoveFromDownloadList(appId: number): void; - - /** - * Resumes the update for a specific app in the queue. - * @param {number} appId - The ID of the application to resume. - * @returns {void} - */ - ResumeAppUpdate(appId: number): void; - - /** - * Sets an app to launch when its download is complete. - * @param {number} appId - The ID of the application to set. - * @returns {void} - * @todo: unsure if this toggles though - */ - SetLaunchOnUpdateComplete(appId: number): void; - - /** - * Sets the queue index for an app in the download queue. - * @param {number} appId - The ID of the application to set the index for. - * @param {number} index - The index to set. - * @returns {void} - * @remarks Index of 0 is the current download in progress. - */ - SetQueueIndex(appId: number, index: number): void; - - /** - * Suspends or resumes download throttling. - * @param {boolean} suspend - Whether to suspend or resume download throttling. - * @returns {void} - */ - SuspendDownloadThrottling(suspend: boolean): void; - - /** - * Suspends or resumes local transfers. - * @param {boolean} suspend - Whether to suspend or resume local transfers. - * @returns {void} - */ - SuspendLanPeerContent(suspend: boolean): void; -} - -/** - * Represents functions related to Steam Family Sharing. - */ -export interface FamilySharing { - /** - * Authorizes library sharing on the local device. - * @returns {Promise<number>} A Promise that resolves to a status code. - * FamilySettings_SteamGuardRequired - 18 - * FamilySettings_LimitExceeded - 25 - * FamilySettings_FailedToAuthorize - any other number - */ - AuthorizeLocalDevice(): Promise<number>; - - /** - * Deauthorizes library sharing on the local device. - * @returns {Promise<number>} A Promise that resolves to a status code. - */ - DeauthorizeLocalDevice(): Promise<number>; - - GetAvailableLenders(appId: number): Promise<Lender[]>; - - GetFamilyGroupInfo(): Promise<string>; - - RegisterForKickedBorrower: any; - - RequestLocalDeviceAuthorization(steam64Id: string): Promise<number>; - - SetPreferredLender(appId: number, param1: number): Promise<number>; - - // param0 - account id? - // return FamilySettings_TooManyBorrowers - 25, FamilySettings_FailedToUpdateBorrower - any number that's not 1 or previous - UpdateAuthorizedBorrower(param0: number, param1: boolean): Promise<number>; -} - -/** - * Represents friend settings and configuration. - */ -export interface FriendSettings { - /** - * Retrieves a list of enabled friend settings features. - * @returns {Promise<FriendSettingsFeature[]>} - A Promise that resolves to an array of enabled friend settings features. - */ - GetEnabledFeatures(): Promise<FriendSettingsFeature[]>; - - /** - * Registers a callback function to be notified of friend settings changes. - * @param callback - The callback function to be called when friend settings change. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @remarks The callback receives an escaped JSON object string as "settingsChanges", which should be parsed into {@link FriendSettingsChange} object. - */ - RegisterForSettingsChanges(callback: (settingsChanges: string) => void): Unregisterable | any; - - SetFriendSettings(details: string): any; // stringified object -} - -/** - * Represents functions related to managing friends in Steam. - */ -export interface Friends { - /** - * Adds a user to the friend list. - * @param {string} steamId - The Steam ID of the user to add as a friend. - * @returns {Promise<boolean>} A Promise that resolves to true if the friend was added successfully, false otherwise. - */ - AddFriend(steamId: string): Promise<boolean>; - - GetCoplayData(): Promise<CoplayData>; - - //(e.ConvertTo64BitString(), t.steamidTarget) - InviteUserToCurrentGame(param0: any, param1: any): any; - - /** - * Invites a user to a specific game. - * @param {string} steamId - The Steam ID of the user to invite. - * @param {number} appId - The ID of the game to invite the user to. - * @param {string} connectString - Additional parameters for the invitation. - * @returns {Promise<boolean>} A Promise that resolves to true if the user was invited successfully, false otherwise. - */ - InviteUserToGame(steamId: string, appId: number, connectString: string): Promise<boolean>; - - //(e.ConvertTo64BitString(), t.steamidTarget) - InviteUserToLobby(param0: any, param1: any): any; - - //(e.ConvertTo64BitString()) - InviteUserToRemotePlayTogetherCurrentGame(param0: any): any; - - RegisterForVoiceChatStatus(callback: (status: any) => void): any; - - /** - * Removes a user from the friend list. - * @param {string} steamId - The Steam ID of the user to remove from the friend list. - * @returns {Promise<boolean>} A Promise that resolves to true if the friend was removed successfully, false otherwise. - */ - RemoveFriend(steamId: string): Promise<boolean>; -} - -export interface GameNotes { - DeleteImage(param0: any): any; - - DeleteNotes: any; - /* - FilenameForNotes(e) { - return "appid" in e ? `notes_${Number(e.appid)}` : `notes_shortcut_${h(e.shortcut)}` - } - DirectoryForNoteImages(e) { - return "appid" in e ? `notes_${Number(e.appid)}_images/` : `notes_shortcut_${h(e.shortcut)}_images/` - } - */ - // {"result":1,"notes":"<escaped json>"} - // <escaped json> example: {"notes":[{"id":"lmuudzqn","appid":1716740,"ordinal":0,"time_created":1695401684,"time_modified":1695403395,"title":"Old Earth Cuisine 1:","content":"[h1]Old Earth Cuisine 1:[/h1][list][*][p]Red Meat[/p][/*][/list][h1]Beverage Development 2:[/h1][list][*][p]Tranquilitea Sunray[/p][/*][/list][p][/p]"}]} - GetNotes(filenameForNotes: string, directoryForNoteImages: string): Promise<any>; - - GetNotesMetadata: any; - GetNumNotes: any; - GetQuota: any; - - IterateNotes(appId: number, length: number): any; // Results array of {"result":1,"filename":"","filesize":0,"timestamp":0} - ResolveSyncConflicts: any; - - SaveNotes(filenameForNotes: string, param1: string): Promise<any>; // param1 - notes like escaped json in GetNotes - SyncToClient(): Promise<any>; - - SyncToServer(): Promise<any>; - - UploadImage: any; -} - -/** - * Represents functions related to Steam Game Sessions. - */ -export interface GameSessions { - /** - * Registers a callback function to be called when an achievement notification is received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAchievementNotification( - callback: (achievementNotification: AchievementNotification) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when an app lifetime notification is received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppLifetimeNotifications( - callback: (appLifetimeNotification: AppLifetimeNotification) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a screenshot notification is received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForScreenshotNotification( - callback: (screenshotNotification: ScreenshotNotification) => void, - ): Unregisterable | any; -} - -/** - * Represents functions related to input and controllers in Steam. - */ -export interface Input { - CalibrateControllerIMU(controllerIndex: any): any; - - CalibrateControllerJoystick(controllerIndex: any): any; - - CalibrateControllerTrackpads(controllerIndex: any): any; - - CancelGyroSWCalibration(): any; - - ClearSelectedConfigForApp(appId: number, controllerIndex: number): any; - - CloseDesktopConfigurator: any; - - /** - * Writes text. - * @param {string} textToWrite - The text to write. - * @returns {void} - */ - ControllerKeyboardSendText(textToWrite: string): void; - - /** - * Sets a specified key's pressed state. - * @param {EHIDKeyboardKey} keyIndex - The key index to set the state for. - * @param {boolean} state - true for pressed, false otherwise. - * @returns {void} - * @example - * Send paste command: - * ``` - * SteamClient.Input.ControllerKeyboardSetKeyState(EHIDKeyboardKey.LControl, true); - * SteamClient.Input.ControllerKeyboardSetKeyState(EHIDKeyboardKey.V, true); - * SteamClient.Input.ControllerKeyboardSetKeyState(EHIDKeyboardKey.V, false); - * SteamClient.Input.ControllerKeyboardSetKeyState(EHIDKeyboardKey.LControl, false); - * ``` - */ - ControllerKeyboardSetKeyState(keyIndex: EHIDKeyboardKey, state: boolean): void; - - DeauthorizeControllerAccount: any; - - DecrementCloudedControllerConfigsCounter(): any; - - DeletePersonalControllerConfiguration(param0: any): any; - - //f.Debug("sending to client"), this.SetEditingConfigurationValue(e, t, c.QU, (e => SteamClient.Input.DuplicateControllerConfigurationSourceMode(this.m_unControllerIndex, e))), this.SaveEditingConfiguration(e), this - DuplicateControllerConfigurationSourceMode(controllerIndex: number, param1: any): any; - - EndControllerDeviceSupportFlow(): any; - - ExportCurrentControllerConfiguration(controllerIndex: number, appId: number, param2: number, title: string, description: string, param5: string): Promise<any>; - - ForceConfiguratorFocus(param0: boolean): any; - - ForceSimpleHapticEvent(param0: number, param1: number, param2: number, param3: number, param4: number): any; - - FreeControllerConfig(m_ChordSummaryConfiguration: any): any; - - GetConfigForAppAndController(appId: number, unControllerIndex: number): any; - - /** - * Retrieves the controller mapping string for the specified controller index. - * @param {number} unControllerIndex - The controller index. - * @returns {Promise<string>} - A Promise that resolves to the controller mapping string. - */ - GetControllerMappingString(unControllerIndex: number): Promise<string>; - - GetControllerPreviouslySeen(): Promise<number[]>; - - GetSteamControllerDongleState(): Promise<boolean>; - - GetTouchMenuIconsForApp(appId: number): Promise<any>; - - GetXboxDriverInstallState(): Promise<any>; // "{"nResult":0}" - IdentifyController(controllerIndex: number): any; - - InitControllerSounds(): any; - - InitializeControllerPersonalizationSettings(controllerIndex: number): any; - - ModalKeyboardDismissed(): void; - - OpenDesktopConfigurator: any; - - PreviewConfigForAppAndController(appId: number, controllerIndex: number, workshopUri: string): any; - - PreviewControllerLEDColor(flHue: number, flSaturation: number, flBrightness: number): any; - - QueryControllerConfigsForApp(appId: number, controllerIndex: number, param2: boolean): any; - - RegisterForActiveControllerChanges: Unregisterable | any; // {"nActiveController":0} - //param0 - e possibly appid? - //param1 - some index? - RegisterForConfigSelectionChanges(callback: (param0: number, param1: number) => void): Unregisterable | any; - - RegisterForControllerAccountChanges: Unregisterable | any; - - RegisterForControllerAnalogInputMessages( - callback: (controllerAnalogInputMessages: ControllerAnalogInputMessage[]) => void, - ): Unregisterable | any; - - RegisterForControllerCommandMessages( - callback: (controllerCommandMessage: ControllerCommandMessage) => void, - ): Unregisterable | any; - - /** - * Registers a callback for changes in controller configuration cloud state. - * @param {(controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void} callback - The callback function for config cloud state changes. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForControllerConfigCloudStateChanges( - callback: (controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void, - ): Unregisterable | any; - - /** - * Registers a callback for receiving controller configuration info messages (controller layouts query, personal controller layout query). - * @param {(controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[]) => void} callback - The callback function for controller config info messages. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @remarks Do Not Use, this will break the controller layout selection unless you know what you are doing. - */ - RegisterForControllerConfigInfoMessages( - callback: ( - controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[], - ) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be invoked when controller input messages are received. - * @param {(controllerInputMessages: ControllerInputMessage[]) => void} callback - The callback function to be invoked when controller input messages are received. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForControllerInputMessages( - callback: (controllerInputMessages: ControllerInputMessage[]) => void, - ): Unregisterable | any; - - RegisterForControllerListChanges(callback: (controllerListChanges: ControllerInfo[]) => void): Unregisterable | any; - - /** - * Registers a callback for changes in the controller state (buttons presses, triggers presses, joystick changes etc...). - * @param {(controllerStateChanges: ControllerStateChange[]) => void} callback - The callback function for controller state changes. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForControllerStateChanges( - callback: (controllerStateChanges: ControllerStateChange[]) => void, - ): Unregisterable | any; - - RegisterForDualSenseUpdateNotification(callback: (m_strDualSenseUpdateProduct: string) => void): Unregisterable | any; - - /** - * Registers a callback for receiving game keyboard messages (text field popup for inputting text for games when in character creation or etc...). - * @param {(gameKeyboardMessage: GameKeyboardMessage) => void} callback - The callback function for game keyboard messages. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForGameKeyboardMessages(callback: (gameKeyboardMessage: GameKeyboardMessage) => void): Unregisterable | any; - - RegisterForRemotePlayConfigChanges(callback: () => void): Unregisterable | any; - - //data.appId, data.ulConfigId - RegisterForShowControllerLayoutPreviewMessages(callback: (data: any) => void): Unregisterable | any; - - /* - onTouchMenuInput(e) { - for (let t = 0; t < e.length; t++) { - const n = this.TouchMenuGetKey(e[t]), o = this.m_mapActiveTouchMenus.get(n); - void 0 !== o && o.updateTouchMenuState(e[t]) - } - } - */ - RegisterForTouchMenuInputMessages(callback: (inputs: number[]) => void): Unregisterable | any; - - RegisterForTouchMenuMessages(callback: (touchMenuMessage: TouchMenuMessage) => void): Unregisterable | any; - - //param0 - index? - RegisterForUIVisualization(param0: any, param1: any, param2: any): Unregisterable | any; - - RegisterForUnboundControllerListChanges(callback: (m_unboundControllerList: any) => void): Unregisterable | any; // param0 is an array - - /* - OnDismissKeyboardMessage(e) { - this.m_WindowStore.SteamUIWindows.forEach((e => e.VirtualKeyboardManager.SetVirtualKeyboardHidden(e.BrowserWindow))) - } - */ - RegisterForUserDismissKeyboardMessages(callback: (param0: any) => void): Unregisterable | any; - - RegisterForUserKeyboardMessages: Unregisterable | any; - - RequestGyroActive(controllerIndex: number, param1: boolean): any; - - RequestRemotePlayControllerConfigs(param0: any): any; - - ResetControllerBindings(param0: any): any; - - ResolveCloudedControllerConfigConflict(param0: any): any; - - RestoreControllerPersonalizationSettings(controllerIndex: number): any; - - SaveControllerCalibration(controllerIndex: number): any; - - SaveControllerPersonalizationSettings(param0: any): any; - - SaveControllerSounds: any; - - SaveEditingControllerConfiguration(controllerIndex: number, sharedConfig: boolean): any; - - SetActiveControllerAccount: any; - - //this.SetEditingConfigurationValue(e, t, c.sL, (e => SteamClient.Input.SetControllerConfigurationModeShiftBinding(this.m_unControllerIndex, e))) - SetControllerConfigurationModeShiftBinding(controllerIndex: number, param1: any): any; - - SetControllerHapticSetting(controllerIndex: number, eHapticSetting: any): any; - - SetControllerMappingString(mapping: string): void; - - SetControllerName(controllerIndex: number, controllerName: string): any; - - SetControllerNintendoLayoutSetting: any; - SetControllerPersonalizationName: any; - - //param0 - nLStickDeadzone, bSWAntiDrift, nRHapticStrength, flRPadPressureCurve - /* - SteamClient.Input.SetControllerPersonalizationSetting("nLStickDeadzone", e.nLStickDeadzone), - SteamClient.Input.SetControllerPersonalizationSetting("nRStickDeadzone", e.nRStickDeadzone), - SteamClient.Input.SetControllerPersonalizationSetting("bSWAntiDrift", e.bSWAntiDrift ? 1 : 0), - SteamClient.Input.SetControllerPersonalizationSetting("nLHapticStrength", e.nLHapticStrength), - SteamClient.Input.SetControllerPersonalizationSetting("nRHapticStrength", e.nRHapticStrength), - SteamClient.Input.SetControllerPersonalizationSetting("flLPadPressureCurve", 100 * e.flLPadPressureCurve), - SteamClient.Input.SetControllerPersonalizationSetting("flRPadPressureCurve", 100 * e.flRPadPressureCurve), - SteamClient.Input.SetControllerPersonalizationSetting("ePlayerSlotLEDSetting", e), - SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nGyroSampleAngleOffsetX", e.nGyroSampleAngleOffsetX), - SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.bMomentumEnabled", e.bMomentumEnabled ? 1 : 0), - SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nMomentumFrictionX", e.nMomentumFrictionX), - SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nMomentumFrictionY", e.nMomentumFrictionY), - SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nAccerationLevel", e.nAccerationLevel), - SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.bInvertX", e.bInvertX ? 1 : 0), - SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.bInvertY", e.bInvertY ? 1 : 0), - SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nRotationAngle", e.nRotationAngle), - SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nTriggerClamping", e.nTriggerClamping), - SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nTriggerClampingAmount", e.nTriggerClampingAmount), - SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nGyroEnableButton", e.nGyroEnableButton), - SteamClient.Input.SetControllerPersonalizationSetting("GyroPreferenceData.nGyroEnableButtonBehavior", e.nGyroEnableButtonBehavior), - */ - SetControllerPersonalizationSetting(param0: string, param1: number): any; - - //param0 - flGyroStationaryTolerance, flAccelerometerStationaryTolerance, - /* - SteamClient.Input.SetControllerPersonalizationSettingFloat("GyroPreferenceData.flGyroNaturalSensitivity", e.flGyroNaturalSensitivity), - SteamClient.Input.SetControllerPersonalizationSettingFloat("GyroPreferenceData.flGyroXYRatio", e.flGyroXYRatio), - SteamClient.Input.SetControllerPersonalizationSettingFloat("GyroPreferenceData.flGyroSpeedDeadzone", e.flGyroSpeedDeadzone), - SteamClient.Input.SetControllerPersonalizationSettingFloat("GyroPreferenceData.flGyroPrecisionSpeed", e.flGyroPrecisionSpeed), - SteamClient.Input.SetControllerPersonalizationSettingFloat("flGyroStationaryTolerance", e.flGyroStationaryTolerance), - SteamClient.Input.SetControllerPersonalizationSettingFloat("flAccelerometerStationaryTolerance", e.flAccelerometerStationaryTolerance), - */ - SetControllerPersonalizationSettingFloat(param0: string, param1: number): any; - - SetControllerRumbleSetting(controllerIndex: number, rumblePreference: any): any; - - SetCursorActionset(param0: boolean): any; - - SetDualSenseUpdateNotification(param0: boolean): any - - /* - SetEditingConfigurationValue(e, t, n, o) { - const a = new r.BinaryWriter; - n.serializeBinaryToWriter(n.fromObject(t), a); - const s = a.getResultBase64String(); - f.Debug("SetEditingConfigurationValue serializeBinaryToWriter", (0, i.ZN)(t), s), this.EditingConfigurationWillUpdate(), this.m_updatingEditingConfigurationPromise = o(s).then((t => { - if (null == t) return f.Debug("SetEditingConfigurationValue returned nothing."), void (0, i.z)((() => this.UpdateEditingConfiguration(e, this.m_unControllerIndex, this.EditingConfiguration))); - const n = c.bE.deserializeBinary(t).toObject(); - f.Debug("SetEditingConfigurationValue returned controller configuration.", n), this.UpdateEditingConfiguration(e, this.m_unControllerIndex, n), this.m_nEditNumber++, -1 == n.url.indexOf("autosave://") && this.SaveEditingConfiguration(e) - })).catch((e => { - f.Error("SetEditingConfigurationValue fail:", o, l.jt(e.result), e.message), this.m_bIsUpdatingActiveConfiguration = !1 - })) - } - - SetControllerActionSet(e, t) { - this.SetEditingConfigurationValue(e, t, c.X3, (e => SteamClient.Input.SetEditingControllerConfigurationActionSet(this.m_unControllerIndex, e))) - } - */ - SetEditingControllerConfigurationActionSet(controllerIndex: number, param1: any): any; - - //this.SetEditingConfigurationValue(e, t, c.io, (e => SteamClient.Input.SetEditingControllerConfigurationInputActivator(this.m_unControllerIndex, e))) - SetEditingControllerConfigurationInputActivator(controllerIndex: number, param1: any): any; - - //this.SetEditingConfigurationValue(e, t, c.tH, (e => SteamClient.Input.SetEditingControllerConfigurationInputActivatorEnabled(this.m_unControllerIndex, e))) - SetEditingControllerConfigurationInputActivatorEnabled(controllerIndex: number, param1: any): any; - - //this.SetEditingConfigurationValue(e, t, c.J2, (e => SteamClient.Input.SetEditingControllerConfigurationInputBinding(this.m_unControllerIndex, e))) - SetEditingControllerConfigurationInputBinding(controllerIndex: number, param1: any): any; - - //this.SetEditingConfigurationValue(e, t, c.Sz, (e => SteamClient.Input.SetEditingControllerConfigurationMiscSetting(this.m_unControllerIndex, e))) - SetEditingControllerConfigurationMiscSetting(controllerIndex: number, param1: any): any; - - //f.Debug("sending to client"), this.SetEditingConfigurationValue(e, t, c.QU, (e => SteamClient.Input.SetEditingControllerConfigurationSourceMode(this.m_unControllerIndex, e))) - SetEditingControllerConfigurationSourceMode(controllerIndex: number, param1: any): any; - - SetGamepadKeyboardText(param0: boolean, param1: string): any; - - SetKeyboardActionset(param0: boolean, param1: boolean): any; - - /** - * Sets the mouse position. - * @param {number} pid - 0 - * @param {number} x - Mouse X position. - * @param {number} y - Mouse Y position. - * @returns {void} - */ - SetMousePosition(pid: number, x: number, y: number): void; - - SetSelectedConfigForApp(appId: number, controllerIndex: number, url: string, param3: boolean): any; - - SetSteamControllerDonglePairingMode(bEnable: boolean, bSilent: boolean): any; - - SetVirtualMenuKeySelected(unControllerIndex: number, unMenuIndex: number, m_controllerMenuActiveMenuItem: number): any; // - SetWebBrowserActionset(param0: boolean): any; - - SetXboxDriverInstallState(param0: any): any; // state - - /** - * Opens the Steam Input controller settings. - * This function displays the Steam Input controller settings for configuration. - * @returns {void} - */ - ShowControllerSettings(): void; - - StandaloneKeyboardDismissed(): any; - - StartControllerDeviceSupportFlow(param0: any, param1: any, callback: (param2: any) => void): any; - - /* - this.m_updatingEditingConfigurationPromise = SteamClient.Input.StartEditingControllerConfigurationForAppIDAndControllerIndex(e, t).then((n=>{ - const o = c.bE.deserializeBinary(n).toObject(); - f.Debug("Loaded controller config for appid", e, n, o), - (0, - i.z)((()=>this.UpdateEditingConfiguration(e, t, o))) - } - )).catch((n=>{ - f.Debug("Loading controller config for appid rejected", e, n), - (0, - i.z)((()=>this.UpdateEditingConfiguration(e, t, null))) - } - )) - */ - StartEditingControllerConfigurationForAppIDAndControllerIndex(m_appId: number, m_unControllerIndex: number): Promise<any>; - - StartGyroSWCalibration(callback: () => void): any; - - StopEditingControllerConfiguration(controllerIndex: number): any; - - SwapControllerConfigurationSourceModes: any; - - //this.SetEditingConfigurationValue(e, t, c.Qb, (e => SteamClient.Input.SwapControllerModeInputBindings(this.m_unControllerIndex, e))) - SwapControllerModeInputBindings(controllerIndex: number, param1: any): any; - - SwapControllerOrder(controllerIndex1: number, controllerIndex2: number): any; - - SyncCloudedControllerConfigs(): any; - - // type - enum - /* - Off - 0, Tick, Click - */ - TriggerHapticPulse(controllerIndex: number, eHapticType: number, param2: number): any; - - TriggerSimpleHapticEvent( - controllerIndex: number, - eHapticType: number, - unIntensity: number, - ndBGain: number, - param4: number, - ): any; - - UnregisterForControllerStateChanges(): void; - - UnregisterForUIVisualization(controllerIndex: number): any; - - UploadChangesForCloudedControllerConfigs(): any; -} - -/** - * Represents functions related to Steam Install Folders. - */ -export interface InstallFolder { - /** - * Adds a Steam Library folder to the Steam client. - * @param {string} steamLibraryPath - The path of the Steam Library folder to be added. - * @returns {Promise<number>} - A Promise that resolves to the index of the added folder. - */ - AddInstallFolder(steamLibraryPath: string): Promise<number>; - - /** - * Opens the file explorer to browse files in a specific Steam Library folder. - * @param {number} folderIndex - The index of the folder to be opened. - * @returns {void} - */ - BrowseFilesInFolder(folderIndex: number): void; - - /** - * Cancels the current move operation for moving game content. - * @returns {void} - */ - CancelMove(): void; - - /** - * Retrieves a list of installed Steam Library folders. - * @returns {Promise<SteamInstallFolder[]>} - A Promise that resolves to an array of SteamInstallFolder objects. - */ - GetInstallFolders(): Promise<SteamInstallFolder[]>; - - /** - * Retrieves a list of potential Steam Library folders that can be added. - * @returns {Promise<PotentialInstallFolder[]>} - A Promise that resolves to an array of PotentialInstallFolder objects. - */ - GetPotentialFolders(): Promise<PotentialInstallFolder[]>; - - /** - * Moves the installation folder for a specific app to another Steam Library folder. - * @param {number} appId - The ID of the application to be moved. - * @param {number} folderIndex - The index of the target Steam Library folder. - * @returns {void} - */ - MoveInstallFolderForApp(appId: number, folderIndex: number): void; - - /** - * Refreshes the list of installed Steam Library folders. - * @returns {any} - A Promise or response indicating the refresh operation. - */ - RefreshFolders(): any; - - /** - * Registers a callback function to be called when changes occur in Steam Install Folders. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForInstallFolderChanges(callback: (folderChange: FolderChange) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when moving game content progresses. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMoveContentProgress(callback: (moveContentProgress: MoveContentProgress) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when repairing an install folder is finished. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForRepairFolderFinished(callback: (folderChange: FolderChange) => void): Unregisterable | any; - - /** - * Removes a Steam Library folder from the Steam client. - * @param {number} folderIndex - The index of the folder to be removed. - * @returns {void} - */ - RemoveInstallFolder(folderIndex: number): void; - - /** - * Repairs an installed Steam Library folder. - * @param {number} folderIndex - The index of the folder to be repaired. - * @returns {void} - */ - RepairInstallFolder(folderIndex: number): void; - - /** - * Sets a specific Steam Library folder as the default install folder. - * @param {number} folderIndex - The index of the folder to be set as default. - * @returns {void} - */ - SetDefaultInstallFolder(folderIndex: number): void; - - /** - * Sets a user-defined label for a specific Steam Library folder. - * @param {number} folderIndex - The index of the folder to be labeled. - * @param {string} userLabel - The label to be assigned to the folder. - * @returns {void} - */ - SetFolderLabel(folderIndex: number, userLabel: string): void; -} - -/** - * Represents functions related to managing installs and installation wizards in Steam. - */ -export interface Installs { - /** - * Cancels the installation wizard if it is open. - * @returns {void} - */ - CancelInstall(): void; - - /** - * Continues and starts the installation if the wizard is still open. - * @returns {void} - */ - ContinueInstall(): void; - - /** - * Retrieves information from the last opened or currently opened installation wizard. - * @returns {Promise<InstallInfo>} A Promise that resolves to the InstallInfo. - */ - GetInstallManagerInfo(): Promise<InstallInfo>; - - /** - * Opens the restore from backup installer wizard for a specific app. - * @param {string} appBackupPath - The backup path of the app. - * @returns {void} - */ - OpenInstallBackup(appBackupPath: string): void; - - /** - * Opens the installation wizard for specified app IDs. - * @param {number[]} appIds - An array of app IDs to install. - * @returns {void} - */ - OpenInstallWizard(appIds: number[]): void; - - /** - * Opens the uninstall wizard for specified app IDs. - * @param {number[]} appIds - An array of app IDs to uninstall. - * @param {boolean} dontPrompt - Whether to *not* prompt the user to uninstall. - * @returns {void} - */ - OpenUninstallWizard(appIds: number[], dontPrompt: boolean): void; - - RegisterForShowConfirmUninstall: Unregisterable | any; // Broken? doesn't seem to work - - /** - * Registers a callback function to be called when the "Failed Uninstall" dialog is shown. - * @param {function} callback - The callback function to be called when the dialog is shown. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForShowFailedUninstall(callback: (appId: number, reason: AppUpdateError) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when the installation wizard is shown. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForShowInstallWizard(callback: (data: InstallInfo) => void): Unregisterable | any; - - RegisterForShowRegisterCDKey: any; - - /** - * Sets a list of app identifiers for downloads in the installation wizard. - * @param {number[]} appIds - An array of app IDs to set. - * @returns {void} - * @remarks The wizard will not reflect this change immediately, but changing another option will. - */ - SetAppList(appIds: number[]): void; - - /** - * Sets the options for creating shortcuts in the installation wizard. - * @param {boolean} bDesktopShortcut - Whether to create a desktop shortcut. - * @param {boolean} bSystemMenuShortcut - Whether to create a system menu shortcut. - * @returns {void} - * @remarks The wizard will not reflect this change immediately, but changing another option will. - */ - SetCreateShortcuts(bDesktopShortcut: boolean, bSystemMenuShortcut: boolean): void; - - /** - * Sets the install folder for the installation wizard using an install folder index. - * @param {number} folderIndex - The index of the install folder. - * @returns {void} - * @remarks The wizard will not reflect this change immediately, but changing another option will. - */ - SetInstallFolder(folderIndex: number): void; -} - -export interface Messaging { - // section - "ContentManagement", "JumpList", "PostToLibrary" - // seems multipurpose - // callback arguments are the same as in PostMessage - RegisterForMessages( - section: string, - callback: (section: string, param1: string, message: string) => void, - ): Unregisterable | any; - - /* - function m(e) { - SteamClient.Messaging.PostMessage("LibraryCommands", "ShowFriendChatDialog", JSON.stringify({ - steamid: e.persona.m_steamid.ConvertTo64BitString() - })) - } - SteamClient.Messaging.PostMessage("FriendsUI", "AcceptedRemotePlayInvite", JSON.stringify({id: this.appID})) : SteamClient.Messaging.PostMessage("FriendsUI", "AcceptedGameInvite", JSON.stringify({id: this.appID})) - */ - PostMessage(section: string, param1: string, message: string): void; -} - -/** - * Represents functions related to controlling music playback in the Steam client. - */ -export interface Music { - /** - * Decreases the music volume by 10%. - */ - DecreaseVolume(): void; - - /** - * Increases the music volume by 10%. - */ - IncreaseVolume(): void; - - /** - * @param {number} param0 - Unknown parameter usage. - * @param {number} param1 - Unknown parameter usage. - * @todo: unknown parameter usages, I have tried soundtrack identifier + track index and in reverse as well - */ - PlayEntry(param0: number, param1: number): void; - - /** - * Plays the next track in the music playlist. - */ - PlayNext(): void; - - /** - * Plays the previous track in the music playlist. - */ - PlayPrevious(): void; - - /** - * Registers a callback function to be called when music playback changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMusicPlaybackChanges(callback: (param0: boolean | MusicTrack) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when the music playback position changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMusicPlaybackPosition(callback: (position: number) => void): Unregisterable | any; - - /** - * Sets the playback position of the music track. - * @param {number} position - The position to set in seconds. - */ - SetPlaybackPosition(position: number): void; - - /** - * Sets the repeat status for music playback. - * @param {MusicRepeatStatus} status - The repeat status. - */ - SetPlayingRepeatStatus(status: MusicRepeatStatus): void; - - /** - * Sets the shuffle status for music playback. - * @param {boolean} value - True to enable shuffle, false to disable shuffle. - */ - SetPlayingShuffled(value: boolean): void; - - /** - * Sets the volume for music playback. - * @param {number} volume - The volume level to set. - * @remarks Ranges from 0 to 100. - */ - SetVolume(volume: number): void; - - /** - * Toggles the mute state of the music volume. - */ - ToggleMuteVolume(): void; - - /** - * Toggles between play and pause for music playback. - */ - TogglePlayPause(): void; -} - -export interface Notifications { - /** - * If `data` is deserialized, returns {@link ClientNotificationFriendMessage}, - * or {@link ClientNotificationGroupChatMessage}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForNotifications( - callback: (notificationIndex: number, type: ClientUINotification, data: ArrayBuffer) => void, - ): Unregisterable | any; -} - -export interface VRDevice { - BIsConnected: any; - RegisterForDeviceConnectivityChange: Unregisterable | any; - - RegisterForVRDeviceSeenRecently(callback: (m_bVRDeviceSeenRecently: any) => void): Unregisterable | any; -} - -export interface DeviceProperties { - GetBoolDeviceProperty: any; - GetDoubleDeviceProperty: any; - GetFloatDeviceProperty: any; - GetInt32DeviceProperty: any; - GetStringDeviceProperty: any; - RegisterForDevicePropertyChange: Unregisterable | any; -} - -export interface Keyboard { - Hide(): any; - - RegisterForStatus(callback: (m_bIsKeyboardOpen: boolean, m_eKeyboardFlags: any, m_sInitialKeyboardText: string) => void): Unregisterable | any; - - SendDone(): any; - - SendText(key: string): any; //??? - Show(): any; -} - -export interface PathProperties { - GetBoolPathProperty: any; - GetDoublePathProperty: any; - GetFloatPathProperty: any; - GetInt32PathProperty: any; - GetStringPathProperty: any; - RegisterForPathPropertyChange: any; - SetBoolPathProperty: any; - SetDoublePathProperty: any; - SetFloatPathProperty: any; - SetInt32PathProperty: any; - SetStringPathProperty: any; -} - -export interface VRNotifications { - HideCustomNotification: any; - RegisterForNotificationEvent: Unregisterable | any; - ShowCustomNotification: any; -} - -export interface VROverlay { - HideDashboard: any; - - IsDashboardVisible(): Promise<boolean>; - - RegisterForButtonPress: Unregisterable | any; - RegisterForCursorMovement: Unregisterable | any; - RegisterForThumbnailChanged: Unregisterable | any; - RegisterForVisibilityChanged: Unregisterable | any; - ShowDashboard: any; - - SwitchToDashboardOverlay(param0: string): void; -} - -export interface OpenVR { - Device: VRDevice; - DeviceProperties: DeviceProperties; - - /** - * @throws OperationResponse if mutual capabilities haven't been loaded. - */ - GetMutualCapabilities(): Promise<any>; - - GetWebSecret(): Promise<string>; - - InstallVR(): any; - - Keyboard: Keyboard; - PathProperties: PathProperties; - - QuitAllVR(): any; - - RegisterForButtonPress: Unregisterable | any; - - RegisterForHMDActivityLevelChanged(callback: (m_eHMDActivityLevel: any) => void): Unregisterable | any; - - RegisterForInstallDialog: Unregisterable | any; - - RegisterForStartupErrors(callback: (clientError: any, initError: any, initErrorString: string) => void): Unregisterable | any; - - RegisterForVRHardwareDetected(callback: (m_bHMDPresent: any, m_bHMDHardwareDetected: any, m_strHMDName: any) => void): Unregisterable | any; - - RegisterForVRModeChange(callback: (m_bIsVRRunning: boolean) => void): Unregisterable | any; - - RegisterForVRSceneAppChange(callback: (param0: number) => void): Unregisterable | any; - - SetOverlayInteractionAffordance: any; - - StartVR: any; - TriggerOverlayHapticEffect: any; - VRNotifications: VRNotifications; - VROverlay: VROverlay; -} - -export interface Overlay { - /** - * Destroys the gamepad UI desktop configurator window if open. - * @returns {void} - */ - DestroyGamePadUIDesktopConfiguratorWindow(): void; - - GetOverlayBrowserInfo(): Promise<OverlayBrowserInfo[]>; - - HandleGameWebCallback(url: string): any; - - HandleProtocolForOverlayBrowser(appId: number, protocol: string): any; - - RegisterForActivateOverlayRequests: Unregisterable | any; - - /** - * Registers a callback function to be called when a microtransaction authorization is requested. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMicroTxnAuth( - callback: (appId: number, microTxnId: string, realm: SteamRealm, microTxnUrl: string) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a microtransaction authorization is dismissed by the user in Steam's authorization page. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForMicroTxnAuthDismiss(callback: (appId: number, microTxnId: string) => void): Unregisterable | any; - - RegisterForNotificationPositionChanged( - callback: (appId: any, position: NotificationPosition, horizontalInset: number, verticalInset: number) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when an overlay is activated or closed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForOverlayActivated( - callback: (overlayProcessPid: number, appId: number, active: boolean, param3: boolean) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when the overlay browser protocols change. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForOverlayBrowserProtocols( - callback: (browseProtocols: OverlayBrowserProtocols) => void, - ): Unregisterable | any; - - /** - * Registers **the** callback function to be called when the overlay browser information changes. - * @param {function} callback - The callback function to be called when the overlay browser information changes. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @remarks Do Not Use, this will break the overlay unless you know what you are doing. - */ - RegisterOverlayBrowserInfoChanged(callback: () => void): Unregisterable | any; - - SetOverlayState(appId: number, uiComposition: UIComposition): any; -} - -/** - * Interface for managing parental control settings. - */ -export interface Parental { - /** - * Locks the parental control settings. - * @returns {void} - */ - LockParentalLock(): void; - - /** - * Registers a callback function to be invoked when parental settings change. - * @param {(parentalSettings: ParentalSettings) => void} callback - The callback function to be invoked when parental settings change. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForParentalSettingsChanges(callback: (parentalSettings: ParentalSettings) => void): Unregisterable | any; - - /** - * Unlocks the parental lock with the provided PIN. - * @param {string} pin - The 4-digit PIN to unlock the parental lock. - * @param {boolean} param1 - Additional parameter. // Todo: Unknown usage. - * @returns {Promise<Result>} - A Promise that resolves to a number representing the result of the unlock operation. - */ - UnlockParentalLock(pin: string, param1: boolean): Promise<Result>; -} - -export interface RemotePlay { - BCanAcceptInviteForGame: any; - BCanCreateInviteForGame: any; - - BCanHostIsolatedGameAudio(): Promise<boolean>; - - BEnabled(): Promise<boolean>; - - BRemotePlayTogetherGuestOnPhoneOrTablet(steam64Id: string, guestId: number): Promise<boolean>; - - BRemotePlayTogetherGuestSupported(): Promise<boolean>; - - CancelInviteAndSession(steam64Id: string): any; - - CancelInviteAndSessionWithGuestID(steam64Id: string, guestId: number): any; - - CloseGroup(): Promise<number>; - - CreateGroup: any; - - CreateInviteAndSession(steam64Id: string, param1: any): any; - - CreateInviteAndSessionWithGuestID(steam64Id: string, guestId: number, param2: any): any; - - GetClientStreamingBitrate(): Promise<number>; //todo: -1 not streaming?? - GetClientStreamingQuality(): Promise<number>; //todo: -1 not streaming?? - GetControllerType(param0: number): Promise<ControllerType>; // todo: param0 with value 0 is host controller type - param0 is likely an index of clients or guestId? - GetGameSystemVolume(): Promise<number>; - - GetPerUserInputSettings(steam64Id: string): any; - - GetPerUserInputSettingsWithGuestID(steam64Id: string, guestId: number): any; - - IdentifyController(nControllerIndex: number): any; - - InstallAudioDriver: any; - InstallInputDriver: any; - MoveControllerToSlot: any; - RegisterForAdditionalParentalBlocks: Unregisterable | any; - RegisterForAudioDriverPrompt: Unregisterable | any; - RegisterForBitrateOverride: Unregisterable | any; - RegisterForControllerIndexSet: Unregisterable | any; - - RegisterForDevicesChanges(callback: (devicesChange: RemotePlayDevice[]) => void): Unregisterable | any; - - RegisterForGroupCreated: Unregisterable | any; - RegisterForGroupDisbanded: Unregisterable | any; - RegisterForInputDriverPrompt: Unregisterable | any; - RegisterForInputDriverRestartNotice: Unregisterable | any; - - RegisterForInputUsed( - callback: (steam64Id: string, type: ClientUsedInputType, guestId: number) => void, - ): Unregisterable | any; // only fires on host - - RegisterForInviteResult: Unregisterable | any; - - RegisterForNetworkUtilizationUpdate( - callback: (steam64Id: string, guestId: number, networkUtilization: number, networkDuration: number) => void, - ): Unregisterable | any; // only fires on host - - RegisterForPlaceholderStateChanged(callback: (isShowingPlaceholder: boolean) => void): Unregisterable | any; - - RegisterForPlayerInputSettingsChanged: Unregisterable | any; - - RegisterForQualityOverride(callback: (hostStreamingQualityOverride: number) => void): Unregisterable | any; - - RegisterForRemoteClientLaunchFailed: Unregisterable | any; - - RegisterForRemoteClientStarted(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client - - RegisterForRemoteClientStopped(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client - - RegisterForSessionStarted(callback: (steam64Id: any, gameId: any, guestId: any) => void): Unregisterable | any; - - RegisterForSessionStopped(callback: (steam64Id: any, guestId: any) => void): Unregisterable | any; - - RegisterForSettingsChanges(callback: (remotePlaySettings: RemotePlaySettings) => void): Unregisterable | any; - - SetClientStreamingBitrate(bitrate: number): void; - - SetClientStreamingQuality(quality: number): void; - - SetGameSystemVolume(volume: number): void; - - SetPerUserControllerInputEnabled(steam64Id: string, enabled: boolean): any; - - SetPerUserControllerInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; - - SetPerUserKeyboardInputEnabled(steam64Id: string, enabled: boolean): any; - - SetPerUserKeyboardInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; - - SetPerUserMouseInputEnabled(steam64Id: string, enabled: boolean): any; - - SetPerUserMouseInputEnabledWithGuestID(steam64Id: string, guestId: number, enabled: boolean): any; - - SetRemoteDeviceAuthorized: any; - - SetRemoteDevicePIN(pin: number): void; - - SetRemotePlayEnabled(enabled: boolean): void; - - SetStreamingClientConfig: any; - SetStreamingClientConfigEnabled: any; - - SetStreamingDesktopToRemotePlayTogetherEnabled(enabled: boolean): any; - - SetStreamingP2PScope: any; - SetStreamingServerConfig: any; - SetStreamingServerConfigEnabled: any; - - StopStreamingClient(): void; - - StopStreamingSession: any; - StopStreamingSessionAndSuspendDevice: any; - - UnlockH264(): any; - - UnpairRemoteDevices(): void; // unpairs all devices -} - -/** - * Interface for managing screenshots. - */ -export interface Screenshots { - /** - * Deletes a local screenshot. - * @param {string} appId - The ID of the application. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {Promise<boolean>} - A Promise that resolves to a boolean value indicating whether the deletion was successful. - */ - DeleteLocalScreenshot(appId: string, screenshotIndex: number): Promise<boolean>; - - /** - * Retrieves all local screenshots for all applications. - * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects. - */ - GetAllAppsLocalScreenshots(): Promise<Screenshot[]>; - - /** - * Retrieves the count of all local screenshots for all applications. - * @returns {Promise<number>} - A Promise that resolves to the count of local screenshots. - */ - GetAllAppsLocalScreenshotsCount(): Promise<number>; - - /** - * Retrieves a range of local screenshots for all applications. - * @param {number} start - The starting index of the screenshot range. - * @param {number} end - The ending index of the screenshot range. - * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects within the specified range. - */ - GetAllAppsLocalScreenshotsRange(start: number, end: number): Promise<Screenshot[]>; - - /** - * Retrieves all local screenshots. - * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects. - */ - GetAllLocalScreenshots(): Promise<Screenshot[]>; - - /** - * Retrieves the game associated with a specific local screenshot index. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {Promise<number>} - A Promise that resolves to the ID of the game associated with the screenshot. - */ - GetGameWithLocalScreenshots(screenshotIndex: number): Promise<number>; - - /** - * Retrieves the last taken local screenshot. - * @returns {Promise<Screenshot>} - A Promise that resolves to the last taken local screenshot. - */ - GetLastScreenshotTaken(): Promise<Screenshot>; - - /** - * Retrieves a specific local screenshot for an application. - * @param {string} appId - The ID of the application. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {Promise<Screenshot>} - A Promise that resolves to the requested local screenshot. - */ - GetLocalScreenshotByHandle(appId: string, screenshotIndex: number): Promise<Screenshot>; - - /** - * Retrieves the count of local screenshots for a specific application. - * @param {number} appId - The ID of the application. - * @returns {Promise<number>} - A Promise that resolves to the count of local screenshots for the application. - */ - GetLocalScreenshotCount(appId: number): Promise<number>; - - /** - * Retrieves the number of games with local screenshots. - * @returns {Promise<number>} - A Promise that resolves to the number of games with local screenshots. - */ - GetNumGamesWithLocalScreenshots(): Promise<number>; - - /** - * Gets total screenshot usage in the specified library folder. - * @param path Library folder path. - * @returns {Promise<number>} A Promise that resolves to the number of taken space in bytes. - */ - GetTotalDiskSpaceUsage(path: string): Promise<number>; - - /** - * Opens a local screenshot in the system image viewer. - * If the screenshot index is invalid, this function opens the screenshots directory for the specified application ID. - * @param {string} appId - The ID of the application. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {void} - */ - ShowScreenshotInSystemViewer(appId: string, screenshotIndex: number): void; - - /** - * Opens the folder containing local screenshots for a specific application. - * @param {string} appId - The ID of the application. - * @returns {void} - */ - ShowScreenshotsOnDisk(appId: string): void; - - /** - * Uploads a local screenshot. - * @param {string} appId - The ID of the application. - * @param {number} localScreenshot_hHandle - The handle of the local screenshot. - * @param {number} filePrivacyState - The privacy state of the screenshot file. - * @returns {Promise<boolean>} - A Promise that resolves to a boolean value indicating whether the upload was successful. - */ - UploadLocalScreenshot( - appId: string, - localScreenshot_hHandle: number, - filePrivacyState: FilePrivacyState, - ): Promise<boolean>; -} - -/** - * Represents functionality for the server browser. - */ -export interface ServerBrowser { - /** - * Adds a favorite server. - * @param {ServerBrowserServerFull} server - The server to add. - * @returns {Promise<string>} A Promise that resolves to an empty string if successful, `Invalid/missing IPv4?` if failed. - * @todo Refreshed the favorite servers list upon adding once, but doesn't now. :-( - */ - AddFavoriteServer(server: ServerBrowserServerFull): Promise<string>; - - /** - * Adds a favorite server by IP. - * @param {string} ip - The IP to add to favorite servers. - * @returns {Promise<string>} A Promise that resolves to an empty string if successful, localization string if failed. - */ - AddFavoriteServersByIP(ip: string): Promise<string>; - - CancelServerQuery(dialogId: number, queryServer: number): void; - - /** - * Connects to a server from a given dialog. - * @param {number} dialogId - The dialog ID to use. - * @param {string} password - Server password, empty if none. - * @returns {Promise<JoinServerError>} A Promise that resolves to a connection status. - */ - ConnectToServer(dialogId: number, password: string): Promise<JoinServerError>; - - /** - * Creates a server info dialog, on which your friend is playing on. - * @param {number} pid - 0 - * @param {string} steamId - A Steam64 ID of a friend. - * @returns {void} - */ - CreateFriendGameInfoDialog(pid: number, steamId: string): void; - - /** - * Creates a server info dialog. - * @param {string} ip - The IP to create a dialog for. - * @param {number} port - The IP's port. - * @param {number} queryPort - - * @returns {Promise<number>} A Promise that resolves to the current dialog ID. - */ - CreateServerGameInfoDialog(ip: string, port: number, queryPort: number): Promise<number>; - - /** - * Retrieves the server list. - * @param {number} appId - The game ID, 0 for every game. - * @param {ServerBrowserTab} queryType - The tab to use. - * @param {string[]} filters - Server filters. - * @param {function} serverCallback - What to do with the found server? - * @param {function} requestCompletedCallback - The callback function to be called when the request is completed. - * @returns {Promise<number>} A Promise that resolves to the current server list request ID. - * @throws Throws if the query type is unknown. - * @throws Throws if the filter list isn't key/value pairs, i.e. of an even length. - * @remarks Stops at 10000 if there are more servers to be found. - * @example - * Filter examples, may be combined: - * ``` - * [ 'gamedir', 'cstrike' ] // Doesn't work? - * [ 'hasplayers', '1' ] // Only works with "1"? - * [ 'notfull', '1' ] // Doesn't work? - * [ 'map', 'cs_office' ] // Has to be an exact match! - * ``` - */ - - /* - The enum in question: - - (t = - 'lan' == this.id - ? this.all_servers.length > 0 - ? '#ServerBrowser_NoServersMatch' - : '#ServerBrowser_NoLanServers' - : 'internet' == this.id - ? this.all_servers.length > 0 - ? '#ServerBrowser_NoInternetGamesMatch' - : e == l.zS.k_EServerFailedToRespond - ? '#ServerBrowser_MasterServerNotResponsive' - : e == l.zS.k_ENoServersListedOnMasterServer - ? '#ServerBrowser_MasterServerHasNoServersListed' - : '#ServerBrowser_NoInternetGamesResponded' - : 'favorites' == this.id - ? this.all_servers.length > 0 - ? '#ServerBrowser_NoServersMatch' - : '#ServerBrowser_NoFavoriteServers' - : 'history' == this.id - ? this.all_servers.length > 0 - ? '#ServerBrowser_NoHistoryServersMatch' - : '#ServerBrowser_NoServersPlayed' - : 'friends' == this.id - ? this.all_servers.length > 0 - ? '#ServerBrowser_NoServersMatch' - : '#ServerBrowser_NoFriendsServers' - : 'BUGBUG'), - */ - CreateServerListRequest( - appId: number, - queryType: ServerBrowserTab, - filters: string[], - serverCallback: (server: ServerBrowserServerFull) => void, - requestCompletedCallback: (response: number) => void, - ): Promise<number | OperationResponse>; - - /** - * Destroys the game info dialog functions (but not the window). - * @param {number} dialogId - The dialog ID to use. - * @returns {void} - * @remarks ServerBrowser.CancelServerQuery may throw if it tries to ping the server. - */ - DestroyGameInfoDialog(dialogId: number): void; - - /** - * Stops retrieving the server list. - * @param {number} activeServerListRequestId - The active server request ID to use. - * @returns {void} - */ - DestroyServerListRequest(activeServerListRequestId: number): void; - - /** - * Gets a list of games that support the server browser feature. - * @returns {Promise<ServerBrowserGame[]>} A Promise that resolves to a list of games. - */ - GetMultiplayerGames(): Promise<ServerBrowserGame[]>; - - /** - * Gets the server browser preferences. - * @returns {Promise<ServerBrowserPreferences>} A Promise that resolves to server browser preferences. - */ - GetServerListPreferences(): Promise<ServerBrowserPreferences>; - - /** - * Pings the server of a specified dialog ID. - * @param {number} dialogId - The dialog ID to use. - * @returns {Promise<number | OperationResponse>} - */ - PingServer(dialogId: number): Promise<number | OperationResponse>; - - /** - * Registers a callback function to be called when a server gets added to favorite servers. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. - */ - RegisterForFavorites(callback: (list: ServerBrowserFavoritesAndHistory) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when idk - * @param {number} dialogId - The dialog ID to use. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. - */ - RegisterForFriendGamePlayed( - dialogId: number, - callback: (server: ServerBrowserFriendServer) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a server info dialog opens. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. - */ - RegisterForGameInfoDialogs(callback: (dialogs: ServerBrowserDialog[]) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when player details get requested. - * @param {number} dialogId - The dialog ID to use. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. - */ - RegisterForPlayerDetails( - dialogId: number, - callback: (player: ServerBrowserPlayer | ServerBrowserPlayerRefreshStatus) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when a server gets pinged. - * @param {number} dialogId - The dialog ID to use. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. - */ - RegisterForServerInfo(dialogId: number, callback: (server: ServerBrowserServerFull) => void): Unregisterable | any; - - /** - * Removes a server from favorite servers. - * @param {ServerBrowserServer} server - The server to remove. - * @returns {void} - */ - RemoveFavoriteServer(server: ServerBrowserServer): void; - - /** - * Removes a server from history of played servers. - * @param {ServerBrowserServer} server - The server to remove. - * @returns {void} - */ - RemoveHistoryServer(server: ServerBrowserServer): void; - - /** - * Requests player details for a specific dialog. - * @param {number} dialogId - The dialog ID to use. - * @returns {Promise<number | OperationResponse>} - */ - RequestPlayerDetails(dialogId: number): Promise<number | OperationResponse>; - - /** - * Sets the server browser preferences. - * @param {ServerBrowserPreferences} prefs - Server list preferences. - * @returns {void} - */ - SetServerListPreferences(prefs: ServerBrowserPreferences): void; -} - -export interface Settings { - AddClientBeta(name: string, password: string): void; - - /** - * Clears HTTP cache located in `<STEAMPATH>/appcache/httpcache`. - * @returns {void} - */ - ClearAllHTTPCaches(): void; - - /** - * Clears download cache and logs you out. - * @returns {void} - */ - ClearDownloadCache(): void; - - GetAccountSettings(): Promise<AccountSettings>; - - GetAppUsesP2PVoice(appId: number): Promise<boolean>; - - GetAvailableLanguages(): Promise<Language[]>; - - GetAvailableTimeZones(): Promise<TimeZone[]>; - - // Returns the current language "english" - GetCurrentLanguage(): Promise<string>; - - GetGlobalCompatTools(): Promise<CompatibilityToolInfo[]>; - - /** - * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link MsgMonitorInfo}. - */ - GetMonitorInfo(): Promise<ArrayBuffer>; - - GetOOBETestMode(): Promise<boolean>; - - GetRegisteredSteamDeck(): Promise<RegisteredSteamDeck>; - - // Returns the current timezone - GetTimeZone(): Promise<string>; - - GetWindowed(): Promise<boolean>; - - IgnoreSteamDeckRewards(): void; - - /** - * Opens the Windows microphones dialog. - * @returns {void} - */ - OpenWindowsMicSettings(): void; - - RegisterForMicVolumeUpdates: Unregisterable | any; - - /** - * If `data` is deserialized, returns {@link MsgClientSettings}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForSettingsArrayChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - - RegisterForSettingsChanges(callback: (steamSettings: SteamSettings) => void): Unregisterable | any; - - RegisterForTimeZoneChange(callback: (timezoneId: string) => void): Unregisterable | any; // When timezone is changed from settings, callback will return new timezoneId - ReinitMicSettings(): void; - - RequestDeviceAuthInfo(): void; - - // - SelectClientBeta(nBetaID: any): any; - - // Get from available languages - SetCurrentLanguage(strShortName: string): void; - - SetEnableSoftProcessKill(value: boolean): void; // Default value is false, this is Valve internal menu - - SetHostname(hostname: string): void; - - SetMicTestMode: any; - - SetOOBETestMode(value: boolean): void; - - SetPreferredMonitor(monitor: string): void; - - SetRegisteredSteamDeck: any; - - /** - * Sets the "Don't save account credentials on this computer" option. - * @param {boolean} value - Whether to save account credentials. - * @returns {void} - */ - SetSaveAccountCredentials(value: boolean): void; - - SetSetting: any; - - SetSteamPlayEnabled(value: boolean): void; - - SetTimeZone(timezoneId: string): void; // You can get valid timezoneIds from GetAvailableTimeZones() - SetUseNintendoButtonLayout: any; - - SetWindowed(value: boolean): void; - - SpecifyGlobalCompatTool(strToolName: string): void; - - // "{"result":2,"message":""}" - ToggleSteamInstall(): any; -} - -export interface SharedConnection { - // hSharedConnection is the number from AllocateSharedConnection() - AllocateSharedConnection(): Promise<number>; - - // if no such number, sends this warning: - // src\clientdll\clientsharedconnection.cpp (154) : m_mapSharedConnections.HasElement( hSharedConnection ) - Close(hSharedConnection: number): void; - - RegisterOnBinaryMessageReceived(hSharedConnection: number, callback: (data: ArrayBuffer) => void): Unregisterable | any; - - RegisterOnLogonInfoChanged(hSharedConnection: number, callback: (info: LogonInfo) => void): Unregisterable | any; - - RegisterOnMessageReceived(hSharedConnection: number, callback: (param0: any) => void): Unregisterable | any; - - SendMsg: any; - SendMsgAndAwaitBinaryResponse: any; - - SubscribeToClientServiceMethod(hSharedConnection: number, param1: any): any; - - SubscribeToEMsg(hSharedConnection: number, param1: any): any; -} - -export interface Stats { - // param0 - AppDetailsReviewSection, Showcases, LibraryReviewSpotlight - // param1 - - // AppDetailsReviewSection: PositiveClicked, NegativeClicked, NeutralClicked, PositiveReviewPosted, NegativeReviewPosted, EditClicked, ReviewCanceled - // LibraryReviewSpotlight: ReviseClicked, PositiveClicked, ReviseCloseClicked, NegativeClicked, PositiveRevisePosted, NegativeRevisePosted, ReviseCanceled, ReviewCanceled, CloseClicked - // Showcases: Delete, Save-Modify, Save-New - RecordActivationEvent(param0: string, param1: string): any; - - RecordDisplayEvent: any; -} - -export interface SteamChina { - GetCustomLauncherAppID(): Promise<number>; -} - -/** - * SteamClient.MachineStorage affects the "STEAMPATH/config/config.vdf" file. - * SteamClient.RoamingStorage affects the "STEAMPATH/userdata/STEAMID3/7/remote/sharedconfig.vdf" file. - * SteamClient.Storage affects the "STEAMPATH/userdata/STEAMID3/config/localconfig.vdf" file. - */ -export interface Storage { - DeleteKey(key: string): Promise<OperationResponse | void>; - - /** - * @remarks Use {@link SetObject} to set. - */ - GetJSON(key: string): Promise<OperationResponse | string>; - - GetString(key: string): Promise<OperationResponse | string>; - - /** - * @remarks Use {@link SetObject} to get. - */ - SetObject(key: string, value: any): Promise<OperationResponse | void>; - - SetString(key: string, value: string): Promise<OperationResponse | void>; -} - -export interface Streaming { - AcceptStreamingEULA(param0: any, param1: any, param2: any): any; - - CancelStreamGame(): void; // existing stream - - /** - * Registers a callback function to be called when the streaming client finishes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStreamingClientFinished(callback: (code: number, result: string) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when there is progress in the launch of the streaming client. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStreamingClientLaunchProgress( - callback: (actionType: string, taskDetails: string, done: number, total: number) => void, - ): Unregisterable | any; - - /** - * Registers a callback function to be called when the streaming client is started (e.g., when clicking the stream button). - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStreamingClientStarted(callback: (appId: number) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when the streaming launch is complete. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @todo `code` is likely a code, 1 being it started, 10 being host computer is updating game, `result` just returns "complete" - */ - RegisterForStreamingLaunchComplete(callback: (code: number, result: string) => void): Unregisterable | any; - - RegisterForStreamingShowEula(callback: (appId: number) => any): Unregisterable | any; - - RegisterForStreamingShowIntro(callback: (param0: any, param1: any) => any): Unregisterable | any; - - /** - * Registers a callback function to be called when the streaming client receives launch options from the host. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStreamingShowLaunchOptions( - callback: (appId: number, launchOptions: LaunchOption[]) => void, - ): Unregisterable | any; // Callback when streaming client receives launch options from host - - StreamingContinueStreamGame(): void; // existing game running on another streaming capable device - StreamingSetLaunchOption(param0: any): any; -} - -/** - * Represents various functions related to Steam system audio. - */ -export interface Audio { - /** - * Clears the default device override for a specified audio type. - * @param {number} audioType - The audio type (0 for input, 1 for output). - * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. - */ - ClearDefaultDeviceOverride(audioType: number): Promise<OperationResponse>; - - /** - * Retrieves information about audio applications. - * @returns {Promise<ApplicationsAudio>} - A Promise that resolves to information about audio applications. - */ - GetApps(): Promise<ApplicationsAudio>; - - /** - * Retrieves information about audio devices. - * @returns {Promise<AudioDeviceInfo>} - A Promise that resolves to information about audio devices. - */ - GetDevices(): Promise<AudioDeviceInfo>; - - /** - * Registers a callback to be called when a new audio application is added. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppAdded(callback: (appAudioAdded: ApplicationAudio) => void): Unregisterable | any; - - /** - * Registers a callback to be called when an audio application is removed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppRemoved(callback: (appAudioId: number) => void): Unregisterable | any; - - /** - * Registers a callback to be called when the volume of an audio application changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForAppVolumeChanged(callback: (appAudioId: number, volume: number) => void): Unregisterable | any; - - /** - * Registers a callback to be called when a new audio device is added. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDeviceAdded(callback: (audioDevice: Device) => void): Unregisterable | any; - - /** - * Registers a callback to be called when an audio device is removed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDeviceRemoved(callback: (audioDeviceId: number) => void): Unregisterable | any; - - /** - * Registers a callback to be called when the volume of an audio device changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDeviceVolumeChanged(callback: (audioDeviceId: number, audioType: number, volume: number) => void): Unregisterable | any; - - RegisterForServiceConnectionStateChanges(callback: (param0: any) => void): Unregisterable | any; - - /** - * Registers a callback to be called when volume buttons are pressed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForVolumeButtonPressed(callback: (volumeUpPressed: boolean) => void): Unregisterable | any; - - /** - * Sets the volume of an audio application. - * @param {number} appAudioId - The ID of the audio application. - * @param {number} volume - The volume level (floating point value between 0 and 1). - * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. - */ - SetAppVolume(appAudioId: number, volume: number): Promise<OperationResponse>; - - /** - * Sets the default device override for a specified audio type. - * @param {number} audioDeviceId - The ID of the audio device. - * @param {number} audioType - The audio type (0 for input, 1 for output). - * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. - */ - SetDefaultDeviceOverride(audioDeviceId: number, audioType: number): Promise<OperationResponse>; - - /** - * Sets the volume of an audio device. - * @param {number} audioDeviceId - The ID of the audio device. - * @param {number} audioType - The audio type (0 for input, 1 for output). - * @param {number} volume - The volume level (floating point value between 0 and 1). - * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. - */ - SetDeviceVolume(audioDeviceId: number, audioType: number, volume: number): Promise<OperationResponse>; -} - -export interface AudioDevice { - /** - * If `data` is deserialized, returns {@link MsgSystemAudioManagerState}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - - UpdateSomething(param0: any): any; // e.UpdateSomething(t.serializeBase64String()) -} - -/** - * Provides functionality for managing Bluetooth devices and interactions. - */ -export interface Bluetooth { - /** - * Cancels an ongoing pairing request with a Bluetooth device. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the Bluetooth device to cancel pairing with. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the cancellation. - */ - CancelPairing(adapterId: number, deviceId: number): Promise<OperationResponse>; - - /** - * Connects to a paired Bluetooth device using the specified adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the paired Bluetooth device to connect to. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the connection attempt. - */ - Connect(adapterId: number, deviceId: number): Promise<OperationResponse>; - - /** - * Disconnects from a currently connected Bluetooth device using the specified adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the connected Bluetooth device to disconnect from. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the disconnection. - */ - Disconnect(adapterId: number, deviceId: number): Promise<OperationResponse>; - - /** - * Initiates pairing with a Bluetooth device using the specified adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the Bluetooth device to initiate pairing with. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the pairing attempt. - */ - Pair(adapterId: number, deviceId: number): Promise<OperationResponse>; - - /** - * Registers a callback function to be called when the Bluetooth state changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStateChanges(callback: (bluetoothStateChange: BluetoothStateChange) => void): Unregisterable | any; - - /** - * Sets whether the Bluetooth adapter should be in discovering mode. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {boolean} value - `true` to enable discovering mode, `false` to disable it. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the operation. - */ - SetAdapterDiscovering(adapterId: number, value: boolean): Promise<OperationResponse>; - - /** - * Enables or disables Bluetooth functionality. - * @param {boolean} bluetooth - `true` to enable Bluetooth, `false` to disable it. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the operation. - */ - SetEnabled(bluetooth: boolean): Promise<OperationResponse>; - - /** - * Unpairs a Bluetooth device from the adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the Bluetooth device to unpair with. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the unpairing request. - */ - UnPair(adapterId: number, deviceId: number): Promise<OperationResponse>; -} - -export interface Devkit { - DeveloperModeChanged(state: boolean): any; - - RegisterForPairingPrompt(callback: (param0: any) => any): Unregisterable | any; - - RespondToPairingPrompt(param0: any, param1: any): any; - - SetPairing(param0: any): any; -} - -export interface Display { - EnableUnderscan(param0: boolean): any; - - RegisterForBrightnessChanges(callback: (brightnessChanges: BrightnessChange) => void): Unregisterable | any; - - SetBrightness(brightness: number): any; - - SetUnderscanLevel(param0: any): any; -} - -// CMsgSystemDisplayManagerState, CMsgSystemDisplayManagerSetMode -export interface DisplayManager { - ClearModeOverride(displayId: any): any; - - GetState: any; - - RegisterForStateChanges(callback: () => void): Unregisterable | any; - - SetCompatibilityMode(displayId: any): any; - - SetGamescopeInternalResolution(width: number, height: number): any; - - SetMode(base64: string): any; // -} - -// CMsgSystemDockUpdateFirmware, CMsgSystemDockState -export interface Dock { - DisarmSafetyNet(): void; - - /** - * If `data` is deserialized, returns {@link MsgSystemDockState}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - - UpdateFirmware(base64String: string): any; // serialize base64 string -} - -export interface WirelessNetwork { - Forget(deviceId: any, deviceWapId: any): any; - - SetAutoconnect(deviceId: any, deviceWapId: any, autoConnect: boolean): any; -} - -export interface NetworkDevice { - Connect(param0: any): any; // some base64 serialized string - Disconnect(deviceId: any): Promise<any>; - - WirelessNetwork: WirelessNetwork; -} - -export interface Network { - Device: NetworkDevice; - - ForceRefresh(): Promise<OperationResponse>; - - ForceTestConnectivity(): void; - - GetProxyInfo(): Promise<ProxyInfo>; - - // data.nAppID, data.serializedMsg - RegisterForAppSummaryUpdate(callback: (data: any) => any): Unregisterable | any; - - /** - * @todo {@link GameNetworkingUI_ConnectionState}, unconfirmed - */ - RegisterForConnectionStateUpdate: Unregisterable | any; - - RegisterForConnectivityTestChanges( - callback: (connectivityTestChange: ConnectivityTestChange) => void, - ): Unregisterable | any; - - /** - * If `data` is deserialized, returns {@link MsgNetworkDevicesData}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDeviceChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - - SetFakeLocalSystemState(state: ENetFakeLocalSystemState): void; - - SetProxyInfo(mode: number, address: string, port: number, excludeLocal: boolean): void; - - SetWifiEnabled(value: boolean): Promise<OperationResponse>; - - StartScanningForNetworks(): Promise<OperationResponse>; - - StopScanningForNetworks(): Promise<OperationResponse>; -} - -// CMsgSystemPerfUpdateSettings, CMsgSystemPerfState, CMsgSystemPerfSettings -export interface Perf { - /** - * If `data` is deserialized, returns {@link MsgSystemPerfDiagnosticInfo}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForDiagnosticInfoChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - - /** - * If `data` is deserialized, returns {@link MsgSystemPerfState}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - - UpdateSettings(base64: string): any; // serialize -} - -export interface Report { - /** - * Generates a system report located in /tmp/steamXXXXXX (https://steamloopback.host/systemreports). - * @throws OperationResponse - */ - GenerateSystemReport(): Promise<SystemReportReply | OperationResponse>; - - /** - * Saves a report in the Desktop directory. - * @param reportId The report ID (file name) to save. - */ - SaveToDesktop(reportId: string): Promise<OperationResponse>; - - /** - * @param reportId The report ID (file name) to submit. - * @todo times out ({@link Result.Timeout}) - */ - Submit(reportId: string): Promise<OperationResponse>; -} - -export interface SystemUI { - CloseGameWindow(appId: number, windowId: number): void; - - GetGameWindowsInfo(appId: number, windowIds: number[]): Promise<GameWindowInfo>; - - RegisterForFocusChangeEvents(callback: (event: FocusChangeEvent) => void): Unregisterable | any; - - // appId is 0 if unknown app is focused - RegisterForOverlayGameWindowFocusChanged(callback: (appId: number, param1: number) => void): Unregisterable | any; - - //event.eKey, event.nControllerIndex - RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable | any; // eKey -} - -export interface System { - Audio: Audio; - AudioDevice: AudioDevice; - Bluetooth: Bluetooth; - - /** - * Copies specified files to clipboard. - * Does not throw if not found. - * @param paths File paths to copy. - */ - CopyFilesToClipboard(paths: string[]): void; - - /** - * Creates a temporary folder. - * @param path The folder to create. - * @returns The created path. - * @todo Does this support relative paths ? this has some weird behavior - */ - CreateTempPath(path: string): Promise<string>; - - Devkit: Devkit; - Display: Display; - DisplayManager: DisplayManager; - Dock: Dock; - - ExitFakeCaptivePortal(): any; - - FactoryReset(): any; - - FormatStorage(forceFormat: boolean): any; - - GetLegacyAmpControlEnabled(): Promise<any>; // {"bAvailable":true,"bEnabled":false} - - GetOSType(): Promise<OSType>; - - GetSystemInfo(): Promise<SystemInfo>; - - IsDeckFactoryImage(): Promise<boolean>; - - IsSteamInTournamentMode(): Promise<boolean>; - - /** - * Moves a file. - * @param target Target file/folder. - * @param destination Destination path. - * @remarks Does not throw on error. - */ - MoveFile(target: string, destination: string): void; - - Network: Network; - - NotifyGameOverlayStateChanged(latestAppOverlayStateActive: boolean, appId: number): any; - - /** - * Open a dialog for choosing a file. - * @param {FileDialog} prefs - Dialog preferences. - * @returns {Promise<string>} A Promise that resolves to the selected file name. - * @throws Throws if no file was selected. - */ - OpenFileDialog(prefs: FileDialog): Promise<string | OperationResponse>; - - /** - * Open a URL in the default web browser. - * @returns {void} - */ - OpenInSystemBrowser(url: string): void; - - OpenLocalDirectoryInSystemExplorer(directory: string): void; // Opens local directory in system explorer - Perf: Perf; - - RebootToAlternateSystemPartition(): any; - - RebootToFactoryTestImage(param0: any): any; - - RegisterForAirplaneModeChanges(callback: (airplaneModeChange: AirplaneModeChange) => void): Unregisterable | any; - - RegisterForBatteryStateChanges(callback: (batteryStateChange: BatteryStateChange) => void): Unregisterable | any; - - RegisterForFormatStorageProgress(callback: () => void): Unregisterable | any; // {"flProgress":0,"rtEstimatedCompletionTime":0,"eStage":1} - - RegisterForOnResumeFromSuspend(callback: () => void): Unregisterable | any; - - RegisterForOnSuspendRequest(callback: () => void): Unregisterable | any; - - /** - * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link MsgSystemManagerSettings}. - */ - RegisterForSettingsChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - - Report: Report; - - /** - * Restarts the system. - */ - RestartPC(): any; - - SetAirplaneMode(value: boolean): void; - - SetLegacyAmpControl: any; - - ShutdownPC(): any; - - SteamRuntimeSystemInfo(): Promise<string>; - - /** - * Suspends the system. - */ - SuspendPC(): any; - - /** - * Switches to desktop mode. - */ - SwitchToDesktop(): any; - - UI: SystemUI; - UpdateSettings: any; -} - -export interface UI { - EnsureMainWindowCreated(): void; - - ExitBigPictureMode(): void; - - GetDesiredSteamUIWindows(): Promise<SteamWindow[]>; - - /** - * Gets information about whether your OS will be unsupported in the future or not. - * @returns {Promise<OSEndOfLifeInfo>} - */ - GetOSEndOfLifeInfo(): Promise<OSEndOfLifeInfo>; - - /** - * Retrieves the current UI mode. - * @returns {Promise<UIMode>} - A Promise that resolves to the current UI mode. - */ - GetUIMode(): Promise<UIMode>; - - NotifyAppInitialized(): void; - - RegisterDesiredSteamUIWindowsChanged(callback: () => void): Unregisterable | any; - - RegisterForClientConVar: any; - - RegisterForErrorCondition(callback: (param0: number, param1: number) => void): Unregisterable | any; - - RegisterForKioskModeResetSignal(callback: () => void): Unregisterable | any; - - RegisterForUIModeChanged(callback: (mode: UIMode) => void): Unregisterable | any; - - ResetErrorCondition(): void; - - /** - * Sets the UI mode to the specified value. - * @param {UIMode} mode - The UI mode to set. - * @returns {void} - */ - SetUIMode(mode: UIMode): void; -} - -export interface URL { - /** - * Executes a steam:// URL. - * @param url The URL to execute. - */ - ExecuteSteamURL(url: string): void; - - /** - * @remarks The array may be empty. - */ - GetSteamURLList(param0: string[]): Promise<SteamURLs>; - - GetWebSessionID(): Promise<string>; - - /** - * Registers a callback to be called when a steam:// URL gets executed. - * @param {string} section - `rungameid`, `open`, etc. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForRunSteamURL(section: string, callback: (param0: number, url: string) => void): Unregisterable | any; - - RegisterForSteamURLChanges(callback: () => void): void; -} - -export interface Updates { - ApplyUpdates(param0: string): Promise<OperationResponse>; - - CheckForUpdates(): Promise<OperationResponse>; // Checks for software updates - - GetCurrentOSBranch(): Promise<OSBranch>; - - /** - * If `data` is deserialized, returns {@link MsgSystemUpdateState}. - * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. - */ - RegisterForUpdateStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; - - // 1 - Stable, 2 - Beta, 3 - Preview - SelectOSBranch(branch: number): any; // enum? -} - -export interface User { - AuthorizeMicrotxn(txnId: any): any; - - CancelLogin: any; - - CancelMicrotxn(txnId: any): any; - - /** - * Tries to cancel Steam shutdown. - * @returns {void} - * @remarks Used in the "Shutting down" dialog. - */ - CancelShutdown(): void; - - /** - * Opens the "Change Account" dialog. - * @returns {void} - */ - ChangeUser(): void; - - Connect(): Promise<OperationResponse>; - - FlipToLogin(): void; - - /** - * Forces a shutdown while shutting down. - * @returns {void} - * @remarks Used in the "Shutting down" dialog. - */ - ForceShutdown(): void; - - /** - * Forgets an account's password. - * @param {string} accountName - Login of the account to forget. - * @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the operation succeeded or not. - */ - ForgetPassword(accountName: string): Promise<boolean>; - - /** - * Gets your country code. - * @returns {Promise<string>} A Promise that resolves to a string containing your country code. - */ - GetIPCountry(): Promise<string>; - - GetLoginProgress(callback: (param0: number, param1: number) => void): Unregisterable | any; - - GetLoginUsers(): Promise<LoginUser[]>; - - GoOffline(): void; - - GoOnline(): void; - - OptOutOfSurvey(): void; - - PrepareForSystemSuspend(): any; - - Reconnect(): void; - - RegisterForConnectionAttemptsThrottled(callback: (data: ConnectionAttempt) => void): Unregisterable | any; - - RegisterForCurrentUserChanges(callback: (user: CurrentUser) => void): void; - - RegisterForLoginStateChange(callback: (accountName: string, loginState: ELoginState, loginResult: number, loginPercentage: number, param4: number) => void): Unregisterable | any; - - RegisterForPrepareForSystemSuspendProgress(callback: (data: any) => void): Unregisterable | any; - - RegisterForResumeSuspendedGamesProgress: Unregisterable | any; - - RegisterForShutdownDone(callback: () => void): Unregisterable | any; - - RegisterForShutdownFailed: Unregisterable | any; - - /** - * Register a function to be executed when a shutdown start is detected. - * @param callback The function to be executed on shutdown start. - */ - RegisterForShutdownStart(callback: () => void): Unregisterable | any; - - RegisterForShutdownState: Unregisterable | any; - - /** - * Removes an account from remembered users. - * @param {string} accountName - The account to remove. - * @returns {void} - */ - RemoveUser(accountName: string): void; - - RequestSupportSystemReport(reportId: string): Promise<{ - bSuccess: boolean; - }>; - - ResumeSuspendedGames(param0: boolean): any; - - // Hardware survey information - RunSurvey(callback: (surveySections: SurveySection[]) => void): void; - - SendSurvey: any; - - SetAsyncNotificationEnabled(appId: number, enable: boolean): any; - - /** - * Sets given login credentials, but don't log in to that account. - * @param {string} accountName - Account name. - * @param {string} password - Account password. - * @param {boolean} rememberMe - Whether to remember that account. - * @returns {void} - */ - SetLoginCredentials(accountName: string, password: string, rememberMe: boolean): void; - - SetOOBEComplete(): void; - - ShouldShowUserChooser(): Promise<boolean>; - - /** - * Signs out and restarts Steam. - * @returnsn {void} - */ - SignOutAndRestart(): void; - - StartLogin(): void; - - // is param0 offline mode? - StartOffline(param0: boolean): any; - - /** - * Restarts the Steam client. - */ - StartRestart(): any; - - StartShutdown(flag: boolean): any; -} - -export interface WebChat { - BSuppressPopupsInRestore(): Promise<boolean>; - - /** - * Gets your Steam3 ID. - * @returns {Promise<number>} A Promise that resolves to a Steam3 ID. - */ - GetCurrentUserAccountID(): Promise<number>; - - /** - * Gets the current user's 64x64 avatar as a data URL. - * @returns {Promise<string>} A Promise that resolves to the data URL. - */ - GetLocalAvatarBase64(): Promise<string>; - - /** - * Gets the current user's nickname. - * @returns {Promise<string>} A Promise that resolves to the nickname. - */ - GetLocalPersonaName(): Promise<string>; - - GetOverlayChatBrowserInfo(): Promise<OverlayBrowserInfo[]>; - - // param0 - appid ? - GetPrivateConnectString(param0: number): Promise<string>; - - /** - * Gets information about push-to-Talk. - * @returns {Promise<PushToTalkInfo>} - */ - GetPushToTalkEnabled(): Promise<PushToTalkInfo>; - - /** - * Gets the "Sign in to friends when Steam starts" option value. - * @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the option is enabled or not. - */ - GetSignIntoFriendsOnStart(): Promise<boolean>; - - /** - * Retrieves the current UI mode. - * @returns {Promise<UIMode>} - A Promise that resolves to the current UI mode. - */ - GetUIMode(): Promise<UIMode>; - - OnGroupChatUserStateChange(chatGroupId: any, accountId: any, action: any): any; - - OnNewGroupChatMsgAdded( - groupId: number, - chatId: number, - accountId: number, - timestamp: number, - param4: number, - message: string, - ): any; - - // Opens the URL in default web browser, despite what the name says ? - OpenURLInClient(url: string, pid: number, forceExternal: boolean): void; - - /** - * Registers a callback function to be called when the computer's active state changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - * @todo Changes to 2 after 10 seconds? - * @todo Does not affect the keyboard? - */ - RegisterForComputerActiveStateChange( - callback: (state: ComputerActiveState, time: number) => void, - ): Unregisterable | any; - - /** - * @todo WebChat.ShowFriendChatDialog does this. - */ - RegisterForFriendPostMessage(callback: (data: FriendChatDialogData) => void): Unregisterable | any; - - /** - * @returns {void} - * @todo To unregister, use WebChat.UnregisterForMouseXButtonDown() ? - */ - RegisterForMouseXButtonDown(callback: any): void; - - /** - * Registers a callback function to be called when the push-to-talk state changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForPushToTalkStateChange(callback: (state: boolean) => void): Unregisterable | any; - - /** - * Registers a callback function to be called when the UI mode is changed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. - */ - RegisterForUIModeChange(callback: (mode: UIMode) => void): Unregisterable | any; - - RegisterOverlayChatBrowserInfoChanged(callback: any): Unregisterable | any; - - SetActiveClanChatIDs(clanChatIds: any[]): any; - - SetNumChatsWithUnreadPriorityMessages(size: number): void; - - SetPersonaName: any; - - SetPushToMuteEnabled(value: boolean): any; - - SetPushToTalkEnabled(value: boolean): any; - - SetPushToTalkHotKey(param0: number): void; - - SetPushToTalkMouseButton(param0: number): void; - - SetVoiceChatActive: any; - SetVoiceChatStatus: any; - ShowChatRoomGroupDialog: any; - - /** - * @todo Does not actually show the dialog. - */ - ShowFriendChatDialog(steamid: string): void; - - UnregisterForMouseXButtonDown(): void; -} - -export interface WebUITransport { - GetTransportInfo(): Promise<TransportInfo>; - - NotifyTransportFailure: any; -} - -/** - * Represents functionality for managing Steam's windows. - * Note that methods here have to be called from the window you want to use. - */ -export interface Window { - BringToFront(forceOS?: WindowBringToFront): any; - - /** - * @todo Shuts down Steam too? - */ - Close(): any; - - /** - * Is the Steam window fullscreen? - * @param {function} callback - The callback function to be called to receive the fullscreen state. - * @returns {void} - */ - DefaultMonitorHasFullscreenWindow(callback: (fullscreen: boolean) => void): void; - - /** - * Flashes the window in the taskbar. - * @returns {void} - */ - FlashWindow(): void; - - /** - * @todo Returns 0? - */ - GetDefaultMonitorDimensions(callback: (param0: number) => void): void; - - GetMousePositionDetails(callback: (details: string) => void): void; - - /** - * Gets the window X position. - * @param {function} callback - The callback function to be called to receive the X position. - * @returns {void} - */ - GetWindowDimensions(callback: (x: number) => void): void; - - GetWindowRestoreDetails(callback: (details: string) => void): void; - - /** - * Hides the window. - * @returns {void} - */ - HideWindow(): void; - - /** - * Is the window maximized? - * @param {function} callback - The callback function to be called to receive the maximized state. - * @returns {void} - */ - IsWindowMaximized(callback: (maximized: boolean) => void): void; - - /** - * Is the window minimized? - * @param {function} callback - The callback function to be called to receive the minimized state. - * @returns {void} - */ - IsWindowMinimized(callback: (minimized: boolean) => void): void; - - MarkLastFocused(): void; - - /** - * Minimizes the window. - * @returns {void} - */ - Minimize(): void; - - /** - * Moves the window to given coordinates. - * @param {number} x - Window X position. - * @param {number} y - Window Y position. - * @param {number | undefined} dpi - Screen DPI. - * @returns {void} - */ - MoveTo(x: number, y: number, dpi: number | undefined): void; - - /** - * Moves the window to a given location. - * @param {string} location - Window location. - * @param {number | undefined} offset - X/Y offset. - * @returns {void} - */ - MoveToLocation(location: WindowLocation, offset: number | undefined): void; - - /** - * Moves the window relatively to given details. - * @param {string} details - Window details string from `Window.GetWindowRestoreDetails`. - * @param {number} x - Window X position. - * @param {number} y - Window Y position. - * @param {number} width - Window width. - * @param {number} height - Window height. - * @returns {void} - * - * @example - * Move the window to bottom right by 50 pixels: - * ``` - * SteamClient.Window.GetWindowRestoreDetails(e => { - * SteamClient.Window.PositionWindowRelative(e, 50, 50, 0, 0); - * }) - * ``` - */ - PositionWindowRelative(details: string, x: number, y: number, width: number, height: number): void; - - ProcessShuttingDown(): Promise<boolean>; - - /** - * Resizes the window to given dimension. - * The window has to be created with the resizable flag. - * @param {number} width - Window width. - * @param {number} height - Window height. - * @param {boolean | number} applyBrowserScaleOrDPIValue - * @returns {void} - */ - ResizeTo(width: number, height: number, applyBrowserScaleOrDPIValue: boolean | number): void; - - /** - * Moves the window to given details. - * @param {string} details - Window details string from `Window.GetWindowRestoreDetails`. - * @returns {void} - */ - RestoreWindowSizeAndPosition(details: string): void; - - SetAutoDisplayScale(value: boolean): void; - - SetComposition(uiComposition: UIComposition, appIds: number[], windowId: number): any; - - /** - * Makes the window hide, but not close on pressing the close button. - * @param {boolean} value - Hide on close? - * @returns {void} - */ - SetHideOnClose(value: boolean): void; - - SetKeyFocus(value: boolean): void; - - SetManualDisplayScaleFactor(displayScaleFactor: number): void; - - /** - * Sets the window's max size. - * @param {number} width - Window's max width. - * @param {number} height - Window's max height. - * @returns {void} - */ - SetMaxSize(width: number, height: number): void; - - /** - * Sets the window's min size. - * @param {number} width - Window's max width. - * @param {number} height - Window's max height. - * @returns {void} - */ - SetMinSize(width: number, height: number): void; - - SetModal(value: boolean): void; - - /** - * Sets the window's resize grip size. - * The window has to be created with the resize grip flag. - * @param {number} width - Resize grip width. - * @param {number} height - Resize grip height. - * @returns {void} - */ - SetResizeGrip(width: number, height: number): void; - - /** - * Set the window's icon. - * @param {WindowIcon} icon - The window icon to be used. - * @returns {void} - */ - SetWindowIcon(icon: WindowIcon): void; - - /** - * Shows the window. - * @returns {void} - */ - ShowWindow(): void; - - /** - * Stops the window's taskbar flashing. - * @returns {void} - */ - StopFlashWindow(): void; - - /** - * Toggles the window's fullscreen state. - * @returns {void} - */ - ToggleFullscreen(): void; - - /** - * Toggles the window's maximized state. - * @returns {void} - */ - ToggleMaximize(): void; -} - -export interface SteamClient { - Apps: Apps; - Auth: Auth; - Broadcast: Broadcast; - Browser: Browser; - BrowserView: BrowserView; - ClientNotifications: ClientNotifications; - Cloud: Cloud; - CommunityItems: CommunityItems; - Console: Console; - Customization: Customization; - Downloads: Downloads; - FamilySharing: FamilySharing; - FriendSettings: FriendSettings; - Friends: Friends; - GameNotes: GameNotes; - GameSessions: GameSessions; - Input: Input; - InstallFolder: InstallFolder; - Installs: Installs; - MachineStorage: Storage; - Messaging: Messaging; - Music: Music; - Notifications: Notifications; - OpenVR: OpenVR; - Overlay: Overlay; - Parental: Parental; - RemotePlay: RemotePlay; - RoamingStorage: Storage; - Screenshots: Screenshots; - ServerBrowser: ServerBrowser; - Settings: Settings; - SharedConnection: SharedConnection; - Stats: Stats; - SteamChina: SteamChina; - Storage: Storage; - Streaming: Streaming; - System: System; - UI: UI; - URL: URL; - Updates: Updates; - User: User; - WebChat: WebChat; - WebUITransport: WebUITransport; - Window: Window; -} - -export interface SteamShortcut { - appid: number; - data: Shortcut; -} - -export interface Shortcut { - bIsApplication: boolean; - strAppName: string; - strExePath: string; - strArguments: string; - strCmdline: string; - strShortcutPath: string | undefined; - strSortAs: string | undefined; - strIconDataBase64: string | undefined; -} - -/** - * @prop unAppID is not properly set by Steam for non-steam game shortcuts, so it defaults to 0 for them - */ -export interface AppLifetimeNotification { - unAppID: number; - nInstanceID: number; - bRunning: boolean; -} - -export type AppAchievements = { - nAchieved: number; - nTotal: number; - vecAchievedHidden: AppAchievement[]; - vecHighlight: AppAchievement[]; - vecUnachieved: AppAchievement[]; -}; - -export type AppLanguage = { - strDisplayName: string; - /** A localization string for the language. */ - strShortName: string; -}; - -export type AppAction = "LaunchApp" | "VerifyApp"; - -export type LaunchAppTask = - | "None" - | "Completed" - | "Cancelled" - | "Failed" - | "Starting" - | "ConnectingToSteam" - | "RequestingLicense" - | "UpdatingAppInfo" - | "UpdatingAppTicket" - | "UnlockingH264" - | "WaitingOnWideVineUpdate" - | "ShowCheckSystem" - | "CheckTimedTrial" - | "GetDurationControl" - | "ShowDurationControl" - | "ShowLaunchOption" - | "ShowEula" - | "ShowVR2DWarning" - | "ShowVROculusOnly" - | "ShowVRStreamingLaunch" - | "ShowGameArgs" - | "ShowCDKey" - | "WaitingPrevProcess" - | "DownloadingDepots" - | "DownloadingWorkshop" - | "UpdatingDRM" - | "GettingLegacyKey" - | "ProcessingInstallScript" - | "RunningInstallScript" - | "SynchronizingCloud" - | "SynchronizingControllerConfig" - | "ShowNoControllerConfig" - | "ProcessingShaderCache" - | "VerifyingFiles" - | "KickingOtherSession" - | "WaitingOpenVRAppQuit" - | "SiteLicenseSeatCheckout" - | "DelayLaunch" - | "CreatingProcess" - | "WaitingGameWindow" - -export type LogoPinPositions = 'BottomLeft' | 'UpperLeft' | 'CenterCenter' | 'UpperCenter' | 'BottomCenter'; - -export type ServerBrowserTab = 'internet' | 'favorites' | 'history' | 'lan' | 'friends'; - -export type WindowLocation = - | 'upper-left' - | 'lower-left' - | 'center-top' - | 'center-bottom' - | 'center-bottom' - | 'upper-right' - | 'lower-right'; - -export type WindowIcon = 'steam' | 'messages' | 'voice'; - -export type BrowserViewEvent = - | 'alert-dialog' - | 'before-close' - | 'blocked-request' - | 'can-go-back-forward-changed' - | 'confirm-dialog' - | 'favicon-urls-changed' - | 'find-in-page-results' - | 'finished-request' - | 'focus-changed' - | 'full-screen' - | 'history-changed' - | 'load-error' - | 'message' - | 'new-tab' - | 'node-has-focus' - | 'page-security' - | 'set-title' - | 'start-loading' - | 'start-request' - | 'toggle-find-in-page'; - -export interface LogoPositionForApp { - nVersion: number; // Usually 1 - logoPosition: LogoPosition; -} - -export interface LogoPosition { - pinnedPosition: LogoPinPositions; - nWidthPct: number; - nHeightPct: number; -} - -export interface AppData { - details: AppDetails; - // more -} - -export interface AppDeckDerivedProperties { - gamescope_frame_limiter_not_supported?: boolean; - non_deck_display_glyphs: boolean; - primary_player_is_controller_slot_0: boolean; - requires_h264: boolean; - requires_internet_for_setup: boolean; - requires_internet_for_singleplayer: boolean; - requires_manual_keyboard_invoke: false; - requires_non_controller_launcher_nav: false; - small_text: boolean; - supported_input: number; -} - -export interface AppLibraryAssets { - logoPosition?: LogoPosition; - strCapsuleImage: string; - strHeroBlurImage: string; - strHeroImage: string; - strLogoImage: string; -} - -export interface AppBeta { - /** Beta name. */ - strName: string; - /** Beta description. */ - strDescription: string; -} - -export interface DeckCompatTestResult { - // enum ? - test_result: number; - /** A localization string. */ - test_loc_token: string; -} - -export interface AppDLC { - /** Is the DLC availble on the store? */ - bAvailableOnStore: boolean; - bEnabled: boolean; - /** Disk usage, in bytes. */ - lDiskUsageBytes: number; - /** Purchase date. */ - rtPurchaseDate: number; - rtStoreAssetModifyType: number; - /** Store header image filename. */ - strHeaderFilename: string; - /** Display name. */ - strName: string; - /** State (installed/notinstalled). */ - strState: string; - /** App ID. */ - unAppID: number; -} - -export interface AppSoundtrack { - /** Purchase date. */ - rtPurchaseDate: number; - rtStoreAssetModifyType: number; - /** Display name. */ - strName: string; - /** State (installed/notinstalled). */ - strState: string; - /** App ID. */ - unAppID: number; -} - -export interface AppDetails { - achievements: AppAchievements; - /** Indicates whether the application is available on the store. */ - bAvailableContentOnStore: boolean; - bCanMoveInstallFolder: boolean; - bCloudAvailable: boolean; - bCloudEnabledForAccount: boolean; - bCloudEnabledForApp: boolean; - bCloudSyncOnSuspendAvailable: boolean; - bCloudSyncOnSuspendEnabled: boolean; - /** Indicates whether the application has community market available. */ - bCommunityMarketPresence: boolean; - bEnableAllowDesktopConfiguration: boolean; - bFreeRemovableLicense: boolean; - bHasAllLegacyCDKeys: boolean; - bHasAnyLocalContent: boolean; - bHasLockedPrivateBetas: boolean; - bIsExcludedFromSharing: boolean; - bIsSubscribedTo: boolean; - bIsThirdPartyUpdater: boolean; - bOverlayEnabled: boolean; - bOverrideInternalResolution: boolean; - bRequiresLegacyCDKey: boolean; - bShortcutIsVR: boolean; - bShowCDKeyInMenus: boolean; - bShowControllerConfig: boolean; - bSupportsCDKeyCopyToClipboard: boolean; - bVRGameTheatreEnabled: boolean; - bWorkshopVisible: boolean; - deckDerivedProperties?: AppDeckDerivedProperties; - eAppOwnershipFlags: AppOwnershipFlags | number; // is this a bitmask? - eAutoUpdateValue: AutoUpdateBehavior; - eBackgroundDownloads: BackgroundDownloadsBehavior; - /** - * @todo enum - */ - eCloudSync: number; - /** - * @todo enum - */ - eControllerRumblePreference: number; // ControllerRumbleSetting? - eDisplayStatus: DisplayStatus; - /** - * @todo enum - */ - eEnableThirdPartyControllerConfiguration: number; - /** - * @todo enum - */ - eSteamInputControllerMask: number; - /** - * Index of the install folder. -1 if not installed. - */ - iInstallFolder: number; - /** Disk space required for installation, in bytes. */ - lDiskSpaceRequiredBytes: number; - /** Application disk space usage, in bytes. */ - lDiskUsageBytes: number; - /** DLC disk space usage, in bytes. */ - lDlcUsageBytes: number; - nBuildID: number; - nCompatToolPriority: number; - /** Total play time, in minutes. */ - nPlaytimeForever: number; - /** Screenshot count. */ - nScreenshots: number; - rtLastTimePlayed: number; - rtLastUpdated: number; - rtPurchased: number; - selectedLanguage: AppLanguage; - strCloudBytesAvailable: string; - strCloudBytesUsed: string; - strCompatToolDisplayName: string; - strCompatToolName: string; - strDeveloperName: string; - strDeveloperURL: string; - strDisplayName: string; - strExternalSubscriptionURL: string; - strFlatpakAppID: string; - strHomepageURL: string; - strLaunchOptions: string; - strManualURL: string; - /** Steam64 ID. */ - strOwnerSteamID: string; - strResolutionOverride: string; - strSelectedBeta: string; - strShortcutExe: string; - strShortcutLaunchOptions: string; - strShortcutStartDir: string; - strSteamDeckBlogURL: string; - unAppID: number; - unEntitledContentApp: number; - unTimedTrialSecondsAllowed: number; - unTimedTrialSecondsPlayed: number; - vecBetas: AppBeta[]; - vecChildConfigApps: number[]; - vecDLC: AppDLC[]; - vecDeckCompatTestResults: DeckCompatTestResult[]; - vecLanguages: AppLanguage[]; - vecLegacyCDKeys: any[]; - vecMusicAlbums: AppSoundtrack[]; - /** windows | osx | linux */ - vecPlatforms: string[]; - vecScreenShots: Screenshot[]; - libraryAssets?: AppLibraryAssets; -} - -// Appears to be all optional fields :disaster: -export interface SteamAppOverview { - appid: number; - display_name: string; - visible_in_game_list: boolean; - sort_as: string; - - /* - * Possible bitmask values, but I haven't spotted any of them being masked in the app_type field. - * Should be safe as an enum. - */ - app_type: AppType; - mru_index: number | undefined; - rt_recent_activity_time: number; - minutes_playtime_forever: number; - minutes_playtime_last_two_weeks: number; - rt_last_time_played_or_installed: number; - rt_last_time_played: number; - store_tag?: number[]; - association: SteamAppOverviewAssociation[]; - store_category?: number[]; - rt_original_release_date: number; - rt_steam_release_date: number; - icon_hash: string; - controller_support?: AppControllerSupportLevel; // default none - vr_supported?: boolean; - metacritic_score: number; - size_on_disk?: number; - third_party_mod?: boolean; - icon_data?: string; - icon_data_format?: string; - gameid: string; - library_capsule_filename?: string; - per_client_data: SteamAppOverviewClientData[]; - most_available_clientid: string; - selected_clientid?: string; - rt_store_asset_mtime: number; - rt_custom_image_mtime?: number; - optional_parent_app_id?: number; - owner_account_id?: number; - review_score_with_bombs: number; - review_percentage_with_bombs: number; - review_score_without_bombs: number; - review_percentage_without_bombs: number; - library_id?: string; - vr_only?: boolean; - mastersub_appid?: number; - mastersub_includedwith_logo?: string; - site_license_site_name?: string; - shortcut_override_appid?: number; - steam_deck_compat_category: SteamDeckCompatibilityCategory; // Default should be Unknown - rt_last_time_locally_played?: number; - rt_purchased_time: number; - header_filename?: string; - - m_setStoreCategories: Set<number>; - m_setStoreTags: Set<number>; - canonicalAppType: number; - local_per_client_data: SteamAppOverviewClientData; - most_available_per_client_data: SteamAppOverviewClientData; - selected_per_client_data: SteamAppOverviewClientData; - m_strPerClientData: Set<any> | undefined; - m_strAssociations: Set<any> | undefined; - - BIsModOrShortcut: () => boolean; - BIsShortcut: () => boolean; -} - -export interface SteamAppOverviewAssociation { - type: AppAssociationType; // Default should be Invalid - name: string; -} - -export interface SteamAppOverviewClientData { - clientid: string; - client_name: string; - display_status: DisplayStatus; // Default should be Invalid - status_percentage: number; - active_beta?: string; - installed?: boolean; - bytes_downloaded: string; - bytes_total: string; - streaming_to_local_client?: boolean; - is_available_on_current_platform: boolean; - is_invalid_os_type?: boolean; - playtime_left?: number; - cloud_status: AppCloudStatus; -} - -export interface ConflictingFileTimestamp { - rtLocalTime: number; - rtRemoteTime: number; -} - -/** - * Represents information about a compatibility tool. - */ -export interface CompatibilityToolInfo { - /** Name of the compatibility tool. */ - strToolName: string; - /** Display name of the compatibility tool. */ - strDisplayName: string; -} - -/** - * Represents information about an installed application. - */ -export interface AppInfo { - /** ID of the application. */ - nAppID: number; - /** Name of the application. */ - strAppName: string; - /** Sorting information for the application. */ - strSortAs: string; - /** Last played time in Unix Epoch time format. */ - rtLastPlayed: number; - /** Size of used storage by the application. */ - strUsedSize: string; - /** Size of DLC storage used by the application. */ - strDLCSize: string; - /** Size of workshop storage used by the application. */ - strWorkshopSize: string; - /** Size of staged storage used by the application. */ - strStagedSize: string; -} - -/** - * Represents information about an installation folder. - */ -export interface SteamInstallFolder extends PotentialInstallFolder { - /** Index of the folder. */ - nFolderIndex: number; - /** Used space in the folder. */ - strUsedSize: string; - /** Size of DLC storage used in the folder. */ - strDLCSize: string; - /** Size of workshop storage used in the folder. */ - strWorkshopSize: string; - /** Size of staged storage used in the folder. */ - strStagedSize: string; - /** Indicates if the folder is set as the default installation folder. */ - bIsDefaultFolder: boolean; - /** Indicates if the folder is currently mounted. */ - bIsMounted: boolean; - /** List of applications installed in the folder. */ - vecApps: AppInfo[]; -} - -export interface PotentialInstallFolder { - /** Path of the folder. */ - strFolderPath: string; - /** User label for the folder. */ - strUserLabel: string; - /** Name of the drive where the folder is located. */ - strDriveName: string; - /** Total capacity of the folder. */ - strCapacity: string; - /** Available free space in the folder. */ - strFreeSpace: string; - /** Indicates if the folder is on a fixed drive. */ - bIsFixed: boolean; -} - -export interface AchievementNotification { - achievement: AppAchievements; - nCurrentProgress: number; - nMaxProgress: number; - unAppID: number; -} - -export interface ScreenshotNotification { - details: Screenshot; - hScreenshot: number; - strOperation: "deleted" | "written"; - unAppID: number; -} - -export interface Screenshot { - nAppID: number; - strGameID: string; - hHandle: number; - nWidth: number; - nHeight: number; - nCreated: number; // timestamp - ePrivacy: FilePrivacyState; - strCaption: ''; - bSpoilers: boolean; - strUrl: string; - bUploaded: boolean; - ugcHandle: string; -} - -export interface DownloadItem { - /** True if this app is currently downloading */ - active: boolean; - /** Appid of app */ - appid: number; - /** Current build ID for the installed app, zero if the app isn't installed yet */ - buildid: number; - /** True if this update has been completed */ - completed: boolean; - /** For completed downloads, time of completion, 0 if not completed */ - completed_time: number; - deferred_time: number; - /** Bytes already downloaded, sum across all content types */ - downloaded_bytes: number; - /** If true, game will launch when its download completes successfully */ - launch_on_completion: boolean; - /** True if this app has been paused by the user or the system */ - paused: boolean; - /** Queue index, -1 if the item is unqueued */ - queue_index: number; - /** Build ID that this download is moving towards. This can be the same as buildid.*/ - target_buildid: number; - /** Total bytes to download, sum across all content types */ - total_bytes: number; - /** - * Update error description, when paused and there has been an error. - * Unlocalized and shouldn't be displayed to the user. - */ - update_error: string; - update_result: AppUpdateError; - update_type_info: UpdateTypeInfo[]; -} - -export interface UpdateTypeInfo { - /** True if this content type had an update and it has completed */ - completed_update: boolean; - /** Bytes already downloaded for this content type */ - downloaded_bytes: number; - /** True if this content type has or had an update */ - has_update: boolean; - /** Total bytes to download for this content type */ - total_bytes: number; -} - -export interface DownloadOverview { - /** Set if we are downloading from LAN peer content server */ - lan_peer_hostname: string; - /** True if all downloads are paused */ - paused: boolean; - /** True if download throttling has been temporarily suspended for the current download */ - throttling_suspended: boolean; - /** Appid of currently updating app */ - update_appid: number; - /** Bytes already downloaded */ - update_bytes_downloaded: number; - /** Bytes already processed in current phase - resets to zero when update stage changes */ - update_bytes_processed: number; - /** Bytes already staged */ - update_bytes_staged: number; - /** Total bytes to download */ - update_bytes_to_download: number; - /** Total bytes to process in current phase - resets to zero when update stage changes */ - update_bytes_to_process: number; - /** Total bytes to be staged */ - update_bytes_to_stage: number; - /** Current disk throughput estimate */ - update_disc_bytes_per_second: number; - /** True if the current update is an initial install */ - update_is_install: boolean; - /** True if download and staging sizes are prefetch estimates */ - update_is_prefetch_estimate: boolean; - /** True if the current update is for shader update */ - update_is_shader: boolean; - /** True if the client is running in peer content server mode serving other peers */ - update_is_upload: boolean; - /** True if the current update is for workshop content */ - update_is_workshop: boolean; - /** Current bandwidth estimate for download */ - update_network_bytes_per_second: number; - /** Peak bandwidth estimate for download */ - update_peak_network_bytes_per_second: number; - /** Estimate of remaining time (in seconds) until download completes (not including staging) */ - update_seconds_remaining: number; - /** Time current update started */ - update_start_time: number; - update_state: 'None' | 'Starting' | 'Updating' | 'Stopping'; -} - -export interface Lender { - /** - * A Steam64 ID. - */ - steamid: string; - appid: number; - numDlc: number; - bPreferred: boolean; - vecDLC: any[]; -} - -export interface InstallInfo { - rgAppIDs: InstallInfoApps[]; - eInstallState: EInstallManagerState; - nDiskSpaceRequired: number; - nDiskSpaceAvailable: number; - nCurrentDisk: number; - nTotalDisks: number; - bCanChangeInstallFolder: boolean; - /** - * Index of the install folder. -1 if not installed. - */ - iInstallFolder: number; - iUnmountedFolder: number; - currentAppID: number; - eAppError: AppError; - errorDetail: string; - bSystemMenuShortcut: boolean; - bDesktopShortcut: boolean; - bIsBackupInstall: boolean; - strPeerContentServer: string; - bPeerContentServerOnline: boolean; - bPeerContentServerAvailable: boolean; -} - -export interface InstallInfoApps { - nAppID: number; - lDiskSpaceRequiredBytes: number; -} - -/** - * Represents spew output information. - */ -export interface SpewOutput { - /** - * The content of the spew output. - */ - spew: string; - - /** - * The type or category of the spew output. - */ - spew_type: "error" | "info" | "input"; -} - -export interface AuthRefreshInfo { - reason: number; - account_name: string; - login_id_token: string; -} - -export interface WorkshopItemDetails { - /** - * Required items' IDs. - */ - children: string[]; - eresult: Result; - /** - * Item size, in byts. - */ - file_size: string; - /** - * Workshop file type. - */ - file_type: WorkshopFileType; - /** - * Item preview image URL. - */ - preview_url: string; - /** - * Item ID. - */ - publishedfileid: string; - /** - * Item description. - */ - short_description: string; - /** - * Item tags. - */ - tags: string[]; - /** - * Item title. - */ - title: string; -} - -export interface WorkshopItem { - unAppID: number; - ulPublishedFileID: string; -} - -/** - * Represents playtime information for an application. - */ -export interface Playtime { - /** Total playtime in minutes for the last 2 weeks. */ - nPlaytimeLastTwoWeeks: number; - /** Total playtime in minutes. */ - nPlaytimeForever: number; - /** Last played time in Unix Epoch time format. */ - rtLastTimePlayed: number; -} - -export interface BrightnessChange { - flBrightness: number; -} - -export interface AirplaneModeChange { - bEnabled: boolean; -} - -export interface SystemInfo { - sOSName: string; - sKernelVersion: string; - sBIOSVersion: string; - sHostname: string; - sOSCodename: string; - sOSVariantId: string; - sOSVersionId: string; - sOSBuildId: string; - nSteamVersion: number; - sSteamBuildDate: string; - sSteamAPI: string; - sCPUVendor: string; - sCPUName: string; - nCPUHz: number; - nCPUPhysicalCores: number; - nCPULogicalCores: number; - nSystemRAMSizeMB: number; - sVideoCardName: string; - sVideoDriverVersion: string; - nVideoRAMSizeMB: number; - bIsUnsupportedPrototypeHardware: boolean; -} - -interface Region { - nRegionID: number; - strRegionName: string; -} - -interface Hour { - nHour: number; - strDisplay: string; -} - -interface AvailableClientBeta { - nBetaID: number; - strName: string; -} - -interface SteamSettings { - bIsInClientBeta: boolean; - bIsSteamSideload: boolean; - eClientBetaState: ClientBetaState; - strSelectedBetaName: string; - nAvailableBetas: number; - bChangeBetaEnabled: boolean; - nSelectedBetaID: number; - vecAvailableClientBetas: AvailableClientBeta[]; - bIsValveEmail: boolean; - bIsInDesktopUIBeta: boolean; - bEnableSoftProcessKill: boolean; - vecValidDownloadRegions: Region[]; - vecValidAutoUpdateRestrictHours: Hour[]; - bCompatEnabled: boolean; - bCompatEnabledForOtherTitles: boolean; - strCompatTool: string; - strDisplayName: string; - bDisplayIsExternal: boolean; - flAutoDisplayScaleFactor: number; - flCurrentDisplayScaleFactor: number; - bDisplayIsUsingAutoScale: boolean; - flMinDisplayScaleFactor: number; - flMaxDisplayScaleFactor: number; - flCurrentUnderscanLevel: number; - bUnderscanEnabled: boolean; - vecNightModeScheduledHours: Hour[]; -} - -export interface PrePurchaseApp { - nAppID: number; - eState: EAppReleaseState; -} - -export interface PrePurchaseInfo { - apps: PrePurchaseApp[]; - lastChangeNumber: number; -} - -export interface AppAchievement { - bAchieved: boolean; - bHidden: boolean; - flMinProgress: number; - flCurrentProgress: number; - flMaxProgress: number; - /** How many players have this achievement, in percentage. */ - flAchieved: number; - /** When this achievement was unlocked. */ - rtUnlocked: number; - /** Achievement description. */ - strDescription: string; - /** Achievement ID. */ - strID: string; - /** Achievement icon. */ - strImage: string; - /** Achievement name. */ - strName: string; -} - -export interface AppAchievementData { - rgAchievements: AppAchievement[]; -} - -export interface AppAchievementResponse { - result: number; - data: AppAchievementData; -} - -export interface NonSteamApp { - bIsApplication: boolean; - strAppName: string; - strExePath: string; - strArguments: string; - strCmdline: string; - strIconDataBase64: string; -} - -export interface RegisteredSteamDeck { - bRegistered: boolean; - bIgnoreRegistrationPrompt: boolean; - strSteamID: string; - strSerialNumber: string; -} - -export interface AccountSettings { - strEmail: string; - bEmailValidated: boolean; - bHasAnyVACBans: boolean; - bHasTwoFactor: boolean; - eSteamGuardState: ESteamGuardState; - rtSteamGuardEnableTime: number; - bSaveAccountCredentials: boolean; -} - -export interface Language { - language: ELanguage; - strShortName: string; -} - -export interface TimeZone { - utcOffset: number; - timezoneID: string; - timezoneLocalizationToken: string; - regionsLocalizationToken: string; -} - -export interface AppBackupStatus { - appid: number; - eError: AppUpdateError; - strBytesToProcess: string; - strBytesProcessed: string; - strTotalBytesWritten: string; -} - -/** - * Represents a list of applications with their IDs. - */ -interface AppList { - /** - * Key-value pairs where the key is the `appId` (e.g., "App_123456") and the value indicates whether the appId is allowed during parental lock. - */ - [appId: string]: number; -} - -/** - * Represents the parental settings and restrictions. - */ -export interface ParentalSettings { - /** - * Indicates whether parental settings are enabled. - */ - enabled: boolean; - /** - * Indicates whether parental settings are locked. - */ - locked: boolean; - /** - * Bitmask representing enabled features. - * - Bit 0: Unknown (@todo Please provide more details if known) - * - Bit 1: Online content & features - Steam Store - * - Bit 2: Online content & features - Community-generated content - * - Bit 3: Online content & features - My online profile, screenshots, and achievements - * - Bit 4: Online content & features - Friends, chat, and groups - * - Bit 5-11: Unknown (@todo Please provide more details if known) - * - Bit 12: Library content - 0: Only games I choose, 1: All games - */ - features: number; - /** - * Indicates whether all apps are allowed. - */ - allowallapps: boolean; - /** - * Base list (type not specified but an object). - * @todo Determine the type of this property. - */ - baselist: any | undefined; - /** - * Custom list of allowed applications. - */ - customlist: AppList; - /** - * Email for recovery (if applicable). - */ - recoveryemail: string | undefined; -} - -export interface ConnectivityTestChange { - eConnectivityTestResult: ConnectivityTestResult; - eFakeState: ENetFakeLocalSystemState; - bChecking: boolean; -} - -export interface ControllerStateChange { - unControllerIndex: number; - unPacketNum: number; - /** - * Bitmask representing pressed upper buttons. - * - Bit 0-8: Unknown (@todo Please provide more details if known) - * - Bit 9: L4 - * - Bit 10: R4 - * - Bit 11-13: Unknown (@todo Please provide more details if known) - * - Bit 14: Left Joystick Touch - * - Bit 15: Right Joystick Touch - * - Bit 16-17: Unknown (@todo Please provide more details if known) - * - Bit 18: Quick Access Menu - */ - ulUpperButtons: number; - /** - * Bitmask representing pressed buttons. - * - Bit 0: R2 - * - Bit 1: L2 - * - Bit 2: R1 - * - Bit 3: L1 - * - Bit 4: Y - * - Bit 5: B - * - Bit 6: X - * - Bit 7: A - * - Bit 8: D-Pad Up - * - Bit 9: D-Pad Right - * - Bit 10: D-Pad Left - * - Bit 11: D-Pad Down - * - Bit 12: Select - * - Bit 13: Steam/Home - * - Bit 14: Start - * - Bit 15: L5 - * - Bit 16: R5 - * - Bit 17: Left Touchpad Click - * - Bit 18: Right Touchpad Click - * - Bit 19: Left Touchpad Touch - * - Bit 20: Right Touchpad Touch - * - Bit 21: Unknown (@todo Please provide more details if known) - * - Bit 22: L3 - * - Bit 23-25: Unknown (@todo Please provide more details if known) - * - Bit 26: R3 - * - Bit 27-28: Unknown (@todo Please provide more details if known) - * - Bit 29: Mute (Dualsense) - * - Bit 30-31: Unknown (@todo Please provide more details if known) - */ - ulButtons: number; - sLeftPadX: number; - sLeftPadY: number; - sRightPadX: number; - sRightPadY: number; - sCenterPadX: number; - sCenterPadY: number; - sLeftStickX: number; - sLeftStickY: number; - sRightStickX: number; - sRightStickY: number; - sTriggerL: number; - sTriggerR: number; - flDriftCorrectedQuatW: number; - flDriftCorrectedQuatX: number; - flDriftCorrectedQuatY: number; - flDriftCorrectedQuatZ: number; - flSensorFusionGyroQuatW: number; - flSensorFusionGyroQuatX: number; - flSensorFusionGyroQuatY: number; - flSensorFusionGyroQuatZ: number; - flDeferredSensorFusionGyroQuatW: number; - flDeferredSensorFusionGyroQuatX: number; - flDeferredSensorFusionGyroQuatY: number; - flDeferredSensorFusionGyroQuatZ: number; - flGyroDegreesPerSecondX: number; - flGyroDegreesPerSecondY: number; - flGyroDegreesPerSecondZ: number; - flGravityVectorX: number; - flGravityVectorY: number; - flGravityVectorZ: number; - flAccelerometerNoiseLength: number; - flGyroNoiseLength: number; - flGyroCalibrationProgress: number; - sBatteryLevel: number; - sPressurePadLeft: number; - sPressurePadRight: number; - sPressureBumperLeft: number; - sPressureBumperRight: number; - unHardwareUpdateInMicrosec: number; -} - -export interface ActiveAccount { - strActiveAccountID: string; - strName: string; - strAvatarHash: string; -} - -export interface ControllerInfo { - strName: string; - eControllerType: ControllerType; - nXInputIndex: number; - nControllerIndex: number; - eRumblePreference: number; // ControllerRumbleSetting - bWireless: boolean; - unUniqueID: number; - unVendorID: number; - unProductID: number; - unCapabilities: number; - strFirmwareBuildTime: string; - strSerialNumber: string; - strChipID: string; - nLEDColorR: number; - nLEDColorG: number; - nLEDColorB: number; - flLEDBrightness: number; - flLEDSaturation: number; - nTurnOnSound: number; - nTurnOffSound: number; - nLStickDeadzone: number; - nRStickDeadzone: number; - nLHapticStrength: number; - nRHapticStrength: number; - flLPadPressureCurve: number; - flRPadPressureCurve: number; - bHaptics: boolean; - bSWAntiDrift: boolean; - flGyroStationaryTolerance: number; - flAccelerometerStationaryTolerance: number; - bRemoteDevice: boolean; - bNintendoLayout: boolean; - bUseReversedLayout: boolean; - ActiveAccount: ActiveAccount | undefined; - vecAltAccounts: any[]; // The type for this property might need to be more specific based on the actual data structure -} - -export interface TouchMenuMessage { - bHasVirtualMenus: boolean; - unControllerIndex: number; - appID: number; -} - -export interface ControllerCommandMessage { - /** - * @todo enum - */ - eAction: number; - nControllerIndex: number; -} - -export interface ControllerInputMessage { - nA: number; - bS: boolean; - nC: number; -} - -export interface ControllerAnalogInputMessage { - nA: number; - x: number; - y: number; - nC: number; -} - -export interface CoplayUser { - accountid: number; - rtTimePlayed: number; - appid: number; -} - -export interface FriendSettingsFeature { - feature: string; - bEnabled: boolean; -} - -export interface FriendSettingsEnabledFeature { - DoNotDisturb: number; - LoaderWindowSynchronization: number; - NonFriendMessageHandling: number; - NewVoiceHotKeyState: number; - PersonaNotifications: number; - ServerVirtualizedMemberLists: number; - SteamworksChatAPI: number; - FriendsFilter: number; -} - -export interface FriendSettingsChange { - bNotifications_ShowIngame: number; - bNotifications_ShowOnline: number; - bNotifications_ShowMessage: number; - bNotifications_EventsAndAnnouncements: number; - bSounds_PlayIngame: number; - bSounds_PlayOnline: number; - bSounds_PlayMessage: number; - bSounds_EventsAndAnnouncements: number; - bAlwaysNewChatWindow: number; - bForceAlphabeticFriendSorting: number; - nChatFlashMode: number; - bRememberOpenChats: number; - bCompactQuickAccess: number; - bCompactFriendsList: number; - bNotifications_ShowChatRoomNotification: number; - bSounds_PlayChatRoomNotification: number; - bHideOfflineFriendsInTagGroups: number; - bHideCategorizedFriends: number; - bCategorizeInGameFriendsByGame: number; - nChatFontSize: number; - b24HourClock: number; - bDoNotDisturbMode: number; - bDisableEmbedInlining: number; - bSignIntoFriends: number; - bDisableSpellcheck: number; - bDisableRoomEffects: number; - bAnimatedAvatars: number; - featuresEnabled: FriendSettingsEnabledFeature; -} - -export interface ProxyInfo { - proxy_mode: number; - address: string; - port: number; - exclude_local: boolean; -} - -export interface RemotePlayDevice { - clientName: string; - status: string; // "Connected", "Paired", - formFactor: number; - unStreamingSessionID: number; - bCanSuspend: boolean; -} - -export interface RemotePlaySettings { - bRemotePlaySupported: boolean; - bRemotePlayEnabled: boolean; - eRemotePlayP2PScope: EStreamP2PScope; - bRemotePlayServerConfigAvailable: boolean; - bRemotePlayServerConfigEnabled: boolean; - RemotePlayServerConfig: any; // todo: document {} - bRemotePlayClientConfigEnabled: boolean; - unStreamingSessionID: number; - strStreamingClientName: string; - RemotePlayClientConfig: any; // todo: document {} - nDefaultAudioChannels: number; - bDefaultEncodeNVIDIA: boolean; - bDefaultEncodeAMD: boolean; - bDefaultEncodeIntel: boolean; - nAutomaticResolutionX: number; - nAutomaticResolutionY: number; -} - -export interface GameAction { - nGameActionID: number; - gameid: string; - strActionName: AppAction; - strTaskName: LaunchAppTask; - strTaskDetails: string; - nLaunchOption: number; - nSecondsRemaing: number; //fixme: not a typo, actually valve - strNumDone: string; - strNumTotal: string; - bWaitingForUI: boolean; -} - -export interface MoveContentProgress { - appid: number; - eError: AppUpdateError; - flProgress: number; - strBytesMoved: string; - strTotalBytesToMove: string; - nFilesMoved: number; -} - -export interface FolderChange { - folderIndex: number; -} - -export interface MusicTrack { - uSoundtrackAppId: number; - ePlaybackStatus: EMusicPlaybackStatus; - eRepeatStatus: EMusicRepeatStatus; - bShuffle: boolean; - nVolume: number; - nActiveTrack: number; - nLengthInMsec: number; -} - -export interface SoundtrackDetails { - tracks: Track[]; - metadata: SoundtrackMetadata; - vecAdditionalImageAssetURLs: string[]; - strCoverImageAssetURL: string; -} - -export interface StoreTagLocalization { - tag: number; - string: string; -} - -export interface SoundtrackMetadata { - artist: string; -} - -export interface Track { - discNumber: number; - trackNumber: number; - durationSeconds: number; - trackDisplayName: string; -} - -export interface EndUserLicenseAgreement { - id: string; - url: string; - version: number; -} - -export interface BroadcastStatus { - broadcastid: string; - nViewers: number; - nRequests: number; - bIsBroadcasting: boolean; - bIsRecordingDesktop: boolean; - eBroadcastReady: Result; - bBroadcastCapable: boolean; - bMicrophoneEnabled: boolean; - bMicrophoneActive: boolean; - nCurrentFPS: number; - nUploadKbps: number; -} - -export interface OverlayBrowserProtocols { - unAppID: number; - strScheme: string; - bAdded: boolean; -} - -export interface LaunchOption { - /** - * @remarks This is an integer, despite the prefix. 0 if false, 1 if true. - */ - bIsLaunchOptionTypeExemptFromGameTheater: number; - /** - * @remarks This is an integer, despite the prefix. 0 if false, 1 if true. - */ - bIsVRLaunchOption: number; - eType: AppLaunchOptionType; - nIndex: number; - /** - * Label localization string. - */ - strDescription: string; - strGameName: string; -} - -/** - * Represents information about a Bluetooth adapter. - */ -export interface BluetoothAdapter { - /** - * The unique identifier of the Bluetooth adapter. - */ - nId: number; - - /** - * The MAC address of the Bluetooth adapter. - */ - sMAC: string; - - /** - * The name of the Bluetooth adapter. - */ - sName: string; - - /** - * Indicates whether the Bluetooth adapter is enabled. - */ - bEnabled: boolean; - - /** - * Indicates whether the Bluetooth adapter is in discovering mode. - */ - bDiscovering: boolean; -} - -/** - * Represents information about a Bluetooth device. - */ -export interface BluetoothDevice { - /** - * The unique identifier of the Bluetooth device. - */ - nId: number; - - /** - * The ID of the Bluetooth adapter to which this device is discovered by / connected to. - */ - nAdapterId: number; - - /** - * The type of the Bluetooth device (e.g., headphones, mouse, keyboard). - */ - eType: BluetoothDeviceType; - - /** - * The MAC address of the Bluetooth device. - */ - sMAC: string; - - /** - * The name of the Bluetooth device. - */ - sName: string; - - /** - * Indicates whether the Bluetooth device is currently connected to the adapter. - */ - bConnected: boolean; - - /** - * Indicates whether the Bluetooth device is paired to the adapter. - */ - bPaired: boolean; - - /** - * The raw signal strength of the Bluetooth device. - */ - nStrengthRaw: number; -} - -/** - * Represents a change in the state of Bluetooth adapters and devices. - */ -export interface BluetoothStateChange { - /** - * An array of Bluetooth adapters with their current state. - */ - vecAdapters: BluetoothAdapter[]; - - /** - * An array of Bluetooth devices with their current state. - */ - vecDevices: BluetoothDevice[]; - - /** - * Indicates whether Bluetooth is enabled (`true`) or disabled (`false`). - */ - bEnabled: boolean; -} - -/** - * Represents the response of an operation. It appears to be not necessary to await for this operation response. It is only used to indicate the result of an operation. - */ -export interface OperationResponse { - /** - * The result code of the operation. - */ - result: Result; - - /** - * A message describing the result of the operation. - */ - message: string; -} - -export interface SystemReportReply extends OperationResponse { - /** - * If deserialized, returns {@link MsgGenerateSystemReportReply}. - */ - reply: ArrayBuffer; -} - -/** - * Represents details about a single screenshot upload. - */ -export interface DetailsForScreenshotUpload { - /** - * The size of the screenshot upload on disk (including thumbnail). - */ - strSizeOnDisk: string; - - /** - * The amount of cloud storage available. - */ - strCloudAvailable: string; - - /** - * The total cloud storage. - */ - strCloudTotal: string; -} - -/** - * Represents details about multiple screenshot uploads. - */ -export interface DetailsForScreenshotUploads { - /** - * The total size of all screenshot uploads on disk (sum of sizes including thumbnails). - */ - unSizeOnDisk: number; - - /** - * The amount of cloud storage available. - */ - strCloudAvailable: string; - - /** - * The total cloud storage. - */ - strCloudTotal: string; -} - -/** - * Represents details about an application audio session. - */ -export interface ApplicationAudio { - /** - * The ID of the application audio. - */ - id: number; - - /** - * The name of the application (e.g., Spotify, YouTube from a browser, etc.). - */ - strName: string; - - /** - * The volume level of the application (floating point value between 0 and 1). - */ - flVolume: number; -} - -/** - * Represents details about an array of application audio sessions. - */ -export interface ApplicationsAudio { - /** - * An array of application audio sessions. - */ - apps: ApplicationAudio[]; -} - -/** - * Represents details about an audio device. - */ -export interface Device { - /** - * The identifier of the audio device. - */ - id: number; - - /** - * The name of the audio device. - */ - sName: string; - - /** - * Indicates if the device has audio output. - */ - bHasOutput: boolean; - - /** - * Indicates if the device is the default output device. - */ - bIsDefaultOutputDevice: boolean; - - /** - * The volume level of the audio output device (floating point value between 0 and 1). - */ - flOutputVolume: number; - - /** - * Indicates if the device has audio input. - */ - bHasInput: boolean; - - /** - * Indicates if the device is the default input device. - */ - bIsDefaultInputDevice: boolean; - - /** - * The volume level of the audio input device (floating point value between 0 and 1). - */ - flInputVolume: number; -} - -/** - * Represents details about audio devices and information about the active audio device. - */ -export interface AudioDeviceInfo { - /** - * The ID of the active output audio device. - */ - activeOutputDeviceId: number; - - /** - * The ID of the active input audio device. - */ - activeInputDeviceId: number; - - /** - * The ID of the overridden output audio device (-1 if not overridden). - */ - overrideOutputDeviceId: number; - - /** - * The ID of the overridden input audio device (-1 if not overridden). - */ - overrideInputDeviceId: number; - - /** - * An array of audio devices. - */ - vecDevices: Device[]; -} - -export interface BatteryStateChange { - bHasBattery: boolean; - eACState: ACState; - eBatteryState: BatteryState; - flLevel: number; // Battery Percentage in floating point 0-1 - nSecondsRemaining: number; // Appears to be charge time remaining or time remaining on battery - bShutdownRequested: boolean; -} - -export interface OSBranch { - eBranch: OSBranchType; // 1 - Stable - sRawName: string; -} - -export interface LoginUser { - personaName: string; - accountName: string; - rememberPassword: boolean; - avatarUrl: string; -} - -export interface ConnectionAttempt { - rtCooldownExpiration: number; -} - -export interface CurrentUser { - NotificationCounts: { - async_game_updates: number; - comments: number; - gifts: number; - help_request_replies: number; - inventory_items: number; - invites: number; - moderator_messages: number; - offline_messages: number; - trade_offers: number; - }; - bHWSurveyPending: boolean; - bIsLimited: boolean; - bIsOfflineMode: boolean; - bPromptToChangePassword: boolean; - bSupportAckOnlyMessages: boolean; - bSupportAlertActive: boolean; - bSupportPopupMessage: boolean; - clientinstanceid: string; - strAccountBalance: string; - strAccountBalancePending: string; - strAccountName: string; - strFamilyGroupID: string; - strSteamID: string; -} - -export interface SurveyEntry { - strName: string; - vecArgs: string[]; -} - -export interface SurveySection { - strSectionName: string; - vecEntries: SurveyEntry[]; -} - -export interface GameKeyboardMessage { - m_bOpen: boolean; - nAppID: number; - m_dwPID: number; - m_dwOverlayPID: number; - m_hPipe: number; - m_eInputMode: number; - m_eLineInputMode: number; - m_pchDescription: string; - m_unCharMax: number; - m_pchExistingText: string; -} - -export interface ControllerConfigInfoMessage { - appID: number; -} - -export interface ControllerConfigInfoMessageQuery extends ControllerConfigInfoMessage { - bPersonalQueryDone: boolean; -} - -export interface ControllerConfigInfoMessageList extends ControllerConfigInfoMessage { - nControllerType: number; - publishedFileID: string; - accountID: number; - Title: string; - Description: string; - URL: string; - timeUpdated: string; - bOfficial: boolean; - bProgenitorOfficial: boolean; - bRecommended: boolean; - bProgenitorRecommended: boolean; - bUsesSIAPI: boolean; - bUsesMouse: boolean; - bUsesKeyboard: boolean; - bUsesGamepad: boolean; - /** - * @todo unconfirmed - */ - eExportType: EControllerConfigExportType; - playtime: string; - bSelected: boolean; -} - -export interface ControllerConfigCloudStateChange { - bSyncDone: boolean; - bSyncConflict: boolean; - bSyncError: boolean; -} - -export interface TouchGesture { - eTouchGesture: TouchGestureType; - x: number; - y: number; -} - -export interface BrowserViewInit { - bOnlyAllowTrustedPopups?: boolean; - parentPopupBrowserID?: number; - /** Initial URL to go to. */ - strInitialURL?: string; - strUserAgentIdentifier?: string; - strUserAgentOverride?: string; - strVROverlayKey?: string; -} - -export interface BrowserViewPopup { - /** - * Blur the popup. - * @param {boolean} enabled - Is the blur enabled? - * @param {boolean} backgroundColor - * @param {boolean} blur - * @returns {void} - * @todo backgroundColor is a bool? Whatever that means - */ - AddGlass(enabled: boolean, backgroundColor: boolean, blur: boolean): void; - - /** - * Indicates whether you can go backward in history or not. - * @returns {boolean} true if you can go backward in history, false otherwise. - */ - CanGoBackward(): boolean; - - /** - * Indicates whether you can go forward in history or not. - * @returns {boolean} true if you can go forward in history, false otherwise. - */ - CanGoForward(): boolean; - - // alert() i assume - DialogResponse(param0: boolean): void; - - EnableSteamInput(): void; - - /** - * Find a string in the page. - * @param {string} input - The string to find. - * @param {boolean} param1 - Additional parameter (exact usage may vary). - * @param {boolean} previous - `true` for previous match, `false` for next match. - * @returns {void} - */ - FindInPage(input: string, param1: boolean, previous: boolean): void; - - /** - * Get the current popup position. - * @returns {BrowserViewBounds} The window position. - */ - GetBounds(): BrowserViewBounds; - - /** - * Go back in history. - * @returns {void} - */ - GoBack(): void; - - /** - * Go forward in history. - * @returns {void} - */ - GoForward(): void; - - /** - * @remarks `| number` is used for `BrowserViewContextMenu.custom_commands`. - */ - HandleContextMenuCommand(command: BrowserViewContextMenuCommand | number, param2: BrowserViewContextMenu): void; - - /** - * Load the specified URL. - * @param {string} url - The URL to go to. - * @returns {void} - */ - LoadURL(url: string): void; - - NotifyUserActivation(): void; - - /** - * Paste the current clipboard selection. - * @returns {void} - */ - Paste(): void; - - PostMessage(message: string, args: string): boolean; - - /** - * Reload the page. - * @returns {void} - */ - Reload(): void; - - /** - * Load the specified URL, but don't save history. - * @param {string} url - The URL to go to. - * @returns {void} - */ - ReplaceURL(url: string): void; - - /** - * Define blocked protocols, like https, etc. - * @param protocols The protocols to block, separated by a semicolon. - * @returns {void} - */ - SetBlockedProtocols(protocols: string): void; - - /** - * Sets the browser window position. - * @param {number} x - Browser window X position. - * @param {number} y - Browser window Y position. - * @param {number} width - Browser window width. - * @param {number} height - Browser window height. - * @returns {void} - */ - SetBounds(x: number, y: number, width: number, height: number): void; - - /** - * Sets the browser window focus state. - * @param {boolean} value - Is the window focused? - * @returns {void} - */ - SetFocus(value: boolean): void; - - SetName(browserName: string): void; - - /** - * Registers a callback to be called when a context menu is shown. - * @param {function} callback - The callback function to be called. - */ - SetShowContextMenuCallback(callback: (data: BrowserViewContextMenu) => void): void; - - /** - * Registers a callback to be called when a steam:// protocol URL is loaded. - * @returns {void} - */ - SetSteamURLCallback(callback: (steamURL: string) => void): void; - - /** - * Raises the browser window. - * @returns {void} - */ - SetTopWindow(): void; - - /** - * @todo unconfirmed - */ - SetTouchGesturesToCancel(gestures: TouchGestureType[]): void; - - SetVRKeyboardVisibility(value: boolean): void; - - SetVisible(value: boolean): void; - - /** - * Stop the "find in page" function. - * @returns {void} - */ - StopFindInPage(): void; - - /** - * Stop listening for an event. - * @param {BrowserViewEvent} event - The event to stop listening to. - * @param {function} callback - The callback function to be called. - * @returns {void} - */ - off(event: BrowserViewEvent, callback: (args: any) => void): void; - - /** - * Start listening for an event. - * @param {BrowserViewEvent} event - The event to start listening to. - * @param {function} callback - The callback function to be called. - * @returns {void} - */ - on(event: BrowserViewEvent, callback: (args: any) => void): void; - - /** - * Fires when an `alert()` dialog appears. - */ - on(event: 'alert-dialog', callback: (message: string) => void): void; - - /** - * Fires when the browser is about to get destroyed. - */ - on(event: 'before-close', callback: () => void): void; - - /** - * Fires when a URL gets blocked. - * @todo not SetBlockedProtocols, maybe only steam links - */ - on(event: 'blocked-request', callback: (blockedURL: string) => void): void; - - /** - * Fires when `CanGoBack() or `CanGoForward()` state changes. - */ - on(event: 'can-go-back-forward-changed', callback: (canGoBackward: boolean, canGoForward: boolean) => void): void; - - /** - * Fires when a `confirm()` dialog appears. - */ - on(event: 'confirm-dialog', callback: (message: string) => void): void; - - /** - * Fires when the browser's favicon changes. - */ - on(event: 'favicon-urls-changed', callback: (faviconURLs: string[]) => void): void; - - /** - * Fires when "Find in page" gets its results. - */ - on(event: 'find-in-page-results', callback: (results: number, activeResultIndex: number) => void): void; - - /** - * Fires when the page finishes loading. - */ - on(event: 'finished-request', callback: (currentURL: string, previousURL: string) => void): void; - - /** - * Fires when the browser goes focused or vice versa. - */ - on(event: 'focus-changed', callback: (focused: boolean) => void): void; - - /** - * Fires when the browser goes fullscreen or vice versa. - */ - on(event: 'full-screen', callback: (fullscreen: boolean) => void): void; - - /** - * Fires when history changes occur. - */ - on(event: 'history-changed', callback: (history: BrowserViewHistory) => void): void; - - /** - * Fires when the URL fails to load. - */ - on(event: 'load-error', callback: (errorCode: number, errorURL: string, errorDescription: string) => void): void; - - /** - * @todo Same as PostMessage? - */ - on(event: 'message', callback: (args: any) => void): void; - - on(event: 'new-tab', callback: (args: any) => void): void; - - /** - * Fires when a node gets focused. - */ - on( - event: 'node-has-focus', - callback: ( - elementIdOrTagName: string, - elementTag: string, - param2: any, - param3: string, - param4: boolean, - ) => void, - ): void; - - on(event: 'page-security', callback: (url: string, pageSecurity: BrowserViewPageSecurity) => void): void; - - /** - * Fires when the page's `<title>` changes. - */ - on(event: 'set-title', callback: (title: string) => void): void; - - /** - * Fires when the page starts loading. - */ - on(event: 'start-loading', callback: (url: string, param1: boolean) => void): void; - - /** - * Fires when the page starts loading. - */ - on(event: 'start-request', callback: (url: string) => void): void; - - /** - * Fires when "Find in page" gets toggled. - */ - on(event: 'toggle-find-in-page', callback: () => void): void; -} - -export interface BrowserViewBounds { - x: number; - y: number; - width: number; - height: number; -} - -export interface BrowserViewContextMenuCustomCommand { - id: number; - label: string; -} - -export interface BrowserViewContextMenu { - /** - * Mouse X position inside the browser view. - */ - coord_x: number; - /** - * Mouse Y position inside the browser view. - */ - coord_y: number; - custom_commands: BrowserViewContextMenuCustomCommand[]; - /** - * Bitmask representing edit state. - * @remarks Appears on editable elements like `<input>`, etc. - * @example - * May be used with BrowserViewContextMenuEditFlag: - * ```js - * edit_state_flags & BrowserViewContextMenuEditFlag.CanCut != 0 // Can cut text - * ``` - */ - edit_state_flags?: number; - /** - * The misspelled word the cursor is on. - * @remarks Appears on an editable element with text. - */ - misspelled_word?: string; - /** - * Browser page URL. - * @todo Appears when there is selected text? - */ - link_url?: string; - /** - * Browser page URL. - */ - page_url: string; - /** - * Selected text. - * @remarks Appears when there is selected text. - */ - selection_text?: string; - /** - * Bitmask representing context menu type. - * @example - * May be used with BrowserViewContextMenuTypeFlag: - * ```js - * type_flags & BrowserViewContextMenuTypeFlag.Selection != 0 // Selected text present - * ``` - */ - type_flags: number; - /** - * Browser page URL. - * @todo Appears when there is selected text? - */ - unfiltered_link_url?: string; -} - -export interface BrowserViewHistoryEntry { - url: string; -} - -export interface BrowserViewHistory { - index: number; - entries: BrowserViewHistoryEntry[]; -} - -export interface BrowserViewPageSecurity { - bHasCertError: boolean; - bIsEVCert: boolean; - bIsSecure: boolean; - certExpiry: number; - certName: string; - issuerName: string; - nCertBits: number; -} - -export interface ServerBrowserGame { - /** The ID of the game. */ - appid: number; - /** The ID of the game. */ - gameid: string; - /** The game folder. */ - gamedir: string; - /** The game's name. */ - name: string; -} - -export interface ServerBrowserGameFilter { - /** Has users playing */ - NoEmpty: boolean; - /** Server not full */ - NoFull: boolean; - /** Is not password protected */ - NoPassword: boolean; - /** Anti-cheat */ - Secure: ServerBrowserGameFilterAntiCheat; - /** The ID of the game */ - appid: number; - /** The game folder */ - game: string; - /** Map filter */ - map: string; - /** Latency */ - ping: ServerBrowserGameFilterPing; -} - -export interface ServerBrowserServer { - /** The ID of the game. */ - appid: number; - /** The server IP. */ - ip: string; - /** The server port. */ - port: number; - queryPort: number; - /** Last time played as a UNIX timestamp. */ - lastPlayed: number; -} - -export interface ServerBrowserServerFull extends ServerBrowserServer { - /** Do not refresh if had unsuccessful response? */ - bDoNotRefresh: boolean; - /** Found the server? */ - bHadSuccessfulResponse: boolean; - /** Has password? */ - bPassword: boolean; - /** Is VAC secured? */ - bSecure: boolean; - /** How many bot players there currently are. */ - botPlayers: number; - /** The server's game name/description. */ - gameDesc: string; - /** The game folder. */ - gameDir: string; - /** Server tags, separated by a comma. */ - gameTags: string; - /** Current server map. */ - map: string; - /** Max players on the server. */ - maxPlayers: number; - /** The server name. */ - name: string; - /** The latency to the server. */ - ping: number; - /** How many players there currently are. */ - players: number; - /** The server's game version it is running on. */ - serverVersion: number; - steamID: string; -} - -export interface ServerBrowserFriendServer { - /** The ID of the game. */ - appid: number; - /** Non-Steam server? */ - bNonSteamServer: boolean; - gameText: string; - /** The ID of the game. */ - gameid: string; - steamIDLobby: string; -} - -export interface ServerBrowserFavoritesAndHistory { - favorites: ServerBrowserServer[]; - history: ServerBrowserServer[]; -} - -export interface ServerBrowserPlayerRefreshStatus { - bSuccess: boolean; - bRefreshComplete: boolean; -} - -export interface ServerBrowserPlayer extends ServerBrowserPlayerRefreshStatus { - /** Player name. */ - playerName: string; - /** Player score. */ - score: number; - /** Time played on the server. */ - timePlayed: number; -} - -export interface ServerBrowserPreferences { - GameList: string; - filters: ServerBrowserTabFilters; -} - -export interface ServerBrowserTabFilters { - favorites: ServerBrowserGameFilter; - friends: ServerBrowserGameFilter; - history: ServerBrowserGameFilter; - internet: ServerBrowserGameFilter; - lan: ServerBrowserGameFilter; -} - -export interface ServerBrowserDialog { - dialogID: number; - ip: number; - port: number; - queryPort: number; -} - -export interface FileDialog { - /** Whether to choose a directory instead. */ - bChooseDirectory?: boolean; - /** - * Array of file filters. - * @example - * Example from the "Add a Non-Steam Game" dialog: - * ``` - * [ - * { - * strFileTypeName: LocalizationManager.LocalizeString("#AddNonSteam_Filter_Exe_Linux"), - * rFilePatterns: [ "*.application", "*.exe", "*.sh", "*.AppImage" ], - * bUseAsDefault: true, - * }, - * { - * strFileTypeName: LocalizationManager.LocalizeString("#AddNonSteam_Filter_All"), - * rFilePatterns: [ "*" ], - * } - * ] - * ``` - */ - rgFilters?: FileDialogFilter[]; - /** Initially selected file. */ - strInitialFile?: string; - /** Window title. */ - strTitle?: string; -} - -export interface FileDialogFilter { - /** A localization string for the file type. */ - strFileTypeName: string; - /** - * File patterns. - * @example [ "*.application", "*.exe", "*.sh", "*.AppImage" ] - */ - rFilePatterns: string[]; - /** Whether to use this filter by default. */ - bUseAsDefault?: boolean; -} - -export interface OSEndOfLifeInfo { - bOSWillBeUnsupported: boolean; - osType: OSType; -} - -export interface SteamURL { - url: string; - /** - * @todo enum? - */ - feature: number; -} - -export interface SteamURLs { - CommunityImages: SteamURL; - StoreAppImages: SteamURL; - BaseURLSharedCDN: SteamURL; - ClanAssetCDN: SteamURL; - CommunityCDN: SteamURL; - AvatarBaseURL: SteamURL; - StoreCDN: SteamURL; - WebAPI: SteamURL; - LocalSSA: SteamURL; -} - -export interface SteamWindow { - appid: number; - hwndParent: number; - nBrowserID: number; - strAppName: string; - unID: number; - unPID: number; - /** - * @todo enum - */ - windowType: number; - x: number; - y: number; -} - -export interface TransportInfo { - authKeyClientdll: string; - authKeySteamUI: string; - portClientdll: number; - portSteamUI: number; -} - -export interface FriendChatDialog { - browserid: number; - btakefocus: string; - command: string; - pid: number; - steamid: string; -} - -export interface FriendChatDialogData { - data: FriendChatDialog; -} - -export interface PushToTalkInfo { - /** Indicates whether push-to-talk is enabled. */ - bEnabled: boolean; - /** Indicates whether push-to-mute is in use instead. */ - bPushToMute: boolean; - /** - * Push-to-talk hotkey. - * @todo enum? - */ - vkHotKey: number; - /** Push-to-talk hotkey name. */ - strKeyName: string; -} - -export interface NotificationOptions { - body: string; - chatroomgroupid?: number; - chatroomid?: number; - icon?: string; - state: string; - /** A Steam64 ID. */ - steamid: string; - tag?: string; - title?: string; -} - -export interface LogonInfo { - bLoggedOn: boolean; - eUniverse: SteamRealm; - strAccountName: string; - strCommunityImagesURL: string; - strPersonaName: string; - /** Steam64 ID. */ - strSteamid: string; - /** Country code. */ - strUserCountry: string; -} - -export interface OverlayBrowserInfo { - appID: number; - eBrowserType: BrowserType; - eUIMode: UIMode; - flDisplayScale?: number; - gameID: string; - nBrowserID: number; - nScreenHeight: number; - nScreenWidth: number; - /** - * The PID of the overlay process. - */ - unPID: number; -} - -export interface GameWindowInfo { - bCanClose: boolean; - strTitle: string; - windowid: number; -} - -export interface FocusedApp { - appid: number; - pid: number; - windowid: number; - strExeName: string; -} - -export interface FocusChangeEvent { - focusedApp: FocusedApp; - rgFocusable: FocusedApp[]; -} - -export interface AppBootstrapData { - appid: number; - hidden: boolean; - user_tag: string[]; -} - -export interface UpdateApplyResult { - type: UpdaterType; - eresult: Result; - requires_client_restart: boolean; - requires_system_restart: boolean; -} - -export interface UpdateCheckResult { - type: UpdaterType; - eresult: Result; - rtime_checked: number; - available: boolean; -} - -export interface UpdateProgress { - stage_progress: number | undefined; - stage_size_bytes: number | undefined; - rtime_estimated_completion: number | undefined; -} - -export interface SystemPerfNetworkInterface { - name: string | undefined; - timestamp: number | undefined; - tx_bytes_total: number | undefined; - rx_bytes_total: number | undefined; - tx_bytes_per_sec: number | undefined; - rx_bytes_per_sec: number | undefined; -} - -export interface SystemPerfDiagnosticEntry { - name: string | undefined; - value: string | undefined; -} - -export interface NetworkDeviceIPv4Address { - ip: number; - netmask: number; -} - -export interface NetworkDeviceIPv6Address { - ip: string; -} - -export interface NetworkDeviceIP { - dns_ip: number[]; - gateway_ip: number; - is_default_route: boolean; - is_dhcp_enabled: boolean; - is_enabled: boolean; -} - -export interface NetworkDeviceIPv4 extends NetworkDeviceIP { - addresses: NetworkDeviceIPv4Address[]; -} - -export interface NetworkDeviceIPv6 extends NetworkDeviceIP { - addresses: NetworkDeviceIPv6Address[]; -} - -export interface WirelessAP { - esecurity: WirelessAPSecurityFlags; - estrength: WirelessAPStrength; - id: number; - is_active: boolean; - is_autoconnect: boolean; - password: string; - ssid: string; - strength_raw: number; - user_name?: string; -} - -export interface NetworkDevice_Wireless { - aps: WirelessAP[]; - /** - * @remarks Not present if wired. - * @todo enum - */ - esecurity_supported?: number; -} - -export interface NetworkDevice_Wired { - friendly_name: string; - is_cable_present: boolean; - speed_mbit: number; -} - -export interface NetworkDevice { - estate: NetworkDeviceState; - etype: NetworkDeviceType; - id: number; - ipv4: NetworkDeviceIPv4; - ipv6: NetworkDeviceIPv6; - mac: string; - product: string; - vendor: string; - /** - * @remarks Present only if wired. - */ - wired?: NetworkDevice_Wired; - /** - * @remarks Present even if wired. - */ - wireless: NetworkDevice_Wireless; -} - -export interface Hotkey { - alt_key: boolean; - ctrl_key: boolean; - display_name: string; - key_code: number; - meta_key: boolean; - shift_key: boolean; -} - -/** - * @todo Doesn't work on Linux ? - */ -export interface Monitor { - monitor_device_name: string; - monitor_display_name: string; -} - -export interface SystemDockUpdateState { - state: UpdaterState | undefined; - rtime_last_checked: number | undefined; - version_current: string | undefined; - version_available: string | undefined; - stage_progress: number | undefined; - rtime_estimated_completion: number | undefined; - old_fw_workaround: number | undefined; -} - -export interface SystemPerfLimits { - cpu_governor_manual_min_mhz: number | undefined; - cpu_governor_manual_max_mhz: number | undefined; - fsr_sharpness_min: number | undefined; - fsr_sharpness_max: number | undefined; - gpu_performance_manual_min_mhz: number | undefined; - gpu_performance_manual_max_mhz: number | undefined; - perf_overlay_is_standalone: boolean | undefined; - is_dynamic_vrs_available: boolean | undefined; - is_manual_display_refresh_rate_available: boolean | undefined; - gpu_performance_levels_available: GPUPerformanceLevel[]; - display_refresh_manual_hz_min: number | undefined; - display_refresh_manual_hz_max: number | undefined; - fps_limit_options: number[] | undefined; - tdp_limit_min: number | undefined; - tdp_limit_max: number | undefined; - is_nis_supported: boolean | undefined; - nis_sharpness_min: number | undefined; - nis_sharpness_max: number | undefined; - display_external_refresh_manual_hz_min: number | undefined; - display_external_refresh_manual_hz_max: number | undefined; - fps_limit_options_external: number[] | undefined; - is_tearing_supported: boolean | undefined; - is_vrr_supported: boolean | undefined; - is_dynamic_refresh_rate_in_steam_supported: boolean | undefined; - is_split_scaling_and_filtering_supported: boolean | undefined; - split_scaling_filters_available: SplitScalingFilter[]; - split_scaling_scalers_available: SplitScalingScaler[]; - is_hdr_supported: boolean | undefined; - display_refresh_manual_hz_oc_max: number | undefined; - disable_refresh_rate_management: boolean | undefined; -} - -export interface SystemPerfSettingsGlobal { - diagnostic_update_rate: number; - system_trace_service_state: SystemServiceState; - graphics_profiling_service_state: SystemServiceState; - perf_overlay_service_state: SystemServiceState; - perf_overlay_level: GraphicsPerfOverlayLevel; - is_show_perf_overlay_over_steam_enabled: boolean; - is_advanced_settings_enabled: boolean; - allow_external_display_refresh_control: boolean; - is_hdr_enabled: boolean; - hdr_on_sdr_tonemap_operator: HDRToneMapOperator; - is_hdr_debug_heatmap_enabled: boolean; - force_hdr_wide_gammut_for_sdr: boolean; - allow_experimental_hdr: boolean; - sdr_to_hdr_brightness: number; - debug_force_hdr_support: boolean; - force_hdr_10pq_output_debug: boolean; - is_display_oc_enabled: boolean; - is_color_management_enabled: boolean; -} - -export interface SystemPerfSettingsPerApp { - gpu_performance_manual_mhz: number | undefined; - fps_limit: number | undefined; - is_variable_resolution_enabled: boolean | undefined; - is_dynamic_refresh_rate_enabled: boolean | undefined; - tdp_limit: number | undefined; - cpu_governor: CPUGovernor | undefined; - cpu_governor_manual_mhz: number | undefined; - scaling_filter: number | undefined; - fsr_sharpness: number | undefined; - is_fps_limit_enabled: boolean | undefined; - is_tdp_limit_enabled: boolean | undefined; - is_low_latency_mode_enabled: boolean | undefined; - display_refresh_manual_hz: number | undefined; - is_game_perf_profile_enabled: boolean | undefined; - gpu_performance_level: GPUPerformanceLevel | undefined; - nis_sharpness: number | undefined; - display_external_refresh_manual_hz: number | undefined; - fps_limit_external: number | undefined; - is_tearing_enabled: boolean | undefined; - is_vrr_enabled: boolean | undefined; - is_composite_debug_enabled: boolean | undefined; - force_composite: boolean | undefined; - use_dynamic_refresh_rate_in_steam: boolean | undefined; - split_scaling_filter: SplitScalingFilter | undefined; - split_scaling_scaler: SplitScalingScaler | undefined; -} - -export interface SystemPerfSettings { - global: SystemPerfSettingsGlobal | undefined; - per_app: SystemPerfSettingsPerApp | undefined; -} - -export interface SteamDatagramLinkInstantaneousStats { - out_packets_per_sec_x10: number | undefined; - out_bytes_per_sec: number | undefined; - in_packets_per_sec_x10: number | undefined; - in_bytes_per_sec: number | undefined; - ping_ms: number | undefined; - packets_dropped_pct: number | undefined; - packets_weird_sequence_pct: number | undefined; - peak_jitter_usec: number | undefined; -} - -export interface SteamDatagramLinkLifetimeStats { - connected_seconds: number | undefined; - packets_sent: number | undefined; - kb_sent: number | undefined; - packets_recv: number | undefined; - kb_recv: number | undefined; - packets_recv_sequenced: number | undefined; - packets_recv_dropped: number | undefined; - packets_recv_out_of_order: number | undefined; - packets_recv_out_of_order_corrected: number | undefined; - packets_recv_duplicate: number | undefined; - packets_recv_lurch: number | undefined; - multipath_packets_recv_sequenced: number[]; - multipath_packets_recv_later: number[]; - multipath_send_enabled: number | undefined; - quality_histogram_100: number | undefined; - quality_histogram_99: number | undefined; - quality_histogram_97: number | undefined; - quality_histogram_95: number | undefined; - quality_histogram_90: number | undefined; - quality_histogram_75: number | undefined; - quality_histogram_50: number | undefined; - quality_histogram_1: number | undefined; - quality_histogram_dead: number | undefined; - quality_ntile_2nd: number | undefined; - quality_ntile_5th: number | undefined; - quality_ntile_25th: number | undefined; - quality_ntile_50th: number | undefined; - ping_histogram_25: number | undefined; - ping_histogram_50: number | undefined; - ping_histogram_75: number | undefined; - ping_histogram_100: number | undefined; - ping_histogram_125: number | undefined; - ping_histogram_150: number | undefined; - ping_histogram_200: number | undefined; - ping_histogram_300: number | undefined; - ping_histogram_max: number | undefined; - ping_ntile_5th: number | undefined; - ping_ntile_50th: number | undefined; - ping_ntile_75th: number | undefined; - ping_ntile_95th: number | undefined; - ping_ntile_98th: number | undefined; - jitter_histogram_negligible: number | undefined; - jitter_histogram_1: number | undefined; - jitter_histogram_2: number | undefined; - jitter_histogram_5: number | undefined; - jitter_histogram_10: number | undefined; - jitter_histogram_20: number | undefined; - txspeed_max: number | undefined; - txspeed_histogram_16: number | undefined; - txspeed_histogram_32: number | undefined; - txspeed_histogram_64: number | undefined; - txspeed_histogram_128: number | undefined; - txspeed_histogram_256: number | undefined; - txspeed_histogram_512: number | undefined; - txspeed_histogram_1024: number | undefined; - txspeed_histogram_max: number | undefined; - txspeed_ntile_5th: number | undefined; - txspeed_ntile_50th: number | undefined; - txspeed_ntile_75th: number | undefined; - txspeed_ntile_95th: number | undefined; - txspeed_ntile_98th: number | undefined; - rxspeed_max: number | undefined; - rxspeed_histogram_16: number | undefined; - rxspeed_histogram_32: number | undefined; - rxspeed_histogram_64: number | undefined; - rxspeed_histogram_128: number | undefined; - rxspeed_histogram_256: number | undefined; - rxspeed_histogram_512: number | undefined; - rxspeed_histogram_1024: number | undefined; - rxspeed_histogram_max: number | undefined; - rxspeed_ntile_5th: number | undefined; - rxspeed_ntile_50th: number | undefined; - rxspeed_ntile_75th: number | undefined; - rxspeed_ntile_95th: number | undefined; - rxspeed_ntile_98th: number | undefined; -} - -export interface SteamDatagramConnectionQuality { - instantaneous: SteamDatagramLinkInstantaneousStats | undefined; - lifetime: SteamDatagramLinkLifetimeStats | undefined; -} - -export interface SteamNetworkingICESessionSummary { - failure_reason_code: number | undefined; - local_candidate_types: number | undefined; - remote_candidate_types: number | undefined; - initial_route_kind: number | undefined; - initial_ping: number | undefined; - initial_score: number | undefined; - negotiation_ms: number | undefined; - best_route_kind: number | undefined; - best_ping: number | undefined; - best_score: number | undefined; - best_time: number | undefined; - selected_seconds: number | undefined; - user_settings: number | undefined; - ice_enable_var: number | undefined; - local_candidate_types_allowed: number | undefined; -} - -export interface SteamNetworkingP2PSDRRoutingSummary { - initial_ping: number | undefined; - initial_ping_front_local: number | undefined; - initial_ping_front_remote: number | undefined; - initial_score: number | undefined; - initial_pop_local: number | undefined; - initial_pop_remote: number | undefined; - best_ping: number | undefined; - best_ping_front_local: number | undefined; - best_ping_front_remote: number | undefined; - best_score: number | undefined; - best_pop_local: number | undefined; - best_pop_remote: number | undefined; - best_time: number | undefined; - negotiation_ms: number | undefined; - selected_seconds: number | undefined; -} - -export interface SteamDatagramP2PRoutingSummary { - ice: SteamNetworkingICESessionSummary | undefined; - sdr: SteamNetworkingP2PSDRRoutingSummary | undefined; -} - -export interface MsgSystemAudioVolumeChannelEntry { - echannel: SystemAudioChannel | undefined; - volume: number | undefined; -} - -export interface MsgSystemAudioVolume { - entries: MsgSystemAudioVolumeChannelEntry[] | undefined; - is_muted: boolean | undefined; -} - -export interface MsgSystemAudioManagerObject { - id: number | undefined; - rtime_last_update: number | undefined; -} - -export interface MsgSystemAudioManagerDevice { - base: MsgSystemAudioManagerObject | undefined; - name: string | undefined; - nick: string | undefined; - description: string | undefined; - api: string | undefined; -} - -export interface MsgSystemAudioManagerNode { - base: MsgSystemAudioManagerObject | undefined; - device_id: number | undefined; - name: string | undefined; - nick: string | undefined; - description: string | undefined; - edirection: SystemAudioDirection | undefined; - volume: MsgSystemAudioVolume | undefined; -} - -export interface MsgSystemAudioManagerPort { - base: MsgSystemAudioManagerObject | undefined; - node_id: number | undefined; - name: string | undefined; - alias: string | undefined; - etype: SystemAudioPortType | undefined; - edirection: SystemAudioPortDirection | undefined; - is_physical: boolean | undefined; - is_terminal: boolean | undefined; - is_control: boolean | undefined; - is_monitor: boolean | undefined; -} - -export interface MsgSystemAudioManagerLink { - base: MsgSystemAudioManagerObject | undefined; - output_node_id: number | undefined; - output_port_id: number | undefined; - input_node_id: number | undefined; - input_port_id: number | undefined; -} - -export interface MsgSystemAudioManagerStateHW { - devices: MsgSystemAudioManagerDevice[]; - nodes: MsgSystemAudioManagerNode[]; - ports: MsgSystemAudioManagerPort[]; - links: MsgSystemAudioManagerLink[]; -} - -/** - * JsPb message class. - */ -export interface JsPbMessageClass { - /** - * @todo Returns {@link JsPbMessage}, but not sure how to do it for the messages. - */ - deserializeBinary(data: ArrayBuffer): any; -} - -/** - * Deserialized JsPb message. - */ -export interface JsPbMessage { - getClassName(): string; - - serializeBase64String(): string; - - serializeBinary(): Uint8Array; - - /** - * Converts the message to an object. - */ - toObject(includeJsPbInstance: boolean): any; -} - -/** - * CLibraryBootstrapData - */ -export interface LibraryBootstrapData extends JsPbMessage { - app_data(): AppBootstrapData[]; - - add_app_data(param0: any, param1: any): any; - - set_app_data(param0: any): any; -} - -/** - * CAppOverview_Change - */ -export interface AppOverview_Change extends JsPbMessage { - app_overview(): SteamAppOverview[]; - - full_update(): boolean; - - removed_appid(): number[]; - - update_complete(): boolean; - - add_app_overview(param0: any, param1: any): any; - - add_removed_appid(param0: any, param1: any): any; - - set_app_overview(param0: any): any; - - set_full_update(param0: any): any; - - set_removed_appid(param0: any): any; - - set_update_complete(param0: any): any; -} - -/** - * CAuthentication_DeviceDetails - * - * `deserializeBinary` argument: - * ``` - * [ - * await SteamClient.System.GetOSType(), - * await SteamClient.Auth.GetLocalHostname(), - * await SteamClient.Auth.GetMachineID(), - * ]; - * ``` - */ -export interface Authentication_DeviceDetails extends JsPbMessage { - client_count(): number | undefined; - - device_friendly_name(): string | undefined; - - gaming_device_type(): GamingDeviceType | undefined; - - machine_id(): Uint8Array | string; - - os_type(): OSType | undefined; - - platform_type(): AuthTokenPlatformType | undefined; - - set_client_count(): any; - - set_device_friendly_name(): any; - - set_gaming_device_type(): any; - - set_machine_id(): any; - - set_os_type(): any; - - set_platform_type(): any; -} - -/** - * CMsgMonitorInfo - */ -export interface MsgMonitorInfo extends JsPbMessage { - monitors(): Monitor[]; - - selected_display_name(): string; - - add_monitors(param0: any, param1: any): any; - - set_monitors(param0: any): any; - - set_selected_display_name(param0: any): any; -} - -/** - * CMsgSystemManagerSettings - */ -export interface MsgSystemManagerSettings extends JsPbMessage { - display_adaptive_brightness_enabled(): boolean; - - display_colorgamut(): number; - - display_colorgamut_labelset(): number; - - display_colortemp(): number; - - display_colortemp_default(): number; - - display_colortemp_enabled(): boolean; - - display_diagnostics_enabled(): boolean; - - display_nightmode_blend(): number; - - display_nightmode_enabled(): boolean; - - display_nightmode_maxhue(): number; - - display_nightmode_maxsat(): number; - - display_nightmode_schedule_enabled(): boolean; - - display_nightmode_schedule_endtime(): number; - - display_nightmode_schedule_starttime(): number; - - display_nightmode_tintstrength(): number; - - display_nightmode_uiexp(): number; - - fan_control_mode(): number; - - idle_backlight_dim_ac_seconds(): number; - - idle_backlight_dim_battery_seconds(): number; - - idle_suspend_ac_seconds(): number; - - idle_suspend_battery_seconds(): number; - - idle_suspend_supressed(): boolean; - - is_adaptive_brightness_available(): boolean; - - is_display_brightness_available(): boolean; - - is_display_colormanagement_available(): boolean; - - is_display_colortemp_available(): boolean; - - is_fan_control_available(): boolean; - - is_wifi_powersave_enabled(): boolean; -} - -/** - * CMsgSystemAudioManagerState - */ -export interface MsgSystemAudioManagerState extends JsPbMessage { - counter(): number | undefined; - - hw(): MsgSystemAudioManagerStateHW | undefined; - - rtime_filter(): number | undefined; -} - -/** - * CMsgSystemUpdateState - */ -export interface MsgSystemUpdateState extends JsPbMessage { - state(): UpdaterState | undefined; - - progress(): UpdateProgress | undefined; - - supports_os_updates(): boolean | undefined; - - update_apply_results(): UpdateApplyResult[]; - - update_check_results(): UpdateCheckResult[]; -} - -/** - * CMsgSystemDockState - */ -export interface MsgSystemDockState extends JsPbMessage { - update_state(): SystemDockUpdateState | undefined; -} - -/** - * CMsgSystemPerfDiagnosticInfo - */ -export interface MsgSystemPerfDiagnosticInfo extends JsPbMessage { - battery_temp_c(): number | undefined; - - entries(): SystemPerfDiagnosticEntry[] | undefined; - - interfaces(): SystemPerfNetworkInterface[] | undefined; -} - -/** - * CMsgSystemPerfState - */ -export interface MsgSystemPerfState extends JsPbMessage { - active_profile_game_id(): string | undefined; - - current_game_id(): string | undefined; - - limits(): SystemPerfLimits | undefined; - - settings(): SystemPerfSettings | undefined; -} - -/** - * CMsgGenerateSystemReportReply - */ -export interface MsgGenerateSystemReportReply extends JsPbMessage { - /** - * The report file name. - */ - report_id(): string | undefined; - - set_report_id(param0: any): any; -} - -/** - * CMsgNetworkDevicesData - */ -export interface MsgNetworkDevicesData extends JsPbMessage { - devices(): NetworkDevice[]; - - is_wifi_enabled(): boolean; - - is_wifi_scanning_enabled(): boolean; -} - -/** - * CMsgClientSettings - */ -export interface MsgClientSettings extends JsPbMessage { - always_show_user_chooser(): boolean; - - always_use_gamepadui_overlay(): boolean; - - auto_scale_factor(): number; - - bigpicture_windowed(): boolean; - - broadcast_bitrate(): number; - - broadcast_chat_corner(): number; - - broadcast_encoding_option(): BroadcastEncoderSetting; - - broadcast_output_height(): number; - - broadcast_output_width(): number; - - broadcast_permissions(): BroadcastPermission; - - broadcast_record_all_audio(): boolean; - - broadcast_record_all_video(): boolean; - - broadcast_record_microphone(): boolean; - - broadcast_show_live_reminder(): boolean; - - broadcast_show_upload_stats(): boolean; - - cef_remote_debugging_enabled(): boolean; - - cloud_enabled(): boolean; - - controller_combine_nintendo_joycons(): boolean; - - controller_generic_support(): boolean; - - controller_guide_button_focus_steam(): boolean; - - controller_power_off_timeout(): number; - - controller_ps_support(): number; - - controller_switch_support(): boolean; - - controller_xbox_driver(): boolean; - - controller_xbox_support(): boolean; - - default_ping_rate(): number; - - disable_all_toasts(): boolean; - - disable_toasts_in_game(): boolean; - - display_name(): string; - - download_peer_content(): number; - - download_rate_bits_per_s(): boolean; - - download_region(): number; - - download_throttle_rate(): number; - - download_throttle_while_streaming(): boolean; - - download_while_app_running(): boolean; - - enable_avif_screenshots(): boolean; - - enable_dpi_scaling(): boolean; - - enable_gpu_accelerated_webviews(): boolean; - - enable_hardware_video_decoding(): boolean; - - enable_marketing_messages(): boolean; - - enable_overlay(): boolean; - - enable_screenshot_notification(): boolean; - - enable_screenshot_sound(): boolean; - - enable_shader_background_processing(): boolean; - - enable_shader_precache(): boolean; - - enable_ui_sounds(): boolean; - - force_deck_perf_tab(): boolean; - - force_fake_mandatory_update(): boolean; - - force_oobe(): boolean; - - g_background_mk(): Hotkey; - - g_background_tg(): Hotkey; - - game_notes_enable_spellcheck(): boolean; - - gamescope_app_target_framerate(): number; - - gamescope_disable_framelimit(): boolean; - - gamescope_disable_mura_correction(): boolean; - - gamescope_display_refresh_rate(): number; - - gamescope_enable_app_target_framerate(): boolean; - - gamescope_hdr_visualization(): HDRVisualization; - - gamescope_include_steamui_in_screenshots(): boolean; - - gamescope_use_game_refresh_rate_in_steam(): boolean; - - gamestream_hardware_video_encode(): boolean; - - hdr_compat_testing(): boolean; - - in_client_beta(): boolean; - - is_external_display(): boolean; - - is_steam_sideloaded(): boolean; - - jumplist_flags(): number; - - library_disable_community_content(): boolean; - - library_display_icon_in_game_list(): boolean; - - library_display_size(): number; - - library_low_bandwidth_mode(): boolean; - - library_low_perf_mode(): boolean; - - library_whats_new_show_only_product_updates(): boolean; - - max_scale_factor(): number; - - min_scale_factor(): number; - - music_download_high_quality(): boolean; - - music_pause_on_app_start(): boolean; - - music_pause_on_voice_chat(): boolean; - - music_playlist_notification(): boolean; - - music_volume(): number; - - needs_steam_service_repair(): boolean; - - no_save_personal_info(): boolean; - - oobe_test_mode_enabled(): boolean; - - overlay_fps_counter_corner(): number; - - overlay_fps_counter_high_contrast(): boolean; - - overlay_key(): Hotkey; - - overlay_restore_browser_tabs(): boolean; - - overlay_scale_interface(): boolean; - - overlay_tabs(): string; - - overlay_toolbar_list_view(): boolean; - - override_browser_composer_mode(): number; - - play_sound_on_toast(): boolean; - - preferred_monitor(): string; - - ready_to_play_includes_streaming(): boolean; - - restrict_auto_updates(): boolean; - - restrict_auto_updates_end(): number; - - restrict_auto_updates_start(): number; - - run_at_startup(): boolean; - - save_uncompressed_screenshots(): boolean; - - screenshot_items_per_row(): number; - - screenshot_key(): Hotkey; - - screenshots_path(): string; - - server_ping_rate(): number; - - setting_validation_bool(): boolean; - - setting_validation_enum(): HDRVisualization; - - setting_validation_int32(): number; - - setting_validation_uint32(): number; - - setting_validation_uint64(): number; - - setting_validation_float(): number; - - setting_validation_string(): string; - - shader_precached_size(): string; - - show_family_sharing_notifications(): boolean; - - show_screenshot_manager(): boolean; - - show_steam_deck_info(): boolean; - - show_store_content_on_home(): boolean; - - show_timestamps_in_console(): boolean; - - skip_steamvr_install_dialog(): boolean; - - small_mode(): boolean; - - smooth_scroll_webviews(): boolean; - - start_in_big_picture_mode(): boolean; - - start_page(): string; - - startup_movie_id(): string; - - startup_movie_local_path(): string; - - startup_movie_shuffle(): boolean; - - startup_movie_used_for_resume(): boolean; - - steam_cef_gpu_blocklist_disabled(): boolean; - - steam_input_configurator_error_msg_enable(): boolean; - - steam_networking_share_ip(): number; - - steam_os_underscan_enabled(): boolean; - - steam_os_underscan_level(): number; - - steamos_status_led_brightness(): number; - - turn_off_controller_on_exit(): boolean; - - voice_mic_device_name(): string; - - voice_mic_input_gain(): number; - - voice_push_to_talk_key(): Hotkey; - - voice_push_to_talk_setting(): number; - - voice_speaker_output_gain(): number; - - web_browser_home(): string; -} - -/** - * CGameNetworkingUI_ConnectionState - */ -export interface GameNetworkingUI_ConnectionState extends JsPbMessage { - connection_key(): string; - - appid(): number; - - connection_id_local(): number; - - identity_local(): string; - - identity_remote(): string; - - connection_state(): number; - - start_time(): number; - - close_time(): number; - - close_reason(): number; - - close_message(): string; - - status_loc_token(): string; - - transport_kind(): number; - - sdrpopid_local(): string; - - sdrpopid_remote(): string; - - address_remote(): string; - - p2p_routing(): SteamDatagramP2PRoutingSummary; - - ping_interior(): number; - - ping_remote_front(): number; - - ping_default_internet_route(): number; - - e2e_quality_local(): SteamDatagramConnectionQuality; - - e2e_quality_remote(): SteamDatagramConnectionQuality; - - e2e_quality_remote_instantaneous_time(): string; - - e2e_quality_remote_lifetime_time(): string; - - front_quality_local(): SteamDatagramConnectionQuality; - - front_quality_remote(): SteamDatagramConnectionQuality; - - front_quality_remote_instantaneous_time(): string; - - front_quality_remote_lifetime_time(): string; -} - -/** - * CMsgHotkey - */ -export interface MsgHotkey extends JsPbMessage { - key_code(): number; - - alt_key(): boolean; - - shift_key(): boolean; - - ctrl_key(): boolean; - - meta_key(): boolean; - - display_name(): string; -} - -/** - * CClientNotificationGroupChatMessage - */ -export interface ClientNotificationGroupChatMessage extends JsPbMessage { - tag(): string; - - /** A Steam64 ID. */ - steamid_sender(): string; - - chat_group_id(): string; - - chat_id(): string; - - title(): string; - - body(): string; - - rawbody(): string; - - icon(): string; - - notificationid(): number; -} - -/** - * CClientNotificationFriendMessage - */ -export interface ClientNotificationFriendMessage extends JsPbMessage { - body(): string; - - icon(): string; - - notificationid(): number; - - response_steamurl(): string; - - /** A Steam64 ID. */ - steamid(): string; - - tag(): string; - - title(): string; -} - -export enum AppArtworkAssetType { - Capsule = 0, - Hero = 1, - Logo = 2, - Header = 3, - Icon = 4, - HeroBlur = 5, -} - -/** - * Controls how Gamescope renders the GamepadUI window when a game is running. - */ -export enum UIComposition { - /** Steam is not rendered on the screen. */ - Hidden = 0, - /** - * Transparent divs will allow pixels from the app behind Steam to penetrate. - * Input goes to **the app**. - */ - Notification = 1, - /** - * Transparent divs will allow pixels from the app behind Steam to penetrate. - * Input goes to **Steam**. - */ - Overlay = 2, - /** Take all of the pixels on the screen, nothing "behind" Steam is shown. */ - Opaque = 3, - /** - * Special composition mode that matches Overlay, but forwards synthetic keyboard - * events to the Gamescope foreground app (game) instead of Steam. - */ - OverlayKeyboard = 4, -} - -export enum OSType { - Web = -700, - Ios = -600, - Android = -500, - Android6 = -499, - Android7 = -498, - Android8 = -497, - Android9 = -496, - Ps3os = -300, - Linux = -203, - Linux22 = -202, - Linux24 = -201, - Linux26 = -200, - Linux32 = -199, - Linux35 = -198, - Linux36 = -197, - Linux310 = -196, - Linux316 = -195, - Linux318 = -194, - Linux3x = -193, - Linux4x = -192, - Linux41 = -191, - Linux44 = -190, - Linux49 = -189, - Linux414 = -188, - Linux419 = -187, - Linux5x = -186, - Linux54 = -185, - Linux6x = -184, - Linux7x = -183, - Linux510 = -182, - Macos = -102, - Macos104 = -101, - Macos105 = -100, - Macos1058 = -99, - Macos106_unused1 = -98, - Macos106_unused2 = -97, - Macos106_unused3 = -96, - Macos106 = -95, - Macos1063 = -94, - Macos1064_slgu = -93, - Macos1067 = -92, - Macos1067_unused = -91, - Macos107 = -90, - Macos108 = -89, - Macos109 = -88, - Macos1010 = -87, - Macos1011 = -86, - Macos1012 = -85, - Macos1013 = -84, - Macos1014 = -83, - Macos1015 = -82, - Macos1016 = -81, - Macos11 = -80, - Macos111 = -79, - Macos1017 = -78, - Macos12 = -77, - Macos1018 = -76, - Macos13 = -75, - Macos1019 = -74, - Macos14 = -73, - Macos1020 = -72, - Macos15 = -71, - Unknown = -1, - Windows = 0, - Win311 = 1, - Win95 = 2, - Win98 = 3, - WinME = 4, - WinNT = 5, - Win200 = 6, - WinXP = 7, - Win2003 = 8, - WinVista = 9, - Win7 = 10, - Win2008 = 11, - Win2012 = 12, - Win8 = 13, - Win81 = 14, - Win2012R2 = 15, - Win10 = 16, - Win2016 = 17, - Win2019 = 18, - Win2022 = 19, - Win11 = 20, -} - -export enum ControllerType { - None = -1, - Unknown = 0, - UnknownSteamController = 1, - SteamController = 2, // Codename Gordon - SteamControllerV2 = 3, // Codename Headcrab - SteamControllerNeptune = 4, // Steam Deck - FrontPanelBoard = 20, - Generic = 30, - XBox360Controller = 31, - XBoxOneController = 32, - PS3Controller = 33, - PS4Controller = 34, - WiiController = 35, - AppleController = 36, - AndroidController = 37, - SwitchProController = 38, - SwitchJoyConLeft = 39, - SwitchJoyConRight = 40, - SwitchJoyConPair = 41, - SwitchProGenericInputOnlyController = 42, - MobileTouch = 43, - SwitchProXInputSwitchController = 44, - PS5Controller = 45, - XboxEliteController = 46, - LastController = 47, // Unverified - PS5EdgeController = 48, - GenericKeyboard = 400, - GenericMouse = 800, -} - -export enum FilePrivacyState { - Invalid = -1, - Private = 2, - FriendsOnly = 4, - Public = 8, - Unlisted = 16, -} - -export enum BluetoothDeviceType { - Invalid = 0, - Unknown = 1, - Phone = 2, - Computer = 3, - Headset = 4, - Headphones = 5, - Speakers = 6, - OtherAudio = 7, - Mouse = 8, - Joystick = 9, - Gamepad = 10, - Keyboard = 11, -} - -export enum AppAssociationType { - Invalid = 0, - Publisher = 1, - Developer = 2, - Franchise = 3, -} - -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, - OwnerLocked = 37, - DownloadFailed = 38, - UpdateFailed = 39, -} - -export enum AppCloudStatus { - Invalid = 0, - Disabled = 1, - Unknown = 2, - Synchronized = 3, - Checking = 4, - OutOfSync = 5, - Uploading = 6, - Downloading = 7, - SyncFailed = 8, - Conflict = 9, - PendingElsewhere = 10, -} - -export enum SteamDeckCompatibilityCategory { - Unknown = 0, - Unsupported = 1, - Playable = 2, - Verified = 3, -} - -export enum ACState { - Unknown = 0, - Disconnected = 1, - Connected = 2, - ConnectedSlow = 3, -} - -export enum BatteryState { - Unknown = 0, - Discharging = 1, - Charging = 2, - Full = 3, -} - -export enum OSBranchType { - Unknown = 0, - Release = 1, - ReleaseCandidate = 2, - Beta = 3, - BetaCandidate = 4, - Main = 5, - Staging = 6, -} - -export enum AppOwnershipFlags { - None = 0, - Subscribed = 1, - Free = 2, - RegionRestricted = 4, - LowViolence = 8, - InvalidPlatform = 16, - Borrowed = 32, - FreeWeekend = 64, - Retail = 128, - Locked = 256, - Pending = 512, - Expired = 1024, - Permanent = 2048, - Recurring = 4096, - Canceled = 8192, - AutoGrant = 16384, - PendingGift = 32768, - RentalNotActivated = 65536, - Rental = 131072, - SiteLicense = 262144, - LegacyFreeSub = 524288, - InvalidOSType = 1048576, - TimedTrial = 2097152, -} - -export enum AppError { - None = 0, - Unspecified = 1, - Paused = 2, - Canceled = 3, - Suspended = 4, - NoSubscription = 5, - NoConnection = 6, - Timeout = 7, - MissingKey = 8, - MissingConfig = 9, - DiskReadFailure = 10, - DiskWriteFailure = 11, - NotEnoughDiskSpace = 12, - CorruptGameFiles = 13, - WaitingForNextDisk = 14, - InvalidInstallPath = 15, - AppRunning = 16, - DependencyFailure = 17, - NotInstalled = 18, - UpdateRequired = 19, - Busy = 20, - NoDownloadSources = 21, - InvalidAppConfig = 22, - InvalidDepotConfig = 23, - MissingManifest = 24, - NotReleased = 25, - RegionRestricted = 26, - CorruptDepotCache = 27, - MissingExecutable = 28, - InvalidPlatform = 29, - InvalidFileSystem = 30, - CorruptUpdateFiles = 31, - DownloadDisabled = 32, - SharedLibraryLocked = 33, - PendingLicense = 34, - OtherSessionPlaying = 35, - CorruptDownload = 36, - CorruptDisk = 37, - FilePermissions = 38, - FileLocked = 39, - MissingContent = 40, - Requires64BitOS = 41, - MissingUpdateFiles = 42, - NotEnoughDiskQuota = 43, - LockedSiteLicense = 44, - ParentalBlocked = 45, - SpawnProcess = 46, - ClientOutOfDate = 47, - PlaytimeExceeded = 48, - CorruptFileSignature = 49, - MissingGameFiles = 50, - CompatToolFailed = 51, - RemovedInstallPath = 52, - InvalidBackupPath = 53, - InvalidPasscode = 54, - SelfUpdating = 55, - ParentalPlaytimeExceeded = 56, - Max = 57, -} - -export enum BrowserType { - OffScreen = 0, - OpenVROverlay = 1, - OpenVROverlay_Dashboard = 2, - DirectHWND = 3, - DirectHWND_Borderless = 4, - DirectHWND_Hidden = 5, - ChildHWNDNative = 6, - Transparent_Toplevel = 7, - OffScreen_SharedTexture = 8, - OffScreen_GameOverlay = 9, - OffScreen_GameOverlay_SharedTexture = 10, - Offscreen_FriendsUI = 11, - Offscreen_SteamUI = 12, - OpenVROverlay_Subview = 13, -} - -export enum NotificationPosition { - TopLeft = 0, - TopRight = 1, - BottomLeft = 2, - BottomRight = 3, -} - -export enum WorkshopFileType { - Community = 0, - Microtransaction = 1, - Collection = 2, - Art = 3, - Video = 4, - Screenshot = 5, - Game = 6, - Software = 7, - Concept = 8, - WebGuide = 9, - IntegratedGuide = 10, - Merch = 11, - ControllerBinding = 12, - SteamworksAccessInvite = 13, - SteamVideo = 14, - GameManagedItem = 15, -} - -export enum EInstallManagerState { - None = 0, - Setup = 1, - WaitLicense = 2, - FreeLicense = 3, - ShowCDKey = 4, - WaitAppInfo = 5, - ShowPassword = 6, - ShowConfig = 7, - ShowEULAs = 8, - CreateApps = 9, - ReadFromMedia = 10, - ShowChangeMedia = 11, - WaitLegacyCDKeys = 12, - ShowSignup = 13, - Complete = 14, - Failed = 15, - Canceled = 16, -} - -export enum EAppReleaseState { - Unknown = 0, - Unavailable = 1, - Prerelease = 2, - PreloadOnly = 3, - Released = 4, - Disabled = 5, -} - -export enum EControllerConfigExportType { - Unknown = 0, - PersonalLocal = 1, - PersonalCloud = 2, - Community = 3, - Template = 4, - Official = 5, - OfficialDefault = 6, -} - -export enum EMusicPlaybackStatus { - Undefined = 0, - Playing = 1, - Paused = 2, - Idle = 3, -} - -export enum EMusicRepeatStatus { - None = 0, - All = 1, - Once = 2, - Max = 3, -} - -export enum EStreamP2PScope { - Automatic = 0, - Disabled = 1, - OnlyMe = 2, - Friends = 3, - Everyone = 4, -} - -/** - * @todo unconfirmed, taken from localization strings - */ -export enum ESteamGuardState { - EmailUnverified = 0, - Protected = 1, - Disabled = 2, - Offline = 3, - NotEnabled = 4, -} - -export enum ENetFakeLocalSystemState { - Normal = 0, - NoLAN = 1, - CaptivePortal_Redirected = 2, - CaptivePortal_InPlace = 3, - NoInternet = 4, - NoSteam = 5, -} - -export enum ELanguage { - None = -1, - English = 0, - German = 1, - French = 2, - Italian = 3, - Korean = 4, - Spanish = 5, - SimplifiedChinese = 6, - TraditionalChinese = 7, - Russian = 8, - Thai = 9, - Japanese = 10, - Portuguese = 11, - Polish = 12, - Danish = 13, - Dutch = 14, - Finnish = 15, - Norwegian = 16, - Swedish = 17, - Hungarian = 18, - Czech = 19, - Romanian = 20, - Turkish = 21, - Brazilian = 22, - Bulgarian = 23, - Greek = 24, - Arabic = 25, - Ukrainian = 26, - LatamSpanish = 27, - Vietnamese = 28, - SteamChina_SChinese = 29, - Max = 30, -} - -export enum EHIDKeyboardKey { - Invalid = 0, - BeforeFirst = 3, - A = 4, - B = 5, - C = 6, - D = 7, - E = 8, - F = 9, - G = 10, - H = 11, - I = 12, - J = 13, - K = 14, - L = 15, - M = 16, - N = 17, - O = 18, - P = 19, - Q = 20, - R = 21, - S = 22, - T = 23, - U = 24, - V = 25, - W = 26, - X = 27, - Y = 28, - Z = 29, - Key_1 = 30, - Key_2 = 31, - Key_3 = 32, - Key_4 = 33, - Key_5 = 34, - Key_6 = 35, - Key_7 = 36, - Key_8 = 37, - Key_9 = 38, - Key_0 = 39, - Return = 40, - Escape = 41, - Backspace = 42, - Tab = 43, - Space = 44, - Dash = 45, - Equals = 46, - LeftBracket = 47, - RightBracket = 48, - Backslash = 49, - Unused1 = 50, - Semicolon = 51, - SingleQuote = 52, - Backtick = 53, - Comma = 54, - Period = 55, - ForwardSlash = 56, - CapsLock = 57, - F1 = 58, - F2 = 59, - F3 = 60, - F4 = 61, - F5 = 62, - F6 = 63, - F7 = 64, - F8 = 65, - F9 = 66, - F10 = 67, - F11 = 68, - F12 = 69, - PrintScreen = 70, - ScrollLock = 71, - Break = 72, - Insert = 73, - Home = 74, - PageUp = 75, - Delete = 76, - End = 77, - PageDown = 78, - RightArrow = 79, - LeftArrow = 80, - DownArrow = 81, - UpArrow = 82, - NumLock = 83, - KeypadForwardSlash = 84, - KeypadAsterisk = 85, - KeypadDash = 86, - KeypadPlus = 87, - KeypadEnter = 88, - Keypad_1 = 89, - Keypad_2 = 90, - Keypad_3 = 91, - Keypad_4 = 92, - Keypad_5 = 93, - Keypad_6 = 94, - Keypad_7 = 95, - Keypad_8 = 96, - Keypad_9 = 97, - Keypad_0 = 98, - KeypadPeriod = 99, - LAlt = 100, - LShift = 101, - LWin = 102, - LControl = 103, - RAlt = 104, - RShift = 105, - RWin = 106, - RControl = 107, - VolUp = 108, - VolDown = 109, - Mute = 110, - Play = 111, - Stop = 112, - Next = 113, - Prev = 114, - AfterLast = 115, -} - -export enum ELoginState { - None = 0, - WelcomeDialog = 1, - WaitingForCreateUser = 2, - WaitingForCredentials = 3, - WaitingForNetwork = 4, - WaitingForServerResponse = 5, - WaitingForLibraryReady = 6, - Success = 7, - Quit = 8, -} - -export enum ClientBetaState { - None = 0, - NoneChosen = 1, - NoneChosenNonAdmin = 2, - InBeta = 3, - InBetaNonAdmin = 4, -} - -export enum ConnectivityTestResult { - Unknown = 0, - Connected = 1, - CaptivePortal = 2, - TimedOut = 3, - Failed = 4, - WifiDisabled = 5, - NoLAN = 6, -} - -export enum ControllerRumbleSetting { - ControllerPreference = 0, - Off = 1, - On = 2, -} - -export enum AppControllerSupportLevel { - None = 0, - Partial = 1, - Full = 2, -} - -export enum AppType { - DepotOnly = -2147483648, - Invalid = 0, - Game = 1, - Application = 2, - Tool = 4, - Demo = 8, - Deprecated = 16, - DLC = 32, - Guide = 64, - Driver = 128, - Config = 256, - Hardware = 512, - Franchise = 1024, - Video = 2048, - Plugin = 4096, - MusicAlbum = 8192, - Series = 16384, - Comic = 32768, - Beta = 65536, - Shortcut = 1073741824, -} - -export enum AutoUpdateBehavior { - Always = 0, // (Always keep this game updated) - Launch = 1, // (Only update this game when I launch it) - HighPriority = 2, // (High priority) -} - -export enum BackgroundDownloadsBehavior { - Pause = 0, - Always = 1, - Never = 2, -} - -export enum SteamRealm { - Unknown = 0, - Global = 1, - China = 2, -} - -/** - * @remarks Not present in any of the Steam files, source: https://gist.github.com/Ne3tCode/fc424ae2bd723d9ccb236eeccce66316#file-steammobile_friendsui_enums-steamd-L1308-L1340 - */ -export enum AppLaunchSource { - None = 0, - _2ftLibraryDetails = 100, - _2ftLibraryListView = 101, - _2ftLibraryGrid = 103, - InstallSubComplete = 104, - DownloadsPage = 105, - RemoteClientStartStreaming = 106, - _2ftMiniModeList = 107, - _10ft = 200, - DashAppLaunchCmdLine = 300, - DashGameIdLaunchCmdLine = 301, - RunByGameDir = 302, - SubCmdRunDashGame = 303, - SteamURL_Launch = 400, - SteamURL_Run = 401, - SteamURL_JoinLobby = 402, - SteamURL_RunGame = 403, - SteamURL_RunGameIdOrJumplist = 404, - SteamURL_RunSafe = 405, - TrayIcon = 500, - LibraryLeftColumnContextMenu = 600, - LibraryLeftColumnDoubleClick = 601, - Dota2Launcher = 700, - IRunGameEngine = 800, - DRMFailureResponse = 801, - DRMDataRequest = 802, - CloudFilePanel = 803, - DiscoveredAlreadyRunning = 804, - GameActionJoinParty = 900, - AppPortraitContextMenu = 1000, -} - -export enum AppLaunchOptionType { - None = 0, - Default = 1, - SafeMode = 2, - Multiplayer = 3, - Config = 4, - OpenVR = 5, - Server = 6, - Editor = 7, - Manual = 8, - Benchmark = 9, - Option1 = 10, - Option2 = 11, - Option3 = 12, - OculusVR = 13, - OpenVROverlay = 14, - OSVR = 15, - OpenXR = 16, - Dialog = 1e3, -} - -/** - * @remarks Not present in any of the Steam files. This is only present as localization strings, whose tokens start with `#Steam_AppUpdateError_`. - */ -export enum AppUpdateError { - None = 0, - Unspecified = 1, - Paused = 2, - Canceled = 3, - Suspended = 4, - NoSubscription = 5, - NoConnection = 6, - Timeout = 7, - MissingKey = 8, - MissingConfig = 9, - DiskReadFailure = 10, - DiskWriteFailure = 11, - NotEnoughDiskSpace = 12, - CorruptGameFiles = 13, - WaitingForNextDisk = 14, - InvalidInstallPath = 15, - AppRunning = 16, - DependencyFailure = 17, - NotInstalled = 18, - UpdateRequired = 19, - Busy = 20, - NoDownloadSources = 21, - InvalidAppConfig = 22, - InvalidDepotConfig = 23, - MissingManifest = 24, - NotReleased = 25, - RegionRestricted = 26, - CorruptDepotCache = 27, - MissingExecutable = 28, - InvalidPlatform = 29, - InvalidFileSystem = 30, - CorruptUpdateFiles = 31, - DownloadDisabled = 32, - SharedLibraryLocked = 33, - PendingLicense = 34, - OtherSessionPlaying = 35, - CorruptDownload = 36, - CorruptDisk = 37, - FilePermissions = 38, - FileLocked = 39, - MissingContent = 40, - Requires64BitOS = 41, - MissingUpdateFiles = 42, - NotEnoughDiskQuota = 43, - LockedSiteLicense = 44, - ParentalControlBlocked = 45, - CreateProcessFailure = 46, - SteamClientOutdated = 47, - PlaytimeExceeded = 48, - CorruptFileSignature = 49, - MissingInstalledFiles = 50, - CompatibilityToolFailure = 51, - UnmountedUninstallPath = 52, - InvalidBackupPath = 53, - InvalidPasscode = 54, - ThirdPartyUpdater = 55, - ParentalPlaytimeExceeded = 56, -} - -export enum ClientUINotification { - GroupChatMessage = 1, - FriendChatMessage = 2, - FriendPersonaState = 3, -} - -export enum MusicRepeatStatus { - None = 0, - All = 1, - Once = 2, - Max = 3, -} - -export enum JoinServerError { - PingFailed = -3, - Connecting = -2, - Pinging = -1, - None = 0, - VACBanned = 1, - ServerFull = 2, - ModNotInstalled = 3, - AppNotFound = 4, - NotInitialized = 5, -} - -export enum ServerBrowserGameFilterAntiCheat { - All = 0, - Secure = 1, - NotSecure = 2, -} - -export enum ServerBrowserGameFilterPing { - All = 0, - LessThan50 = 50, - LessThan100 = 100, - LessThan150 = 150, - LessThan250 = 250, -} - -export enum UIMode { - Unknown = -1, - GamePad = 4, - Desktop = 7, -} - -export enum WindowBringToFront { - Invalid = 0, - ForceOS = 1, - WithoutForcingOS = 2, -} - -export enum ComputerActiveState { - Invalid = 0, - Active = 1, - Idle = 2, -} - -export enum ClientUsedInputType { - Keyboard = 0, - Mouse = 1, - Controller = 2, - Max = 3, -} - -export enum TouchGestureType { - None = 0, - Touch = 1, - Tap = 2, - DoubleTap = 3, - ShortPress = 4, - LongPress = 5, - LongTap = 6, - TwoFingerTap = 7, - TapCancelled = 8, - PinchBegin = 9, - PinchUpdate = 10, - PinchEnd = 11, - FlingStart = 12, - FlingCancelled = 13, -} - -export enum BrowserViewContextMenuCommand { - Close = -1, - OpenDevTools = 26500, - CloseDevTools = 26501, - InspectElement = 26502, - OpenLinkInNewTab = 26503, -} - -export enum BrowserViewContextMenuTypeFlag { - None = 0, - Page = 1 << 0, - Frame = 1 << 1, - Link = 1 << 2, - Media = 1 << 3, - Selection = 1 << 4, - Editable = 1 << 5, -} - -export enum BrowserViewContextMenuEditFlag { - None = 0, - CanUndo = 1 << 0, - CanRedo = 1 << 1, - CanCut = 1 << 2, - CanCopy = 1 << 3, - CanPaste = 1 << 4, - CanDelete = 1 << 5, - CanSelectAll = 1 << 6, - CanTranslate = 1 << 7, -} - -export enum HDRVisualization { - None = 0, - Heatmap = 1, - Analysis = 2, - HeatmapExtended = 3, - HeatmapClassic = 4, -} - -export enum BroadcastPermission { - Disabled = 0, - FriendsApprove = 1, - FriendsAllowed = 2, - Public = 3, - Subscribers = 4, -} - -export enum BroadcastEncoderSetting { - BestQuality = 0, - BestPerformance = 1, -} - -export enum UpdaterState { - Invalid = 0, - UpToDate = 2, - Checking = 3, - Available = 4, - Applying = 5, - ClientRestartPending = 6, - SystemRestartPending = 7, -} - -export enum UpdaterType { - Invalid = 0, - Client = 1, - OS = 2, - BIOS = 3, - Aggregated = 4, - Test1 = 5, - Test2 = 6, - Dummy = 7, -} - -export enum Result { - OK = 1, - Fail = 2, - NoConnection = 3, - InvalidPassword = 5, - LoggedInElsewhere = 6, - InvalidProtocolVer = 7, - InvalidParam = 8, - FileNotFound = 9, - Busy = 10, - InvalidState = 11, - InvalidName = 12, - InvalidEmail = 13, - DuplicateName = 14, - AccessDenied = 15, - Timeout = 16, - Banned = 17, - AccountNotFound = 18, - InvalidSteamID = 19, - ServiceUnavailable = 20, - NotLoggedOn = 21, - Pending = 22, - EncryptionFailure = 23, - InsufficientPrivilege = 24, - LimitExceeded = 25, - Revoked = 26, - Expired = 27, - AlreadyRedeemed = 28, - DuplicateRequest = 29, - AlreadyOwned = 30, - IPNotFound = 31, - PersistFailed = 32, - LockingFailed = 33, - LogonSessionReplaced = 34, - ConnectFailed = 35, - HandshakeFailed = 36, - IOFailure = 37, - RemoteDisconnect = 38, - ShoppingCartNotFound = 39, - Blocked = 40, - Ignored = 41, - NoMatch = 42, - AccountDisabled = 43, - ServiceReadOnly = 44, - AccountNotFeatured = 45, - AdministratorOK = 46, - ContentVersion = 47, - TryAnotherCM = 48, - PasswordRequiredToKickSession = 49, - AlreadyLoggedInElsewhere = 50, - Suspended = 51, - Cancelled = 52, - DataCorruption = 53, - DiskFull = 54, - RemoteCallFailed = 55, - PasswordUnset = 56, - ExternalAccountUnlinked = 57, - PSNTicketInvalid = 58, - ExternalAccountAlreadyLinked = 59, - RemoteFileConflict = 60, - IllegalPassword = 61, - SameAsPreviousValue = 62, - AccountLogonDenied = 63, - CannotUseOldPassword = 64, - InvalidLoginAuthCode = 65, - AccountLogonDeniedNoMail = 66, - HardwareNotCapableOfIPT = 67, - IPTInitError = 68, - ParentalControlRestricted = 69, - FacebookQueryError = 70, - ExpiredLoginAuthCode = 71, - IPLoginRestrictionFailed = 72, - AccountLockedDown = 73, - AccountLogonDeniedVerifiedEmailRequired = 74, - NoMatchingURL = 75, - BadResponse = 76, - RequirePasswordReEntry = 77, - ValueOutOfRange = 78, - UnexpectedError = 79, - Disabled = 80, - InvalidCEGSubmission = 81, - RestrictedDevice = 82, - RegionLocked = 83, - RateLimitExceeded = 84, - AccountLoginDeniedNeedTwoFactor = 85, - ItemDeleted = 86, - AccountLoginDeniedThrottle = 87, - TwoFactorCodeMismatch = 88, - TwoFactorActivationCodeMismatch = 89, - AccountAssociatedToMultiplePartners = 90, - NotModified = 91, - NoMobileDevice = 92, - TimeNotSynced = 93, - SmsCodeFailed = 94, - AccountLimitExceeded = 95, - AccountActivityLimitExceeded = 96, - PhoneActivityLimitExceeded = 97, - RefundToWallet = 98, - EmailSendFailure = 99, - NotSettled = 100, - NeedCaptcha = 101, - GSLTDenied = 102, - GSOwnerDenied = 103, - InvalidItemType = 104, - IPBanned = 105, - GSLTExpired = 106, - InsufficientFunds = 107, - TooManyPending = 108, - NoSiteLicensesFound = 109, - WGNetworkSendExceeded = 110, - AccountNotFriends = 111, - LimitedUserAccount = 112, -} - -export enum AuthTokenPlatformType { - Unknown = 0, - SteamClient = 1, - WebBrowser = 2, - MobileApp = 3, -} - -export enum SystemAudioDirection { - Invalid = 0, - Input = 1, - Output = 2, -} - -export enum SystemAudioChannel { - Invalid = 0, - Aggregated = 1, - FrontLeft = 2, - FrontRight = 3, - LFE = 4, - BackLeft = 5, - BackRight = 6, - FrontCenter = 7, - Unknown = 8, - Mono = 9, -} - -export enum SystemAudioPortType { - Invalid = 0, - Unknown = 1, - Audio32f = 2, - Midi8b = 3, - Video32RGBA = 4, -} - -export enum SystemAudioPortDirection { - Invalid = 0, - Input = 1, - Output = 2, -} - -export enum CPUGovernor { - Invalid = 0, - Perf = 1, - Powersave = 2, - Manual = 3, -} - -export enum GPUPerformanceLevel { - Invalid = 0, - Auto = 1, - Manual = 2, - Low = 3, - High = 4, - Profiling = 5, -} - -export enum SplitScalingFilter { - Invalid = 0, - Linear = 1, - Nearest = 2, - FSR = 3, - NIS = 4, -} - -export enum SplitScalingScaler { - Invalid = 0, - Auto = 1, - Integer = 2, - Fit = 3, - Fill = 4, - Stretch = 5, -} - -export enum SystemServiceState { - Unavailable = 0, - Disabled = 1, - Enabled = 2, -} - -export enum GraphicsPerfOverlayLevel { - Hidden = 0, - Basic = 1, - Medium = 2, - Full = 3, - Minimal = 4, -} - -export enum HDRToneMapOperator { - Invalid = 0, - Uncharted = 1, - Reinhard = 2, -} - -export enum GamingDeviceType { - Unknown = 0, - StandardPC = 1, - Console = 256, - PS3 = 272, - Steambox = 288, - Handheld = 512, - Phone = 528, - SteamDeck = 544, -} - -export enum WirelessAPSecurityFlags { - None = 0, - StaticWep = 1, - DynamicWep = 2, - Wpa = 4, - WpaEnterprise = 8, - Wpa2 = 16, - Wpa2Enterprise = 32, - /** - * Special value to indicate that this platform does not support - * the security methods required to connect to an access point - */ - Unsupported = 32768, -} - -export enum WirelessAPStrength { - None = 0, - Weak = 1, - Ok = 2, - Good = 3, - Excellent = 4, -} - -export enum NetworkDeviceState { - NotPresent = 0, - Failed = 1, - Disconnected = 2, - Disconnecting = 3, - Connecting = 4, - Connected = 5, - Retrying = 6, -} - -export enum NetworkDeviceType { - Unknown = 0, - Wired = 1, - Wireless = 2, - Virtual = 3, -} - -/** - * @todo May be useful for ParentalSettings.feature ? - */ -export enum ParentalFeature { - Invalid = 0, - Store = 1, - Community = 2, - Profile = 3, - Friends = 4, - News = 5, - Trading = 6, - Settings = 7, - Console = 8, - Browser = 9, - ParentalSetup = 10, - Library = 11, - Test = 12, - SiteLicense = 13, - KioskMode = 14, - Max = 15, -} - -export interface StartupMovie { - strMovieURL: string; -} - -export interface CoplayData { - currentUsers: CoplayUser[]; - recentUsers: CoplayUser[]; -} - -export interface Unregisterable { - /** - * Unregister the callback. - */ - unregister(): void; -} diff --git a/src/globals/stores.ts b/src/globals/stores.ts index 119daaa6..f371a597 100644 --- a/src/globals/stores.ts +++ b/src/globals/stores.ts @@ -1,4 +1,6 @@ -import {AppData, AppDetails, LogoPosition, SteamAppOverview, SteamClient} from './SteamClient'; +import {AppData, SteamClient} from "./steam-client"; +import {AppDetails, LogoPosition, SteamAppOverview} from "./steam-client/App"; + declare global { interface Window { LocalizationManager: { diff --git a/src/modules/Router.ts b/src/modules/Router.ts index 6333a3d0..50739c2d 100644 --- a/src/modules/Router.ts +++ b/src/modules/Router.ts @@ -1,5 +1,6 @@ import { sleep } from '../utils'; -import { Export, findModuleExport } from '../webpack'; +import { Module, findModuleChild } from '../webpack'; +import { DisplayStatus } from "./steam-client/App"; export enum SideMenu { None, @@ -19,45 +20,6 @@ export enum QuickAccessTab { Decky = 999, } -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; From 539e02f2cb060375acda0a027460af2d8aa2af5e Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Sun, 2 Jun 2024 08:17:20 +0000 Subject: [PATCH 38/46] docs(SteamClient): document more notification interfaces --- .../steam-client/ClientNotifications.ts | 28 +- .../steam-client/Notifications.ts | 288 +++++++++++++++++- src/deck-components/steam-client/Overlay.ts | 22 +- src/deck-components/steam-client/UI.ts | 8 +- src/deck-components/steam-client/WebChat.ts | 3 +- src/deck-components/steam-client/index.ts | 79 ++++- 6 files changed, 371 insertions(+), 57 deletions(-) diff --git a/src/deck-components/steam-client/ClientNotifications.ts b/src/deck-components/steam-client/ClientNotifications.ts index 7e0bd1ca..4f9d70e4 100644 --- a/src/deck-components/steam-client/ClientNotifications.ts +++ b/src/deck-components/steam-client/ClientNotifications.ts @@ -1,20 +1,38 @@ +import { BrowserContext } from "./index"; + export interface ClientNotifications { /** * Displays a Steam notification. - * @param {ClientUINotification} notification - Notification type. - * @param {string} options - Stringified object of `NotificationOptions`. + * @param {ClientUINotificationType} notification - Notification type. + * @param {string} options - Stringified object of {@link SteamNotificationOptions}. * @param {function} callback */ - DisplayClientNotification(notification: ClientUINotification, options: string, callback: any): void; + DisplayClientNotification( + notification: ClientUINotificationType, + options: string, + callback: (browser: BrowserContext) => void, + ): void; /** * @param notificationId The ID of the notification to handle. - * @param handleAction `true` to habdle the associated notification action, `false` otherwise. + * @param handleAction `true` to execute the callback function associated with the notification, `false` otherwise. */ OnRespondToClientNotification(notificationId: number, handleAction: boolean): void; } -export enum ClientUINotification { +export interface SteamNotificationOptions { + body: string; + chatroomgroupid?: number; + chatroomid?: number; + icon?: string; + state: string; + /** A Steam64 ID. */ + steamid: string; + tag?: string; + title?: string; +} + +export enum ClientUINotificationType { GroupChatMessage = 1, FriendChatMessage = 2, FriendPersonaState = 3, diff --git a/src/deck-components/steam-client/Notifications.ts b/src/deck-components/steam-client/Notifications.ts index 2bde10d2..58dbf294 100644 --- a/src/deck-components/steam-client/Notifications.ts +++ b/src/deck-components/steam-client/Notifications.ts @@ -1,20 +1,89 @@ -import {ClientUINotification} from "./ClientNotifications"; import {JsPbMessage, Unregisterable} from "./index"; +// Everything is taken from here: +// https://github.com/SteamDatabase/SteamTracking/blob/master/Protobufs/steammessages_clientnotificationtypes.proto + export interface Notifications { /** - * If `data` is deserialized, returns {@link ClientNotificationFriendMessage}, - * or {@link ClientNotificationGroupChatMessage}. + * If `data` is deserialized, returns one of the following here: {@link Notifications} * @returns {Unregisterable | any} - An object that can be used to unregister the callback. */ RegisterForNotifications( - callback: (notificationIndex: number, type: ClientUINotification, data: ArrayBuffer) => void, + callback: (notificationIndex: number, type: EClientNotificationType, data: ArrayBuffer) => void, ): Unregisterable | any; } -/** - * CClientNotificationGroupChatMessage - */ +export enum EClientNotificationType { + Invalid, + DownloadComplete, + FriendInvite, + FriendInGame, + FriendOnline, + Achievement, + LowBattery, + SystemUpdate, + FriendMessage, + GroupChatMessage, + FriendInviteRollup, + FamilySharingDeviceAuthorizationChanged, + FamilySharingStopPlaying, + FamilySharingLibraryAvailable, + Screenshot, + CloudSyncFailure, + CloudSyncConflict, + IncomingVoiceChat, + ClaimSteamDeckRewards, + GiftReceived, + ItemAnnouncement, + HardwareSurvey, + LowDiskSpace, + BatteryTemperature, + DockUnsupportedFirmware, + PeerContentUpload, + CannotReadControllerGuideButton, + Comment, + Wishlist, + TradeOffer, + AsyncGame, + General, + HelpRequest, + OverlaySplashScreen, + BroadcastAvailableToWatch, + TimedTrialRemaining, + LoginRefresh, + MajorSale, + TimerExpired, + ModeratorMsg, + SteamInputActionSetChanged, + RemoteClientConnection, + RemoteClientStartStream, + StreamingClientConnection, + FamilyInvite, + PlaytimeWarning, + FamilyPurchaseRequest, + FamilyPurchaseRequestResponse, + ParentalFeatureRequest, + ParentalPlaytimeRequest, + GameRecordingError, + ParentalFeatureResponse, + ParentalPlaytimeResponse, + RequestedGameAdded, + ClipDownloaded, + GameRecordingStart, + GameRecordingStop, +} + +export enum ESystemUpdateNotificationType { + Invalid, + Available, + NeedsRestart, +} + +export enum EGameRecordingErrorType { + General = 1, + LowDiskSpace, +} + export interface ClientNotificationGroupChatMessage extends JsPbMessage { tag(): string; @@ -36,9 +105,6 @@ export interface ClientNotificationGroupChatMessage extends JsPbMessage { notificationid(): number; } -/** - * CClientNotificationFriendMessage - */ export interface ClientNotificationFriendMessage extends JsPbMessage { body(): string; @@ -54,4 +120,204 @@ export interface ClientNotificationFriendMessage extends JsPbMessage { tag(): string; title(): string; -} \ No newline at end of file +} + +export interface ClientNotificationCloudSyncFailure extends JsPbMessage { + appid(): number; +} + +export interface ClientNotificationCloudSyncConflict extends JsPbMessage { + appid(): number; +} + +export interface ClientNotificationScreenshot extends JsPbMessage { + screenshot_handle(): string; + description(): string; + local_url(): string; +} + +export interface ClientNotificationDownloadCompleted extends JsPbMessage { + appid(): number; + dlc_appid(): number; +} + +export interface ClientNotificationFriendInvite extends JsPbMessage { + steamid(): number; +} + +export interface ClientNotificationFriendInviteRollup extends JsPbMessage { + new_invite_count(): number; +} + +export interface ClientNotificationFriendInGame extends JsPbMessage { + steamid(): number; + game_name(): string; +} + +export interface ClientNotificationFriendOnline extends JsPbMessage { + steamid(): number; +} + +export interface ClientNotificationAchievement extends JsPbMessage { + achievement_id(): string; + appid(): number; + name(): string; + description(): string; + image_url(): string; + achieved(): boolean; + rtime_unlocked(): number; + min_progress(): number; + current_progress(): number; + max_progress(): number; + global_achieved_pct(): number; +} + +export interface ClientNotificationLowBattery extends JsPbMessage { + pct_remaining(): number; +} + +export interface ClientNotificationSystemUpdate extends JsPbMessage { + type(): ESystemUpdateNotificationType; +} + +export interface ClientNotificationFriendMessage extends JsPbMessage { + tag(): string; + steamid(): string; + title(): string; + body(): string; + icon(): string; + notificationid(): number; + response_steamurl(): string; +} + +export interface ClientNotificationGroupChatMessage extends JsPbMessage { + tag(): string; + steamid_sender(): string; + chat_group_id(): string; + chat_id(): string; + title(): string; + body(): string; + rawbody(): string; + icon(): string; + notificationid(): number; +} + +export interface ClientNotificationFamilySharingDeviceAuthorizationChanged extends JsPbMessage { + accountid_owner(): number; + authorized(): boolean; +} + +export interface ClientNotificationFamilySharingStopPlaying extends JsPbMessage { + accountid_owner(): number; + seconds_remaining(): number; + appid(): number; +} + +export interface ClientNotificationFamilySharingLibraryAvailable extends JsPbMessage { + accountid_owner(): number; +} + +export interface ClientNotificationIncomingVoiceChat extends JsPbMessage { + steamid(): number; +} + +export interface ClientNotificationClaimSteamDeckRewards extends JsPbMessage { +} + +export interface ClientNotificationGiftReceived extends JsPbMessage { + sender_name(): string; +} + +export interface ClientNotificationItemAnnouncement extends JsPbMessage { + new_item_count(): number; + new_backpack_items(): boolean; +} + +export interface ClientNotificationHardwareSurveyPending extends JsPbMessage { +} + +export interface ClientNotificationLowDiskSpace extends JsPbMessage { + folder_index(): number; +} + +export interface ClientNotificationBatteryTemperature extends JsPbMessage { + temperature(): number; + notification_type(): string; +} + +export interface ClientNotificationDockUnsupportedFirmware extends JsPbMessage { +} + +export interface ClientNotificationPeerContentUpload extends JsPbMessage { + appid(): number; + peer_name(): string; +} + +export interface ClientNotificationCannotReadControllerGuideButton extends JsPbMessage { + controller_index(): number; +} + +export interface ClientNotificationOverlaySplashScreen extends JsPbMessage { +} + +export interface ClientNotificationBroadcastAvailableToWatch extends JsPbMessage { + broadcast_permission(): number; +} + +export interface ClientNotificationTimedTrialRemaining extends JsPbMessage { + appid(): number; + icon(): string; + offline(): boolean; + allowed_seconds(): number; + played_seconds(): number; +} + +export interface ClientNotificationLoginRefresh extends JsPbMessage { +} + +export interface ClientNotificationTimerExpired extends JsPbMessage { +} + +export interface ClientNotificationSteamInputActionSetChanged extends JsPbMessage { + controller_index(): number; + action_set_name(): string; +} + +export interface ClientNotificationRemoteClientConnection extends JsPbMessage { + machine(): string; + connected(): boolean; +} + +export interface ClientNotificationRemoteClientStartStream extends JsPbMessage { + machine(): string; + game_name(): string; +} + +export interface ClientNotificationStreamingClientConnection extends JsPbMessage { + hostname(): string; + machine(): string; + connected(): boolean; +} + +export interface ClientNotificationPlaytimeWarning extends JsPbMessage { + type(): string; + playtime_remaining(): number; +} + +export interface ClientNotificationGameRecordingError extends JsPbMessage { + game_id(): number; + error_type(): EGameRecordingErrorType; +} + +export interface ClientNotificationClipDownloaded extends JsPbMessage { + clip_id(): string; +} + +export interface ClientNotificationGameRecordingStart extends JsPbMessage { + game_id(): number; +} + +export interface ClientNotificationGameRecordingStop extends JsPbMessage { + game_id(): number; + clip_id(): string; +} diff --git a/src/deck-components/steam-client/Overlay.ts b/src/deck-components/steam-client/Overlay.ts index 1698690e..fb62fefb 100644 --- a/src/deck-components/steam-client/Overlay.ts +++ b/src/deck-components/steam-client/Overlay.ts @@ -1,5 +1,4 @@ -import {Unregisterable} from "./index"; -import {UIMode} from "./UI"; +import {EBrowserType, UIMode, Unregisterable} from "./index"; export interface Overlay { /** @@ -74,7 +73,7 @@ export enum NotificationPosition { export interface OverlayBrowserInfo { appID: number; - eBrowserType: BrowserType; + eBrowserType: EBrowserType; eUIMode: UIMode; flDisplayScale?: number; gameID: string; @@ -87,23 +86,6 @@ export interface OverlayBrowserInfo { unPID: number; } -export enum BrowserType { - OffScreen = 0, - OpenVROverlay = 1, - OpenVROverlay_Dashboard = 2, - DirectHWND = 3, - DirectHWND_Borderless = 4, - DirectHWND_Hidden = 5, - ChildHWNDNative = 6, - Transparent_Toplevel = 7, - OffScreen_SharedTexture = 8, - OffScreen_GameOverlay = 9, - OffScreen_GameOverlay_SharedTexture = 10, - Offscreen_FriendsUI = 11, - Offscreen_SteamUI = 12, - OpenVROverlay_Subview = 13, -} - export interface OverlayBrowserProtocols { unAppID: number; strScheme: string; diff --git a/src/deck-components/steam-client/UI.ts b/src/deck-components/steam-client/UI.ts index 062cc4ce..b4e16222 100644 --- a/src/deck-components/steam-client/UI.ts +++ b/src/deck-components/steam-client/UI.ts @@ -1,4 +1,4 @@ -import {Unregisterable} from "./index"; +import {UIMode, Unregisterable} from "./index"; import {OSType} from "./system"; export interface UI { @@ -42,12 +42,6 @@ export interface UI { SetUIMode(mode: UIMode): void; } -export enum UIMode { - Unknown = -1, - GamePad = 4, - Desktop = 7, -} - export interface OSEndOfLifeInfo { bOSWillBeUnsupported: boolean; osType: OSType; diff --git a/src/deck-components/steam-client/WebChat.ts b/src/deck-components/steam-client/WebChat.ts index be8c21f1..c3eb46b6 100644 --- a/src/deck-components/steam-client/WebChat.ts +++ b/src/deck-components/steam-client/WebChat.ts @@ -1,6 +1,5 @@ import {OverlayBrowserInfo} from "./Overlay"; -import {UIMode} from "./UI"; -import {Unregisterable} from "./index"; +import {UIMode, Unregisterable} from "./index"; export interface WebChat { BSuppressPopupsInRestore(): Promise<boolean>; diff --git a/src/deck-components/steam-client/index.ts b/src/deck-components/steam-client/index.ts index da0895d5..8ee1ec66 100644 --- a/src/deck-components/steam-client/index.ts +++ b/src/deck-components/steam-client/index.ts @@ -202,6 +202,73 @@ export enum Result { LimitedUserAccount = 112, } +export enum EBrowserType { + /** + * No window is created (like SharedJSContext). + */ + OffScreen, + OpenVROverlay, + OpenVROverlay_Dashboard, + /** + * A normal window. + */ + DirectHWND, + /** + * A borderless window. + */ + DirectHWND_Borderless, + /** + * An initially hidden window. + * May be shown with {@link SteamClient.Window.ShowWindow}. + */ + DirectHWND_Hidden, + ChildHWNDNative, + /** + * A transparent borderless window. + * Always on top of other windows, does not have a taskbar icon and not focusable. + */ + Transparent_Toplevel, + OffScreen_SharedTexture, + OffScreen_GameOverlay, + OffScreen_GameOverlay_SharedTexture, + Offscreen_FriendsUI, + Offscreen_SteamUI, + OpenVROverlay_Subview, +} + +export enum UIMode { + Unknown = -1, + GamePad = 4, + Desktop = 7, +} + +export interface BrowserContext { + /** + * Window type. + */ + m_eBrowserType?: EBrowserType; + /** + * The UI mode in use. + */ + m_eUIMode?: UIMode; + /** + * @todo Appears when EBrowserType == 0 ? + */ + m_gameID?: string; + /** + * @todo Same as `SteamClient.Browser.GetBrowserID()` ? + */ + m_nBrowserID: number; + /** + * Game's app ID. + */ + m_unAppID?: number; + /** + * If overlay, game's PID. + */ + m_unPID: number; +} + /** * Represents the response of an operation. It appears to be not necessary to await for this operation response. It is only used to indicate the result of an operation. */ @@ -266,18 +333,6 @@ export interface AppData { // more } -export interface NotificationOptions { - body: string; - chatroomgroupid?: number; - chatroomid?: number; - icon?: string; - state: string; - /** A Steam64 ID. */ - steamid: string; - tag?: string; - title?: string; -} - export interface SteamDatagramLinkInstantaneousStats { out_packets_per_sec_x10: number | undefined; out_bytes_per_sec: number | undefined; From 761cdff65cf2d2c31dac87128c7a0d364e582cb9 Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:46:29 +0000 Subject: [PATCH 39/46] docs(SteamClient): document more interfaces --- src/deck-components/steam-client/App.ts | 1 + src/deck-components/steam-client/Downloads.ts | 1 - src/deck-components/steam-client/Friends.ts | 19 ++++- src/deck-components/steam-client/OpenVR.ts | 25 +++++- src/deck-components/steam-client/Settings.ts | 10 +-- src/deck-components/steam-client/UI.ts | 27 ++++-- src/deck-components/steam-client/WebChat.ts | 9 +- .../steam-client/WebUITransport.ts | 11 ++- src/deck-components/steam-client/Window.ts | 82 ++++++++++++------- 9 files changed, 134 insertions(+), 51 deletions(-) diff --git a/src/deck-components/steam-client/App.ts b/src/deck-components/steam-client/App.ts index 703d0b62..16cc1524 100644 --- a/src/deck-components/steam-client/App.ts +++ b/src/deck-components/steam-client/App.ts @@ -473,6 +473,7 @@ export interface Apps { /** * @todo returns undefined (now)? + * @todo does not exist on Steam Version: 1718064497 */ RegisterForLocalizationChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; diff --git a/src/deck-components/steam-client/Downloads.ts b/src/deck-components/steam-client/Downloads.ts index b2c4ad15..53dd1da7 100644 --- a/src/deck-components/steam-client/Downloads.ts +++ b/src/deck-components/steam-client/Downloads.ts @@ -68,7 +68,6 @@ export interface Downloads { * Sets an app to launch when its download is complete. * @param {number} appId - The ID of the application to set. * @returns {void} - * @todo: unsure if this toggles though */ SetLaunchOnUpdateComplete(appId: number): void; diff --git a/src/deck-components/steam-client/Friends.ts b/src/deck-components/steam-client/Friends.ts index 5a140f55..e01330d0 100644 --- a/src/deck-components/steam-client/Friends.ts +++ b/src/deck-components/steam-client/Friends.ts @@ -1,3 +1,5 @@ +import { Unregisterable } from "./index"; + /** * Represents functions related to managing friends in Steam. */ @@ -9,10 +11,13 @@ export interface Friends { */ AddFriend(steamId: string): Promise<boolean>; + /** + * @returns a list of players you recently played with. + */ GetCoplayData(): Promise<CoplayData>; //(e.ConvertTo64BitString(), t.steamidTarget) - InviteUserToCurrentGame(param0: any, param1: any): any; + InviteUserToCurrentGame(steam64Id: string, param1: any): any; /** * Invites a user to a specific game. @@ -24,12 +29,12 @@ export interface Friends { InviteUserToGame(steamId: string, appId: number, connectString: string): Promise<boolean>; //(e.ConvertTo64BitString(), t.steamidTarget) - InviteUserToLobby(param0: any, param1: any): any; + InviteUserToLobby(steam64Id: string, param1: any): any; //(e.ConvertTo64BitString()) - InviteUserToRemotePlayTogetherCurrentGame(param0: any): any; + InviteUserToRemotePlayTogetherCurrentGame(steam64Id: string): any; - RegisterForVoiceChatStatus(callback: (status: any) => void): any; + RegisterForVoiceChatStatus(callback: (status: VoiceChatStatus) => void): Unregisterable | any; /** * Removes a user from the friend list. @@ -48,4 +53,10 @@ export interface CoplayUser { accountid: number; rtTimePlayed: number; appid: number; +} + +export interface VoiceChatStatus { + bVoiceChatActive: boolean; + bMicMuted: boolean; + bOutputMuted: boolean; } \ No newline at end of file diff --git a/src/deck-components/steam-client/OpenVR.ts b/src/deck-components/steam-client/OpenVR.ts index d89bb3d3..dde8a9af 100644 --- a/src/deck-components/steam-client/OpenVR.ts +++ b/src/deck-components/steam-client/OpenVR.ts @@ -21,7 +21,7 @@ export interface OpenVR { RegisterForButtonPress: Unregisterable | any; - RegisterForHMDActivityLevelChanged(callback: (m_eHMDActivityLevel: any) => void): Unregisterable | any; + RegisterForHMDActivityLevelChanged(callback: (m_eHMDActivityLevel: EHMDActivityLevel) => void): Unregisterable | any; RegisterForInstallDialog: Unregisterable | any; @@ -60,7 +60,10 @@ export interface DeviceProperties { export interface Keyboard { Hide(): any; - RegisterForStatus(callback: (m_bIsKeyboardOpen: boolean, m_eKeyboardFlags: any, m_sInitialKeyboardText: string) => void): Unregisterable | any; + /** + * {@link EKeyboardFlags} could be useful here + */ + RegisterForStatus(callback: (m_bIsKeyboardOpen: boolean, m_eKeyboardFlags: number, m_sInitialKeyboardText: string) => void): Unregisterable | any; SendDone(): any; @@ -100,4 +103,20 @@ export interface VROverlay { ShowDashboard: any; SwitchToDashboardOverlay(param0: string): void; -} \ No newline at end of file +} + +export enum EHMDActivityLevel { + Unknown = -1, + Idle, + UserInteraction, + UserInteraction_Timeout, + Standby, + Idle_Timeout, +} + +export enum EKeyboardFlags { + Minimal = 1 << 0, + Modal = 1 << 1, + ShowArrowKeys = 1 << 2, + HideDoneKey = 1 << 3, +} diff --git a/src/deck-components/steam-client/Settings.ts b/src/deck-components/steam-client/Settings.ts index 61e17446..5d5bb06c 100644 --- a/src/deck-components/steam-client/Settings.ts +++ b/src/deck-components/steam-client/Settings.ts @@ -1,5 +1,5 @@ import {CompatibilityToolInfo} from "./App"; -import {JsPbMessage, Unregisterable} from "./index"; +import {JsPbMessage, OperationResponse, Unregisterable} from "./index"; export interface Settings { AddClientBeta(name: string, password: string): void; @@ -91,19 +91,19 @@ export interface Settings { */ SetSaveAccountCredentials(value: boolean): void; - SetSetting: any; + SetSetting(serializedBase64: string): any; SetSteamPlayEnabled(value: boolean): void; SetTimeZone(timezoneId: string): void; // You can get valid timezoneIds from GetAvailableTimeZones() - SetUseNintendoButtonLayout: any; + + SetUseNintendoButtonLayout(controllerIndex: number, value: boolean): void; SetWindowed(value: boolean): void; SpecifyGlobalCompatTool(strToolName: string): void; - // "{"result":2,"message":""}" - ToggleSteamInstall(): any; + ToggleSteamInstall(): Promise<OperationResponse>; } export interface AccountSettings { diff --git a/src/deck-components/steam-client/UI.ts b/src/deck-components/steam-client/UI.ts index b4e16222..36c798cf 100644 --- a/src/deck-components/steam-client/UI.ts +++ b/src/deck-components/steam-client/UI.ts @@ -24,7 +24,15 @@ export interface UI { RegisterDesiredSteamUIWindowsChanged(callback: () => void): Unregisterable | any; - RegisterForClientConVar: any; + /** + * Registers a callback function to be called when a convar's value gets changed. + * + * Hard crashes if such a convar does not exist or if you can't set it. + * + * @param convar The ConVar to watch. + * @param callback The callback function to be called. + */ + RegisterForClientConVar(convar: string, callback: (value: string) => void): Unregisterable | any; RegisterForErrorCondition(callback: (param0: number, param1: number) => void): Unregisterable | any; @@ -42,6 +50,18 @@ export interface UI { SetUIMode(mode: UIMode): void; } +export enum EWindowType { + MainGamepadUI, + OverlayGamepadUI, + Keyboard, + ControllerConfigurator, + VR, + MainDesktopUI, + DesktopLogin, + OverlayDesktopUI, + SteamChinaReviewLauncher, +} + export interface OSEndOfLifeInfo { bOSWillBeUnsupported: boolean; osType: OSType; @@ -54,10 +74,7 @@ export interface SteamWindow { strAppName: string; unID: number; unPID: number; - /** - * @todo enum - */ - windowType: number; + windowType: EWindowType; x: number; y: number; } \ No newline at end of file diff --git a/src/deck-components/steam-client/WebChat.ts b/src/deck-components/steam-client/WebChat.ts index c3eb46b6..a1050f4c 100644 --- a/src/deck-components/steam-client/WebChat.ts +++ b/src/deck-components/steam-client/WebChat.ts @@ -76,8 +76,8 @@ export interface WebChat { RegisterForFriendPostMessage(callback: (data: FriendChatDialogData) => void): Unregisterable | any; /** + * To unregister, use {@link UnregisterForMouseXButtonDown}. * @returns {void} - * @todo To unregister, use WebChat.UnregisterForMouseXButtonDown() ? */ RegisterForMouseXButtonDown(callback: any): void; @@ -120,7 +120,10 @@ export interface WebChat { */ ShowFriendChatDialog(steamid: string): void; - UnregisterForMouseXButtonDown(): void; + /** + * @todo does this take any args at all lol + */ + UnregisterForMouseXButtonDown(callback: any): void; } export enum ComputerActiveState { @@ -148,7 +151,7 @@ export interface PushToTalkInfo { bPushToMute: boolean; /** * Push-to-talk hotkey. - * @todo enum? + * @todo enum? this is not EHIDKeyboardKey */ vkHotKey: number; /** Push-to-talk hotkey name. */ diff --git a/src/deck-components/steam-client/WebUITransport.ts b/src/deck-components/steam-client/WebUITransport.ts index 8ed6ee93..ab31d7a1 100644 --- a/src/deck-components/steam-client/WebUITransport.ts +++ b/src/deck-components/steam-client/WebUITransport.ts @@ -1,7 +1,16 @@ +import { OperationResponse } from "./index"; + export interface WebUITransport { GetTransportInfo(): Promise<TransportInfo>; - NotifyTransportFailure: any; + /** + * *Possibly* notifies websocket of failure and tries to reconnect to it. + * + * The responsible message for this is `CMsgWebUITransportFailure`. + * + * @param serializedBase64 Serialized ProtoBuf message. + */ + NotifyTransportFailure(serializedBase64: string): Promise<OperationResponse>; } export interface TransportInfo { diff --git a/src/deck-components/steam-client/Window.ts b/src/deck-components/steam-client/Window.ts index 39079ed6..a8277dc3 100644 --- a/src/deck-components/steam-client/Window.ts +++ b/src/deck-components/steam-client/Window.ts @@ -2,22 +2,26 @@ import {UIComposition} from "./Overlay"; /** * Represents functionality for managing Steam's windows. - * Note that methods here have to be called from the window you want to use. + * + * "Restore details" here refers to a string that is similiar to + * `1&x=604&y=257&w=1010&h=600`, which is usable with certain + * `window.open()` parameters and methods from here. + * + * Note that methods here have to be called from the + * window you want to use (not SharedJSContext). */ export interface Window { - BringToFront(forceOS?: WindowBringToFront): any; + BringToFront(forceOS?: WindowBringToFront): void; /** - * @todo Shuts down Steam too? + * Closes the window. */ - Close(): any; + Close(): void; /** - * Is the Steam window fullscreen? - * @param {function} callback - The callback function to be called to receive the fullscreen state. - * @returns {void} + * @returns the window's fullscreen state. */ - DefaultMonitorHasFullscreenWindow(callback: (fullscreen: boolean) => void): void; + DefaultMonitorHasFullscreenWindow(): Promise<boolean>; /** * Flashes the window in the taskbar. @@ -25,21 +29,22 @@ export interface Window { */ FlashWindow(): void; + GetDefaultMonitorDimensions(): Promise<MonitorDimensions>; + /** - * @todo Returns 0? + * @returns the mouse position's restore details. */ - GetDefaultMonitorDimensions(callback: (param0: number) => void): void; - - GetMousePositionDetails(callback: (details: string) => void): void; + GetMousePositionDetails(): Promise<string>; /** - * Gets the window X position. - * @param {function} callback - The callback function to be called to receive the X position. - * @returns {void} + * @returns the window's dimensions. */ - GetWindowDimensions(callback: (x: number) => void): void; + GetWindowDimensions(): Promise<WindowDimensions>; - GetWindowRestoreDetails(callback: (details: string) => void): void; + /** + * @returns the window's restore details. + */ + GetWindowRestoreDetails(): Promise<string>; /** * Hides the window. @@ -48,18 +53,14 @@ export interface Window { HideWindow(): void; /** - * Is the window maximized? - * @param {function} callback - The callback function to be called to receive the maximized state. - * @returns {void} + * @returns the window's maximized state. */ - IsWindowMaximized(callback: (maximized: boolean) => void): void; + IsWindowMaximized(): Promise<boolean>; /** - * Is the window minimized? - * @param {function} callback - The callback function to be called to receive the minimized state. - * @returns {void} + * @returns the window's minimized state. */ - IsWindowMinimized(callback: (minimized: boolean) => void): void; + IsWindowMinimized(): Promise<boolean>; MarkLastFocused(): void; @@ -88,7 +89,7 @@ export interface Window { /** * Moves the window relatively to given details. - * @param {string} details - Window details string from `Window.GetWindowRestoreDetails`. + * @param {string} details - Window restore details string from {@link GetWindowRestoreDetails}. * @param {number} x - Window X position. * @param {number} y - Window Y position. * @param {number} width - Window width. @@ -126,7 +127,7 @@ export interface Window { SetAutoDisplayScale(value: boolean): void; - SetComposition(uiComposition: UIComposition, appIds: number[], windowId: number): any; + SetComposition(mode: UIComposition, appIdCompositionQueue: number[], windowId: number): void; /** * Makes the window hide, but not close on pressing the close button. @@ -159,7 +160,7 @@ export interface Window { /** * Sets the window's resize grip size. - * The window has to be created with the resize grip flag. + * The window has to be created with the resizable flag for this to take any effect. * @param {number} width - Resize grip width. * @param {number} height - Resize grip height. * @returns {void} @@ -212,4 +213,27 @@ export type WindowLocation = | 'upper-right' | 'lower-right'; -export type WindowIcon = 'steam' | 'messages' | 'voice'; \ No newline at end of file +export type WindowIcon = 'steam' | 'messages' | 'voice'; + +/** + * "Usable" here refers to space that is not taken by the taskbar. + */ +export interface MonitorDimensions { + flHorizontalScale: number; + flVerticalScale: number; + nFullHeight: number; + nFullLeft: number; + nFullTop: number; + nFullWidth: number; + nUsableHeight: number; + nUsableLeft: number; + nUsableTop: number; + nUsableWidth: number; +} + +export interface WindowDimensions { + x: number; + y: number; + width: number; + height: number; +} From b62fed0d70e1aa8db43fe5ac4cecb8ce16b6eb1e Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Sun, 23 Jun 2024 11:19:39 +0000 Subject: [PATCH 40/46] docs(SteamClient): add some descriptions --- src/deck-components/steam-client/Browser.ts | 7 +++++-- src/deck-components/steam-client/GameSessions.ts | 3 ++- src/deck-components/steam-client/Notifications.ts | 7 ++++--- src/deck-components/steam-client/SharedConnection.ts | 8 +++++++- src/deck-components/steam-client/UI.ts | 4 ++++ src/deck-components/steam-client/Window.ts | 7 +++++-- 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/deck-components/steam-client/Browser.ts b/src/deck-components/steam-client/Browser.ts index abfda5d5..6ed91980 100644 --- a/src/deck-components/steam-client/Browser.ts +++ b/src/deck-components/steam-client/Browser.ts @@ -21,7 +21,10 @@ export interface Browser { */ HideCursorUntilMouseEvent(): void; - InspectElement(clientY: number, clientX: number): void; // yup that's right, clientY and clientX are reversed + /** + * yup that's right, clientY and clientX are reversed + */ + InspectElement(clientY: number, clientX: number): void; NotifyUserActivation(): void; @@ -42,7 +45,7 @@ export interface Browser { ReplaceMisspelling: any; /** - * Restarts the browser. + * Restarts the Steam JS context. * @returns {void} */ RestartJSContext(): void; diff --git a/src/deck-components/steam-client/GameSessions.ts b/src/deck-components/steam-client/GameSessions.ts index 11946fae..5d41a1a4 100644 --- a/src/deck-components/steam-client/GameSessions.ts +++ b/src/deck-components/steam-client/GameSessions.ts @@ -1,5 +1,6 @@ import {Unregisterable} from "./index"; -import {AppAchievements, Screenshot} from "./App"; +import {AppAchievements} from "./App"; +import { Screenshot } from "./Screenshots"; /** * Represents functions related to Steam Game Sessions. diff --git a/src/deck-components/steam-client/Notifications.ts b/src/deck-components/steam-client/Notifications.ts index 58dbf294..dbb25933 100644 --- a/src/deck-components/steam-client/Notifications.ts +++ b/src/deck-components/steam-client/Notifications.ts @@ -1,8 +1,9 @@ import {JsPbMessage, Unregisterable} from "./index"; -// Everything is taken from here: -// https://github.com/SteamDatabase/SteamTracking/blob/master/Protobufs/steammessages_clientnotificationtypes.proto - +/** + * Everything is taken from here: + * https://github.com/SteamDatabase/SteamTracking/blob/master/Protobufs/steammessages_clientnotificationtypes.proto + */ export interface Notifications { /** * If `data` is deserialized, returns one of the following here: {@link Notifications} diff --git a/src/deck-components/steam-client/SharedConnection.ts b/src/deck-components/steam-client/SharedConnection.ts index 0945a66e..9894eab9 100644 --- a/src/deck-components/steam-client/SharedConnection.ts +++ b/src/deck-components/steam-client/SharedConnection.ts @@ -1,8 +1,10 @@ import {Unregisterable} from "./index"; import {SteamRealm} from "./Overlay"; +/** + * `hSharedConnection` is the number from {@link AllocateSharedConnection}. + */ export interface SharedConnection { - // hSharedConnection is the number from AllocateSharedConnection() AllocateSharedConnection(): Promise<number>; // if no such number, sends this warning: @@ -24,10 +26,14 @@ export interface SharedConnection { } export interface LogonInfo { + /** `true` if logged on, `false otherwise. */ bLoggedOn: boolean; eUniverse: SteamRealm; + /** Account username. Empty if not logged on. */ strAccountName: string; + /** URL for community content. */ strCommunityImagesURL: string; + /** Account nickname. Empty if not logged on. */ strPersonaName: string; /** Steam64 ID. */ strSteamid: string; diff --git a/src/deck-components/steam-client/UI.ts b/src/deck-components/steam-client/UI.ts index 36c798cf..e202ea46 100644 --- a/src/deck-components/steam-client/UI.ts +++ b/src/deck-components/steam-client/UI.ts @@ -67,6 +67,10 @@ export interface OSEndOfLifeInfo { osType: OSType; } +/** + * The following might have more correct information: + * https://github.com/SteamDatabase/SteamTracking/blob/master/Protobufs/webuimessages_sharedjscontext.proto + */ export interface SteamWindow { appid: number; hwndParent: number; diff --git a/src/deck-components/steam-client/Window.ts b/src/deck-components/steam-client/Window.ts index a8277dc3..ca488de0 100644 --- a/src/deck-components/steam-client/Window.ts +++ b/src/deck-components/steam-client/Window.ts @@ -99,13 +99,16 @@ export interface Window { * @example * Move the window to bottom right by 50 pixels: * ``` - * SteamClient.Window.GetWindowRestoreDetails(e => { + * SteamClient.Window.GetWindowRestoreDetails((e) => { * SteamClient.Window.PositionWindowRelative(e, 50, 50, 0, 0); - * }) + * }); * ``` */ PositionWindowRelative(details: string, x: number, y: number, width: number, height: number): void; + /** + * @returns true if yje naun [tpcess od about to shut down.] + */ ProcessShuttingDown(): Promise<boolean>; /** From 8102f284815551ed968b4540750f1f66ad8eb1c5 Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Sun, 23 Jun 2024 12:00:14 +0000 Subject: [PATCH 41/46] docs(SteamClient): remove duplicate types --- src/deck-components/steam-client/App.ts | 426 ++++++++---------- src/deck-components/steam-client/Auth.ts | 4 +- src/deck-components/steam-client/Broadcast.ts | 27 +- src/deck-components/steam-client/Browser.ts | 11 +- .../steam-client/ClientNotifications.ts | 10 +- src/deck-components/steam-client/Cloud.ts | 12 +- .../steam-client/CommunityItems.ts | 2 +- src/deck-components/steam-client/Console.ts | 15 +- src/deck-components/steam-client/Downloads.ts | 43 +- .../steam-client/FamilySharing.ts | 6 +- .../steam-client/FriendSettings.ts | 10 +- src/deck-components/steam-client/Friends.ts | 20 +- src/deck-components/steam-client/GameNotes.ts | 2 +- .../steam-client/GameSessions.ts | 20 +- src/deck-components/steam-client/Input.ts | 82 ++-- .../steam-client/InstallFolder.ts | 53 +-- src/deck-components/steam-client/Installs.ts | 42 +- src/deck-components/steam-client/Messaging.ts | 4 +- src/deck-components/steam-client/Music.ts | 26 +- .../steam-client/Notifications.ts | 4 +- src/deck-components/steam-client/OpenVR.ts | 32 +- src/deck-components/steam-client/Overlay.ts | 37 +- src/deck-components/steam-client/Parental.ts | 15 +- .../steam-client/RemotePlay.ts | 44 +- .../steam-client/Screenshots.ts | 56 ++- .../steam-client/ServerBrowser.ts | 103 ++--- src/deck-components/steam-client/Settings.ts | 20 +- .../steam-client/SharedConnection.ts | 8 +- src/deck-components/steam-client/Stats.ts | 2 +- .../steam-client/SteamChina.ts | 2 +- src/deck-components/steam-client/Storage.ts | 2 +- src/deck-components/steam-client/Streaming.ts | 36 +- src/deck-components/steam-client/UI.ts | 18 +- src/deck-components/steam-client/URL.ts | 10 +- src/deck-components/steam-client/Updates.ts | 6 +- src/deck-components/steam-client/User.ts | 40 +- src/deck-components/steam-client/WebChat.ts | 37 +- .../steam-client/WebUITransport.ts | 2 +- src/deck-components/steam-client/Window.ts | 61 +-- .../browser-view/BrowserViewPopup.ts | 60 +-- .../steam-client/browser-view/index.ts | 2 +- src/deck-components/steam-client/index.ts | 2 +- .../steam-client/system/Audio.ts | 74 +-- .../steam-client/system/AudioDevice.ts | 6 +- .../steam-client/system/Bluetooth.ts | 48 +- .../steam-client/system/Devkit.ts | 4 +- .../steam-client/system/Display.ts | 2 +- .../steam-client/system/DisplayManager.ts | 4 +- .../steam-client/system/Dock.ts | 4 +- .../steam-client/system/Perf.ts | 8 +- .../steam-client/system/Report.ts | 2 +- src/deck-components/steam-client/system/UI.ts | 6 +- .../steam-client/system/index.ts | 21 +- .../steam-client/system/network/Device.ts | 2 +- .../steam-client/system/network/index.ts | 12 +- 55 files changed, 737 insertions(+), 870 deletions(-) diff --git a/src/deck-components/steam-client/App.ts b/src/deck-components/steam-client/App.ts index 16cc1524..8b01994d 100644 --- a/src/deck-components/steam-client/App.ts +++ b/src/deck-components/steam-client/App.ts @@ -7,86 +7,79 @@ import {FilePrivacyState, Screenshot} from "./Screenshots"; export interface Apps { /** * Adds a non-Steam application shortcut to the local Steam library. - * @param {string} appName - The name of the non-Steam application. - * @param {string} executablePath - The path to the executable file of the non-Steam application. - * @param {string} directory - The working directory for the non-Steam application. - * @param {string} launchOptions - Options to be passed when launching the non-Steam application. - * @returns {Promise<number>} - A Promise that resolves to a unique AppID assigned to the added non-Steam application shortcut. + * @param appName The name of the non-Steam application. + * @param executablePath The path to the executable file of the non-Steam application. + * @param directory The working directory for the non-Steam application. + * @param launchOptions Options to be passed when launching the non-Steam application. + * @returns A Promise that resolves to a unique AppID assigned to the added non-Steam application shortcut. */ AddShortcut(appName: string, executablePath: string, directory: string, launchOptions: string): Promise<number>; /** * Adds user tags to specified apps in the Steam library. - * @param {number[]} appIds - The IDs of the apps to which user tags will be added. - * @param {string} userTag - The user tag to be added. - * @returns {void} + * @param appIds The IDs of the apps to which user tags will be added. + * @param userTag The user tag to be added. * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. */ AddUserTagToApps(appIds: number[], userTag: string): void; /** * Backups an app to the specified path. - * @param {number} appId - The ID of the application to back up. - * @param {string} backupToPath - The path to store the backup. - * @returns {number} A Promise that resolves to a number. This value may be "20" for backup busy and "0" for success. + * @param appId The ID of the application to back up. + * @param backupToPath The path to store the backup. + * @returns A Promise that resolves to a number. This value may be "20" for backup busy and "0" for success. */ BackupFilesForApp(appId: number, backupToPath: string): Promise<number>; /** * Opens the screenshot folder for a specific app. - * @param {string} appId - The ID of the app to browse screenshots for. - * @param {number} handle - The screenshot handle to use. - * @returns {void} + * @param appId The ID of the app to browse screenshots for. + * @param handle The screenshot handle to use. */ BrowseScreenshotForApp(appId: string, handle: number): void; /** * Opens the screenshot folder for a specific app. - * @param {string} appId - The ID of the app to browse screenshots for. - * @returns {void} + * @param appId The ID of the app to browse screenshots for. */ BrowseScreenshotsForApp(appId: string): void; /** * Cancels the current backup process. - * @returns {void} */ CancelBackup(): void; /** * Cancels a specific game action. - * @param {number} gameActionId - The ID of the game action to cancel. - * @returns {void} + * @param gameActionId The ID of the game action to cancel. */ CancelGameAction(gameActionId: number): void; /** * Cancels the launch of an application with the specified ID. - * @param {string} appId - The ID of the application whose launch is to be canceled. - * @returns {void} + * @param appId The ID of the application whose launch is to be canceled. */ CancelLaunch(appId: string): void; /** * Clears existing user tags on a specified application and sets new user tags. - * @param {number} appId - The ID of the application to clear and set user tags for. - * @param {string[]} userTags - An array of user tags to set for the application. - * @returns {void} + * @param appId The ID of the application to clear and set user tags for. + * @param userTags An array of user tags to set for the application. * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. */ ClearAndSetUserTagsOnApp(appId: number, userTags: string[]): void; /** * Clears the custom artwork for a given application. - * @param {number} appId - The ID of the application to clear custom artwork for. - * @param {AppArtworkAssetType} assetType - The type of artwork to clear. + * @param appId The ID of the application to clear custom artwork for. + * @param assetType The type of artwork to clear. */ ClearCustomArtworkForApp(appId: number, assetType: AppArtworkAssetType): Promise<void>; /** * Clears the custom logo position for a specific application. - * @param {number} appId - The ID of the application. - * @returns {Promise<void>} - A Promise that resolves once the custom logo position is cleared. + * @param appId The ID of the application. + * @returns A Promise that resolves once the custom logo position is cleared. */ ClearCustomLogoPositionForApp(appId: number): Promise<void>; @@ -94,71 +87,67 @@ export interface Apps { /** * Clears user tags on a list of specified applications. - * @param {number[]} appIds - An array of application IDs for which to clear user tags. - * @returns {void} + * @param appIds An array of application IDs for which to clear user tags. * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. */ ClearUserTagsOnApps(appIds: number[]): void; /** * Continues a specific game action. - * @param {number} gameActionId - The ID of the game action to continue. - * @param {string} actionType - The type of action to perform during continuation. - * @returns {void} + * @param gameActionId The ID of the game action to continue. + * @param actionType The type of action to perform during continuation. * @remarks actionType - "SkipShaders", "skip", "ShowDurationControl" todo: */ ContinueGameAction(gameActionId: number, actionType: string): void; /** * Creates a Steam application shortcut on the desktop. - * @param {number} appId - The ID of the application for which to create a desktop shortcut. - * @returns {void} + * @param appId The ID of the application for which to create a desktop shortcut. */ CreateDesktopShortcutForApp(appId: number): void; /** * Download a workshop item. - * @param {number} appId - The ID of the application. - * @param {string} itemId - The ID of the workshop item. - * @param {boolean} param1 - Additional parameter (exact usage may vary). - * @returns {void} + * @param appId The ID of the application. + * @param itemId The ID of the workshop item. + * @param param1 Additional parameter (exact usage may vary). */ DownloadWorkshopItem(appId: number, itemId: string, param1: boolean): void; /** * Retrieves achievements within a specified time range for a given app. - * @param {number} appId - The ID of the application. - * @param {number} start - The start of the time range as a Unix timestamp. - * @param {number} end - The end of the time range as a Unix timestamp. - * @returns {Promise<AppAchievement[]>} - A Promise that resolves to an array of AppAchievement objects. + * @param appId The ID of the application. + * @param start The start of the time range as a Unix timestamp. + * @param end The end of the time range as a Unix timestamp. + * @returns A Promise that resolves to an array of AppAchievement objects. */ GetAchievementsInTimeRange(appId: number, start: number, end: number): Promise<AppAchievement[]>; /** * Retrieves a list of active game actions, such as launching an application. - * @returns {Promise<GameAction[]>} A Promise that resolves to an array of active game actions. + * @returns A Promise that resolves to an array of active game actions. */ GetActiveGameActions(): Promise<GameAction[]>; /** * Retrieves a list of available compatibility tools for a specific application. - * @param {number} appId - The ID of the application to retrieve compatibility tools for. - * @returns {Promise<CompatibilityToolInfo[]>} A Promise that resolves to an array of CompatibilityToolInfo objects. + * @param appId The ID of the application to retrieve compatibility tools for. + * @returns A Promise that resolves to an array of CompatibilityToolInfo objects. */ GetAvailableCompatTools(appId: number): Promise<CompatibilityToolInfo[]>; /** * Represents a function to retrieve the name of the application in a backup folder. - * @param {string} appBackupPath - The path to the application's backup folder. - * @returns {Promise<string | undefined>} - A Promise that resolves to the name of the application in the backup folder, or undefined if the path is invalid. + * @param appBackupPath The path to the application's backup folder. + * @returns A Promise that resolves to the name of the application in the backup folder, or undefined if the path is invalid. * @remarks This function checks for the "sku.sis" file in that path. */ GetBackupsInFolder(appBackupPath: string): Promise<string | undefined>; /** * Retrieves cached details for a specific application. - * @param appId - The ID of the application. - * @returns {Promise<string>} - A Promise that resolves to a stringified object. + * @param appId The ID of the application. + * @returns A Promise that resolves to a stringified object. */ GetCachedAppDetails(appId: number): Promise<string>; // todo: Parsing nightmare @@ -170,24 +159,24 @@ export interface Apps { /** * Retrieves details for a specific screenshot upload. - * @param {string} appId - The ID of the application. - * @param {number} hHandle - The handle of the screenshot upload. - * @returns {Promise<DetailsForScreenshotUpload>} - A Promise that resolves to details about the screenshot upload. + * @param appId The ID of the application. + * @param hHandle The handle of the screenshot upload. + * @returns A Promise that resolves to details about the screenshot upload. */ GetDetailsForScreenshotUpload(appId: string, hHandle: number): Promise<DetailsForScreenshotUpload>; /** * Retrieves details for multiple screenshot uploads. - * @param {string} appId - The ID of the application. - * @param {number[]} hHandles - An array of handles of the screenshot uploads. - * @returns {Promise<DetailsForScreenshotUploads>} - A Promise that resolves to details about the screenshot uploads. + * @param appId The ID of the application. + * @param hHandles An array of handles of the screenshot uploads. + * @returns A Promise that resolves to details about the screenshot uploads. */ GetDetailsForScreenshotUploads(appId: string, hHandles: number[]): Promise<DetailsForScreenshotUploads>; /** * Retrieves a list of downloaded workshop items for a specific application. - * @param {number} appId - The ID of the application to retrieve downloaded workshop items for. - * @returns {Promise<WorkshopItem[]>} - A Promise that resolves to an array of downloaded workshop items for the specified application. + * @param appId The ID of the application to retrieve downloaded workshop items for. + * @returns A Promise that resolves to an array of downloaded workshop items for the specified application. */ GetDownloadedWorkshopItems(appId: number): Promise<WorkshopItem[]>; @@ -195,26 +184,25 @@ export interface Apps { /** * Retrieves achievement information for a specific application for a given friend. - * @param {string} appId - The ID of the application to retrieve achievement information for. - * @param {string} friendSteam64Id - The Steam64 ID of the friend for whom to retrieve achievement information. - * @returns {Promise<AppAchievementResponse>} - A Promise that resolves to an object containing achievement information for the specified friend and application. + * @param appId The ID of the application to retrieve achievement information for. + * @param friendSteam64Id The Steam64 ID of the friend for whom to retrieve achievement information. + * @returns A Promise that resolves to an object containing achievement information for the specified friend and application. */ GetFriendAchievementsForApp(appId: string, friendSteam64Id: string): Promise<AppAchievementResponse>; /** * Retrieves a list of friends who play the specified application. - * @param {number} appId - The ID of the application. - * @returns {Promise<string[]>} A Promise that resolves to an array of Steam64 IDs representing friends who play the application. + * @param appId The ID of the application. + * @returns A Promise that resolves to an array of Steam64 IDs representing friends who play the application. */ GetFriendsWhoPlay(appId: number): Promise<string[]>; /** * Retrieves details of a game action. - * @param {number} appId - The ID of the application. - * @param {Function} callback - The callback function to handle the retrieved game action details and state. - * @param {GameAction} callback.gameAction - The game action received in the callback. - * @param {state} callback.state - The state manager received in the callback. - * @returns {void} + * @param appId The ID of the application. + * @param callback The callback function to handle the retrieved game action details and state. + * @param callback.gameAction The game action received in the callback. + * @param callback.state The state manager received in the callback. */ GetGameActionDetails(appId: number, callback: (gameAction: GameAction) => void): void; @@ -234,27 +222,27 @@ export interface Apps { * Retrieves launch options for a specified application. * These options may include different configurations or settings for launching the application, such as DirectX, Vulkan, OpenGL, 32-bit, 64-bit, etc. * This function does not retrieve launch/argument options inputted by the user. - * @param {number} appId - The ID of the application. - * @returns {Promise<LaunchOption[]>} - A Promise that resolves to an array of launch options for the specified application. + * @param appId The ID of the application. + * @returns A Promise that resolves to an array of launch options for the specified application. */ GetLaunchOptionsForApp(appId: number): Promise<LaunchOption[]>; /** - * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link LibraryBootstrapData}. + * @returns A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link LibraryBootstrapData}. */ GetLibraryBootstrapData(): Promise<ArrayBuffer>; /** * Retrieves achievement information for the authenticated user in a specific Steam application. - * @param {string} appId - The ID of the application to retrieve achievement information for. - * @returns {Promise<AppAchievementResponse>} A Promise that resolves to an AppAchievementResponse object containing the achievement information for the authenticated user in the specified application. + * @param appId The ID of the application to retrieve achievement information for. + * @returns A Promise that resolves to an AppAchievementResponse object containing the achievement information for the authenticated user in the specified application. */ GetMyAchievementsForApp(appId: string): Promise<AppAchievementResponse>; /** * Retrieves the playtime information for a specific application. - * @param {number} appId - The ID of the application to get playtime information for. - * @returns {Promise<Playtime | undefined>} A Promise that resolves to playtime information or undefined if not available. + * @param appId The ID of the application to get playtime information for. + * @returns A Promise that resolves to playtime information or undefined if not available. */ GetPlaytime(appId: number): Promise<Playtime | undefined>; @@ -262,47 +250,47 @@ export interface Apps { /** * Retrieves the resolution override for a specific application. - * @param {number} appId - The ID of the application to retrieve the resolution override for. - * @returns {Promise<string>} A Promise that resolves to a string of the resolution override. + * @param appId The ID of the application to retrieve the resolution override for. + * @returns A Promise that resolves to a string of the resolution override. */ GetResolutionOverrideForApp(appId: number): Promise<string>; /** * Represents a function to retrieve detailed information about a specific screenshot. - * @param {string} appId - The ID of the application the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @returns {Promise<Screenshot>} - A Promise that resolves to detailed information about the specified screenshot. + * @param appId The ID of the application the screenshot belongs to. + * @param hHandle The handle of the screenshot. + * @returns A Promise that resolves to detailed information about the specified screenshot. */ GetScreenshotInfo(appId: string, hHandle: number): Promise<Screenshot>; /** * Represents a function to retrieve screenshots within a specified time range. - * @param {number} appId - The ID of the application. - * @param {number} start - The start of the time range as a Unix timestamp. - * @param {number} end - The end of the time range as a Unix timestamp. - * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of screenshots taken within the specified time range. + * @param appId The ID of the application. + * @param start The start of the time range as a Unix timestamp. + * @param end The end of the time range as a Unix timestamp. + * @returns A Promise that resolves to an array of screenshots taken within the specified time range. */ GetScreenshotsInTimeRange(appId: number, start: number, end: number): Promise<Screenshot[]>; /** * Represents a function to retrieve shortcut data for a list of non-Steam app IDs. - * @param {number[]} appIds - An array of non-Steam application IDs. - * @returns {Promise<Shortcut[]>} - A Promise that resolves to an array of Shortcut objects for the specified non-Steam app IDs. + * @param appIds An array of non-Steam application IDs. + * @returns A Promise that resolves to an array of Shortcut objects for the specified non-Steam app IDs. */ GetShortcutData(appIds: number[]): Promise<Shortcut[]>; /** * Retrieves shortcut data for a given shortcut file path. - * @param {string} pathToShortcut The path to the shortcut file. - * @returns {Promise<Shortcut>} A Promise that resolves to the shortcut data. + * @param pathToShortcut The path to the shortcut file. + * @returns A Promise that resolves to the shortcut data. */ GetShortcutDataForPath(pathToShortcut: string): Promise<Shortcut>; /** * Represents a function to retrieve details about a soundtrack associated with a soundtrack application. * The soundtrack has to be installed. - * @param {number} appId - The ID of the soundtrack application. - * @returns {Promise<SoundtrackDetails>} - A Promise that resolves to the details of the soundtrack associated with the specified soundtrack application. + * @param appId The ID of the soundtrack application. + * @returns A Promise that resolves to the details of the soundtrack associated with the specified soundtrack application. */ GetSoundtrackDetails(appId: number): Promise<SoundtrackDetails>; @@ -311,17 +299,17 @@ export interface Apps { /** * Retrieves a list of subscribed workshop item details for a specific application. - * @param {number} appId - The ID of the application to retrieve subscribed workshop item details for. - * @param {string[]} itemIds - Workshop item IDs to retrieve details for. - * @returns {Promise<WorkshopItemDetails[] | OperationResponse>} - A Promise that resolves to an array of subscribed workshop item details for the specified application. + * @param appId The ID of the application to retrieve subscribed workshop item details for. + * @param itemIds Workshop item IDs to retrieve details for. + * @returns A Promise that resolves to an array of subscribed workshop item details for the specified application. * @throws Throws if the query failed. */ GetSubscribedWorkshopItemDetails(appId: number, itemIds: string[]): Promise<WorkshopItemDetails[] | OperationResponse>; /** * Retrieves a list of subscribed workshop items for a specific application. - * @param {number} appId - The ID of the application to retrieve subscribed workshop items for. - * @returns {Promise<WorkshopItem[]>} - A Promise that resolves to an array of subscribed workshop items for the specified application. + * @param appId The ID of the application to retrieve subscribed workshop items for. + * @returns A Promise that resolves to an array of subscribed workshop items for the specified application. */ GetSubscribedWorkshopItems(appId: number): Promise<WorkshopItem[]>; @@ -342,26 +330,24 @@ export interface Apps { /** * Move specified workshop item load order. - * @param appId - The ID of the application. - * @param oldOrder - The item to move, referenced by its position number. - * @param newOrder - The position number to move the item to. - * @returns {void} + * @param appId The ID of the application. + * @param oldOrder The item to move, referenced by its position number. + * @param newOrder The position number to move the item to. * @remarks Orders are zero-indexed. */ MoveWorkshopItemLoadOrder(appId: number, oldOrder: number, newOrder: number): void; /** * Opens the settings dialog for a specific application. - * @param {number} appId - The ID of the application for which to open the settings dialog. - * @param {string} section - The section (tab) to switch to. - * @returns {void} + * @param appId The ID of the application for which to open the settings dialog. + * @param section The section (tab) to switch to. */ OpenAppSettingsDialog(appId: number, section: string): void; /** * Raises the window for a given application. - * @param {string} appId - The ID of the application to raise the window of. - * @returns {Promise<number>} - A Promise that resolves to a number. + * @param appId The ID of the application to raise the window of. + * @returns A Promise that resolves to a number. * @todo Returns a result enum? 1 if ok, 2 if not running */ RaiseWindowForGame(appId: number): Promise<number>; // ResumeGameInProgress @@ -382,19 +368,19 @@ export interface Apps { /** * Registers a callback function to be called when achievement changes occur. * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns An object that can be used to unregister the callback. */ - RegisterForAchievementChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterForAchievementChanges(callback: (data: ArrayBuffer) => void): Unregisterable; - RegisterForAppBackupStatus(callback: (appBackupStatus: AppBackupStatus) => void): Unregisterable | any; + RegisterForAppBackupStatus(callback: (appBackupStatus: AppBackupStatus) => void): Unregisterable; /** * Registers a callback function to be called when app details change. * @param appId The ID of the application to monitor. * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns An object that can be used to unregister the callback. */ - RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable | any; + RegisterForAppDetails(appId: number, callback: (appDetails: AppDetails) => void): Unregisterable; /* @@ -413,38 +399,38 @@ export interface Apps { RegisterForDRMFailureResponse( callback: (appid: number, eResult: number, errorCode: number) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be called when a game action ends. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForGameActionEnd(callback: (gameActionIdentifier: number) => void): Unregisterable | any; + RegisterForGameActionEnd(callback: (gameActionIdentifier: number) => void): Unregisterable; // "error" is a localization token - RegisterForGameActionShowError(callback: (gameActionId: number, appId: string, actionName: string, error: string, param4: string) => void): Unregisterable | any; + RegisterForGameActionShowError(callback: (gameActionId: number, appId: string, actionName: string, error: string, param4: string) => void): Unregisterable; /** * Registers a callback function to be called when a game action UI is shown. * @param callback The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns An object that can be used to unregister the callback. */ - RegisterForGameActionShowUI(callback: () => void): Unregisterable | any; // todo: no idea what this callback is from + RegisterForGameActionShowUI(callback: () => void): Unregisterable; // todo: no idea what this callback is from /** * Registers a callback function to be called when a game action starts. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForGameActionStart( callback: (gameActionIdentifier: number, appId: string, action: string, param3: AppLaunchSource) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be called when a game action task changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForGameActionTaskChange( callback: ( @@ -454,12 +440,12 @@ export interface Apps { requestedAction: string, param4: string, ) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be called when a user requests a game action. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForGameActionUserRequest( callback: ( @@ -469,43 +455,41 @@ export interface Apps { requestedAction: string, appId2: string, ) => void, - ): Unregisterable | any; + ): Unregisterable; /** * @todo returns undefined (now)? * @todo does not exist on Steam Version: 1718064497 */ - RegisterForLocalizationChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterForLocalizationChanges(callback: (data: ArrayBuffer) => void): Unregisterable; - RegisterForPrePurchasedAppChanges(callback: () => void): Unregisterable | any; // Unknown, did have it show up a few times, but not callback parameters - RegisterForShowMarketingMessageDialog: Unregisterable | any; + RegisterForPrePurchasedAppChanges(callback: () => void): Unregisterable; // Unknown, did have it show up a few times, but not callback parameters + RegisterForShowMarketingMessageDialog: Unregisterable; /** * Registers a callback function to be notified when workshop items are added or removed from a Steam application. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForWorkshopChanges(callback: (appId: number) => void): Unregisterable | any; + RegisterForWorkshopChanges(callback: (appId: number) => void): Unregisterable; RegisterForWorkshopItemDownloads( appId: number, callback: (appId: number, publishedFileId: string, param2: number) => void, - ): Unregisterable | any; + ): Unregisterable; RegisterForWorkshopItemInstalled: any; /** * Removes a non-Steam application shortcut from the Steam library. - * @param {number} appId - The ID of the application for which to remove the shortcut. - * @returns {void} + * @param appId The ID of the application for which to remove the shortcut. */ RemoveShortcut(appId: number): void; /** * Removes a user tag from multiple Steam applications. - * @param {number[]} appIds - An array of application IDs from which the user tag should be removed. - * @param {string} userTag - The user tag to be removed. - * @returns {void} + * @param appIds An array of application IDs from which the user tag should be removed. + * @param userTag The user tag to be removed. * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. */ RemoveUserTagFromApps(appIds: number[], userTag: string): void; @@ -524,12 +508,11 @@ export interface Apps { /** * Runs a game with specified parameters. Focuses the game if already launched. - * @param {string} appId - The ID of the application to run. - * @param {string} launchOptions - Additional launch options for the application. - * @param {number} param2 - Additional parameter (exact usage may vary). - * @param {AppLaunchSource} launchSource + * @param appId The ID of the application to run. + * @param launchOptions Additional launch options for the application. + * @param param2 Additional parameter (exact usage may vary). + * @param launchSource * @remarks `launchOptions` is appended before the ones specified in the application's settings. - * @returns {void} */ RunGame(appId: string, launchOptions: string, param2: number, launchSource: AppLaunchSource): void; @@ -545,7 +528,7 @@ export interface Apps { /** * Scans the system for installed non-Steam applications. - * @returns {Promise<NonSteamApp[]>} A Promise that resolves to an array of NonSteamApp objects representing installed non-Steam applications. + * @returns A Promise that resolves to an array of NonSteamApp objects representing installed non-Steam applications. * @remarks This function scans the user's system for installed applications that are not part of the Steam library. It does not scan for shortcuts added to the Steam library. * * On Linux, it scans inside /usr/share/applications and $XDG_DATA_HOME/applications. @@ -554,68 +537,61 @@ export interface Apps { /** * Sets the automatic update behavior for a Steam application. - * @param {number} appId - The ID of the application to set the update behavior for. - * @param {AutoUpdateBehavior} mode - The update behavior mode to set. - * @returns {void} + * @param appId The ID of the application to set the update behavior for. + * @param mode The update behavior mode to set. * @remarks This function only works with installed Steam applications. */ SetAppAutoUpdateBehavior(appId: number, mode: AutoUpdateBehavior): void; /** * Sets the background downloads behavior for a specific Steam application. - * @param {number} appId - The ID of the application to set the background downloads behavior for. - * @param {BackgroundDownloadsBehavior} mode - The background downloads mode to set. - * @returns {void} + * @param appId The ID of the application to set the background downloads behavior for. + * @param mode The background downloads mode to set. * @remarks This function only works with installed Steam applications. */ SetAppBackgroundDownloadsBehavior(appId: number, mode: BackgroundDownloadsBehavior): void; /** * Sets the current language for a specific Steam application. - * @param {number} appId - The ID of the application to set the current language for. - * @param {string} language - The language to set, represented as a language (e.g., "english", "spanish", "tchinese", "schinese"). - * @returns {void} + * @param appId The ID of the application to set the current language for. + * @param language The language to set, represented as a language (e.g., "english", "spanish", "tchinese", "schinese"). */ SetAppCurrentLanguage(appId: number, language: string): void; /** * Sets the blocked state for apps. - * @param {number[]} appIds - An array of app IDs to set the blocked state for. - * @param {boolean} state - The state to set (true for blocked, false for unblocked). - * @returns {void} + * @param appIds An array of app IDs to set the blocked state for. + * @param state The state to set (true for blocked, false for unblocked). */ SetAppFamilyBlockedState(appIds: number[], state: boolean): void; /** * Sets the hidden status of a specific Steam application. - * @param {number} appId - The ID of the application to set the hidden status for. - * @param {boolean} value - The value indicating whether the application should be hidden (true) or not (false). - * @returns {void} + * @param appId The ID of the application to set the hidden status for. + * @param value The value indicating whether the application should be hidden (true) or not (false). * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file to set the hidden status of the specified application. */ SetAppHidden(appId: number, value: boolean): void; /** * Sets launch options for a Steam application. - * @param {number} appId - The ID of the application to set launch options for. - * @param {string} launchOptions - The launch options to be set for the application. - * @returns {void} + * @param appId The ID of the application to set launch options for. + * @param launchOptions The launch options to be set for the application. */ SetAppLaunchOptions(appId: number, launchOptions: string): void; /** * Sets a resolution override for a Steam application. - * @param {number} appId - The ID of the application to set the resolution override for. - * @param {string} resolution - The resolution to be set for the application. It can be "Default", "Native", or other compatible resolutions for the user's monitor. - * @returns {void} + * @param appId The ID of the application to set the resolution override for. + * @param resolution The resolution to be set for the application. It can be "Default", "Native", or other compatible resolutions for the user's monitor. */ SetAppResolutionOverride(appId: number, resolution: string): any; /** * Sets cached details for a specific application. - * @param {number} appId - The ID of the application. - * @param {string} details - The details to be cached, a stringified object. - * @returns {Promise<any>} - A Promise that resolves when the details are successfully cached. + * @param appId The ID of the application. + * @param details The details to be cached, a stringified object. + * @returns A Promise that resolves when the details are successfully cached. * todo: might return boolean? */ SetCachedAppDetails(appId: number, details: string): Promise<any>; @@ -624,100 +600,93 @@ export interface Apps { /** * Sets the custom artwork for a given application. - * @param {number} appId - The ID of the application to set custom artwork for. - * @param {string} base64Image - Base64 encoded image. - * @param {string} imageType - "jpeg" or "png". - * @param {AppArtworkAssetType} assetType - The type of artwork to set. - * @returns {Promise<any>} A Promise that resolves after the custom artwork is set. + * @param appId The ID of the application to set custom artwork for. + * @param base64Image Base64 encoded image. + * @param imageType "jpeg" or "png". + * @param assetType The type of artwork to set. + * @returns A Promise that resolves after the custom artwork is set. */ SetCustomArtworkForApp(appId: number, base64Image: string, imageType: string, assetType: AppArtworkAssetType): Promise<any>; /** * Sets a custom logo position for a specific app. - * @param {number} appId - The ID of the application. - * @param {string} details - The details of the custom logo position, expected to be a stringified {@link LogoPositionForApp} object. - * @returns {Promise<void>} - A Promise that resolves when the custom logo position is successfully set. + * @param appId The ID of the application. + * @param details The details of the custom logo position, expected to be a stringified {@link LogoPositionForApp} object. + * @returns A Promise that resolves when the custom logo position is successfully set. */ SetCustomLogoPositionForApp(appId: number, details: string): Promise<void>; /** * Sets the enabled state for downloadable content (DLC) of a specific app. - * @param {number} appId - The ID of the parent application. - * @param {number} appDLCId - The ID of the DLC to set the state for. - * @param {boolean} value - The value to set (true for enabled, false for disabled). - * @returns {void} + * @param appId The ID of the parent application. + * @param appDLCId The ID of the DLC to set the state for. + * @param value The value to set (true for enabled, false for disabled). */ SetDLCEnabled(appId: number, appDLCId: number, value: boolean): void; /** * Set a local screenshot's caption. - * @param {string} appId - The application ID the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @param {string} caption - * @returns {void} + * @param appId The application ID the screenshot belongs to. + * @param hHandle The handle of the screenshot. + * @param caption */ SetLocalScreenshotCaption(appId: string, hHandle: any, caption: string): void; /** * Set a local screenshot's privacy state. - * @param {string} appId - The application ID the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @param {FilePrivacyState} privacy - Screenshot privacy state. + * @param appId The application ID the screenshot belongs to. + * @param hHandle The handle of the screenshot. + * @param privacy Screenshot privacy state. */ SetLocalScreenshotPrivacy(appId: string, hHandle: any, privacy: FilePrivacyState): void; /** * Set a local screenshot's spoiler state. - * @param {string} appId - The application ID the screenshot belongs to. - * @param {number} hHandle - The handle of the screenshot. - * @param {boolean} spoilered - Is the screenshot spoilered? + * @param appId The application ID the screenshot belongs to. + * @param hHandle The handle of the screenshot. + * @param spoilered Is the screenshot spoilered? */ SetLocalScreenshotSpoiler(appId: string, hHandle: any, spoilered: boolean): void; /** * Sets the icon for a non-Steam application shortcut. - * @param {string} appId - The ID of the application to set the shortcut icon for. - * @param {string} iconPath - The path to the icon image (can be png or tga format). - * @returns {void} + * @param appId The ID of the application to set the shortcut icon for. + * @param iconPath The path to the icon image (can be png or tga format). */ SetShortcutIcon(appId: number, iconPath: string): void; /** * Sets whether a non-Steam application shortcut should be included in the VR library. - * @param {number} appId The ID of the application to set the VR status for. - * @param {boolean} value A boolean indicating whether the application should be included in the VR library. - * @returns {void} + * @param appId The ID of the application to set the VR status for. + * @param value A boolean indicating whether the application should be included in the VR library. */ SetShortcutIsVR(appId: number, value: boolean): void; /** * Sets launch options for a non-Steam application shortcut. - * @param {number} appId - The ID of the application to set the launch options for. - * @param {string} launchOptions - The launch options to be used when starting the application. - * @returns {void} + * @param appId The ID of the application to set the launch options for. + * @param launchOptions The launch options to be used when starting the application. */ SetShortcutLaunchOptions(appId: number, launchOptions: string): void; /** * Sets the name for a non-Steam application shortcut. - * @param {number} appId - The ID of the application to set the shortcut name for. - * @param {string} shortcutName - The name to be displayed for the application shortcut. - * @returns {void} + * @param appId The ID of the application to set the shortcut name for. + * @param shortcutName The name to be displayed for the application shortcut. */ SetShortcutName(appId: number, shortcutName: string): void; /** * Sets the starting directory for a non-Steam application shortcut. - * @param {number} appId - The ID of the application to set the starting directory for. - * @param {string} directory - The directory from which the application should be launched. - * @returns {void} + * @param appId The ID of the application to set the starting directory for. + * @param directory The directory from which the application should be launched. */ SetShortcutStartDir(appId: number, directory: string): void; /** * Sets the client ID for streaming for a specific application. - * @param {number} appId - The ID of the application. - * @param {string} clientId - The client ID for streaming. + * @param appId The ID of the application. + * @param clientId The client ID for streaming. */ SetStreamingClientForApp(appId: number, clientId: string): void; @@ -725,33 +694,29 @@ export interface Apps { /** * Sets the workshop items disabled state. - * @param {number} appId - The ID of the application. - * @param {string[]} itemIds - Workshop item IDs to change the state for. - * @param {boolean} value - `true` to disable, `false` otherwise. - * @returns {void} + * @param appId The ID of the application. + * @param itemIds Workshop item IDs to change the state for. + * @param value `true` to disable, `false` otherwise. */ SetWorkshopItemsDisabledLocally(appId: number, itemIds: string[], value: boolean): void; /** * Sets the workshop items load order for a specified application. - * @param {number} appId - The ID of the application. - * @param {string[]} itemIds - Workshop item IDs. - * @returns {void} + * @param appId The ID of the application. + * @param itemIds Workshop item IDs. * @remarks `itemIds` has to be the full list of subscribed items, otherwise the specified items get moved to the last position. */ SetWorkshopItemsLoadOrder(appId: number, itemIds: string[]): void; /** * Opens the controller configurator for a specific application. - * @param {number} appId - The ID of the application for which to open the controller configurator. - * @returns {void} + * @param appId The ID of the application for which to open the controller configurator. */ ShowControllerConfigurator(appId: number): void; /** * Opens the Steam store page for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} + * @param appId The ID of the application. */ ShowStore(appId: number): void; @@ -759,9 +724,8 @@ export interface Apps { /** * Specifies a compatibility tool by its name for a given application. If strToolName is an empty string, the specified application will no longer use a compatibility tool. - * @param {number} appId - The ID of the application to specify compatibility tool for. - * @param {string} strToolName - The name of the compatibility tool to specify. - * @returns {void} + * @param appId The ID of the application to specify compatibility tool for. + * @param strToolName The name of the compatibility tool to specify. */ SpecifyCompatTool(appId: number, strToolName: string): void; @@ -769,18 +733,16 @@ export interface Apps { /** * Subscribes or unsubscribes from a workshop item for a specific app. - * @param {number} appId - The ID of the application. - * @param {string} workshopId - The ID of the workshop item. - * @param {boolean} subscribed - True to subscribe, false to unsubscribe. - * @returns {void} + * @param appId The ID of the application. + * @param workshopId The ID of the workshop item. + * @param subscribed True to subscribe, false to unsubscribe. */ SubscribeWorkshopItem(appId: number, workshopId: string, subscribed: boolean): void; /** * Terminates a running application. - * @param {string} appId - The ID of the application to terminate. - * @param {boolean} param1 - Additional parameter. Exact usage may vary. - * @returns {void} + * @param appId The ID of the application to terminate. + * @param param1 Additional parameter. Exact usage may vary. */ TerminateApp(appId: string, param1: boolean): void; @@ -789,8 +751,7 @@ export interface Apps { /** * Toggles the Steam Cloud synchronization for game saves for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} + * @param appId The ID of the application. * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. */ ToggleAppSteamCloudEnabled(appId: number): void; @@ -800,8 +761,7 @@ export interface Apps { /** * Toggles the Steam Overlay setting for a specific application. - * @param {number} appId - The ID of the application. - * @returns {void} + * @param appId The ID of the application. */ ToggleEnableSteamOverlayForApp(appId: number): void; @@ -812,7 +772,7 @@ export interface Apps { /** * Verifies the integrity of an app's files. - * @param {number} appId - The ID of the app to verify. + * @param appId The ID of the app to verify. */ VerifyApp(appId: number): Promise<any>; // todo: returns {"nGameActionID":9} } @@ -1727,4 +1687,4 @@ export enum AppCloudStatus { SyncFailed = 8, Conflict = 9, PendingElsewhere = 10, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Auth.ts b/src/deck-components/steam-client/Auth.ts index b965ac97..f0968728 100644 --- a/src/deck-components/steam-client/Auth.ts +++ b/src/deck-components/steam-client/Auth.ts @@ -5,7 +5,7 @@ export interface Auth { GetLocalHostname(): Promise<string>; /** - * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link Authentication_DeviceDetails}. + * @returns A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link Authentication_DeviceDetails}. */ GetMachineID(): Promise<ArrayBuffer>; @@ -82,4 +82,4 @@ export enum GamingDeviceType { Handheld = 512, Phone = 528, SteamDeck = 544, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Broadcast.ts b/src/deck-components/steam-client/Broadcast.ts index 9a32357b..642157fe 100644 --- a/src/deck-components/steam-client/Broadcast.ts +++ b/src/deck-components/steam-client/Broadcast.ts @@ -3,44 +3,43 @@ import {Result, Unregisterable} from "./index"; export interface Broadcast { /** * Approves a viewer request for the broadcast. - * @param {string} steamId64 - The SteamID64 of the user whose request is to be approved. - * @param {number} param1 - Unknown parameter. + * @param steamId64 The SteamID64 of the user whose request is to be approved. + * @param param1 Unknown parameter. */ ApproveViewerRequest(steamId64: string, param1: number): void; /** * Invites a user identified by their SteamID64 to watch the broadcast. - * @param {string} steamId64 - The SteamID64 of the user to invite. - * @returns {Promise<number>} - A Promise indicating the result of the invitation (1 for success, 2 for error). + * @param steamId64 The SteamID64 of the user to invite. + * @returns A Promise indicating the result of the invitation (1 for success, 2 for error). */ InviteToWatch(steamId64: string): Promise<number>; /** * Registers a callback to be called when the broadcast status changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForBroadcastStatus(callback: (broadcastStatus: BroadcastStatus) => void): Unregisterable | any; + RegisterForBroadcastStatus(callback: (broadcastStatus: BroadcastStatus) => void): Unregisterable; /** * Registers a callback to be called when viewer requests are received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForViewerRequests( callback: (viewerFriendCode: number, param1: number, param2: number) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Rejects a viewer request for the broadcast. - * @param {string} steamId64 - The SteamID64 of the user whose request is to be rejected. - * @param {number} param1 - Unknown parameter. + * @param steamId64 The SteamID64 of the user whose request is to be rejected. + * @param param1 Unknown parameter. */ RejectViewerRequest(steamId64: string, param1: number): void; /** * Stops the broadcast. - * @returns {void} */ StopBroadcasting(): void; } @@ -57,4 +56,4 @@ export interface BroadcastStatus { bMicrophoneActive: boolean; nCurrentFPS: number; nUploadKbps: number; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Browser.ts b/src/deck-components/steam-client/Browser.ts index 6ed91980..6df884f7 100644 --- a/src/deck-components/steam-client/Browser.ts +++ b/src/deck-components/steam-client/Browser.ts @@ -17,7 +17,6 @@ export interface Browser { /** * Hides the mouse cursor until input. - * @returns {void} */ HideCursorUntilMouseEvent(): void; @@ -38,15 +37,14 @@ export interface Browser { /** * @todo unconfirmed */ - RegisterForGestureEvents(callback: (gesture: TouchGesture) => void): Unregisterable | any; + RegisterForGestureEvents(callback: (gesture: TouchGesture) => void): Unregisterable; - RegisterForOpenNewTab: Unregisterable | any; + RegisterForOpenNewTab: Unregisterable; ReplaceMisspelling: any; /** * Restarts the Steam JS context. - * @returns {void} */ RestartJSContext(): void; @@ -60,8 +58,7 @@ export interface Browser { /** * Prompts and downloads a file. - * @param {string} url - The URL of the file to download. - * @returns {void} + * @param url The URL of the file to download. */ StartDownload(url: string): void; } @@ -87,4 +84,4 @@ export enum TouchGestureType { PinchEnd = 11, FlingStart = 12, FlingCancelled = 13, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/ClientNotifications.ts b/src/deck-components/steam-client/ClientNotifications.ts index 4f9d70e4..d74ce344 100644 --- a/src/deck-components/steam-client/ClientNotifications.ts +++ b/src/deck-components/steam-client/ClientNotifications.ts @@ -3,14 +3,14 @@ import { BrowserContext } from "./index"; export interface ClientNotifications { /** * Displays a Steam notification. - * @param {ClientUINotificationType} notification - Notification type. - * @param {string} options - Stringified object of {@link SteamNotificationOptions}. - * @param {function} callback + * @param notification Notification type. + * @param options Stringified object of {@link SteamNotificationOptions}. + * @param callback */ DisplayClientNotification( notification: ClientUINotificationType, options: string, - callback: (browser: BrowserContext) => void, + callback: (context: BrowserContext) => void, ): void; /** @@ -36,4 +36,4 @@ export enum ClientUINotificationType { GroupChatMessage = 1, FriendChatMessage = 2, FriendPersonaState = 3, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Cloud.ts b/src/deck-components/steam-client/Cloud.ts index f4141d8d..9088ab91 100644 --- a/src/deck-components/steam-client/Cloud.ts +++ b/src/deck-components/steam-client/Cloud.ts @@ -1,16 +1,16 @@ export interface Cloud { /** * Resolves a synchronization conflict for an app in the cloud. - * @param {number} appId - The ID of the app with the sync conflict. - * @param {boolean} keepLocal - Whether to keep the local version during conflict resolution. - * @returns {any} - Returns data related to resolving the sync conflict. + * @param appId The ID of the app with the sync conflict. + * @param keepLocal Whether to keep the local version during conflict resolution. + * @returns Returns data related to resolving the sync conflict. */ ResolveAppSyncConflict(appId: number, keepLocal: boolean): void; /** * Retries syncing an app with the cloud. - * @param {number} appId - The ID of the app to retry syncing. - * @returns {any} - Returns data related to retrying the app sync. + * @param appId The ID of the app to retry syncing. + * @returns Returns data related to retrying the app sync. */ RetryAppSync(appId: number): void; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/CommunityItems.ts b/src/deck-components/steam-client/CommunityItems.ts index 8c27aee5..9f2e0945 100644 --- a/src/deck-components/steam-client/CommunityItems.ts +++ b/src/deck-components/steam-client/CommunityItems.ts @@ -21,4 +21,4 @@ export interface CommunityItems { GetItemAssetPath(communityItemId: string, param1: any, param2: string): any; RemoveDownloadedItemAsset(communityItemId: string, param1: any, param2: string): any; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Console.ts b/src/deck-components/steam-client/Console.ts index ff7d94bb..3edad44b 100644 --- a/src/deck-components/steam-client/Console.ts +++ b/src/deck-components/steam-client/Console.ts @@ -6,24 +6,23 @@ import {Unregisterable} from "./index"; export interface Console { /** * Executes a console command. - * @param {string} command - The command to execute in the console. - * @returns {void} + * @param command The command to execute in the console. */ ExecCommand(command: string): void; /** * Retrieves autocomplete suggestions for a given console command. - * @param {string} command - The console command to provide autocomplete suggestions for. - * @returns {Promise<string[]>} - A Promise that resolves to an array of autocomplete suggestions. + * @param command The console command to provide autocomplete suggestions for. + * @returns A Promise that resolves to an array of autocomplete suggestions. */ GetAutocompleteSuggestions(command: string): Promise<string[]>; /** * Registers a callback function to receive spew output. - * @param {function} callback - The callback function that will receive spew output. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function that will receive spew output. + * @returns An object that can be used to unregister the callback. */ - RegisterForSpewOutput(callback: (spewOutput: SpewOutput) => void): Unregisterable | any; + RegisterForSpewOutput(callback: (spewOutput: SpewOutput) => void): Unregisterable; } /** @@ -39,4 +38,4 @@ export interface SpewOutput { * The type or category of the spew output. */ spew_type: "error" | "info" | "input"; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Downloads.ts b/src/deck-components/steam-client/Downloads.ts index 53dd1da7..ffbd16c6 100644 --- a/src/deck-components/steam-client/Downloads.ts +++ b/src/deck-components/steam-client/Downloads.ts @@ -7,21 +7,19 @@ import {AppError} from "./App"; export interface Downloads { /** * Enables or disables all downloads in Steam. - * @param {boolean} enable - True to enable downloads, false to disable. + * @param enable True to enable downloads, false to disable. */ EnableAllDownloads(enable: boolean): void; /** * Moves the update for a specific app down the download queue. - * @param {number} appId - The ID of the application to move. - * @returns {void} + * @param appId The ID of the application to move. */ MoveAppUpdateDown(appId: number): void; /** * Moves the update for a specific app up the download queue. - * @param {number} appId - The ID of the application to move. - * @returns {void} + * @param appId The ID of the application to move. */ MoveAppUpdateUp(appId: number): void; @@ -29,68 +27,61 @@ export interface Downloads { /** * Adds the update for a specific app to the download queue. - * @param {number} appId - The ID of the application to queue. - * @returns {void} + * @param appId The ID of the application to queue. */ QueueAppUpdate(appId: number): void; /** * Registers a callback function to be called when download items change. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForDownloadItems( callback: (isDownloading: boolean, downloadItems: DownloadItem[]) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be called when download overview changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForDownloadOverview(callback: (downloadOverview: DownloadOverview) => void): Unregisterable | any; + RegisterForDownloadOverview(callback: (downloadOverview: DownloadOverview) => void): Unregisterable; /** * Removes the update for a specific app from the download list and places it in the unscheduled list. - * @param {number} appId - The ID of the application to remove. - * @returns {void} + * @param appId The ID of the application to remove. */ RemoveFromDownloadList(appId: number): void; /** * Resumes the update for a specific app in the queue. - * @param {number} appId - The ID of the application to resume. - * @returns {void} + * @param appId The ID of the application to resume. */ ResumeAppUpdate(appId: number): void; /** * Sets an app to launch when its download is complete. - * @param {number} appId - The ID of the application to set. - * @returns {void} + * @param appId The ID of the application to set. */ SetLaunchOnUpdateComplete(appId: number): void; /** * Sets the queue index for an app in the download queue. - * @param {number} appId - The ID of the application to set the index for. - * @param {number} index - The index to set. - * @returns {void} + * @param appId The ID of the application to set the index for. + * @param index The index to set. * @remarks Index of 0 is the current download in progress. */ SetQueueIndex(appId: number, index: number): void; /** * Suspends or resumes download throttling. - * @param {boolean} suspend - Whether to suspend or resume download throttling. - * @returns {void} + * @param suspend Whether to suspend or resume download throttling. */ SuspendDownloadThrottling(suspend: boolean): void; /** * Suspends or resumes local transfers. - * @param {boolean} suspend - Whether to suspend or resume local transfers. - * @returns {void} + * @param suspend Whether to suspend or resume local transfers. */ SuspendLanPeerContent(suspend: boolean): void; } diff --git a/src/deck-components/steam-client/FamilySharing.ts b/src/deck-components/steam-client/FamilySharing.ts index 8b3265bc..9b45f235 100644 --- a/src/deck-components/steam-client/FamilySharing.ts +++ b/src/deck-components/steam-client/FamilySharing.ts @@ -4,7 +4,7 @@ export interface FamilySharing { /** * Authorizes library sharing on the local device. - * @returns {Promise<number>} A Promise that resolves to a status code. + * @returns A Promise that resolves to a status code. * FamilySettings_SteamGuardRequired - 18 * FamilySettings_LimitExceeded - 25 * FamilySettings_FailedToAuthorize - any other number @@ -13,7 +13,7 @@ export interface FamilySharing { /** * Deauthorizes library sharing on the local device. - * @returns {Promise<number>} A Promise that resolves to a status code. + * @returns A Promise that resolves to a status code. */ DeauthorizeLocalDevice(): Promise<number>; @@ -41,4 +41,4 @@ export interface Lender { numDlc: number; bPreferred: boolean; vecDLC: any[]; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/FriendSettings.ts b/src/deck-components/steam-client/FriendSettings.ts index 746986b0..d60055fd 100644 --- a/src/deck-components/steam-client/FriendSettings.ts +++ b/src/deck-components/steam-client/FriendSettings.ts @@ -6,17 +6,17 @@ import {Unregisterable} from "./index"; export interface FriendSettings { /** * Retrieves a list of enabled friend settings features. - * @returns {Promise<FriendSettingsFeature[]>} - A Promise that resolves to an array of enabled friend settings features. + * @returns A Promise that resolves to an array of enabled friend settings features. */ GetEnabledFeatures(): Promise<FriendSettingsFeature[]>; /** * Registers a callback function to be notified of friend settings changes. - * @param callback - The callback function to be called when friend settings change. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called when friend settings change. + * @returns An object that can be used to unregister the callback. * @remarks The callback receives an escaped JSON object string as "settingsChanges", which should be parsed into {@link FriendSettingsChange} object. */ - RegisterForSettingsChanges(callback: (settingsChanges: string) => void): Unregisterable | any; + RegisterForSettingsChanges(callback: (settingsChanges: string) => void): Unregisterable; SetFriendSettings(details: string): any; // stringified object } @@ -66,4 +66,4 @@ export interface FriendSettingsChange { bDisableRoomEffects: number; bAnimatedAvatars: number; featuresEnabled: FriendSettingsEnabledFeature; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Friends.ts b/src/deck-components/steam-client/Friends.ts index e01330d0..18e75b26 100644 --- a/src/deck-components/steam-client/Friends.ts +++ b/src/deck-components/steam-client/Friends.ts @@ -6,8 +6,8 @@ import { Unregisterable } from "./index"; export interface Friends { /** * Adds a user to the friend list. - * @param {string} steamId - The Steam ID of the user to add as a friend. - * @returns {Promise<boolean>} A Promise that resolves to true if the friend was added successfully, false otherwise. + * @param steamId The Steam ID of the user to add as a friend. + * @returns A Promise that resolves to true if the friend was added successfully, false otherwise. */ AddFriend(steamId: string): Promise<boolean>; @@ -21,10 +21,10 @@ export interface Friends { /** * Invites a user to a specific game. - * @param {string} steamId - The Steam ID of the user to invite. - * @param {number} appId - The ID of the game to invite the user to. - * @param {string} connectString - Additional parameters for the invitation. - * @returns {Promise<boolean>} A Promise that resolves to true if the user was invited successfully, false otherwise. + * @param steamId The Steam ID of the user to invite. + * @param appId The ID of the game to invite the user to. + * @param connectString Additional parameters for the invitation. + * @returns A Promise that resolves to true if the user was invited successfully, false otherwise. */ InviteUserToGame(steamId: string, appId: number, connectString: string): Promise<boolean>; @@ -34,12 +34,12 @@ export interface Friends { //(e.ConvertTo64BitString()) InviteUserToRemotePlayTogetherCurrentGame(steam64Id: string): any; - RegisterForVoiceChatStatus(callback: (status: VoiceChatStatus) => void): Unregisterable | any; + RegisterForVoiceChatStatus(callback: (status: VoiceChatStatus) => void): Unregisterable; /** * Removes a user from the friend list. - * @param {string} steamId - The Steam ID of the user to remove from the friend list. - * @returns {Promise<boolean>} A Promise that resolves to true if the friend was removed successfully, false otherwise. + * @param steamId The Steam ID of the user to remove from the friend list. + * @returns A Promise that resolves to true if the friend was removed successfully, false otherwise. */ RemoveFriend(steamId: string): Promise<boolean>; } @@ -59,4 +59,4 @@ export interface VoiceChatStatus { bVoiceChatActive: boolean; bMicMuted: boolean; bOutputMuted: boolean; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/GameNotes.ts b/src/deck-components/steam-client/GameNotes.ts index e9820aa1..5c349e38 100644 --- a/src/deck-components/steam-client/GameNotes.ts +++ b/src/deck-components/steam-client/GameNotes.ts @@ -27,4 +27,4 @@ export interface GameNotes { SyncToServer(): Promise<any>; UploadImage: any; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/GameSessions.ts b/src/deck-components/steam-client/GameSessions.ts index 5d41a1a4..a3d28615 100644 --- a/src/deck-components/steam-client/GameSessions.ts +++ b/src/deck-components/steam-client/GameSessions.ts @@ -8,30 +8,30 @@ import { Screenshot } from "./Screenshots"; export interface GameSessions { /** * Registers a callback function to be called when an achievement notification is received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForAchievementNotification( callback: (achievementNotification: AchievementNotification) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be called when an app lifetime notification is received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForAppLifetimeNotifications( callback: (appLifetimeNotification: AppLifetimeNotification) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be called when a screenshot notification is received. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForScreenshotNotification( callback: (screenshotNotification: ScreenshotNotification) => void, - ): Unregisterable | any; + ): Unregisterable; } export interface AchievementNotification { @@ -55,4 +55,4 @@ export interface ScreenshotNotification { hScreenshot: number; strOperation: "deleted" | "written"; unAppID: number; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Input.ts b/src/deck-components/steam-client/Input.ts index ecc3835a..90bf784e 100644 --- a/src/deck-components/steam-client/Input.ts +++ b/src/deck-components/steam-client/Input.ts @@ -18,16 +18,14 @@ export interface Input { /** * Writes text. - * @param {string} textToWrite - The text to write. - * @returns {void} + * @param textToWrite The text to write. */ ControllerKeyboardSendText(textToWrite: string): void; /** * Sets a specified key's pressed state. - * @param {HIDKeyboardKey} keyIndex - The key index to set the state for. - * @param {boolean} state - true for pressed, false otherwise. - * @returns {void} + * @param keyIndex The key index to set the state for. + * @param state true for pressed, false otherwise. * @example * Send paste command: * ``` @@ -62,8 +60,8 @@ export interface Input { /** * Retrieves the controller mapping string for the specified controller index. - * @param {number} unControllerIndex - The controller index. - * @returns {Promise<string>} - A Promise that resolves to the controller mapping string. + * @param unControllerIndex The controller index. + * @returns A Promise that resolves to the controller mapping string. */ GetControllerMappingString(unControllerIndex: number): Promise<string>; @@ -90,75 +88,75 @@ export interface Input { QueryControllerConfigsForApp(appId: number, controllerIndex: number, param2: boolean): any; - RegisterForActiveControllerChanges: Unregisterable | any; // {"nActiveController":0} + RegisterForActiveControllerChanges: Unregisterable; // {"nActiveController":0} //param0 - e possibly appid? //param1 - some index? - RegisterForConfigSelectionChanges(callback: (param0: number, param1: number) => void): Unregisterable | any; + RegisterForConfigSelectionChanges(callback: (param0: number, param1: number) => void): Unregisterable; - RegisterForControllerAccountChanges: Unregisterable | any; + RegisterForControllerAccountChanges: Unregisterable; RegisterForControllerAnalogInputMessages( callback: (controllerAnalogInputMessages: ControllerAnalogInputMessage[]) => void, - ): Unregisterable | any; + ): Unregisterable; RegisterForControllerCommandMessages( callback: (controllerCommandMessage: ControllerCommandMessage) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback for changes in controller configuration cloud state. - * @param {(controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void} callback - The callback function for config cloud state changes. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function for config cloud state changes. + * @returns An object that can be used to unregister the callback. */ RegisterForControllerConfigCloudStateChanges( callback: (controllerConfigCloudStateChange: ControllerConfigCloudStateChange) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback for receiving controller configuration info messages (controller layouts query, personal controller layout query). - * @param {(controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[]) => void} callback - The callback function for controller config info messages. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function for controller config info messages. + * @returns An object that can be used to unregister the callback. * @remarks Do Not Use, this will break the controller layout selection unless you know what you are doing. */ RegisterForControllerConfigInfoMessages( callback: ( controllerConfigInfoMessages: ControllerConfigInfoMessageList[] | ControllerConfigInfoMessageQuery[], ) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be invoked when controller input messages are received. - * @param {(controllerInputMessages: ControllerInputMessage[]) => void} callback - The callback function to be invoked when controller input messages are received. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be invoked when controller input messages are received. + * @returns An object that can be used to unregister the callback. */ RegisterForControllerInputMessages( callback: (controllerInputMessages: ControllerInputMessage[]) => void, - ): Unregisterable | any; + ): Unregisterable; - RegisterForControllerListChanges(callback: (controllerListChanges: ControllerInfo[]) => void): Unregisterable | any; + RegisterForControllerListChanges(callback: (controllerListChanges: ControllerInfo[]) => void): Unregisterable; /** * Registers a callback for changes in the controller state (buttons presses, triggers presses, joystick changes etc...). - * @param {(controllerStateChanges: ControllerStateChange[]) => void} callback - The callback function for controller state changes. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function for controller state changes. + * @returns An object that can be used to unregister the callback. */ RegisterForControllerStateChanges( callback: (controllerStateChanges: ControllerStateChange[]) => void, - ): Unregisterable | any; + ): Unregisterable; - RegisterForDualSenseUpdateNotification(callback: (m_strDualSenseUpdateProduct: string) => void): Unregisterable | any; + RegisterForDualSenseUpdateNotification(callback: (m_strDualSenseUpdateProduct: string) => void): Unregisterable; /** * Registers a callback for receiving game keyboard messages (text field popup for inputting text for games when in character creation or etc...). - * @param {(gameKeyboardMessage: GameKeyboardMessage) => void} callback - The callback function for game keyboard messages. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function for game keyboard messages. + * @returns An object that can be used to unregister the callback. */ - RegisterForGameKeyboardMessages(callback: (gameKeyboardMessage: GameKeyboardMessage) => void): Unregisterable | any; + RegisterForGameKeyboardMessages(callback: (gameKeyboardMessage: GameKeyboardMessage) => void): Unregisterable; - RegisterForRemotePlayConfigChanges(callback: () => void): Unregisterable | any; + RegisterForRemotePlayConfigChanges(callback: () => void): Unregisterable; //data.appId, data.ulConfigId - RegisterForShowControllerLayoutPreviewMessages(callback: (data: any) => void): Unregisterable | any; + RegisterForShowControllerLayoutPreviewMessages(callback: (data: any) => void): Unregisterable; /* onTouchMenuInput(e) { @@ -168,23 +166,23 @@ export interface Input { } } */ - RegisterForTouchMenuInputMessages(callback: (inputs: number[]) => void): Unregisterable | any; + RegisterForTouchMenuInputMessages(callback: (inputs: number[]) => void): Unregisterable; - RegisterForTouchMenuMessages(callback: (touchMenuMessage: TouchMenuMessage) => void): Unregisterable | any; + RegisterForTouchMenuMessages(callback: (touchMenuMessage: TouchMenuMessage) => void): Unregisterable; //param0 - index? - RegisterForUIVisualization(param0: any, param1: any, param2: any): Unregisterable | any; + RegisterForUIVisualization(param0: any, param1: any, param2: any): Unregisterable; - RegisterForUnboundControllerListChanges(callback: (m_unboundControllerList: any) => void): Unregisterable | any; // param0 is an array + RegisterForUnboundControllerListChanges(callback: (m_unboundControllerList: any) => void): Unregisterable; // param0 is an array /* OnDismissKeyboardMessage(e) { this.m_WindowStore.SteamUIWindows.forEach((e => e.VirtualKeyboardManager.SetVirtualKeyboardHidden(e.BrowserWindow))) } */ - RegisterForUserDismissKeyboardMessages(callback: (param0: any) => void): Unregisterable | any; + RegisterForUserDismissKeyboardMessages(callback: (param0: any) => void): Unregisterable; - RegisterForUserKeyboardMessages: Unregisterable | any; + RegisterForUserKeyboardMessages: Unregisterable; RequestGyroActive(controllerIndex: number, param1: boolean): any; @@ -301,10 +299,9 @@ export interface Input { /** * Sets the mouse position. - * @param {number} pid - 0 - * @param {number} x - Mouse X position. - * @param {number} y - Mouse Y position. - * @returns {void} + * @param pid 0 + * @param x Mouse X position. + * @param y Mouse Y position. */ SetMousePosition(pid: number, x: number, y: number): void; @@ -320,7 +317,6 @@ export interface Input { /** * Opens the Steam Input controller settings. * This function displays the Steam Input controller settings for configuration. - * @returns {void} */ ShowControllerSettings(): void; @@ -744,4 +740,4 @@ export interface TouchMenuMessage { bHasVirtualMenus: boolean; unControllerIndex: number; appID: number; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/InstallFolder.ts b/src/deck-components/steam-client/InstallFolder.ts index 8f55a339..fe62ae40 100644 --- a/src/deck-components/steam-client/InstallFolder.ts +++ b/src/deck-components/steam-client/InstallFolder.ts @@ -7,97 +7,90 @@ import {AppError} from "./App"; export interface InstallFolder { /** * Adds a Steam Library folder to the Steam client. - * @param {string} steamLibraryPath - The path of the Steam Library folder to be added. - * @returns {Promise<number>} - A Promise that resolves to the index of the added folder. + * @param steamLibraryPath The path of the Steam Library folder to be added. + * @returns A Promise that resolves to the index of the added folder. */ AddInstallFolder(steamLibraryPath: string): Promise<number>; /** * Opens the file explorer to browse files in a specific Steam Library folder. - * @param {number} folderIndex - The index of the folder to be opened. - * @returns {void} + * @param folderIndex The index of the folder to be opened. */ BrowseFilesInFolder(folderIndex: number): void; /** * Cancels the current move operation for moving game content. - * @returns {void} */ CancelMove(): void; /** * Retrieves a list of installed Steam Library folders. - * @returns {Promise<SteamInstallFolder[]>} - A Promise that resolves to an array of SteamInstallFolder objects. + * @returns A Promise that resolves to an array of SteamInstallFolder objects. */ GetInstallFolders(): Promise<SteamInstallFolder[]>; /** * Retrieves a list of potential Steam Library folders that can be added. - * @returns {Promise<PotentialInstallFolder[]>} - A Promise that resolves to an array of PotentialInstallFolder objects. + * @returns A Promise that resolves to an array of PotentialInstallFolder objects. */ GetPotentialFolders(): Promise<PotentialInstallFolder[]>; /** * Moves the installation folder for a specific app to another Steam Library folder. - * @param {number} appId - The ID of the application to be moved. - * @param {number} folderIndex - The index of the target Steam Library folder. - * @returns {void} + * @param appId The ID of the application to be moved. + * @param folderIndex The index of the target Steam Library folder. */ MoveInstallFolderForApp(appId: number, folderIndex: number): void; /** * Refreshes the list of installed Steam Library folders. - * @returns {any} - A Promise or response indicating the refresh operation. + * @returns A Promise or response indicating the refresh operation. */ RefreshFolders(): any; /** * Registers a callback function to be called when changes occur in Steam Install Folders. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForInstallFolderChanges(callback: (folderChange: FolderChange) => void): Unregisterable | any; + RegisterForInstallFolderChanges(callback: (folderChange: FolderChange) => void): Unregisterable; /** * Registers a callback function to be called when moving game content progresses. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForMoveContentProgress(callback: (moveContentProgress: MoveContentProgress) => void): Unregisterable | any; + RegisterForMoveContentProgress(callback: (moveContentProgress: MoveContentProgress) => void): Unregisterable; /** * Registers a callback function to be called when repairing an install folder is finished. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForRepairFolderFinished(callback: (folderChange: FolderChange) => void): Unregisterable | any; + RegisterForRepairFolderFinished(callback: (folderChange: FolderChange) => void): Unregisterable; /** * Removes a Steam Library folder from the Steam client. - * @param {number} folderIndex - The index of the folder to be removed. - * @returns {void} + * @param folderIndex The index of the folder to be removed. */ RemoveInstallFolder(folderIndex: number): void; /** * Repairs an installed Steam Library folder. - * @param {number} folderIndex - The index of the folder to be repaired. - * @returns {void} + * @param folderIndex The index of the folder to be repaired. */ RepairInstallFolder(folderIndex: number): void; /** * Sets a specific Steam Library folder as the default install folder. - * @param {number} folderIndex - The index of the folder to be set as default. - * @returns {void} + * @param folderIndex The index of the folder to be set as default. */ SetDefaultInstallFolder(folderIndex: number): void; /** * Sets a user-defined label for a specific Steam Library folder. - * @param {number} folderIndex - The index of the folder to be labeled. - * @param {string} userLabel - The label to be assigned to the folder. - * @returns {void} + * @param folderIndex The index of the folder to be labeled. + * @param userLabel The label to be assigned to the folder. */ SetFolderLabel(folderIndex: number, userLabel: string): void; } @@ -172,4 +165,4 @@ export interface MoveContentProgress { strBytesMoved: string; strTotalBytesToMove: string; nFilesMoved: number; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Installs.ts b/src/deck-components/steam-client/Installs.ts index 6272eb14..db0c068c 100644 --- a/src/deck-components/steam-client/Installs.ts +++ b/src/deck-components/steam-client/Installs.ts @@ -7,83 +7,75 @@ import {AppError} from "./App"; export interface Installs { /** * Cancels the installation wizard if it is open. - * @returns {void} */ CancelInstall(): void; /** * Continues and starts the installation if the wizard is still open. - * @returns {void} */ ContinueInstall(): void; /** * Retrieves information from the last opened or currently opened installation wizard. - * @returns {Promise<InstallInfo>} A Promise that resolves to the InstallInfo. + * @returns A Promise that resolves to the InstallInfo. */ GetInstallManagerInfo(): Promise<InstallInfo>; /** * Opens the restore from backup installer wizard for a specific app. - * @param {string} appBackupPath - The backup path of the app. - * @returns {void} + * @param appBackupPath The backup path of the app. */ OpenInstallBackup(appBackupPath: string): void; /** * Opens the installation wizard for specified app IDs. - * @param {number[]} appIds - An array of app IDs to install. - * @returns {void} + * @param appIds An array of app IDs to install. */ OpenInstallWizard(appIds: number[]): void; /** * Opens the uninstall wizard for specified app IDs. - * @param {number[]} appIds - An array of app IDs to uninstall. - * @param {boolean} dontPrompt - Whether to *not* prompt the user to uninstall. - * @returns {void} + * @param appIds An array of app IDs to uninstall. + * @param dontPrompt Whether to *not* prompt the user to uninstall. */ OpenUninstallWizard(appIds: number[], dontPrompt: boolean): void; - RegisterForShowConfirmUninstall: Unregisterable | any; // Broken? doesn't seem to work + RegisterForShowConfirmUninstall: Unregisterable; // Broken? doesn't seem to work /** * Registers a callback function to be called when the "Failed Uninstall" dialog is shown. - * @param {function} callback - The callback function to be called when the dialog is shown. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called when the dialog is shown. + * @returns An object that can be used to unregister the callback. */ - RegisterForShowFailedUninstall(callback: (appId: number, reason: AppError) => void): Unregisterable | any; + RegisterForShowFailedUninstall(callback: (appId: number, reason: AppError) => void): Unregisterable; /** * Registers a callback function to be called when the installation wizard is shown. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForShowInstallWizard(callback: (data: InstallInfo) => void): Unregisterable | any; + RegisterForShowInstallWizard(callback: (data: InstallInfo) => void): Unregisterable; RegisterForShowRegisterCDKey: any; /** * Sets a list of app identifiers for downloads in the installation wizard. - * @param {number[]} appIds - An array of app IDs to set. - * @returns {void} + * @param appIds An array of app IDs to set. * @remarks The wizard will not reflect this change immediately, but changing another option will. */ SetAppList(appIds: number[]): void; /** * Sets the options for creating shortcuts in the installation wizard. - * @param {boolean} bDesktopShortcut - Whether to create a desktop shortcut. - * @param {boolean} bSystemMenuShortcut - Whether to create a system menu shortcut. - * @returns {void} + * @param bDesktopShortcut Whether to create a desktop shortcut. + * @param bSystemMenuShortcut Whether to create a system menu shortcut. * @remarks The wizard will not reflect this change immediately, but changing another option will. */ SetCreateShortcuts(bDesktopShortcut: boolean, bSystemMenuShortcut: boolean): void; /** * Sets the install folder for the installation wizard using an install folder index. - * @param {number} folderIndex - The index of the install folder. - * @returns {void} + * @param folderIndex The index of the install folder. * @remarks The wizard will not reflect this change immediately, but changing another option will. */ SetInstallFolder(folderIndex: number): void; @@ -136,4 +128,4 @@ export enum EInstallManagerState { Complete = 14, Failed = 15, Canceled = 16, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Messaging.ts b/src/deck-components/steam-client/Messaging.ts index 62505338..07f83f8b 100644 --- a/src/deck-components/steam-client/Messaging.ts +++ b/src/deck-components/steam-client/Messaging.ts @@ -7,7 +7,7 @@ export interface Messaging { RegisterForMessages( section: string, callback: (section: string, param1: string, message: string) => void, - ): Unregisterable | any; + ): Unregisterable; /* function m(e) { @@ -18,4 +18,4 @@ export interface Messaging { SteamClient.Messaging.PostMessage("FriendsUI", "AcceptedRemotePlayInvite", JSON.stringify({id: this.appID})) : SteamClient.Messaging.PostMessage("FriendsUI", "AcceptedGameInvite", JSON.stringify({id: this.appID})) */ PostMessage(section: string, param1: string, message: string): void; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Music.ts b/src/deck-components/steam-client/Music.ts index 5fb0661e..d004ffc7 100644 --- a/src/deck-components/steam-client/Music.ts +++ b/src/deck-components/steam-client/Music.ts @@ -15,8 +15,8 @@ export interface Music { IncreaseVolume(): void; /** - * @param {number} param0 - Unknown parameter usage. - * @param {number} param1 - Unknown parameter usage. + * @param param0 Unknown parameter usage. + * @param param1 Unknown parameter usage. * @todo: unknown parameter usages, I have tried soundtrack identifier + track index and in reverse as well */ PlayEntry(param0: number, param1: number): void; @@ -33,39 +33,39 @@ export interface Music { /** * Registers a callback function to be called when music playback changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForMusicPlaybackChanges(callback: (param0: boolean | MusicTrack) => void): Unregisterable | any; + RegisterForMusicPlaybackChanges(callback: (param0: boolean | MusicTrack) => void): Unregisterable; /** * Registers a callback function to be called when the music playback position changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForMusicPlaybackPosition(callback: (position: number) => void): Unregisterable | any; + RegisterForMusicPlaybackPosition(callback: (position: number) => void): Unregisterable; /** * Sets the playback position of the music track. - * @param {number} position - The position to set in seconds. + * @param position The position to set in seconds. */ SetPlaybackPosition(position: number): void; /** * Sets the repeat status for music playback. - * @param {MusicRepeatStatus} status - The repeat status. + * @param status The repeat status. */ SetPlayingRepeatStatus(status: MusicRepeatStatus): void; /** * Sets the shuffle status for music playback. - * @param {boolean} value - True to enable shuffle, false to disable shuffle. + * @param value True to enable shuffle, false to disable shuffle. */ SetPlayingShuffled(value: boolean): void; /** * Sets the volume for music playback. - * @param {number} volume - The volume level to set. + * @param volume The volume level to set. * @remarks Ranges from 0 to 100. */ SetVolume(volume: number): void; @@ -103,4 +103,4 @@ export enum MusicRepeatStatus { All = 1, Once = 2, Max = 3, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Notifications.ts b/src/deck-components/steam-client/Notifications.ts index dbb25933..566b3e81 100644 --- a/src/deck-components/steam-client/Notifications.ts +++ b/src/deck-components/steam-client/Notifications.ts @@ -7,11 +7,11 @@ import {JsPbMessage, Unregisterable} from "./index"; export interface Notifications { /** * If `data` is deserialized, returns one of the following here: {@link Notifications} - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns An object that can be used to unregister the callback. */ RegisterForNotifications( callback: (notificationIndex: number, type: EClientNotificationType, data: ArrayBuffer) => void, - ): Unregisterable | any; + ): Unregisterable; } export enum EClientNotificationType { diff --git a/src/deck-components/steam-client/OpenVR.ts b/src/deck-components/steam-client/OpenVR.ts index dde8a9af..25ed556a 100644 --- a/src/deck-components/steam-client/OpenVR.ts +++ b/src/deck-components/steam-client/OpenVR.ts @@ -19,19 +19,19 @@ export interface OpenVR { QuitAllVR(): any; - RegisterForButtonPress: Unregisterable | any; + RegisterForButtonPress: Unregisterable; - RegisterForHMDActivityLevelChanged(callback: (m_eHMDActivityLevel: EHMDActivityLevel) => void): Unregisterable | any; + RegisterForHMDActivityLevelChanged(callback: (m_eHMDActivityLevel: EHMDActivityLevel) => void): Unregisterable; - RegisterForInstallDialog: Unregisterable | any; + RegisterForInstallDialog: Unregisterable; - RegisterForStartupErrors(callback: (clientError: any, initError: any, initErrorString: string) => void): Unregisterable | any; + RegisterForStartupErrors(callback: (clientError: any, initError: any, initErrorString: string) => void): Unregisterable; - RegisterForVRHardwareDetected(callback: (m_bHMDPresent: any, m_bHMDHardwareDetected: any, m_strHMDName: any) => void): Unregisterable | any; + RegisterForVRHardwareDetected(callback: (m_bHMDPresent: any, m_bHMDHardwareDetected: any, m_strHMDName: any) => void): Unregisterable; - RegisterForVRModeChange(callback: (m_bIsVRRunning: boolean) => void): Unregisterable | any; + RegisterForVRModeChange(callback: (m_bIsVRRunning: boolean) => void): Unregisterable; - RegisterForVRSceneAppChange(callback: (param0: number) => void): Unregisterable | any; + RegisterForVRSceneAppChange(callback: (param0: number) => void): Unregisterable; SetOverlayInteractionAffordance: any; @@ -43,9 +43,9 @@ export interface OpenVR { export interface VRDevice { BIsConnected: any; - RegisterForDeviceConnectivityChange: Unregisterable | any; + RegisterForDeviceConnectivityChange: Unregisterable; - RegisterForVRDeviceSeenRecently(callback: (m_bVRDeviceSeenRecently: any) => void): Unregisterable | any; + RegisterForVRDeviceSeenRecently(callback: (m_bVRDeviceSeenRecently: any) => void): Unregisterable; } export interface DeviceProperties { @@ -54,7 +54,7 @@ export interface DeviceProperties { GetFloatDeviceProperty: any; GetInt32DeviceProperty: any; GetStringDeviceProperty: any; - RegisterForDevicePropertyChange: Unregisterable | any; + RegisterForDevicePropertyChange: Unregisterable; } export interface Keyboard { @@ -63,7 +63,7 @@ export interface Keyboard { /** * {@link EKeyboardFlags} could be useful here */ - RegisterForStatus(callback: (m_bIsKeyboardOpen: boolean, m_eKeyboardFlags: number, m_sInitialKeyboardText: string) => void): Unregisterable | any; + RegisterForStatus(callback: (m_bIsKeyboardOpen: boolean, m_eKeyboardFlags: number, m_sInitialKeyboardText: string) => void): Unregisterable; SendDone(): any; @@ -87,7 +87,7 @@ export interface PathProperties { export interface VRNotifications { HideCustomNotification: any; - RegisterForNotificationEvent: Unregisterable | any; + RegisterForNotificationEvent: Unregisterable; ShowCustomNotification: any; } @@ -96,10 +96,10 @@ export interface VROverlay { IsDashboardVisible(): Promise<boolean>; - RegisterForButtonPress: Unregisterable | any; - RegisterForCursorMovement: Unregisterable | any; - RegisterForThumbnailChanged: Unregisterable | any; - RegisterForVisibilityChanged: Unregisterable | any; + RegisterForButtonPress: Unregisterable; + RegisterForCursorMovement: Unregisterable; + RegisterForThumbnailChanged: Unregisterable; + RegisterForVisibilityChanged: Unregisterable; ShowDashboard: any; SwitchToDashboardOverlay(param0: string): void; diff --git a/src/deck-components/steam-client/Overlay.ts b/src/deck-components/steam-client/Overlay.ts index fb62fefb..867557b8 100644 --- a/src/deck-components/steam-client/Overlay.ts +++ b/src/deck-components/steam-client/Overlay.ts @@ -3,7 +3,6 @@ import {EBrowserType, UIMode, Unregisterable} from "./index"; export interface Overlay { /** * Destroys the gamepad UI desktop configurator window if open. - * @returns {void} */ DestroyGamePadUIDesktopConfiguratorWindow(): void; @@ -13,53 +12,53 @@ export interface Overlay { HandleProtocolForOverlayBrowser(appId: number, protocol: string): any; - RegisterForActivateOverlayRequests: Unregisterable | any; + RegisterForActivateOverlayRequests: Unregisterable; /** * Registers a callback function to be called when a microtransaction authorization is requested. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForMicroTxnAuth( callback: (appId: number, microTxnId: string, realm: SteamRealm, microTxnUrl: string) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be called when a microtransaction authorization is dismissed by the user in Steam's authorization page. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForMicroTxnAuthDismiss(callback: (appId: number, microTxnId: string) => void): Unregisterable | any; + RegisterForMicroTxnAuthDismiss(callback: (appId: number, microTxnId: string) => void): Unregisterable; RegisterForNotificationPositionChanged( callback: (appId: any, position: NotificationPosition, horizontalInset: number, verticalInset: number) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be called when an overlay is activated or closed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForOverlayActivated( callback: (overlayProcessPid: number, appId: number, active: boolean, param3: boolean) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be called when the overlay browser protocols change. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForOverlayBrowserProtocols( callback: (browseProtocols: OverlayBrowserProtocols) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers **the** callback function to be called when the overlay browser information changes. - * @param {function} callback - The callback function to be called when the overlay browser information changes. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called when the overlay browser information changes. + * @returns An object that can be used to unregister the callback. * @remarks Do Not Use, this will break the overlay unless you know what you are doing. */ - RegisterOverlayBrowserInfoChanged(callback: () => void): Unregisterable | any; + RegisterOverlayBrowserInfoChanged(callback: () => void): Unregisterable; SetOverlayState(appId: number, uiComposition: UIComposition): any; } @@ -121,4 +120,4 @@ export enum UIComposition { * events to the Gamescope foreground app (game) instead of Steam. */ OverlayKeyboard = 4, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Parental.ts b/src/deck-components/steam-client/Parental.ts index ccb94cb3..4e061b68 100644 --- a/src/deck-components/steam-client/Parental.ts +++ b/src/deck-components/steam-client/Parental.ts @@ -6,22 +6,21 @@ import {Result, Unregisterable} from "./index"; export interface Parental { /** * Locks the parental control settings. - * @returns {void} */ LockParentalLock(): void; /** * Registers a callback function to be invoked when parental settings change. - * @param {(parentalSettings: ParentalSettings) => void} callback - The callback function to be invoked when parental settings change. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be invoked when parental settings change. + * @returns An object that can be used to unregister the callback. */ - RegisterForParentalSettingsChanges(callback: (parentalSettings: ParentalSettings) => void): Unregisterable | any; + RegisterForParentalSettingsChanges(callback: (parentalSettings: ParentalSettings) => void): Unregisterable; /** * Unlocks the parental lock with the provided PIN. - * @param {string} pin - The 4-digit PIN to unlock the parental lock. - * @param {boolean} param1 - Additional parameter. // Todo: Unknown usage. - * @returns {Promise<Result>} - A Promise that resolves to a number representing the result of the unlock operation. + * @param pin The 4-digit PIN to unlock the parental lock. + * @param param1 Additional parameter. // Todo: Unknown usage. + * @returns A Promise that resolves to a number representing the result of the unlock operation. */ UnlockParentalLock(pin: string, param1: boolean): Promise<Result>; } @@ -76,4 +75,4 @@ interface AppList { * Key-value pairs where the key is the `appId` (e.g., "App_123456") and the value indicates whether the appId is allowed during parental lock. */ [appId: string]: number; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/RemotePlay.ts b/src/deck-components/steam-client/RemotePlay.ts index 4d8edcd3..3751bcc2 100644 --- a/src/deck-components/steam-client/RemotePlay.ts +++ b/src/deck-components/steam-client/RemotePlay.ts @@ -39,45 +39,45 @@ export interface RemotePlay { InstallAudioDriver: any; InstallInputDriver: any; MoveControllerToSlot: any; - RegisterForAdditionalParentalBlocks: Unregisterable | any; - RegisterForAudioDriverPrompt: Unregisterable | any; - RegisterForBitrateOverride: Unregisterable | any; - RegisterForControllerIndexSet: Unregisterable | any; + RegisterForAdditionalParentalBlocks: Unregisterable; + RegisterForAudioDriverPrompt: Unregisterable; + RegisterForBitrateOverride: Unregisterable; + RegisterForControllerIndexSet: Unregisterable; - RegisterForDevicesChanges(callback: (devicesChange: RemotePlayDevice[]) => void): Unregisterable | any; + RegisterForDevicesChanges(callback: (devicesChange: RemotePlayDevice[]) => void): Unregisterable; - RegisterForGroupCreated: Unregisterable | any; - RegisterForGroupDisbanded: Unregisterable | any; - RegisterForInputDriverPrompt: Unregisterable | any; - RegisterForInputDriverRestartNotice: Unregisterable | any; + RegisterForGroupCreated: Unregisterable; + RegisterForGroupDisbanded: Unregisterable; + RegisterForInputDriverPrompt: Unregisterable; + RegisterForInputDriverRestartNotice: Unregisterable; RegisterForInputUsed( callback: (steam64Id: string, type: ClientUsedInputType, guestId: number) => void, - ): Unregisterable | any; // only fires on host + ): Unregisterable; // only fires on host - RegisterForInviteResult: Unregisterable | any; + RegisterForInviteResult: Unregisterable; RegisterForNetworkUtilizationUpdate( callback: (steam64Id: string, guestId: number, networkUtilization: number, networkDuration: number) => void, - ): Unregisterable | any; // only fires on host + ): Unregisterable; // only fires on host - RegisterForPlaceholderStateChanged(callback: (isShowingPlaceholder: boolean) => void): Unregisterable | any; + RegisterForPlaceholderStateChanged(callback: (isShowingPlaceholder: boolean) => void): Unregisterable; - RegisterForPlayerInputSettingsChanged: Unregisterable | any; + RegisterForPlayerInputSettingsChanged: Unregisterable; - RegisterForQualityOverride(callback: (hostStreamingQualityOverride: number) => void): Unregisterable | any; + RegisterForQualityOverride(callback: (hostStreamingQualityOverride: number) => void): Unregisterable; - RegisterForRemoteClientLaunchFailed: Unregisterable | any; + RegisterForRemoteClientLaunchFailed: Unregisterable; - RegisterForRemoteClientStarted(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client + RegisterForRemoteClientStarted(callback: (steam64Id: string, appId: number) => void): Unregisterable; // only fires on client - RegisterForRemoteClientStopped(callback: (steam64Id: string, appId: number) => void): Unregisterable | any; // only fires on client + RegisterForRemoteClientStopped(callback: (steam64Id: string, appId: number) => void): Unregisterable; // only fires on client - RegisterForSessionStarted(callback: (steam64Id: any, gameId: any, guestId: any) => void): Unregisterable | any; + RegisterForSessionStarted(callback: (steam64Id: any, gameId: any, guestId: any) => void): Unregisterable; - RegisterForSessionStopped(callback: (steam64Id: any, guestId: any) => void): Unregisterable | any; + RegisterForSessionStopped(callback: (steam64Id: any, guestId: any) => void): Unregisterable; - RegisterForSettingsChanges(callback: (remotePlaySettings: RemotePlaySettings) => void): Unregisterable | any; + RegisterForSettingsChanges(callback: (remotePlaySettings: RemotePlaySettings) => void): Unregisterable; SetClientStreamingBitrate(bitrate: number): void; @@ -162,4 +162,4 @@ export enum StreamP2PScope { OnlyMe = 2, Friends = 3, Everyone = 4, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Screenshots.ts b/src/deck-components/steam-client/Screenshots.ts index a5c97f11..0e835e76 100644 --- a/src/deck-components/steam-client/Screenshots.ts +++ b/src/deck-components/steam-client/Screenshots.ts @@ -4,101 +4,99 @@ export interface Screenshots { /** * Deletes a local screenshot. - * @param {string} appId - The ID of the application. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {Promise<boolean>} - A Promise that resolves to a boolean value indicating whether the deletion was successful. + * @param appId The ID of the application. + * @param screenshotIndex The index of the local screenshot. + * @returns A Promise that resolves to a boolean value indicating whether the deletion was successful. */ DeleteLocalScreenshot(appId: string, screenshotIndex: number): Promise<boolean>; /** * Retrieves all local screenshots for all applications. - * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects. + * @returns A Promise that resolves to an array of Screenshot objects. */ GetAllAppsLocalScreenshots(): Promise<Screenshot[]>; /** * Retrieves the count of all local screenshots for all applications. - * @returns {Promise<number>} - A Promise that resolves to the count of local screenshots. + * @returns A Promise that resolves to the count of local screenshots. */ GetAllAppsLocalScreenshotsCount(): Promise<number>; /** * Retrieves a range of local screenshots for all applications. - * @param {number} start - The starting index of the screenshot range. - * @param {number} end - The ending index of the screenshot range. - * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects within the specified range. + * @param start The starting index of the screenshot range. + * @param end The ending index of the screenshot range. + * @returns A Promise that resolves to an array of Screenshot objects within the specified range. */ GetAllAppsLocalScreenshotsRange(start: number, end: number): Promise<Screenshot[]>; /** * Retrieves all local screenshots. - * @returns {Promise<Screenshot[]>} - A Promise that resolves to an array of Screenshot objects. + * @returns A Promise that resolves to an array of Screenshot objects. */ GetAllLocalScreenshots(): Promise<Screenshot[]>; /** * Retrieves the game associated with a specific local screenshot index. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {Promise<number>} - A Promise that resolves to the ID of the game associated with the screenshot. + * @param screenshotIndex The index of the local screenshot. + * @returns A Promise that resolves to the ID of the game associated with the screenshot. */ GetGameWithLocalScreenshots(screenshotIndex: number): Promise<number>; /** * Retrieves the last taken local screenshot. - * @returns {Promise<Screenshot>} - A Promise that resolves to the last taken local screenshot. + * @returns A Promise that resolves to the last taken local screenshot. */ GetLastScreenshotTaken(): Promise<Screenshot>; /** * Retrieves a specific local screenshot for an application. - * @param {string} appId - The ID of the application. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {Promise<Screenshot>} - A Promise that resolves to the requested local screenshot. + * @param appId The ID of the application. + * @param screenshotIndex The index of the local screenshot. + * @returns A Promise that resolves to the requested local screenshot. */ GetLocalScreenshotByHandle(appId: string, screenshotIndex: number): Promise<Screenshot>; /** * Retrieves the count of local screenshots for a specific application. - * @param {number} appId - The ID of the application. - * @returns {Promise<number>} - A Promise that resolves to the count of local screenshots for the application. + * @param appId The ID of the application. + * @returns A Promise that resolves to the count of local screenshots for the application. */ GetLocalScreenshotCount(appId: number): Promise<number>; /** * Retrieves the number of games with local screenshots. - * @returns {Promise<number>} - A Promise that resolves to the number of games with local screenshots. + * @returns A Promise that resolves to the number of games with local screenshots. */ GetNumGamesWithLocalScreenshots(): Promise<number>; /** * Gets total screenshot usage in the specified library folder. * @param path Library folder path. - * @returns {Promise<number>} A Promise that resolves to the number of taken space in bytes. + * @returns A Promise that resolves to the number of taken space in bytes. */ GetTotalDiskSpaceUsage(path: string): Promise<number>; /** * Opens a local screenshot in the system image viewer. * If the screenshot index is invalid, this function opens the screenshots directory for the specified application ID. - * @param {string} appId - The ID of the application. - * @param {number} screenshotIndex - The index of the local screenshot. - * @returns {void} + * @param appId The ID of the application. + * @param screenshotIndex The index of the local screenshot. */ ShowScreenshotInSystemViewer(appId: string, screenshotIndex: number): void; /** * Opens the folder containing local screenshots for a specific application. - * @param {string} appId - The ID of the application. - * @returns {void} + * @param appId The ID of the application. */ ShowScreenshotsOnDisk(appId: string): void; /** * Uploads a local screenshot. - * @param {string} appId - The ID of the application. - * @param {number} localScreenshot_hHandle - The handle of the local screenshot. - * @param {number} filePrivacyState - The privacy state of the screenshot file. - * @returns {Promise<boolean>} - A Promise that resolves to a boolean value indicating whether the upload was successful. + * @param appId The ID of the application. + * @param localScreenshot_hHandle The handle of the local screenshot. + * @param filePrivacyState The privacy state of the screenshot file. + * @returns A Promise that resolves to a boolean value indicating whether the upload was successful. */ UploadLocalScreenshot( appId: string, @@ -128,4 +126,4 @@ export enum FilePrivacyState { FriendsOnly = 4, Public = 8, Unlisted = 16, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/ServerBrowser.ts b/src/deck-components/steam-client/ServerBrowser.ts index fcfb9dec..5c7386d0 100644 --- a/src/deck-components/steam-client/ServerBrowser.ts +++ b/src/deck-components/steam-client/ServerBrowser.ts @@ -6,16 +6,15 @@ import {OperationResponse, Unregisterable} from "./index"; export interface ServerBrowser { /** * Adds a favorite server. - * @param {ServerBrowserServerFull} server - The server to add. - * @returns {Promise<string>} A Promise that resolves to an empty string if successful, `Invalid/missing IPv4?` if failed. - * @todo Refreshed the favorite servers list upon adding once, but doesn't now. :-( + * @param server The server to add. + * @returns A Promise that resolves to an empty string if successful, `Invalid/missing IPv4?` if failed. */ AddFavoriteServer(server: ServerBrowserServerFull): Promise<string>; /** * Adds a favorite server by IP. - * @param {string} ip - The IP to add to favorite servers. - * @returns {Promise<string>} A Promise that resolves to an empty string if successful, localization string if failed. + * @param ip The IP to add to favorite servers. + * @returns A Promise that resolves to an empty string if successful, localization string if failed. */ AddFavoriteServersByIP(ip: string): Promise<string>; @@ -23,37 +22,36 @@ export interface ServerBrowser { /** * Connects to a server from a given dialog. - * @param {number} dialogId - The dialog ID to use. - * @param {string} password - Server password, empty if none. - * @returns {Promise<JoinServerError>} A Promise that resolves to a connection status. + * @param dialogId The dialog ID to use. + * @param password Server password, empty if none. + * @returns A Promise that resolves to a connection status. */ ConnectToServer(dialogId: number, password: string): Promise<JoinServerError>; /** * Creates a server info dialog, on which your friend is playing on. - * @param {number} pid - 0 - * @param {string} steamId - A Steam64 ID of a friend. - * @returns {void} + * @param pid 0 + * @param steamId A Steam64 ID of a friend. */ CreateFriendGameInfoDialog(pid: number, steamId: string): void; /** * Creates a server info dialog. - * @param {string} ip - The IP to create a dialog for. - * @param {number} port - The IP's port. - * @param {number} queryPort - - * @returns {Promise<number>} A Promise that resolves to the current dialog ID. + * @param ip The IP to create a dialog for. + * @param port The IP's port. + * @param queryPort + * @returns A Promise that resolves to the current dialog ID. */ CreateServerGameInfoDialog(ip: string, port: number, queryPort: number): Promise<number>; /** * Retrieves the server list. - * @param {number} appId - The game ID, 0 for every game. - * @param {ServerBrowserTab} queryType - The tab to use. - * @param {string[]} filters - Server filters. - * @param {function} serverCallback - What to do with the found server? - * @param {function} requestCompletedCallback - The callback function to be called when the request is completed. - * @returns {Promise<number>} A Promise that resolves to the current server list request ID. + * @param appId The game ID, 0 for every game. + * @param queryType The tab to use. + * @param filters Server filters. + * @param serverCallback What to do with the found server? + * @param requestCompletedCallback The callback function to be called when the request is completed. + * @returns A Promise that resolves to the current server list request ID. * @throws Throws if the query type is unknown. * @throws Throws if the filter list isn't key/value pairs, i.e. of an even length. * @remarks Stops at 10000 if there are more servers to be found. @@ -107,107 +105,100 @@ export interface ServerBrowser { /** * Destroys the game info dialog functions (but not the window). - * @param {number} dialogId - The dialog ID to use. - * @returns {void} + * @param dialogId The dialog ID to use. * @remarks ServerBrowser.CancelServerQuery may throw if it tries to ping the server. */ DestroyGameInfoDialog(dialogId: number): void; /** * Stops retrieving the server list. - * @param {number} activeServerListRequestId - The active server request ID to use. - * @returns {void} + * @param activeServerListRequestId The active server request ID to use. */ DestroyServerListRequest(activeServerListRequestId: number): void; /** * Gets a list of games that support the server browser feature. - * @returns {Promise<ServerBrowserGame[]>} A Promise that resolves to a list of games. + * @returns A Promise that resolves to a list of games. */ GetMultiplayerGames(): Promise<ServerBrowserGame[]>; /** * Gets the server browser preferences. - * @returns {Promise<ServerBrowserPreferences>} A Promise that resolves to server browser preferences. + * @returns A Promise that resolves to server browser preferences. */ GetServerListPreferences(): Promise<ServerBrowserPreferences>; /** * Pings the server of a specified dialog ID. - * @param {number} dialogId - The dialog ID to use. - * @returns {Promise<number | OperationResponse>} + * @param dialogId The dialog ID to use. */ PingServer(dialogId: number): Promise<number | OperationResponse>; /** * Registers a callback function to be called when a server gets added to favorite servers. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForFavorites(callback: (list: ServerBrowserFavoritesAndHistory) => void): Unregisterable | any; + RegisterForFavorites(callback: (list: ServerBrowserFavoritesAndHistory) => void): Unregisterable; /** * Registers a callback function to be called when idk - * @param {number} dialogId - The dialog ID to use. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. + * @param dialogId The dialog ID to use. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForFriendGamePlayed( dialogId: number, callback: (server: ServerBrowserFriendServer) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be called when a server info dialog opens. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForGameInfoDialogs(callback: (dialogs: ServerBrowserDialog[]) => void): Unregisterable | any; + RegisterForGameInfoDialogs(callback: (dialogs: ServerBrowserDialog[]) => void): Unregisterable; /** * Registers a callback function to be called when player details get requested. - * @param {number} dialogId - The dialog ID to use. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. + * @param dialogId The dialog ID to use. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForPlayerDetails( dialogId: number, callback: (player: ServerBrowserPlayer | ServerBrowserPlayerRefreshStatus) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be called when a server gets pinged. - * @param {number} dialogId - The dialog ID to use. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} An object that can be used to unregister the callback. + * @param dialogId The dialog ID to use. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForServerInfo(dialogId: number, callback: (server: ServerBrowserServerFull) => void): Unregisterable | any; + RegisterForServerInfo(dialogId: number, callback: (server: ServerBrowserServerFull) => void): Unregisterable; /** * Removes a server from favorite servers. - * @param {ServerBrowserServer} server - The server to remove. - * @returns {void} + * @param server The server to remove. */ RemoveFavoriteServer(server: ServerBrowserServer): void; /** * Removes a server from history of played servers. - * @param {ServerBrowserServer} server - The server to remove. - * @returns {void} + * @param server The server to remove. */ RemoveHistoryServer(server: ServerBrowserServer): void; /** * Requests player details for a specific dialog. - * @param {number} dialogId - The dialog ID to use. - * @returns {Promise<number | OperationResponse>} + * @param dialogId The dialog ID to use. */ RequestPlayerDetails(dialogId: number): Promise<number | OperationResponse>; /** * Sets the server browser preferences. - * @param {ServerBrowserPreferences} prefs - Server list preferences. - * @returns {void} + * @param prefs Server list preferences. */ SetServerListPreferences(prefs: ServerBrowserPreferences): void; } @@ -362,4 +353,4 @@ export interface ServerBrowserPlayer extends ServerBrowserPlayerRefreshStatus { score: number; /** Time played on the server. */ timePlayed: number; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Settings.ts b/src/deck-components/steam-client/Settings.ts index 5d5bb06c..34f651cb 100644 --- a/src/deck-components/steam-client/Settings.ts +++ b/src/deck-components/steam-client/Settings.ts @@ -6,13 +6,11 @@ export interface Settings { /** * Clears HTTP cache located in `<STEAMPATH>/appcache/httpcache`. - * @returns {void} */ ClearAllHTTPCaches(): void; /** * Clears download cache and logs you out. - * @returns {void} */ ClearDownloadCache(): void; @@ -30,7 +28,7 @@ export interface Settings { GetGlobalCompatTools(): Promise<CompatibilityToolInfo[]>; /** - * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link MsgMonitorInfo}. + * @returns A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link MsgMonitorInfo}. */ GetMonitorInfo(): Promise<ArrayBuffer>; @@ -47,21 +45,20 @@ export interface Settings { /** * Opens the Windows microphones dialog. - * @returns {void} */ OpenWindowsMicSettings(): void; - RegisterForMicVolumeUpdates: Unregisterable | any; + RegisterForMicVolumeUpdates: Unregisterable; /** * If `data` is deserialized, returns {@link MsgClientSettings}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns An object that can be used to unregister the callback. */ - RegisterForSettingsArrayChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterForSettingsArrayChanges(callback: (data: ArrayBuffer) => void): Unregisterable; - RegisterForSettingsChanges(callback: (steamSettings: SteamSettings) => void): Unregisterable | any; + RegisterForSettingsChanges(callback: (steamSettings: SteamSettings) => void): Unregisterable; - RegisterForTimeZoneChange(callback: (timezoneId: string) => void): Unregisterable | any; // When timezone is changed from settings, callback will return new timezoneId + RegisterForTimeZoneChange(callback: (timezoneId: string) => void): Unregisterable; // When timezone is changed from settings, callback will return new timezoneId ReinitMicSettings(): void; RequestDeviceAuthInfo(): void; @@ -86,8 +83,7 @@ export interface Settings { /** * Sets the "Don't save account credentials on this computer" option. - * @param {boolean} value - Whether to save account credentials. - * @returns {void} + * @param value Whether to save account credentials. */ SetSaveAccountCredentials(value: boolean): void; @@ -564,4 +560,4 @@ export enum HDRVisualization { Analysis = 2, HeatmapExtended = 3, HeatmapClassic = 4, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/SharedConnection.ts b/src/deck-components/steam-client/SharedConnection.ts index 9894eab9..abfefe7b 100644 --- a/src/deck-components/steam-client/SharedConnection.ts +++ b/src/deck-components/steam-client/SharedConnection.ts @@ -11,11 +11,11 @@ export interface SharedConnection { // src\clientdll\clientsharedconnection.cpp (154) : m_mapSharedConnections.HasElement( hSharedConnection ) Close(hSharedConnection: number): void; - RegisterOnBinaryMessageReceived(hSharedConnection: number, callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterOnBinaryMessageReceived(hSharedConnection: number, callback: (data: ArrayBuffer) => void): Unregisterable; - RegisterOnLogonInfoChanged(hSharedConnection: number, callback: (info: LogonInfo) => void): Unregisterable | any; + RegisterOnLogonInfoChanged(hSharedConnection: number, callback: (info: LogonInfo) => void): Unregisterable; - RegisterOnMessageReceived(hSharedConnection: number, callback: (param0: any) => void): Unregisterable | any; + RegisterOnMessageReceived(hSharedConnection: number, callback: (param0: any) => void): Unregisterable; SendMsg: any; SendMsgAndAwaitBinaryResponse: any; @@ -39,4 +39,4 @@ export interface LogonInfo { strSteamid: string; /** Country code. */ strUserCountry: string; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Stats.ts b/src/deck-components/steam-client/Stats.ts index c2fdc15b..c8e81313 100644 --- a/src/deck-components/steam-client/Stats.ts +++ b/src/deck-components/steam-client/Stats.ts @@ -7,4 +7,4 @@ export interface Stats { RecordActivationEvent(param0: string, param1: string): any; RecordDisplayEvent: any; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/SteamChina.ts b/src/deck-components/steam-client/SteamChina.ts index 04a3e45e..d23e6c78 100644 --- a/src/deck-components/steam-client/SteamChina.ts +++ b/src/deck-components/steam-client/SteamChina.ts @@ -1,3 +1,3 @@ export interface SteamChina { GetCustomLauncherAppID(): Promise<number>; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Storage.ts b/src/deck-components/steam-client/Storage.ts index 80e90852..aab95556 100644 --- a/src/deck-components/steam-client/Storage.ts +++ b/src/deck-components/steam-client/Storage.ts @@ -21,4 +21,4 @@ export interface Storage { SetObject(key: string, value: any): Promise<OperationResponse | void>; SetString(key: string, value: string): Promise<OperationResponse | void>; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Streaming.ts b/src/deck-components/steam-client/Streaming.ts index aadef786..6b6c9c00 100644 --- a/src/deck-components/steam-client/Streaming.ts +++ b/src/deck-components/steam-client/Streaming.ts @@ -8,48 +8,48 @@ export interface Streaming { /** * Registers a callback function to be called when the streaming client finishes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForStreamingClientFinished(callback: (code: number, result: string) => void): Unregisterable | any; + RegisterForStreamingClientFinished(callback: (code: number, result: string) => void): Unregisterable; /** * Registers a callback function to be called when there is progress in the launch of the streaming client. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForStreamingClientLaunchProgress( callback: (actionType: string, taskDetails: string, done: number, total: number) => void, - ): Unregisterable | any; + ): Unregisterable; /** * Registers a callback function to be called when the streaming client is started (e.g., when clicking the stream button). - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForStreamingClientStarted(callback: (appId: number) => void): Unregisterable | any; + RegisterForStreamingClientStarted(callback: (appId: number) => void): Unregisterable; /** * Registers a callback function to be called when the streaming launch is complete. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. * @todo `code` is likely a code, 1 being it started, 10 being host computer is updating game, `result` just returns "complete" */ - RegisterForStreamingLaunchComplete(callback: (code: number, result: string) => void): Unregisterable | any; + RegisterForStreamingLaunchComplete(callback: (code: number, result: string) => void): Unregisterable; - RegisterForStreamingShowEula(callback: (appId: number) => any): Unregisterable | any; + RegisterForStreamingShowEula(callback: (appId: number) => any): Unregisterable; - RegisterForStreamingShowIntro(callback: (param0: any, param1: any) => any): Unregisterable | any; + RegisterForStreamingShowIntro(callback: (param0: any, param1: any) => any): Unregisterable; /** * Registers a callback function to be called when the streaming client receives launch options from the host. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ RegisterForStreamingShowLaunchOptions( callback: (appId: number, launchOptions: LaunchOption[]) => void, - ): Unregisterable | any; // Callback when streaming client receives launch options from host + ): Unregisterable; // Callback when streaming client receives launch options from host StreamingContinueStreamGame(): void; // existing game running on another streaming capable device StreamingSetLaunchOption(param0: any): any; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/UI.ts b/src/deck-components/steam-client/UI.ts index e202ea46..4b1946b0 100644 --- a/src/deck-components/steam-client/UI.ts +++ b/src/deck-components/steam-client/UI.ts @@ -10,19 +10,18 @@ export interface UI { /** * Gets information about whether your OS will be unsupported in the future or not. - * @returns {Promise<OSEndOfLifeInfo>} */ GetOSEndOfLifeInfo(): Promise<OSEndOfLifeInfo>; /** * Retrieves the current UI mode. - * @returns {Promise<UIMode>} - A Promise that resolves to the current UI mode. + * @returns A Promise that resolves to the current UI mode. */ GetUIMode(): Promise<UIMode>; NotifyAppInitialized(): void; - RegisterDesiredSteamUIWindowsChanged(callback: () => void): Unregisterable | any; + RegisterDesiredSteamUIWindowsChanged(callback: () => void): Unregisterable; /** * Registers a callback function to be called when a convar's value gets changed. @@ -32,20 +31,19 @@ export interface UI { * @param convar The ConVar to watch. * @param callback The callback function to be called. */ - RegisterForClientConVar(convar: string, callback: (value: string) => void): Unregisterable | any; + RegisterForClientConVar(convar: string, callback: (value: string) => void): Unregisterable; - RegisterForErrorCondition(callback: (param0: number, param1: number) => void): Unregisterable | any; + RegisterForErrorCondition(callback: (param0: number, param1: number) => void): Unregisterable; - RegisterForKioskModeResetSignal(callback: () => void): Unregisterable | any; + RegisterForKioskModeResetSignal(callback: () => void): Unregisterable; - RegisterForUIModeChanged(callback: (mode: UIMode) => void): Unregisterable | any; + RegisterForUIModeChanged(callback: (mode: UIMode) => void): Unregisterable; ResetErrorCondition(): void; /** * Sets the UI mode to the specified value. - * @param {UIMode} mode - The UI mode to set. - * @returns {void} + * @param mode The UI mode to set. */ SetUIMode(mode: UIMode): void; } @@ -81,4 +79,4 @@ export interface SteamWindow { windowType: EWindowType; x: number; y: number; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/URL.ts b/src/deck-components/steam-client/URL.ts index 1f951028..cd70fad7 100644 --- a/src/deck-components/steam-client/URL.ts +++ b/src/deck-components/steam-client/URL.ts @@ -16,11 +16,11 @@ export interface URL { /** * Registers a callback to be called when a steam:// URL gets executed. - * @param {string} section - `rungameid`, `open`, etc. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param section `rungameid`, `open`, etc. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForRunSteamURL(section: string, callback: (param0: number, url: string) => void): Unregisterable | any; + RegisterForRunSteamURL(section: string, callback: (param0: number, url: string) => void): Unregisterable; RegisterForSteamURLChanges(callback: () => void): void; } @@ -43,4 +43,4 @@ export interface SteamURLs { StoreCDN: SteamURL; WebAPI: SteamURL; LocalSSA: SteamURL; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Updates.ts b/src/deck-components/steam-client/Updates.ts index 85d4bb0a..2345a89b 100644 --- a/src/deck-components/steam-client/Updates.ts +++ b/src/deck-components/steam-client/Updates.ts @@ -9,9 +9,9 @@ export interface Updates { /** * If `data` is deserialized, returns {@link MsgSystemUpdateState}. - * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. + * @returns A Promise that resolves to a ProtoBuf message. */ - RegisterForUpdateStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterForUpdateStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable; // 1 - Stable, 2 - Beta, 3 - Preview SelectOSBranch(branch: number): any; // enum? @@ -87,4 +87,4 @@ export enum UpdaterType { Test1 = 5, Test2 = 6, Dummy = 7, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/User.ts b/src/deck-components/steam-client/User.ts index 3ebdbe5c..e3e6db8d 100644 --- a/src/deck-components/steam-client/User.ts +++ b/src/deck-components/steam-client/User.ts @@ -9,14 +9,12 @@ export interface User { /** * Tries to cancel Steam shutdown. - * @returns {void} * @remarks Used in the "Shutting down" dialog. */ CancelShutdown(): void; /** * Opens the "Change Account" dialog. - * @returns {void} */ ChangeUser(): void; @@ -26,25 +24,24 @@ export interface User { /** * Forces a shutdown while shutting down. - * @returns {void} * @remarks Used in the "Shutting down" dialog. */ ForceShutdown(): void; /** * Forgets an account's password. - * @param {string} accountName - Login of the account to forget. - * @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the operation succeeded or not. + * @param accountName Login of the account to forget. + * @returns A Promise that resolves to a boolean indicating whether the operation succeeded or not. */ ForgetPassword(accountName: string): Promise<boolean>; /** * Gets your country code. - * @returns {Promise<string>} A Promise that resolves to a string containing your country code. + * @returns A Promise that resolves to a string containing your country code. */ GetIPCountry(): Promise<string>; - GetLoginProgress(callback: (param0: number, param1: number) => void): Unregisterable | any; + GetLoginProgress(callback: (param0: number, param1: number) => void): Unregisterable; GetLoginUsers(): Promise<LoginUser[]>; @@ -58,32 +55,31 @@ export interface User { Reconnect(): void; - RegisterForConnectionAttemptsThrottled(callback: (data: ConnectionAttempt) => void): Unregisterable | any; + RegisterForConnectionAttemptsThrottled(callback: (data: ConnectionAttempt) => void): Unregisterable; RegisterForCurrentUserChanges(callback: (user: CurrentUser) => void): void; - RegisterForLoginStateChange(callback: (accountName: string, loginState: LoginState, loginResult: number, loginPercentage: number, param4: number) => void): Unregisterable | any; + RegisterForLoginStateChange(callback: (accountName: string, loginState: LoginState, loginResult: number, loginPercentage: number, param4: number) => void): Unregisterable; - RegisterForPrepareForSystemSuspendProgress(callback: (data: any) => void): Unregisterable | any; + RegisterForPrepareForSystemSuspendProgress(callback: (data: any) => void): Unregisterable; - RegisterForResumeSuspendedGamesProgress: Unregisterable | any; + RegisterForResumeSuspendedGamesProgress: Unregisterable; - RegisterForShutdownDone(callback: () => void): Unregisterable | any; + RegisterForShutdownDone(callback: () => void): Unregisterable; - RegisterForShutdownFailed: Unregisterable | any; + RegisterForShutdownFailed: Unregisterable; /** * Register a function to be executed when a shutdown start is detected. * @param callback The function to be executed on shutdown start. */ - RegisterForShutdownStart(callback: () => void): Unregisterable | any; + RegisterForShutdownStart(callback: () => void): Unregisterable; - RegisterForShutdownState: Unregisterable | any; + RegisterForShutdownState: Unregisterable; /** * Removes an account from remembered users. - * @param {string} accountName - The account to remove. - * @returns {void} + * @param accountName The account to remove. */ RemoveUser(accountName: string): void; @@ -102,10 +98,9 @@ export interface User { /** * Sets given login credentials, but don't log in to that account. - * @param {string} accountName - Account name. - * @param {string} password - Account password. - * @param {boolean} rememberMe - Whether to remember that account. - * @returns {void} + * @param accountName Account name. + * @param password Account password. + * @param rememberMe Whether to remember that account. */ SetLoginCredentials(accountName: string, password: string, rememberMe: boolean): void; @@ -115,7 +110,6 @@ export interface User { /** * Signs out and restarts Steam. - * @returnsn {void} */ SignOutAndRestart(): void; @@ -190,4 +184,4 @@ export interface SurveyEntry { export interface SurveySection { strSectionName: string; vecEntries: SurveyEntry[]; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/WebChat.ts b/src/deck-components/steam-client/WebChat.ts index a1050f4c..12b99140 100644 --- a/src/deck-components/steam-client/WebChat.ts +++ b/src/deck-components/steam-client/WebChat.ts @@ -6,19 +6,19 @@ export interface WebChat { /** * Gets your Steam3 ID. - * @returns {Promise<number>} A Promise that resolves to a Steam3 ID. + * @returns A Promise that resolves to a Steam3 ID. */ GetCurrentUserAccountID(): Promise<number>; /** * Gets the current user's 64x64 avatar as a data URL. - * @returns {Promise<string>} A Promise that resolves to the data URL. + * @returns A Promise that resolves to the data URL. */ GetLocalAvatarBase64(): Promise<string>; /** * Gets the current user's nickname. - * @returns {Promise<string>} A Promise that resolves to the nickname. + * @returns A Promise that resolves to the nickname. */ GetLocalPersonaName(): Promise<string>; @@ -29,19 +29,19 @@ export interface WebChat { /** * Gets information about push-to-Talk. - * @returns {Promise<PushToTalkInfo>} + * @returns */ GetPushToTalkEnabled(): Promise<PushToTalkInfo>; /** * Gets the "Sign in to friends when Steam starts" option value. - * @returns {Promise<boolean>} A Promise that resolves to a boolean indicating whether the option is enabled or not. + * @returns A Promise that resolves to a boolean indicating whether the option is enabled or not. */ GetSignIntoFriendsOnStart(): Promise<boolean>; /** * Retrieves the current UI mode. - * @returns {Promise<UIMode>} - A Promise that resolves to the current UI mode. + * @returns A Promise that resolves to the current UI mode. */ GetUIMode(): Promise<UIMode>; @@ -61,41 +61,40 @@ export interface WebChat { /** * Registers a callback function to be called when the computer's active state changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. * @todo Changes to 2 after 10 seconds? * @todo Does not affect the keyboard? */ RegisterForComputerActiveStateChange( callback: (state: ComputerActiveState, time: number) => void, - ): Unregisterable | any; + ): Unregisterable; /** * @todo WebChat.ShowFriendChatDialog does this. */ - RegisterForFriendPostMessage(callback: (data: FriendChatDialogData) => void): Unregisterable | any; + RegisterForFriendPostMessage(callback: (data: FriendChatDialogData) => void): Unregisterable; /** * To unregister, use {@link UnregisterForMouseXButtonDown}. - * @returns {void} */ RegisterForMouseXButtonDown(callback: any): void; /** * Registers a callback function to be called when the push-to-talk state changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForPushToTalkStateChange(callback: (state: boolean) => void): Unregisterable | any; + RegisterForPushToTalkStateChange(callback: (state: boolean) => void): Unregisterable; /** * Registers a callback function to be called when the UI mode is changed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForUIModeChange(callback: (mode: UIMode) => void): Unregisterable | any; + RegisterForUIModeChange(callback: (mode: UIMode) => void): Unregisterable; - RegisterOverlayChatBrowserInfoChanged(callback: any): Unregisterable | any; + RegisterOverlayChatBrowserInfoChanged(callback: any): Unregisterable; SetActiveClanChatIDs(clanChatIds: any[]): any; @@ -156,4 +155,4 @@ export interface PushToTalkInfo { vkHotKey: number; /** Push-to-talk hotkey name. */ strKeyName: string; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/WebUITransport.ts b/src/deck-components/steam-client/WebUITransport.ts index ab31d7a1..79289f4b 100644 --- a/src/deck-components/steam-client/WebUITransport.ts +++ b/src/deck-components/steam-client/WebUITransport.ts @@ -18,4 +18,4 @@ export interface TransportInfo { authKeySteamUI: string; portClientdll: number; portSteamUI: number; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/Window.ts b/src/deck-components/steam-client/Window.ts index ca488de0..b7aaea62 100644 --- a/src/deck-components/steam-client/Window.ts +++ b/src/deck-components/steam-client/Window.ts @@ -25,7 +25,6 @@ export interface Window { /** * Flashes the window in the taskbar. - * @returns {void} */ FlashWindow(): void; @@ -48,7 +47,6 @@ export interface Window { /** * Hides the window. - * @returns {void} */ HideWindow(): void; @@ -66,35 +64,31 @@ export interface Window { /** * Minimizes the window. - * @returns {void} */ Minimize(): void; /** * Moves the window to given coordinates. - * @param {number} x - Window X position. - * @param {number} y - Window Y position. - * @param {number | undefined} dpi - Screen DPI. - * @returns {void} + * @param x Window X position. + * @param y Window Y position. + * @param dpi Screen DPI. */ MoveTo(x: number, y: number, dpi: number | undefined): void; /** * Moves the window to a given location. - * @param {string} location - Window location. - * @param {number | undefined} offset - X/Y offset. - * @returns {void} + * @param location Window location. + * @param offset X/Y offset. */ MoveToLocation(location: WindowLocation, offset: number | undefined): void; /** * Moves the window relatively to given details. - * @param {string} details - Window restore details string from {@link GetWindowRestoreDetails}. - * @param {number} x - Window X position. - * @param {number} y - Window Y position. - * @param {number} width - Window width. - * @param {number} height - Window height. - * @returns {void} + * @param details Window restore details string from {@link GetWindowRestoreDetails}. + * @param x Window X position. + * @param y Window Y position. + * @param width Window width. + * @param height Window height. * * @example * Move the window to bottom right by 50 pixels: @@ -114,17 +108,15 @@ export interface Window { /** * Resizes the window to given dimension. * The window has to be created with the resizable flag. - * @param {number} width - Window width. - * @param {number} height - Window height. - * @param {boolean | number} applyBrowserScaleOrDPIValue - * @returns {void} + * @param width Window width. + * @param height Window height. + * @param applyBrowserScaleOrDPIValue */ ResizeTo(width: number, height: number, applyBrowserScaleOrDPIValue: boolean | number): void; /** * Moves the window to given details. - * @param {string} details - Window details string from `Window.GetWindowRestoreDetails`. - * @returns {void} + * @param details Window details string from `Window.GetWindowRestoreDetails`. */ RestoreWindowSizeAndPosition(details: string): void; @@ -134,8 +126,7 @@ export interface Window { /** * Makes the window hide, but not close on pressing the close button. - * @param {boolean} value - Hide on close? - * @returns {void} + * @param value Hide on close? */ SetHideOnClose(value: boolean): void; @@ -145,17 +136,15 @@ export interface Window { /** * Sets the window's max size. - * @param {number} width - Window's max width. - * @param {number} height - Window's max height. - * @returns {void} + * @param width Window's max width. + * @param height Window's max height. */ SetMaxSize(width: number, height: number): void; /** * Sets the window's min size. - * @param {number} width - Window's max width. - * @param {number} height - Window's max height. - * @returns {void} + * @param width Window's max width. + * @param height Window's max height. */ SetMinSize(width: number, height: number): void; @@ -164,40 +153,34 @@ export interface Window { /** * Sets the window's resize grip size. * The window has to be created with the resizable flag for this to take any effect. - * @param {number} width - Resize grip width. - * @param {number} height - Resize grip height. - * @returns {void} + * @param width Resize grip width. + * @param height Resize grip height. */ SetResizeGrip(width: number, height: number): void; /** * Set the window's icon. - * @param {WindowIcon} icon - The window icon to be used. - * @returns {void} + * @param icon The window icon to be used. */ SetWindowIcon(icon: WindowIcon): void; /** * Shows the window. - * @returns {void} */ ShowWindow(): void; /** * Stops the window's taskbar flashing. - * @returns {void} */ StopFlashWindow(): void; /** * Toggles the window's fullscreen state. - * @returns {void} */ ToggleFullscreen(): void; /** * Toggles the window's maximized state. - * @returns {void} */ ToggleMaximize(): void; } diff --git a/src/deck-components/steam-client/browser-view/BrowserViewPopup.ts b/src/deck-components/steam-client/browser-view/BrowserViewPopup.ts index 91c64f1c..4775450b 100644 --- a/src/deck-components/steam-client/browser-view/BrowserViewPopup.ts +++ b/src/deck-components/steam-client/browser-view/BrowserViewPopup.ts @@ -3,23 +3,22 @@ import {TouchGestureType} from "../Browser"; export interface BrowserViewPopup { /** * Blur the popup. - * @param {boolean} enabled - Is the blur enabled? - * @param {boolean} backgroundColor - * @param {boolean} blur - * @returns {void} + * @param enabled Is the blur enabled? + * @param backgroundColor + * @param blur * @todo backgroundColor is a bool? Whatever that means */ AddGlass(enabled: boolean, backgroundColor: boolean, blur: boolean): void; /** * Indicates whether you can go backward in history or not. - * @returns {boolean} true if you can go backward in history, false otherwise. + * @returns true if you can go backward in history, false otherwise. */ CanGoBackward(): boolean; /** * Indicates whether you can go forward in history or not. - * @returns {boolean} true if you can go forward in history, false otherwise. + * @returns true if you can go forward in history, false otherwise. */ CanGoForward(): boolean; @@ -30,28 +29,25 @@ export interface BrowserViewPopup { /** * Find a string in the page. - * @param {string} input - The string to find. - * @param {boolean} param1 - Additional parameter (exact usage may vary). - * @param {boolean} previous - `true` for previous match, `false` for next match. - * @returns {void} + * @param input The string to find. + * @param param1 Additional parameter (exact usage may vary). + * @param previous `true` for previous match, `false` for next match. */ FindInPage(input: string, param1: boolean, previous: boolean): void; /** * Get the current popup position. - * @returns {BrowserViewBounds} The window position. + * @returns The window position. */ GetBounds(): BrowserViewBounds; /** * Go back in history. - * @returns {void} */ GoBack(): void; /** * Go forward in history. - * @returns {void} */ GoForward(): void; @@ -62,8 +58,7 @@ export interface BrowserViewPopup { /** * Load the specified URL. - * @param {string} url - The URL to go to. - * @returns {void} + * @param url The URL to go to. */ LoadURL(url: string): void; @@ -71,7 +66,6 @@ export interface BrowserViewPopup { /** * Paste the current clipboard selection. - * @returns {void} */ Paste(): void; @@ -79,38 +73,33 @@ export interface BrowserViewPopup { /** * Reload the page. - * @returns {void} */ Reload(): void; /** * Load the specified URL, but don't save history. - * @param {string} url - The URL to go to. - * @returns {void} + * @param url The URL to go to. */ ReplaceURL(url: string): void; /** * Define blocked protocols, like https, etc. * @param protocols The protocols to block, separated by a semicolon. - * @returns {void} */ SetBlockedProtocols(protocols: string): void; /** * Sets the browser window position. - * @param {number} x - Browser window X position. - * @param {number} y - Browser window Y position. - * @param {number} width - Browser window width. - * @param {number} height - Browser window height. - * @returns {void} + * @param x Browser window X position. + * @param y Browser window Y position. + * @param width Browser window width. + * @param height Browser window height. */ SetBounds(x: number, y: number, width: number, height: number): void; /** * Sets the browser window focus state. - * @param {boolean} value - Is the window focused? - * @returns {void} + * @param value Is the window focused? */ SetFocus(value: boolean): void; @@ -118,19 +107,17 @@ export interface BrowserViewPopup { /** * Registers a callback to be called when a context menu is shown. - * @param {function} callback - The callback function to be called. + * @param callback The callback function to be called. */ SetShowContextMenuCallback(callback: (data: BrowserViewContextMenu) => void): void; /** * Registers a callback to be called when a steam:// protocol URL is loaded. - * @returns {void} */ SetSteamURLCallback(callback: (steamURL: string) => void): void; /** * Raises the browser window. - * @returns {void} */ SetTopWindow(): void; @@ -145,23 +132,20 @@ export interface BrowserViewPopup { /** * Stop the "find in page" function. - * @returns {void} */ StopFindInPage(): void; /** * Stop listening for an event. - * @param {BrowserViewEvent} event - The event to stop listening to. - * @param {function} callback - The callback function to be called. - * @returns {void} + * @param event The event to stop listening to. + * @param callback The callback function to be called. */ off(event: BrowserViewEvent, callback: (args: any) => void): void; /** * Start listening for an event. - * @param {BrowserViewEvent} event - The event to start listening to. - * @param {function} callback - The callback function to be called. - * @returns {void} + * @param event The event to start listening to. + * @param callback The callback function to be called. */ on(event: BrowserViewEvent, callback: (args: any) => void): void; @@ -386,4 +370,4 @@ export interface BrowserViewPageSecurity { certName: string; issuerName: string; nCertBits: number; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/browser-view/index.ts b/src/deck-components/steam-client/browser-view/index.ts index acc8b2fa..0af2a749 100644 --- a/src/deck-components/steam-client/browser-view/index.ts +++ b/src/deck-components/steam-client/browser-view/index.ts @@ -24,4 +24,4 @@ export interface BrowserViewInit { strUserAgentIdentifier?: string; strUserAgentOverride?: string; strVROverlayKey?: string; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/index.ts b/src/deck-components/steam-client/index.ts index 8ee1ec66..56cbce9f 100644 --- a/src/deck-components/steam-client/index.ts +++ b/src/deck-components/steam-client/index.ts @@ -612,4 +612,4 @@ export enum ParentalFeature { SiteLicense = 13, KioskMode = 14, Max = 15, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/system/Audio.ts b/src/deck-components/steam-client/system/Audio.ts index 5a5a0dea..f9031967 100644 --- a/src/deck-components/steam-client/system/Audio.ts +++ b/src/deck-components/steam-client/system/Audio.ts @@ -6,96 +6,96 @@ import {OperationResponse, Unregisterable} from "../index"; export interface Audio { /** * Clears the default device override for a specified audio type. - * @param {number} audioType - The audio type (0 for input, 1 for output). - * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. + * @param audioType The audio type (0 for input, 1 for output). + * @returns A Promise indicating the result of the operation. */ ClearDefaultDeviceOverride(audioType: number): Promise<OperationResponse>; /** * Retrieves information about audio applications. - * @returns {Promise<ApplicationsAudio>} - A Promise that resolves to information about audio applications. + * @returns A Promise that resolves to information about audio applications. */ GetApps(): Promise<ApplicationsAudio>; /** * Retrieves information about audio devices. - * @returns {Promise<AudioDeviceInfo>} - A Promise that resolves to information about audio devices. + * @returns A Promise that resolves to information about audio devices. */ GetDevices(): Promise<AudioDeviceInfo>; /** * Registers a callback to be called when a new audio application is added. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForAppAdded(callback: (appAudioAdded: ApplicationAudio) => void): Unregisterable | any; + RegisterForAppAdded(callback: (appAudioAdded: ApplicationAudio) => void): Unregisterable; /** * Registers a callback to be called when an audio application is removed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForAppRemoved(callback: (appAudioId: number) => void): Unregisterable | any; + RegisterForAppRemoved(callback: (appAudioId: number) => void): Unregisterable; /** * Registers a callback to be called when the volume of an audio application changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForAppVolumeChanged(callback: (appAudioId: number, volume: number) => void): Unregisterable | any; + RegisterForAppVolumeChanged(callback: (appAudioId: number, volume: number) => void): Unregisterable; /** * Registers a callback to be called when a new audio device is added. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForDeviceAdded(callback: (audioDevice: Device) => void): Unregisterable | any; + RegisterForDeviceAdded(callback: (audioDevice: Device) => void): Unregisterable; /** * Registers a callback to be called when an audio device is removed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForDeviceRemoved(callback: (audioDeviceId: number) => void): Unregisterable | any; + RegisterForDeviceRemoved(callback: (audioDeviceId: number) => void): Unregisterable; /** * Registers a callback to be called when the volume of an audio device changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForDeviceVolumeChanged(callback: (audioDeviceId: number, audioType: number, volume: number) => void): Unregisterable | any; + RegisterForDeviceVolumeChanged(callback: (audioDeviceId: number, audioType: number, volume: number) => void): Unregisterable; - RegisterForServiceConnectionStateChanges(callback: (param0: any) => void): Unregisterable | any; + RegisterForServiceConnectionStateChanges(callback: (param0: any) => void): Unregisterable; /** * Registers a callback to be called when volume buttons are pressed. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForVolumeButtonPressed(callback: (volumeUpPressed: boolean) => void): Unregisterable | any; + RegisterForVolumeButtonPressed(callback: (volumeUpPressed: boolean) => void): Unregisterable; /** * Sets the volume of an audio application. - * @param {number} appAudioId - The ID of the audio application. - * @param {number} volume - The volume level (floating point value between 0 and 1). - * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. + * @param appAudioId The ID of the audio application. + * @param volume The volume level (floating point value between 0 and 1). + * @returns A Promise indicating the result of the operation. */ SetAppVolume(appAudioId: number, volume: number): Promise<OperationResponse>; /** * Sets the default device override for a specified audio type. - * @param {number} audioDeviceId - The ID of the audio device. - * @param {number} audioType - The audio type (0 for input, 1 for output). - * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. + * @param audioDeviceId The ID of the audio device. + * @param audioType The audio type (0 for input, 1 for output). + * @returns A Promise indicating the result of the operation. */ SetDefaultDeviceOverride(audioDeviceId: number, audioType: number): Promise<OperationResponse>; /** * Sets the volume of an audio device. - * @param {number} audioDeviceId - The ID of the audio device. - * @param {number} audioType - The audio type (0 for input, 1 for output). - * @param {number} volume - The volume level (floating point value between 0 and 1). - * @returns {Promise<OperationResponse>} - A Promise indicating the result of the operation. + * @param audioDeviceId The ID of the audio device. + * @param audioType The audio type (0 for input, 1 for output). + * @param volume The volume level (floating point value between 0 and 1). + * @returns A Promise indicating the result of the operation. */ SetDeviceVolume(audioDeviceId: number, audioType: number, volume: number): Promise<OperationResponse>; } @@ -203,4 +203,4 @@ export interface Device { * The volume level of the audio input device (floating point value between 0 and 1). */ flInputVolume: number; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/system/AudioDevice.ts b/src/deck-components/steam-client/system/AudioDevice.ts index f9b8d78b..8aadef12 100644 --- a/src/deck-components/steam-client/system/AudioDevice.ts +++ b/src/deck-components/steam-client/system/AudioDevice.ts @@ -3,9 +3,9 @@ import {JsPbMessage, Unregisterable} from "../index"; export interface AudioDevice { /** * If `data` is deserialized, returns {@link MsgSystemAudioManagerState}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns An object that can be used to unregister the callback. */ - RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable; UpdateSomething(param0: any): any; // e.UpdateSomething(t.serializeBase64String()) } @@ -113,4 +113,4 @@ export enum SystemAudioChannel { FrontCenter = 7, Unknown = 8, Mono = 9, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/system/Bluetooth.ts b/src/deck-components/steam-client/system/Bluetooth.ts index f17d4bec..35d885cd 100644 --- a/src/deck-components/steam-client/system/Bluetooth.ts +++ b/src/deck-components/steam-client/system/Bluetooth.ts @@ -6,63 +6,63 @@ import {OperationResponse, Unregisterable} from "../index"; export interface Bluetooth { /** * Cancels an ongoing pairing request with a Bluetooth device. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the Bluetooth device to cancel pairing with. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the cancellation. + * @param adapterId The ID of the Bluetooth adapter. + * @param deviceId The ID of the Bluetooth device to cancel pairing with. + * @returns A Promise that resolves with the result of the cancellation. */ CancelPairing(adapterId: number, deviceId: number): Promise<OperationResponse>; /** * Connects to a paired Bluetooth device using the specified adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the paired Bluetooth device to connect to. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the connection attempt. + * @param adapterId The ID of the Bluetooth adapter. + * @param deviceId The ID of the paired Bluetooth device to connect to. + * @returns A Promise that resolves with the result of the connection attempt. */ Connect(adapterId: number, deviceId: number): Promise<OperationResponse>; /** * Disconnects from a currently connected Bluetooth device using the specified adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the connected Bluetooth device to disconnect from. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the disconnection. + * @param adapterId The ID of the Bluetooth adapter. + * @param deviceId The ID of the connected Bluetooth device to disconnect from. + * @returns A Promise that resolves with the result of the disconnection. */ Disconnect(adapterId: number, deviceId: number): Promise<OperationResponse>; /** * Initiates pairing with a Bluetooth device using the specified adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the Bluetooth device to initiate pairing with. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the pairing attempt. + * @param adapterId The ID of the Bluetooth adapter. + * @param deviceId The ID of the Bluetooth device to initiate pairing with. + * @returns A Promise that resolves with the result of the pairing attempt. */ Pair(adapterId: number, deviceId: number): Promise<OperationResponse>; /** * Registers a callback function to be called when the Bluetooth state changes. - * @param {function} callback - The callback function to be called. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @param callback The callback function to be called. + * @returns An object that can be used to unregister the callback. */ - RegisterForStateChanges(callback: (bluetoothStateChange: BluetoothStateChange) => void): Unregisterable | any; + RegisterForStateChanges(callback: (bluetoothStateChange: BluetoothStateChange) => void): Unregisterable; /** * Sets whether the Bluetooth adapter should be in discovering mode. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {boolean} value - `true` to enable discovering mode, `false` to disable it. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the operation. + * @param adapterId The ID of the Bluetooth adapter. + * @param value `true` to enable discovering mode, `false` to disable it. + * @returns A Promise that resolves with the result of the operation. */ SetAdapterDiscovering(adapterId: number, value: boolean): Promise<OperationResponse>; /** * Enables or disables Bluetooth functionality. - * @param {boolean} bluetooth - `true` to enable Bluetooth, `false` to disable it. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the operation. + * @param bluetooth `true` to enable Bluetooth, `false` to disable it. + * @returns A Promise that resolves with the result of the operation. */ SetEnabled(bluetooth: boolean): Promise<OperationResponse>; /** * Unpairs a Bluetooth device from the adapter. - * @param {number} adapterId - The ID of the Bluetooth adapter. - * @param {number} deviceId - The ID of the Bluetooth device to unpair with. - * @returns {Promise<OperationResponse>} - A Promise that resolves with the result of the unpairing request. + * @param adapterId The ID of the Bluetooth adapter. + * @param deviceId The ID of the Bluetooth device to unpair with. + * @returns A Promise that resolves with the result of the unpairing request. */ UnPair(adapterId: number, deviceId: number): Promise<OperationResponse>; } @@ -175,4 +175,4 @@ export enum BluetoothDeviceType { Joystick = 9, Gamepad = 10, Keyboard = 11, -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/system/Devkit.ts b/src/deck-components/steam-client/system/Devkit.ts index f29f2f1a..242643d7 100644 --- a/src/deck-components/steam-client/system/Devkit.ts +++ b/src/deck-components/steam-client/system/Devkit.ts @@ -3,9 +3,9 @@ import {Unregisterable} from "../index"; export interface Devkit { DeveloperModeChanged(state: boolean): any; - RegisterForPairingPrompt(callback: (param0: any) => any): Unregisterable | any; + RegisterForPairingPrompt(callback: (param0: any) => any): Unregisterable; RespondToPairingPrompt(param0: any, param1: any): any; SetPairing(param0: any): any; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/system/Display.ts b/src/deck-components/steam-client/system/Display.ts index 886dbf82..3272292c 100644 --- a/src/deck-components/steam-client/system/Display.ts +++ b/src/deck-components/steam-client/system/Display.ts @@ -3,7 +3,7 @@ import {Unregisterable} from "../index"; export interface Display { EnableUnderscan(param0: boolean): any; - RegisterForBrightnessChanges(callback: (brightnessChanges: BrightnessChange) => void): Unregisterable | any; + RegisterForBrightnessChanges(callback: (brightnessChanges: BrightnessChange) => void): Unregisterable; SetBrightness(brightness: number): any; diff --git a/src/deck-components/steam-client/system/DisplayManager.ts b/src/deck-components/steam-client/system/DisplayManager.ts index 874a072d..dd6d49f9 100644 --- a/src/deck-components/steam-client/system/DisplayManager.ts +++ b/src/deck-components/steam-client/system/DisplayManager.ts @@ -6,11 +6,11 @@ export interface DisplayManager { GetState: any; - RegisterForStateChanges(callback: () => void): Unregisterable | any; + RegisterForStateChanges(callback: () => void): Unregisterable; SetCompatibilityMode(displayId: any): any; SetGamescopeInternalResolution(width: number, height: number): any; SetMode(base64: string): any; // -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/system/Dock.ts b/src/deck-components/steam-client/system/Dock.ts index c79e3cf8..cc683ce7 100644 --- a/src/deck-components/steam-client/system/Dock.ts +++ b/src/deck-components/steam-client/system/Dock.ts @@ -7,9 +7,9 @@ export interface Dock { /** * If `data` is deserialized, returns {@link MsgSystemDockState}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns An object that can be used to unregister the callback. */ - RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable; UpdateFirmware(base64String: string): any; // serialize base64 string } diff --git a/src/deck-components/steam-client/system/Perf.ts b/src/deck-components/steam-client/system/Perf.ts index afcabff4..594e77c1 100644 --- a/src/deck-components/steam-client/system/Perf.ts +++ b/src/deck-components/steam-client/system/Perf.ts @@ -4,15 +4,15 @@ import {JsPbMessage, Unregisterable} from "../index"; export interface Perf { /** * If `data` is deserialized, returns {@link MsgSystemPerfDiagnosticInfo}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns An object that can be used to unregister the callback. */ - RegisterForDiagnosticInfoChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterForDiagnosticInfoChanges(callback: (data: ArrayBuffer) => void): Unregisterable; /** * If `data` is deserialized, returns {@link MsgSystemPerfState}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns An object that can be used to unregister the callback. */ - RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterForStateChanges(callback: (data: ArrayBuffer) => void): Unregisterable; UpdateSettings(base64: string): any; // serialize } diff --git a/src/deck-components/steam-client/system/Report.ts b/src/deck-components/steam-client/system/Report.ts index ee1f5dda..bb51c7bf 100644 --- a/src/deck-components/steam-client/system/Report.ts +++ b/src/deck-components/steam-client/system/Report.ts @@ -37,4 +37,4 @@ export interface MsgGenerateSystemReportReply extends JsPbMessage { report_id(): string | undefined; set_report_id(param0: any): any; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/system/UI.ts b/src/deck-components/steam-client/system/UI.ts index 84d4d492..ea4c1fde 100644 --- a/src/deck-components/steam-client/system/UI.ts +++ b/src/deck-components/steam-client/system/UI.ts @@ -5,13 +5,13 @@ export interface UI { GetGameWindowsInfo(appId: number, windowIds: number[]): Promise<GameWindowInfo>; - RegisterForFocusChangeEvents(callback: (event: FocusChangeEvent) => void): Unregisterable | any; + RegisterForFocusChangeEvents(callback: (event: FocusChangeEvent) => void): Unregisterable; // appId is 0 if unknown app is focused - RegisterForOverlayGameWindowFocusChanged(callback: (appId: number, param1: number) => void): Unregisterable | any; + RegisterForOverlayGameWindowFocusChanged(callback: (appId: number, param1: number) => void): Unregisterable; //event.eKey, event.nControllerIndex - RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable | any; // eKey + RegisterForSystemKeyEvents(callback: (event: any) => void): Unregisterable; // eKey } export interface FocusChangeEvent { diff --git a/src/deck-components/steam-client/system/index.ts b/src/deck-components/steam-client/system/index.ts index 3acf1f05..78687d20 100644 --- a/src/deck-components/steam-client/system/index.ts +++ b/src/deck-components/steam-client/system/index.ts @@ -66,15 +66,14 @@ export interface System { /** * Open a dialog for choosing a file. - * @param {FileDialog} prefs - Dialog preferences. - * @returns {Promise<string>} A Promise that resolves to the selected file name. + * @param prefs Dialog preferences. + * @returns A Promise that resolves to the selected file name. * @throws Throws if no file was selected. */ OpenFileDialog(prefs: FileDialog): Promise<string | OperationResponse>; /** * Open a URL in the default web browser. - * @returns {void} */ OpenInSystemBrowser(url: string): void; @@ -85,20 +84,20 @@ export interface System { RebootToFactoryTestImage(param0: any): any; - RegisterForAirplaneModeChanges(callback: (airplaneModeChange: AirplaneModeChange) => void): Unregisterable | any; + RegisterForAirplaneModeChanges(callback: (airplaneModeChange: AirplaneModeChange) => void): Unregisterable; - RegisterForBatteryStateChanges(callback: (batteryStateChange: BatteryStateChange) => void): Unregisterable | any; + RegisterForBatteryStateChanges(callback: (batteryStateChange: BatteryStateChange) => void): Unregisterable; - RegisterForFormatStorageProgress(callback: () => void): Unregisterable | any; // {"flProgress":0,"rtEstimatedCompletionTime":0,"eStage":1} + RegisterForFormatStorageProgress(callback: () => void): Unregisterable; // {"flProgress":0,"rtEstimatedCompletionTime":0,"eStage":1} - RegisterForOnResumeFromSuspend(callback: () => void): Unregisterable | any; + RegisterForOnResumeFromSuspend(callback: () => void): Unregisterable; - RegisterForOnSuspendRequest(callback: () => void): Unregisterable | any; + RegisterForOnSuspendRequest(callback: () => void): Unregisterable; /** - * @returns {Promise<ArrayBuffer>} A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link MsgSystemManagerSettings}. + * @returns A Promise that resolves to a ProtoBuf message. If deserialized, returns {@link MsgSystemManagerSettings}. */ - RegisterForSettingsChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterForSettingsChanges(callback: (data: ArrayBuffer) => void): Unregisterable; Report: Report; @@ -366,4 +365,4 @@ export interface MsgSystemManagerSettings extends JsPbMessage { is_fan_control_available(): boolean; is_wifi_powersave_enabled(): boolean; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/system/network/Device.ts b/src/deck-components/steam-client/system/network/Device.ts index d65240ad..a0e84fb3 100644 --- a/src/deck-components/steam-client/system/network/Device.ts +++ b/src/deck-components/steam-client/system/network/Device.ts @@ -9,4 +9,4 @@ export interface WirelessNetwork { Forget(deviceId: any, deviceWapId: any): any; SetAutoconnect(deviceId: any, deviceWapId: any, autoConnect: boolean): any; -} \ No newline at end of file +} diff --git a/src/deck-components/steam-client/system/network/index.ts b/src/deck-components/steam-client/system/network/index.ts index f395cbf6..dcddd073 100644 --- a/src/deck-components/steam-client/system/network/index.ts +++ b/src/deck-components/steam-client/system/network/index.ts @@ -12,22 +12,22 @@ export interface Network { GetProxyInfo(): Promise<ProxyInfo>; // data.nAppID, data.serializedMsg - RegisterForAppSummaryUpdate(callback: (data: any) => any): Unregisterable | any; + RegisterForAppSummaryUpdate(callback: (data: any) => any): Unregisterable; /** * @todo {@link GameNetworkingUI_ConnectionState}, unconfirmed */ - RegisterForConnectionStateUpdate: Unregisterable | any; + RegisterForConnectionStateUpdate: Unregisterable; RegisterForConnectivityTestChanges( callback: (connectivityTestChange: ConnectivityTestChange) => void, - ): Unregisterable | any; + ): Unregisterable; /** * If `data` is deserialized, returns {@link MsgNetworkDevicesData}. - * @returns {Unregisterable | any} - An object that can be used to unregister the callback. + * @returns An object that can be used to unregister the callback. */ - RegisterForDeviceChanges(callback: (data: ArrayBuffer) => void): Unregisterable | any; + RegisterForDeviceChanges(callback: (data: ArrayBuffer) => void): Unregisterable; SetFakeLocalSystemState(state: NetFakeLocalSystemState): void; @@ -192,4 +192,4 @@ export enum WirelessAPStrength { Ok = 2, Good = 3, Excellent = 4, -} \ No newline at end of file +} From 23f62d7bbb472b1abe755885d4c98c68e8db49ec Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Sat, 29 Jun 2024 08:06:44 -0600 Subject: [PATCH 42/46] change: Fix rebase errors --- src/globals/SteamClient.ts | 5 +++++ src/globals/stores.ts | 4 ++-- src/modules/Router.ts | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 src/globals/SteamClient.ts diff --git a/src/globals/SteamClient.ts b/src/globals/SteamClient.ts new file mode 100644 index 00000000..d45e1754 --- /dev/null +++ b/src/globals/SteamClient.ts @@ -0,0 +1,5 @@ +import {SteamClient} from "../deck-components/steam-client"; + +declare global { + var SteamClient: SteamClient; +} \ No newline at end of file diff --git a/src/globals/stores.ts b/src/globals/stores.ts index f371a597..b94b758a 100644 --- a/src/globals/stores.ts +++ b/src/globals/stores.ts @@ -1,5 +1,5 @@ -import {AppData, SteamClient} from "./steam-client"; -import {AppDetails, LogoPosition, SteamAppOverview} from "./steam-client/App"; +import {AppDetails, LogoPosition, SteamAppOverview} from "../deck-components/steam-client/App"; +import {AppData} from "../deck-components/steam-client"; declare global { interface Window { diff --git a/src/modules/Router.ts b/src/modules/Router.ts index 50739c2d..dba34e68 100644 --- a/src/modules/Router.ts +++ b/src/modules/Router.ts @@ -1,6 +1,6 @@ import { sleep } from '../utils'; -import { Module, findModuleChild } from '../webpack'; -import { DisplayStatus } from "./steam-client/App"; +import {Export, findModuleExport} from "../webpack"; +import {DisplayStatus} from "../deck-components/steam-client/App"; export enum SideMenu { None, From e0b5c6c36d733349c1bf661be0adeade0a87569c Mon Sep 17 00:00:00 2001 From: Xander <xander@isxander.dev> Date: Sun, 21 Jul 2024 11:15:26 +0100 Subject: [PATCH 43/46] Updated ControllerStateChange --- src/deck-components/steam-client/Input.ts | 40 ++++++++++++----------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/deck-components/steam-client/Input.ts b/src/deck-components/steam-client/Input.ts index 90bf784e..62f781a7 100644 --- a/src/deck-components/steam-client/Input.ts +++ b/src/deck-components/steam-client/Input.ts @@ -694,27 +694,29 @@ export interface ControllerStateChange { sRightStickY: number; sTriggerL: number; sTriggerR: number; - flDriftCorrectedQuatW: number; - flDriftCorrectedQuatX: number; - flDriftCorrectedQuatY: number; - flDriftCorrectedQuatZ: number; - flSensorFusionGyroQuatW: number; - flSensorFusionGyroQuatX: number; - flSensorFusionGyroQuatY: number; - flSensorFusionGyroQuatZ: number; - flDeferredSensorFusionGyroQuatW: number; - flDeferredSensorFusionGyroQuatX: number; - flDeferredSensorFusionGyroQuatY: number; - flDeferredSensorFusionGyroQuatZ: number; - flGyroDegreesPerSecondX: number; - flGyroDegreesPerSecondY: number; - flGyroDegreesPerSecondZ: number; - flGravityVectorX: number; - flGravityVectorY: number; - flGravityVectorZ: number; - flAccelerometerNoiseLength: number; + flTrustedGravityVectorX: number; + flTrustedGravityVectorY: number; + flTrustedGravityVectorZ: number; + flSoftwareQuatW: number; + flSoftwareQuatX: number; + flSoftwareQuatY: number; + flSoftwareQuatZ: number; + flSoftwareGyroDegreesPerSecondPitch: number; + flSoftwareGyroDegreesPerSecondYaw: number; + flSoftwareGyroDegreesPerSecondRoll: number; + flHardwareQuatW: number; + flHardwareQuatX: number; + flHardwareQuatY: number; + flHardwareQuatZ: number; + flHardwareGyroDegreesPerSecondPitch: number; + flHardwareGyroDegreesPerSecondYaw: number; + flHardwareGyroDegreesPerSecondRoll: number; flGyroNoiseLength: number; flGyroCalibrationProgress: number; + glGravityVectorX: number; + glGravityVectorY: number; + glGravityVectorZ: number; + flAccelerometerNoiseLength: number; sBatteryLevel: number; sPressurePadLeft: number; sPressurePadRight: number; From d8a1ac4417c285b3f04355f42902623af5e054d4 Mon Sep 17 00:00:00 2001 From: Xander <xander@isxander.dev> Date: Sun, 21 Jul 2024 17:15:45 +0100 Subject: [PATCH 44/46] Fix typo --- src/deck-components/steam-client/Input.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/deck-components/steam-client/Input.ts b/src/deck-components/steam-client/Input.ts index 62f781a7..1e3ec43c 100644 --- a/src/deck-components/steam-client/Input.ts +++ b/src/deck-components/steam-client/Input.ts @@ -713,9 +713,9 @@ export interface ControllerStateChange { flHardwareGyroDegreesPerSecondRoll: number; flGyroNoiseLength: number; flGyroCalibrationProgress: number; - glGravityVectorX: number; - glGravityVectorY: number; - glGravityVectorZ: number; + flGravityVectorX: number; + flGravityVectorY: number; + flGravityVectorZ: number; flAccelerometerNoiseLength: number; sBatteryLevel: number; sPressurePadLeft: number; From 0351d838fe9e6032f1dc16351b45a28b133d4590 Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:11:19 +0000 Subject: [PATCH 45/46] docs(SteamClient): update interfaces to Steam Version 1723601482 Steam Version: 1723601482 Steam Client Build Date: Wed, Aug 14 01:51 UTC -08:00 --- src/deck-components/steam-client/App.ts | 43 --------------- .../steam-client/GameRecording.ts | 29 ++++++++++ .../steam-client/Notifications.ts | 9 ++-- .../steam-client/Screenshots.ts | 12 +++++ src/deck-components/steam-client/Settings.ts | 54 +++++++++++++++++++ src/deck-components/steam-client/Window.ts | 10 ++++ src/deck-components/steam-client/index.ts | 13 ++--- .../steam-client/system/index.ts | 4 -- 8 files changed, 113 insertions(+), 61 deletions(-) create mode 100644 src/deck-components/steam-client/GameRecording.ts diff --git a/src/deck-components/steam-client/App.ts b/src/deck-components/steam-client/App.ts index 8b01994d..b7a6bf1c 100644 --- a/src/deck-components/steam-client/App.ts +++ b/src/deck-components/steam-client/App.ts @@ -15,14 +15,6 @@ export interface Apps { */ AddShortcut(appName: string, executablePath: string, directory: string, launchOptions: string): Promise<number>; - /** - * Adds user tags to specified apps in the Steam library. - * @param appIds The IDs of the apps to which user tags will be added. - * @param userTag The user tag to be added. - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - AddUserTagToApps(appIds: number[], userTag: string): void; - /** * Backups an app to the specified path. * @param appId The ID of the application to back up. @@ -61,14 +53,6 @@ export interface Apps { */ CancelLaunch(appId: string): void; - /** - * Clears existing user tags on a specified application and sets new user tags. - * @param appId The ID of the application to clear and set user tags for. - * @param userTags An array of user tags to set for the application. - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - ClearAndSetUserTagsOnApp(appId: number, userTags: string[]): void; - /** * Clears the custom artwork for a given application. * @param appId The ID of the application to clear custom artwork for. @@ -85,13 +69,6 @@ export interface Apps { ClearProton(appId: number): Promise<any>; - /** - * Clears user tags on a list of specified applications. - * @param appIds An array of application IDs for which to clear user tags. - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - ClearUserTagsOnApps(appIds: number[]): void; - /** * Continues a specific game action. * @param gameActionId The ID of the game action to continue. @@ -486,14 +463,6 @@ export interface Apps { */ RemoveShortcut(appId: number): void; - /** - * Removes a user tag from multiple Steam applications. - * @param appIds An array of application IDs from which the user tag should be removed. - * @param userTag The user tag to be removed. - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file. - */ - RemoveUserTagFromApps(appIds: number[], userTag: string): void; - ReportLibraryAssetCacheMiss(appId: number, assetType: AppArtworkAssetType): void; ReportMarketingMessageDialogShown(): void; @@ -502,10 +471,6 @@ export interface Apps { RequestLegacyCDKeysForApp(appId: number): any; - // collectionStore.GetCollection('hidden').allApps.map(e => e.appid) - // May be broken? - ResetHiddenState(appIds: number[]): Promise<void>; - /** * Runs a game with specified parameters. Focuses the game if already launched. * @param appId The ID of the application to run. @@ -565,14 +530,6 @@ export interface Apps { */ SetAppFamilyBlockedState(appIds: number[], state: boolean): void; - /** - * Sets the hidden status of a specific Steam application. - * @param appId The ID of the application to set the hidden status for. - * @param value The value indicating whether the application should be hidden (true) or not (false). - * @remarks This function modifies the "<STEAMPATH>/userdata/<STEAMID3>/7/remote/sharedconfig.vdf" file to set the hidden status of the specified application. - */ - SetAppHidden(appId: number, value: boolean): void; - /** * Sets launch options for a Steam application. * @param appId The ID of the application to set launch options for. diff --git a/src/deck-components/steam-client/GameRecording.ts b/src/deck-components/steam-client/GameRecording.ts new file mode 100644 index 00000000..cc470fe2 --- /dev/null +++ b/src/deck-components/steam-client/GameRecording.ts @@ -0,0 +1,29 @@ +import type { JsPbMessage, Unregisterable } from "./index"; + +export interface GameRecording { + /** + * If `data` is deserialized, returns {@link CGameRecording_AudioSessionsChanged_Notification}. + */ + RegisterForAudioSessionsChanged(callback: (data: ArrayBuffer) => void): Unregisterable; + SetAudioSessionCaptureState(id: string, name: string, state: boolean): void; +} + +export interface AudioSession { + id(): string | undefined; + name(): string | undefined; + is_system(): boolean | undefined; + is_muted(): boolean | undefined; + is_active(): boolean | undefined; + is_captured(): boolean | undefined; + recent_peak(): number | undefined; + is_game(): boolean | undefined; + is_steam(): boolean | undefined; + is_saved(): boolean | undefined; +} + +/** + * @note Taken from https://github.com/SteamDatabase/SteamTracking/blob/master/Protobufs/steammessages_gamerecording_objects.proto + */ +export interface CGameRecording_AudioSessionsChanged_Notification extends JsPbMessage { + sessions(): AudioSession[]; +} diff --git a/src/deck-components/steam-client/Notifications.ts b/src/deck-components/steam-client/Notifications.ts index 566b3e81..d1e53e0d 100644 --- a/src/deck-components/steam-client/Notifications.ts +++ b/src/deck-components/steam-client/Notifications.ts @@ -72,6 +72,7 @@ export enum EClientNotificationType { ClipDownloaded, GameRecordingStart, GameRecordingStop, + GameRecordingUserMarkerAdded, } export enum ESystemUpdateNotificationType { @@ -310,10 +311,6 @@ export interface ClientNotificationGameRecordingError extends JsPbMessage { error_type(): EGameRecordingErrorType; } -export interface ClientNotificationClipDownloaded extends JsPbMessage { - clip_id(): string; -} - export interface ClientNotificationGameRecordingStart extends JsPbMessage { game_id(): number; } @@ -322,3 +319,7 @@ export interface ClientNotificationGameRecordingStop extends JsPbMessage { game_id(): number; clip_id(): string; } + +export interface ClientNotificationGameRecordingUserMarkerAdded extends JsPbMessage { + game_id(): number; +} diff --git a/src/deck-components/steam-client/Screenshots.ts b/src/deck-components/steam-client/Screenshots.ts index 0e835e76..170f7a44 100644 --- a/src/deck-components/steam-client/Screenshots.ts +++ b/src/deck-components/steam-client/Screenshots.ts @@ -10,6 +10,8 @@ export interface Screenshots { */ DeleteLocalScreenshot(appId: string, screenshotIndex: number): Promise<boolean>; + DeleteLocalScreenshots(screenshots: ScreenshotToDelete[]): Promise<ScreenshotDeletionResponse>; + /** * Retrieves all local screenshots for all applications. * @returns A Promise that resolves to an array of Screenshot objects. @@ -120,6 +122,16 @@ export interface Screenshot { ugcHandle: string; } +export interface ScreenshotToDelete { + gameID: string; + rgHandles: number[]; +} + +export interface ScreenshotDeletionResponse { + bSuccess: boolean; + rgFailedRequestIndices: number[]; +} + export enum FilePrivacyState { Invalid = -1, Private = 2, diff --git a/src/deck-components/steam-client/Settings.ts b/src/deck-components/steam-client/Settings.ts index 34f651cb..ece97c98 100644 --- a/src/deck-components/steam-client/Settings.ts +++ b/src/deck-components/steam-client/Settings.ts @@ -355,14 +355,36 @@ export interface MsgClientSettings extends JsPbMessage { force_oobe(): boolean; + g_background_audio(): EGRAudio; + + g_background_a_m(): number; + + g_background_a_s(): boolean; + + g_background_br(): number; + + g_background_path(): string; + + g_background_max_keep(): string; + + g_background_mode(): EGRMode; + + g_background_time_resolution(): number; + g_background_mk(): Hotkey; g_background_tg(): Hotkey; + g_max_fps(): number; + game_notes_enable_spellcheck(): boolean; + gamescope_allow_tearing(): boolean; + gamescope_app_target_framerate(): number; + gamescope_composite_debug(): boolean; + gamescope_disable_framelimit(): boolean; gamescope_disable_mura_correction(): boolean; @@ -371,6 +393,8 @@ export interface MsgClientSettings extends JsPbMessage { gamescope_enable_app_target_framerate(): boolean; + gamescope_force_composite(): boolean; + gamescope_hdr_visualization(): HDRVisualization; gamescope_include_steamui_in_screenshots(): boolean; @@ -477,6 +501,8 @@ export interface MsgClientSettings extends JsPbMessage { shader_precached_size(): string; + show_copy_count_in_library(): boolean; + show_family_sharing_notifications(): boolean; show_screenshot_manager(): boolean; @@ -515,8 +541,24 @@ export interface MsgClientSettings extends JsPbMessage { steam_os_underscan_level(): number; + steamos_cec_enabled(): boolean; + + steamos_cec_wake_on_resume(): boolean; + + steamos_magnifier_scale(): number; + steamos_status_led_brightness(): number; + steamos_tdp_limit(): number; + + steamos_tdp_limit_enabled(): boolean; + + steamos_wifi_debug(): boolean; + + steamos_wifi_force_wpa_supplicant(): boolean; + + system_bluetooth_enabled(): boolean; + turn_off_controller_on_exit(): boolean; voice_mic_device_name(): string; @@ -545,6 +587,18 @@ export enum BroadcastPermission { Subscribers = 4, } +export enum EGRAudio { + Game, + System, + Select, +} + +export enum EGRMode { + Never, + Always, + Manual, +} + export interface Hotkey { alt_key: boolean; ctrl_key: boolean; diff --git a/src/deck-components/steam-client/Window.ts b/src/deck-components/steam-client/Window.ts index b7aaea62..69e32872 100644 --- a/src/deck-components/steam-client/Window.ts +++ b/src/deck-components/steam-client/Window.ts @@ -35,6 +35,11 @@ export interface Window { */ GetMousePositionDetails(): Promise<string>; + /** + * @returns the window's details. + */ + GetWindowDetails(): Promise<WindowDetails>; + /** * @returns the window's dimensions. */ @@ -217,6 +222,11 @@ export interface MonitorDimensions { nUsableWidth: number; } +export interface WindowDetails { + bGPUEnabled: boolean; + bUnderlaySupported: boolean; +} + export interface WindowDimensions { x: number; y: number; diff --git a/src/deck-components/steam-client/index.ts b/src/deck-components/steam-client/index.ts index 56cbce9f..ee8ce104 100644 --- a/src/deck-components/steam-client/index.ts +++ b/src/deck-components/steam-client/index.ts @@ -13,6 +13,7 @@ import {FamilySharing} from "./FamilySharing"; import {FriendSettings} from "./FriendSettings"; import {Friends} from "./Friends"; import {GameNotes} from "./GameNotes"; +import {GameRecording} from "./GameRecording"; import {GameSessions} from "./GameSessions"; import {Input} from "./Input"; import {InstallFolder} from "./InstallFolder"; @@ -57,6 +58,7 @@ export interface SteamClient { Friends: Friends; FriendSettings: FriendSettings; GameNotes: GameNotes; + GameRecording: GameRecording; GameSessions: GameSessions; Input: Input; InstallFolder: InstallFolder; @@ -223,16 +225,7 @@ export enum EBrowserType { */ DirectHWND_Hidden, ChildHWNDNative, - /** - * A transparent borderless window. - * Always on top of other windows, does not have a taskbar icon and not focusable. - */ - Transparent_Toplevel, - OffScreen_SharedTexture, - OffScreen_GameOverlay, - OffScreen_GameOverlay_SharedTexture, - Offscreen_FriendsUI, - Offscreen_SteamUI, + Offscreen_SteamUI = 12, OpenVROverlay_Subview, } diff --git a/src/deck-components/steam-client/system/index.ts b/src/deck-components/steam-client/system/index.ts index 78687d20..e110685c 100644 --- a/src/deck-components/steam-client/system/index.ts +++ b/src/deck-components/steam-client/system/index.ts @@ -42,8 +42,6 @@ export interface System { FormatStorage(forceFormat: boolean): any; - GetLegacyAmpControlEnabled(): Promise<any>; // {"bAvailable":true,"bEnabled":false} - GetOSType(): Promise<OSType>; GetSystemInfo(): Promise<SystemInfo>; @@ -108,8 +106,6 @@ export interface System { SetAirplaneMode(value: boolean): void; - SetLegacyAmpControl: any; - ShutdownPC(): any; SteamRuntimeSystemInfo(): Promise<string>; From a1ba6b356c38d6bdd5552b5fcd545db22eeddd88 Mon Sep 17 00:00:00 2001 From: ricewind012 <58827198+ricewind012@users.noreply.github.com> Date: Sat, 7 Sep 2024 16:23:37 +0000 Subject: [PATCH 46/46] docs(SteamClient): update interfaces to 1725654351 --- src/deck-components/steam-client/Notifications.ts | 6 ++++++ src/deck-components/steam-client/Settings.ts | 15 +++++++++++++++ src/deck-components/steam-client/system/index.ts | 5 +++++ 3 files changed, 26 insertions(+) diff --git a/src/deck-components/steam-client/Notifications.ts b/src/deck-components/steam-client/Notifications.ts index d1e53e0d..5b81cea2 100644 --- a/src/deck-components/steam-client/Notifications.ts +++ b/src/deck-components/steam-client/Notifications.ts @@ -73,6 +73,7 @@ export enum EClientNotificationType { GameRecordingStart, GameRecordingStop, GameRecordingUserMarkerAdded, + GameRecordingInstantClip, } export enum ESystemUpdateNotificationType { @@ -323,3 +324,8 @@ export interface ClientNotificationGameRecordingStop extends JsPbMessage { export interface ClientNotificationGameRecordingUserMarkerAdded extends JsPbMessage { game_id(): number; } + +export interface CClientNotificationGameRecordingInstantClip extends JsPbMessage { + game_id(): number; + clip_id(): string; +} diff --git a/src/deck-components/steam-client/Settings.ts b/src/deck-components/steam-client/Settings.ts index ece97c98..b73822e8 100644 --- a/src/deck-components/steam-client/Settings.ts +++ b/src/deck-components/steam-client/Settings.ts @@ -61,6 +61,8 @@ export interface Settings { RegisterForTimeZoneChange(callback: (timezoneId: string) => void): Unregisterable; // When timezone is changed from settings, callback will return new timezoneId ReinitMicSettings(): void; + RenderHotkey(event: KeyCaptureEvent): Promise<string>; + RequestDeviceAuthInfo(): void; // @@ -123,6 +125,14 @@ export enum ESteamGuardState { NotEnabled = 4, } +export interface KeyCaptureEvent { + alt_key: boolean; + ctrl_key: boolean; + display_name: string; + meta_key: boolean; + shift_key: boolean; +} + export interface Language { language: ELanguage; strShortName: string; @@ -377,6 +387,9 @@ export interface MsgClientSettings extends JsPbMessage { g_max_fps(): number; + gamerecording_hotkey_ic(): Hotkey; + gamerecording_ic_seconds(): number; + game_notes_enable_spellcheck(): boolean; gamescope_allow_tearing(): boolean; @@ -445,6 +458,8 @@ export interface MsgClientSettings extends JsPbMessage { oobe_test_mode_enabled(): boolean; + os_version_unsupported(): boolean; + overlay_fps_counter_corner(): number; overlay_fps_counter_high_contrast(): boolean; diff --git a/src/deck-components/steam-client/system/index.ts b/src/deck-components/steam-client/system/index.ts index e110685c..ca76a99d 100644 --- a/src/deck-components/steam-client/system/index.ts +++ b/src/deck-components/steam-client/system/index.ts @@ -16,6 +16,11 @@ export interface System { AudioDevice: AudioDevice; Bluetooth: Bluetooth; + /** + * @returns a boolean indicating whether the operation succeeded. + */ + CopyFile(target: string, destination: string): Promise<boolean>; + /** * Copies specified files to clipboard. * Does not throw if not found.