import { Color } from '@deck.gl/core';
import { Position } from 'geojson';
import { EditableGeoJsonLayerProps, GeoJsonEditMode } from '@deck.gl-community/editable-layers';
import { ValueOf } from 'type-fest';
import { CustomMeasureMode, MeasurementModes, MeasurementUnits, MapComponentProps, Tooltip } from '../../types';
import { MapMeasurementUnitAuto } from './const';
export interface MeasurementToolsState {
    mapId: MapComponentProps['id'];
    modeInstance?: CustomMeasureMode<GeoJsonEditMode>;
    modeSelected?: keyof MeasurementModes;
    modes: MeasurementModes<keyof MeasurementModes, CustomMeasureMode<GeoJsonEditMode>>;
    units: MeasurementUnits;
    enabled: boolean;
    finished: boolean;
    distance: number;
    unit: ValueOf<typeof MapMeasurementUnitAuto>;
    locale: string;
    clearLayerOnStart?: boolean;
    positions: Position[];
}
export interface MeasurementToolsLayerProps {
    enabled: boolean;
    layerProps: Partial<MeasurementToolsLayersProps<never>>;
    locale: MeasurementToolsState['locale'];
    unit: MeasurementToolsState['unit'];
    onEdit: (args: MeasurementToolsLayerEditProps) => void;
    guideColor: Color;
    pointColor: Color;
    mode: CustomMeasureMode<GeoJsonEditMode>;
    textOptions?: MeasurementToolsTextProps;
}
export interface MeasurementToolsLayersProps<D = unknown> extends Omit<EditableGeoJsonLayerProps<D>, 'onHover' | 'mode'> {
    selectedFeatures: D[];
    onChangeFeatures: (features: D[]) => void;
    onHover?: MeasurementToolsLayerHoverProps;
}
export interface EditableLayerHoverProps {
    distance: number;
    unit: string;
    locale: string;
}
export type MeasurementToolsLayerHoverProps = (info: Tooltip, args: EditableLayerHoverProps) => void;
export interface MeasurementToolsLayerEditProps {
    editType: string;
    editContext: {
        distance: MeasurementToolsState['distance'];
        finished: MeasurementToolsState['finished'];
        positions: MeasurementToolsState['positions'];
    };
}
export interface MeasurementToolsControlProps {
    mapId: MeasurementToolsProps['mapId'];
    textOptions?: MeasurementToolsProps['textOptions'];
    children: (props: Required<MeasurementToolChildrenProps<string, GeoJsonEditMode>>) => React.ReactNode;
}
export interface DefaultMeasureToolProps {
    styles: {
        colors: {
            editing: Color;
            finished: Color;
            point: Color;
        };
    };
}
export interface MeasurementToolsProps {
    mapId: string;
    defaultProps?: Partial<DefaultMeasureToolProps>;
    layerProps?: MeasurementToolsLayerProps['layerProps'];
    textOptions?: MeasurementToolsTextProps;
}
export type MeasurementToolChildrenProps<M extends string, T = unknown> = Partial<MeasurementToolsState> & {
    value: string;
    modes: MeasurementModes<M, T>;
    modeSelected?: keyof MeasurementModes<M, T>;
    units: MeasurementUnits;
    setModeSelected: (mode: MeasurementToolsState['modeSelected']) => void;
    setFinished: (finished: MeasurementToolsState['finished']) => void;
    setDistance: (distance: MeasurementToolsState['distance']) => void;
    setUnit: (unit: MeasurementToolsState['unit']) => void;
    setLocale: (locale: MeasurementToolsState['locale']) => void;
    setPositions: (positions: MeasurementToolsState['positions']) => void;
    setEnabled: (enabled: MeasurementToolsState['enabled']) => void;
    toggleLayer: (enabled: boolean) => void;
    clearLayer: () => void;
};
export type MeasurementToolsTextProps = Intl.NumberFormatOptions & {
    autoSplitNumber?: number;
    customFormatter?: (value: string) => string;
};
export interface EditModeConfig {
    formatTooltip?: (radius: number) => string;
    turfOptions: {
        units: string;
    };
}
