/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type Formatters } from "@elaraai/east-ui-components"; import type { PeriodRead } from "../shared/loading.js"; import { type RowAnchor } from "../shared/schedule/row-anchor.js"; import { type RosterDrag } from "./drag.js"; import type { RosterCommands } from "./actions.js"; import type { RosterOptimised } from "./optimise.js"; import { type Assignment, type Coverage, type Issue, type Pay, type Person, type PlacedProposal, type RosterDomain, type RosterSpan, type RosterStyles, type RosterValue, type RosterView, type Selection, type Slot, type Week, type WeekState } from "./model.js"; export interface RosterViewsProps { value: RosterValue; week: Week; held: Week; start: Date; day: number; view: RosterView; setView: (view: RosterView) => void; /** Whether a duty holds a conflict not yet chosen: its chip, tile and card wear the warn ring. None by default. */ conflicted?: ((id: string) => boolean) | undefined; /** Whether a duty's row holds a number its field's bounds don't (#1585): its chip, tile and card wear the warn ring. None by default. */ bounded?: ((id: string) => boolean) | undefined; /** The span in view (#1406, D2), and each of its weeks drafts in place: what the month draws, and what a pattern dropped on one applies to. */ span: RosterSpan; weeks: readonly WeekState[]; /** Opens a week in the Week period (P12, P24). */ openWeek: (week: Date) => void; /** Whether the layout in view offers Day, and Week (`viewPeriods`): without it, a heading that would open it is a heading alone. */ opensDay: boolean; opensWeek: boolean; styles: RosterStyles; format: Formatters; narrow: boolean; coverage: ReadonlyMap; hours: ReadonlyMap; /** * Each week of the span's coverage, as `weeks` lists them (#1568): what the People layout's work requirement sums — * a week's `coverage`, or each of a month's weeks', its hours alone; none in a month drawing no work requirement. */ spanCoverage: readonly ReadonlyMap[]; /** Each duty's cost by the app's codes: none without `pay`. */ pay: Pay; /** The duty row type's domain: what a duty unlike the record's is told by. */ domain: RosterDomain; issues: readonly Issue[]; proposals: readonly PlacedProposal[]; selection: Selection | undefined; select: (next: Selection | undefined) => void; /** What selects and opens the inspector's view, where a selection alone leaves main in view on a phone: a phone's lane line's press. */ inspect: (next: Selection) => void; commands: RosterCommands; drag: RosterDrag; onError: (error: string | undefined) => void; /** * What the views draw of the week's read (#1398): the week as read; a week not read yet — its dates, people, groups * and shifts at once, a placeholder where its content goes, unseen until the frame's reveal says so, never "Off · * assign" nor "0 / 2 positions" (CL2, CL13); or one whose read failed — its geometry, the failure said once in its * first row in view (CL11). */ read: PeriodRead; /** Where the People rows' and cards' views last rested (#1398): what each comes back to as it mounts. */ anchor?: RosterAnchor | undefined; /** Told where a People view rests as its scroll settles. */ onAnchor?: ((next: Partial) => void) | undefined; /** * What the runs of the app's optimiser left on the week's duties (#1409, R23): each duty's operation, drawn on its * tile and its chip alike with its provenance on hover, and the people whose hours the latest run changed. */ optimised?: RosterOptimised | undefined; /** Whether a run's highlight is on (#1409): a removed duty's tombstone is struck, and the changed people's hours flash. */ lit?: boolean | undefined; /** The person the last pick in Search Records gives the keyboard to (#1398): their name in the People view, once. */ picked?: PeoplePick | undefined; } /** A pick in Search Records, handing its person the keyboard (#1398): their key, and which pick it is. */ export interface PeoplePick { readonly key: string; readonly seq: number; } /** Where the People views rest (#1398): the desktop rows', and the phone's cards', each by its top row's key — brought * back once the rows' floors are measured, so the rows above the one brought back stand where they will. */ export interface RosterAnchor { readonly people?: RowAnchor | undefined; readonly cards?: RowAnchor | undefined; } /** Where the People views rest, as storage keeps it. */ export declare const readRosterAnchor: import("@elaraai/east-ui-components/internal").KeptReader; /** * Install (or clear) the People draw probe. Test use only. * * @param fn - Told of each row and day drawn; `undefined` clears it */ export declare function setPeopleDrawProbe(fn: ((part: "row" | "day", key: string) => void) | undefined): void; /** * A person of the payload, by key: found in the payload's people indexed once, never by a search of every person * (#1398, CL9). * * @param value - The payload * @param key - The person's key * @returns The person; `undefined` for a key the payload does not hold */ export declare function personOf(value: Pick, key: string): Person | undefined; export declare function assignmentName(value: RosterValue, a: Assignment): string; /** A cost in the Roster's currency, through the shared money formatter: compact where it heads a column, exact where it stands alone. */ export declare function money(format: Formatters, value: RosterValue, amount: number, compact?: boolean): string; /** Whether the Roster shows costs: only with the app's pay (§5.6). */ export declare function costed(value: RosterValue): boolean; /** * The same coverage bar and skill lines appear in a day cell and the inspector. A sum of several slots' coverage — a * shift's day across the groups — is given what its slots are short, each slot's own (K4): its difference and its bar's * open part say that, never their net; a slot's own is what it is short. */ export declare function CoverageView({ coverage: c, value, styles, format, compact, short: given }: { coverage: Coverage; value: RosterValue; styles: RosterStyles; format: Formatters; compact?: boolean; /** What the slots summed are short, each slot's own; by default, what the one slot is short. */ short?: number; }): import("react/jsx-runtime").JSX.Element; /** A desktop proposal is the mock's quiet inline chip; phones retain labelled actions. */ export declare function ProposalCard({ props, proposal }: { props: RosterViewsProps; proposal: PlacedProposal; }): import("react/jsx-runtime").JSX.Element; /** Whether the week keeps the suggestions it rejects: without a record to keep them, a suggestion is only accepted (§5.2). */ export declare function dismissible(value: RosterValue): boolean; export declare function RosterViews(props: RosterViewsProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=views.d.ts.map