@yarrow-uz/rn-map-sdk 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1463 @@
1
+ import { NativeSyntheticEvent, ViewProps } from "react-native";
2
+ import { CameraRef, CameraRef as CameraRef$1, MapProps, MapRef, MapRef as MapRef$1, MarkerProps, OfflinePackStatus, PressEventWithFeatures } from "@maplibre/maplibre-react-native";
3
+ import { ReactElement, ReactNode, Ref, RefObject } from "react";
4
+ declare const YARROW_MAP_URL: string;
5
+ declare const YARROW_SEARCH_API_URL: string;
6
+ declare function setYarrowApiKey(apiKey: string): void;
7
+ declare function getYarrowApiKey(): string;
8
+ /**
9
+ * Appends the configured API key as the `api_key` query parameter. Deliberately
10
+ * lenient: returns the url unchanged when no key is configured yet or the url
11
+ * cannot be parsed — this is a public utility, and the SDK's own clients
12
+ * (`fetchRoutes`, `fetchSearchResults`, `fetchYarrowIcons`, …) enforce the key
13
+ * at entry via `getYarrowApiKey()` (a coded `unauthorized` error) instead of
14
+ * letting keyless requests hit the server and fail opaquely.
15
+ */
16
+ declare function addApiKeyToUrl(url: string): string;
17
+ /**
18
+ * Machine-readable failure codes carried by {@link YarrowApiError}. Consumers
19
+ * branch on `error.code` instead of parsing messages:
20
+ *
21
+ * ```ts
22
+ * try {
23
+ * await fetchRoutes({ … });
24
+ * } catch (error) {
25
+ * if (error instanceof YarrowApiError && error.code === 'unauthorized') { … }
26
+ * }
27
+ * ```
28
+ */
29
+ type YarrowApiErrorCode =
30
+ /** Missing API key, or the server rejected it (HTTP 401). */
31
+ 'unauthorized' |
32
+ /** HTTP 402 — quota exhausted with overage enabled, but the billing
33
+ * balance (or the overage spending cap) could not cover the request. */
34
+ 'payment-required' |
35
+ /** HTTP 403 — e.g. no active subscription for a metered service. */
36
+ 'forbidden' |
37
+ /** HTTP 429 — too many requests. */
38
+ 'rate-limited' |
39
+ /** HTTP 404 — endpoint or resource does not exist. */
40
+ 'not-found' |
41
+ /** The request never produced a response: DNS/socket failure, or timeout. */
42
+ 'network' |
43
+ /** A response arrived but its shape was not what the SDK expects. */
44
+ 'invalid-response' |
45
+ /** Any HTTP status without a dedicated code above. */
46
+ 'unknown';
47
+ /**
48
+ * Coded error thrown by the Yarrow API clients (routing, search, icon
49
+ * registry, tile cache) in both platform SDKs.
50
+ *
51
+ * Recognizable legacy messages are kept verbatim as the error `message`
52
+ * (`"Request failed: 500 Server Error"`), while `code`/`status`/`url` carry
53
+ * the structured detail. Client-side aborts are NOT wrapped — callers keep
54
+ * receiving the original `AbortError` so cancellation stays distinguishable.
55
+ */
56
+ declare class YarrowApiError extends Error {
57
+ code: YarrowApiErrorCode;
58
+ /** HTTP status code, when the error originated from a response. */
59
+ status?: number;
60
+ /** Request URL, for debugging. */
61
+ url?: string;
62
+ constructor(code: YarrowApiErrorCode, message: string, options?: {
63
+ status?: number;
64
+ url?: string;
65
+ cause?: unknown;
66
+ });
67
+ }
68
+ type CacheConfig = {
69
+ enabled?: boolean;
70
+ lifespanDays?: number;
71
+ };
72
+ type NormalizedCacheConfig = {
73
+ enabled: boolean;
74
+ lifespanDays: number;
75
+ };
76
+ type CachedArrayBufferResponse = {
77
+ data: ArrayBuffer;
78
+ cacheControl: string | null;
79
+ expires: string | null;
80
+ contentType: string | null;
81
+ };
82
+ type BoundsInput = {
83
+ type?: string;
84
+ features: Array<{
85
+ geometry?: {
86
+ type?: string;
87
+ coordinates?: unknown;
88
+ };
89
+ }>;
90
+ };
91
+ type RouteFeature = {
92
+ type: 'Feature';
93
+ geometry: {
94
+ type: 'LineString';
95
+ coordinates: [number, number][];
96
+ };
97
+ properties: {
98
+ duration: number;
99
+ distance: number;
100
+ [key: string]: unknown;
101
+ };
102
+ };
103
+ /** Style-API endpoint returning the icon registry (`IconListItem[]`). */
104
+ declare const ICONS_ENDPOINT = "/icons-image";
105
+ type SearchResult = {
106
+ id?: string | number;
107
+ latitude?: number;
108
+ longitude?: number;
109
+ icon_img?: string;
110
+ name?: string;
111
+ /** Backend category, e.g. `{ id: 789, name: "school" }`. The `name` field
112
+ * matches sprite names loaded into the map's icon registry at init, so
113
+ * it's used as a fallback icon source when `icon_img` is missing. */
114
+ category?: {
115
+ id?: number;
116
+ name?: string;
117
+ };
118
+ [key: string]: unknown;
119
+ };
120
+ declare const DEFAULT_CACHE_LIFESPAN_DAYS = 30;
121
+ declare const MILLISECONDS_PER_DAY: number;
122
+ declare const TILE_CACHE_NAME = "yarrow-cache-v1-tile";
123
+ declare const ICON_CACHE_NAME = "yarrow-cache-v1-icon";
124
+ declare const CACHE_PROTOCOL = "yarrowcache";
125
+ declare const CACHED_AT_HEADER = "x-yarrow-cached-at";
126
+ /** A geographic bounding box in degrees. */
127
+ type BoundingBox = {
128
+ xMin: number;
129
+ xMax: number;
130
+ yMin: number;
131
+ yMax: number;
132
+ };
133
+ /**
134
+ * Computes the geographic bounding box of a FeatureCollection whose features
135
+ * are Points, LineStrings or Polygons. Pure platform-agnostic math shared by
136
+ * the web and React Native SDKs' camera helpers.
137
+ */
138
+ declare function getBoundingBox(data: BoundsInput): BoundingBox;
139
+ /**
140
+ * Structural subset of maplibre-gl's `RequestParameters` covering the fields
141
+ * used for the network fetch. Any real maplibre `RequestParameters` object is
142
+ * assignable to this type.
143
+ */
144
+ type RequestParametersLike = {
145
+ method?: string;
146
+ headers?: {
147
+ [key: string]: string;
148
+ };
149
+ body?: BodyInit | null;
150
+ credentials?: 'omit' | 'same-origin' | 'include';
151
+ };
152
+ declare const hasCacheStorage: () => boolean;
153
+ declare const fetchArrayBufferWithCache: (url: string, cacheName: string, lifespanMs: number, abortController: AbortController, requestParameters?: RequestParametersLike) => Promise<CachedArrayBufferResponse>;
154
+ /** Routing API endpoint used by `fetchRoutes()`. */
155
+ declare const ROUTE_API_URL = "https://api.yarrow.uz/api/routing/route";
156
+ /**
157
+ * Turn modifier returned by the routing API for a direction step.
158
+ * Falls back to `string` for any value not enumerated here.
159
+ */
160
+ type RouteDirectionModifier = 'move' | 'left' | 'right' | 'slight left' | 'slight right' | 'sharp left' | 'sharp right' | 'straight' | 'uturn' | (string & {});
161
+ /**
162
+ * A single turn-by-turn step in a route's directions.
163
+ *
164
+ * `distance`/`duration` are omitted on terminal steps (e.g. the final
165
+ * "arrive" instruction), so they are optional. `to_street` is only present
166
+ * when the step transitions onto a named street.
167
+ */
168
+ type RouteDirection = {
169
+ instruction: string;
170
+ modifier?: RouteDirectionModifier;
171
+ modifier_key?: string;
172
+ to_street?: string;
173
+ distance?: number;
174
+ duration?: number;
175
+ [key: string]: unknown;
176
+ };
177
+ /** Platform-agnostic input for `fetchRoutes()` — the network half of
178
+ * `buildRoute()`. Rendering/callback options stay in the platform SDKs.
179
+ *
180
+ * `profile` accepts the routing API's wire values (`'CAR' | 'FOOT' |
181
+ * 'BICYCLE'`, case-insensitive) plus the legacy friendly names
182
+ * (`'driving' | 'walking' | 'cycling'`), which are mapped onto the wire
183
+ * enum — the API removed the old uppercase `DRIVING`-style values in its
184
+ * 2026-11 contract update. */
185
+ type FetchRoutesInput = {
186
+ profile: string;
187
+ coordinates: [number, number][];
188
+ language?: string;
189
+ /** Cancels the routing request. */
190
+ signal?: AbortSignal;
191
+ };
192
+ interface RoutesMeta {
193
+ profile: string;
194
+ totalRoutes: number;
195
+ bestRouteIndex: number;
196
+ duration: number;
197
+ distance: number;
198
+ }
199
+ interface FetchRoutesResult {
200
+ features: RouteFeature[];
201
+ directions: RouteDirection[][];
202
+ meta: RoutesMeta;
203
+ }
204
+ /**
205
+ * Network half of the routing flow: POSTs the route request to the Yarrow
206
+ * routing API, parses and normalizes the response (coordinate order fix
207
+ * included). Rendering, events and camera work stay in the platform SDKs —
208
+ * they consume the returned features/directions/meta verbatim.
209
+ *
210
+ * Early "no route" outcomes resolve to an empty result (never throw), exactly
211
+ * like the web SDK's historic `buildRoute()` behavior.
212
+ */
213
+ declare function fetchRoutes(input: FetchRoutesInput): Promise<FetchRoutesResult>;
214
+ /**
215
+ * Normalizes routing-API feature coordinates to `[lng, lat]` tuples. The API
216
+ * ships `{lng, lat}` objects; tuple coordinates (already GeoJSON-canonical)
217
+ * pass through as-is. Features whose geometry is not a LineString with
218
+ * well-formed coordinates are skipped instead of crashing on the cast — a
219
+ * single malformed feature must not lose the whole route. Returns the
220
+ * surviving features; a one-line warning fires only when something was
221
+ * actually dropped (core has no `__DEV__`, and this path only triggers on a
222
+ * malformed backend response, so the warn is rare by construction).
223
+ */
224
+ declare const transformRouteCoordinates: (features: RouteFeature[]) => RouteFeature[];
225
+ declare const haversineDistance: (lat1: number, lon1: number, lat2: number, lon2: number) => number;
226
+ interface FetchSearchResultsInput {
227
+ lat: number;
228
+ lon: number;
229
+ page?: number;
230
+ pageSize?: number;
231
+ signal: AbortSignal;
232
+ }
233
+ /**
234
+ * Queries the Yarrow search API around a coordinate. Pure network + mapping —
235
+ * marker rendering stays in the platform SDKs.
236
+ */
237
+ declare function fetchSearchResults(query: string, input: FetchSearchResultsInput): Promise<SearchResult[]>;
238
+ type YarrowStyleType = 'default' | 'satellite' | 'hybrid';
239
+ /**
240
+ * Validates a user-supplied style type, warning (and falling back to
241
+ * `"default"`) on anything unrecognized. Verbatim behavior of the web SDK's
242
+ * `changeStyles()` guard.
243
+ */
244
+ declare function normalizeStyleType(styleType?: string): YarrowStyleType;
245
+ /**
246
+ * Style-fetch endpoint for a style type/theme combination, e.g.
247
+ * `/styles/satellite/?dark=true`. Verbatim behavior of the web SDK's
248
+ * `YarrowStylesManager.buildStyleEndpoint()`.
249
+ */
250
+ declare function buildStyleEndpoint(styleType: YarrowStyleType, theme: 'light' | 'dark'): string;
251
+ /**
252
+ * Public alias of `STORAGE_KEY` so platform SDKs can build storage adapters
253
+ * (e.g. React Native AsyncStorage bridges) without hard-coding the key.
254
+ */
255
+ declare const USER_TOKEN_STORAGE_KEY = "yarrow:user_token";
256
+ /**
257
+ * Minimal persistence contract for the anonymous user token. The default
258
+ * resolution uses `localStorage` when available (guarded — this is the only
259
+ * file in core allowed to touch it); shells without a DOM (e.g. React Native)
260
+ * can inject their own storage via `setTokenStorage`.
261
+ */
262
+ interface TokenStorage {
263
+ getItem(key: string): string | null;
264
+ setItem(key: string, value: string): void;
265
+ }
266
+ declare function setTokenStorage(storage: TokenStorage): void;
267
+ declare function getOrCreateUserToken(): string;
268
+ type ClusterBadgeProps = {
269
+ /** Cluster centroid as `[longitude, latitude]`. */
270
+ lngLat: [number, number];
271
+ /** Number of markers the badge stands in for. */
272
+ count: number;
273
+ /** Visual theme — picks the badge colors (web parity). */
274
+ theme: 'light' | 'dark';
275
+ onPress?: () => void;
276
+ };
277
+ /**
278
+ * The count badge that stands in for clustered highlight/search markers —
279
+ * the native counterpart of the web SDK's cluster DOM marker (blue circle,
280
+ * white border, bold count).
281
+ */
282
+ declare const ClusterBadge: import("react").MemoExoticComponent<({ lngLat, count, theme, onPress }: ClusterBadgeProps) => import("react/jsx-runtime").JSX.Element>;
283
+ /**
284
+ * Clustering configuration and normalization — the declarative counterpart of
285
+ * the web SDK's `setClustering`. Defaults match the web SDK exactly:
286
+ * 60 px merge radius, no clustering above zoom 16, clusters need ≥ 2 markers.
287
+ */
288
+ declare const DEFAULT_CLUSTER_RADIUS_PX = 60;
289
+ declare const DEFAULT_CLUSTER_MAX_ZOOM = 16;
290
+ declare const DEFAULT_CLUSTER_MIN_POINTS = 2;
291
+ /** A single marker that belongs to a pressed cluster. */
292
+ type ClusterChild = {
293
+ /**
294
+ * The marker id. Web parity uses numeric POI ids; the RN SDK also accepts
295
+ * string keys (search results without an `id` get index-based keys).
296
+ */
297
+ id: number | string;
298
+ lng: number;
299
+ lat: number;
300
+ };
301
+ /**
302
+ * Called when a cluster badge is pressed, with the POIs it represents. Return
303
+ * exactly `false` to suppress the default zoom-to-expand behaviour.
304
+ */
305
+ type ClusterClickHandler = (children: ClusterChild[]) => unknown;
306
+ /**
307
+ * Clustering config for highlight/search markers. Off by default; pass `true`
308
+ * to enable with defaults, or an object to tune it (passing an object also
309
+ * enables it).
310
+ */
311
+ type ClusteringConfig = boolean | {
312
+ /** Merge distance in screen points. Default 60. */
313
+ radius?: number;
314
+ /** Above this zoom, markers never cluster. Default 16. */
315
+ maxZoom?: number;
316
+ /** Minimum markers within `radius` to form a cluster. Min/default 2. */
317
+ minPoints?: number;
318
+ /** Overrides/augments the default zoom-to-expand on cluster press. */
319
+ onClusterClick?: ClusterClickHandler;
320
+ };
321
+ type NormalizedClusteringConfig = {
322
+ enabled: boolean;
323
+ radius: number;
324
+ maxZoom: number;
325
+ minPoints: number;
326
+ onClusterClick?: ClusterClickHandler;
327
+ };
328
+ /**
329
+ * Normalizes the public clustering option (`true` / config object / falsy)
330
+ * into a fully-resolved config. Passing an object enables clustering.
331
+ * `minPoints` is clamped to at least 2 — a "cluster" of one is just the
332
+ * marker itself.
333
+ */
334
+ declare function normalizeClusteringConfig(input: ClusteringConfig | undefined): NormalizedClusteringConfig;
335
+ /** A marker eligible for clustering: its id and coordinates. */
336
+ type ClusterPoint = {
337
+ id: number | string;
338
+ lng: number;
339
+ lat: number;
340
+ };
341
+ /** A computed cluster: badge position plus the members it stands in for. */
342
+ type PixelCluster = {
343
+ /**
344
+ * Key used to reuse a badge across recomputes (the first member's id —
345
+ * grouping is deterministic, so this is stable).
346
+ */
347
+ key: number | string;
348
+ lng: number;
349
+ lat: number;
350
+ members: ClusterChild[];
351
+ };
352
+ /**
353
+ * Groups projected points greedily by pixel distance: each unvisited point
354
+ * seeds a group and absorbs every remaining point within `radius`. O(n²), but
355
+ * the highlighted/search-marker count is small (dozens at most), so this
356
+ * stays cheap and deterministic. Ported from the web SDK's cluster engine.
357
+ */
358
+ declare function groupByPixelRadius<T extends {
359
+ x: number;
360
+ y: number;
361
+ }>(items: T[], radius: number): T[][];
362
+ /**
363
+ * Base-style layer targets — mirrors the web SDK's `ClickLayerTarget`. Unlike
364
+ * the web SDK (which resolves layer ids dynamically from the loaded style),
365
+ * native cannot enumerate style layers, so these are the canonical Yarrow
366
+ * style layer ids, verified against the served `/styles/` document (identical
367
+ * in light and dark). Apps can override per target via the options argument
368
+ * of `useYarrowLayerPress` if the style changes.
369
+ */
370
+ type ClickLayerTarget = 'pois' | 'buildings' | 'mahalla' | 'district' | 'region' | 'country';
371
+ declare const YARROW_CLICK_LAYER_IDS: Record<ClickLayerTarget, string[]>;
372
+ type LayerPressInfo = {
373
+ lat: number;
374
+ lng: number;
375
+ properties: Record<string, unknown>;
376
+ /** `true` when the pressed POI is currently highlighted (pois target only). */
377
+ selected?: boolean;
378
+ };
379
+ type UseYarrowLayerPressOptions = {
380
+ /** Per-target layer-id overrides (the base map's layer ids). */
381
+ layerIds?: Partial<Record<ClickLayerTarget, string[]>>;
382
+ };
383
+ /**
384
+ * Base-style-layer press handler — the native counterpart of the web SDK's
385
+ * `onIconClick('pois' | 'buildings')` and `onLayerClick(<admin label>)`. On
386
+ * every map press it queries the rendered features at the press point for the
387
+ * target layers and invokes `handler` with the topmost hit. Must be called
388
+ * inside `<YarrowMapView>` — extract a child component rendered as a map
389
+ * child (hooks outside the map can't see the runtime):
390
+ *
391
+ * ```tsx
392
+ * function PoiPressReporter() {
393
+ * useYarrowLayerPress('pois', ({ lat, lng, properties, selected }) => {
394
+ * console.log('POI pressed', properties.id, selected);
395
+ * });
396
+ * return null;
397
+ * }
398
+ *
399
+ * <YarrowMapView apiKey={KEY}>
400
+ * <PoiPressReporter />
401
+ * </YarrowMapView>
402
+ * ```
403
+ *
404
+ * Unlike the web SDK, targets resolve to the canonical Yarrow style layer
405
+ * ids (verified against the served `/styles/` document, identical in light
406
+ * and dark) instead of dynamic style inspection — override `layerIds` if
407
+ * your style variant names them differently.
408
+ */
409
+ declare function useYarrowLayerPress(target: ClickLayerTarget | ClickLayerTarget[], handler: (info: LayerPressInfo) => void, options?: UseYarrowLayerPressOptions): void;
410
+ type UseYarrowSearchOptions = {
411
+ /** Latitude the search ranks results around. */
412
+ lat: number;
413
+ /** Longitude the search ranks results around. */
414
+ lon: number;
415
+ /** Result page. Default `1`. */
416
+ page?: number;
417
+ /** Results per page. Default `15`. */
418
+ pageSize?: number;
419
+ /** Debounce before querying, ms. Default `300`. */
420
+ debounceMs?: number;
421
+ /** Set `false` to pause querying — pending results clear while paused.
422
+ * Default `true`. */
423
+ enabled?: boolean;
424
+ };
425
+ type UseYarrowSearchResult = {
426
+ results: SearchResult[];
427
+ isLoading: boolean;
428
+ error: Error | null;
429
+ };
430
+ /**
431
+ * Debounced, abortable search against the Yarrow search API.
432
+ *
433
+ * Requires the API key to be configured (`YarrowMapView` does this on mount;
434
+ * otherwise call `setYarrowApiKey()` first).
435
+ *
436
+ * ```tsx
437
+ * const { results, isLoading } = useYarrowSearch(query, {
438
+ * lat: position?.lat ?? 41.2995,
439
+ * lon: position?.lng ?? 69.2401,
440
+ * });
441
+ * ```
442
+ */
443
+ declare const useYarrowSearch: (query: string, options: UseYarrowSearchOptions) => UseYarrowSearchResult;
444
+ type UseYarrowMapSearchOptions = UseYarrowSearchOptions & {
445
+ /**
446
+ * Re-runs the search when the camera moves at least `thresholdMeters`
447
+ * (default 500, web parity) after a `debounceMs` settle delay (default 250,
448
+ * web parity). Pass `false` to disable; `true` uses both defaults.
449
+ */
450
+ refetchOnMove?: boolean | {
451
+ thresholdMeters?: number;
452
+ debounceMs?: number;
453
+ };
454
+ };
455
+ type UseYarrowMapSearchResult = UseYarrowSearchResult & {
456
+ /** The coordinate the current results were fetched around. */
457
+ center: {
458
+ lat: number;
459
+ lon: number;
460
+ };
461
+ };
462
+ /**
463
+ * `useYarrowSearch` plus web-parity re-query on camera movement: when the map
464
+ * moves ≥ 500 m from where the current results were fetched for, the search
465
+ * re-runs around the new center. Must be called inside `<YarrowMapView>` to
466
+ * observe camera moves (outside one it behaves exactly like `useYarrowSearch`).
467
+ *
468
+ * ```tsx
469
+ * const { results, isLoading, center } = useYarrowMapSearch(query, {
470
+ * lat: 41.2995,
471
+ * lon: 69.2401,
472
+ * refetchOnMove: true,
473
+ * });
474
+ * <SearchResultsLayer results={results} />
475
+ * ```
476
+ */
477
+ declare function useYarrowMapSearch(query: string, options: UseYarrowMapSearchOptions): UseYarrowMapSearchResult;
478
+ type UseYarrowRoutingOptions = {
479
+ /**
480
+ * Routing profile. Accepts the API's wire values (`'CAR' | 'FOOT' |
481
+ * 'BICYCLE'`, case-insensitive) and the legacy friendly names —
482
+ * `'driving'` maps to `CAR`, `'walking'` to `FOOT`, `'cycling'` to
483
+ * `BICYCLE`. Default `"driving"`.
484
+ */
485
+ profile?: string;
486
+ /** Language for turn-by-turn directions. */
487
+ language?: string;
488
+ /**
489
+ * Abort a `buildRoute` request after this many milliseconds, rejecting with
490
+ * a `YarrowApiError` (code `'network'`, message mentioning the timeout).
491
+ * Works with or without a caller `signal`; caller cancellation still applies
492
+ * immediately. Pass `0` to disable. Default `30000`.
493
+ */
494
+ timeoutMs?: number;
495
+ };
496
+ type BuildRouteInput = {
497
+ /** Waypoints as `[longitude, latitude][]` (minimum two). */
498
+ coordinates: [number, number][];
499
+ /** Overrides the hook-level profile for this request. */
500
+ profile?: string;
501
+ /** Overrides the hook-level language for this request. */
502
+ language?: string;
503
+ /** Cancels the request. */
504
+ signal?: AbortSignal;
505
+ };
506
+ type UseYarrowRoutingResult = {
507
+ /** Renderable route features — feed straight into `<RouteLayer routes={…}>`. */
508
+ routes: RouteFeature[];
509
+ /** Turn-by-turn directions per route. */
510
+ directions: RouteDirection[][];
511
+ /** Duration/distance/profile summary of the best route, when present. */
512
+ meta: RoutesMeta | null;
513
+ isLoading: boolean;
514
+ error: Error | null;
515
+ /** Fetches routes and stores them in state. Rejects on network failure —
516
+ * "no route found" resolves to an empty result instead. */
517
+ buildRoute: (input: BuildRouteInput) => Promise<FetchRoutesResult>;
518
+ /** Clears routes/directions/meta and any error. */
519
+ clearRoutes: () => void;
520
+ };
521
+ /**
522
+ * Headless routing state for the Yarrow routing API — pairs with
523
+ * `<RouteLayer>` for rendering.
524
+ *
525
+ * Requests abort after `timeoutMs` (default 30 s) and reject with a coded
526
+ * `YarrowApiError`; caller `signal` cancellation applies immediately, and
527
+ * pass `timeoutMs: 0` to disable the timer.
528
+ *
529
+ * ```tsx
530
+ * const { routes, isLoading, buildRoute } = useYarrowRouting({ profile: 'driving' });
531
+ * <YarrowMapView apiKey={KEY} center={[69.2401, 41.2995]}>
532
+ * <RouteLayer routes={routes} />
533
+ * </YarrowMapView>
534
+ * ```
535
+ */
536
+ declare const useYarrowRouting: (options?: UseYarrowRoutingOptions) => UseYarrowRoutingResult;
537
+ /** Icon registry: sprite name (e.g. `"school"`) → image URL. */
538
+ type YarrowIconsMap = Record<string, string>;
539
+ /**
540
+ * Fetches the Yarrow icon registry (`/icons-image`) and reduces it to a
541
+ * name → URL map. Native has no Cache Storage, so the result is not persisted
542
+ * — `<YarrowMapView>` fetches it once per mount when icons are enabled.
543
+ *
544
+ * Also seeds core's API-key module state (like every standalone client), so
545
+ * the key is current even if the hook runs before a map mounts.
546
+ *
547
+ * Throws a coded {@link YarrowApiError}: `unauthorized` when no key is
548
+ * configured (or the server rejects one), `network` when the request fails.
549
+ */
550
+ declare function fetchYarrowIcons(apiKey?: string): Promise<YarrowIconsMap>;
551
+ /**
552
+ * Best-effort icon URL for a search-result `category.name` / tile
553
+ * `node_type`. The registry is keyed by sprite names, which usually match
554
+ * category names — the same fallback the web SDK applies via its icon
555
+ * expression.
556
+ */
557
+ declare function resolveCategoryIcon(iconsByName: YarrowIconsMap | undefined, name: string | undefined): string | undefined;
558
+ type YarrowImagesProps = {
559
+ /** Icon registry entries to add to the style: sprite name → image URL. */
560
+ iconsByName: YarrowIconsMap;
561
+ /**
562
+ * Fired when the style references an icon the registry doesn't cover —
563
+ * the map should re-fetch the registry (once) to recover.
564
+ */
565
+ onMissingIcon?: (name: string) => void;
566
+ };
567
+ /**
568
+ * Adds the Yarrow icon images to the native style so symbol layers can
569
+ * resolve their `icon-image` names — the native counterpart of the web SDK's
570
+ * `addIconsToMap` prefetch plus its missing-image resolver. `Images` accepts
571
+ * remote URLs and downloads them natively; `onImageMissing` covers icons
572
+ * referenced before the registry fetch lands or after a failed fetch.
573
+ */
574
+ declare const YarrowImages: import("react").MemoExoticComponent<({ iconsByName, onMissingIcon }: YarrowImagesProps) => import("react/jsx-runtime").JSX.Element>;
575
+ type BrandBadgePosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
576
+ declare const DEFAULT_BRAND_BADGE_SCALE = 1;
577
+ /**
578
+ * Configuration for the React Native map — the `container`-free counterpart
579
+ * of the web SDK's `YarrowMapConfigOptions`. The native view is sized by the
580
+ * consuming component's layout, so there is no container to name.
581
+ */
582
+ type YarrowMapConfigOptions = {
583
+ /** Yarrow API key from the dashboard. Required. */
584
+ apiKey: string;
585
+ /** Initial map center as `[longitude, latitude]`, e.g. Tashkent. */
586
+ center: [number, number];
587
+ /** Initial zoom level. Default `10`. */
588
+ zoom?: number;
589
+ /** Minimum zoom level. Default `0`. */
590
+ minZoom?: number;
591
+ /** Maximum zoom level. Default `19`. */
592
+ maxZoom?: number;
593
+ /** Style theme. Default `"light"`. */
594
+ theme?: 'light' | 'dark';
595
+ /** Base style. Default `"default"` (street map). */
596
+ styleType?: YarrowStyleType;
597
+ };
598
+ /**
599
+ * Validated, defaulted RN map configuration. Mirrors the web SDK's
600
+ * `YarrowMapConfig` minus the DOM container (the native view is sized by the
601
+ * consuming app's layout) and minus web-only rendering options (hover,
602
+ * clustering, controls, tile cache — none of which exist on native).
603
+ */
604
+ declare class YarrowMapConfig {
605
+ readonly center: [number, number];
606
+ readonly zoom: number;
607
+ readonly minZoom: number;
608
+ readonly maxZoom: number;
609
+ theme: 'light' | 'dark';
610
+ styleType: YarrowStyleType;
611
+ apiKey: string;
612
+ constructor(config: YarrowMapConfigOptions);
613
+ }
614
+ type RoutePressEvent = NativeSyntheticEvent<PressEventWithFeatures>;
615
+ /**
616
+ * Called when a rendered route is pressed, with the press event (carrying the
617
+ * GeoJSON feature) and the route's index in the `routes` array.
618
+ */
619
+ type RoutePressHandler = (event: RoutePressEvent, routeIndex: number) => void;
620
+ type RouteLayerProps = {
621
+ /** Route line features — feed with `useYarrowRouting().routes` or your own
622
+ * `fetchRoutes()` result. Best route renders bold; the rest as fainter,
623
+ * thinner alternatives. */
624
+ routes: RouteFeature[];
625
+ /** Index of the route to highlight. Default `0`. */
626
+ bestIndex?: number;
627
+ /** Best-route color. Default `#22c55e`. */
628
+ routeColor?: string;
629
+ /** Best-route line width. Default `5`. */
630
+ routeWidth?: number;
631
+ /** Best-route opacity. Default `1`. */
632
+ routeOpacity?: number;
633
+ /** Alternative-route color. Default `#aaaaaa` — every alternative shares
634
+ * it, matching the web SDK's `buildRoute()`. */
635
+ alternativeColor?: string;
636
+ /** Alternative-route line width. Default `2.5`. */
637
+ alternativeWidth?: number;
638
+ /** Alternative-route opacity. Default `0.5`. */
639
+ alternativeOpacity?: number;
640
+ /** Prefix for source/layer ids. Default `"yarrow-route"`. */
641
+ layerPrefix?: string;
642
+ /** Called when a rendered route line is pressed. */
643
+ onPressRoute?: RoutePressHandler;
644
+ /**
645
+ * Distinct-series mode — web `renderRoutes()` parity. Every route draws in
646
+ * its own color from the shared `ROUTE_COLORS` palette (cycled), width 4
647
+ * and opacity 0.8, with no best/alternative distinction; the
648
+ * `bestIndex`/route/alternative style props are ignored.
649
+ */
650
+ distinct?: boolean;
651
+ };
652
+ /**
653
+ * Declarative route rendering: one GeoJSON source + line layer per route.
654
+ * Compose inside `<YarrowMapView>` and drive it with `useYarrowRouting()`:
655
+ *
656
+ * ```tsx
657
+ * const { routes } = useYarrowRouting();
658
+ * <YarrowMapView apiKey={KEY} center={[69.2401, 41.2995]}>
659
+ * <RouteLayer routes={routes} onPressRoute={…} />
660
+ * </YarrowMapView>
661
+ * ```
662
+ *
663
+ * Pass `distinct` to render independent series instead of best-route-plus-
664
+ * alternatives — the declarative counterpart of the web SDK's
665
+ * `renderRoutes()`.
666
+ */
667
+ declare const RouteLayer: import("react").MemoExoticComponent<({ routes, bestIndex, routeColor, routeWidth, routeOpacity, alternativeColor, alternativeWidth, alternativeOpacity, layerPrefix, onPressRoute, distinct }: RouteLayerProps) => import("react/jsx-runtime").JSX.Element[]>;
668
+ /**
669
+ * Full style URL for MapLibre React Native's `mapStyle` prop, built from the
670
+ * platform-agnostic style endpoint plus the configured API key. The key comes
671
+ * from core's module state (`setYarrowApiKey`) — `YarrowMapView` calls it for
672
+ * you; standalone callers must set it first or this throws a coded
673
+ * `unauthorized` `YarrowApiError` (instead of producing a keyless style URL
674
+ * that fails opaquely on the native side).
675
+ */
676
+ declare function buildStyleUrl(styleType?: string, theme?: 'light' | 'dark'): string;
677
+ type YarrowMapViewProps = YarrowMapConfigOptions & {
678
+ /** Called once the native map finished loading its style. */
679
+ onReady?: (map: MapRef$1) => void;
680
+ /** Called when the style fails to load. */
681
+ onLoadError?: (error: Error) => void;
682
+ /** Called when the user presses the map (bubbles up from pressable
683
+ * sources unless they call `event.stopPropagation()`). */
684
+ onPress?: MapProps['onPress'];
685
+ /**
686
+ * Called when the camera finishes moving — web `onMoveEnd` parity:
687
+ * `(lat, lng, zoom)`.
688
+ */
689
+ onMoveEnd?: (lat: number, lng: number, zoom: number) => void;
690
+ /** Forwarded to the inner camera — use it for `flyTo`/`fitBounds`/`zoomTo`.
691
+ * The outer component ref is the `MapRef` (getCenter, queryRenderedFeatures…). */
692
+ cameraRef?: Ref<CameraRef$1>;
693
+ /**
694
+ * MapLibre attribution button. Default `false` — the Yarrow brand badge
695
+ * covers attribution duties (web SDK parity). Pass `true` to restore the
696
+ * native ornament.
697
+ */
698
+ attribution?: boolean;
699
+ /**
700
+ * MapLibre logo. Default `false` — the Yarrow brand badge replaces it
701
+ * (web SDK parity). Pass `true` to restore the native ornament.
702
+ */
703
+ logo?: boolean;
704
+ /** Compass ornament. Default `true`. */
705
+ compass?: boolean;
706
+ /**
707
+ * Corner for the Yarrow brand badge overlay (web `brandBadgePosition`
708
+ * parity). Default `"bottom-left"`.
709
+ */
710
+ brandBadgePosition?: BrandBadgePosition;
711
+ /**
712
+ * Size multiplier over the web badge's 106px logo — `1` is exact web
713
+ * sizing (the default). Pass e.g. `1.4` for a bigger brand mark on
714
+ * phones.
715
+ */
716
+ brandBadgeScale?: number;
717
+ /**
718
+ * Android map render mode pass-through. MapLibre's own default is
719
+ * `"surface"`; `"texture"` renders the map into the view hierarchy
720
+ * (needed for view-hierarchy overlays/screenshots). The brand badge
721
+ * never requires it.
722
+ */
723
+ androidView?: MapProps['androidView'];
724
+ /** Fire-and-forget DAU ping when the style first loads. Default `true`. */
725
+ dauTracking?: boolean;
726
+ /**
727
+ * Fetch the Yarrow icon registry and add it to the style so POI symbols and
728
+ * category-icon fallbacks work (web icon-pipeline parity). Disable only if
729
+ * your style/labels don't need the Yarrow icons. Default `true`.
730
+ */
731
+ icons?: boolean;
732
+ /**
733
+ * Called when the icon-registry fetch fails (coded `YarrowApiError` —
734
+ * `unauthorized` for a rejected key, `network` for connection failures).
735
+ * The SDK still warns to the console in dev; POIs degrade to blue dots.
736
+ */
737
+ onIconsError?: (error: Error) => void;
738
+ /** Style for the wrapping native view. Default `{ flex: 1 }`. */
739
+ style?: ViewProps['style'];
740
+ /** Sources/layers/markers rendered inside the map. */
741
+ children?: ReactNode;
742
+ };
743
+ /**
744
+ * React Native Yarrow map. Renders MapLibre Native with a Yarrow style URL
745
+ * (theme + styleType aware, API key attached) and a default camera, and
746
+ * provides the runtime (refs, icon registry, camera/event subscriptions) to
747
+ * the SDK layers rendered inside it.
748
+ *
749
+ * ```tsx
750
+ * const mapRef = useRef<MapRef>(null);
751
+ * <YarrowMapView
752
+ * apiKey="YOUR_API_KEY"
753
+ * center={[69.2401, 41.2995]} // Tashkent
754
+ * zoom={12}
755
+ * theme="dark"
756
+ * onReady={(map) => map.getCenter().then(console.log)}
757
+ * />
758
+ * ```
759
+ *
760
+ * Camera props (`center`, `zoom`) apply only on mount — recenter through
761
+ * `cameraRef` (`flyTo`, `jumpTo`, `fitBounds`). Theme and styleType changes
762
+ * hot-swap the style URL natively.
763
+ */
764
+ declare const YarrowMapView: import("react").ForwardRefExoticComponent<YarrowMapConfigOptions & {
765
+ /** Called once the native map finished loading its style. */
766
+ onReady?: (map: MapRef$1) => void;
767
+ /** Called when the style fails to load. */
768
+ onLoadError?: (error: Error) => void;
769
+ /** Called when the user presses the map (bubbles up from pressable
770
+ * sources unless they call `event.stopPropagation()`). */
771
+ onPress?: MapProps['onPress'];
772
+ /**
773
+ * Called when the camera finishes moving — web `onMoveEnd` parity:
774
+ * `(lat, lng, zoom)`.
775
+ */
776
+ onMoveEnd?: (lat: number, lng: number, zoom: number) => void;
777
+ /** Forwarded to the inner camera — use it for `flyTo`/`fitBounds`/`zoomTo`.
778
+ * The outer component ref is the `MapRef` (getCenter, queryRenderedFeatures…). */
779
+ cameraRef?: Ref<CameraRef$1>;
780
+ /**
781
+ * MapLibre attribution button. Default `false` — the Yarrow brand badge
782
+ * covers attribution duties (web SDK parity). Pass `true` to restore the
783
+ * native ornament.
784
+ */
785
+ attribution?: boolean;
786
+ /**
787
+ * MapLibre logo. Default `false` — the Yarrow brand badge replaces it
788
+ * (web SDK parity). Pass `true` to restore the native ornament.
789
+ */
790
+ logo?: boolean;
791
+ /** Compass ornament. Default `true`. */
792
+ compass?: boolean;
793
+ /**
794
+ * Corner for the Yarrow brand badge overlay (web `brandBadgePosition`
795
+ * parity). Default `"bottom-left"`.
796
+ */
797
+ brandBadgePosition?: BrandBadgePosition;
798
+ /**
799
+ * Size multiplier over the web badge's 106px logo — `1` is exact web
800
+ * sizing (the default). Pass e.g. `1.4` for a bigger brand mark on
801
+ * phones.
802
+ */
803
+ brandBadgeScale?: number;
804
+ /**
805
+ * Android map render mode pass-through. MapLibre's own default is
806
+ * `"surface"`; `"texture"` renders the map into the view hierarchy
807
+ * (needed for view-hierarchy overlays/screenshots). The brand badge
808
+ * never requires it.
809
+ */
810
+ androidView?: MapProps['androidView'];
811
+ /** Fire-and-forget DAU ping when the style first loads. Default `true`. */
812
+ dauTracking?: boolean;
813
+ /**
814
+ * Fetch the Yarrow icon registry and add it to the style so POI symbols and
815
+ * category-icon fallbacks work (web icon-pipeline parity). Disable only if
816
+ * your style/labels don't need the Yarrow icons. Default `true`.
817
+ */
818
+ icons?: boolean;
819
+ /**
820
+ * Called when the icon-registry fetch fails (coded `YarrowApiError` —
821
+ * `unauthorized` for a rejected key, `network` for connection failures).
822
+ * The SDK still warns to the console in dev; POIs degrade to blue dots.
823
+ */
824
+ onIconsError?: (error: Error) => void;
825
+ /** Style for the wrapping native view. Default `{ flex: 1 }`. */
826
+ style?: ViewProps['style'];
827
+ /** Sources/layers/markers rendered inside the map. */
828
+ children?: ReactNode;
829
+ } & import("react").RefAttributes<MapRef$1>>;
830
+ type HighlightMarkerViewProps = {
831
+ /** Coordinates as `[longitude, latitude]`. */
832
+ lngLat: [number, number];
833
+ /** Icon URL; when absent a blue dot is rendered (web parity). */
834
+ iconUrl?: string;
835
+ /** Label rendered under the icon. */
836
+ title?: string;
837
+ /** Icon size in points: a number (square) or `[width, height]`. Default 56. */
838
+ iconSize?: number | [number, number];
839
+ /** Plays the exit animation instead of the enter one. */
840
+ leaving?: boolean;
841
+ onPress?: () => void;
842
+ };
843
+ /**
844
+ * The animated icon+label marker shared by `<PoiHighlightLayer>` and
845
+ * `<SearchResultsLayer>` — the native counterpart of the web SDK's
846
+ * `createMarkerElement` + enter/exit CSS transitions. The scale/fade runs on
847
+ * an inner view (never on the `Marker` itself, which the map repositions
848
+ * every frame).
849
+ */
850
+ declare const HighlightMarkerView: import("react").MemoExoticComponent<({ lngLat, iconUrl, title, iconSize, leaving, onPress }: HighlightMarkerViewProps) => import("react/jsx-runtime").JSX.Element>;
851
+ type YarrowMarkerProps = {
852
+ /** Coordinates as `[longitude, latitude]`. */
853
+ lngLat: [number, number];
854
+ /** Which part of the marker sits on the coordinate. Default `'bottom'`. */
855
+ anchor?: MarkerProps['anchor'];
856
+ /** Pixel offset `[x, y]` applied relative to the anchor. */
857
+ offset?: [number, number];
858
+ /** Called when the marker is pressed. */
859
+ onPress?: () => void;
860
+ /** Marker content — a single view (icon, label, bubble, …). */
861
+ children: ReactElement;
862
+ };
863
+ /**
864
+ * Declarative counterpart of the web SDK's `addMarker()` / `removeMarker()`.
865
+ * Mounting places the marker, unmounting removes it; the React lifecycle
866
+ * replaces the imperative manager pair.
867
+ *
868
+ * ```tsx
869
+ * <YarrowMapView apiKey={KEY} center={[69.2401, 41.2995]}>
870
+ * <YarrowMarker lngLat={[69.2401, 41.2995]} onPress={() => …}>
871
+ * <PinIcon />
872
+ * </YarrowMarker>
873
+ * </YarrowMapView>
874
+ * ```
875
+ */
876
+ declare const YarrowMarker: import("react").MemoExoticComponent<({ lngLat, anchor, offset, onPress, children }: YarrowMarkerProps) => import("react/jsx-runtime").JSX.Element>;
877
+ type ZoomToOptions = {
878
+ /** Animation duration in ms. Web's `speed` option has no native equivalent. */
879
+ duration?: number;
880
+ };
881
+ type FitBoundsOptions = {
882
+ /** Padding in points around the fitted bounds. Default `50`. */
883
+ padding?: number;
884
+ /** Animation duration in ms. Default `1000`. */
885
+ duration?: number;
886
+ };
887
+ type YarrowCamera = {
888
+ /** Flies the camera to a coordinate at `zoom`. */
889
+ zoomTo(lat: number, lng: number, zoom: number, options?: ZoomToOptions): void;
890
+ /**
891
+ * Fits the camera to the bounds of a GeoJSON FeatureCollection. Applies the
892
+ * web SDK's minimum-dimension expansion (0.003°) so single points don't
893
+ * over-zoom. Web's `maxZoom` cap is not supported natively. Empty or
894
+ * fully-degenerate input is ignored with a dev warning (core's inverted
895
+ * sentinel box would otherwise fling the camera off-world).
896
+ */
897
+ fitBounds(data: BoundsInput, options?: FitBoundsOptions): void;
898
+ /** Computes the geographic bounding box of a FeatureCollection. */
899
+ getBoundingBox(data: BoundsInput): BoundingBox;
900
+ };
901
+ /**
902
+ * Web-parity camera helpers on top of a `CameraRef`. Reads the enclosing
903
+ * `<YarrowMapView>` camera when called inside the map; otherwise pass a ref:
904
+ *
905
+ * ```tsx
906
+ * const cameraRef = useRef<CameraRef>(null);
907
+ * <YarrowMapView apiKey={KEY} cameraRef={cameraRef}>…</YarrowMapView>
908
+ * const camera = useYarrowCamera(cameraRef);
909
+ * camera.zoomTo(41.2995, 69.2401, 14);
910
+ * ```
911
+ */
912
+ declare function useYarrowCamera(cameraRefInput?: RefObject<CameraRef$1 | null>): YarrowCamera;
913
+ /** Download progress of an offline region (normalized native pack status). */
914
+ type OfflineRegionProgress = Omit<OfflinePackStatus, 'id'>;
915
+ /**
916
+ * Geographic bounds as `[west, south, east, north]` — the flat corner order
917
+ * MapLibre React Native's `LngLatBounds` uses.
918
+ */
919
+ type OfflineBounds = [west: number, south: number, east: number, north: number];
920
+ type OfflineRegionDownloadOptions = {
921
+ /**
922
+ * Unique region name. Re-downloading an existing name returns the stored
923
+ * pack instead of creating a duplicate; a different name is required per
924
+ * style combination.
925
+ */
926
+ name: string;
927
+ /** Region bounds as `[west, south, east, north]`. */
928
+ bounds: OfflineBounds;
929
+ /** Lowest zoom level to pack. Default `8`. */
930
+ minZoom?: number;
931
+ /** Highest zoom level to pack. Default `15`. */
932
+ maxZoom?: number;
933
+ /** Style the pack pins. Default `"default"`. Offline style swaps only
934
+ * work for styles that were packed. */
935
+ styleType?: YarrowStyleType;
936
+ /** Theme the pack pins. Default `"light"`. */
937
+ theme?: 'light' | 'dark';
938
+ /**
939
+ * Days after which `listRegions()` flags the region `isStale`. Unlike the
940
+ * web cache there is no native TTL — staleness is informational; refresh
941
+ * with `handle.invalidate()`. Default `null` (never stale).
942
+ */
943
+ maxAgeDays?: number | null;
944
+ /** Delete and re-download an existing region with this name. Default `false`. */
945
+ force?: boolean;
946
+ /** Extra app-specific data stored alongside the region metadata, readable
947
+ * back via `listRegions()` → `userMetadata`. JSON-serializable only —
948
+ * native stores metadata as a JSON string. */
949
+ metadata?: Record<string, unknown>;
950
+ /** Progress while the region downloads. */
951
+ onProgress?: (progress: OfflineRegionProgress) => void;
952
+ /** Download failure. Fatal for the region — call `handle.resume()` to retry. */
953
+ onError?: (error: YarrowOfflineError) => void;
954
+ };
955
+ type OfflineRegionErrorCode =
956
+ /** The name exists with different parameters than the stored pack. */
957
+ 'params-mismatch' |
958
+ /** The region is too large for the native offline system. */
959
+ 'region-too-large' |
960
+ /** The native tile-count limit was hit (see `setTileCountLimit`). */
961
+ 'tile-count-limit-exceeded' | 'network' | 'disk' |
962
+ /** A handle referenced a region that no longer exists. */
963
+ 'not-found' | 'unknown';
964
+ type YarrowOfflineError = Error & {
965
+ code: OfflineRegionErrorCode;
966
+ /** Native pack id, when the error is tied to a region. */
967
+ regionId?: string;
968
+ };
969
+ type OfflineRegionSummary = {
970
+ id: string;
971
+ name: string;
972
+ styleType: YarrowStyleType;
973
+ theme: 'light' | 'dark';
974
+ bounds: OfflineBounds;
975
+ minZoom: number;
976
+ maxZoom: number;
977
+ status: OfflineRegionProgress['state'];
978
+ /** Download percentage, 0–100. */
979
+ percentage: number;
980
+ /** Bytes of tiles stored so far. */
981
+ completedTileSize: number;
982
+ /** True when `maxAgeDays` has elapsed since `createdAt`. */
983
+ isStale: boolean;
984
+ /** Epoch ms when the region was created. */
985
+ createdAt: number;
986
+ /** The `metadata` the app passed to `downloadRegion`, if any. */
987
+ userMetadata?: Record<string, unknown>;
988
+ };
989
+ type OfflineRegionHandle = {
990
+ /** Native pack id (UUID). */
991
+ id: string;
992
+ name: string;
993
+ /**
994
+ * Resolves with the final progress on completion, rejects with a
995
+ * `YarrowOfflineError` on the first download failure. It stays rejected
996
+ * after that — retry with `resume()` and track recovery through
997
+ * `onProgress` / `refreshStatus()` instead of awaiting `done` again.
998
+ */
999
+ done: Promise<OfflineRegionProgress>;
1000
+ /** Current status snapshot from the native layer. */
1001
+ refreshStatus: () => Promise<OfflineRegionProgress>;
1002
+ pause: () => Promise<void>;
1003
+ resume: () => Promise<void>;
1004
+ /** Revalidates stored tiles against the server and re-fetches changed
1005
+ * ones — the cheap refresh path. */
1006
+ invalidate: () => Promise<void>;
1007
+ delete: () => Promise<void>;
1008
+ };
1009
+ type OfflineRegionEstimate = {
1010
+ /** Unique `z/x/y` tiles across `[minZoom, maxZoom]`. Each style downloads
1011
+ * one tile per source (≈12 vector sources, satellite adds a raster one),
1012
+ * so network/storage cost scales with the style's source count too. */
1013
+ tileCount: number;
1014
+ /** Rough storage estimate: `tileCount × avgTileBytes`. */
1015
+ estSizeBytes: number;
1016
+ tilesPerLevel: Array<{
1017
+ zoom: number;
1018
+ tiles: number;
1019
+ }>;
1020
+ };
1021
+ /** Default minimum zoom for offline regions. */
1022
+ declare const DEFAULT_OFFLINE_MIN_ZOOM = 8;
1023
+ /** Default maximum zoom for offline regions. */
1024
+ declare const DEFAULT_OFFLINE_MAX_ZOOM = 15;
1025
+ /** Schema version of the pack metadata this SDK writes. */
1026
+ declare const OFFLINE_METADATA_VERSION = 1;
1027
+ /**
1028
+ * Rough bytes per downloaded `z/x/y` tile, empirically measured from a
1029
+ * Tashkent z14 tile: ≈64 KB × ~8 sources carrying data ≈ 0.5 MB. A region's
1030
+ * true size depends on the style's source count and local data density —
1031
+ * pass `avgTileBytes` for a tighter estimate.
1032
+ */
1033
+ declare const AVG_TILE_BYTES = 500000;
1034
+ type EstimateRegionInput = {
1035
+ bounds: OfflineBounds;
1036
+ minZoom: number;
1037
+ maxZoom: number;
1038
+ /** Bytes per `z/x/y` tile used for the size estimate. Default `500_000`. */
1039
+ avgTileBytes?: number;
1040
+ };
1041
+ /**
1042
+ * Estimates the download/storage cost of an offline region — pure tile math,
1043
+ * no native calls. Tile counts are exact for the XYZ scheme; byte estimates
1044
+ * are rough (see `AVG_TILE_BYTES`).
1045
+ *
1046
+ * ```ts
1047
+ * const { tileCount, estSizeBytes } = estimateRegion({
1048
+ * bounds: [69.15, 41.2, 69.4, 41.4], // Tashkent
1049
+ * minZoom: 8,
1050
+ * maxZoom: 15,
1051
+ * });
1052
+ * ```
1053
+ */
1054
+ declare const estimateRegion: (input: EstimateRegionInput) => OfflineRegionEstimate;
1055
+ type UseYarrowOfflineRegionsOptions = {
1056
+ /** Yarrow API key from the dashboard. Required. */
1057
+ apiKey: string;
1058
+ /** Poll interval while any region is downloading, ms. Default `1000`. */
1059
+ pollMs?: number;
1060
+ };
1061
+ type UseYarrowOfflineRegionsResult = {
1062
+ /** All regions created through the SDK, newest first. */
1063
+ regions: OfflineRegionSummary[];
1064
+ /** True during the initial `listRegions()` load. */
1065
+ isLoading: boolean;
1066
+ error: Error | null;
1067
+ /** Re-reads regions from the native layer. */
1068
+ refresh: () => Promise<void>;
1069
+ /** Starts a region download (idempotent by `name` — see
1070
+ * `YarrowOfflineManager.downloadRegion`). */
1071
+ download: (options: OfflineRegionDownloadOptions) => Promise<OfflineRegionHandle>;
1072
+ pause: (name: string) => Promise<void>;
1073
+ resume: (name: string) => Promise<void>;
1074
+ /** Revalidates stored tiles against the server — the cheap refresh path. */
1075
+ invalidate: (name: string) => Promise<void>;
1076
+ remove: (name: string) => Promise<void>;
1077
+ };
1078
+ /**
1079
+ * Offline region state for settings/offline screens — pairs with
1080
+ * `YarrowOfflineManager`. Polls the native layer while downloads run, so
1081
+ * `regions` (and progress bars) stay current.
1082
+ *
1083
+ * ```tsx
1084
+ * const { regions, download, remove } = useYarrowOfflineRegions({ apiKey });
1085
+ * await download({ name: 'tashkent', bounds: [69.15, 41.2, 69.4, 41.4] });
1086
+ * ```
1087
+ */
1088
+ declare const useYarrowOfflineRegions: (options: UseYarrowOfflineRegionsOptions) => UseYarrowOfflineRegionsResult;
1089
+ type YarrowOfflineManagerOptions = {
1090
+ /** Yarrow API key from the dashboard. Required. */
1091
+ apiKey: string;
1092
+ };
1093
+ /**
1094
+ * Offline region manager for React Native — a Yarrow-flavoured wrapper around
1095
+ * MapLibre React Native's `OfflineManager`.
1096
+ *
1097
+ * The web SDK's `yarrowcache` protocol cannot exist on native (no
1098
+ * `addProtocol`), so offline support here is region packs: pick a bounding
1099
+ * box and zoom range, download it once, and the map renders from the native
1100
+ * offline database with no network.
1101
+ *
1102
+ * ```ts
1103
+ * const offline = new YarrowOfflineManager({ apiKey: 'YOUR_API_KEY' });
1104
+ * const { tileCount, estSizeBytes } = offline.estimateRegion({
1105
+ * bounds: [69.15, 41.2, 69.4, 41.4], // Tashkent
1106
+ * minZoom: 8,
1107
+ * maxZoom: 15,
1108
+ * });
1109
+ * const region = await offline.downloadRegion({
1110
+ * name: 'tashkent-city',
1111
+ * bounds: [69.15, 41.2, 69.4, 41.4],
1112
+ * maxAgeDays: 30,
1113
+ * onProgress: (p) => console.log(`${p.percentage}%`),
1114
+ * });
1115
+ * await region.done;
1116
+ * ```
1117
+ */
1118
+ declare class YarrowOfflineManager {
1119
+ private readonly apiKey;
1120
+ /**
1121
+ * Downloads this session created, keyed by pack id. MLRN's listener maps
1122
+ * are last-write-wins, so re-attaching listeners over a live download
1123
+ * would strand the original handle — `reattachExisting` consults this map
1124
+ * and reuses the original `done` instead.
1125
+ */
1126
+ private readonly activeDownloads;
1127
+ /**
1128
+ * Every live `done` settlement channel this session handed out, keyed by
1129
+ * native pack id — including reattached ones (`getRegion`) that are NOT in
1130
+ * `activeDownloads`. Deleting a pack settles (rejects) its channels so no
1131
+ * outstanding `done` hangs after the region disappears.
1132
+ */
1133
+ private readonly liveChannels;
1134
+ constructor(options: YarrowOfflineManagerOptions);
1135
+ /**
1136
+ * Creates a `done` promise together with its settlement channel. The
1137
+ * channel registers itself under the pack id (lazily — the id is often
1138
+ * only known after `createPack` resolves, or when the first event arrives)
1139
+ * so a later deletion can reject every outstanding `done` for that pack.
1140
+ */
1141
+ private createPendingDone;
1142
+ /**
1143
+ * Pure tile-math estimate of a region's download/storage cost — no native
1144
+ * calls. See `estimateRegion` for the math and caveats.
1145
+ */
1146
+ estimateRegion(input: Parameters<typeof estimateRegion>[0]): OfflineRegionEstimate;
1147
+ /**
1148
+ * Starts (or resumes) a region download. Resolves with a handle once the
1149
+ * pack is created and downloading — progress arrives via `options.onProgress`
1150
+ * and `handle.done` settles with the outcome.
1151
+ *
1152
+ * Idempotent by `name`: an existing matching region is returned as-is
1153
+ * (resumed when incomplete); a name reused with different parameters throws
1154
+ * a `params-mismatch` error. Pass `force: true` to delete and re-download.
1155
+ */
1156
+ downloadRegion(options: OfflineRegionDownloadOptions): Promise<OfflineRegionHandle>;
1157
+ /** Lists regions created through this SDK (native packs created directly
1158
+ * against `OfflineManager` are not included), newest first. */
1159
+ listRegions(): Promise<OfflineRegionSummary[]>;
1160
+ /** Returns the handle for a region by name, or `null`. */
1161
+ getRegion(name: string): Promise<OfflineRegionHandle | null>;
1162
+ /** Ambient cache (seen-tiles LRU) max size in bytes. May erase resources
1163
+ * when shrinking — call once at app startup. `0` disables the cache. */
1164
+ setAmbientCacheSize(size: number): Promise<void>;
1165
+ /** Revalidates ambient-cache tiles against the server — the recommended
1166
+ * way to refresh cached data. */
1167
+ invalidateAmbientCache(): Promise<void>;
1168
+ /** Erases ambient-cache resources. Computationally expensive. */
1169
+ clearAmbientCache(): Promise<void>;
1170
+ /** Maximum number of tiles offline packs may store. Raise it when large
1171
+ * regions fail with a `tile-count-limit-exceeded` error. */
1172
+ setTileCountLimit(limit: number): void;
1173
+ /** Download status event throttle in ms. Platform-defined default (300 ms
1174
+ * today on both iOS and Android). Note errors bypass the throttle. */
1175
+ setProgressEventThrottle(ms: number): void;
1176
+ /** Deletes the offline database (ambient cache + packs), then
1177
+ * reinitializes it. Destructive — and MLRN's JS pack cache only clears
1178
+ * on app restart, so subsequent reads may hit stale ids (guarded as
1179
+ * `not-found`). Prefer per-region `invalidate`/`delete`. */
1180
+ resetDatabase(): Promise<void>;
1181
+ private hydrate;
1182
+ private findRegionPacks;
1183
+ private findParamMismatches;
1184
+ /** Attaches listeners to a pack that may have outlived the JS layer
1185
+ * (created in a previous app session) and builds a fresh handle.
1186
+ *
1187
+ * Deliberately cautious: it never hijacks a download this session owns,
1188
+ * never attaches listeners to packs that don't need them, and — on
1189
+ * Android, where attaching an observer *activates* the region — never
1190
+ * wakes a paused pack unless the caller explicitly asked for a download. */
1191
+ private reattachExisting;
1192
+ private toHandle;
1193
+ /**
1194
+ * Deletes a pack natively and settles every outstanding handle: their
1195
+ * `done` rejects with a `not-found` YarrowOfflineError (a deleted pack
1196
+ * never emits another event, so awaiting `done` would otherwise hang
1197
+ * forever). `forced` marks the force-re-download path for the message.
1198
+ * Native failures leave handles untouched — the pack still exists.
1199
+ */
1200
+ private deletePack;
1201
+ }
1202
+ /** Coordinates the caller already holds (e.g. from a search result). */
1203
+ type PlaceLocation = {
1204
+ lat: number;
1205
+ lng: number;
1206
+ };
1207
+ /** Coordinates (+ optional icon URL and title) resolved before placing a marker. */
1208
+ type ResolvedPoiData = {
1209
+ lng: number;
1210
+ lat: number;
1211
+ iconUrl?: string;
1212
+ title?: string;
1213
+ };
1214
+ /** Payload passed to a highlight marker's press handler. */
1215
+ type PoiHighlightPressInfo = {
1216
+ /** The highlighted POI id. */
1217
+ id: number;
1218
+ lng: number;
1219
+ lat: number;
1220
+ /** Resolved title/icon of the marker, if any. */
1221
+ title?: string;
1222
+ iconUrl?: string;
1223
+ };
1224
+ /**
1225
+ * Per-id data the caller already holds. Anything provided here skips the
1226
+ * corresponding lookup (viewport query / place-detail API) — the cheapest
1227
+ * resolution wins, exactly like the web SDK's `HighlightPOIOptions`.
1228
+ */
1229
+ type HighlightPoiData = {
1230
+ location?: PlaceLocation;
1231
+ icon?: string;
1232
+ title?: string;
1233
+ };
1234
+ type PoiHighlightLayerProps = {
1235
+ /** POI id(s) to highlight — the declarative selection state. */
1236
+ ids: number | number[];
1237
+ /**
1238
+ * Per-id data the caller already holds (location/icon/title). Anything
1239
+ * provided skips the corresponding lookup.
1240
+ */
1241
+ dataById?: Record<number, HighlightPoiData>;
1242
+ /** Icon size in points: a number (square) or `[width, height]`. Default 56. */
1243
+ iconSize?: number | [number, number];
1244
+ /** Flies the camera to the highlighted POI(s) once resolved. Default `false`. */
1245
+ panTo?: boolean;
1246
+ /** Target zoom for `panTo` of a single POI. Default `13`. */
1247
+ zoom?: number;
1248
+ /** Clusters the highlight markers (`true` or a config object). */
1249
+ clustering?: ClusteringConfig;
1250
+ /** Called when a highlight marker is pressed. */
1251
+ onHighlightPress?: (info: PoiHighlightPressInfo) => void;
1252
+ /** Called when a POI could not be resolved (its highlight is rolled back). */
1253
+ onResolveError?: (id: number) => void;
1254
+ };
1255
+ /**
1256
+ * Declarative counterpart of the web SDK's `highlightPOI()`: renders an
1257
+ * animated icon+label marker for each highlighted POI id, resolving each id
1258
+ * cheapest-first (caller data → rendered tiles → place-detail API).
1259
+ * Highlight state is owned by the `ids` prop (or
1260
+ * `useYarrowPoiHighlight().highlightedIds`); removing an id plays the exit
1261
+ * animation and unmounts the marker.
1262
+ *
1263
+ * Known native limitation (documented in the README): the base style's own
1264
+ * POI icon is not hidden behind the highlight marker — native has no runtime
1265
+ * `setFilter`, so the marker simply draws on top of it.
1266
+ *
1267
+ * ```tsx
1268
+ * <YarrowMapView apiKey={KEY} center={[69.2401, 41.2995]}>
1269
+ * <PoiHighlightLayer ids={[123]} dataById={{ 123: { location } }} panTo />
1270
+ * </YarrowMapView>
1271
+ * ```
1272
+ */
1273
+ declare function PoiHighlightLayer({ ids, dataById, iconSize, panTo, zoom, clustering, onHighlightPress, onResolveError }: PoiHighlightLayerProps): import("react/jsx-runtime").JSX.Element | null;
1274
+ /** Camera state snapshot delivered to region-change subscribers. */
1275
+ type YarrowRegionState = {
1276
+ /** Map center as `[lng, lat]`. */
1277
+ center: [number, number];
1278
+ zoom: number;
1279
+ };
1280
+ /** A raw map press, delivered to press subscribers before `onPress` props. */
1281
+ type YarrowMapPress = {
1282
+ /** Press location as `[lng, lat]`. */
1283
+ lngLat: [number, number];
1284
+ /** Press location in viewport pixels `[x, y]` (for `queryRenderedFeatures`). */
1285
+ point: [number, number];
1286
+ };
1287
+ /**
1288
+ * Shared runtime state that `<YarrowMapView>` provides to the layers and hooks
1289
+ * rendered inside it. Everything is optional at the type level so hooks can
1290
+ * also run outside a map (they no-op with a console warning where relevant).
1291
+ */
1292
+ type YarrowMapRuntime = {
1293
+ apiKey: string;
1294
+ /** Visual theme of the map, for theme-aware overlay styling. */
1295
+ theme: 'light' | 'dark';
1296
+ mapRef: RefObject<MapRef$1 | null>;
1297
+ cameraRef: RefObject<CameraRef$1 | null>;
1298
+ /** Icon registry: sprite name → image URL (empty until loaded / disabled). */
1299
+ iconsByName: Record<string, string>;
1300
+ /**
1301
+ * POI ids currently highlighted by `<PoiHighlightLayer>` — a mutable set
1302
+ * (no re-renders) so press handlers can report the web SDK's `selected`
1303
+ * flag. Updated by the layer; read by `useYarrowLayerPress`.
1304
+ */
1305
+ highlightedPoiIds: RefObject<Set<number>>;
1306
+ /**
1307
+ * Subscribes to region changes (the `moveend` parity point). Returns an
1308
+ * unsubscribe function.
1309
+ */
1310
+ subscribeRegionChange: (listener: (state: YarrowRegionState) => void) => () => void;
1311
+ /**
1312
+ * Subscribes to raw map presses. Returns an unsubscribe function.
1313
+ */
1314
+ subscribePress: (listener: (press: YarrowMapPress) => void) => () => void;
1315
+ };
1316
+ declare const YarrowMapContext: import("react").Context<YarrowMapRuntime | null>;
1317
+ /** Reads the enclosing `<YarrowMapView>` runtime, or `null` outside one. */
1318
+ declare function useYarrowMapRuntime(): YarrowMapRuntime | null;
1319
+ /** The base style's POI symbol layer (`node_tile` source). */
1320
+ declare const POI_BASE_LAYER = "pois_tile_layer";
1321
+ /**
1322
+ * Fetches a POI's coordinates and icon from the place-detail API — the
1323
+ * off-screen / below-zoom fallback of the resolution chain. Returns `null`
1324
+ * on any failure or missing coordinates (web parity).
1325
+ *
1326
+ * When the response carries no `icon_img`, the icon is derived from
1327
+ * `node_type` (falling back to `category.name`) — the web SDK resolves it
1328
+ * through its style `icon-image` expression; native approximates that with
1329
+ * an icon-registry lookup by the same name, since the detail endpoint
1330
+ * returns the node type rather than an icon URL.
1331
+ */
1332
+ declare function fetchPlaceLocation(id: number, iconsByName?: Record<string, string>): Promise<ResolvedPoiData | null>;
1333
+ /**
1334
+ * Reads a POI's point geometry from the style's POI layer within the current
1335
+ * viewport — the free, no-network resolution step. Native can only query
1336
+ * *rendered* features (no `querySourceFeatures` on undeclared sources), so
1337
+ * off-screen POIs fall through to the place-detail API. Icons are resolved
1338
+ * best-effort from the registry via the feature's `node_type`.
1339
+ */
1340
+ declare function lookupPoiInViewport(mapRef: MapRef$1, id: number, iconsByName?: Record<string, string>): Promise<ResolvedPoiData | null>;
1341
+ /**
1342
+ * Resolves a POI's coordinates, icon and title cheapest-first:
1343
+ * 1. caller-provided `location` / `icon` / `title`
1344
+ * 2. local lookup in the rendered POI layer (no network)
1345
+ * 3. the place-detail API (off-screen / below the POI zoom range, or when
1346
+ * anything is still missing — web parity: the API fills icon and title
1347
+ * too, not just coordinates)
1348
+ *
1349
+ * The web SDK additionally evaluates the style's `icon-image` expression for
1350
+ * both the tile and the place-detail steps; native approximates it with a
1351
+ * registry lookup by `node_type`. Coordinate resolution is the hard
1352
+ * requirement — if it fails, the highlight is rolled back by the caller.
1353
+ */
1354
+ declare function resolvePoiData(id: number, options: HighlightPoiData, runtime: YarrowMapRuntime): Promise<ResolvedPoiData | null>;
1355
+ /** Handle for one active highlight — mirrors the web SDK's `POIHighlight`. */
1356
+ type YarrowPoiHighlight = {
1357
+ readonly id: number;
1358
+ remove: () => void;
1359
+ };
1360
+ type UseYarrowPoiHighlightResult = {
1361
+ /** All currently highlighted ids — feed to `<PoiHighlightLayer ids={…}>`. */
1362
+ highlightedIds: number[];
1363
+ /**
1364
+ * Highlights one or more POIs. Additive by default (web parity); pass
1365
+ * `{ replace: true }` to reset the selection first. Returns one handle per
1366
+ * id whose `remove()` un-highlights it.
1367
+ */
1368
+ highlight: (input: number | number[], options?: {
1369
+ replace?: boolean;
1370
+ }) => YarrowPoiHighlight[];
1371
+ /** Un-highlights all POIs, or the given id(s). */
1372
+ reset: (input?: number | number[]) => void;
1373
+ /** Whether a POI id is currently highlighted. */
1374
+ isHighlighted: (id: number) => boolean;
1375
+ };
1376
+ /**
1377
+ * Headless highlight state — the declarative counterpart of the web SDK's
1378
+ * `highlightPOI` / `resetPOIHighlight` / `isPOIHighlighted` /
1379
+ * `getHighlightedPOIs` quartet. Rendering is owned by `<PoiHighlightLayer>`:
1380
+ *
1381
+ * ```tsx
1382
+ * const { highlightedIds, highlight } = useYarrowPoiHighlight();
1383
+ * <YarrowMapView apiKey={KEY}>
1384
+ * <PoiHighlightLayer ids={highlightedIds} panTo />
1385
+ * </YarrowMapView>
1386
+ * ```
1387
+ */
1388
+ declare function useYarrowPoiHighlight(): UseYarrowPoiHighlightResult;
1389
+ type SearchResultsLayerProps = {
1390
+ /** Results from `useYarrowSearch` (or your own fetch). */
1391
+ results: SearchResult[];
1392
+ /** Icon size in points: a number (square) or `[width, height]`. Default 56. */
1393
+ iconSize?: number | [number, number];
1394
+ /**
1395
+ * Fits the camera to the results the first time a non-empty page renders
1396
+ * (default `true`). The fit runs once per session — pass a `fitKey` to
1397
+ * start a new session (web parity: the web fits once per
1398
+ * `highlightSearchResults()` call, so a new query re-fits).
1399
+ */
1400
+ zoomToResults?: boolean;
1401
+ /**
1402
+ * Session identity for `zoomToResults`: changing it re-arms the initial
1403
+ * fit, e.g. `fitKey={query}` re-fits when the query changes (web parity).
1404
+ * Omitted (or unchanged) = fit once per mount.
1405
+ */
1406
+ fitKey?: string | number;
1407
+ /** Clusters the result markers (`true` or a config object). */
1408
+ clustering?: ClusteringConfig;
1409
+ /** Called when a result marker is pressed. */
1410
+ onResultPress?: (lat: number, lng: number, result: SearchResult) => void;
1411
+ };
1412
+ /**
1413
+ * Renders search results on the map — the declarative counterpart of the web
1414
+ * SDK's `highlightSearchResults()`. Icon precedence per result:
1415
+ * `icon_img` → registry icon by `category.name` → blue-dot fallback.
1416
+ *
1417
+ * ```tsx
1418
+ * const { results, isLoading } = useYarrowSearch(query, { lat, lon });
1419
+ * <YarrowMapView apiKey={KEY}>
1420
+ * <SearchResultsLayer results={results} onResultPress={…} />
1421
+ * </YarrowMapView>
1422
+ * ```
1423
+ */
1424
+ declare function SearchResultsLayer({ results, iconSize, zoomToResults, fitKey, clustering, onResultPress }: SearchResultsLayerProps): import("react/jsx-runtime").JSX.Element | null;
1425
+ /**
1426
+ * DAU tracking for the RN SDK — wraps the platform-agnostic core
1427
+ * implementation with the RN default `sdk_type: "react-native"`. Core's own
1428
+ * default (`'javascript'`) exists for the web SDK and would misattribute
1429
+ * direct calls from React Native apps, so this wrapper owns the RN default.
1430
+ * `<YarrowMapView>` passes the key from its own config (see `dauTracking`).
1431
+ */
1432
+ declare function trackDau(apiKey: string, sdkType?: string): void;
1433
+ /**
1434
+ * Minimal slice of `@react-native-async-storage/async-storage` the adapter
1435
+ * needs. Accepting a structural type (instead of importing the module) keeps
1436
+ * the async-storage peer dependency optional.
1437
+ */
1438
+ type AsyncStorageLike = {
1439
+ getItem(key: string): Promise<string | null>;
1440
+ setItem(key: string, value: string): Promise<void>;
1441
+ };
1442
+ /**
1443
+ * Bridges the async AsyncStorage API onto core's synchronous TokenStorage
1444
+ * contract: the existing token hydrates into memory once, reads are served
1445
+ * synchronously from that cache, and writes mirror in-memory before flushing
1446
+ * to AsyncStorage (fire-and-forget).
1447
+ *
1448
+ * If the initial read throws, the override is left unset entirely: core then
1449
+ * degrades to ephemeral tokens *without persisting anything*, so a transient
1450
+ * read failure can never overwrite the stored identity with a fresh token.
1451
+ *
1452
+ * Await this once during app startup, before the first map or tracking call
1453
+ * (tokens generated before this resolves are ephemeral by design):
1454
+ *
1455
+ * ```ts
1456
+ * import AsyncStorage from '@react-native-async-storage/async-storage';
1457
+ * import { setAsyncStorageTokenStorage } from '@yarrow-uz/rn-map-sdk';
1458
+ *
1459
+ * await setAsyncStorageTokenStorage(AsyncStorage);
1460
+ * ```
1461
+ */
1462
+ declare function setAsyncStorageTokenStorage(storage: AsyncStorageLike): Promise<void>;
1463
+ export { YarrowMapViewProps as $, RouteDirection as $t, useYarrowOfflineRegions as A, ClusteringConfig as At, OfflineRegionHandle as B, BoundingBox as Bt, PlaceLocation as C, setTokenStorage as Cn, LayerPressInfo as Ct, YarrowOfflineManagerOptions as D, ClusterChild as Dt, YarrowOfflineManager as E, useYarrowLayerPress as Et, OFFLINE_METADATA_VERSION as F, PixelCluster as Ft, YarrowCamera as G, DEFAULT_CACHE_LIFESPAN_DAYS as Gt, OfflineRegionSummary as H, CACHE_PROTOCOL as Ht, OfflineBounds as I, groupByPixelRadius as It, YarrowMarker as J, ICONS_ENDPOINT as Jt, ZoomToOptions as K, FetchRoutesInput as Kt, OfflineRegionDownloadOptions as L, normalizeClusteringConfig as Lt, estimateRegion as M, DEFAULT_CLUSTER_MIN_POINTS as Mt, DEFAULT_OFFLINE_MAX_ZOOM as N, DEFAULT_CLUSTER_RADIUS_PX as Nt, UseYarrowOfflineRegionsOptions as O, ClusterClickHandler as Ot, DEFAULT_OFFLINE_MIN_ZOOM as P, NormalizedClusteringConfig as Pt, YarrowMapView as Q, ROUTE_API_URL as Qt, OfflineRegionErrorCode as R, ClusterBadge as Rt, HighlightPoiData as S, normalizeStyleType as Sn, ClickLayerTarget as St, ResolvedPoiData as T, transformRouteCoordinates as Tn, YARROW_CLICK_LAYER_IDS as Tt, YarrowOfflineError as U, CacheConfig as Ut, OfflineRegionProgress as V, CACHED_AT_HEADER as Vt, FitBoundsOptions as W, CachedArrayBufferResponse as Wt, HighlightMarkerView as X, MILLISECONDS_PER_DAY as Xt, YarrowMarkerProps as Y, ICON_CACHE_NAME as Yt, HighlightMarkerViewProps as Z, NormalizedCacheConfig as Zt, YarrowMapRuntime as _, getBoundingBox as _n, UseYarrowMapSearchResult as _t, trackDau as a, TokenStorage as an, BrandBadgePosition as at, PoiHighlightLayer as b, hasCacheStorage as bn, UseYarrowSearchResult as bt, UseYarrowPoiHighlightResult as c, YARROW_SEARCH_API_URL as cn, YarrowImagesProps as ct, POI_BASE_LAYER as d, YarrowStyleType as dn, resolveCategoryIcon as dt, RouteDirectionModifier as en, buildStyleUrl as et, fetchPlaceLocation as f, addApiKeyToUrl as fn, BuildRouteInput as ft, YarrowMapPress as g, fetchSearchResults as gn, UseYarrowMapSearchOptions as gt, YarrowMapContext as h, fetchRoutes as hn, useYarrowRouting as ht, setAsyncStorageTokenStorage as i, TILE_CACHE_NAME as in, YarrowMapConfigOptions as it, AVG_TILE_BYTES as j, DEFAULT_CLUSTER_MAX_ZOOM as jt, UseYarrowOfflineRegionsResult as k, ClusterPoint as kt, YarrowPoiHighlight as l, YarrowApiError as ln, YarrowIconsMap as lt, resolvePoiData as m, fetchArrayBufferWithCache as mn, UseYarrowRoutingResult as mt, MapRef as n, RoutesMeta as nn, RouteLayerProps as nt, SearchResultsLayer as o, USER_TOKEN_STORAGE_KEY as on, DEFAULT_BRAND_BADGE_SCALE as ot, lookupPoiInViewport as p, buildStyleEndpoint as pn, UseYarrowRoutingOptions as pt, useYarrowCamera as q, FetchRoutesResult as qt, AsyncStorageLike as r, SearchResult as rn, YarrowMapConfig as rt, SearchResultsLayerProps as s, YARROW_MAP_URL as sn, YarrowImages as st, CameraRef as t, RouteFeature as tn, RouteLayer as tt, useYarrowPoiHighlight as u, YarrowApiErrorCode as un, fetchYarrowIcons as ut, YarrowRegionState as v, getOrCreateUserToken as vn, useYarrowMapSearch as vt, PoiHighlightPressInfo as w, setYarrowApiKey as wn, UseYarrowLayerPressOptions as wt, PoiHighlightLayerProps as x, haversineDistance as xn, useYarrowSearch as xt, useYarrowMapRuntime as y, getYarrowApiKey as yn, UseYarrowSearchOptions as yt, OfflineRegionEstimate as z, ClusterBadgeProps as zt };