import { Map as OLMap, Feature } from 'ol';
import { default as VectorLayer } from 'ol/layer/Vector';
import { default as VectorSource } from 'ol/source/Vector';
import { Geometry } from 'ol/geom';
import { Style } from 'ol/style';
import { Coordinate } from 'ol/coordinate';
import { EventsKey } from 'ol/events';

/**
 * 标绘样式配置接口
 */
export interface DrawingStyleConfig {
    fillColor?: string;
    fillOpacity?: number;
    strokeColor?: string;
    strokeWidth?: number;
    strokeOpacity?: number;
    strokeDashArray?: number[];
    pointColor?: string;
    pointSize?: number;
    pointStyle?: "circle" | "square" | "triangle" | "star" | "cross" | "x" | "diffusion" | "gif" | "icon" | "ripple";
    textContent?: string;
    fontSize?: number;
    fontFamily?: string;
    textColor?: string;
    textAlign?: "left" | "center" | "right" | "start" | "end";
    textBaseline?: "top" | "middle" | "bottom" | "alphabetic" | "hanging";
    textOffsetX?: number;
    textOffsetY?: number;
    imageUrl?: string;
    imageSize?: [number, number];
    imageScale?: number;
    imageRotation?: number;
    selectionColor?: string;
    selectionWidth?: number;
    selectionOpacity?: number;
    showEditHandles?: boolean;
    editHandleSize?: number;
    editHandleColor?: string;
    zIndex?: number;
    opacity?: number;
}
/**
 * 标绘配置接口
 */
export interface DrawingConfig {
    id?: string;
    name?: string;
    type: string;
    coordinates?: Coordinate | Coordinate[] | Coordinate[][] | Coordinate[][][] | {
        center: Coordinate;
        radius: number;
    } | {
        topLeft: Coordinate;
        bottomRight: Coordinate;
    };
    properties?: Record<string, any>;
    style?: DrawingStyleConfig;
    visible?: boolean;
    selectable?: boolean;
    editable?: boolean;
    deletable?: boolean;
}
/**
 * 标绘事件接口
 */
export interface DrawingEvents {
    "drawing:created": (drawing: BaseDrawing) => void;
    "drawing:updated": (drawing: BaseDrawing) => void;
    "drawing:deleted": (drawing: BaseDrawing) => void;
    "drawing:selected": (drawing: BaseDrawing) => void;
    "drawing:deselected": (drawing: BaseDrawing) => void;
    "drawing:hover": (drawing: BaseDrawing) => void;
    "drawing:click": (drawing: BaseDrawing, event: any) => void;
}
/**
 * 基础标绘类
 * 所有标绘类的基类，提供通用的接口和基础功能
 */
export declare abstract class BaseDrawing<TConfig extends DrawingConfig = DrawingConfig, TStyle extends DrawingStyleConfig = DrawingStyleConfig> {
    protected map: OLMap | null;
    protected layer: VectorLayer<VectorSource> | null;
    protected source: VectorSource | null;
    protected feature: Feature<Geometry> | null;
    protected eventListeners: EventsKey[];
    protected eventHandlers: Map<string, Function[]>;
    protected _config: TConfig;
    protected _style: TStyle;
    protected _visible: boolean;
    protected _selected: boolean;
    constructor(config: TConfig);
    /**
     * 生成唯一ID
     */
    protected generateId(): string;
    /**
     * 初始化标绘
     */
    initialize(map: OLMap, layer?: VectorLayer<VectorSource>): void;
    /**
     * 创建要素 - 抽象方法，由子类实现
     */
    protected abstract createFeature(): void;
    /**
     * 创建样式 - 抽象方法，由子类实现
     */
    protected abstract createStyle(): Style | Style[];
    /**
     * 更新样式
     */
    updateStyle(styleConfig?: Partial<TStyle>): void;
    /**
     * 绑定事件
     */
    protected bindEvents(): void;
    /**
     * 要素点击事件处理
     */
    protected onFeatureClick(event: any): void;
    /**
     * 要素悬停事件处理
     */
    protected onFeatureHover(event: any): void;
    /**
     * 设置选中状态
     */
    setSelected(selected: boolean): void;
    /**
     * 更新选中状态的样式
     */
    protected updateSelectionStyle(): void;
    /**
     * 创建选择样式 - 子类可以重写此方法来自定义选中样式
     */
    protected createSelectionStyles(): Style[];
    /**
     * 设置可见性
     */
    setVisible(visible: boolean): void;
    /**
     * 获取可见性
     */
    getVisible(): boolean;
    /**
     * 获取选中状态
     */
    getSelected(): boolean;
    /**
     * 更新坐标
     */
    updateCoordinates(coordinates: Coordinate | Coordinate[] | Coordinate[][] | {
        center: Coordinate;
        radius: number;
    } | {
        topLeft: Coordinate;
        bottomRight: Coordinate;
    }): void;
    /**
     * 更新要素几何 - 抽象方法，由子类实现
     */
    protected abstract updateFeatureGeometry(): void;
    /**
     * 获取配置
     */
    getConfig(): TConfig;
    /**
     * 获取样式配置
     */
    getStyleConfig(): TStyle;
    /**
     * 获取要素
     */
    getFeature(): Feature<Geometry> | null;
    /**
     * 获取图层
     */
    getLayer(): VectorLayer<VectorSource> | null;
    /**
     * 获取ID
     */
    getId(): string;
    /**
     * 获取类型
     */
    getType(): string;
    /**
     * 获取名称
     */
    getName(): string;
    /**
     * 设置名称
     */
    setName(name: string): void;
    /**
     * 获取坐标
     */
    getCoordinates(): Coordinate | Coordinate[] | Coordinate[][] | Coordinate[][][] | {
        center: Coordinate;
        radius: number;
    } | {
        topLeft: Coordinate;
        bottomRight: Coordinate;
    } | undefined;
    /**
     * 获取属性
     */
    getProperties(): Record<string, any>;
    /**
     * 设置属性
     */
    setProperties(properties: Record<string, any>): void;
    /**
     * 获取边界框
     */
    getBounds(): [number, number, number, number] | null;
    /**
     * 缩放到标绘
     */
    zoomTo(padding?: number[]): void;
    /**
     * 克隆标绘
     */
    clone(): BaseDrawing;
    /**
     * 创建实例 - 抽象方法，由子类实现
     */
    protected abstract createInstance(config: TConfig): BaseDrawing<TConfig, TStyle>;
    /**
     * 序列化为JSON
     */
    toJSON(): any;
    /**
     * 从JSON反序列化
     */
    static fromJSON(data: any): BaseDrawing<any, any>;
    /**
     * 销毁标绘
     */
    destroy(): void;
    /**
     * 事件发射器 - 简单实现
     */
    on(event: string, handler: Function): void;
    off(event: string, handler?: Function): void;
    protected emit(event: string, ...args: any[]): void;
}
/**
 * 标绘工厂接口
 */
export interface DrawingFactory {
    create(config: DrawingConfig): BaseDrawing;
    getType(): string;
    getSupportedTypes(): string[];
}
//# sourceMappingURL=BaseDrawing.d.ts.map