import type { RecipeItem } from "./recipe.js"; export type SoilState = "untilled" | "tilled"; export interface CropDef { id: string; stages: readonly number[]; regrowDays?: number; needsDailyWater?: boolean; harvest?: RecipeItem; } export interface CropTileState { soil: SoilState; watered: boolean; cropId: string | null; stage: number; stageProgress: number; harvestable: boolean; } export type CropCatalog = (cropId: string) => CropDef | null; /** @internal */ export declare function emptyTile(): CropTileState; /** @internal */ export declare function canTill(state: CropTileState): boolean; /** @internal */ export declare function tillTile(state: CropTileState): CropTileState; /** @internal */ export declare function canPlant(state: CropTileState): boolean; /** @internal */ export declare function plantCrop(state: CropTileState, cropId: string): CropTileState; /** @internal */ export declare function waterTile(state: CropTileState): CropTileState; /** @internal */ export declare function maturityDays(def: CropDef): number; /** @internal */ export declare function advanceCropDay(def: CropDef, state: CropTileState): CropTileState; export interface HarvestResult { state: CropTileState; yield: RecipeItem | null; } /** @internal */ export declare function harvestCrop(def: CropDef, state: CropTileState): HarvestResult; export type TileCoord = readonly [number, number]; export type TilePattern = readonly TileCoord[]; /** @internal */ export declare function tileKey(coord: TileCoord): string; /** @internal */ export declare function singleTile(): TilePattern; /** @internal */ export declare function squarePattern(radius: number): TilePattern; /** @internal */ export declare function diamondPattern(radius: number): TilePattern; /** @internal */ export declare function rectPattern(width: number, depth: number): TilePattern; /** @internal */ export declare function patternAt(center: TileCoord, pattern: TilePattern): TileCoord[]; export interface ApplyToolResult { tiles: Map; changed: TileCoord[]; } /** @internal */ export declare function applyToolToTiles(tiles: ReadonlyMap, center: TileCoord, pattern: TilePattern, apply: (state: CropTileState, coord: TileCoord) => CropTileState, fill?: () => CropTileState): ApplyToolResult; export interface DayTicker { tick(currentDay: number): number; day(): number; } /** @internal */ export declare function createDayTicker(startDay?: number): DayTicker; export interface CropField { get(coord: TileCoord): CropTileState; till(coord: TileCoord, pattern?: TilePattern): TileCoord[]; plant(coord: TileCoord, cropId: string): boolean; water(coord: TileCoord, pattern?: TilePattern): TileCoord[]; harvest(coord: TileCoord): RecipeItem | null; advanceDay(days?: number): void; tiles(): ReadonlyMap; } /** @internal */ export declare function createCropField(catalog?: CropCatalog): CropField;