/** * Node shape library. Each shape knows how to draw its outline inside a box, * where its label goes and how much padding the label needs. Shapes are * composed only of canvas primitives, so they render identically in * Excalidraw, SVG and PNG. * @module draw/shapes */ export type Canvas = import("./canvas.mjs").Canvas; export type Style = import("./canvas.mjs").Style; export type Point = import("./canvas.mjs").Point; export type ShapeDef = { /** * Label placement. */ label: "inside" | "below"; /** * Label padding (top, right, bottom, left) for inside labels. */ pad: [number, number, number, number]; /** * Fixed icon size for `below` shapes. */ icon?: [number, number]; /** * Minimum outline size. */ min?: [number, number]; /** * Returns the bindable element id. */ draw: (c: Canvas, x: number, y: number, w: number, h: number, s: Style) => string; }; /** * Sample an elliptic arc into points. * @param {number} cx * @param {number} cy * @param {number} rx * @param {number} ry * @param {number} a0 Start angle in degrees. * @param {number} a1 End angle in degrees. * @param {number} [steps] * @returns {Point[]} */ export declare function arc(cx: number, cy: number, rx: number, ry: number, a0: number, a1: number, steps?: number): Point[]; /** @type {Record} */ export declare const SHAPES: Record; /** * Look up a shape definition (falls back to `rectangle`). * @param {string} name * @returns {ShapeDef} */ export declare function shape(name: string): ShapeDef;