import { OnDestroy } from '@angular/core';
import { IsWithinLatLngBoundFunction, LatLngBound, LatLngPointInput, LatLngPoint, Maybe, OverlapsLatLngBoundFunction, Vector } from '@dereekb/util';
import { ComponentStore } from '@ngrx/component-store';
import { MapService } from 'ngx-mapbox-gl';
import { Observable, Subscription, OperatorFunction } from 'rxjs';
import * as MapboxGl from 'mapbox-gl';
import { DbxMapboxClickEvent, MapboxEaseTo, MapboxEventData, MapboxFitBounds, MapboxFitPositions, MapboxFlyTo, MapboxJumpTo, MapboxResetNorth, MapboxResetNorthPitch, MapboxRotateTo, MapboxSnapToNorth, MapboxStyleConfig, MapboxZoomLevel } from './mapbox';
import { DbxInjectionComponentConfig } from '@dereekb/dbx-core';
import { MapboxViewportBoundFunction } from './mapbox.util';
import { FilterMapboxBoundConfig, FilterMapboxBoundReadItemValueFunction } from './mapbox.rxjs';
import * as i0 from "@angular/core";
export type MapboxMapLifecycleState = 'init' | 'load' | 'render' | 'idle';
export type MapboxMapMoveState = 'init' | 'idle' | 'moving';
export type MapboxMapZoomState = 'init' | 'idle' | 'zooming';
export type MapboxMapRotateState = 'init' | 'idle' | 'rotating';
export interface StringMapboxListenerPair {
    type: string;
    listener: (ev: MapboxEventData) => void;
}
export interface TypedMapboxListenerPair<T extends keyof MapboxGl.MapEventType> {
    type: T;
    listener: (ev: MapboxGl.MapEventType[T] & MapboxEventData) => void;
}
export interface DbxMapboxMarginCalculationSizing {
    leftMargin: number;
    rightMargin: number;
    fullWidth: number;
}
export type DbxMapboxStoreBoundRefreshType = 'always' | 'when_not_rendering' | 'only_after_render_finishes';
export interface DbxMapboxStoreBoundRefreshSettings {
    /**
     * Max bound refresh interval.
     */
    throttle: number;
    /**
     * Whether or not to wait to update the bound until after it has finished rendering.
     */
    refreshType: DbxMapboxStoreBoundRefreshType;
}
export interface DbxMapboxStoreState {
    /**
     * Current MapService being utilized.
     */
    readonly mapService?: Maybe<MapService>;
    readonly lifecycleState: MapboxMapLifecycleState;
    readonly moveState: MapboxMapMoveState;
    readonly zoomState: MapboxMapZoomState;
    readonly rotateState: MapboxMapRotateState;
    /**
     * Visual container size of the map.
     */
    readonly mapCanvasSize?: Maybe<Vector>;
    /**
     * Latest click event
     */
    readonly clickEvent?: Maybe<DbxMapboxClickEvent>;
    /**
     * Latest double-click event
     */
    readonly doubleClickEvent?: Maybe<DbxMapboxClickEvent>;
    /**
     * Latest contextmenu event.
     */
    readonly rightClickEvent?: Maybe<DbxMapboxClickEvent>;
    /**
     * Whether or not to retain content between resets.
     *
     * True by default.
     */
    readonly retainContent: boolean;
    /**
     * Custom drawer content configuration.
     */
    readonly drawerContent?: Maybe<DbxInjectionComponentConfig<unknown>>;
    /**
     * Latest error
     */
    readonly error?: Maybe<Error>;
    /**
     * Map margin/offset
     */
    readonly margin?: Maybe<DbxMapboxMarginCalculationSizing>;
    /**
     * Minimum vector size to use for the viewportBoundFunction$. If not defined there is no minimum.
     */
    readonly minimumVirtualViewportSize?: Maybe<Partial<Vector>>;
    /**
     * Bound refresh settings
     */
    readonly boundRefreshSettings: DbxMapboxStoreBoundRefreshSettings;
    /**
     * Whether or not to use the virtual bound (vs raw bound) for all bound-related observables.
     *
     * Defaults to true.
     */
    readonly useVirtualBound: boolean;
}
/**
 * Store used for retrieving information.
 */
export declare class DbxMapboxMapStore extends ComponentStore<DbxMapboxStoreState> implements OnDestroy {
    private readonly dbxMapboxService;
    private safeLatLngPoint;
    private latLngPoint;
    private latLngBound;
    constructor();
    readonly setMapService: (observableOrValue: Maybe<MapService> | Observable<Maybe<MapService>>) => Subscription;
    readonly setStyle: (observableOrValue: string | MapboxStyleConfig | Observable<string | MapboxStyleConfig>) => Subscription;
    readonly setCenter: (observableOrValue: LatLngPointInput | Observable<LatLngPointInput>) => Subscription;
    readonly setZoom: (observableOrValue: number | Observable<number>) => Subscription;
    readonly setZoomRange: (observableOrValue: Partial<import("@dereekb/util").ZoomLevelRange> | Observable<Partial<import("@dereekb/util").ZoomLevelRange>>) => Subscription;
    readonly setMinZoom: (observableOrValue: number | Observable<number>) => Subscription;
    readonly setMaxZoom: (observableOrValue: number | Observable<number>) => Subscription;
    readonly setKeyboardDisabled: (observableOrValue: void | Maybe<boolean> | Observable<void | Maybe<boolean>>) => Subscription;
    readonly setDragRotateDisabled: (observableOrValue: void | Maybe<boolean> | Observable<void | Maybe<boolean>>) => Subscription;
    readonly setDragPanDisabled: (observableOrValue: void | Maybe<boolean> | Observable<void | Maybe<boolean>>) => Subscription;
    readonly setZoomDisabled: (observableOrValue: void | Maybe<boolean> | Observable<void | Maybe<boolean>>) => Subscription;
    readonly setPitch: (observableOrValue: number | Observable<number>) => Subscription;
    readonly setMinPitch: (observableOrValue: number | Observable<number>) => Subscription;
    readonly setMaxPitch: (observableOrValue: number | Observable<number>) => Subscription;
    readonly setBearing: (observableOrValue: number | Observable<number>) => Subscription;
    readonly rotateTo: (observableOrValue: number | MapboxRotateTo | Observable<number | MapboxRotateTo>) => Subscription;
    readonly resetNorth: (observableOrValue: void | Maybe<MapboxResetNorth> | Observable<void | Maybe<MapboxResetNorth>>) => Subscription;
    readonly resetNorthPitch: (observableOrValue: void | Maybe<MapboxResetNorthPitch> | Observable<void | Maybe<MapboxResetNorthPitch>>) => Subscription;
    readonly snapToNorth: (observableOrValue: void | Maybe<MapboxSnapToNorth> | Observable<void | Maybe<MapboxSnapToNorth>>) => Subscription;
    readonly fitPositions: (observableOrValue: MapboxFitPositions | Observable<MapboxFitPositions>) => Subscription;
    readonly fitBounds: (observableOrValue: MapboxFitBounds | Observable<MapboxFitBounds>) => Subscription;
    readonly jumpTo: (observableOrValue: MapboxJumpTo | Observable<MapboxJumpTo>) => Subscription;
    readonly easeTo: (observableOrValue: MapboxEaseTo | Observable<MapboxEaseTo>) => Subscription;
    readonly flyTo: (observableOrValue: MapboxFlyTo | Observable<MapboxFlyTo>) => Subscription;
    readonly resetPitchAndBearing: (observableOrValue?: void | Observable<void> | undefined) => Subscription;
    get timerRefreshPeriod(): number;
    movingTimer(period?: number): Observable<number>;
    lifecycleRenderTimer(period?: number): Observable<number>;
    atNextIdle(): Observable<boolean>;
    calculateNextCenterWithOffset(inputOffset: LatLngPointInput): Observable<LatLngPoint>;
    calculateNextCenterOffsetWithScreenMarginChange(sizing: DbxMapboxMarginCalculationSizing): Observable<LatLngPoint>;
    filterByViewportBound<T>(input: FilterMapboxBoundReadItemValueFunction<T> | Omit<FilterMapboxBoundConfig<T>, 'boundFunctionObs' | 'boundDecisionObs'>): OperatorFunction<T[], T[]>;
    readonly currentMapService$: Observable<Maybe<MapService>>;
    readonly mapService$: Observable<MapService>;
    readonly currentMapInstance$: Observable<Maybe<MapboxGl.Map>>;
    readonly mapInstance$: Observable<MapboxGl.Map>;
    readonly boundRefreshSettings$: Observable<DbxMapboxStoreBoundRefreshSettings>;
    readonly moveState$: Observable<MapboxMapMoveState>;
    readonly lifecycleState$: Observable<MapboxMapLifecycleState>;
    readonly zoomState$: Observable<MapboxMapZoomState>;
    readonly rotateState$: Observable<MapboxMapRotateState>;
    readonly isInitialized$: Observable<boolean>;
    readonly whenInitialized$: Observable<boolean>;
    readonly isRendering$: Observable<boolean>;
    readonly isMoving$: Observable<boolean>;
    readonly isZooming$: Observable<boolean>;
    readonly isRotating$: Observable<boolean>;
    private readonly _movingTimer;
    private readonly _renderingTimer;
    readonly centerNow$: Observable<LatLngPoint>;
    readonly center$: Observable<LatLngPoint>;
    readonly minimumVirtualViewportSize$: Observable<Maybe<Partial<Vector>>>;
    readonly currentMapCanvasSize$: Observable<Maybe<Vector>>;
    /**
     * The map canvas size with consideration to the virtual viewport size.
     */
    readonly mapCanvasSize$: Observable<Vector>;
    minimumMapCanvasSize(minVector: Partial<Vector>): Observable<Vector>;
    /**
     * The map canvas size with consideration to the virtual viewport size.
     */
    readonly virtualMapCanvasSize$: Observable<Vector>;
    readonly rawViewportBoundFunction$: Observable<MapboxViewportBoundFunction>;
    /**
     * Creates a MapboxViewportBoundFunction observable that returns the minimum viewport size.
     *
     * @param minVector
     * @returns
     */
    viewportBoundFunctionWithMinimumSize(minVector: Partial<Vector>): Observable<MapboxViewportBoundFunction>;
    readonly viewportBoundFunction$: Observable<MapboxViewportBoundFunction>;
    readonly virtualBound$: Observable<LatLngBound>;
    readonly margin$: Observable<Maybe<DbxMapboxMarginCalculationSizing>>;
    readonly reverseMargin$: Observable<{
        leftMargin: number;
        rightMargin: number;
        fullWidth: number;
    } | null | undefined>;
    readonly centerGivenMargin$: Observable<LatLngPoint>;
    readonly rawBoundNow$: Observable<LatLngBound>;
    readonly rawBound$: Observable<LatLngBound>;
    readonly useVirtualBound$: Observable<boolean>;
    readonly bound$: Observable<LatLngBound>;
    readonly boundSizing$: Observable<LatLngPoint>;
    readonly boundWrapsAroundWorld$: Observable<boolean>;
    readonly isWithinBoundFunction$: Observable<IsWithinLatLngBoundFunction>;
    readonly overlapsBoundFunction$: Observable<OverlapsLatLngBoundFunction>;
    readonly zoomNow$: Observable<MapboxZoomLevel>;
    readonly zoom$: Observable<MapboxZoomLevel>;
    readonly pitchNow$: Observable<number>;
    readonly pitch$: Observable<number>;
    readonly bearingNow$: Observable<number>;
    readonly bearing$: Observable<number>;
    readonly drawerContent$: Observable<Maybe<DbxInjectionComponentConfig<unknown>>>;
    readonly hasDrawerContent$: Observable<boolean>;
    readonly clickEvent$: Observable<Maybe<DbxMapboxClickEvent>>;
    readonly doubleClickEvent$: Observable<Maybe<DbxMapboxClickEvent>>;
    readonly rightClickEvent$: Observable<Maybe<DbxMapboxClickEvent>>;
    readonly setMargin: (() => void) | ((observableOrValue: Maybe<DbxMapboxMarginCalculationSizing> | Observable<Maybe<DbxMapboxMarginCalculationSizing>>) => Subscription);
    readonly setMinimumVirtualViewportSize: (() => void) | ((observableOrValue: Maybe<Partial<Vector>> | Observable<Maybe<Partial<Vector>>>) => Subscription);
    readonly setUseVirtualBound: (observableOrValue: boolean | Observable<boolean>) => Subscription;
    readonly setBoundRefreshSettings: (observableOrValue: Partial<DbxMapboxStoreBoundRefreshSettings> | Observable<Partial<DbxMapboxStoreBoundRefreshSettings>>) => Subscription;
    private readonly _setMapService;
    private readonly _setLifecycleState;
    private readonly _setMoveState;
    private readonly _setZoomState;
    private readonly _setRotateState;
    private readonly _setMapCanvasSize;
    private readonly _setClickEvent;
    private readonly _setDoubleClickEvent;
    private readonly _setRightClickEvent;
    private readonly _setError;
    readonly clearDrawerContent: () => void;
    readonly setDrawerContent: (() => void) | ((observableOrValue: Maybe<DbxInjectionComponentConfig<unknown>> | Observable<Maybe<DbxInjectionComponentConfig<unknown>>>) => Subscription);
    /**
     * @deprecated use drawerContent$ instead.
     */
    readonly content$: Observable<Maybe<DbxInjectionComponentConfig<unknown>>>;
    /**
     * @deprecated use hasDrawerContent$ instead.
     */
    readonly hasContent$: Observable<boolean>;
    /**
     * @deprecated use clearDrawerContent instead.
     */
    readonly clearContent: () => void;
    /**
     * @deprecated use setDrawerContent instead.
     */
    readonly setContent: (() => void) | ((observableOrValue: Maybe<DbxInjectionComponentConfig<unknown>> | Observable<Maybe<DbxInjectionComponentConfig<unknown>>>) => Subscription);
    static ɵfac: i0.ɵɵFactoryDeclaration<DbxMapboxMapStore, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<DbxMapboxMapStore>;
}
