/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import type { flowchartKeys } from "@elaraai/e3-ui/internal"; import { type FlowchartCanvasDrop, type FlowchartDropContext } from "./drop.js"; import type { FlowchartHolding, GestureEdits } from "./edits.js"; import type { FlowchartWords } from "./messages.js"; import type { FlowchartValue } from "./model.js"; import type { FlowchartSelection } from "./selection.js"; /** The names a Flowchart keeps its viewer's state under. */ type FlowchartKeys = ReturnType; /** What the frame hands its drop target. */ export interface FlowchartDropProps { /** The payload: its library's tabs, and its kinds' cards. */ readonly value: FlowchartValue; /** The names the Flowchart keeps its state under: its library's id, and its drop target. */ readonly keys: FlowchartKeys; /** The Flowchart as it stands now — never a render's copy: what a drop plans over. */ readonly context: () => FlowchartDropContext; /** What the Flowchart holds now: what a drop's edits are made over. */ readonly holding: () => FlowchartHolding; /** * Records a drop's edits as one step of the history, under its name — every row whose key its kind builds from it * following its fields, and a refusal said in the footer (#1549). * * @returns The edits recorded; `undefined` where nothing was */ readonly record: (made: GestureEdits, label: string) => GestureEdits | undefined; /** What the canvas has selected now. */ readonly selection: () => FlowchartSelection | null; /** Selects the state or the lane a drop added — scrolling it into view, for a card's ⏎. */ readonly select: (selection: FlowchartSelection, scroll: boolean) => void; /** Says why a card's ⏎ was refused, in the footer; `undefined` clears it. */ readonly notice: (text: string | undefined) => void; /** The Flowchart's words. */ readonly words: FlowchartWords; /** Whether a card drags onto the canvas: `false` below 480px of main, where no target registers and the canvas has no drop cell. */ readonly drags?: boolean | undefined; } /** What the drop target hands the canvas and the library. */ export interface FlowchartDropState { /** The canvas's drop cell; `undefined` while no tab of the library drops, or no card drags. */ readonly canvas: FlowchartCanvasDrop | undefined; /** A card's ⏎: the card, by its library and its key, dropped on the canvas's selection. */ readonly enter: (library: string, key: string) => void; } /** * The Flowchart's drop target — see the module docs. * * @param props - The payload, the Flowchart's keys, how a drop reads the Flowchart and records itself, the canvas's * selection, what a drop selects, the footer's line, and the words * @returns The canvas's drop cell, and a card's ⏎ */ export declare function useFlowchartDrop(props: FlowchartDropProps): FlowchartDropState; export {}; //# sourceMappingURL=use-drop.d.ts.map