import { type GlobalPoint, type LocalPoint } from "@excalidraw/math"; import type { ElementsMap, ExcalidrawBindableElement, ExcalidrawDiamondElement, ExcalidrawElement, ExcalidrawEllipseElement, ExcalidrawEmbeddableElement, ExcalidrawFrameLikeElement, ExcalidrawFreeDrawElement, ExcalidrawIframeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawRectangleElement, ExcalidrawSelectionElement, ExcalidrawTextElement } from "@excalidraw/element/types"; import type { Curve, LineSegment, Polygon, Radians } from "@excalidraw/math"; import type { Drawable, Op } from "roughjs/bin/core"; export type Polyline = LineSegment[]; export type Polycurve = Curve[]; export type Ellipse = { center: Point; angle: Radians; halfWidth: number; halfHeight: number; }; export type GeometricShape = { type: "line"; data: LineSegment; } | { type: "polygon"; data: Polygon; } | { type: "curve"; data: Curve; } | { type: "ellipse"; data: Ellipse; } | { type: "polyline"; data: Polyline; } | { type: "polycurve"; data: Polycurve; }; type RectangularElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawFrameLikeElement | ExcalidrawEmbeddableElement | ExcalidrawImageElement | ExcalidrawIframeElement | ExcalidrawTextElement | ExcalidrawSelectionElement; export declare const getPolygonShape: (element: RectangularElement) => GeometricShape; export declare const getSelectionBoxShape: (element: ExcalidrawElement, elementsMap: ElementsMap, padding?: number) => GeometricShape; export declare const getEllipseShape: (element: ExcalidrawEllipseElement) => GeometricShape; export declare const getCurvePathOps: (shape: Drawable) => Op[]; export declare const getCurveShape: (roughShape: Drawable, startingPoint: Point | undefined, angleInRadian: Radians, center: Point) => GeometricShape; export declare const getFreedrawShape: (element: ExcalidrawFreeDrawElement, center: Point, isClosed?: boolean) => GeometricShape; export declare const getClosedCurveShape: (element: ExcalidrawLinearElement, roughShape: Drawable, startingPoint: Point | undefined, angleInRadian: Radians, center: Point) => GeometricShape; /** * Determine intersection of a rectangular shaped element and a * line segment. * * @param element The rectangular element to test against * @param segment The segment intersecting the element * @param gap Optional value to inflate the shape before testing * @returns An array of intersections */ export declare const segmentIntersectRectangleElement: (element: ExcalidrawBindableElement, segment: LineSegment, gap?: number) => Point[]; export declare const pointOnEllipse: (point: Point, ellipse: Ellipse, threshold?: number) => boolean; export declare const pointInEllipse: (p: Point, ellipse: Ellipse) => boolean; export declare const ellipseAxes: (ellipse: Ellipse) => { majorAxis: number; minorAxis: number; }; export declare const ellipseFocusToCenter: (ellipse: Ellipse) => number; export declare const ellipseExtremes: (ellipse: Ellipse) => import("@excalidraw/math").Vector[]; export {};