import { BBox } from '@likec4/core/geometry'; import { DeploymentFqn, DiagramEdge, DiagramNode, DiagramView, Fqn } from '@likec4/core/types'; import { Viewport } from '@xyflow/system'; import { ActorSystem } from 'xstate'; import { EditorActorRef } from '../../editor/editorActor.states'; import { OverlaysActorRef } from '../../overlays/overlaysActor'; import { SearchActorRef } from '../../search/searchActor'; import { Types } from '../types'; import { Context } from './machine.setup'; import { DiagramActorRef, NodeWithData } from './types'; export declare const findNodeByModelFqn: (xynodes: T[], elementFqn: Fqn) => (T & { data: { modelFqn: Fqn; }; }) | null; export declare function typedSystem(system: ActorSystem): { readonly overlaysActorRef: OverlaysActorRef | null; readonly diagramActorRef: DiagramActorRef; readonly searchActorRef: SearchActorRef | null; readonly editorActorRef: EditorActorRef | null; }; export declare namespace typedSystem { var editorActor: ({ system }: { system: ActorSystem; }) => EditorActorRef; var overlaysActor: ({ system }: { system: ActorSystem; }) => OverlaysActorRef; var diagramActor: ({ system }: { system: ActorSystem; }) => DiagramActorRef; var searchActor: ({ system }: { system: ActorSystem; }) => SearchActorRef; } export declare function findDiagramNode(ctx: Context, xynodeId: string): DiagramNode | null; export declare function findDiagramEdge(ctx: Context, xyedgeId: string): DiagramEdge | null; /** * Returns the bounds of the current view from the context. * If {@link nextView} is provided, returns the bounds of the next view. */ export declare function viewBounds(ctx: Pick, nextView?: DiagramView): BBox; export declare function focusedBounds(params: { context: Context; }): { bounds: BBox; duration?: number; }; export declare function activeSequenceBounds(params: { context: Context; }): { bounds: BBox; duration: number; }; export declare function nodeRef(node: Types.Node): Fqn | DeploymentFqn | null; export declare function findCorrespondingNode(context: Pick, event: { view: DiagramView; xynodes: Types.Node[]; }): { fromNode: null; toNode: null; } | { fromNode: Types.Node; toNode: Types.Node | null; }; export declare function calcViewportForBounds(context: Pick, bounds: BBox): Viewport;