/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The Allocation's editing (#1372, `Builder Interfaces Spec.md` §7): one * history over a session per record it writes — the bins (the bin kind's * session, read by key through its `entries` when it is given them) and the * periods, its days or its weeks (#1550) — through the shared Schedule * editing, as the Roster's is: a gesture is one step, and Save sends each * record's changes as its own request. Drafts of every day stay in their sessions: navigating, the rail and * a remount keep them, and Save includes them. The day's own reads of each * record serve a gesture's original and a Save's confirmation, at the revision * the Save committed; a row they do not hold is read by its key. * * @packageDocumentation */ import { type RefObject } from "react"; import { type ValueTypeOf } from "@elaraai/east"; import type { FieldSpecValue, RecordSliceBindType } from "@elaraai/east-ui/internal"; import { type EditHistory } from "@elaraai/east-ui-components"; import { type ScheduleEditing, type ScheduleEntryRef, type ScheduleStandingRows } from "../shared/schedule/editing.js"; import { type AllocationValue, type DraftedBin, type StoredBin } from "./model.js"; /** What a change names the periods' record by in the history — its days', or its weeks' (#1550): no bin kind's slot. */ export declare const PERIODS = "allocation.periods"; /** * The fields of the bin kind's form a bin's numbers are held to the bounds of (#1585), from its row: every bounded one, * but a reservation's quantity — it holds none until an arrival is booked into it, and is checked once that makes it a * bin. One rule for what holds Save, what wears the warn ring and what Issues lists out of range. * * @param bin - The bin kind * @returns A row's bounded fields */ export declare function binBounds(bin: AllocationValue["bin"]): (row: unknown) => readonly FieldSpecValue[]; /** The Allocation's editing: its history, and every draft of each record, decoded once. */ export interface AllocationEditing { /** The shared Schedule editing over the two records: how a gesture is recorded, and what each record holds. */ readonly schedule: ScheduleEditing; /** The one history over them. */ readonly history: EditHistory; /** The bin kind's slot: what a change names the bins by. */ readonly bin: string; /** Every drafted bin of every day, by key: its bytes, its roles and its row, or `undefined` for one removed. */ readonly bins: ReadonlyMap; /** Every drafted period's row — a day's, or a week's (#1550) — by its key's text: its bytes, or `undefined` for one removed. */ readonly periods: ReadonlyMap; /** * Where the board says what it draws of each record now: a gesture's original while the record's revision now is * read — after a Save, or another session's — so a gesture on what the board shows is taken at once. */ readonly standing: RefObject; } /** * Says what the board draws of each record now ({@link AllocationEditing.standing}): the day's bins, and the own row * of the period holding the day — as the frame holds them, at whatever revision they were read. None while the board * draws no read of the day in view. Said as the frame commits, so a gesture reads what the page shows. * * @param editing - The board's editing; none for a board read only * @param bins - The bins the frame draws, while its read is the day's own * @param period - The period's own row as the frame holds it * @param periodId - The period's key's text */ export declare function useAllocationStanding(editing: AllocationEditing | undefined, bins: ReadonlyMap | undefined, period: Uint8Array | undefined, periodId: string): void; /** * The Allocation's sessions over its records, and their drafts (see the module docs). * * @param value - The payload * @param storageKey - The board's key: its sessions and their history are kept under it * @param day - The plan day: the window the board reads its records over * @param recordSlices - The slice's part over the bins: its Save notice counts what leaves it * @returns The editing */ export declare function useAllocationEditing(value: AllocationValue, storageKey: string, day: Date, recordSlices: readonly ValueTypeOf[]): AllocationEditing; //# sourceMappingURL=editing.d.ts.map