/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { SortedMap, type ValueTypeOf } from "@elaraai/east"; import { type RecordSliceBindType } from "@elaraai/east-ui/internal"; import { type ReferenceRows } from "../shared/schedule/reference.js"; import { type AllocationValue, type Day, type StoredBin } from "./model.js"; /** * The bins' own source's narrowing, apart from the day the board writes into * its range (#1398): what a read of the day is filtered by. The board's * navigation moves the range alone, so a day step leaves it as it is. * * @param part - The bins' source's part of the slice; `undefined` with none * @returns The narrowing's choices, printed; `""` with no part */ export declare function binChoicesOf(part: ValueTypeOf | undefined): string; /** * Whether the read in flight is the day's bins under a new narrowing of their * own source (#1398): the board holds a complete read of the day it shows, * made under other choices, which stands in — `Filtering bins…` — rather than * a day it has not read — `Loading Wed 12 May`. * * @param loading - Whether a read the day needs is in flight * @param landed - The day and the choices of the last complete read; `undefined` before one * @param day - The day the board shows * @param choices - The bins' source's choices now ({@link binChoicesOf}) * @returns Whether the read in flight is a filtering of the day's bins */ export declare function filteringBins(loading: boolean, landed: { readonly day: Date; readonly choices: string; } | undefined, day: Date, choices: string): boolean; /** A day's status, as its period's row says it. */ type Status = Day["status"]; /** What the board has read of its records for a day. */ export interface AllocationData { /** The day it is of. */ readonly day: Date; /** The day's stored bins, by key: what its window read. */ readonly bins: ReadonlyMap; /** The own row's bytes of the period holding the day — the day's, or its week's (#1550); `undefined` for one with no row, or a board with no periods. */ readonly period: Uint8Array | undefined; /** The open picker's days' statuses, by day — each day of a week its week's (#1550): a day whose period has no row is not among them. */ readonly picker: SortedMap; /** * The rows of the reference record the app's check reads (#1551): those overlapping the day, every one whatever the * slice holds; `undefined` without one. */ readonly reference: ReferenceRows | undefined; /** Whether a read the day needs — its bins, its row or its reference rows — is in flight. */ readonly loading: boolean; /** Whether the read in flight is the day's bins under a new narrowing of their own source, the last narrowing's standing in ({@link filteringBins}). */ readonly filtering: boolean; /** Whether a complete read of the day has landed. */ readonly ready: boolean; /** * Whether a complete read of any day has landed: the frame's cold load is * over (#1398, CL5), and a day not read yet is read with the frame live, * its geometry drawn and its placeholders where its content goes. */ readonly landed: boolean; /** Why the latest read failed. */ readonly error: string | undefined; } /** * The frame's data before its reader first reports: nothing held, a read in flight. * * @param day - The day the frame shows * @returns The state */ export declare function initialAllocationData(day: Date): AllocationData; /** * Reads the day (see the module docs). * * @param value - The payload * @param day - The plan day, at UTC midnight * @param pickerDays - The open picker's days, in order * @param choices - The bins' own source's narrowing, apart from the day ({@link binChoicesOf}) * @returns What the board has read of the day */ export declare function useAllocationData(value: AllocationValue, day: Date, pickerDays: readonly Date[], choices: string): AllocationData; /** * The day's reads, in a component of its own (#1343): each page and search * that lands re-runs it alone, and it hands the frame what it read only when * what the frame shows moves. * * @param props - The payload, the day, the open picker's days, the bins' source's choices, and where the data goes * @returns Nothing: it reads */ export declare function AllocationDataReader({ value, day, pickerDays, choices, onData }: { value: AllocationValue; day: Date; pickerDays: readonly Date[]; choices: string; onData: (data: AllocationData) => void; }): null; export {}; //# sourceMappingURL=data.d.ts.map