import Layer, { ILayerEvent, ILayerState } from './Layer'; import { ISketchUtils } from './Sketch'; export interface ICircleProps { /** * 半径 */ size: number; /** * 张开角度 * * 取值范围 [0, 360] */ angle: number; /** * 使用弧形 * * 值为 `true` 时,将不会渲染扇形两条直线的边。 */ arc: boolean; /** * 线段样式 */ dash: readonly number[] | null; } export interface ICircleEvent extends ILayerEvent { size: (size: ICircleProps['size']) => void; angle: (angle: ICircleProps['angle']) => void; arc: (arc: ICircleProps['arc']) => void; dash: (dash: ICircleProps['dash']) => void; } /** * 可绘制 圆形、扇形、弧形 */ export default class Circle extends Layer { props: ICircleProps; constructor(state?: Partial, props?: Partial); /** * 设置半径 */ size(value: ICircleProps['size']): this; /** * 设置张开角度 */ angle(value: ICircleProps['angle']): this; /** * 设置弧形 * @param value 值为 `true` 时,将不会渲染扇形两条直线的边。 */ arc(value: ICircleProps['arc']): this; /** * 设置线段样式 */ dash(value: ICircleProps['dash']): this; protected _clone(): Circle; protected _render(ctx: CanvasRenderingContext2D, utils: ISketchUtils): void; }