import type { SerializedVector2, SignalValue, SimpleSignal } from '@revideo/core'; import { BBox } from '@revideo/core'; import type { CurveProfile } from '../curves'; import type { DesiredLength } from '../partials'; import type { CurveProps } from './Curve'; import { Curve } from './Curve'; export interface PolygonProps extends CurveProps { /** * {@inheritDoc Polygon.sides} */ sides?: SignalValue; /** * {@inheritDoc Polygon.radius} */ radius?: SignalValue; } /** * A node for drawing regular polygons. * * @remarks * This node can be used to render shapes such as: triangle, pentagon, * hexagon and more. * * Note that the polygon is inscribed in a circle defined by the height * and width. If height and width are unequal, the polygon is inscribed * in the resulting ellipse. * * Since the polygon is inscribed in the circle, the actual displayed * height and width may differ somewhat from the bounding rectangle. This * will be particularly noticeable if the number of sides is low, e.g. for a * triangle. * * @preview * ```tsx editor * // snippet Polygon * import {makeScene2D, Polygon} from '@revideo/2d'; * import {createRef} from '@revideo/core'; * * export default makeScene2D(function* (view) { * const ref = createRef(); * view.add( * * ); * * yield* ref().sides(3, 2).to(6, 2); * }); * * // snippet Pentagon outline * import {makeScene2D, Polygon} from '@revideo/2d'; * * export default makeScene2D(function* (view) { * view.add( * * ); * }); * ``` */ export declare class Polygon extends Curve { /** * The number of sides of the polygon. * * @remarks * For example, a value of 6 creates a hexagon. * * @example * ```tsx * * ``` */ readonly sides: SimpleSignal; /** * The radius of the polygon's corners. * * @example * ```tsx * * ``` */ readonly radius: SimpleSignal; constructor(props: PolygonProps); profile(): CurveProfile; protected desiredSize(): SerializedVector2; protected offsetComputedLayout(box: BBox): BBox; protected childrenBBox(): BBox; protected requiresProfile(): boolean; protected getPath(): Path2D; protected getRipplePath(): Path2D; protected createPath(expand?: number): Path2D; } //# sourceMappingURL=Polygon.d.ts.map