/**
 * Polyline decoder/encoder.
 *
 * The routing engine encodes leg `shape` at precision
 * 1e6 ("polyline6"). The transit module uses standard precision-5 polylines.
 * Both are handled here. Output is GeoJSON-ready `[lng, lat]` (the algorithm
 * decodes lat,lng — we swap to lng,lat).
 */
/**
 * Decode an encoded polyline string into `[lng, lat]` pairs.
 * @param str   encoded polyline
 * @param precision number of decimal places (6 for polyline6, 5 for standard)
 */
declare function decodePolyline(str: string, precision?: number): [number, number][];
/** Convenience: decode a polyline6 string into `[lng, lat]` pairs. */
declare function decodePolyline6(str: string): [number, number][];
/** Encode `[lng, lat]` pairs into a polyline string at the given precision. */
declare function encodePolyline(coords: [number, number][], precision?: number): string;

/**
 * Shared type surface for @navvo/maps-js.
 *
 * The SDK's public API is always `[lng, lat]` (GL convention). Per-endpoint
 * coordinate adapters in `coords.ts` convert to the wire shape each Navvo endpoint
 * expects ({lat,lon} vs {lon,lat} vs WKT vs bbox string).
 */
/** A longitude/latitude pair. Accepts a tuple or an object on the public surface. */
type LngLat = [number, number] | {
    lng: number;
    lat: number;
};
/** Map bounds as `[[west, south], [east, north]]`, or a GL LngLatBounds-like object. */
type LngLatBoundsLike = [[number, number], [number, number]] | {
    getWest(): number;
    getSouth(): number;
    getEast(): number;
    getNorth(): number;
};
/** Navvo's six published base/imagery styles (short names). */
type NavvoStyleName = "standard" | "road" | "positron" | "light" | "dark" | "satellite" | "terrain" | "3d";
/** Travel modes accepted by the routing engine. */
type Costing = "auto" | "pedestrian" | "bicycle" | "motor_scooter" | "truck" | "wheelchair" | "bus" | "taxi";
/** Route optimisation preference. */
type RoutePreference = "fastest" | "shortest" | "balanced";
/** Things a route may avoid. */
type RouteAvoid = "tolls" | "highways" | "ferries" | "unpaved";
/** The 11 Navvo API scopes. */
type NavvoScope = "search" | "geocode" | "places" | "routing" | "traffic" | "telemetry" | "tiles" | "imagery" | "geo" | "insights" | "optimize";
/** Retry policy for the HTTP client. */
interface RetryOptions {
    /** Max retry attempts (after the first try). Default 3. */
    retries?: number;
    /** Base delay in ms before the first retry. Default 500. */
    baseDelayMs?: number;
    /** Exponential growth factor. Default 2. */
    factor?: number;
    /** Apply full jitter to the backoff. Default true. */
    jitter?: boolean;
    /** Hard ceiling on a single backoff delay (ms). Default 20000. */
    maxDelayMs?: number;
}
/** Configuration shared by every SDK client. */
interface NavvoClientConfig {
    /** `nvvo_<48 hex>` API key. Required. */
    apiKey: string;
    /** API base URL. Default `https://navvo.io/api/v1`. Must be https. */
    baseUrl?: string;
    /** Per-request timeout in ms. Default 15000. */
    timeoutMs?: number;
    /** Retry policy. */
    retry?: RetryOptions;
    /** Optional User-Agent (Node only; browsers ignore it). */
    userAgent?: string;
    /** Default narrative/result language (`en`, `ar`, …). */
    language?: string;
    /**
     * When true, `{ available: false }` envelopes are thrown as
     * `NavvoUnavailableError` instead of being returned. Default false.
     */
    throwOnUnavailable?: boolean;
}
/** A geocode/routing result envelope flag is normalised into this shape. */
interface AvailableEnvelope {
    available: boolean;
}
/** A normalised geocode result. */
interface GeocodeResult {
    displayName: string;
    /** `[lng, lat]` (parsed from the geocoder's string lat/lon). */
    lngLat: [number, number];
    bounds?: [[number, number], [number, number]];
    type?: string;
    category?: string;
    name?: string;
    address?: Record<string, string>;
    /** The raw upstream result. */
    raw: unknown;
}
/** A `{ provider, available, results }` envelope around geocode results. */
interface GeocodeEnvelope<T> {
    provider: string;
    available: boolean;
    results: T[];
    status?: number;
}
/** One batch-geocode result (forward). */
interface GeocodeBatchResult {
    query: string;
    found: boolean;
    lngLat: [number, number] | null;
    displayName?: string;
    type?: string;
    category?: string;
}
/** One batch reverse-geocode result. */
interface ReverseGeocodeBatchResult {
    lngLat: [number, number];
    found: boolean;
    displayName?: string;
    type?: string;
    address?: Record<string, string>;
}
/** A ranked place from `/search`. */
interface PlaceSummary {
    id: string;
    slug: string;
    nameEn: string;
    nameAr: string;
    categories: string[];
    canonicalCategorySlug?: string;
    rawCategories?: string[];
    rating: number;
    sponsored: boolean;
    /** `[lng, lat]` parsed from the WKT `POINT(lng lat)` center. */
    lngLat: [number, number];
}
/** Result page from `/search`. */
interface SearchResult {
    query: string;
    locale: string;
    items: PlaceSummary[];
    total: number;
    page: number;
    limit: number;
    understanding?: unknown;
    raw: unknown;
}
/** Options for `services.search`. */
interface SearchOptions {
    limit?: number;
    page?: number;
    /** Result language (`en` | `ar`). */
    locale?: string;
    /** Alias of `locale`. */
    lang?: string;
    /** Viewport/proximity bias (currently informational for `/search`). */
    bbox?: LngLatBoundsLike | string;
}
/** A waypoint on the public routing surface. */
interface Waypoint {
    lngLat: LngLat;
    name?: string;
}
/** Truck dimensions for truck costing. */
interface TruckOptions {
    heightM?: number;
    widthM?: number;
    lengthM?: number;
    weightT?: number;
    axleLoadT?: number;
    hazmat?: boolean;
}
/** Input to `services.directions.plan` / `route`. */
interface RoutePlanInput {
    waypoints: Waypoint[];
    costing?: Costing;
    preference?: RoutePreference;
    avoid?: RouteAvoid[];
    optimize?: boolean;
    avoidIncidents?: boolean;
    avoidReported?: boolean;
    disregard?: string[];
    constraintsText?: string;
    includeLabels?: boolean;
    language?: string;
    departureTime?: string;
    truck?: TruckOptions;
}
/** A single turn-by-turn maneuver, normalised from the engine. */
interface RouteManeuver {
    type: number;
    instruction: string;
    verbalInstruction?: string;
    streetNames?: string[];
    /** Length in km. */
    length: number;
    /** Duration in seconds. */
    time: number;
    roundaboutExitCount?: number;
    /** Index into the leg's decoded shape where this maneuver begins. */
    beginShapeIndex?: number;
    raw: unknown;
}
/** A leg of a route. */
interface RouteLeg {
    maneuvers: RouteManeuver[];
    /** Decoded `[lng, lat][]` for this leg. */
    geometry: [number, number][];
    /** Raw encoded polyline6 for this leg. */
    shape: string;
    summary: {
        length: number;
        time: number;
    };
}
/** Normalised result of a route plan. */
interface RoutePlanResult {
    available: boolean;
    /** Decoded full-route `[lng, lat][]` (all legs concatenated). */
    geometry: [number, number][];
    /** Raw polyline6 of the primary leg. */
    shape: string;
    summary: {
        length: number;
        time: number;
    };
    legs: RouteLeg[];
    alternates: RoutePlanResult[];
    labels?: {
        label: string;
        tip: string;
    } | null;
    logistics?: unknown;
    signConstraints?: unknown;
    incidentConstraints?: unknown;
    reportedConstraints?: unknown;
    roadEditConstraints?: unknown;
    routeProfile?: unknown;
    /** The raw API response. */
    raw: unknown;
}
/** A congestion-coloured traffic route (from `/traffic/route`). */
interface TrafficRouteResult {
    available: boolean;
    distanceKm: number;
    baseDurationSeconds: number;
    durationInTrafficSeconds: number;
    delaySeconds: number;
    departureTime?: string;
    arrivalTime?: string;
    traffic?: {
        hasData: boolean;
        congestionScore: number;
        level: string;
        trafficFactor: number;
        congestedShare: number;
    };
    /** GeoJSON FeatureCollection of congestion-coloured segments. */
    segments: GeoJSONFeatureCollection;
    legend?: Record<string, {
        label: string;
        color: string;
    }>;
    raw: unknown;
}
/** Matrix request on the public surface. */
interface MatrixInput {
    origins: LngLat[];
    destinations: LngLat[];
    costing?: Costing;
    units?: "kilometers" | "miles";
}
/** One matrix cell. */
interface MatrixCell {
    /** Distance in the requested units, or null if unreachable. */
    distance: number | null;
    /** Time in seconds, or null if unreachable. */
    time: number | null;
}
/** Isochrone contour. */
interface IsochroneContour {
    minutes?: number;
    km?: number;
    color?: string;
}
/** Isochrone request. */
interface IsochroneInput {
    origin: LngLat;
    costing?: Costing;
    contours: IsochroneContour[];
    polygons?: boolean;
}
/** Optimize (TSP) request. */
interface OptimizeInput {
    stops: LngLat[];
    costing?: Costing;
}
/** Optimize result. */
interface OptimizeResult {
    available: boolean;
    /** Optimised visiting order as indices into the input `stops`. */
    order: number[];
    raw: unknown;
}
/** A minimal GeoJSON FeatureCollection type (avoids a hard dep on @types/geojson). */
interface GeoJSONFeatureCollection {
    type: "FeatureCollection";
    features: GeoJSONFeature[];
    [k: string]: unknown;
}
interface GeoJSONFeature {
    type: "Feature";
    geometry: {
        type: string;
        coordinates: unknown;
    } | null;
    properties: Record<string, unknown> | null;
    [k: string]: unknown;
}
/** Weather point lookup result. */
interface WeatherPoint {
    ok: boolean;
    lat: number;
    lon: number;
    city?: string;
    temperature?: number;
    unit?: string;
    feelsLike?: number;
    humidity?: number;
    windSpeed?: number;
    condition?: string;
    aqi?: number | null;
    aqiCategory?: string | null;
    pm25?: number | null;
    pm10?: number | null;
    dust?: number | null;
    [k: string]: unknown;
}
/** Incident-report input. */
interface IncidentReportInput {
    type: string;
    lngLat: LngLat;
    title?: string;
    description?: string;
    severity?: number;
    ttlMinutes?: number;
    /** Dedup radius for `/incidents/report` (default 80m). */
    dedupMeters?: number;
}
/** Units. */
type Units = "metric" | "imperial";

declare const DEFAULT_BASE_URL = "https://navvo.io/api/v1";
declare const SDK_VERSION = "0.1.0";
interface RequestOptions {
    /** Query parameters (undefined/null values are dropped). */
    query?: Record<string, string | number | boolean | undefined | null>;
    /** JSON body for POST. */
    body?: unknown;
    /** Override the per-request abort signal. */
    signal?: AbortSignal;
    /** Treat this request as retry-safe even if it is a POST. */
    idempotent?: boolean;
    /** Accept these HTTP statuses as success (default 200/201). */
    okStatuses?: number[];
}
declare class HttpClient {
    readonly apiKey: string;
    readonly baseUrl: string;
    readonly timeoutMs: number;
    readonly retry: Required<RetryOptions>;
    readonly userAgent?: string;
    readonly language?: string;
    constructor(config: NavvoClientConfig);
    get maskedKey(): string;
    private buildUrl;
    get<T>(path: string, opts?: RequestOptions): Promise<T>;
    post<T>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
    request<T>(method: string, path: string, opts?: RequestOptions): Promise<T>;
    private doFetch;
    private parseBody;
    private mapHttpError;
    private mapNetworkError;
    private isRetryable;
    private backoff;
}

/**
 * Directions — the high-level directions helper.
 *
 * Wraps route()/trafficRoute(), decodes polyline6 into a render-ready geometry,
 * and produces a normalised maneuver/turn list with Navvo turn icons.
 */

/** One row for a turn-by-turn side panel. */
interface TurnListItem {
    /** A short icon key (e.g. "turn-left", "roundabout", "depart", "arrive"). */
    icon: string;
    /** The maneuver instruction text. */
    text: string;
    /** Human distance for this maneuver (e.g. "1.2 km", "300 m"). */
    distanceText: string;
    /** Human duration for this maneuver (e.g. "2 min"). */
    durationText: string;
    /** Raw values for custom formatting. */
    lengthKm: number;
    timeSec: number;
    type: number;
}
declare class Directions {
    private readonly services;
    constructor(services: NavvoServices);
    /** POST /routing/plan — corridor-aware directions. Returns the normalised result. */
    plan(input: RoutePlanInput): Promise<RoutePlanResult>;
    /** POST /routing/route — simple/fast directions (no corridor avoidance). */
    simple(input: RoutePlanInput): Promise<RoutePlanResult>;
    /** POST /traffic/route — traffic-aware ETA + congestion-coloured segments. */
    trafficRoute(input: {
        waypoints: {
            lngLat: LngLat;
            name?: string;
        }[];
        costing?: string;
        departureTime?: string;
        language?: string;
    }): Promise<TrafficRouteResult>;
    /** Build a flat turn list from a route plan result (all legs concatenated). */
    getTurnList(route: RoutePlanResult): TurnListItem[];
}
/**
 * Map a routing-engine maneuver `type` to a Navvo turn-icon key.
 * Reference: the routing engine's TripLeg maneuver type enum.
 */
declare function maneuverIcon(type: number, roundaboutExit?: number): string;
/** Format a distance (km) into a human string. */
declare function formatDistance(km: number): string;
/** Format a duration (seconds) into a human string. */
declare function formatDuration(sec: number): string;

declare class NavvoServices {
    readonly http: HttpClient;
    private readonly throwOnUnavailable;
    private readonly defaultLanguage?;
    private configCache?;
    /** Directions helper (route() + trafficRoute() + polyline render data). */
    readonly directions: Directions;
    constructor(config: NavvoClientConfig);
    /** GET /tiles/styles — the style catalog (for a style switcher). */
    styles(): Promise<{
        provider: string;
        count: number;
        styles: Array<{
            style: string;
            label: string;
            category: string;
            description?: string;
        }>;
    }>;
    /** Build a tiles/style URL with the api_key query param. */
    styleUrl(style?: NavvoStyleName | string, opts?: {
        terrain?: boolean;
        version?: string;
    }): string;
    /** GET /tiles/layers — logical layer catalog. */
    layers(): Promise<unknown>;
    /** GET /map/config — the bootstrap manifest. Cached after the first call. */
    mapConfig(): Promise<unknown>;
    /** GET /map/category-styles — renderer-ready category marker styling. */
    categoryStyles(): Promise<unknown>;
    /** GET /search — full-text place search. */
    search(q: string, opts?: SearchOptions): Promise<SearchResult>;
    private normalizePlaceSummary;
    /** GET /geocode/search — forward geocoding. */
    geocode(q: string, opts?: {
        limit?: number;
        locale?: string;
        bbox?: LngLatBoundsLike | string;
        near?: LngLat;
    }): Promise<GeocodeEnvelope<GeocodeResult>>;
    /** GET /geocode/reverse — reverse geocoding (separate lat & lon params). */
    reverseGeocode(coord: LngLat): Promise<GeocodeEnvelope<GeocodeResult>>;
    /** POST /geocode/batch — bulk forward geocode (max 50). */
    geocodeBatch(queries: string[], opts?: {
        locale?: string;
        bbox?: LngLatBoundsLike | string;
    }): Promise<{
        count: number;
        found: number;
        results: GeocodeBatchResult[];
    }>;
    /** POST /geocode/reverse-batch — bulk reverse geocode (max 50). */
    reverseGeocodeBatch(points: LngLat[]): Promise<{
        count: number;
        found: number;
        results: ReverseGeocodeBatchResult[];
    }>;
    private wrapGeocodeEnvelope;
    /**
     * GET /places/{slug} — full place detail.
     *
     * Soft-null getter: returns `null` when the place is unknown (the API answers
     * HTTP 404, which the HTTP layer surfaces as a typed NavvoNotFoundError that we
     * catch here). Some deployments answer 200 with an empty/`null` body for an
     * unknown slug; that is normalised to `null` too. All other typed errors
     * (auth, scope, rate-limit, server, network) still propagate.
     */
    place(slug: string): Promise<unknown | null>;
    /** GET /places/thumb?slug= — lightweight card thumbnail + open state. */
    placeThumb(slug: string): Promise<{
        url: string | null;
        source: string | null;
        rating: number | null;
        openState: string | null;
        openText: string | null;
    }>;
    /** GET /places/{slug}/hours — opening-hours engine. */
    placeHours(slug: string, at?: string): Promise<unknown>;
    /** GET /places/{slug}/popular-times — busyness. */
    placePopularTimes(slug: string): Promise<unknown>;
    /** GET /places/{slug}/photos — gallery. */
    placePhotos(slug: string, opts?: {
        page?: number;
        limit?: number;
    }): Promise<unknown>;
    /** GET /places/categories — the category taxonomy. */
    placeCategories(): Promise<unknown>;
    /** GET /places/facets — amenity facets. */
    placeFacets(q?: string): Promise<unknown>;
    /** GET /places — list places with filters. */
    placesList(opts?: {
        q?: string;
        page?: number;
        limit?: number;
        category?: string;
        amenities?: string;
        openNow?: boolean;
        sort?: string;
        minRating?: number;
        near?: LngLat;
        radiusKm?: number;
    }): Promise<unknown>;
    /** POST /places/reachable — places inside an isochrone. */
    reachable(input: {
        origin: LngLat;
        minutes?: number;
        costing?: "pedestrian" | "auto" | "bicycle";
        q?: string;
        categories?: string[] | string;
        amenities?: string;
        limit?: number;
    }): Promise<unknown>;
    /** POST /routing/plan — corridor-aware high-level directions. */
    route(input: RoutePlanInput): Promise<RoutePlanResult>;
    /** POST /routing/route — simple/fast directions (no corridor avoidance). */
    simpleRoute(input: RoutePlanInput): Promise<RoutePlanResult>;
    /** POST /routing/matrix — travel-time/distance matrix. */
    matrix(input: MatrixInput): Promise<{
        available: boolean;
        cells: MatrixCell[][];
        raw: unknown;
    }>;
    /** POST /routing/isochrone — reachability polygons. */
    isochrone(input: IsochroneInput): Promise<{
        available: boolean;
        geojson: GeoJSONFeatureCollection | null;
        raw: unknown;
    }>;
    /** POST /routing/map-match — snap a GPS trace to roads. */
    mapMatch(payload: Record<string, unknown>): Promise<unknown>;
    /** POST /routing/optimize — optimal stop ordering (TSP). */
    optimize(input: OptimizeInput): Promise<OptimizeResult>;
    /** POST /traffic/route — traffic-aware ETA + congestion-coloured segments. */
    trafficRoute(input: {
        waypoints: {
            lngLat: LngLat;
            name?: string;
        }[];
        costing?: string;
        departureTime?: string;
        language?: string;
    }): Promise<TrafficRouteResult>;
    /** GET /traffic/summary — aggregate live conditions over a bbox. */
    trafficSummary(bbox?: LngLatBoundsLike | string): Promise<unknown>;
    /** GET /traffic/layers — live traffic layer descriptor + legend. */
    trafficLayers(): Promise<unknown>;
    /** GET /incidents/geojson — active incidents as GeoJSON. */
    incidents(opts?: {
        bbox?: LngLatBoundsLike | string;
        type?: string;
        limit?: number;
        zoom?: number;
    }): Promise<GeoJSONFeatureCollection>;
    /** GET /incidents/types — the incident type catalog. */
    incidentTypes(): Promise<unknown>;
    /** POST /incidents/report — community report (auto-dedup). */
    reportIncident(input: IncidentReportInput): Promise<unknown>;
    /** POST /incidents/{id}/votes — confirm/reject an incident. */
    voteIncident(id: string, vote: "confirm" | "reject", userId?: string): Promise<unknown>;
    /** GET /road-edits/geojson — active closures/restrictions/custom roads. */
    roadEdits(bbox?: LngLatBoundsLike | string): Promise<GeoJSONFeatureCollection>;
    /** POST /map/route-risk — score a route geometry against live conditions. */
    routeRisk(geometry: [number, number][] | GeoJSONFeatureCollection | object, opts?: {
        routeId?: string;
        timeOffset?: "-1h" | "now" | "+1h" | "+3h";
    }): Promise<unknown>;
    /** POST /map/route-enforcement — cameras/lights along a route. */
    routeEnforcement(geometry: [number, number][] | GeoJSONFeatureCollection | object, opts?: {
        routeId?: string;
    }): Promise<unknown>;
    /** GET /map/weather/point — current point weather + live air quality. */
    weatherPoint(coord: LngLat, opts?: {
        units?: Units;
    }): Promise<WeatherPoint>;
    /** GET /map/weather/forecast — hourly forecast. */
    weatherForecast(coord: LngLat, opts?: {
        hours?: number;
        units?: Units;
    }): Promise<unknown>;
    /** GET /map/weather/alerts — derived warnings for a point. */
    weatherAlerts(coord: LngLat, opts?: {
        hours?: number;
    }): Promise<unknown>;
    /** GET /map/weather/cities — weather pins in a viewport (zoom >= 7). */
    weatherCities(bbox: LngLatBoundsLike | string, zoom: number, opts?: {
        units?: Units;
        limit?: number;
    }): Promise<GeoJSONFeatureCollection>;
    /** GET /map/airquality/cities — air-quality pins in a viewport (zoom >= 7). */
    airQualityCities(bbox: LngLatBoundsLike | string, zoom: number, opts?: {
        limit?: number;
    }): Promise<GeoJSONFeatureCollection>;
    /** GET /map/overlays/{layerType} — one overlay as GeoJSON. */
    overlay(layerType: string, opts?: {
        bbox?: LngLatBoundsLike | string;
        limit?: number;
        zoom?: number;
    }): Promise<GeoJSONFeatureCollection>;
    /** GET /ev/stations — charging stations in a viewport. */
    evStations(opts: {
        bbox: LngLatBoundsLike | string;
        minKw?: number;
        connector?: string;
        limit?: number;
        availableOnly?: boolean;
    }): Promise<unknown>;
    /** GET /transit/stops — transit stops near a point (radius in metres). */
    transitStops(coord: LngLat, radius?: number): Promise<unknown>;
    /** GET /transit/gbfs — shared docks/bikes/scooters near a point. */
    gbfs(coord: LngLat, opts?: {
        radius?: number;
        type?: "bike" | "scooter" | "car";
    }): Promise<unknown>;
    /** GET /imagery/map-features — signs/points from street-level imagery. */
    mapFeatures(opts?: {
        bbox?: LngLatBoundsLike | string;
    }): Promise<unknown>;
    buildPlanBody(input: RoutePlanInput): Record<string, unknown>;
    /** Normalise a /routing/plan response (engine envelope), tolerant of a flat shape. */
    normalizePlan(raw: Record<string, unknown>): RoutePlanResult;
    /** Normalise a passthrough /routing/route response (has `data.trip`). */
    normalizePassthroughTrip(env: Record<string, unknown>, raw: unknown): RoutePlanResult;
    /** Convert a raw engine `trip` object to a normalised RoutePlanResult (no envelope fields). */
    private tripToResult;
    private maybeThrowUnavailable;
}

/**
 * GL engine resolution.
 *
 * The GL rendering engine is BUNDLED into every build of this package (ESM, CJS, and UMD) — it is
 * NOT an external dependency, so a consumer installs only `@navvo/maps-js` and nothing else. The
 * engine is exposed through a resolver so a test/host can inject a custom engine without a real GL
 * context; the exported namespace is a live proxy that reads the active engine on every access.
 */

/** Advanced / testing: inject a custom GL engine (unit tests use this to avoid a real WebGL context). */
declare function __setMapEngine(engine: unknown): void;
/** The bundled engine version (for diagnostics). */
declare const engineVersion: string;
/**
 * Initialise the RTL text plugin once, lazily, before the first map paints, so
 * Arabic labels shape and bidi-order correctly. Safe to call multiple times.
 *
 * @param pluginUrl URL to the RTL text plugin script. Defaults to the Navvo-hosted asset.
 */
declare function ensureRtlPlugin(pluginUrl?: string): void;

interface NavvoMapOptions {
    /** Element id or node. */
    container: string | HTMLElement;
    /** `nvvo_…` key. Required unless `style` is a full URL carrying ?api_key=. */
    apiKey?: string;
    /** Alias of apiKey accepted from the cloud config. */
    mapKey?: string;
    /** A separate services key, kept for parity with multi-key setups. */
    serviceKey?: string;
    /** Short style name, full /tiles/style URL, or an inline style object. */
    style?: NavvoStyleName | string | object;
    /** API base URL. Default https://navvo.io/api/v1. */
    baseUrl?: string;
    /** `[lng, lat]`. Default Amman. */
    center?: [number, number];
    zoom?: number;
    bearing?: number;
    pitch?: number;
    minZoom?: number;
    maxZoom?: number;
    maxBounds?: [[number, number], [number, number]];
    /** Append &terrain=1 to the style + enable terrain (3d/terrain styles). */
    terrain?: boolean;
    /** Force-load the RTL text plugin. Default true. */
    rtl?: boolean;
    /** URL of the RTL text plugin script. Defaults to the Navvo-hosted asset. */
    rtlTextPluginUrl?: string;
    /** Enable the full 3D feature set (extrusions/sky/terrain wiring). */
    enable3D?: boolean;
    attributionControl?: boolean | object;
    interactive?: boolean;
    pixelRatio?: number;
    /** Any extra GL MapOptions passthrough. */
    [k: string]: unknown;
}
type AnyMap = any;
declare class NavvoMap {
    /** The wrapped GL map. Documented escape hatch. */
    readonly map: AnyMap;
    /** The api_key used for browser-fetched map resources. */
    readonly apiKey: string;
    readonly baseUrl: string;
    private currentStyle;
    private terrainEnabled;
    constructor(options: NavvoMapOptions);
    private usesTerrain;
    /** Build the transformRequest that appends ?api_key= to Navvo-hosted URLs. */
    private makeTransformRequest;
    private resolveStyle;
    /**
     * Swap the style, preserving user-added sources/layers/overlays.
     * GL drops them on setStyle by default; we capture and re-apply.
     */
    setStyle(style: NavvoStyleName | string | object, opts?: {
        terrain?: boolean;
    }): void;
    private captureUserLayers;
    private restoreUserLayers;
    private userSourceIds;
    private userLayerIds;
    /** Idempotently add a source we track for setStyle preservation. */
    private addTrackedSource;
    /** Idempotently add a layer we track for setStyle preservation. */
    private addTrackedLayer;
    /** Enable the 3D feature set: extrusions + terrain (if present in the style). */
    enable3D(opts?: {
        terrain?: boolean;
        exaggeration?: number;
    }): void;
    /** Toggle terrain. Guards on the terrain source being present in the style. */
    setTerrain(on: boolean, exaggeration?: number): void;
    /** Add a fill-extrusion buildings layer from the vector `building` source-layer. */
    add3DBuildings(): void;
    /** Add a default/symbol marker at a point and return it. */
    addMarker(lngLat: LngLat, opts?: object): AnyMap;
    /** Add a popup with HTML at a point and return it. */
    addPopup(lngLat: LngLat, html: string, opts?: object): AnyMap;
    /** Add a GeoJSON source + a styled layer; returns a handle with setData/remove. */
    addGeoJSON(id: string, data: GeoJSONFeatureCollection | object, opts?: {
        type?: "fill" | "line" | "circle" | "symbol";
        paint?: object;
        layout?: object;
    }): {
        setData: (d: object) => void;
        remove: () => void;
    };
    private fetchJson;
    private currentBboxString;
    /**
     * Add the live traffic layer (congestion lines coloured by feature.color).
     * Returns a handle that can refresh() to the current viewport or remove().
     */
    addTrafficLayer(opts?: {
        id?: string;
    }): Promise<OverlayHandle>;
    private fetchTrafficFC;
    /** Add the incidents layer (point symbols / circles by severity). */
    addIncidentsLayer(opts?: {
        id?: string;
    }): Promise<OverlayHandle>;
    /** Add the road-closures / road-edits layer (lines + polygons by color). */
    addRoadClosuresLayer(opts?: {
        id?: string;
    }): Promise<OverlayHandle>;
    /** Add the weather city-pins layer (symbols coloured by feature.color). */
    addWeatherLayer(opts?: {
        id?: string;
        units?: "metric" | "imperial";
    }): Promise<OverlayHandle>;
    /** Generic colored-line overlay used by traffic. */
    private addColoredLineOverlay;
    private makeOverlayHandle;
    addControl(control: AnyMap, position?: string): this;
    on(type: string, layerOrHandler: AnyMap, handler?: AnyMap): this;
    off(type: string, layerOrHandler: AnyMap, handler?: AnyMap): this;
    once(type: string, handler: AnyMap): this;
    resize(): this;
    remove(): void;
    getCanvas(): HTMLCanvasElement;
    getContainer(): HTMLElement;
    isStyleLoaded(): boolean;
    /** The underlying GL map (documented escape hatch). */
    get engine(): AnyMap;
}
interface OverlayHandle {
    id: string;
    /** Re-fetch for the current viewport and update the source. */
    refresh: () => Promise<GeoJSONFeatureCollection>;
    /** Remove the overlay's source + layer(s). */
    remove: () => void;
}

/**
 * The `NavvoMaps` namespace — the renderer half of the SDK.
 *
 * Re-exports GL primitives (Marker, Popup, controls, LngLatBounds) under
 * the Navvo namespace and adds the `Map` wrapper, the polyline decoder, the RTL
 * initialiser, and a `configure()` factory that keys both transports.
 */

type AnyCtor = any;
/** A configured SDK handle: makes keyed maps + a keyed services client. */
interface NavvoSdk {
    apiKey: string;
    baseUrl: string;
    /** Create a map already carrying the key. */
    map(options: Omit<NavvoMapOptions, "apiKey">): NavvoMap;
    /** A keyed, lazily-created services client. */
    readonly services: NavvoServices;
}
declare const NavvoMaps: {
    version: string;
    engineVersion: string;
    /** The Map wrapper. `new NavvoMaps.Map({ ... })`. */
    Map: typeof NavvoMap;
    Marker: AnyCtor;
    Popup: AnyCtor;
    /** Alias for Popup. */
    InfoWindow: AnyCtor;
    LngLat: AnyCtor;
    LngLatBounds: AnyCtor;
    NavigationControl: AnyCtor;
    GeolocateControl: AnyCtor;
    ScaleControl: AnyCtor;
    FullscreenControl: AnyCtor;
    AttributionControl: AnyCtor;
    decodePolyline: typeof decodePolyline;
    decodePolyline6: typeof decodePolyline6;
    ensureRtlPlugin: typeof ensureRtlPlugin;
    /** Services constructor for `new NavvoMaps.Services({ apiKey })`. */
    Services: typeof NavvoServices;
    /**
     * Configure the SDK once with one key — produces keyed map/services factories.
     * This is the recommended entry point (key given once, routed to both transports).
     */
    configure(config: NavvoClientConfig): NavvoSdk;
    /** Direct access to the underlying engine namespace (escape hatch). */
    engine: AnyCtor;
};
type NavvoMapsNamespace = typeof NavvoMaps;

/**
 * CoordUtils — the single place coordinate conventions are translated.
 *
 * The SDK's public surface is always `[lng, lat]`. Navvo endpoints differ:
 *   - GeoJSON outputs ......................... [lng, lat]  (pass through)
 *   - place center / entrance ................. WKT "POINT(lng lat)"
 *   - bbox query param ........................ "west,south,east,north"
 *   - routing passthrough (/route,/matrix,…) .. { lat, lon }
 *   - routing plan (/plan, /traffic/route) .... { lon, lat, name? }
 *   - reverse geocode ......................... separate lat & lon params
 *   - ev/places.reachable ..................... { lat, lng }
 */

/** Normalise any accepted LngLat into a `[lng, lat]` tuple. */
declare function toLngLat(c: LngLat): [number, number];
/** `{ lat, lon }` — the routing-engine passthrough convention. */
declare function toLatLonObj(c: LngLat): {
    lat: number;
    lon: number;
};
/** `{ lon, lat, name? }` — the /routing/plan & /traffic/route convention. */
declare function toLonLatObj(c: LngLat, name?: string): {
    lon: number;
    lat: number;
    name?: string;
};
/** `{ lat, lng }` — EV / places.reachable convention. */
declare function toLatLngObj(c: LngLat): {
    lat: number;
    lng: number;
};
/** Parse a WKT `POINT(lng lat)` string into `[lng, lat]`. Returns null on failure. */
declare function parseWkt(wkt: string | null | undefined): [number, number] | null;
/** Convert bounds (tuple or LngLatBounds-like) to the `west,south,east,north` query string. */
declare function bboxParam(b: LngLatBoundsLike | string): string;
/** Separate `{ lat, lon }` query params for reverse geocode. */
declare function latLonParams(c: LngLat): {
    lat: string;
    lon: string;
};

/** Map a friendly/alias style name to the canonical `style=` query value. */
declare function resolveStyleName(style: NavvoStyleName | string): string;
interface StyleUrlOptions {
    apiKey: string;
    baseUrl?: string;
    /** Append `&terrain=1` (only meaningful for the `3d` style). */
    terrain?: boolean;
    /** Cosmetic version label → becomes the style `name`. */
    version?: string;
}
/**
 * Build a tiles/style URL with the api_key query param.
 * `style` may be a short name (resolved) or a full URL (key injected if absent).
 */
declare function styleUrl(style: (NavvoStyleName | string) | undefined, opts: StyleUrlOptions): string;
/** Append `?api_key=` (alias `?apiKey=` honoured) to any Navvo-hosted URL if missing. */
declare function injectApiKey(rawUrl: string, apiKey: string): string;
/**
 * Static method→required-scope table. Used to produce actionable scope errors.
 * Names match the canonical NavvoServices method names.
 */
declare const METHOD_SCOPES: Record<string, NavvoScope[]>;

/**
 * Typed error model for @navvo/maps-js.
 *
 * - NavvoError ............ base; carries `status` + server `code`/`message`.
 * - NavvoAuthError ........ 401 (no/unknown key).
 * - NavvoScopeError ....... 403 missing scope (names the missing scope).
 * - NavvoForbiddenError ... 403 revoked / generic forbidden.
 * - NavvoNotFoundError .... 404.
 * - NavvoRateLimitError ... 429 / quota exceeded.
 * - NavvoServerError ...... 5xx.
 * - NavvoNetworkError ..... fetch/network failure (no HTTP status).
 * - NavvoUnavailableError . `{ available: false }` envelopes (opt-in throw).
 */
declare class NavvoError extends Error {
    /** HTTP status code (0 for network errors). */
    status: number;
    /** Machine-readable code parsed from the response body, when present. */
    code: string;
    /** The endpoint path that failed (relative to baseUrl). */
    path?: string;
    /** The parsed/raw response body, when available. */
    body?: unknown;
    constructor(message: string, status?: number, code?: string, opts?: {
        path?: string;
        body?: unknown;
    });
}
declare class NavvoAuthError extends NavvoError {
    constructor(message?: string, opts?: {
        path?: string;
        body?: unknown;
    });
}
declare class NavvoScopeError extends NavvoError {
    /** The scope the key is missing, parsed from the error body when possible. */
    missingScope?: string;
    constructor(missingScope?: string, opts?: {
        path?: string;
        body?: unknown;
        message?: string;
    });
}
declare class NavvoForbiddenError extends NavvoError {
    constructor(message?: string, code?: string, opts?: {
        path?: string;
        body?: unknown;
    });
}
declare class NavvoNotFoundError extends NavvoError {
    constructor(message?: string, opts?: {
        path?: string;
        body?: unknown;
    });
}
declare class NavvoRateLimitError extends NavvoError {
    /** Suggested wait before retrying, in ms (from Retry-After when present). */
    retryAfterMs?: number;
    constructor(message?: string, opts?: {
        path?: string;
        body?: unknown;
        retryAfterMs?: number;
        code?: string;
    });
}
declare class NavvoServerError extends NavvoError {
    constructor(message?: string, status?: number, opts?: {
        path?: string;
        body?: unknown;
    });
}
declare class NavvoNetworkError extends NavvoError {
    constructor(message?: string, opts?: {
        path?: string;
        cause?: unknown;
    });
}
/** Thrown only when `throwOnUnavailable` is enabled and an envelope has available:false. */
declare class NavvoUnavailableError extends NavvoError {
    constructor(message?: string, opts?: {
        path?: string;
        body?: unknown;
    });
}

/**
 * @navvo/maps-js — the Navvo Maps JavaScript SDK (browser).
 *
 * Two halves:
 *   - NavvoMaps     — the map renderer + map-bound primitives (wraps GL).
 *   - NavvoServices — the stateless, keyed REST client (search/geocode/routing/…).
 *
 * Quickstart:
 *   import { NavvoMaps, NavvoServices } from "@navvo/maps-js";
 *   import "@navvo/maps-js/css";
 *   const map = new NavvoMaps.Map({ container: "map", apiKey: "nvvo_…", style: "standard", center: [35.91, 31.95], zoom: 12 });
 */

export { type AvailableEnvelope, type Costing, DEFAULT_BASE_URL, Directions, type GeoJSONFeature, type GeoJSONFeatureCollection, type GeocodeBatchResult, type GeocodeEnvelope, type GeocodeResult, type IncidentReportInput, type IsochroneContour, type IsochroneInput, type LngLat, type LngLatBoundsLike, METHOD_SCOPES, type MatrixCell, type MatrixInput, NavvoAuthError, type NavvoClientConfig, NavvoError, NavvoForbiddenError, NavvoMap, type NavvoMapOptions, NavvoMaps, type NavvoMapsNamespace, NavvoNetworkError, NavvoNotFoundError, NavvoRateLimitError, type NavvoScope, NavvoScopeError, type NavvoSdk, NavvoServerError, NavvoServices, type NavvoStyleName, NavvoUnavailableError, type OptimizeInput, type OptimizeResult, type OverlayHandle, type PlaceSummary, type RetryOptions, type ReverseGeocodeBatchResult, type RouteAvoid, type RouteLeg, type RouteManeuver, type RoutePlanInput, type RoutePlanResult, type RoutePreference, SDK_VERSION, type SearchOptions, type SearchResult, type TrafficRouteResult, type TruckOptions, type TurnListItem, type Units, type Waypoint, type WeatherPoint, __setMapEngine, bboxParam, decodePolyline, decodePolyline6, NavvoMaps as default, encodePolyline, engineVersion, ensureRtlPlugin, formatDistance, formatDuration, injectApiKey, latLonParams, maneuverIcon, parseWkt, resolveStyleName, styleUrl, toLatLngObj, toLatLonObj, toLngLat, toLonLatObj };
