Files
decky-frontend-lib/src/globals/steam-client/shared.ts
Yao Chung Hu 131ab4cc11 feat(globals): Steam client reference (#92)
* change: Add SteamClient types

Steam Version:  1690583737
Steam Client Build Date:  Sat, Jul 29 02:44 UTC -08:00

* 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.

* new: Document some SteamClient interfaces - part 2

* new: Document some SteamClient interfaces - part 3

* new: Document some SteamClient interfaces - part 4

* new: Document some SteamClient interfaces - part 5

* new: Document some SteamClient interfaces - part 6

* new: Document some SteamClient interfaces - part 7

* change: Update interfaces to Steam Version 1691097434

Steam Version:  1691097434
Steam Client Build Date:  Fri, Aug 4 04:54 UTC -08:00

* new: Document some SteamClient interfaces - part 8

* new: Document some SteamClient interfaces - part 9

* change: Update interfaces to Steam Version 1694466342

Steam Version:  1694466342
Steam Client Build Date:  Tue, Sep 12 04:59 UTC +08:00

* new: Document some SteamClient interfaces - part 10

* new: Document some SteamClient interfaces - part 11

* new: Document some SteamClient interfaces - part 12

* new: Document some SteamClient interfaces - part 13

* new: Document some SteamClient interfaces - part 14

* change: Update interfaces to Steam Version 1698260427

Steam Version:  1698260427
Steam Client Build Date:  Thu, Oct 26 2:40 AM UTC -08:00

* new: Document some SteamClient interfaces - part 10

* change: Update interfaces to Steam Version 1700160213

Steam Version:  1700160213
Steam Client Build Date:  Fri, Nov 17 2:23 AM UTC +08:00

* docs(SteamClient): document some interfaces

* change: Fix formatting style

* docs(SteamClient): document protobufs & System.Report

* docs(SteamClient): document CMsgMonitorInfo

* docs(SteamClient): document remaining messages

* docs(SteamClient): update interfaces to Steam Version 1702515219
Steam Version:  1702515219
Steam Client Build Date:  Thu, Dec 14 00:36 UTC -08:00

* docs(SteamClient): update interfaces to Steam Version 1704329464
Steam Version:  1704329464
Steam Client Build Date:  Thu, Jan 4 12:23 AM UTC -08:00

* docs(SteamClient): update interfaces to Steam Version 1705630720
Steam Version:  1705630720
Steam Client Build Date:  Fri, Jan 19 1:58 AM UTC -08:00

* docs(SteamClient): update interfaces to Steam Version 1706914901
Steam Version:  1706914901
Steam Client Build Date:  Fri, Feb 2 8:46 PM UTC -08:00

* docs(SteamClient): update interfaces to Steam Version 1709920887
Steam Version:  1709920887
Steam Client Build Date:  Thu, Mar 7 5:29 PM UTC -08:00

* docs(SteamClient): update interfaces to Steam Version 1710786209
Steam Version:  1710786209
Steam Client Build Date:  Mon, Mar 18 7:07 PM UTC -08:00

* docs(SteamClient): document even more interfaces

* new: Document some SteamClient interfaces - part 15

* Fix QAM button bit number

* new: Document some SteamClient interfaces - part 16

* change: Update interfaces to Steam Version 1714854927

Steam Version: 1714854927
Steam Client Build Date:  Sat, May 4 7:11 AM UTC -08:00

* change: Refactor and reorganize SteamClient

* docs(SteamClient): document more notification interfaces

* docs(SteamClient): document more interfaces

* docs(SteamClient): add some descriptions

* docs(SteamClient): remove duplicate types

* change: Fix rebase errors

* Updated ControllerStateChange

* Fix typo

* docs(SteamClient): update interfaces to Steam Version 1723601482

Steam Version:  1723601482
Steam Client Build Date:  Wed, Aug 14 01:51 UTC -08:00

* docs(SteamClient): update interfaces to 1725654351

* docs(SteamClient): update interfaces to 1730416762

* docs(SteamClient): forgot some stuff

* docs(SteamClient): add missed interfaces

* docs(SteamClient): update enums

* docs(SteamClient): add some things and move stuff around

* docs(SteamClient): move shared enums/interfaces to a separate file

* docs(SteamClient): add more stuff

* docs(SteamClient): reword some things

* docs(SteamClient): new BrowserView things

* docs(SteamClient): review fixes

* move to src/globals

---------

Co-authored-by: ricewind012 <58827198+ricewind012@users.noreply.github.com>
Co-authored-by: Party Wumpus <48649272+PartyWumpus@users.noreply.github.com>
Co-authored-by: Xander <xander@isxander.dev>
2025-04-23 11:20:48 -04:00

263 lines
4.9 KiB
TypeScript

export enum EResult {
OK = 1,
Fail,
NoConnection,
InvalidPassword = 5,
LoggedInElsewhere,
InvalidProtocolVer,
InvalidParam,
FileNotFound,
Busy,
InvalidState,
InvalidName,
InvalidEmail,
DuplicateName,
AccessDenied,
Timeout,
Banned,
AccountNotFound,
InvalidSteamID,
ServiceUnavailable,
NotLoggedOn,
Pending,
EncryptionFailure,
InsufficientPrivilege,
LimitExceeded,
Revoked,
Expired,
AlreadyRedeemed,
DuplicateRequest,
AlreadyOwned,
IPNotFound,
PersistFailed,
LockingFailed,
LogonSessionReplaced,
ConnectFailed,
HandshakeFailed,
IOFailure,
RemoteDisconnect,
ShoppingCartNotFound,
Blocked,
Ignored,
NoMatch,
AccountDisabled,
ServiceReadOnly,
AccountNotFeatured,
AdministratorOK,
ContentVersion,
TryAnotherCM,
PasswordRequiredToKickSession,
AlreadyLoggedInElsewhere,
Suspended,
Cancelled,
DataCorruption,
DiskFull,
RemoteCallFailed,
PasswordUnset,
ExternalAccountUnlinked,
PSNTicketInvalid,
ExternalAccountAlreadyLinked,
RemoteFileConflict,
IllegalPassword,
SameAsPreviousValue,
AccountLogonDenied,
CannotUseOldPassword,
InvalidLoginAuthCode,
AccountLogonDeniedNoMail,
HardwareNotCapableOfIPT,
IPTInitError,
ParentalControlRestricted,
FacebookQueryError,
ExpiredLoginAuthCode,
IPLoginRestrictionFailed,
AccountLockedDown,
AccountLogonDeniedVerifiedEmailRequired,
NoMatchingURL,
BadResponse,
RequirePasswordReEntry,
ValueOutOfRange,
UnexpectedError,
Disabled,
InvalidCEGSubmission,
RestrictedDevice,
RegionLocked,
RateLimitExceeded,
AccountLoginDeniedNeedTwoFactor,
ItemDeleted,
AccountLoginDeniedThrottle,
TwoFactorCodeMismatch,
TwoFactorActivationCodeMismatch,
AccountAssociatedToMultiplePartners,
NotModified,
NoMobileDevice,
TimeNotSynced,
SmsCodeFailed,
AccountLimitExceeded,
AccountActivityLimitExceeded,
PhoneActivityLimitExceeded,
RefundToWallet,
EmailSendFailure,
NotSettled,
NeedCaptcha,
GSLTDenied,
GSOwnerDenied,
InvalidItemType,
IPBanned,
GSLTExpired,
InsufficientFunds,
TooManyPending,
NoSiteLicensesFound,
WGNetworkSendExceeded,
AccountNotFriends,
LimitedUserAccount,
}
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,
Offscreen_SteamUI = 12,
OpenVROverlay_Subview,
}
export enum ESteamRealm {
Unknown,
Global,
China,
}
/**
* Controls how Gamescope renders the GamepadUI window when a game is running.
*/
export enum EUIComposition {
/** Steam is not rendered on the screen. */
Hidden,
/**
* Transparent divs will allow pixels from the app behind Steam to penetrate.
* Input goes to **the app**.
*/
Notification,
/**
* Transparent divs will allow pixels from the app behind Steam to penetrate.
* Input goes to **Steam**.
*/
Overlay,
/** Take all of the pixels on the screen, nothing "behind" Steam is shown. */
Opaque,
/**
* Special composition mode that matches {@link Overlay}, but forwards synthetic keyboard
* events to the Gamescope foreground app (game) instead of Steam.
*/
OverlayKeyboard,
}
export enum EUIMode {
Unknown = -1,
GamePad = 4,
Desktop = 7,
}
/** 0 - false, 1 - true */
export type VDFBoolean_t = 0 | 1;
export interface BrowserContext {
/**
* Window type.
*/
m_eBrowserType?: EBrowserType;
/**
* The UI mode in use.
*/
m_eUIMode?: EUIMode;
/**
* @todo Appears when {@link m_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.
*/
export interface OperationResponse {
/**
* The result code of the operation.
*/
result: EResult;
/**
* An unlocalized message describing the result of the operation.
*/
message: string;
}
export interface Unregisterable {
/**
* Unregister the callback.
*/
unregister(): void;
}
/**
* ProtoBuf message class.
*/
export interface JsPbMessageClass {
/**
* @todo Returns {@link JsPbMessage}, but not sure how to do it for the messages.
*/
deserializeBinary(data: ArrayBuffer): any;
}
/**
* Deserialized ProtoBuf message.
*/
export interface JsPbMessage {
getClassName(): string;
serializeBase64String(): string;
serializeBinary(): Uint8Array;
/**
* Converts the message to an object.
*/
toObject(includeJsPbInstance: boolean): any;
}