/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The Flowchart's issues (#1504, `Flowchart Records Spec.md` R6, R7, R11, * R12, R16, D3, D12) — pure and React-free: what the inspector's Issues tab * lists, each naming what a click on it selects, and the field it names, if * any, which the click asks of its row's Details. * * - **An end no state is keyed by** — a transition's end the canvas draws as a * ghost. Under `"hide"` such an end is read by key first: one the states' * narrowing hides takes its transition off the canvas with it, and is no * issue (D7). * - **A state whose lane names no lane** — or that names none, while lanes are * given — drawn in the last band, *No lane* (D12). * - **A transition whose decision names none** of the decisions the Flowchart * is given. * - **The details' counts no bin holds** — a row's histogram counting at no * edge of the flowchart's bins, or counting what is no count — and **the bins * the app binds** that hold no edge, one that is no finite number, or two * that do not ascend (R38, `details.ts`). A details row keyed as no row drawn * is no issue. * - **A number its field's bounds don't hold** (#1585) — a row drawn whose * number is under its least or over its most, by its field's label and the * bound in its hint's own words, `Slices: at least 1`. A changed row's is * its session's readiness, which holds Save off; any other row's warns. * - **A draft waiting in its session**, the narrowing hiding its row: listed * with the rows of the rail's sources whose narrowing leaves it out, which the * inspector names the choices of (the shared hidden pick) and Go to issue * clears (R11). * - **The app's `ready` refusals** — the key check's among them, a new key e3 * holds already (D3) — which hold Save off (R12). * - **A Save's conflict or refusal**, while it stands. * * The last two block, and come first; the rest warn, and Save goes ahead with * them. What the narrowing draws as context (`"dim"`) raises no issue: no path * selects it. * * A Save's conflict names each side's value as the canvas names that row — a * state's lane by the lane's label, a transition's ends by their states' and * its decision by the decision's — never a key ({@link conflictValueName}), * each read at the key type of the kind it names (#1549). * * @packageDocumentation */ import { type PatchPath } from "@elaraai/east"; import type { EditSession, FieldBreach } from "@elaraai/east-ui-components"; import type { FlowchartBinsRefusalWord, FlowchartDetailsFinding } from "./details.js"; import type { FlowchartWaiting } from "./drafted.js"; import type { FlowchartModel, FlowchartRow, FlowchartTransitionRoles } from "./model.js"; import type { FlowchartSort } from "./read.js"; import type { FlowchartSelection } from "./selection.js"; /** A row of a source of the rail whose narrowing leaves out what an issue names: the source's kind, and the row's key. */ export interface FlowchartHiding { /** The kind read through the source. */ readonly sort: "states" | "transitions"; /** The row's key in its record. */ readonly key: string; } /** What an issue says, before its words. */ export type FlowchartIssueWord = /** A transition, named by its ends, naming states no row is keyed by — by their keys. */ { readonly issue: "end"; readonly link: string; readonly missing: readonly string[]; } /** A state naming a lane the Flowchart has none of, by its key — or naming none. */ | { readonly issue: "lane"; readonly state: string; readonly lane: string | undefined; } /** A transition, named by its ends, naming a decision the Flowchart has none of, by its key. */ | { readonly issue: "decision"; readonly link: string; readonly decision: string; } /** A row's histogram holding counts no bin holds, by the row's name and the read's label. */ | { readonly issue: "counts"; readonly name: string; readonly read: string; } /** A histogram's bins, as the app binds them, refused, by the read's label: why, its numbers in the app's locale. */ | { readonly issue: "bins"; readonly read: string; readonly refusal: FlowchartBinsRefusalWord; } /** * The rail's source whose picks would weigh a kind's details narrowing another record than they read (#1522), by * the kind's name and the source's: the details draw each row's own. */ | { readonly issue: "weighed"; readonly kind: string; readonly source: string; } /** A change waiting on Save that the narrowing hides, by the row's name. */ | { readonly issue: "waiting"; readonly name: string; } /** The app's check — or the key check — refusing a drafted row, which holds Save off, in its own words. */ | { readonly issue: "ready"; readonly message: string; } /** A number its field's bounds don't hold (#1585): its field's label, and the bound in its hint's own words. */ | { readonly issue: "bounds"; readonly field: string; readonly bound: string; } /** A Save's conflict or refusal, in the source's own words. */ | { readonly issue: "save"; readonly message: string; }; /** One issue, as the Issues tab lists it. */ export interface FlowchartIssue { /** What a click on it selects, as the canvas selects it; `null`, the Flowchart itself — what nothing selected shows. */ readonly at: FlowchartSelection | null; /** Whether it blocks — the app's check holds Save, or a Save was stopped — rather than warns. */ readonly blocking: boolean; /** What it names: its kind — `undefined` for a record's words that name no row — and its name, as the Flowchart names it. */ readonly where: { readonly sort: FlowchartSort | undefined; readonly name: string; }; /** * The rows of the rail's sources whose narrowing leaves out what it names — a draft waiting in its session: its own * row, or a transition's ends the states' narrowing hides; none for what the canvas draws. */ readonly hiding: readonly FlowchartHiding[]; /** What it says. */ readonly word: FlowchartIssueWord; /** * The field it names, by its form's key: a click on it asks its row's Details for it, and it takes the keyboard * there, as it does for the toolbar's issue gone to. `undefined` for an issue naming none. */ readonly field?: string | undefined; } /** A number its field's bounds don't hold, as Issues says it (#1585). */ export interface FlowchartBreachWords { /** Its field's label. */ readonly field: string; /** The bound, in its field's hint's own words — `at least 1`. */ readonly bound: string; } /** A row drawn whose number its field's bounds don't hold, no change of it holding Save (#1585). */ export interface FlowchartBreach extends FlowchartBreachWords { /** Its kind. */ readonly sort: FlowchartSort; /** Its key. */ readonly key: string; /** The field, by its form's key: what a click on its issue asks of its row's Details. */ readonly fieldKey: string; } /** What the issues are worked out from. */ export interface FlowchartIssueArgs { /** What the canvas draws, the drafts in place. */ readonly model: FlowchartModel; /** The transitions it draws, the drafts in place — those in place among them. */ readonly transitions: readonly FlowchartRow[]; /** The drafted rows waiting in their sessions (`drafted.ts`). */ readonly waiting: readonly FlowchartWaiting[]; /** The transitions held but hidden with their far end (`read.ts`' `hiddenWith`). */ readonly hiddenWith: ReadonlySet; /** The states the read holds, by key: a waiting transition's end it does not hold is one the narrowing hides. */ readonly stored: ReadonlyMap; /** Whether the Flowchart is given decisions: a transition naming one it has none of is an issue only then. */ readonly decisions: boolean; /** What the details model finds (`details.ts`): the bins the app binds refused, and the rows' counts no bin holds. */ readonly details: readonly FlowchartDetailsFinding[]; /** The rows drawn whose numbers their fields' bounds don't hold, none of them changed so (#1585); none unless given. */ readonly breaches?: readonly FlowchartBreach[] | undefined; } /** * What the canvas selects a row of a kind as, by its key. * * @param sort - The row's kind * @param key - Its key * @returns The selection */ export declare function selectionOf(sort: FlowchartSort, key: string): FlowchartSelection; /** * The Flowchart's own issues (see the module docs), each a warning: the states * standing in *No lane*, in their band's order; then the transitions', in * their keys' order at their key type — an end no state is keyed by, a decision * the Flowchart has none of; * then the details', as the details model finds them — each kind's refused * bins, naming the kind and selecting the Flowchart, then its rows' counts no * bin holds, each selecting its row; then the rows' numbers their fields' * bounds don't hold, as given, each naming its field; then each draft waiting * in its session, each kind's in its drafts' order. * * @param args - What the canvas draws, its transitions, the drafts waiting, the transitions hidden with their far end, * the states read, whether decisions are given, what the details model finds, and the rows' breaches * @returns The issues */ export declare function flowchartIssues(args: FlowchartIssueArgs): FlowchartIssue[]; /** A record's session as Issues reads it: the kind it is, and where its Save stands. */ export interface FlowchartIssueSession { /** The record's key in the history: its kind. */ readonly kind: string; /** Its session: where its latest Save stands, its source's words, and its drafts' readiness. */ readonly session: Pick, "status" | "issues" | "readiness">; } /** * The issues each record's session raises (see the module docs): the app's * check — the key check's among it — refusing its drafted rows, a changed * row's number its field's bounds don't hold among them, and its latest Save's * conflict or refusal while it stands; each blocking, naming its row — one * waiting in its session with the rows of the rail's sources hiding it — and * the field the source's issue names. * * @param sessions - Each record's session * @param args - What the canvas draws, as {@link flowchartIssues} takes it: what names a row, and what hides one waiting * @param kindName - A kind's name, as the payload gives it: what a record's words that name no row stand for * @param breachWords - A breach of a kind's form in Issues' words (#1585): its field's label and its bound; a breach * says its bound alone unless given * @returns The issues, in the sessions' order */ export declare function sessionIssues(sessions: readonly FlowchartIssueSession[], args: FlowchartIssueArgs, kindName: (sort: FlowchartSort) => string, breachWords?: (sort: FlowchartSort, breach: FieldBreach) => FlowchartBreachWords): FlowchartIssue[]; /** The fields the kinds' roles name another row's key in (#1503): what a conflict on one is named by. */ export interface FlowchartKeyFields { /** The field of a state naming its lane by the lane's key; `undefined` without lanes. */ readonly lane: string | undefined; /** The fields of a transition naming its ends by their states' keys; `undefined` without transitions. */ readonly ends: readonly [from: string, to: string] | undefined; /** The field of a transition naming its decision by the decision's key; `undefined` without one. */ readonly decision: string | undefined; } /** * A conflict's value as the canvas names that row, where the value is a key * (#1503): a state's lane by the lane's label, a transition's end by its * state's label and its decision by the decision's — never a key, as the * history bar's conflict card shows each side and what it was. * * @param sort - The kind whose row conflicts * @param path - The conflict's path in the row: one field, through the case of an Option * @param value - The value on one side: a key at the key type of the kind its field names (#1549), or an `Option` of one * @param fields - The fields the kinds' roles name a key in * @param model - The flowchart as its drafts stand, which names each row and holds each kind's keys * @returns Its name, or the key's text for a row the flowchart holds none of; `undefined` for any other value, which the card reads as it is */ export declare function conflictValueName(sort: FlowchartSort, path: PatchPath, value: unknown, fields: FlowchartKeyFields, model: FlowchartModel): string | undefined; //# sourceMappingURL=issues.d.ts.map