@retroachievements/api
Version:
A well-tested library that lets you get achievement, user, and game data from RetroAchievements.
51 lines (50 loc) • 1.44 kB
TypeScript
import type { AuthObject, AwardKind } from "../utils/public";
import type { RecentGameAwards } from "./models";
/**
* A call to this function will retrieve all recently granted game
* awards across the site's userbase.
*
* @param authorization An object containing your username and webApiKey.
* This can be constructed with `buildAuthorization()`.
*
* @param payload.startDate The date to fetch awards from.
*
* @param payload.offset Optional. Defaults to 0.
*
* @param payload.count Optional. Defaults to 25.
*
* @param payload.desiredAwardKinds Optional. Defaults to all. Accepts "beaten-softcore", "beaten-hardcore", "completed", and/or "mastered".
*
* @example
* ```
* const recentGameAwards = await getRecentGameAwards(
* authorization,
* );
* ```
*
* @returns An object containing metadata about all recently granted game
* awards across the site's userbase
* ```
* {
* count: 1,
* total: 1,
* results: [
* {
* user: "renanbrj",
* awardKind: "mastered",
* awardDate: "2022-01-01T23:48:04+00:00",
* gameId: 14_284,
* gameTitle: "Batman Returns",
* consoleId: 15,
* consoleName: "Game Gear",
* },
* ],
* }
* ```
*/
export declare const getRecentGameAwards: (authorization: AuthObject, payload?: Partial<{
startDate: string;
offset: number;
count: number;
desiredAwardKinds: AwardKind[];
}>) => Promise<RecentGameAwards>;