export interface RepairMaterial { item: string; perPoint: number; } export interface RepairSpec { materials: readonly RepairMaterial[]; station?: string; qualityLossPerRepair?: number; } export interface DurabilitySpec { max: number; wearPerUse?: number; wearPerHit?: number; disableAtZero?: boolean; repair?: RepairSpec; } export interface DurabilityState { current: number; max: number; } export type WearKind = "use" | "hit"; export interface RepairCost { item: string; count: number; } export interface RepairQuote { materials: readonly RepairCost[]; restored: number; state: DurabilityState; } export declare function createDurability(spec: DurabilitySpec): DurabilityState; export declare function durabilityFraction(state: DurabilityState): number; export declare function isBroken(state: DurabilityState): boolean; export declare function isDisabled(spec: DurabilitySpec, state: DurabilityState): boolean; export declare function wearAmount(spec: DurabilitySpec, kind: WearKind): number; /** * Apply wear to an item, tracking breakage and repair eligibility. * * @capability durability track item wear, breakage, and repair */ export declare function applyWear(state: DurabilityState, amount: number): DurabilityState; export declare function wear(spec: DurabilitySpec, state: DurabilityState, kind: WearKind, times?: number): DurabilityState; export declare function canRepairAt(spec: DurabilitySpec, stationId?: string): boolean; export declare function repairQuote(spec: DurabilitySpec, state: DurabilityState, options?: { to?: number; station?: string; }): RepairQuote | null; export interface DurabilityTracker { init(instanceId: string, spec: DurabilitySpec): DurabilityState; get(instanceId: string): DurabilityState | null; set(instanceId: string, state: DurabilityState): void; wear(instanceId: string, spec: DurabilitySpec, kind: WearKind, times?: number): DurabilityState | null; isDisabled(instanceId: string, spec: DurabilitySpec): boolean; remove(instanceId: string): void; } export declare function createDurabilityTracker(): DurabilityTracker;