import { BBox, EdgeId, ExclusiveUnion, Fqn, ViewId } from '@likec4/core'; import { EdgeChange, NodeChange, ReactFlowInstance, ReactFlowState } from '@xyflow/react'; import { ActorRef, SnapshotFrom, StateMachine } from 'xstate'; import { RelationshipDetailsTypes } from './_types'; import { LayoutResult } from './layout'; type XYFLowInstance = ReactFlowInstance; type XYStoreState = ReactFlowState; type XYStoreApi = { getState: () => XYStoreState; }; export type Input = ExclusiveUnion<{ Edge: { edgeId: EdgeId; viewId: ViewId; }; Between: { source: Fqn; target: Fqn; viewId: ViewId; }; }>; type Subject = { edgeId: EdgeId; source?: never; target?: never; } | { source: Fqn; target: Fqn; edgeId?: never; }; export type Context = Readonly<{ subject: Subject; viewId: ViewId; xyflow: XYFLowInstance | null; xystore: XYStoreApi | null; initialized: { xydata: boolean; xyflow: boolean; }; xynodes: RelationshipDetailsTypes.Node[]; xyedges: RelationshipDetailsTypes.Edge[]; bounds: BBox; }>; export type Events = { type: 'xyflow.init'; instance: XYFLowInstance; store: XYStoreApi; } | { type: 'xyflow.nodeClick'; node: RelationshipDetailsTypes.Node; } | { type: 'xyflow.edgeClick'; edge: RelationshipDetailsTypes.Edge; } | { type: 'xyflow.edgeMouseEnter'; edge: RelationshipDetailsTypes.Edge; } | { type: 'xyflow.edgeMouseLeave'; edge: RelationshipDetailsTypes.Edge; } | { type: 'dim.nonhovered.edges'; } | { type: 'undim.edges'; } | { type: 'xyflow.selectionChange'; nodes: RelationshipDetailsTypes.Node[]; edges: RelationshipDetailsTypes.Edge[]; } | { type: 'xyflow.applyNodeChanges'; changes: NodeChange[]; } | { type: 'xyflow.applyEdgeChanges'; changes: EdgeChange[]; } | { type: 'xyflow.paneClick'; } | { type: 'xyflow.paneDblClick'; } | { type: 'xyflow.resized'; } | { type: 'xyflow.updateNodeInternals'; } | { type: 'update.layoutData'; data: LayoutResult; } | { type: 'fitDiagram'; duration?: number; bounds?: BBox; } | { type: 'navigate.to'; params: { edgeId: EdgeId; viewId?: ViewId; } | { source: Fqn; target: Fqn; viewId?: ViewId; }; } | { type: 'close'; }; export type Tags = never; export interface RelationshipDetailsLogic extends StateMachine { } export declare const relationshipDetailsLogic: RelationshipDetailsLogic; export type RelationshipDetailsSnapshot = SnapshotFrom; export interface RelationshipDetailsActorRef extends ActorRef { } export type { Input as RelationshipDetailsInput, };