export interface UnlockDef { id: string; category?: string; } export type UnlockState = readonly string[]; export declare function hasUnlock(granted: UnlockState, unlockId: string): boolean; export declare function grantUnlock(granted: UnlockState, unlockId: string): string[]; export declare function unlockTree(defs: readonly UnlockDef[], categoryId: string): UnlockDef[]; export interface UnlockCatalog { has(unlockId: string): boolean; tree(categoryId: string): UnlockDef[]; } /** * A catalog of unlockable content gated behind conditions the player earns, tracking what is unlocked. * * @capability unlockables gate content behind unlock conditions the player earns */ export declare function createUnlockCatalog(defs?: readonly UnlockDef[]): UnlockCatalog; export interface Unlocks { has(userId: string, unlockId: string): boolean; grant(userId: string, unlockId: string): void; list(userId: string): string[]; tree(categoryId: string): UnlockDef[]; snapshot(userId: string): string[]; hydrate(userId: string, ids: string[]): void; /** Whole-store capture across every user — the world-save/replication seam (per-user `snapshot` can't enumerate users). */ snapshotAll(): Record; hydrateAll(data: Record): void; } export declare function createUnlocks(defs?: UnlockDef[]): Unlocks;