import type { AppType } from './app.js';
export declare const PLAYER_META_KEY_REGEX: RegExp;
export declare const PLAYER_META_DEFINITION_STATUS_VALUES: readonly ["ACTIVE", "RETIRED"];
export type PlayerMetaDefinitionStatus = (typeof PLAYER_META_DEFINITION_STATUS_VALUES)[number];
export declare const APP_ACHIEVEMENT_KIND_VALUES: readonly ["STANDARD", "INCREMENTAL"];
export type AppAchievementKind = (typeof APP_ACHIEVEMENT_KIND_VALUES)[number];
export declare const APP_LEADERBOARD_SCORE_TYPE_VALUES: readonly ["INTEGER", "TIME_MS"];
export type AppLeaderboardScoreType = (typeof APP_LEADERBOARD_SCORE_TYPE_VALUES)[number];
export declare const APP_LEADERBOARD_SORT_VALUES: readonly ["DESC", "ASC"];
export type AppLeaderboardSort = (typeof APP_LEADERBOARD_SORT_VALUES)[number];
export declare const PLAYER_META_ERROR_CODE_VALUES: readonly ["E_AUTH_REQUIRED", "E_RUNTIME_AUTH_REQUIRED", "E_META_NOT_FOUND", "E_META_RETIRED", "E_META_INVALID_KEY", "E_META_INVALID_DEFINITION", "E_INVALID_ARGUMENT", "E_SCORE_INVALID", "E_PROGRESS_INVALID", "E_FEATURE_KIND_MISMATCH", "E_RATE_LIMITED"];
export type PlayerMetaErrorCode = (typeof PLAYER_META_ERROR_CODE_VALUES)[number];
export interface AppAchievementCatalogueDefinition {
    key: string;
    displayName: string;
    description: string;
    kind: AppAchievementKind;
    hidden?: boolean;
    maxProgress?: number;
    icon: string;
    status?: PlayerMetaDefinitionStatus;
}
export interface AppLeaderboardCatalogueDefinition {
    key: string;
    displayName: string;
    description: string;
    scoreType: AppLeaderboardScoreType;
    sort: AppLeaderboardSort;
    unitLabel?: string;
    status?: PlayerMetaDefinitionStatus;
}
export interface AppAchievementDefinition {
    key: string;
    displayName: string;
    description: string;
    kind: AppAchievementKind;
    hidden: boolean;
    maxProgress: number | null;
    iconUrl: string;
    status: PlayerMetaDefinitionStatus;
}
export interface AppLeaderboardDefinition {
    key: string;
    displayName: string;
    description: string;
    scoreType: AppLeaderboardScoreType;
    sort: AppLeaderboardSort;
    unitLabel?: string;
    status: PlayerMetaDefinitionStatus;
}
export interface AppAchievementPlayerState {
    progress: number;
    unlocked: boolean;
    unlockedAt: string | null;
}
export interface AppLeaderboardPlayerSummary {
    hasScore: boolean;
    bestScore: number | null;
    rank: number | null;
    bestScoreAt: string | null;
}
export interface AchievementView {
    definition: AppAchievementDefinition;
    player: AppAchievementPlayerState | null;
}
export interface LeaderboardSummary {
    definition: AppLeaderboardDefinition;
    player: AppLeaderboardPlayerSummary | null;
}
export interface LeaderboardEntryUser {
    publicPlayerId: string;
    username?: string;
    displayName: string;
    avatarUrl?: string;
    profilePath?: string;
}
export interface LeaderboardEntry {
    rank: number;
    score: number;
    bestScoreAt: string;
    isCurrentPlayer?: boolean;
    user: LeaderboardEntryUser;
}
export interface LeaderboardView {
    definition: AppLeaderboardDefinition;
    top: LeaderboardEntry[];
    player: AppLeaderboardPlayerSummary | null;
    playerEntry: LeaderboardEntry | null;
    aroundPlayer: LeaderboardEntry[];
}
export interface ListAchievementsRequest {
    includeHiddenDefinitions?: boolean;
    includeRetired?: boolean;
}
export interface ListAchievementsResponse {
    achievements: AchievementView[];
}
export interface GetAchievementResponse {
    achievement: AchievementView;
}
export interface AppAchievementMutationSummary {
    key: string;
    displayName: string;
    iconUrl: string;
}
export interface UnlockAchievementResponse {
    accepted: true;
    changed: boolean;
    unlocked: boolean;
    progress: number;
    unlockedAt: string | null;
    achievement: AppAchievementMutationSummary;
}
export interface SetAchievementProgressRequest {
    progress: number;
}
export interface SetAchievementProgressResponse {
    accepted: true;
    changed: boolean;
    unlocked: boolean;
    progress: number;
    unlockedAt: string | null;
    achievement: AppAchievementMutationSummary;
}
export interface ListLeaderboardsRequest {
    includeRetired?: boolean;
}
export interface ListLeaderboardsResponse {
    leaderboards: LeaderboardSummary[];
}
export interface GetLeaderboardRequest {
    top?: number;
    aroundMe?: number;
    includeRetired?: boolean;
}
export interface GetLeaderboardResponse {
    leaderboard: LeaderboardView;
}
export interface AppLeaderboardMutationSummary {
    key: string;
    displayName: string;
    scoreType: AppLeaderboardScoreType;
    unitLabel?: string;
}
export interface SubmitLeaderboardScoreRequest {
    score: number;
}
export interface SubmitLeaderboardScoreResponse {
    accepted: true;
    improved: boolean;
    previousBestScore: number | null;
    bestScore: number;
    rank: number | null;
    previousRank: number | null;
    bestScoreAt: string;
    leaderboard: AppLeaderboardMutationSummary;
}
export interface RuntimeAchievementUnlockedNotificationPayload {
    kind: 'achievement_unlocked';
    achievement: AppAchievementMutationSummary;
}
export interface RuntimeLeaderboardHighScoreNotificationPayload {
    kind: 'leaderboard_high_score';
    leaderboard: AppLeaderboardMutationSummary;
    previousBestScore: number | null;
    bestScore: number;
    previousRank: number | null;
    rank: number | null;
}
export type RuntimePlayerMetaNotificationPayload = RuntimeAchievementUnlockedNotificationPayload | RuntimeLeaderboardHighScoreNotificationPayload;
export interface PlayerMetaAppSummary {
    id: number;
    name: string;
    displayName: string;
    creatorUsername: string;
    type: AppType;
    iconUrl: string | null;
}
export interface MyAchievementAppSection {
    app: PlayerMetaAppSummary;
    achievements: AchievementView[];
}
export interface MyLeaderboardAppSection {
    app: PlayerMetaAppSummary;
    leaderboards: LeaderboardSummary[];
}
export interface MyAchievementsResponse {
    apps: MyAchievementAppSection[];
}
export interface MyLeaderboardsResponse {
    apps: MyLeaderboardAppSection[];
}
export interface AdminPlayerMetaUserSummary {
    id: number;
    username: string;
    displayName: string;
}
export interface AdminAppPlayerMetaResponse {
    app: PlayerMetaAppSummary;
    achievements: AchievementView[];
    leaderboards: LeaderboardSummary[];
}
export interface AdminAppPlayerMetaUserResponse {
    app: PlayerMetaAppSummary;
    user: AdminPlayerMetaUserSummary;
    achievements: AchievementView[];
    leaderboards: LeaderboardSummary[];
}
export declare const ADMIN_ACHIEVEMENT_MUTATION_ACTION_VALUES: readonly ["grant", "revoke", "reset"];
export type AdminAchievementMutationAction = (typeof ADMIN_ACHIEVEMENT_MUTATION_ACTION_VALUES)[number];
export interface AdminMutateAchievementStateRequest {
    action: AdminAchievementMutationAction;
}
export interface AdminMutateAchievementStateResponse {
    achievement: AchievementView;
}
export declare const ADMIN_LEADERBOARD_MUTATION_ACTION_VALUES: readonly ["reset", "remove"];
export type AdminLeaderboardMutationAction = (typeof ADMIN_LEADERBOARD_MUTATION_ACTION_VALUES)[number];
export interface AdminMutateLeaderboardScoreRequest {
    action: AdminLeaderboardMutationAction;
}
export interface AdminMutateLeaderboardScoreResponse {
    leaderboard: LeaderboardSummary;
}
export interface AdminRetirePlayerMetaDefinitionResponse {
    success: true;
}
export declare function isPlayerMetaKey(value: unknown): value is string;
export declare function parsePlayerMetaDefinitionStatus(value: unknown): PlayerMetaDefinitionStatus | null;
export declare function parseAppAchievementKind(value: unknown): AppAchievementKind | null;
export declare function parseAppLeaderboardScoreType(value: unknown): AppLeaderboardScoreType | null;
export declare function parseAppLeaderboardSort(value: unknown): AppLeaderboardSort | null;
export declare function parseAdminAchievementMutationAction(value: unknown): AdminAchievementMutationAction | null;
export declare function parseAdminLeaderboardMutationAction(value: unknown): AdminLeaderboardMutationAction | null;
export declare function isSafeNonNegativeInteger(value: unknown): value is number;
export declare function isSafePositiveInteger(value: unknown): value is number;
export declare function isValidLeaderboardDefinitionCombination(scoreType: AppLeaderboardScoreType, sort: AppLeaderboardSort): boolean;
export declare function computeAchievementProgressPercent(progress: number, maxProgress: number): number;
export declare function formatLeaderboardScore(score: number, scoreType: AppLeaderboardScoreType, unitLabel?: string): string;
//# sourceMappingURL=player-meta.d.ts.map