-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve type safety of FBadgeProgress, add SteamCommunityApiFacade, u…
…se BackgroundSender
- Loading branch information
Showing
6 changed files
with
87 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
interface TCardInfo { | ||
name: string; | ||
title: string; | ||
imgurl: string; | ||
arturl: string; | ||
owned: 0|1; | ||
markethash: string; | ||
} | ||
|
||
export interface TBadgeData { | ||
appid: number; | ||
border: 0|1; | ||
series: number; | ||
level: number; | ||
maxlevel: number; | ||
name: string; // empty if no badge level | ||
xp: number; | ||
nextlevelname: string; | ||
nextlevelxp: number; | ||
iconurl: string; | ||
bMaxed: null|unknown; | ||
rgCards: TCardInfo[] | ||
} | ||
|
||
export interface TFetchBadgeInfoMessage { | ||
action: "community.badgeinfo", | ||
params: { | ||
steamId: string, | ||
appid: number | ||
} | ||
} | ||
|
||
export interface TFetchBadgeInfoResponse { | ||
eresult: number, | ||
badgedata?: TBadgeData | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {BackgroundSender} from "../../../Core/BackgroundSimple"; | ||
import type {TFetchBadgeInfoMessage, TFetchBadgeInfoResponse} from "../../../Background/Modules/Community/_types"; | ||
|
||
export default class SteamCommunityApiFacade { | ||
|
||
static async fetchBadgeInfo(steamId: string, appid: number): Promise<TFetchBadgeInfoResponse> { | ||
return await BackgroundSender.send<TFetchBadgeInfoMessage, TFetchBadgeInfoResponse>({ | ||
action: "community.badgeinfo", | ||
params: {steamId, appid} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters