import type { Box } from './Box'; import type { Point, PointLike } from './Point'; import type { Vector } from './Vector'; export type AnyShape = Shape; export declare enum ShapeTag { Segment = 0, Arc = 1, Bezier = 2, Quadratic = 3, Box = 4, Circle = 5, Path = 6, Ray = 7, Line = 8, Multiline = 9, Point = 10, Polygon = 11, Vector = 12 } export declare const MAX_EDGE_SHAPE_TAG = ShapeTag.Quadratic; /** * Base class representing shape * Implement common methods of affine transformations */ export declare abstract class Shape { abstract get tag(): ShapeTag; abstract get name(): string; abstract get box(): Box; abstract get center(): Point; abstract clone(): Shape; /** * Data field for rendering engines, can be used to store cached data. * e.g. Path2D when rendering to the canvas */ _data: any; constructor(); /** * Returns new shape translated by given vector. * Translation vector may be also defined by a pair of numbers. */ translate(v: Vector): T; translate(p: { x: number; y: number; }): T; translate(x: number, y: number): T; /** * Returns new shape rotated by given angle around given center point. * If center point is omitted, rotates around zero point (0,0). * Positive value of angle defines rotation in counterclockwise direction, * negative angle defines rotation in clockwise direction * @param angle - angle in radians * @param [center=(0,0)] center */ rotate(angle: number, center?: PointLike): T; /** * Return new shape with coordinates multiplied by scaling factor */ scale(s: number): T; scale(sx: number, sy: number): T; transform(_a: unknown): T; abstract contains(other: Shape): boolean; /** * This method returns an object that defines how data will be * serialized when called JSON.stringify() method */ toJSON(): { name: string; } & Record; } //# sourceMappingURL=Shape.d.ts.map