/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type SortedMap, type option } from "@elaraai/east"; import type { PeriodRead } from "../shared/loading.js"; import { type AllocationNarrowed } from "./narrowed.js"; import type { AllocationOptimised } from "./optimise.js"; import { type ChoiceScene } from "./table.js"; import type { TimelineFollow } from "./timeline.js"; import { type AllocationStyles, type AllocationValue, type Bin, type Day, type Load, type ResourceLine, type Selection, type Slot } from "./model.js"; /** The cards' props: what a cell's Chooser reads, and the board's drafts, figures, selection and commands. */ export interface CardsProps extends ChoiceScene { value: AllocationValue; styles: AllocationStyles; /** The day as the record holds it: what a draft differs from. */ held: Day | undefined; sameBin: (a: Bin, b: Bin) => boolean; /** Whether a bin holds a conflict not yet chosen: it wears the warn ring. None by default. */ conflicted?: ((id: string) => boolean) | undefined; /** Whether a bin's row breaks its form's bounds (#1585), stored or changed: it wears the warn ring too. None by default. */ bounded?: ((id: string) => boolean) | undefined; loads: SortedMap; /** Each resource's line on the day (A19). */ lines: ReadonlyMap; slots: readonly Slot[]; /** Which layout the cards stand for. */ layout: "timeline" | "table"; /** The board's drag surface: the Table's bands keep their folds by it, the cards' with them. */ surface: string; selection: Selection | undefined; /** An explicit inspection: what a card's head selects. */ select: (next: Selection | undefined) => void; /** Selecting follows the selection (A12): its card scrolls into view. */ follow: TimelineFollow; /** Whether the day takes edits: with none, the cards have no actions. */ editable: boolean; /** The lanes the narrowing shows, by key; `none` for every one. */ visibleLanes: option>; /** The sources a choice of the viewer's narrows, and its Clear filters, where nothing shows; `undefined` with no choice (#1621). */ narrowed: AllocationNarrowed | undefined; /** Books an arrival onto a resource at the day's first free slot (A36), as a drop on its row does. */ bookOnto: (arrival: string, resource: string) => void; /** * What the cards draw of the day's read (#1398): the day as read; a day not read yet — the day without its bins handed * in as `plan`, each card's contents placeholders once the reveal says so; or one whose read failed — the failure said * once, in the first card in view. */ read: PeriodRead; /** What the runs of the app's optimiser left on the day's bins (#1409): each bin's operation, drawn on its card, and its provenance on hover. */ optimised?: AllocationOptimised | undefined; /** Whether a run's highlight is on (#1409): a band's count flashes where the run changed its rows. */ lit?: boolean | undefined; } /** * The narrow layout (see the module docs). * * @param props - See {@link CardsProps} * @returns A card per resource (the Timeline's), or per row (the Table's) */ export declare function AllocationCards(props: CardsProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=cards.d.ts.map