/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type option } from "@elaraai/east"; import { type BuilderFrameDock, type Origin } from "@elaraai/east-ui-components"; import { type SourceHiding } from "../shared/schedule/hidden.js"; import type { HiddenPicks } from "../shared/schedule/hidden-pick.js"; import { type SchematicDrawn, type SchematicRef } from "./canvas/drawn.js"; import type { SchematicCounts, SchematicSavedRecord } from "./counts.js"; import type { SchematicValue } from "./data.js"; import { type ConnectVetoOf, type NetLeg, type SchematicEdit, type SchematicKeyRefusal } from "./edits.js"; import { type SchematicEditing } from "./editing.js"; import { type SchematicInspected } from "./inspect.js"; import type { SchematicInspectedRows } from "./inspector-rows.js"; import type { SchematicIssue } from "./issues.js"; import { type SchematicWords } from "./messages.js"; /** * The editing as Details records its edits: as every route's are (`index.tsx`), each row whose key its fields build * following them (#1549) — an edit refused handing back why, where the Schematic says. */ export interface SchematicInspectorEditing extends Omit { /** * Records one edit as one step of the history. * * @param edits - The rows it changes, and how * @param origin - The gesture * @param label - Its label in the history * @returns `true` once recorded; refused, why — its key refused, as the footer says it — or `false` where nothing says */ record(edits: readonly SchematicEdit[], origin: Origin, label: string): boolean | string; } /** What the inspector reads of the Schematic. */ export interface SchematicInspectorProps { /** The payload, decoded. */ readonly value: SchematicValue; /** What Details shows. */ readonly inspected: SchematicInspected; /** The inspected entity's stored rows: its own and its details'. */ readonly rows: SchematicInspectedRows; /** What the canvas draws: the stored rows, the drafts in place. */ readonly drawn: SchematicDrawn; /** * Each entity's name, by its id, as the Schematic says it everywhere (`inspect.ts`' `entityNames`): what the head, the * collapsed rail and the lists name it — a link by its ends, a net by its label or its ends, never a key it minted. */ readonly names: ReadonlyMap; /** The drawing as its lists show it, what the rail's narrowing leaves out left out (#1392): what a Chooser offers, and what an item is joined to. */ readonly listed: SchematicDrawn; /** The editing: each record's session and drafts, and how an edit is recorded. */ readonly editing: SchematicInspectorEditing; /** What the drawing's Details counts, with nothing selected (`counts.ts`). */ readonly counts: SchematicCounts; /** The kinds' records whose commits say when each was last saved, and by whom. */ readonly records: readonly SchematicSavedRecord[]; /** The drawing's issues, and its sessions'. */ readonly issues: readonly SchematicIssue[]; /** * The kinds read by area, each by its name as running text writes it in the plural (`racks`): Issues checks their rows * read around the view and says the others are checked only as the view reaches them; none, it says nothing of it. */ readonly unchecked: readonly string[]; /** * Each unsaved change the drawing leaves out — a drafted row waiting in its session, the narrowing leaving out the row * it drafts (`drafted.ts`' `waitingDrafts`) — its reference by its id: what Issues checks beside the drawing, and an * issue of which says which of the rail's choices hide it. */ readonly waiting: ReadonlyMap; /** * Each kind's hidden pick, by its slot — every kind read through its source of the rail, read by the frame * (`hidden-pick.tsx`' `HideSources`): what an issue of an unsaved change the drawing leaves out asks e3 which of the * rail's choices hide the row it drafts. */ readonly picks: HiddenPicks; /** * Goes to an unsaved change the drawing leaves out, by its id — the frame's hidden pick, as Find's is: the choices * hiding it cleared, flown to where its draft stands, and selected once the narrowing they leave draws it. * * @param id - The change's entity, by its id * @param hidden - What hides the row it drafts, as far as e3 has said; `undefined` where nothing does */ readonly goToWaiting: (id: string, hidden: readonly SourceHiding[] | undefined) => void; /** * Asks a row's Details for a field, which takes the keyboard there, the inspector opened at Details: what an issue's * line in Issues asks, as the toolbar's issue gone to does. Asked for none, any ask standing is dropped. * * @param record - The row's record, by its key in the history: its kind's slot, or its details record's * @param entry - The row's key * @param field - The field the issue names, by its form's key; none for an issue naming none */ readonly ask: (record: string, entry: string, field: option) => void; /** The zone holding a point, by its name, as the Index files an item. */ readonly zoneAt: (x: number, y: number) => string | undefined; /** Selects an entity, by its id — a net's leg with it — flying to it; `undefined` selects nothing. */ readonly reveal: (id: string | undefined, leg?: NetLeg) => void; /** Says why an edit was refused, in the footer; `undefined` clears it. */ readonly refuse: (words: string | undefined) => void; /** Says why an edit records nothing, its new row's key refused (#1549), in the footer, and hands back the words. */ readonly keyRefused: (refusal: SchematicKeyRefusal) => string; /** Selects an entity alone, by its id, once the drawing draws it, the camera where it is: an item under the key typed for it (#1549). */ readonly select: (id: string) => void; /** The open tab. */ readonly tab: string; /** Opens a tab. */ readonly onTab: (tab: string) => void; /** Where an own Details keeps its own state. */ readonly storageKey: string; /** The Schematic's words. */ readonly words: SchematicWords; /** Whether main is below 480px (#1394, D15): Details gains the actions the canvas doesn't take there — an item's Connect to…, an unplaced item's Place. */ readonly narrow: boolean; /** The host's veto, as every route that connects two items asks it (`edits.ts`' `connectVeto`): what Connect to…, a link's ends and a net's sides are held to. */ readonly veto: ConnectVetoOf; /** The link kind Connect draws, by its slot — the toolbar's Connect menu's choice: what Connect to… records, while it may run from the item. */ readonly linkKind: string | undefined; /** Picks the link kind Connect draws: Connect to…'s choice of it, which the toolbar's Connect menu follows. */ readonly onLinkKind: (slot: string) => void; /** What a new link takes its other fields from, by its kind's slot (§4.3): the values of the template of its kind the library has selected; `none`, their types' defaults. */ readonly connectValues: (slot: string) => option; /** Places an item with no position at the canvas's centre, by its id, as its Backlog card's ⏎ does, and selects it (#1394). */ readonly place: (id: string) => void; } /** * The inspector pane, as `BuilderFrame` draws it — see the module docs. * * @param props - What is selected and its rows, the drawing, the editing, the counts, the records, the issues, the tab and the words * @returns The pane — 320px wide, its collapsed state kept per viewer — or `undefined`, no pane, when the Schematic is given no inspector */ export declare function schematicInspectorPane(props: SchematicInspectorProps): BuilderFrameDock | undefined; //# sourceMappingURL=inspector.d.ts.map