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