import type React from 'react'; import type { CanvasGraph } from '../graph-projection.js'; import type { YarramateOperation } from '../operations.js'; import type { ConnectionDraft } from './workspace-state.js'; export interface TargetMatch { readonly id: string; readonly name: string; } /** * Subjects a typed query names as connection targets (#309). The canvas tap * stays the fast path; this is the KEYBOARD path — the one mandatory canvas * interaction was pointer-only, so a screen-reader or keyboard-only reviewer * could not author a relationship at all. Name and id both match, * case-insensitively, because the reviewer knows whichever the rail showed * them; the source is excluded because a self-edge is never what a typed * query means. An empty query matches nothing rather than everything: the * list is an answer to a question, not a roster. */ export declare const searchTargets: (graph: CanvasGraph, from: string, query: string, cap?: number) => { readonly matches: readonly TargetMatch[]; readonly more: number; }; /** * The connection tool: pick a source, pick a target, pick a kind. * * Every kind offered here comes from the ArchiMate relationship table, so the * reviewer cannot draw an edge `check` would refuse with `YM404` * (ADR 0097). Nothing filters the list by hand: `connectableKinds` is the same * lookup the compiler performs, and `draftRelationship` refuses a kind that is * not in it even if this panel somehow offered one. * * A pair the table knows always permits `association`, so an empty list here * means an endpoint outside the ArchiMate vocabulary rather than a dead end, * and the panel says which. */ export declare const ConnectionPanel: ({ draft, graph, reservedIds, onTarget, onStage, onCancel, }: { readonly draft: ConnectionDraft; readonly graph: CanvasGraph; /** * Ids the pending changeset already claims. The graph only knows what has * landed, so without these a second relationship between the same pair * proposed the identical id and replace-by-target staging swallowed it * silently (#306). Required rather than defaulted: a caller has to say * what is staged, even when the answer is nothing. */ readonly reservedIds: readonly string[]; /** * Names the target, exactly as a canvas tap would (#309): same reducer * action, same draft transition. The panel adds the keyboard way in, not * a second connect flow. */ readonly onTarget: (id: string) => void; readonly onStage: (operation: YarramateOperation) => void; readonly onCancel: () => void; }) => React.ReactElement;