@decky/ui 4.15.1 → 4.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/components/Dropdown.d.ts +2 -2
  2. package/dist/components/FooterLegend.d.ts +8 -2
  3. package/dist/components/FooterLegend.js +7 -0
  4. package/dist/components/Menu.d.ts +5 -9
  5. package/dist/components/Modal.d.ts +3 -2
  6. package/dist/globals/index.d.ts +47 -2
  7. package/dist/globals/index.js +3 -2
  8. package/dist/globals/shared/cm.d.ts +112 -0
  9. package/dist/globals/shared/enums.d.ts +80 -0
  10. package/dist/globals/shared/enums.js +85 -0
  11. package/dist/globals/shared/history.d.ts +12 -0
  12. package/dist/globals/shared/history.js +1 -0
  13. package/dist/globals/shared/index.d.ts +5 -0
  14. package/dist/globals/shared/index.js +5 -0
  15. package/dist/globals/shared/interfaces.d.ts +54 -0
  16. package/dist/globals/shared/interfaces.js +1 -0
  17. package/dist/globals/shared/navigation.d.ts +14 -0
  18. package/dist/globals/shared/navigation.js +10 -0
  19. package/dist/globals/shared/steamid.d.ts +36 -0
  20. package/dist/globals/shared/steamid.js +15 -0
  21. package/dist/globals/shared/storage.d.ts +27 -0
  22. package/dist/globals/shared/storage.js +11 -0
  23. package/dist/globals/steam-client/App.d.ts +1 -1
  24. package/dist/globals/steam-client/Auth.d.ts +1 -1
  25. package/dist/globals/steam-client/ClientNotifications.d.ts +1 -1
  26. package/dist/globals/steam-client/Overlay.d.ts +3 -2
  27. package/dist/globals/steam-client/Settings.d.ts +1 -1
  28. package/dist/globals/steam-client/SharedConnection.d.ts +2 -1
  29. package/dist/globals/steam-client/UI.d.ts +17 -6
  30. package/dist/globals/steam-client/UI.js +11 -0
  31. package/dist/globals/steam-client/User.d.ts +13 -0
  32. package/dist/globals/steam-client/User.js +7 -0
  33. package/dist/globals/steam-client/WebChat.d.ts +5 -4
  34. package/dist/globals/steam-client/shared.d.ts +0 -29
  35. package/dist/globals/steam-client/shared.js +0 -24
  36. package/dist/globals/stores/app.d.ts +35 -0
  37. package/dist/globals/stores/app.js +1 -0
  38. package/dist/globals/stores/appdetailsstore.d.ts +86 -0
  39. package/dist/globals/stores/appdetailsstore.js +1 -0
  40. package/dist/globals/stores/appinfostore.d.ts +56 -0
  41. package/dist/globals/stores/appinfostore.js +1 -0
  42. package/dist/globals/stores/appstore.d.ts +77 -0
  43. package/dist/globals/stores/appstore.js +1 -0
  44. package/dist/globals/stores/badgestore.d.ts +52 -0
  45. package/dist/globals/stores/badgestore.js +1 -0
  46. package/dist/globals/stores/collectionstore.d.ts +313 -0
  47. package/dist/globals/stores/collectionstore.js +143 -0
  48. package/dist/globals/stores/consolestore.d.ts +20 -0
  49. package/dist/globals/stores/consolestore.js +1 -0
  50. package/dist/globals/stores/focusnavcontroller.d.ts +383 -0
  51. package/dist/globals/stores/focusnavcontroller.js +29 -0
  52. package/dist/globals/stores/friendstore/clanstore.d.ts +75 -0
  53. package/dist/globals/stores/friendstore/clanstore.js +19 -0
  54. package/dist/globals/stores/friendstore/friendchat.d.ts +374 -0
  55. package/dist/globals/stores/friendstore/friendchat.js +56 -0
  56. package/dist/globals/stores/friendstore/friendgroupstore.d.ts +98 -0
  57. package/dist/globals/stores/friendstore/friendgroupstore.js +8 -0
  58. package/dist/globals/stores/friendstore/friendingamenotificationstore.d.ts +2 -0
  59. package/dist/globals/stores/friendstore/friendingamenotificationstore.js +1 -0
  60. package/dist/globals/stores/friendstore/friendslistfavoritesstore.d.ts +22 -0
  61. package/dist/globals/stores/friendstore/friendslistfavoritesstore.js +1 -0
  62. package/dist/globals/stores/friendstore/friendsuifriendstore.d.ts +125 -0
  63. package/dist/globals/stores/friendstore/friendsuifriendstore.js +1 -0
  64. package/dist/globals/stores/friendstore/index.d.ts +25 -0
  65. package/dist/globals/stores/friendstore/index.js +1 -0
  66. package/dist/globals/stores/friendstore/shared.d.ts +207 -0
  67. package/dist/globals/stores/friendstore/shared.js +41 -0
  68. package/dist/globals/stores/gamerecordingstore.d.ts +263 -0
  69. package/dist/globals/stores/gamerecordingstore.js +1 -0
  70. package/dist/globals/stores/index.d.ts +18 -0
  71. package/dist/globals/stores/index.js +18 -0
  72. package/dist/globals/stores/libraryuistore.d.ts +179 -0
  73. package/dist/globals/stores/libraryuistore.js +56 -0
  74. package/dist/globals/stores/localizationmanager.d.ts +18 -0
  75. package/dist/globals/stores/localizationmanager.js +1 -0
  76. package/dist/globals/stores/mainwindowbrowsermanager.d.ts +62 -0
  77. package/dist/globals/stores/mainwindowbrowsermanager.js +1 -0
  78. package/dist/globals/stores/notificationstore.d.ts +242 -0
  79. package/dist/globals/stores/notificationstore.js +20 -0
  80. package/dist/globals/stores/popupmanager.d.ts +128 -0
  81. package/dist/globals/stores/popupmanager.js +1 -0
  82. package/dist/globals/stores/securitystore.d.ts +35 -0
  83. package/dist/globals/stores/securitystore.js +1 -0
  84. package/dist/globals/stores/settingsstore.d.ts +86 -0
  85. package/dist/globals/stores/settingsstore.js +19 -0
  86. package/dist/globals/stores/steamuistore/gamepadbrowserview.d.ts +143 -0
  87. package/dist/globals/stores/steamuistore/gamepadbrowserview.js +9 -0
  88. package/dist/globals/stores/steamuistore/gamepaduiaudio.d.ts +36 -0
  89. package/dist/globals/stores/steamuistore/gamepaduiaudio.js +1 -0
  90. package/dist/globals/stores/steamuistore/index.d.ts +132 -0
  91. package/dist/globals/stores/steamuistore/index.js +14 -0
  92. package/dist/globals/stores/steamuistore/menu.d.ts +39 -0
  93. package/dist/globals/stores/steamuistore/menu.js +19 -0
  94. package/dist/globals/stores/steamuistore/window.d.ts +206 -0
  95. package/dist/globals/stores/steamuistore/window.js +6 -0
  96. package/dist/globals/stores/storeitemcache.d.ts +319 -0
  97. package/dist/globals/stores/storeitemcache.js +17 -0
  98. package/dist/globals/stores/urlstore.d.ts +57 -0
  99. package/dist/globals/stores/urlstore.js +1 -0
  100. package/dist/modules/Router.d.ts +3 -56
  101. package/dist/modules/Router.js +2 -20
  102. package/dist/tsconfig.tsbuildinfo +1 -1
  103. package/dist/utils/index.d.ts +0 -1
  104. package/dist/utils/react/fc.js +4 -2
  105. package/dist/utils/react/react.js +2 -2
  106. package/dist/utils/react/treepatcher.js +1 -1
  107. package/package.json +1 -1
  108. package/src/components/Dropdown.tsx +2 -2
  109. package/src/components/FooterLegend.ts +10 -2
  110. package/src/components/Menu.ts +11 -21
  111. package/src/components/Modal.ts +40 -8
  112. package/src/globals/index.ts +68 -2
  113. package/src/globals/shared/cm.ts +158 -0
  114. package/src/globals/shared/enums.ts +97 -0
  115. package/src/globals/shared/history.ts +15 -0
  116. package/src/globals/shared/index.ts +5 -0
  117. package/src/globals/shared/interfaces.ts +147 -0
  118. package/src/globals/shared/navigation.ts +15 -0
  119. package/src/globals/shared/steamid.ts +49 -0
  120. package/src/globals/shared/storage.ts +62 -0
  121. package/src/globals/steam-client/App.ts +2 -2
  122. package/src/globals/steam-client/Auth.ts +2 -2
  123. package/src/globals/steam-client/ClientNotifications.ts +1 -1
  124. package/src/globals/steam-client/Overlay.ts +3 -2
  125. package/src/globals/steam-client/Settings.ts +1 -1
  126. package/src/globals/steam-client/SharedConnection.ts +2 -1
  127. package/src/globals/steam-client/UI.ts +18 -9
  128. package/src/globals/steam-client/User.ts +20 -0
  129. package/src/globals/steam-client/WebChat.ts +5 -4
  130. package/src/globals/steam-client/shared.ts +0 -69
  131. package/src/globals/stores/app.ts +102 -0
  132. package/src/globals/stores/appdetailsstore.ts +235 -0
  133. package/src/globals/stores/appinfostore.ts +65 -0
  134. package/src/globals/stores/appstore.ts +166 -0
  135. package/src/globals/stores/badgestore.ts +87 -0
  136. package/src/globals/stores/collectionstore.ts +544 -0
  137. package/src/globals/stores/consolestore.ts +54 -0
  138. package/src/globals/stores/focusnavcontroller.ts +522 -0
  139. package/src/globals/stores/friendstore/clanstore.ts +89 -0
  140. package/src/globals/stores/friendstore/friendchat.ts +646 -0
  141. package/src/globals/stores/friendstore/friendgroupstore.ts +187 -0
  142. package/src/globals/stores/friendstore/friendingamenotificationstore.ts +1 -0
  143. package/src/globals/stores/friendstore/friendslistfavoritesstore.ts +37 -0
  144. package/src/globals/stores/friendstore/friendsuifriendstore.ts +274 -0
  145. package/src/globals/stores/friendstore/index.ts +58 -0
  146. package/src/globals/stores/friendstore/shared.ts +318 -0
  147. package/src/globals/stores/gamerecordingstore.ts +367 -0
  148. package/src/globals/stores/index.ts +18 -0
  149. package/src/globals/stores/libraryuistore.ts +395 -0
  150. package/src/globals/stores/localizationmanager.ts +56 -0
  151. package/src/globals/stores/mainwindowbrowsermanager.ts +135 -0
  152. package/src/globals/stores/notificationstore.ts +298 -0
  153. package/src/globals/stores/popupmanager.ts +352 -0
  154. package/src/globals/stores/securitystore.ts +36 -0
  155. package/src/globals/stores/settingsstore.ts +134 -0
  156. package/src/globals/stores/steamuistore/gamepadbrowserview.ts +172 -0
  157. package/src/globals/stores/steamuistore/gamepaduiaudio.ts +117 -0
  158. package/src/globals/stores/steamuistore/index.ts +217 -0
  159. package/src/globals/stores/steamuistore/menu.ts +89 -0
  160. package/src/globals/stores/steamuistore/window.ts +466 -0
  161. package/src/globals/stores/storeitemcache.ts +347 -0
  162. package/src/globals/stores/urlstore.ts +150 -0
  163. package/src/modules/Router.ts +9 -75
  164. package/src/utils/index.ts +0 -1
  165. package/src/utils/react/fc.ts +4 -2
  166. package/src/utils/react/react.ts +2 -2
  167. package/src/utils/react/treepatcher.ts +1 -1
  168. package/dist/globals/SteamClient.d.ts +0 -5
  169. package/dist/globals/SteamClient.js +0 -1
  170. package/dist/globals/stores.d.ts +0 -70
  171. package/src/globals/SteamClient.ts +0 -6
  172. package/src/globals/stores.ts +0 -74
  173. /package/dist/globals/{stores.js → shared/cm.js} +0 -0
@@ -0,0 +1,298 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ import type { ESteamUISound } from '../shared/enums';
4
+ import type { CCallbackList } from '../shared/interfaces';
5
+ import { EClientNotificationType } from '../steam-client/Notifications';
6
+ import type { EParentalFeature } from '../steam-client/Parental';
7
+ import type { EACState } from '../steam-client/system';
8
+
9
+ // TODO(protobufs): generate
10
+ export enum EBroadcastPermission {
11
+ k_EBroadcastPermissionDisabled,
12
+ k_EBroadcastPermissionFriendsApprove,
13
+ k_EBroadcastPermissionFriendsAllowed,
14
+ k_EBroadcastPermissionPublic,
15
+ k_EBroadcastPermissionSubscribers,
16
+ }
17
+
18
+ export enum ESteamNotificationSource {
19
+ Client,
20
+ Server,
21
+ }
22
+
23
+ // that's what I *guess* it is, no idea what this is
24
+ export enum ESteamNotificationAction {
25
+ New,
26
+ Update,
27
+ Remove,
28
+ }
29
+
30
+ interface SteamNotificationData {
31
+ bCritical: boolean;
32
+ body: string;
33
+ /**
34
+ * In ms.
35
+ */
36
+ duration: number;
37
+ logo: ReactNode;
38
+ onClick: () => void;
39
+ // TODO: apparently can be a function too
40
+ playSound: boolean;
41
+ showNewIndicator: boolean;
42
+ showToast: boolean;
43
+ // TODO: apparently can be a function too
44
+ sound: ESteamUISound;
45
+ timestamp: Date;
46
+ title: string;
47
+ }
48
+
49
+ type RequiredProcessNotifArgs = Record<EClientNotificationType, Record<string, any>> & {
50
+ [EClientNotificationType.Invalid]: {};
51
+ [EClientNotificationType.DownloadComplete]: {};
52
+ [EClientNotificationType.FriendInvite]: {};
53
+ [EClientNotificationType.FriendInGame]: {};
54
+ [EClientNotificationType.FriendOnline]: {};
55
+ [EClientNotificationType.Achievement]: {
56
+ achieved(): boolean;
57
+ };
58
+ [EClientNotificationType.LowBattery]: {};
59
+ [EClientNotificationType.SystemUpdate]: {};
60
+ [EClientNotificationType.FriendMessage]: {};
61
+ [EClientNotificationType.GroupChatMessage]: {
62
+ tag(): string;
63
+ };
64
+ [EClientNotificationType.FriendInviteRollup]: {};
65
+ [EClientNotificationType.FamilySharingDeviceAuthorizationChanged]: {};
66
+ [EClientNotificationType.FamilySharingStopPlaying]: {};
67
+ [EClientNotificationType.FamilySharingLibraryAvailable]: {};
68
+ [EClientNotificationType.Screenshot]: {};
69
+ [EClientNotificationType.CloudSyncFailure]: {};
70
+ [EClientNotificationType.CloudSyncConflict]: {};
71
+ [EClientNotificationType.IncomingVoiceChat]: {};
72
+ [EClientNotificationType.ClaimSteamDeckRewards]: {};
73
+ [EClientNotificationType.GiftReceived]: {};
74
+ [EClientNotificationType.ItemAnnouncement]: {};
75
+ [EClientNotificationType.HardwareSurvey]: {};
76
+ [EClientNotificationType.LowDiskSpace]: {};
77
+ [EClientNotificationType.BatteryTemperature]: {};
78
+ [EClientNotificationType.DockUnsupportedFirmware]: {};
79
+ [EClientNotificationType.PeerContentUpload]: {};
80
+ [EClientNotificationType.CannotReadControllerGuideButton]: {};
81
+ [EClientNotificationType.Comment]: {};
82
+ [EClientNotificationType.Wishlist]: {};
83
+ [EClientNotificationType.TradeOffer]: {};
84
+ [EClientNotificationType.AsyncGame]: {};
85
+ [EClientNotificationType.General]: {};
86
+ [EClientNotificationType.HelpRequest]: {};
87
+ [EClientNotificationType.OverlaySplashScreen]: {};
88
+ [EClientNotificationType.BroadcastAvailableToWatch]: {};
89
+ [EClientNotificationType.TimedTrialRemaining]: {};
90
+ [EClientNotificationType.LoginRefresh]: {};
91
+ [EClientNotificationType.MajorSale]: {};
92
+ [EClientNotificationType.TimerExpired]: {};
93
+ [EClientNotificationType.ModeratorMsg]: {};
94
+ [EClientNotificationType.SteamInputActionSetChanged]: {};
95
+ [EClientNotificationType.RemoteClientConnection]: {};
96
+ [EClientNotificationType.RemoteClientStartStream]: {};
97
+ [EClientNotificationType.StreamingClientConnection]: {};
98
+ [EClientNotificationType.FamilyInvite]: {};
99
+ [EClientNotificationType.PlaytimeWarning]: {};
100
+ [EClientNotificationType.FamilyPurchaseRequest]: {};
101
+ [EClientNotificationType.FamilyPurchaseRequestResponse]: {};
102
+ [EClientNotificationType.ParentalFeatureRequest]: {};
103
+ [EClientNotificationType.ParentalPlaytimeRequest]: {};
104
+ [EClientNotificationType.GameRecordingError]: {};
105
+ [EClientNotificationType.ParentalFeatureResponse]: {};
106
+ [EClientNotificationType.ParentalPlaytimeResponse]: {};
107
+ [EClientNotificationType.RequestedGameAdded]: {};
108
+ [EClientNotificationType.ClipDownloaded]: {};
109
+ [EClientNotificationType.GameRecordingStart]: {};
110
+ [EClientNotificationType.GameRecordingStop]: {};
111
+ [EClientNotificationType.GameRecordingUserMarkerAdded]: {};
112
+ [EClientNotificationType.GameRecordingInstantClip]: {};
113
+ };
114
+
115
+ export interface SteamNotification<T extends EClientNotificationType = EClientNotificationType> {
116
+ bNewIndicator: boolean;
117
+ data: SteamNotificationData;
118
+ eSource: ESteamNotificationSource;
119
+ eType: T;
120
+ nToastDurationMS: number;
121
+ notificationID: number;
122
+ /**
123
+ * UNIX timestamp.
124
+ */
125
+ rtCreated: number;
126
+ }
127
+
128
+ export interface TrayNotification {
129
+ eType: EClientNotificationType;
130
+ notifications: SteamNotification[];
131
+ }
132
+
133
+ export interface NotificationTarget {
134
+ eFeature?: EParentalFeature;
135
+ fnNotificationResolved?: () => void;
136
+ fnShowModal?: () => void;
137
+ fnTray?: (target: NotificationTarget, notificationsInTray: TrayNotification[]) => void;
138
+ nRemoveFromTraySec?: number;
139
+ toastDurationMS?: number;
140
+ type: EClientNotificationType;
141
+ }
142
+
143
+ /**
144
+ * All the functions starting with `Test` may be used to test notifications.
145
+ */
146
+ export interface CNotificationStore {
147
+ m_LastSystemUpdateNotification: Pick<SteamNotification, 'eType' | 'rtCreated'> | null;
148
+ m_bCheckBatteryAfterResume: boolean;
149
+ m_bShowClientItemAnnouncementToasts: boolean;
150
+ m_bShowedHighBatteryTempNotification: boolean;
151
+ m_bShowedLowBatteryTempNotification: boolean;
152
+ m_bShowedRefreshLogin: boolean;
153
+ m_bTestNotifications: boolean;
154
+ m_cbkCurrentToast: CCallbackList<[TrayNotification[]]>;
155
+ m_cbkNotificationTray: CCallbackList<[TrayNotification[]]>;
156
+ m_hPendingToastTimer: number;
157
+ m_hTrayRemoveTimer: number;
158
+ m_iLastBatteryLevelNotification: number;
159
+ m_mapAppOverlayToasts: Map<number, SteamNotification[]>;
160
+ // second map:
161
+ // {"function(){return e(this,...t)}_function(){return e(this,...t)}" => 1760072931}
162
+ // ?????
163
+ m_mapToastLastShown: Map<number, Map<string, number>>;
164
+ m_nNextTestNotificationID: number;
165
+ m_nUnviewedNotifications: number;
166
+ m_rgContextsRenderingToasts: number[];
167
+ m_rgNotificationToasts: SteamNotification[];
168
+ m_rgNotificationTray: TrayNotification[];
169
+ m_rgPendingToasts: SteamNotification[];
170
+ m_rtNextTrayRemove: number;
171
+ m_setContextsRenderingToasts: Set<any>;
172
+
173
+ AddAppOverlayNotification(
174
+ appId: number,
175
+ notificationId: number,
176
+ type: EClientNotificationType,
177
+ param3: any, // data: i.proto.deserializeBinary(o)
178
+ notificationResolvedCallback: () => void,
179
+ ): void;
180
+ AddBroadcastAvailableToWatch(appId: number, permission: EBroadcastPermission): void;
181
+ AddOverlaySplashScreen(appId: number): void;
182
+ AddTimedTrialRemaining(
183
+ appid: number,
184
+ icon: string,
185
+ offline: boolean,
186
+ allowedSeconds: number,
187
+ playedSeconds?: number,
188
+ ): void;
189
+ AppOverlayRunning(appId: number, value: boolean): void;
190
+ BAnyContextRenderingToasts(): boolean;
191
+ BAnyToastDisplayAlone(toasts: SteamNotification[]): boolean;
192
+ BContextRenderingToasts(e: any): boolean;
193
+ BIsToastRateLimited(e: number, t: any, r: number): boolean;
194
+
195
+ /**
196
+ * @returns `true` if you are currently in a game.
197
+ */
198
+ BIsUserInGame(): boolean;
199
+ BNextToastDisplayAlone(appId: number): boolean;
200
+ BShowToast(e: any, t: any): boolean;
201
+ BSkipSystemUpdateNotification(type: EClientNotificationType): boolean;
202
+ ChooseSound(data: SteamNotificationData, t: any): any | null;
203
+ ClearAllToastNotifications(): void;
204
+ ClearRemoveFromTrayTimer(): void;
205
+ // wtf is this
206
+ Dev_SendTestNotifications(): void;
207
+ DispatchNextToast(): void;
208
+ DoScreenshotNotification(screenshotHandle: number, description: string): void;
209
+ ExpireToast(toast: SteamNotification): void;
210
+ GetCurrentAppOverlayNotification(appId: number): SteamNotification;
211
+ GetCurrentToastNotification(): SteamNotification | null;
212
+ GetNotificationTargets(): Record<EClientNotificationType, SteamNotification>;
213
+ GetNotificationsInTray(): [CNotificationStore['m_rgNotificationTray'], CNotificationStore['m_cbkNotificationTray']];
214
+ IncomingVoiceChat(steamId: number, show: boolean): void;
215
+ LoadServerToastRequiredData(steamId: number): boolean;
216
+ MarkNotificationRead(notificationId: number): void;
217
+ NotifyClaimSteamDeckRewards(): void;
218
+ NotifyLowDiskSpace(folderIndex: number): void;
219
+ NotifyTimerExpired(appId: number): void;
220
+ OnBatteryLevelChange(flLevel: number, eACState: EACState, bHasBattery: boolean): void;
221
+ /**
222
+ * @param temperature in Celsius
223
+ */
224
+ OnBatteryTemperatureChange(temperature: number): void;
225
+ OnNewNotificationReceived(notification: SteamNotification): void;
226
+ OnNotification(notificationIndex: number, type: EClientNotificationType, data: ArrayBuffer): void;
227
+ OnNotificationUpdateReceived(toast: SteamNotification, action: ESteamNotificationAction): void;
228
+ OnScreenshotStarted(): void;
229
+ PendingLoginRefresh(showedRefreshLogin: boolean): void;
230
+ PlayNotificationSound(toast: SteamNotification): void;
231
+ PopNextToastNotification(appId: number): SteamNotification;
232
+ ProcessNotification<T extends EClientNotificationType>(
233
+ target: NotificationTarget,
234
+ notification: SteamNotification<T> & RequiredProcessNotifArgs[T],
235
+ action: ESteamNotificationAction,
236
+ ): void;
237
+ RemoveFromToastsWhere(callback: (toast: SteamNotification) => void): void;
238
+ RemoveFromTrayWhere(callback: (toast: SteamNotification) => void): void;
239
+ RemoveScreenshotNotification(screenshotHandle: number): void;
240
+ RunDebugTestsWhenServicesReady(e: boolean): void;
241
+ ScheduleRemoveFromTray(delaySeconds: number): void;
242
+ SendPendingServerToasts(): void;
243
+ SetContextRenderingToast(context: any, add: boolean): void;
244
+ Viewed(): void;
245
+
246
+ // #region Test functions
247
+ TestAchievement(appId: number, showProgress: boolean): void;
248
+ TestAsyncGame(appId: number): void;
249
+ TestCloudSyncConflict(appId: number): void;
250
+ TestCloudSyncFailure(appId: number): void;
251
+ TestComment(): void;
252
+ TestDownloadComplete(appId: number): void;
253
+ TestFamilyInvite(steamId: number): void;
254
+ TestFamilyPurchaseRequest(steamId: number): void;
255
+ TestFamilyPurchaseRequestResponse(steamId: number): void;
256
+ TestFamilySharing(): void;
257
+ TestFriendIngame(gameName: string, steamId: number): void;
258
+ TestFriendInvite(steamId: number): void;
259
+ TestFriendInviteRollup(newInviteCount: number): void;
260
+ TestFriendMessage(steamId: number, messageBody: string): void;
261
+ TestFriendOnline(steamId: number): void;
262
+ TestGRE(): void;
263
+ TestGRUM(): void;
264
+ TestGameRecordingInstantClip(): void;
265
+ TestGeneralAnnouncement(): void;
266
+ TestGift(steamId: number): void;
267
+ TestGroupChatMention(steamId: number, messageBody: string): void;
268
+ TestGroupChatMessage(steamId: number, messageBody: string): void;
269
+ TestHardwareSurvey(): void;
270
+ TestHelpRequest(): void;
271
+ TestIncomingVoiceChat(): void;
272
+ TestItemAnnouncement(steamId: number): Promise<void>;
273
+ /**
274
+ * @param percentage from 0 to 1
275
+ */
276
+ TestLowBatteryNotification(percentage: number): void;
277
+ TestMajorSale(): void;
278
+ TestModeratorMessage(): void;
279
+ TestParentalFeatureRequest(steamId: number): void;
280
+ TestParentalFeatureResponse(steamId: number): void;
281
+ TestParentalPlaytimeRequest(steamId: number): void;
282
+ TestParentalPlaytimeResponse(steamId: number): void;
283
+ TestPlaytestInvite(): void;
284
+ TestPlaytimeWarning(): void;
285
+ TestReadControllerGuide(): void;
286
+ TestRemoteClientConnection(): void;
287
+ TestRemoteClientStartStream(): void;
288
+ TestRequestedGameAdded(steamid64?: string): void;
289
+ TestScreenshot(): void;
290
+ TestSteamInputActionSetChanged(): void;
291
+ TestStreamingClientConnection(): void;
292
+ TestSystemUpdate(notificationType: 1 | 2): void;
293
+ TestTradeOffer(): void;
294
+ TestTradeReversal(): void;
295
+ TestUnsupportedDock(): void;
296
+ TestWishlist(appId: number): void;
297
+ // #endregion
298
+ }
@@ -0,0 +1,352 @@
1
+ import type { EBrowserType } from '../shared/enums';
2
+ import type { BrowserContext, CCallbackList, Unsubscribable } from '../shared/interfaces';
3
+ import type { EWindowBringToFront } from '../steam-client/Window';
4
+
5
+ export type PopupCallback_t = (popup?: SteamPopup) => void;
6
+
7
+ export interface RestoreDetails {
8
+ bExpires: boolean;
9
+ /**
10
+ * Date as a Unix timestamp.
11
+ */
12
+ last_used: number;
13
+ strRestoreDetails: string;
14
+ }
15
+
16
+ export interface PopupCreationOptions {
17
+ /**
18
+ * Initially hidden, make it appear with a `Show` method from return result.
19
+ */
20
+ bCreateHidden?: boolean;
21
+
22
+ /**
23
+ * @todo bHideMainWindowForPopouts
24
+ */
25
+ bModal?: boolean;
26
+
27
+ /**
28
+ * Document title.
29
+ *
30
+ * @todo This is a getter in {@link SteamPopupParameters}, but a normal
31
+ * property in {@link ContextMenuPositionOptions}, wtf (does this matter tho)
32
+ */
33
+ title?: string;
34
+ }
35
+
36
+ export interface SteamPopupParameters extends PopupCreationOptions {
37
+ availscreenheight: number;
38
+ availscreenwidth: number;
39
+ /**
40
+ * Value of `SteamClient.Window.SetHideOnClose`.
41
+ */
42
+ bHideOnClose: boolean;
43
+ bNoFocusOnShow: boolean;
44
+ /**
45
+ * @todo saw in js, but is it there ?
46
+ */
47
+ bNoInitialShow: boolean;
48
+ bPinned: boolean;
49
+ /**
50
+ * Popup's `<body>` class.
51
+ */
52
+ body_class: string;
53
+ browserType: EBrowserType;
54
+ /**
55
+ * Popup is centered on this window.
56
+ */
57
+ center_on_window: Window;
58
+ dimensions: {
59
+ height?: number;
60
+ left?: number;
61
+ top?: number;
62
+ width?: number;
63
+ };
64
+ /**
65
+ * @see {@link EPopupCreationFlags}
66
+ */
67
+ eCreationFlags: number;
68
+ /**
69
+ * Popup `<html>` class.
70
+ */
71
+ html_class: string;
72
+ /**
73
+ * @todo unused ? maybe used with {@link bModal} ?
74
+ */
75
+ hwndParent: number;
76
+ /**
77
+ * Popup minimum height.
78
+ */
79
+ minHeight: number;
80
+ /**
81
+ * Popup minimum width.
82
+ */
83
+ minWidth: number;
84
+ /**
85
+ * Parent browser ID.
86
+ */
87
+ parent_container_popup_id: number;
88
+ /**
89
+ * Root element class.
90
+ */
91
+ popup_class: string;
92
+ replace_existing_popup: boolean;
93
+ strRestoreDetails: string;
94
+ strUserAgent: string;
95
+ strVROverlayKey: string;
96
+ /**
97
+ * These parameters are interpreted by the Steam process to open popups
98
+ * in the Steam overlay or SteamVR dashboard instead of on the desktop.
99
+ */
100
+ target_browser: BrowserContext;
101
+ /**
102
+ * Internal popup name.
103
+ */
104
+ m_strName: string;
105
+ /**
106
+ * Document title.
107
+ */
108
+ m_strTitle: string;
109
+ /**
110
+ * Parent browser ID.
111
+ */
112
+ window_opener_id: number;
113
+ }
114
+
115
+ /**
116
+ * Helper to track when all links for a newly created popup have loaded.
117
+ * Supports CPopup replacement too.
118
+ */
119
+ export interface CRenderWhenLinksReady {
120
+ m_fnRender: () => void;
121
+ m_rgLoadingLinks: Node[];
122
+
123
+ AddLink(link: Node, checkIfLoaded: boolean): void;
124
+ SetTarget(renderCallback: () => void): void;
125
+ }
126
+
127
+ export interface SteamPopup {
128
+ /**
129
+ * `true` if the popup will not be shown initially.
130
+ */
131
+ m_bCreateHidden: boolean;
132
+ /**
133
+ * `true` if created.
134
+ */
135
+ m_bCreated: boolean;
136
+ /**
137
+ * `true` if focused.
138
+ */
139
+ m_bFocused: boolean;
140
+ m_callbacks: {
141
+ onLoad(e: any, t: any): any;
142
+ onResize(t: any, r: any, i: any): any;
143
+ updateParamsBeforeShow(...args: any[]): any;
144
+ };
145
+ /**
146
+ * Root element.
147
+ */
148
+ m_element: HTMLElement;
149
+ m_fnReadyToRender(...args: any[]): any;
150
+ m_onCreateRender: any;
151
+ m_popup: Window;
152
+ m_renderWhenReady: CRenderWhenLinksReady;
153
+ m_rgParams: Partial<SteamPopupParameters>;
154
+ /**
155
+ * Popup (internal) name.
156
+ */
157
+ m_strName: string;
158
+ /**
159
+ * Document title.
160
+ */
161
+ m_strTitle: string;
162
+
163
+ /**
164
+ * @returns `true` if the popup is closed.
165
+ */
166
+ BIsClosed(): boolean;
167
+
168
+ /**
169
+ * @returns `true` if the popup is focused.
170
+ */
171
+ BIsFocused(): boolean;
172
+
173
+ /**
174
+ * @returns `true` if the popup is usable.
175
+ */
176
+ BIsValid(): boolean;
177
+
178
+ /**
179
+ * @returns `true` if not closed and not minimized.
180
+ */
181
+ BIsVisible(): boolean;
182
+
183
+ /**
184
+ * Closes the popup.
185
+ */
186
+ Close(): void;
187
+
188
+ /**
189
+ * Focuses the popup.
190
+ */
191
+ Focus(eForceOS?: EWindowBringToFront): void;
192
+
193
+ /**
194
+ * @returns the internal name.
195
+ */
196
+ GetName(): string;
197
+
198
+ /**
199
+ * @returns the popup's restore details.
200
+ */
201
+ GetWindowRestoreDetails(): Promise<string>;
202
+
203
+ /**
204
+ * @returns `true` if the window is maximized.
205
+ */
206
+ IsMaximized(): Promise<boolean>;
207
+
208
+ /**
209
+ * @returns `true` if the window is minimized.
210
+ */
211
+ IsMinimized(): Promise<boolean>;
212
+
213
+ // #region Window events, not always available
214
+ OnBlur(): void;
215
+ OnCreate(): void;
216
+ OnDragOver(ev: DragEvent): void;
217
+ OnDrop(ev: DragEvent): void;
218
+ OnFocus(): void;
219
+ OnMessage<T = any>(ev: MessageEvent<T>): void;
220
+ OnResize(): void;
221
+ OnResizeEvent(): void;
222
+ OnUnload(ev?: Event): void;
223
+ // #endregion
224
+
225
+ /**
226
+ * Closes the popup and releases it from memory, beyond that the popup is
227
+ * unusable.
228
+ */
229
+ ReleasePopup(): void;
230
+
231
+ /**
232
+ * Removes all event listeners attached to the popup window.
233
+ */
234
+ RemoveEventListeners(): void;
235
+ Render(wnd: Window, element: HTMLElement): void;
236
+ Show(eForceOS?: EWindowBringToFront): void;
237
+ UpdateParamsBeforeShow<T = Partial<SteamPopupParameters>>(params: T): T;
238
+ }
239
+
240
+ export interface CPopupManager {
241
+ DebouncedSaveSavedDimensionStore_DebounceProperties: {
242
+ hTimer: number;
243
+ nPending: number;
244
+ };
245
+ m_DynamicCSSObserver: MutationObserver;
246
+ m_bSaveRequired: boolean;
247
+ m_bShuttingDown: boolean;
248
+ m_mapPopups: Map<string, SteamPopup>;
249
+ m_mapRestoreDetails: Map<string, RestoreDetails>;
250
+ m_rgPopupCreatedCallbacks: CCallbackList<[PopupCallback_t]>;
251
+ m_rgPopupDestroyedCallbacks: CCallbackList<[PopupCallback_t]>;
252
+ m_rgShutdownCallbacks: (() => void)[];
253
+ m_unCurrentAccountID: number;
254
+
255
+ /**
256
+ * Adds a callback to dispatch on popup creation.
257
+ */
258
+ AddPopupCreatedCallback(callback: PopupCallback_t): Unsubscribable;
259
+
260
+ /**
261
+ * Adds a callback to dispatch on popup destruction.
262
+ */
263
+ AddPopupDestroyedCallback(callback: PopupCallback_t): Unsubscribable;
264
+
265
+ /**
266
+ * Adds a callback to dispatch on Steam shutdown.
267
+ */
268
+ AddShutdownCallback(callback: () => void): Unsubscribable;
269
+
270
+ /**
271
+ * Adds a popup and dispatches all the callbacks.
272
+ */
273
+ AddTrackedPopup(popup: SteamPopup): void;
274
+
275
+ /**
276
+ * @returns `true` if one of the context menu *popups* is focused.
277
+ */
278
+ BAnyMenuHasFocus(): boolean;
279
+
280
+ /**
281
+ * @returns `true` if one of the windows is focused.
282
+ */
283
+ BAnyPopupHasFocus(): boolean;
284
+
285
+ /**
286
+ * @returns `true` if Steam is about to shut down.
287
+ */
288
+ BShuttingDown(): boolean;
289
+
290
+ /**
291
+ * Clears saved restore details from {@link m_mapRestoreDetails}.
292
+ */
293
+ ClearSavedDimensionStore(): void;
294
+
295
+ /**
296
+ * Closes all popups owned by provided browser.
297
+ */
298
+ ClosePopupsOwnedByBrowser(browser: BrowserContext): void;
299
+
300
+ /**
301
+ * @returns the popup for the specified popup name.
302
+ */
303
+ GetExistingPopup(popupName: string): SteamPopup;
304
+
305
+ /**
306
+ * @returns the key used for usage in {@link localStorage}. Saved on a
307
+ * per-account basis.
308
+ */
309
+ GetLocalStorageKey(): string;
310
+
311
+ /**
312
+ * @returns the popup for the specified window.
313
+ */
314
+ GetPopupForWindow(window: Window): SteamPopup;
315
+
316
+ /**
317
+ * @returns a list of current popups.
318
+ */
319
+ GetPopups(): SteamPopup[];
320
+
321
+ /**
322
+ * @returns restore details for the specified window.
323
+ */
324
+ GetRestoreDetails(windowName: string): string;
325
+
326
+ /**
327
+ * Loads saved restore details from {@link localStorage}.
328
+ */
329
+ LoadSavedDimensionStore(): void;
330
+
331
+ /**
332
+ * Deletes a popup.
333
+ */
334
+ RemoveTrackedPopup(popup: SteamPopup): void;
335
+
336
+ /**
337
+ * Saves restore details in {@link localStorage}.
338
+ */
339
+ SaveSavedDimensionStore(): void;
340
+
341
+ /**
342
+ * Sets the provided account ID for later usage with restore details.
343
+ *
344
+ * @param accountId SteamID 3
345
+ */
346
+ SetCurrentLoggedInAccountID(accountId: number): void;
347
+
348
+ /**
349
+ * Sets restore details for the specified popup.
350
+ */
351
+ SetRestoreDetails(popupName: string, restoreDetails: string, expires: boolean): void;
352
+ }
@@ -0,0 +1,36 @@
1
+ interface LockScreenSettings_t {
2
+ version: number;
3
+ bLockOnWake: boolean;
4
+ bLockOnLogin: boolean;
5
+ bLockDesktopMode: boolean;
6
+ strPIN: string;
7
+ strOwnerAccountName: string;
8
+ bUserForgotPin: boolean;
9
+ bShowResetPinModal: boolean;
10
+ }
11
+
12
+ interface ActiveLockScreenProps_t {
13
+ allowAnyPIN?: boolean;
14
+ closeModal?: () => void;
15
+ hideForgotPIN?: boolean;
16
+ preventCancel?: boolean;
17
+ preventSteamButtons?: boolean;
18
+ onSuccess?: () => void;
19
+ }
20
+
21
+ export declare class CSecurityStore {
22
+ BConsumeLockTocket(): boolean;
23
+ BResettingPIN(): boolean;
24
+ BShowResetPINModal(): boolean;
25
+ BeginPINReset(): Promise<void>;
26
+ ClearPIN(bShowResetPinModal: boolean): void;
27
+ ClearPINIfNotUsed(): void;
28
+ GetActiveLockScreenProps(): ActiveLockScreenProps_t | null;
29
+ GetSettings(): LockScreenSettings_t;
30
+ InitialLoginComplete(accountName: string): void;
31
+ IsLockScreenActive(): boolean;
32
+ ProvideLockTicket(value: boolean): void;
33
+ SetActiveLockScreenProps(props: ActiveLockScreenProps_t | null): void;
34
+ SetHasShownResetPINModal(): void;
35
+ SetSettings(settings: LockScreenSettings_t): void;
36
+ }