import { Feature, Overlay } from 'ol';
import { Coordinate } from 'ol/coordinate';
import { App, ComponentPublicInstance } from 'vue';

export type PopupType = "html" | "image" | "array" | "all" | "custom";
export interface BasePopupConfig {
    type: PopupType;
    position?: "auto" | "top" | "bottom" | "left" | "right";
    showCloseButton?: boolean;
    maxWidth?: number;
    maxHeight?: number;
    offset?: [number, number];
    className?: string;
    closable?: boolean;
    autoPan?: boolean;
    vertical?: boolean;
    priorityMode?: boolean;
    autoPanAnimation?: {
        duration?: number;
        source?: Coordinate;
    };
    events?: {
        onRowClick?: (item: any, index: number) => void;
        onClose?: () => void;
        [key: string]: any;
    };
}
export interface HtmlPopupConfig extends BasePopupConfig {
    type: "html";
    content: string | ((feature: Feature, coordinate: Coordinate) => string);
    template?: {
        title?: string;
        body?: string;
    };
}
export interface ImagePopupConfig extends BasePopupConfig {
    type: "image";
    images: string[] | ((feature: Feature, coordinate: Coordinate) => string[]);
    title?: string;
    description?: string;
    showThumbnails?: boolean;
    allowZoom?: boolean;
    slideshow?: boolean;
}
export interface ArrayPopupConfig extends BasePopupConfig {
    type: "array";
    fields: PopupField[];
    title?: string;
    description?: string;
    showHeader?: boolean;
    striped?: boolean;
    bordered?: boolean;
    compact?: boolean;
    allowViewSwitch?: boolean;
    defaultView?: "table" | "list" | "card";
    searchable?: boolean;
    showStats?: boolean;
    pagination?: boolean;
    pageSize?: number;
    data?: any[] | ((feature: Feature, coordinate: Coordinate) => any[]);
}
export interface AllPopupConfig extends BasePopupConfig {
    type: "all";
    title?: string;
    excludeFields?: string[];
    includeFields?: string[];
    fieldLabels?: Record<string, string>;
    showEmpty?: boolean;
    groupBy?: string;
    htmlContent?: string | ((feature: Feature, coordinate: Coordinate) => string);
    images?: string[] | ((feature: Feature, coordinate: Coordinate) => string[]);
    data?: any[] | ((feature: Feature, coordinate: Coordinate) => any[]);
    fields?: PopupField[];
}
export interface CustomPopupConfig extends BasePopupConfig {
    type: "custom";
    component: any;
    props?: Record<string, any> | ((feature: Feature | undefined, coordinate: Coordinate) => Record<string, any>);
}
export interface PopupField {
    key?: string;
    name?: string;
    label: string;
    type?: "text" | "number" | "date" | "boolean" | "link" | "image";
    format?: string | ((value: any) => string);
    visible?: boolean | ((feature: Feature) => boolean);
    sortable?: boolean;
    width?: string | number;
}
export type PopupConfig = HtmlPopupConfig | ImagePopupConfig | ArrayPopupConfig | AllPopupConfig | CustomPopupConfig;
export interface PopupInstance {
    id: string;
    type: PopupType;
    config: PopupConfig;
    coordinate: Coordinate;
    feature?: Feature;
    layerId?: string;
    overlay: Overlay;
    container: HTMLElement;
    component: ComponentPublicInstance | null;
    app: App | null;
    createdAt: Date;
}
export interface PopupEvents {
    "popup:show": {
        instance: PopupInstance;
    };
    "popup:hide": {
        instance: PopupInstance;
    };
    "popup:close": {
        instance: PopupInstance;
    };
    "popup:content-change": {
        instance: PopupInstance;
        content: any;
    };
}
export interface PopupManagerConfig {
    maxPopups?: number;
    defaultConfig?: Partial<BasePopupConfig>;
    container?: HTMLElement;
    zIndex?: number;
    priorityMode?: boolean;
    autoClose?: boolean;
    closeOnMapClick?: boolean;
    onShow?: (id: string, config: PopupConfig, feature?: Feature, coordinate?: Coordinate) => void;
    onHide?: (id: string) => void;
    onClose?: (id: string) => void;
}
//# sourceMappingURL=types.d.ts.map