/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import type { FlowchartModel } from "./model.js"; /** * What is selected: one state, transition, decision or lane, by its key, or * several states, in the order they were selected. */ export type FlowchartSelection = { readonly kind: "state" | "link" | "trigger" | "lane"; readonly key: string; } | { readonly kind: "states"; readonly keys: readonly string[]; }; /** * The states a selection holds: its one state, its several, or none. * * @param selection - What is selected * @returns The states' keys, in the order they were selected */ export declare function selectedStates(selection: FlowchartSelection | null): readonly string[]; /** * Whether two selections are one: what the canvas marks, and the inspector * shows, need not move. * * @param a - A selection, or none * @param b - Another, or none * @returns Whether they select the same, in the same order */ export declare function selectionEqual(a: FlowchartSelection | null, b: FlowchartSelection | null): boolean; /** * A state shift-, ⌘- or Ctrl-clicked: put into the selection, or — selected * already — taken out of it. A selection of anything but states starts again * from the state; several states taken down to one are that state alone. * * @param selection - What is selected * @param key - The state clicked * @returns The selection after the click; `null` when the click took out its last state */ export declare function toggleState(selection: FlowchartSelection | null, key: string): FlowchartSelection | null; /** * Whether the canvas draws a state of a key as itself — its card, or the * ghost a transition naming it draws — never as context. * * @param model - What the canvas draws * @param key - The state's key * @returns Whether a path selects it */ export declare function drawsState(model: FlowchartModel, key: string): boolean; /** * Whether the canvas draws a transition as itself — its line, or its state's * `↻ n` badge — never as context. * * @param model - What the canvas draws * @param key - The transition's key * @returns Whether a path selects it */ export declare function drawsTransition(model: FlowchartModel, key: string): boolean; /** * The selection as the canvas draws the records now: what it names that the * canvas no longer draws as itself goes — a state, a transition, a decision * or a lane an Undo, a gesture or the narrowing took away — several states * keep those still drawn, and one left is that state alone. Only a lane of * the app's is selected: never *No lane*, nor the one band of a Flowchart * given no lanes. * * @param selection - What is selected * @param model - What the canvas draws, the drafts in place * @returns The selection itself while the canvas draws all it names — the same object — else what is left of it, or `null` */ export declare function selectionHeld(selection: FlowchartSelection | null, model: FlowchartModel): FlowchartSelection | null; //# sourceMappingURL=selection.d.ts.map