import { Rectangle } from './infrastructure/Rectangle'; import { CanvasColour, Rect } from './interfaces'; import { RenderShape, TitleMode } from './types/globalEnums'; export declare enum SlotType { Array = "array", Event = -1 } /** @see RenderShape */ export declare enum SlotShape { Box = 1, Arrow = 5, Grid = 6, Circle = 3, HollowCircle = 7 } /** @see LinkDirection */ export declare enum SlotDirection { Up = 1, Right = 4, Down = 2, Left = 3 } export declare enum LabelPosition { Left = "left", Right = "right" } export interface IDrawBoundingOptions { /** The shape to render */ shape?: RenderShape; /** The radius of the rounded corners for {@link RenderShape.ROUND} and {@link RenderShape.CARD} */ round_radius?: number; /** Shape will extend above the Y-axis 0 by this amount @deprecated This is node-specific: it should be removed entirely, and behaviour defined by the caller more explicitly */ title_height?: number; /** @deprecated This is node-specific: it should be removed entirely, and behaviour defined by the caller more explicitly */ title_mode?: TitleMode; /** The color that should be drawn */ color?: CanvasColour; /** The distance between the edge of the {@link area} and the middle of the line */ padding?: number; /** @deprecated This is node-specific: it should be removed entirely, and behaviour defined by the caller more explicitly */ collapsed?: boolean; /** Thickness of the line drawn (`lineWidth`) */ lineWidth?: number; } export interface IDrawTextInAreaOptions { /** The canvas to draw the text on. */ ctx: CanvasRenderingContext2D; /** The text to draw. */ text: string; /** The area the text will be drawn in. */ area: Rectangle; /** The alignment of the text. */ align?: "left" | "right" | "center"; } /** * Draws only the path of a shape on the canvas, without filling. * Used to draw indicators for node status, e.g. "selected". * @param ctx The 2D context to draw on * @param area The position and size of the shape to render */ export declare function strokeShape(ctx: CanvasRenderingContext2D, area: Rect, { shape, round_radius, title_height, title_mode, color, padding, collapsed, lineWidth: thickness, }?: IDrawBoundingOptions): void; /** * Draws text within an area, truncating it and adding an ellipsis if necessary. */ export declare function drawTextInArea({ ctx, text, area, align }: IDrawTextInAreaOptions): void;