import type { RecipeItem } from "./recipe.js"; export interface ProductionBuildingDef { id: string; inputs: readonly RecipeItem[]; outputs: readonly RecipeItem[]; rate: number; power?: number; bufferMultiplier?: number; } export interface ProductionBuildingConfig { id: string; inputs?: readonly RecipeItem[]; outputs: readonly RecipeItem[]; rate: number; power?: number; bufferMultiplier?: number; } export type ItemCounts = Readonly>; export interface ProductionState { buffer: ItemCounts; output: ItemCounts; progress: number; active: boolean; } export interface ProductionTickInput { dt: number; powered?: boolean; } export declare function productionBuilding(config: ProductionBuildingConfig): ProductionBuildingDef; /** * A production building that converts input items into outputs over time — factory/crafting station. * * @capability production-building a factory building converting inputs to outputs over time */ export declare function createProductionState(): ProductionState; export declare function acceptsInput(def: ProductionBuildingDef, state: ProductionState, itemId: string): boolean; export declare function feedProduction(def: ProductionBuildingDef, state: ProductionState, itemId: string, count: number): { state: ProductionState; accepted: number; }; export declare function drainOutput(state: ProductionState, itemId: string, count?: number): { state: ProductionState; taken: number; }; export declare function tickProduction(def: ProductionBuildingDef, state: ProductionState, input: ProductionTickInput): ProductionState; export interface TransportItem { itemId: string; count: number; position: number; } export interface TransportPath { length: number; speed: number; } export declare function advanceTransport(path: TransportPath, items: readonly TransportItem[], dt: number): { items: TransportItem[]; delivered: TransportItem[]; }; export interface PowerConsumer { id: string; demand: number; } export interface PowerGridResult { powered: ReadonlySet; supply: number; demand: number; deficit: number; } export declare function resolvePowerGrid(supply: number, consumers: readonly PowerConsumer[]): PowerGridResult;