import { IControl } from 'maplibre-gl';
import { Ref } from 'vue';

/** Common position type for map controls */
declare type MapControlPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";

/**
 * Composable for adding MapLibre controls to the map.
 *
 * This composable handles positioning controls in MapLibre's corner containers
 * (top-left, top-right, etc.) and automatic cleanup on unmount.
 *
 * ## What is IControl?
 *
 * IControl is MapLibre's interface for map controls. It's not a class you extend -
 * it's a TypeScript interface that uses "duck typing": any object with the right
 * methods qualifies. The required methods are:
 *
 *   - onAdd(map): Called when control is added. Must return an HTMLElement.
 *   - onRemove(): Called when control is removed. Handle any cleanup here.
 *
 * So this plain object is a valid IControl:
 *
 *   { onAdd() { return myDiv; }, onRemove() {} }
 *
 * ## Usage
 *
 * For Vue template-based controls (MapButton, MapSearchControl, BasemapDropdown),
 * pass a ref to the container element. The composable creates the IControl internally,
 * returning your Vue template's DOM element from onAdd():
 *
 *   const containerRef = ref<HTMLElement | null>(null);
 *   useMapControl(props, containerRef);
 *
 * For MapLibre's built-in controls (like NavigationControl), pass a function that
 * returns the control. These already implement IControl internally:
 *
 *   useMapControl(props, () => new maplibregl.NavigationControl());
 */
export declare function useMapControl(props: {
    position?: MapControlPosition;
}, controlOrContainer: Ref<HTMLElement | null> | (() => IControl)): void;

export { }


declare global {
    interface Window {
        deleteActivePolygon?: () => void;
        cancelDrawing?: () => void;
        finishDrawing?: () => void;
    }
}


/**
 * Augment window type with Eagleview namespace
 */
declare global {
    interface Window {
        ev?: EagleviewNamespace;
    }
}

