/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type ValueTypeOf } from "@elaraai/east"; import { type RecordSliceBindType } from "@elaraai/east-ui/internal"; import { type KeyVisibility } from "../shared/schedule/visibility.js"; import type { AllocationStyles, AllocationValue } from "./model.js"; /** A narrowed source's role: what its rows are on the board. */ export type NarrowedSource = "lanes" | "resources" | "arrivals"; /** * The slot the slice names a source by: the lanes' and the resources' the bin * kind's own (`resource.of`, `parts.of`), the arrivals' `arrivals`. * * @param value - The payload * @param source - The source's role * @returns Its name in the slice */ export declare function narrowingSlot(value: AllocationValue, source: NarrowedSource): string; /** * A source's part of the board's narrowing, if the slice has one. * * @param value - The payload * @param source - The source's role * @returns Its record Slice's controls */ export declare function narrowingPart(value: AllocationValue, source: NarrowedSource): ValueTypeOf | undefined; /** * The board's narrowing, as text (#1398): the bins' own choices, apart from * the day the board writes into their range, and the lanes', the resources' * and the arrivals' — what a view keeps its place across. * * @param value - The payload * @param binChoices - The bins' own source's choices, printed (`binChoicesOf`) * @returns The narrowing, printed */ export declare function narrowingText(value: AllocationValue, binChoices: string): string; /** * Which of a source's rows show: its narrowed keys while a choice or its * page's scope narrows it, every row — and no read — while neither does. * * @param value - The payload * @param source - The source's role * @param rows - Every row of it, in order * @returns The keys to show, and the narrowing's state */ export declare function useNarrowed(value: AllocationValue, source: NarrowedSource, rows: readonly { key: string; }[]): KeyVisibility; /** * What the board's empty state stands under (#1398, CL13): each source a choice of the viewer's narrows, and the * narrowing's Clear all. A page's scope (#1621) is no choice — a board its scope leaves empty is no narrowing's empty * state, as a board with no rows is not, and Clear filters could not bring a row back — so a board holds one only while * a choice narrows a source. */ export interface AllocationNarrowed { /** Whether a choice of the viewer's narrows the lanes, the resources, the arrivals. */ readonly lanes: boolean; readonly resources: boolean; readonly arrivals: boolean; /** Clears every choice of the narrowing's, the page's scope kept. */ readonly clear: () => void; } /** * The board's narrowing, as its empty state stands under it (see {@link AllocationNarrowed}). * * @param value - The payload * @param chosen - Whether a choice of the viewer's narrows each source (its visibility's `chosen`) * @returns The narrowing; `undefined` while no choice narrows a source */ export declare function allocationNarrowed(value: AllocationValue, chosen: Readonly>): AllocationNarrowed | undefined; /** * The narrowing left nothing to show: the shared empty state, and Clear filters. * * @param props - The recipe's styles, and the narrowing's Clear all * @returns The empty state */ export declare function NarrowedEmpty({ styles, clear }: { styles: AllocationStyles; clear: () => void; }): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=narrowed.d.ts.map