import { type ComponentType } from "react"; import { type ButtonProps } from "../../atoms/button/button.shared.js"; import { type SelectProps } from "../../atoms/select/select.shared.js"; import { type FlowEdge, type FlowNode, type FlowPaletteItem, type FlowPoint, type FlowSelection } from "./flow-editor.logic.js"; import { type FlowEditorSkin } from "./flow-editor.styles.js"; export type { FlowEdge, FlowNode, FlowPaletteItem, FlowPoint, FlowSelection }; export interface FlowEditorProps { /** Accessible name of the canvas, such as "Workflow version 3". */ label: string; /** The cards, controlled. */ nodes: FlowNode[]; /** The connections, controlled. */ edges: FlowEdge[]; /** Kinds of node the user can add; omit for no palette. */ palette?: FlowPaletteItem[]; /** Controlled selection; null selects nothing. Omit for uncontrolled use. */ selected?: FlowSelection | null; /** Initial selection for uncontrolled use. */ defaultSelected?: FlowSelection | null; /** Fired when the selection changes, in both modes. */ onSelectionChange?: (selection: FlowSelection | null) => void; /** A card was moved to a new top-left corner (snapped unless `freePlacement`). */ onMoveNode?: (id: string, point: FlowPoint) => void; /** The user asked for an edge between two cards. */ onConnect?: (from: string, to: string) => void; /** The user asked to add a node of a palette kind with its top-left corner at `point`. */ onAddNode?: (paletteId: string, point: FlowPoint) => void; /** The user asked to delete the selected node or edge. */ onDelete?: (selection: FlowSelection) => void; /** Show the graph without editing: no toolbar edits, drags or ports; pan, zoom and selection stay. */ readOnly?: boolean; /** Place cards exactly where they are dropped instead of on the grid. */ freePlacement?: boolean; /** E2E hook forwarded to the root element. */ testID?: string; } /** The platform-styled controls the toolbar composes. */ export interface FlowEditorParts { Button: ComponentType; Select: ComponentType; } /** Build a FlowEditor from a platform skin and its toolbar controls. */ export declare function createFlowEditor(skin: FlowEditorSkin, parts: FlowEditorParts): (props: FlowEditorProps) => import("react").JSX.Element; //# sourceMappingURL=flow-editor.shared.d.ts.map