/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * What a Table cell's Chooser offers (`Allocation Spec.md` A48), pure: an * arrival cell's arrivals and a resource cell's resources, in sections, each * option's line and its state the fit's answer (F4). The board's own words say * only what the answer does not: the current choice, an arrival's meta, and * where an arrival already on the board is. * * @packageDocumentation */ import type { ChooserSection } from "@elaraai/east-ui-components/internal"; import type { option } from "@elaraai/east"; import { type Context, type Day, type FitResult } from "./model.js"; import { type Nouns } from "./nouns.js"; /** The words a Chooser's lines are written with: a quantity with its unit and without, and a lane's name. */ export interface ChoiceWords { quantity: (value: number) => string; number: (value: number) => string; lane: (key: string) => string; /** The board's words for what it holds; the defaults' with none given. */ nouns?: Nouns | undefined; } /** * An arrival cell's Chooser (A48): the row's own arrival (Current), the * arrivals the plan has not booked — fitting the row's resource, or all of * them where the row has none — those that don't fit, and the arrivals * already on the board, which cannot be chosen; of the arrivals the narrowing * shows (#1339), as the rest of the board shows them. The current one is * offered whatever it hides. Onto a resource, an arrival the fit's answer * names no verdict for has none, and is left out (east-workspace#1624, rule * 6), as a resource is from a resource cell's, and from a reservation's Book * list (`arrivalVerdict`); while the answer is on its way each reads `checking * fits…`, and where none is coming `fits unavailable · …` (F3, rule 10). * * @param args - The row and what the board knows * @returns The sections, in order */ export declare function arrivalChoices(args: { plan: Day; context: Context; day: Date; words: ChoiceWords; /** The row's bin, when it shows one (a bin or a reservation). */ bin: string | undefined; /** The resource the row's bin is on, if any: what the arrivals are asked onto. */ resource: string | undefined; /** The fit's answer to `take` the resource, asked of the day without the row's bin. */ answer: FitResult | undefined; /** Why no answer is coming (`fitFailure`): each arrival says so, and none can be chosen; `undefined` while one may come. */ failure?: string | undefined; /** The arrivals the narrowing shows; `none`, every one. */ shown?: option> | undefined; }): ChooserSection[]; /** * A resource cell's Chooser (A48): the row's resource (Current), the * resources that fit — `Gaps that fit` a bin, `Can be reserved` for a free row * or a reservation — best first, and those that don't; of the resources the * narrowing shows, as a drop lands only on a shown row (#1336). A split's * (A71) leaves out the resources the bin is on already: each is a part of it. * * @param args - The row and what the board knows * @returns The sections, in order */ export declare function resourceChoices(args: { context: Context; words: ChoiceWords; /** Whether the row is a bin with an arrival: its fits are gaps, a free row's or a reservation's reservations. */ binRow: boolean; /** The resource the row's bin is on, if any. */ current: string | undefined; /** The fit's answer to placing the row's bin, or a reservation in its slot. */ answer: FitResult | undefined; /** Why no answer is coming (`fitFailure`): each resource says so, and none can be chosen; `undefined` while one may come. */ failure?: string | undefined; /** The resources the narrowing shows; `none`, every one. The current one is offered whatever it hides. */ shown: option>; /** Resources not to offer: a split's bin's own (A71). */ except?: ReadonlySet | undefined; }): ChooserSection[]; //# sourceMappingURL=choices.d.ts.map