import { BBox, Fqn, ViewId } from '@likec4/core'; import { EdgeChange, NodeChange, ReactFlowInstance, ReactFlowState } from '@xyflow/react'; import { ActorRef, SnapshotFrom, StateMachine, PromiseActorLogic, EventObject } from 'xstate'; import { RelationshipsBrowserTypes } from './_types'; import { LayoutRelationshipsViewResult } from './layout'; type XYFLowInstance = ReactFlowInstance; type XYStoreState = ReactFlowState; type XYStoreApi = { getState: () => XYStoreState; setState: (state: XYStoreState) => void; }; export declare const layouter: PromiseActorLogic<{ xyedges: RelationshipsBrowserTypes.Edge[]; xynodes: RelationshipsBrowserTypes.Node[]; }, { subjectId: Fqn; navigateFromNode: string | null; xyflow: XYFLowInstance; xystore: XYStoreApi; update: LayoutRelationshipsViewResult; }, EventObject>; export type Input = { subject: Fqn; viewId: ViewId | null; scope: 'global' | 'view'; closeable?: boolean; enableSelectSubject?: boolean; enableChangeScope?: boolean; }; export interface Context { subject: Fqn; viewId: ViewId | null; scope: 'global' | 'view'; closeable: boolean; enableSelectSubject: boolean; enableChangeScope: boolean; xyflow: XYFLowInstance | null; xystore: XYStoreApi | null; layouted: LayoutRelationshipsViewResult | null; navigateFromNode: string | null; xynodes: RelationshipsBrowserTypes.Node[]; xyedges: RelationshipsBrowserTypes.Edge[]; } export type Events = { type: 'xyflow.init'; instance: XYFLowInstance; store: XYStoreApi; } | { type: 'xyflow.nodeClick'; node: RelationshipsBrowserTypes.Node; } | { type: 'xyflow.edgeClick'; edge: RelationshipsBrowserTypes.Edge; } | { type: 'xyflow.applyNodeChanges'; changes: NodeChange[]; } | { type: 'xyflow.applyEdgeChanges'; changes: EdgeChange[]; } | { type: 'xyflow.paneClick'; } | { type: 'xyflow.paneDblClick'; } | { type: 'xyflow.resized'; } | { type: 'xyflow.edgeMouseEnter'; edge: RelationshipsBrowserTypes.Edge; } | { type: 'xyflow.edgeMouseLeave'; edge: RelationshipsBrowserTypes.Edge; } | { type: 'xyflow.selectionChange'; nodes: RelationshipsBrowserTypes.Node[]; edges: RelationshipsBrowserTypes.Edge[]; } | { type: 'dim.nonhovered.edges'; } | { type: 'undim.edges'; } | { type: 'xyflow.updateNodeInternals'; } | { type: 'xyflow.unmount'; } | { type: 'fitDiagram'; duration?: number; bounds?: BBox; } | { type: 'navigate.to'; subject: Fqn; fromNode?: string | undefined; viewId?: ViewId | undefined; } | { type: 'update.xydata'; xynodes: RelationshipsBrowserTypes.Node[]; xyedges: RelationshipsBrowserTypes.Edge[]; } | { type: 'change.scope'; scope: 'global' | 'view'; } | { type: 'update.view'; layouted: LayoutRelationshipsViewResult; } | { type: 'close'; }; type Tags = 'active'; export interface RelationshipsBrowserLogic extends StateMachine { } export declare const relationshipsBrowserLogic: RelationshipsBrowserLogic; export type RelationshipsBrowserSnapshot = SnapshotFrom; export interface RelationshipsBrowserActorRef extends ActorRef { } export type { Input as RelationshipsBrowserInput, };