import { DecalProps } from '@utils/decal'; export interface ArcOptions { x: number; y: number; r: number; startAngle: number; endAngle: number; anticlockwise?: boolean; } export interface AreaOptions { points: Array<{ x: number; y: number }>; fillStyle?: string | CanvasGradient; } export interface CircleOptions { x: number; y: number; r: number; fillStyle?: string; strokeStyle?: string; decal?: DecalProps; } export interface LineOptions { x1: number; y1: number; x2: number; y2: number; type?: 'line' | 'dashed'; lineWidth?: number; strokeStyle?: string; } export interface PolyLineOptions { points: Array<{ x: number; y: number }>; // web坐标系坐标数组 rawPoints?: Array<{ x: number; y: number }>; // 数学坐标系坐标数组 smooth?: boolean; stroke?: string; lineWidth?: number; } export interface RectOptions { x: number; // 原点横坐标 (数学坐标系原点,在左下角) y: number; // 原点纵坐标 width: number; height: number; radius?: Array; fillStyle?: string; strokeStyle?: string; boxShadow?: { offsetX: number; offsetY: number; color: string; blur: number; }; blur?: string; filter?: string; decal?: DecalProps; } export interface SectorOptions { x: number; y: number; r0: number; r1: number; startAngle: number; endAngle: number; interval?: number; anticlockwise?: boolean; fillStyle?: string; strokeStyle?: string; } export interface TextOptions { text: string; x: number; y: number; textAlign?: CanvasTextAlign; textBaseline?: CanvasTextBaseline; fontSize?: number; fontFamily?: string; fontWeight?: string; fontStyle?: string; rotate?: number; } export interface ImageOptions { image: any; x: number; y: number; } export type ShapeOptions = | ArcOptions | AreaOptions | CircleOptions | LineOptions | PolyLineOptions | RectOptions | SectorOptions | TextOptions | ImageOptions;