export interface MountSlotDef { id: string; accepts: string | readonly string[]; required?: boolean; } export interface ModularItemDef { id: string; baseStats: Record; slots: readonly MountSlotDef[]; } export interface PartDef { id: string; category: string; stats?: Record; multipliers?: Record; } export interface InstalledPart { slotId: string; part: PartDef; } export type InstallResult = { status: "ok"; installed: readonly InstalledPart[]; } | { status: "rejected"; reason: "unknown-slot" | "wrong-category" | "slot-occupied"; }; export declare function slotById(def: ModularItemDef, slotId: string): MountSlotDef | null; /** * Attach parts into an item's mount slots and resolve the combined stats. * * @capability modular-item attach parts into item mount slots to compute combined stats */ export declare function slotAccepts(slot: MountSlotDef, category: string): boolean; export declare function install(def: ModularItemDef, installed: readonly InstalledPart[], slotId: string, part: PartDef): InstallResult; export declare function uninstall(installed: readonly InstalledPart[], slotId: string): readonly InstalledPart[]; export declare function partInSlot(installed: readonly InstalledPart[], slotId: string): PartDef | null; export declare function computeEffectiveStats(def: ModularItemDef, installed: readonly InstalledPart[]): Record; export declare function missingRequiredSlots(def: ModularItemDef, installed: readonly InstalledPart[]): string[]; export declare function isComplete(def: ModularItemDef, installed: readonly InstalledPart[]): boolean; export interface ModularItem { readonly def: ModularItemDef; parts(): readonly InstalledPart[]; install(slotId: string, part: PartDef): InstallResult; uninstall(slotId: string): readonly InstalledPart[]; partInSlot(slotId: string): PartDef | null; effectiveStats(): Record; missingRequired(): string[]; isComplete(): boolean; } export declare function createModularItem(def: ModularItemDef, initial?: readonly InstalledPart[]): ModularItem;