/** * 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 BuilderFrameDock, type EditIssue } from "@elaraai/east-ui-components"; import type { PeriodRead } from "../shared/loading.js"; import { type AllocationCommands } from "./actions.js"; import { type AllocationDrag, type Refusal, type Target } from "./drag.js"; import { type AllocationFit } from "./fit.js"; import type { AllocationMessages } from "./messages.js"; import { type AllocationDomain, type AllocationValue, type Context, type Day, type Issue, type Load, type ResourceLine, type Selection, type Slot } from "./model.js"; /** * A refusal holding Save (#1525), as the board says it: the app's `ready` refusing a drafted bin, named by its code — * or by its key, for a bin the board can't read — and its field by its form's label. */ export interface AllocationRefusal { /** The bin kind's slot, or the record's key, whose session refuses. */ readonly kind: string; /** The refusal's issue: its entry's key's text, its field and the app's message. */ readonly issue: EditIssue; /** Its bin in words: its code, `LD-2231`. */ readonly title: string; /** Its field and the app's message: `Grade: Choose the grade`. */ readonly text: string; } /** The Inspector's args: what the board knows, and what it can do. */ export interface InspectorArgs { value: AllocationValue; domain: AllocationDomain; context: Context; /** The plan day. */ day: Date; /** The day as drafted, and as the record holds it. */ plan: Day; held: Day | undefined; loads: SortedMap; lines: ReadonlyMap; slots: readonly Slot[]; /** Every issue: the built-in checks', then the app's. */ issues: readonly Issue[]; layout: "timeline" | "table"; selection: Selection | undefined; /** An inspection: what a click in the inspector selects, showing it in Details (A8). */ inspect: (next: Selection) => void; drag: AllocationDrag; fit: AllocationFit; commands: AllocationCommands; /** Whether what main shows is retained while a narrowing of it is read, or one failed (#1398, CL8): Details' fields, and its buttons that edit, are off. */ retained: boolean; /** The day without a bin, and with a probe reservation in a free slot: what a reservation's and a free slot's questions are asked of. */ without: (bin: string) => Day; reserving: (lane: string, at: Date) => Day; /** What the narrowing shows of each source; `none`, every row. */ shown: { lanes: option>; resources: option>; arrivals: option>; }; /** A refused drop's reason (A40), and its dismissal. */ refusal: Refusal | undefined; dismissRefusal: () => void; /** The bin whose resource Chooser is open in the pane (A8, A21, A64), and opening or closing it. */ chooser: string | undefined; setChooser: (bin: string | undefined) => void; /** Books the picked arrival onto a resource, as a click on a ranked resource does (A11, A36). */ book: (target: Target) => void; /** The day's first free slot, of the lanes that show (A36). */ firstFree: () => { lane: string; at: Date; } | undefined; /** The open tab, the board's. */ tab: string; onTab: (tab: string) => void; storageKey: string; /** Finds a fit for a bin's unallocated quantity (A74, #1332): with none — no Library's Resources tab to show the fits in — nothing offers it. */ onFind?: ((bin: string) => void) | undefined; /** Whether a bin's find is asked and its answer for the drafts as they are is on its way: its button reads `Finding…`. */ finding?: ((bin: string) => boolean) | undefined; /** The board's message table: what a bin's Details call its key. */ m: AllocationMessages; /** Every refusal holding Save, of every day's drafts (#1525): listed ahead of the issues, and over its bin's form. */ refusals: readonly AllocationRefusal[]; /** What the board's read says of the day in view (#1398): until its bins and the check's record land, the Issues list shows it is loading (#1595). */ read: PeriodRead; /** A refusal's Show pressed: its bin shown on its day and selected. */ onRefusal: (refusal: AllocationRefusal) => void; } /** * The end pane (see the module docs). * * @param args - See {@link InspectorArgs} * @returns The pane, or `undefined` when the board has no inspector */ export declare function useAllocationInspector(args: InspectorArgs): BuilderFrameDock | undefined; //# sourceMappingURL=inspector.d.ts.map