import { Component, VNode } from 'vue';
import { Map } from 'ol';
import { MapManager } from '../core/MapManager';

export type PluginPosition = "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right" | "overlay" | "custom";
export interface PluginSize {
    width?: string | number;
    height?: string | number;
    minWidth?: string | number;
    minHeight?: string | number;
    maxWidth?: string | number;
    maxHeight?: string | number;
}
export interface PluginStyle {
    backgroundColor?: string;
    borderRadius?: string;
    padding?: string;
    margin?: string;
    boxShadow?: string;
    zIndex?: number;
    opacity?: number;
    className?: string;
    customStyles?: Record<string, any>;
}
export interface PluginAnimation {
    enabled?: boolean;
    type?: "fade" | "slide" | "scale" | "bounce";
    duration?: number;
    delay?: number;
    easing?: string;
}
export interface PluginResponsive {
    breakpoints?: {
        xs?: Partial<PluginConfig>;
        sm?: Partial<PluginConfig>;
        md?: Partial<PluginConfig>;
        lg?: Partial<PluginConfig>;
        xl?: Partial<PluginConfig>;
        xxl?: Partial<PluginConfig>;
    };
    hideOnMobile?: boolean;
    hideOnTablet?: boolean;
    hideOnDesktop?: boolean;
}
export interface PluginEvents {
    onMount?: (plugin: PluginInstance) => void;
    onUnmount?: (plugin: PluginInstance) => void;
    onShow?: (plugin: PluginInstance) => void;
    onHide?: (plugin: PluginInstance) => void;
    onResize?: (plugin: PluginInstance, size: {
        width: number;
        height: number;
    }) => void;
    onPositionChange?: (plugin: PluginInstance, position: PluginPosition) => void;
    [key: string]: any;
}
export interface PluginPermissions {
    roles?: string[];
    permissions?: string[];
    customCheck?: (context: PluginContext) => boolean;
}
export interface PluginContext {
    map: Map;
    mapManager: MapManager;
    pluginManager: any;
    config: any;
    user?: any;
    [key: string]: any;
}
export interface PluginConfig {
    id: string;
    name: string;
    type?: string;
    enabled?: boolean;
    visible?: boolean;
    position: PluginPosition;
    offset?: {
        x: number;
        y: number;
    };
    size?: PluginSize;
    style?: PluginStyle;
    animation?: PluginAnimation;
    responsive?: PluginResponsive;
    zIndex?: number;
    order?: number;
    draggable?: boolean;
    resizable?: boolean;
    collapsible?: boolean;
    closable?: boolean;
    permissions?: PluginPermissions;
    events?: PluginEvents;
    props?: Record<string, any>;
    slots?: {
        [slotName: string]: {
            enabled?: boolean;
            template?: string | Component;
            props?: Record<string, any>;
        };
    };
    render?: (context: PluginContext) => VNode | string;
    component?: string | Component;
    dependencies?: string[];
    conflicts?: string[];
    metadata?: Record<string, any>;
    version?: string;
    author?: string;
    description?: string;
    tags?: string[];
    [key: string]: any;
}
export interface PluginInstance {
    id: string;
    config: PluginConfig;
    context: PluginContext;
    element?: HTMLElement;
    component?: any;
    mount(): Promise<void>;
    unmount(): Promise<void>;
    show(): void;
    hide(): void;
    isVisible(): boolean;
    isEnabled(): boolean;
    setPosition(position: PluginPosition, offset?: {
        x: number;
        y: number;
    }): void;
    getPosition(): {
        position: PluginPosition;
        offset?: {
            x: number;
            y: number;
        };
    };
    setSize(size: PluginSize): void;
    getSize(): PluginSize;
    setStyle(style: Partial<PluginStyle>): void;
    getStyle(): PluginStyle;
    emit(event: string, ...args: any[]): void;
    on(event: string, handler: Function): void;
    off(event: string, handler?: Function): void;
    updateConfig(config: Partial<PluginConfig>): void;
    destroy(): void;
}
export interface PluginManagerConfig {
    globalStyle?: PluginStyle;
    globalAnimation?: PluginAnimation;
    container?: {
        className?: string;
        style?: Record<string, any>;
    };
    responsive?: {
        enabled?: boolean;
        breakpoints?: Record<string, number>;
    };
    performance?: {
        lazyLoad?: boolean;
        virtualScroll?: boolean;
        debounceResize?: number;
    };
    debug?: boolean;
    plugins?: PluginConfig[];
    [key: string]: any;
}
export interface PluginRegistration {
    id: string;
    name: string;
    component: Component;
    defaultConfig?: Partial<PluginConfig>;
    version?: string;
    dependencies?: string[];
    install?: (context: PluginContext) => void;
    uninstall?: (context: PluginContext) => void;
}
export interface PluginContainerConfig {
    position: PluginPosition;
    plugins: PluginInstance[];
    style?: PluginStyle;
    className?: string;
    direction?: "horizontal" | "vertical";
    gap?: string | number;
    wrap?: boolean;
    justify?: "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly";
    align?: "start" | "center" | "end" | "stretch";
    [key: string]: any;
}
export type BuiltinPluginType = "map-toolbar" | "map-controls" | "map-search" | "toolbar" | "search" | "controls" | "tooltip" | "legend" | "layer-switcher" | "measurement" | "drawing" | "overview-map" | "scale-line" | "mouse-position" | "attribution" | "fullscreen" | "zoom" | "rotate" | "location" | "info-panel" | "context-menu";
export interface PluginState {
    mounted: boolean;
    visible: boolean;
    enabled: boolean;
    loading: boolean;
    error?: Error;
    position: PluginPosition;
    size: PluginSize;
    style: PluginStyle;
}
export interface PluginHooks {
    beforeMount?: (instance: PluginInstance) => void | Promise<void>;
    mounted?: (instance: PluginInstance) => void | Promise<void>;
    beforeUnmount?: (instance: PluginInstance) => void | Promise<void>;
    unmounted?: (instance: PluginInstance) => void | Promise<void>;
    beforeUpdate?: (instance: PluginInstance, newConfig: PluginConfig) => void | Promise<void>;
    updated?: (instance: PluginInstance, oldConfig: PluginConfig) => void | Promise<void>;
    error?: (instance: PluginInstance, error: Error) => void;
}
//# sourceMappingURL=plugin.d.ts.map