@peacockproject/core
Version:
Type definitions for Peacock's core.
48 lines (47 loc) • 1.79 kB
TypeScript
import type { GameVersion, Unlockable } from "./types/types";
export declare const ISOLATED_UNLOCKABLES_EXEMPT: string[];
/**
* An inventory item.
*/
export interface InventoryItem {
InstanceId: string;
ProfileId: string;
Unlockable: Unlockable;
Properties: Record<string, string>;
}
/**
* Clears a user's inventory.
*
* @param userId The user's ID.
*/
export declare function clearInventoryFor(userId: string): void;
/**
* Clears the entire inventory cache.
*/
export declare function clearInventoryCache(): void;
/**
* Get an unlockable by its ID, lazy-loading the unlockable cache if necessary.
*
* @param id The unlockable's ID.
* @param gameVersion The current game version.
* @see getUnlockablesById
*/
export declare function getUnlockableById(id: string, gameVersion: GameVersion): Unlockable | undefined;
/**
* Multi-getter for unlockables.
*
* @param ids The unlockable IDs to get.
* @param gameVersion The current game version.
* @see getUnlockableById
*/
export declare function getUnlockablesById(ids: string[], gameVersion: GameVersion): (Unlockable | undefined)[];
/**
* Generate a player's inventory with unlockables.
* @param profileId The profile ID of the player
* @param gameVersion The game version
* @param sublocation The sublocation to generate the inventory for. Used to award default suits for the sublocation. Defaulted to undefined.
* @param suitOverride A default suit override for this contract. Defaulted to undefined.
* @returns The player's inventory
*/
export declare function createInventory(profileId: string, gameVersion: GameVersion, sublocation?: Unlockable | undefined, suitOverride?: string | undefined): InventoryItem[];
export declare function grantDrops(profileId: string, drops: Unlockable[]): void;