Skip to content

Commit

Permalink
docs(SteamClient): remove duplicate types
Browse files Browse the repository at this point in the history
  • Loading branch information
ricewind012 authored and FlashyReese committed Jun 29, 2024
1 parent b62fed0 commit 8102f28
Show file tree
Hide file tree
Showing 55 changed files with 737 additions and 870 deletions.
426 changes: 193 additions & 233 deletions src/deck-components/steam-client/App.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/deck-components/steam-client/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;

Expand Down Expand Up @@ -82,4 +82,4 @@ export enum GamingDeviceType {
Handheld = 512,
Phone = 528,
SteamDeck = 544,
}
}
27 changes: 13 additions & 14 deletions src/deck-components/steam-client/Broadcast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -57,4 +56,4 @@ export interface BroadcastStatus {
bMicrophoneActive: boolean;
nCurrentFPS: number;
nUploadKbps: number;
}
}
11 changes: 4 additions & 7 deletions src/deck-components/steam-client/Browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export interface Browser {

/**
* Hides the mouse cursor until input.
* @returns {void}
*/
HideCursorUntilMouseEvent(): void;

Expand All @@ -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;

Expand All @@ -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;
}
Expand All @@ -87,4 +84,4 @@ export enum TouchGestureType {
PinchEnd = 11,
FlingStart = 12,
FlingCancelled = 13,
}
}
10 changes: 5 additions & 5 deletions src/deck-components/steam-client/ClientNotifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -36,4 +36,4 @@ export enum ClientUINotificationType {
GroupChatMessage = 1,
FriendChatMessage = 2,
FriendPersonaState = 3,
}
}
12 changes: 6 additions & 6 deletions src/deck-components/steam-client/Cloud.ts
Original file line number Diff line number Diff line change
@@ -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;
}
}
2 changes: 1 addition & 1 deletion src/deck-components/steam-client/CommunityItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export interface CommunityItems {
GetItemAssetPath(communityItemId: string, param1: any, param2: string): any;

RemoveDownloadedItemAsset(communityItemId: string, param1: any, param2: string): any;
}
}
15 changes: 7 additions & 8 deletions src/deck-components/steam-client/Console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -39,4 +38,4 @@ export interface SpewOutput {
* The type or category of the spew output.
*/
spew_type: "error" | "info" | "input";
}
}
43 changes: 17 additions & 26 deletions src/deck-components/steam-client/Downloads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,90 +7,81 @@ 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;

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}
* @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;
}
Expand Down
6 changes: 3 additions & 3 deletions src/deck-components/steam-client/FamilySharing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>;

Expand Down Expand Up @@ -41,4 +41,4 @@ export interface Lender {
numDlc: number;
bPreferred: boolean;
vecDLC: any[];
}
}
10 changes: 5 additions & 5 deletions src/deck-components/steam-client/FriendSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -66,4 +66,4 @@ export interface FriendSettingsChange {
bDisableRoomEffects: number;
bAnimatedAvatars: number;
featuresEnabled: FriendSettingsEnabledFeature;
}
}
Loading

0 comments on commit 8102f28

Please sign in to comment.