import { HotbarEntry, HotbarEntryPresentation } from '@rpgjs/common'; import { RpgPlayer } from '../Player/Player'; import { HotbarConfiguration } from '../Player/HotbarManager'; import { Gui } from './Gui'; /** Authoritative use request passed to a custom `showHotbar()` handler. */ export interface HotbarUseRequest { /** Zero-based slot requested by the client. */ slot: number; /** Entry stored in the slot at request time. */ entry: HotbarEntry; /** Optional targeting data supplied by a client activation handler. */ target?: unknown; } /** Short-lived visual feedback sent to the built-in client component. */ export interface HotbarActionFeedback { /** Monotonic value used to replay feedback for repeated actions. */ revision: number; /** Zero-based slot receiving feedback. */ slot: number; /** Result rendered by the client animation. */ status: "used" | "selected" | "rejected"; } /** Options accepted by `player.showHotbar()`. */ export interface HotbarGuiOptions extends HotbarConfiguration { /** * Initialize from the player's loadout when opening or refreshing. * @default true */ autoInitialize?: boolean; /** * Optional authoritative override for entry execution. * * Return `false` to reject the action. The server still owns validation and * gameplay state. */ onUse?: (player: RpgPlayer, request: HotbarUseRequest) => unknown | Promise; /** Customize the serializable presentation for this GUI instance. */ transformEntry?: (player: RpgPlayer, entry: HotbarEntry, presentation: HotbarEntryPresentation) => HotbarEntryPresentation; } /** * Build the renderer-neutral data contract consumed by `rpg-hotbar`. * * @param player - Player receiving the GUI. * @param options - Capacity, presentation, and use options. * @param feedback - Optional transient interaction feedback. * @returns Serializable state, allowed built-in assignment types, and ten * presentation slots. */ export declare const buildPlayerHotbarData: (player: RpgPlayer, options?: HotbarGuiOptions, feedback?: HotbarActionFeedback) => { hotbar: import('@rpgjs/common').HotbarState; capacity: number; activeSlot: number | null; allowedEntryTypes: string[]; slots: ({ index: number; type: "empty"; entry: null; usable: boolean; locked: boolean; lockedHint: string | undefined; } | { entry: HotbarEntry; usable: boolean; locked: boolean; lockedHint: string | undefined; id: string; type: string; name: string; description?: string; icon?: string; quantity?: number; cost?: { value: number; label: string; }; badge?: string; cooldownMs?: number; readyAt?: number; activation: { mode: import('@rpgjs/common').HotbarActivationMode; handler?: string; payload?: Record; }; index: number; })[]; feedback: HotbarActionFeedback | undefined; }; export declare class HotbarGui extends Gui { private options; private feedbackRevision; private feedback?; private ready; private initializing; constructor(player: RpgPlayer); configure(options?: HotbarGuiOptions): void; refresh(clientActionId?: string): void; private setFeedback; open(options?: HotbarGuiOptions): Promise; }