import { Feature } from 'ol';
import { Coordinate } from 'ol/coordinate';
import { Geometry as GeometryApi, LineString, Point, Polygon } from 'ol/geom';
import { Type } from 'ol/geom/Geometry';
import { default as VectorLayer } from 'ol/layer/Vector';
import { default as VectorSource } from 'ol/source/Vector';
import { MapRepresentationDTO, Coordinate as CoordinateApi } from '../../api/services/generated/api';
import { GEMLayerConfig, WMSLayerConfig } from '../../services/Map/types';
import { MapConfig } from './config';
export type MapEvents = {
    drawGemRoad: {
        netId: number;
        roadId: number;
        chainage: number;
    };
    drawInitialGemRoad: {
        netId: number;
        roadId: number;
        chainage: number;
    };
    drawGeometry: {
        geometries: MapRepresentationDTO[] | GugikGeometryResponse['data']['response']['geometry'][];
    };
    movePointIcon: number;
    'map:geolocation:toggle': boolean;
    setPositionChange: {
        coords: Coordinate;
    };
    reloadFeatures: () => void;
};
export type SnapEvents = {
    'map:snap:deactivate': () => void;
    'map:snap:angle:disable': () => void;
    'map:snap:angle:enable': () => void;
    'map:snap:update:config': SnapConfiguration;
    'map:snap:middle:toggle': {
        snapToMiddleOfLine: boolean;
    };
    'map:snap:center:toggle': {
        snapToCenter: boolean;
    };
    'map:snap:angle:toggle': {
        snapToAngle: boolean;
    };
    'map:snap:toggle:visualization': boolean;
    'map:snap:toggle': () => void;
};
export type NavigationEvents = {
    updateNavigationInfo: ItemPositionResponse;
};
export type GeometryEvents = {
    clearDrawnGeometries: [];
};
export type LayersEvents = {
    onLayersSelected: (GEMLayer | WMSLayerDetailed)[];
    onLayersDeselected: (GEMLayer | WMSLayerDetailed)[];
    onRestartLayers: () => void;
};
export type VectorLayerType = VectorLayer<VectorSource<Feature<GeometryApi>>, Feature<GeometryApi>>;
export type SliderValue = number | number[];
export interface SnapConfiguration {
    [key: string]: boolean | SliderValue;
    edge: boolean;
    vertex: boolean;
    pixelTolerance: SliderValue;
}
export interface InfoLayersStructure {
    title: string;
    hint: Record<string, string>[];
}
export type GEMLayer = {
    id: string;
    parent: string;
    text: string;
    config: GEMLayerConfig;
};
export interface ProcessedGEMLayer {
    id: string;
    parent: string;
    label: string;
    checked: boolean;
    config: GEMLayerConfig;
}
export interface GEMLayerTreeItem extends ProcessedGEMLayer {
    children: GEMLayerTreeItem[];
    isLeaf: boolean;
}
export type WMSLayerDetailed = {
    id: string;
    parent: string;
    text: string;
    config: WMSLayerConfig;
    key: string;
    type: string;
};
export type ItemPositionResponse = {
    net_id: number;
    position: number;
    road_id: number;
    tab_index: number;
};
export type Geometry = {
    coordinates: Coordinate[];
    type: Type;
    geometries: string | null;
};
export type CorrectGeometryType = Polygon | Point | LineString;
export type CorrectCoordinate = Coordinate[] & Coordinate[][];
export type GEMRoadNet = {
    id: number;
    display_name: string;
    name: string;
    nodes: string;
    from_mileage: number;
    to_mileage: number;
    length: number;
};
export type GEMRoadNetResponse = {
    response: {
        road_id: number;
        start_mileage: number;
        end_mileage: number;
        nets: GEMRoadNet[];
    };
};
export type GEMRoadNetDetails = {
    from_node: string;
    geometry: Geometry;
    id: number;
    length: number;
    net_name: string;
    number_of_carriageways: number;
    region_id: number;
    road_category: string;
    road_class: string;
    road_id: number;
    road_manager_id: number;
    route_id: number | null;
    to_node: string;
    start_station: number;
};
export interface GugikGeometryResponse {
    data: {
        response: {
            geometry: {
                coordinates: CoordinateApi[];
            };
        };
    };
}
export type MapLayer = {
    name?: string;
    layer_symbol?: string;
    layerId?: number;
    geometryType?: string;
};
export type DrawnGeometryParam = Omit<Geometry, 'geometries'>[];
export interface MapExternalProps extends MapConfig {
    mapLayers: MapLayer[];
    setOuterDrawnGeometries?: (drawnGeometries: DrawnGeometryParam) => void;
    caseObjectId?: number;
}
