@peacockproject/core
Version:
Type definitions for Peacock's core.
23 lines (22 loc) • 1.04 kB
TypeScript
import { ContractSession, GameVersion, SaveFile, UserProfile } from "./types/types";
declare const profileRouter: import("express-serve-static-core").Router;
export interface FakePlayer {
id: string;
name: string;
platformId: string;
platform: string;
}
/**
* The fake player registry allows us to translate another user's
* profile ID to their name, for leaderboards.
*/
export declare const fakePlayerRegistry: {
players: FakePlayer[];
getFromId(id: string): FakePlayer | undefined;
index(name: string, platform: string, platformId: string, requestedId?: string): string;
};
export declare function resolveProfiles(profileIDs: string[], gameVersion: GameVersion): Promise<UserProfile[]>;
export declare function getErrorMessage(error: unknown): string;
export declare function saveSession(save: SaveFile, userData: UserProfile): Promise<void>;
export declare function loadSession(sessionId: string, token: string, userData: UserProfile, sessionData?: ContractSession): Promise<void>;
export { profileRouter };