/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The Roster's editing (#1369, `Builder Interfaces Spec.md` §7): one history * over a session per record it writes — the duties (the duty kind's session, * read by key through its `entries` when it is given them), the weeks (the * periods') and the targets — through the shared Schedule editing, so a * gesture across them is one step and Save sends each record's changes as its * own request. Drafts of every week stay in their sessions, as the Calendar's * do: navigating, the rail and a remount keep them, and Save includes them. * The week'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 { 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 { RosterData } from "./data.js"; import { type DraftedDuty, type RosterSpan, type RosterValue, type StoredTarget } from "./model.js"; /** What a change names the weeks' record by in the history: no duty kind's slot. */ export declare const PERIODS = "roster.periods"; /** What a change names the targets' record by in the history. */ export declare const TARGETS = "roster.targets"; /** The Roster's editing: its history, and every draft of each record, decoded once. */ export interface RosterEditing { /** The shared Schedule editing over the three records: how a gesture is recorded, and what each record holds. */ readonly schedule: ScheduleEditing; /** The one history over them. */ readonly history: EditHistory; /** The duty kind's slot: what a change names the duties by. */ readonly duty: string; /** Every drafted duty of every week, by key: its bytes, its roles and its row, or `undefined` for one removed. */ readonly duties: ReadonlyMap; /** Every drafted target, by key: its bytes and its roles, or `undefined` for one removed. */ readonly targets: ReadonlyMap; /** Every drafted week's row, 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 RosterEditing.standing}): the span's duties and the week * before's, its targets, and each period's own row by its start — as the frame holds them, at whatever revision they * were read. None while the board draws no read of the span in view. Said as the frame commits, so a gesture reads * what the page shows. * * @param editing - The Roster's editing; none for a Roster read only * @param drawn - The read the frame draws, while it is the span's own */ export declare function useRosterStanding(editing: RosterEditing | undefined, drawn: Pick | undefined): void; /** * The Roster's sessions over its records, and their drafts (see the module docs). * * @param value - The payload * @param storageKey - The Roster's key: its sessions and their history are kept under it * @param span - The span shown — a week, or a month's weeks (#1406): the windows the Roster reads its records over * @param recordSlices - The slice's parts over the records it writes: each Save notice counts what leaves its own * @returns The editing */ export declare function useRosterEditing(value: RosterValue, storageKey: string, span: RosterSpan, recordSlices: readonly ValueTypeOf[]): RosterEditing; //# sourceMappingURL=editing.d.ts.map