import type { SVG } from '../../../diagram-api/types.js'; import type { InternalHelpers } from '../../../internals.js'; import type { D3Selection } from '../../../types.js'; import { createGraphWithElements } from '../../createGraph.js'; import type { LayoutData, Edge } from '../../types.js'; import type { RenderOptions } from '../../render.js'; export type CommonLayoutMeasure = Awaited>; type ClusterDb = Map>; export interface CommonLayoutRenderContext { element: D3Selection; helpers?: InternalHelpers; options?: RenderOptions; preparedLayout?: PreparedLayout; } export interface CommonLayoutPaintContext extends CommonLayoutRenderContext { measure: MeasureResult; } export interface CommonLayoutPaintOptions { clusterDb?: ClusterDb; getNodes?: (data4Layout: LayoutData, context: CommonLayoutPaintContext) => Iterable; getEdgeNode?: (id: string | undefined, edge: Edge, context: CommonLayoutPaintContext) => LayoutData['nodes'][number] | object | undefined; skipNode?: (node: LayoutData['nodes'][number], context: CommonLayoutPaintContext) => boolean; isCluster?: (node: LayoutData['nodes'][number], context: CommonLayoutPaintContext) => boolean; skipEdge?: (edge: Edge) => boolean; skipIntersect?: boolean | ((edge: Edge) => boolean); } export interface CommonLayoutRendererDefinition { prepareLayout?: (data4Layout: LayoutData, context: CommonLayoutRenderContext) => PreparedLayout | Promise; measureLayout?: (data4Layout: LayoutData, context: CommonLayoutRenderContext) => Promise; runLayoutCore: (data4Layout: LayoutData, context: CommonLayoutRenderContext) => CoreResult | Promise; paintLayout?: (data4Layout: LayoutData, context: CommonLayoutPaintContext, coreResult: CoreResult) => void | Promise; afterPaint?: (data4Layout: LayoutData, context: CommonLayoutPaintContext, coreResult: CoreResult) => void | Promise; paintOptions?: CommonLayoutPaintOptions; } export declare function createCommonLayoutRenderer({ prepareLayout, measureLayout, runLayoutCore, paintLayout, afterPaint, paintOptions, }: CommonLayoutRendererDefinition): (data4Layout: LayoutData, svg: SVG, helpers?: InternalHelpers, options?: RenderOptions) => Promise; export declare function clearLayoutRenderState(): void; export declare function defaultMeasureLayout(data4Layout: LayoutData, { element }: CommonLayoutRenderContext): Promise; export declare function paintLayoutData(data4Layout: LayoutData, context: CommonLayoutPaintContext, options?: CommonLayoutPaintOptions): Promise; export {};