/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type FieldSpecValue } from "@elaraai/east-ui/internal"; import type { BatchReadiness, EditIssue } from "@elaraai/east-ui-components"; import type { ScheduleKindSession } from "./editing.js"; /** One refusal holding Save: whose session it is, and its issue. */ export interface ScheduleRefusal { /** The kind's slot, or the record's key, whose session refuses. */ readonly kind: string; /** The issue: its entry's key's text, the field it names, if any, and the app's message. */ readonly issue: EditIssue; } /** * Every refusal holding Save, in the sessions' order: each session's drafts' * readiness while it refuses. * * @param sessions - Each kind's session and each record's, as the shared editing holds them * @returns The refusals */ export declare function scheduleRefusals(sessions: readonly ScheduleKindSession[]): ScheduleRefusal[]; /** * What a session refuses of one entry: its drafts' readiness's issues naming the entry, while it refuses — the app's * check, a bound a changed row breaks, a new row waiting for its key. An entry with any holds its session's Save; each * naming a field is what the entry's form says under it ({@link refusedFields}). Any session: a kind's or a record's * ({@link entryRefusals}), or the one a Plan's rows save through, which no kind's slot names (#1541, U5). * * @param session - The session, as anything holding its readiness; `undefined` for none * @param entry - The entry's key's text * @returns Its refusals, in the readiness's order; none while the session is ready, or for no session */ export declare function sessionEntryRefusals(session: { readonly readiness: BatchReadiness; } | undefined, entry: string): EditIssue[]; /** * What one record's session refuses of one entry ({@link sessionEntryRefusals}), the session found by its kind's slot or * its record's key. * * @param sessions - Each kind's session and each record's, as the shared editing holds them * @param kind - The record: its kind's slot, or its record's key * @param entry - The entry's key's text * @returns Its refusals, in the readiness's order; none while the session is ready, or holds no session of the record */ export declare function entryRefusals(sessions: readonly ScheduleKindSession[], kind: string, entry: string): EditIssue[]; /** * Of the refusals holding Save ({@link scheduleRefusals}), those of one entry of one kind, in their order: what that * entry's panel shows over its form. Any list of them — a builder's own, each in its words, as the Roster's and the * Allocation's Issues tabs list them. * * @typeParam R - A refusal, as the builder holds it * @param refusals - The refusals holding Save * @param kind - The entry's kind: its slot, or its record's key * @param entry - The entry's key's text * @returns Its refusals; none for an entry nothing refuses */ export declare function refusalsOfEntry(refusals: readonly R[], kind: string, entry: string): R[]; /** * A field as a refusal names it: by its form's label — a nested field, a * case's among them, by its path joined by "." (#1585) — or, for one no form * draws (a role the builder draws itself), its name spelled out. * * @param specs - The entry's form, whose labels name its fields * @param field - The field's name, a nested one's path joined by "." * @returns Its words */ export declare function fieldLabelOf(specs: readonly FieldSpecValue[], field: string): string; /** * The fields an entry's issues name, each with what its issues say of it, in their order: what the entry's form is * handed as its `issues` (east-ui-components' `FieldForm`), so each field it rings says its reason under it (ruled 13 * Nov 2026) — where the keyboard lands when the issue is gone to, whatever of the banner over the form is in view. */ export type RefusedFields = ReadonlyMap; /** No field an issue names. */ export declare const NO_REFUSED_FIELDS: RefusedFields; /** * The fields an entry's issues name ({@link RefusedFields}): an app's refusal of a field in the app's own words, a * bound a changed row breaks in the bound's — which the form says once, in the field's help line. An issue naming no * field rings none. * * @param issues - The entry's issues: its refusals holding Save, or what its session raises of it * @returns Each field they name, by its key as the form keys it, and the words under it; the one empty map for none */ export declare function refusedFields(issues: readonly EditIssue[]): RefusedFields; /** * A refusal in words: the field it names ({@link fieldLabelOf}), then the * app's message: `Cost centre: Choose the cost centre`. A refusal naming no * field is its message alone. * * @param issue - The refusal's issue * @param specs - The entry's form, whose labels name its fields * @returns The words */ export declare function refusalText(issue: EditIssue, specs: readonly FieldSpecValue[]): string; /** * An entry's refusals in words, as the banner over its form says them in every builder's panel: each one's words * ({@link refusalText}), in their order, `; ` between them. * * @param issues - The entry's refusals' issues * @param specs - The entry's form, whose labels name its fields; none where it has none, each field then spelled out * @returns The words: `Cost centre: Choose the cost centre; Due before it starts` */ export declare function refusalsText(issues: readonly EditIssue[], specs: readonly FieldSpecValue[]): string; //# sourceMappingURL=refusals.d.ts.map