/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type DrawnLink, type DrawnNet, type SchematicDrawn, type SchematicRef } from "./canvas/drawn.js"; import type { NetLeg } from "./edits.js"; import type { SchematicWords } from "./messages.js"; /** * Each entity's name, as the Schematic says it wherever it names one (#1391) — the inspector's head and its collapsed * rail, what an item is joined to and a net's leg, a drop's words, an issue's row and a record's banners: an item's or a * zone's label; a link's ends, by their items' labels (`A04 → CORE-1`); a net's label, else its ends, its sources then * its destinations (`A03 → CORE-1, ODF-1`). Never a key the Schematic minted: a new link or net is named by what it joins. * * @param drawn - What the canvas draws * @param words - The Schematic's words * @returns Each entity's name, by its id */ export declare function entityNames(drawn: SchematicDrawn, words: SchematicWords): ReadonlyMap; /** * An entity's name, as {@link entityNames} named it — or, for one the drawing doesn't draw, the key its id names. * * @param names - Each entity's name, by its id ({@link entityNames}) * @param id - The entity's id * @returns Its name */ export declare function nameOfEntity(names: ReadonlyMap, id: string): string; /** What an entity is: an item, a zone, a link or a net. */ export type SchematicSort = "item" | "zone" | "link" | "net"; /** An entity the drawing draws: its sort and its reference. */ export interface SchematicDrawnEntity { readonly sort: SchematicSort; readonly ref: SchematicRef; } /** An item with no position, as Details shows it (#1394): its id, its reference, its label and its icon, as its Backlog card has them. */ export interface SchematicUnplaced { /** Its id: its reference, printed, and its Backlog card's key. */ readonly id: string; /** Its kind's slot and its key. */ readonly ref: SchematicRef; /** Its label. */ readonly label: string; /** Its own icon, where its row gives one. */ readonly icon: string | undefined; } /** What Details shows: the drawing, one entity, a net's leg, several, or an item with no position. */ export type SchematicInspected = { readonly view: "drawing"; } | { readonly view: "entity"; readonly sort: SchematicSort; readonly id: string; readonly ref: SchematicRef; } | { readonly view: "leg"; readonly id: string; readonly ref: SchematicRef; readonly leg: NetLeg; } | { readonly view: "several"; readonly entities: readonly (SchematicDrawnEntity & { readonly id: string; })[]; } | ({ readonly view: "unplaced"; } & SchematicUnplaced); /** Nothing selected: the drawing. */ export declare const NOTHING_INSPECTED: SchematicInspected; /** * Each entity the drawing draws, by its id: its sort and its reference. * * @param drawn - What the canvas draws * @returns The entities, by id */ export declare function drawnEntities(drawn: SchematicDrawn): ReadonlyMap; /** * What Details shows for a selection (see the module docs). * * @param selection - What the canvas has selected, by id: the items, the zones, and the link or the net * @param leg - The selected net's leg, when a stub is selected; `null` for none * @param entities - Each entity the drawing draws ({@link drawnEntities}) * @returns What Details shows */ export declare function inspectedOf(selection: ReadonlySet, leg: NetLeg | null, entities: ReadonlyMap): SchematicInspected; /** * Whether two of what Details shows are one: the same view of the same * entities, so what it holds need not move. * * @param a - What Details shows * @param b - What it showed * @returns Whether they show the same */ export declare function inspectedEqual(a: SchematicInspected, b: SchematicInspected): boolean; /** What an item is joined to: the links that run from or to it, and the nets it is a member of, each on its side. */ export interface SchematicJoins { readonly links: readonly DrawnLink[]; readonly nets: readonly { readonly net: DrawnNet; readonly end: NetLeg["end"]; }[]; } /** * What an item is joined to, as the drawing holds it: each link from or to it, * and each net it is a member of — on its feeding side, else its fed side — in * the drawing's order. * * @param id - The item's id * @param drawn - What the canvas draws * @returns Its links and nets */ export declare function joinsOf(id: string, drawn: Pick): SchematicJoins; //# sourceMappingURL=inspect.d.ts.map