Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steam client reference #92

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f627b87
change: Add SteamClient types
FlashyReese Aug 27, 2023
d4e18c0
new: Document some SteamClient interfaces
FlashyReese Aug 27, 2023
1ed9b72
new: Document some SteamClient interfaces - part 2
FlashyReese Aug 28, 2023
82237e3
new: Document some SteamClient interfaces - part 3
FlashyReese Aug 28, 2023
484f01e
new: Document some SteamClient interfaces - part 4
FlashyReese Aug 29, 2023
2ac09e4
new: Document some SteamClient interfaces - part 5
FlashyReese Aug 30, 2023
87163f6
new: Document some SteamClient interfaces - part 6
FlashyReese Aug 30, 2023
06b0fb6
new: Document some SteamClient interfaces - part 7
FlashyReese Sep 1, 2023
db0b58a
change: Update interfaces to Steam Version 1691097434
FlashyReese Sep 1, 2023
eec1200
new: Document some SteamClient interfaces - part 8
FlashyReese Sep 2, 2023
be22953
new: Document some SteamClient interfaces - part 9
FlashyReese Sep 4, 2023
1980e07
change: Update interfaces to Steam Version 1694466342
FlashyReese Sep 12, 2023
339136d
new: Document some SteamClient interfaces - part 10
FlashyReese Sep 23, 2023
d6f16f6
new: Document some SteamClient interfaces - part 11
FlashyReese Sep 30, 2023
fffd0b5
new: Document some SteamClient interfaces - part 12
FlashyReese Oct 3, 2023
cc835dc
new: Document some SteamClient interfaces - part 13
FlashyReese Oct 4, 2023
a74109f
new: Document some SteamClient interfaces - part 14
FlashyReese Oct 16, 2023
8d845de
change: Update interfaces to Steam Version 1698260427
FlashyReese Oct 26, 2023
21747ef
new: Document some SteamClient interfaces - part 10
FlashyReese Sep 23, 2023
b23839e
change: Update interfaces to Steam Version 1700160213
FlashyReese Nov 17, 2023
93e8c31
docs(SteamClient): document some interfaces
ricewind012 Nov 26, 2023
67089bc
change: Fix formatting style
FlashyReese Nov 28, 2023
7263d28
docs(SteamClient): document protobufs & System.Report
ricewind012 Nov 30, 2023
b3c539f
docs(SteamClient): document CMsgMonitorInfo
ricewind012 Dec 1, 2023
217e5d4
docs(SteamClient): document remaining messages
ricewind012 Dec 14, 2023
54c4edb
docs(SteamClient): update interfaces to Steam Version 1702515219
ricewind012 Dec 14, 2023
d3bdf05
docs(SteamClient): update interfaces to Steam Version 1704329464
ricewind012 Jan 6, 2024
24e49f5
docs(SteamClient): update interfaces to Steam Version 1705630720
ricewind012 Jan 19, 2024
f7b346f
docs(SteamClient): update interfaces to Steam Version 1706914901
ricewind012 Feb 3, 2024
314e19c
docs(SteamClient): update interfaces to Steam Version 1709920887
ricewind012 Mar 9, 2024
caafb6c
docs(SteamClient): update interfaces to Steam Version 1710786209
ricewind012 Mar 21, 2024
620e033
docs(SteamClient): document even more interfaces
ricewind012 Mar 23, 2024
2ca0a37
new: Document some SteamClient interfaces - part 15
FlashyReese Mar 24, 2024
8bd92b5
Fix QAM button bit number
PartyWumpus Mar 24, 2024
cc40e81
new: Document some SteamClient interfaces - part 16
FlashyReese Apr 16, 2024
4a754b4
change: Update interfaces to Steam Version 1714854927
FlashyReese May 8, 2024
4293a21
change: Refactor and reorganize SteamClient
FlashyReese May 17, 2024
539e02f
docs(SteamClient): document more notification interfaces
ricewind012 Jun 2, 2024
761cdff
docs(SteamClient): document more interfaces
ricewind012 Jun 13, 2024
b62fed0
docs(SteamClient): add some descriptions
ricewind012 Jun 23, 2024
8102f28
docs(SteamClient): remove duplicate types
ricewind012 Jun 23, 2024
23f62d7
change: Fix rebase errors
FlashyReese Jun 29, 2024
e0b5c6c
Updated ControllerStateChange
isXander Jul 21, 2024
d8a1ac4
Fix typo
isXander Jul 21, 2024
35e17ab
Merge pull request #3 from isXander/patch-1
ricewind012 Jul 21, 2024
0351d83
docs(SteamClient): update interfaces to Steam Version 1723601482
ricewind012 Aug 14, 2024
a1ba6b3
docs(SteamClient): update interfaces to 1725654351
ricewind012 Sep 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,647 changes: 1,647 additions & 0 deletions src/deck-components/steam-client/App.ts

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions src/deck-components/steam-client/Auth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import {JsPbMessage} from "./index";
import {OSType} from "./system";

export interface Auth {
GetLocalHostname(): Promise<string>;

/**
* @returns 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,
}
59 changes: 59 additions & 0 deletions src/deck-components/steam-client/Broadcast.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import {Result, Unregisterable} from "./index";

export interface Broadcast {
/**
* Approves a viewer request for the broadcast.
* @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 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 callback The callback function to be called.
* @returns An object that can be used to unregister the callback.
*/
RegisterForBroadcastStatus(callback: (broadcastStatus: BroadcastStatus) => void): Unregisterable;

/**
* Registers a callback to be called when viewer requests are received.
* @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;

/**
* Rejects a viewer request for the broadcast.
* @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.
*/
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;
}
87 changes: 87 additions & 0 deletions src/deck-components/steam-client/Browser.ts
Original file line number Diff line number Diff line change
@@ -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.
*/
HideCursorUntilMouseEvent(): void;

/**
* yup that's right, clientY and clientX are reversed
*/
InspectElement(clientY: number, clientX: number): void;

NotifyUserActivation(): void;

OpenDevTools(): void;

/**
* Pastes the clipboard contents.
*/
Paste(): void;

/**
* @todo unconfirmed
*/
RegisterForGestureEvents(callback: (gesture: TouchGesture) => void): Unregisterable;

RegisterForOpenNewTab: Unregisterable;

ReplaceMisspelling: any;

/**
* Restarts the Steam JS context.
*/
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 url The URL of the file to download.
*/
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,
}
39 changes: 39 additions & 0 deletions src/deck-components/steam-client/ClientNotifications.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { BrowserContext } from "./index";

export interface ClientNotifications {
/**
* Displays a Steam notification.
* @param notification Notification type.
* @param options Stringified object of {@link SteamNotificationOptions}.
* @param callback
*/
DisplayClientNotification(
notification: ClientUINotificationType,
options: string,
callback: (context: BrowserContext) => void,
): void;

/**
* @param notificationId The ID of the notification to handle.
* @param handleAction `true` to execute the callback function associated with the notification, `false` otherwise.
*/
OnRespondToClientNotification(notificationId: number, handleAction: boolean): void;
}

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,
}
16 changes: 16 additions & 0 deletions src/deck-components/steam-client/Cloud.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export interface Cloud {
/**
* Resolves a synchronization conflict for an app in the cloud.
* @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 appId The ID of the app to retry syncing.
* @returns Returns data related to retrying the app sync.
*/
RetryAppSync(appId: number): void;
}
24 changes: 24 additions & 0 deletions src/deck-components/steam-client/CommunityItems.ts
Original file line number Diff line number Diff line change
@@ -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;
}
41 changes: 41 additions & 0 deletions src/deck-components/steam-client/Console.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import {Unregisterable} from "./index";

/**
* 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.
*/
ExecCommand(command: string): void;

/**
* Retrieves autocomplete suggestions for a given console command.
* @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 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;
}

/**
* 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";
}
12 changes: 12 additions & 0 deletions src/deck-components/steam-client/Customization.ts
Original file line number Diff line number Diff line change
@@ -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;
}
Loading