/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { NullType, OptionType, StringType, StructType, VariantType, type ValueTypeOf } from "@elaraai/east"; /** A tool, as the UI store holds it. */ export declare const SchematicToolType: VariantType<{ readonly select: NullType; readonly zoom: NullType; readonly marquee: NullType; readonly connect: NullType; readonly move: NullType; }>; /** The tools' state, as the UI store holds it: the tool, and the link kind Connect draws, by its slot. */ export declare const SchematicToolsType: StructType<{ readonly tool: VariantType<{ readonly select: NullType; readonly zoom: NullType; readonly marquee: NullType; readonly connect: NullType; readonly move: NullType; }>; readonly link: OptionType; }>; /** A tool, by its name. */ export type SchematicTool = ValueTypeOf["type"]; /** Every tool, in the toolbar's order. */ export declare const SCHEMATIC_TOOLS: readonly SchematicTool[]; /** What the viewer holds: the tool, and the link kind Connect draws. */ export interface SchematicToolsState { /** The tool held. */ readonly tool: SchematicTool; /** The link kind Connect draws, by its slot. */ readonly link: string | undefined; } /** What the Schematic offers: the link kinds Connect may draw, and whether Move moves anything. */ export interface SchematicToolsOffered { /** The editable link kinds, by their slots, in the order the Schematic lists them. */ readonly links: readonly string[]; /** Whether an item kind is editable: Move is offered. */ readonly movable: boolean; } /** * The tools the Schematic offers, in order: Select, Zoom box and Marquee * always; Connect over an editable link kind; Move over an editable item kind. * * @param offered - What the Schematic edits * @returns The tools */ export declare function offeredTools(offered: SchematicToolsOffered): SchematicTool[]; /** * What the viewer holds, as the Schematic offers it: a tool it does not offer * is Select, and a link kind it does not edit is the first it does. * * @param held - What the store holds * @param offered - What the Schematic edits * @returns The tool and the link kind in force */ export declare function toolsInForce(held: SchematicToolsState, offered: SchematicToolsOffered): SchematicToolsState; /** * The tools the viewer holds under a key, and how to pick another tool or link * kind: a write every Schematic under that key follows (see the module docs). * * @param key - The Schematic's tools key (`schematicKeys(id).tools`) * @returns What the store holds — Select and no link kind until the viewer picks — and the write that picks */ export declare function useSchematicTools(key: string): [SchematicToolsState, (next: SchematicToolsState) => void]; //# sourceMappingURL=tools.d.ts.map