@yappkit/front-module-map 0.1.8 → 0.2.1

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,121 @@
1
+ import Mapbox from './providers/Mapbox.js';
2
+ import Maplibre from './providers/Maplibre.js';
3
+ import GoogleMaps from './providers/GoogleMaps.js';
4
+ import DeckGL from './providers/DeckGL.js';
5
+ import getAirRoute from './utils/getAirRoute.js';
6
+ import getWaterRoute from './utils/getWaterRoute.js';
7
+ import normalizeRoute from './utils/normalizeRoute.js';
8
+ export declare const utils: {
9
+ getAirRoute: typeof getAirRoute;
10
+ getWaterRoute: typeof getWaterRoute;
11
+ normalizeRoute: typeof normalizeRoute;
12
+ };
13
+ export declare const mapProviders: {
14
+ mapbox: typeof Mapbox;
15
+ maplibre: typeof Maplibre;
16
+ 'maplibre-gl': typeof Maplibre;
17
+ google: typeof GoogleMaps;
18
+ 'google-maps': typeof GoogleMaps;
19
+ deckgl: typeof DeckGL;
20
+ 'deck-gl': typeof DeckGL;
21
+ };
22
+ export type GoogleMapsConfig = {
23
+ /**
24
+ * - Provider discriminant.
25
+ */
26
+ type: 'google' | 'google-maps';
27
+ /**
28
+ * - Google Maps API key. Required: without it the entry is warn+skipped (#255).
29
+ */
30
+ apiKey: string;
31
+ /**
32
+ * - Google Maps libraries, all loaded in a single loader call (e.g.
33
+ * 'maps', 'maps3d', 'elevation'); each becomes available through getSDK(name).
34
+ */
35
+ libraries?: string[];
36
+ /**
37
+ * - Google Maps JS API version channel — Map3D requires 'alpha'
38
+ * (plus a pre-authorized key).
39
+ */
40
+ version?: string;
41
+ };
42
+ export type MapboxConfig = {
43
+ /**
44
+ * - Provider discriminant.
45
+ */
46
+ type: 'mapbox';
47
+ /**
48
+ * - Mapbox public access token. Required: without it the entry is warn+skipped (#255).
49
+ */
50
+ apiKey: string;
51
+ /**
52
+ * - Mapbox REST SDK services to preload; each becomes available through getSDK(name).
53
+ */
54
+ services?: Array<'datasets' | 'directions' | 'geocoding' | 'geocodingV6' | 'mapMatching' | 'matrix' | 'optimization' | 'static' | 'styles' | 'tilequery' | 'tilesets' | 'tokens' | 'uploads' | 'isochrone'>;
55
+ };
56
+ export type MaplibreConfig = {
57
+ /**
58
+ * - Provider discriminant.
59
+ */
60
+ type: 'maplibre' | 'maplibre-gl';
61
+ };
62
+ export type DeckGLConfig = {
63
+ /**
64
+ * - Provider discriminant.
65
+ */
66
+ type: 'deckgl' | 'deck-gl';
67
+ };
68
+ export type MapConfig = GoogleMapsConfig | MapboxConfig | MaplibreConfig | DeckGLConfig;
69
+ export type MapsConfig = Record<string, MapConfig>;
70
+ /**
71
+ * Google Maps provider config (`type: 'google'` / `'google-maps'`).
72
+ * @typedef {object} GoogleMapsConfig
73
+ * @property {'google'|'google-maps'} type - Provider discriminant.
74
+ * @property {string} apiKey - Google Maps API key. Required: without it the entry is warn+skipped (#255).
75
+ * @property {string[]} [libraries] - Google Maps libraries, all loaded in a single loader call (e.g.
76
+ * 'maps', 'maps3d', 'elevation'); each becomes available through getSDK(name).
77
+ * @property {string} [version='weekly'] - Google Maps JS API version channel — Map3D requires 'alpha'
78
+ * (plus a pre-authorized key).
79
+ */
80
+ /**
81
+ * Mapbox provider config (`type: 'mapbox'`), rendering on the mapbox-gl peer.
82
+ * @typedef {object} MapboxConfig
83
+ * @property {'mapbox'} type - Provider discriminant.
84
+ * @property {string} apiKey - Mapbox public access token. Required: without it the entry is warn+skipped (#255).
85
+ * @property {Array<'datasets'|'directions'|'geocoding'|'geocodingV6'|'mapMatching'|'matrix'|'optimization'|'static'|'styles'|'tilequery'|'tilesets'|'tokens'|'uploads'|'isochrone'>} [services]
86
+ * - Mapbox REST SDK services to preload; each becomes available through getSDK(name).
87
+ */
88
+ /**
89
+ * MapLibre provider config (`type: 'maplibre'` / `'maplibre-gl'`) — the token-less mapbox-gl fork
90
+ * (#154): no apiKey, and no Mapbox REST services (getSDK refuses them).
91
+ * @typedef {object} MaplibreConfig
92
+ * @property {'maplibre'|'maplibre-gl'} type - Provider discriminant.
93
+ */
94
+ /**
95
+ * DeckGL provider config (`type: 'deckgl'` / `'deck-gl'`) — no key: composes over the other providers.
96
+ * @typedef {object} DeckGLConfig
97
+ * @property {'deckgl'|'deck-gl'} type - Provider discriminant.
98
+ */
99
+ /**
100
+ * One entry of the `maps` config: a per-instance provider config, discriminated by `type`.
101
+ * @typedef {GoogleMapsConfig|MapboxConfig|MaplibreConfig|DeckGLConfig} MapConfig
102
+ */
103
+ /**
104
+ * The `maps` config key: instance key → provider config. Each valid entry becomes
105
+ * `yAppKit.maps.<key>`; a faulty one is warn+skipped (#166/#255/#351).
106
+ * @typedef {Record<string, MapConfig>} MapsConfig
107
+ */
108
+ export default class MapModule {
109
+ /** Builds `yAppKit.maps` — one provider instance per entry of the `maps` config key ({@link MapsConfig}).
110
+ * @param {object} yAppKit - The yAppKit instance (untyped: @yappkit/front exports no types).
111
+ * @returns {{onAfterSetup: () => void}} The module's yAppKit lifecycle hooks.
112
+ */
113
+ install(yAppKit: object): {
114
+ onAfterSetup: () => void;
115
+ };
116
+ }
117
+ /**
118
+ * Module factory for createYAppKit's `modules` list.
119
+ * @returns {MapModule} A fresh module instance.
120
+ */
121
+ export declare const loadMapModule: () => MapModule;
@@ -0,0 +1,102 @@
1
+ export type DeckGLMapWrapperOptions = {
2
+ /**
3
+ * - Vue watcher options for the options watcher (defaults: `immediate: true, deep: true`).
4
+ */
5
+ watchOptionsOptions?: import('vue').WatchOptions;
6
+ /**
7
+ * - Vue watcher options for the layers watcher (default: `immediate: true`; intentionally not deep — layers are shallow-compared, swap array/layer identity to update).
8
+ */
9
+ watchLayersOptions?: import('vue').WatchOptions;
10
+ /**
11
+ * - Defers map creation: called on mount with the create function instead of creating right away — call `loadMap()` when ready.
12
+ */
13
+ onMounted?: (loadMap: () => void) => void;
14
+ };
15
+ export type DeckGLMapOptions = import('@deck.gl/core').DeckProps & DeckGLMapWrapperOptions;
16
+ /**
17
+ * Wrapper-specific keys of the map options bag — every other key is handed verbatim to the
18
+ * deck.gl `Deck` constructor (and re-applied through `setProps` on change).
19
+ * @typedef {object} DeckGLMapWrapperOptions
20
+ * @property {import('vue').WatchOptions} [watchOptionsOptions] - Vue watcher options for the options watcher (defaults: `immediate: true, deep: true`).
21
+ * @property {import('vue').WatchOptions} [watchLayersOptions] - Vue watcher options for the layers watcher (default: `immediate: true`; intentionally not deep — layers are shallow-compared, swap array/layer identity to update).
22
+ * @property {(loadMap: () => void) => void} [onMounted] - Defers map creation: called on mount with the create function instead of creating right away — call `loadMap()` when ready.
23
+ */
24
+ /**
25
+ * Options accepted by the deckGL `Map` component's `:options` prop and by `createMap`: the
26
+ * deck.gl `Deck` constructor props plus the wrapper keys.
27
+ * @typedef {import('@deck.gl/core').DeckProps & DeckGLMapWrapperOptions} DeckGLMapOptions
28
+ */
29
+ /**
30
+ * Resolved map wrapper — `createMap`'s resolution and the `Map` component's `@loaded` payload:
31
+ * the raw `Deck` instance on `.map`, plus reactive watchers taking Vue refs.
32
+ */
33
+ declare class DeckGLMap {
34
+ /**
35
+ * The raw deck.gl instance (e.g. `pickObject`, `redraw`); null until created and after unmount.
36
+ * @type {import('@deck.gl/core').Deck | null}
37
+ */
38
+ map: import('@deck.gl/core').Deck | null;
39
+ watching: {
40
+ options: boolean;
41
+ layers: boolean;
42
+ };
43
+ /**
44
+ * Stop handles of the active watchers, called on unmount.
45
+ * @type {import('vue').WatchHandle[]}
46
+ */
47
+ unwatchFn: import('vue').WatchHandle[];
48
+ constructor();
49
+ /**
50
+ * Keep the map's props in sync with the ref: re-applies its value through `Deck.setProps` on
51
+ * change (immediate + deep by default). One shot per wrapper: further calls warn and no-op.
52
+ * @param {import('vue').Ref<DeckGLMapOptions>} opts - Ref to the options bag applied to the map.
53
+ * @param {import('vue').WatchOptions} [options] - Overrides for the underlying Vue watcher.
54
+ * @returns {void}
55
+ */
56
+ watchOptions(opts: import('vue').Ref<DeckGLMapOptions>, options?: import('vue').WatchOptions): void;
57
+ /**
58
+ * Keep the map's `layers` prop in sync with the ref (immediate, NOT deep: layers are
59
+ * shallow-compared — swap array/layer identity to update). One shot per wrapper: further calls
60
+ * warn and no-op.
61
+ * @param {import('vue').Ref<import('@deck.gl/core').LayersList>} layers - Ref to the deck.gl layers array.
62
+ * @param {import('vue').WatchOptions} [options] - Overrides for the underlying Vue watcher.
63
+ * @returns {void}
64
+ */
65
+ watchLayers(layers: import('vue').Ref<import('@deck.gl/core').LayersList>, options?: import('vue').WatchOptions): void;
66
+ }
67
+ export default class DeckGL {
68
+ deckgl: {
69
+ Deck: typeof import("@deck.gl/core").Deck;
70
+ } | null;
71
+ /**
72
+ * Memoized component definition (#139), see the `get Map` comment.
73
+ * @type {import('vue').Component | null}
74
+ */
75
+ _MapComponent: import('vue').Component | null;
76
+ constructor();
77
+ /**
78
+ * The deckGL `Map` component. Props: `options` ({@link DeckGLMapOptions}, watched deep) and
79
+ * `layers` (deck.gl layers, shallow-compared). Emits `loaded` with the {@link DeckGLMap}
80
+ * wrapper, and `error`. Provides to descendants: `deckGLMap` (ShallowRef<DeckGLMap | null>,
81
+ * set once loaded), `deckGLPrependLayers` (ShallowRef<LayersList> — layers rendered UNDER the
82
+ * `layers` prop's, e.g. the google-maps DeckGL3DTileLayer's tiles) and `deckGLAppendVNodeFn`
83
+ * (Ref<Array<() => VNodeChild>> — vnode factories rendered after the map's div, e.g. a child's
84
+ * #appendMap credits slot).
85
+ * @returns {import('vue').Component} The map component definition.
86
+ */
87
+ get Map(): import('vue').Component;
88
+ /**
89
+ * Lazy-load and memoize the deck.gl `Deck` class (one dynamic import per provider instance).
90
+ * @returns {Promise<void>}
91
+ */
92
+ loadDeckGL(): Promise<void>;
93
+ /**
94
+ * Imperative SDK entry — must run during a component's `setup()` (it registers the
95
+ * onMounted/onUnmounted hooks that create and destroy the map).
96
+ * @param {import('vue').Ref<HTMLElement | null>} elemRef - Template ref of the element the map renders into (becomes `Deck`'s `parent`).
97
+ * @param {DeckGLMapOptions} [options] - `Deck` constructor props plus the wrapper keys.
98
+ * @returns {Promise<DeckGLMap>} Resolves with the map wrapper once created; rejects with `error.code === 'MAP_UNMOUNTED'` when the component unmounts before the map loads (#148).
99
+ */
100
+ createMap(elemRef: import('vue').Ref<HTMLElement | null>, options?: DeckGLMapOptions): Promise<DeckGLMap>;
101
+ }
102
+ export {};
@@ -0,0 +1,84 @@
1
+ export type DeckGLOverlayWrapperOptions = {
2
+ /**
3
+ * - Vue watcher options for the options watcher (defaults: `immediate: true, deep: true`).
4
+ */
5
+ watchOptionsOptions?: import('vue').WatchOptions;
6
+ /**
7
+ * - Vue watcher options for the layers watcher (default: `immediate: true`; intentionally not deep — layers are shallow-compared, swap array/layer identity to update).
8
+ */
9
+ watchLayersOptions?: import('vue').WatchOptions;
10
+ };
11
+ export type DeckGLOverlayOptions = (import('@deck.gl/mapbox').MapboxOverlayProps | import('@deck.gl/google-maps').GoogleMapsOverlayProps) & DeckGLOverlayWrapperOptions;
12
+ /**
13
+ * Wrapper-specific keys of the overlay options bag — every other key is handed verbatim to the
14
+ * provider overlay's constructor (and re-applied through `setProps` on change).
15
+ * @typedef {object} DeckGLOverlayWrapperOptions
16
+ * @property {import('vue').WatchOptions} [watchOptionsOptions] - Vue watcher options for the options watcher (defaults: `immediate: true, deep: true`).
17
+ * @property {import('vue').WatchOptions} [watchLayersOptions] - Vue watcher options for the layers watcher (default: `immediate: true`; intentionally not deep — layers are shallow-compared, swap array/layer identity to update).
18
+ */
19
+ /**
20
+ * Options accepted by the provider `DeckGLOverlay` components' `:options` prop and by
21
+ * `setDeckGLOverlay()`: the raw overlay's constructor props (`MapboxOverlayProps` on
22
+ * mapbox/maplibre maps, `GoogleMapsOverlayProps` on google maps) plus the wrapper keys.
23
+ * @typedef {(import('@deck.gl/mapbox').MapboxOverlayProps | import('@deck.gl/google-maps').GoogleMapsOverlayProps) & DeckGLOverlayWrapperOptions} DeckGLOverlayOptions
24
+ */
25
+ /**
26
+ * Shared deck.gl overlay wiring (#174): the class and the component below used to be duplicated
27
+ * verbatim in Mapbox.js and GoogleMaps.js — every fix (#151, #156, #165) had to be applied twice.
28
+ * Providers subclass DeckGLOverlay with their `_detach()` and build their component through
29
+ * makeDeckGLOverlayComponent with their inject key.
30
+ */
31
+ export declare class DeckGLOverlay {
32
+ /**
33
+ * The raw deck.gl overlay (a @deck.gl/mapbox MapboxOverlay on mapbox/maplibre maps, a
34
+ * @deck.gl/google-maps GoogleMapsOverlay on google maps), attached by the provider subclass;
35
+ * null until then and after destroy.
36
+ * @type {import('@deck.gl/mapbox').MapboxOverlay | import('@deck.gl/google-maps').GoogleMapsOverlay | null}
37
+ */
38
+ overlay: import('@deck.gl/mapbox').MapboxOverlay | import('@deck.gl/google-maps').GoogleMapsOverlay | null;
39
+ watching: {
40
+ options: boolean;
41
+ layers: boolean;
42
+ };
43
+ unwatchFn: import("vue").WatchHandle[];
44
+ trackedIn: DeckGLOverlay[] | null;
45
+ /**
46
+ * Built by the provider's `setDeckGLOverlay()`, not by consumers directly.
47
+ * @param {object} config - Wiring handed over by the provider subclass.
48
+ * @param {import('vue').WatchHandle[]} config.unwatchFn - List collecting the overlay's watcher stop handles (all called and emptied on destroy).
49
+ * @param {DeckGLOverlay[] | null} [config.trackedIn] - The map wrapper's overlays list this instance is tracked in.
50
+ */
51
+ constructor({ unwatchFn, trackedIn }: {
52
+ unwatchFn: import('vue').WatchHandle[];
53
+ trackedIn?: DeckGLOverlay[] | null;
54
+ });
55
+ /** Stop the watchers, leave the map's tracking list and detach the overlay from the map (#151).
56
+ * @returns {void}
57
+ */
58
+ destroy(): void;
59
+ /**
60
+ * Keep the overlay's props in sync with the ref: re-applies its value through `setProps` on
61
+ * change (immediate + deep by default). One shot per wrapper: further calls warn and no-op.
62
+ * @param {import('vue').Ref<DeckGLOverlayOptions>} opts - Ref to the options bag applied to the overlay.
63
+ * @param {import('vue').WatchOptions} [options] - Overrides for the underlying Vue watcher.
64
+ * @returns {void}
65
+ */
66
+ watchOptions(opts: import('vue').Ref<DeckGLOverlayOptions>, options?: import('vue').WatchOptions): void;
67
+ /**
68
+ * Keep the overlay's `layers` prop in sync with the ref (immediate, NOT deep: layers are
69
+ * shallow-compared — swap array/layer identity to update). One shot per wrapper: further calls
70
+ * warn and no-op.
71
+ * @param {import('vue').Ref<import('@deck.gl/core').LayersList>} layers - Ref to the deck.gl layers array.
72
+ * @param {import('vue').WatchOptions} [options] - Overrides for the underlying Vue watcher.
73
+ * @returns {void}
74
+ */
75
+ watchLayers(layers: import('vue').Ref<import('@deck.gl/core').LayersList>, options?: import('vue').WatchOptions): void;
76
+ }
77
+ /** Build the provider's DeckGLOverlay component, bound to its injected map key (#174) — it must
78
+ * nest inside that provider's Map. Props: `options` ({@link DeckGLOverlayOptions}, watched deep)
79
+ * and `layers` (deck.gl layers, shallow-compared). Emits `loaded` with the {@link DeckGLOverlay}
80
+ * wrapper, and `error` (#194). Renders nothing itself.
81
+ * @param {string} mapInjectKey - The provide/inject key of the provider's map ref.
82
+ * @returns {import('vue').Component} The overlay component definition.
83
+ */
84
+ export declare const makeDeckGLOverlayComponent: (mapInjectKey: string) => import('vue').Component;
@@ -0,0 +1,321 @@
1
+ import { DeckGLOverlay } from './DeckGLOverlay.js';
2
+ declare class GoogleMapsDeckGLOverlay extends DeckGLOverlay {
3
+ /** setMap(null) only detaches: finalize() is deck.gl's full GL-resource release (#156).
4
+ * @returns {void}
5
+ */
6
+ _detach(): void;
7
+ }
8
+ /**
9
+ * 2D map wrapper, resolved by createMap and emitted by the Map component's `loaded` event. Its
10
+ * public surface is ONLY setDeckGLOverlay() and the raw `.map` — the Google 2D map has no
11
+ * watchOptions/watchLayers (imperative updates go through Google's own setters on `.map`).
12
+ */
13
+ declare class GoogleMapsMap {
14
+ /** @type {object|null} The raw google.maps.Map (runtime-loaded API — untyped here). */
15
+ map: object | null;
16
+ /** @type {import('vue').WatchStopHandle[]} Stopped by createMap's unmount (#148/#165). */
17
+ unwatchFn: import('vue').WatchStopHandle[];
18
+ /** @type {GoogleMapsDeckGLOverlay[]} Overlays attached via setDeckGLOverlay. */
19
+ overlays: GoogleMapsDeckGLOverlay[];
20
+ constructor();
21
+ /** Create a deck.gl GoogleMapsOverlay (lazy-imported) and attach it to the map.
22
+ * @param {import('@deck.gl/google-maps').GoogleMapsOverlayProps} [options] - GoogleMapsOverlay constructor props (deck props plus `interleaved`).
23
+ * @returns {Promise<GoogleMapsDeckGLOverlay>} The overlay wrapper: watchOptions/watchLayers/destroy.
24
+ */
25
+ setDeckGLOverlay(options?: import('@deck.gl/google-maps').GoogleMapsOverlayProps): Promise<GoogleMapsDeckGLOverlay>;
26
+ }
27
+ export type GoogleMapsMap3DLayer = {
28
+ /**
29
+ * - Unique layer id: written to the element's `name` attribute and used by the by-id diff.
30
+ */
31
+ id: string;
32
+ /**
33
+ * - The layer's DOM element (a gmp-* Maps 3D element), inserted into the <gmp-map-3d> at its array position (array order = z-order).
34
+ */
35
+ element: Element;
36
+ };
37
+ /**
38
+ * A Map3D layer entry (the Map3D component's `layers` items / watchLayers input): a pre-built
39
+ * layer element keyed for the by-id diff (#195).
40
+ * @typedef {object} GoogleMapsMap3DLayer
41
+ * @property {string} id - Unique layer id: written to the element's `name` attribute and used by the by-id diff.
42
+ * @property {Element} element - The layer's DOM element (a gmp-* Maps 3D element), inserted into the <gmp-map-3d> at its array position (array order = z-order).
43
+ */
44
+ /**
45
+ * 3D map wrapper, resolved by createMap3D and emitted by the Map3D component's `loaded` event,
46
+ * around the runtime-loaded <gmp-map-3d> Map3DElement.
47
+ */
48
+ declare class GoogleMapsMap3D {
49
+ /** @type {HTMLElement|null} The <gmp-map-3d> Map3DElement — a DOM element whose Maps-specific API is runtime-loaded and untyped here. */
50
+ map: HTMLElement | null;
51
+ watching: {
52
+ options: boolean;
53
+ layers: boolean;
54
+ };
55
+ /** @type {import('vue').WatchStopHandle[]} Stopped by createMap3D's unmount (#148/#165). */
56
+ unwatchFn: import('vue').WatchStopHandle[];
57
+ constructor();
58
+ /** Collect the element's Web IDL attribute names: enumerable ACCESSOR descriptors on its prototype.
59
+ * @param {object} obj - The element (or nested element state) to inspect.
60
+ * @returns {string[]} The accessor property names.
61
+ */
62
+ _getSetters(obj: object): string[];
63
+ /** Snapshot the element's Web IDL attributes into a plain options object.
64
+ * @param {object} obj - The element (or nested element state) to snapshot.
65
+ * @param {WeakSet<object>} [seen] - Guards accessor cycles across the recursion.
66
+ * @returns {Record<string, any>} Attribute name → current value (nested element state recursed into plain objects).
67
+ */
68
+ _getOptions(obj: object, seen?: WeakSet<object>): Record<string, any>;
69
+ /** Assign a bag of Map3DElement attributes — the imperative sibling of watchOptions.
70
+ * @param {Record<string, any>} [props] - Attribute name → value, assigned onto the element (runtime-loaded API — untyped here).
71
+ * @returns {void}
72
+ */
73
+ setProps(props?: Record<string, any>): void;
74
+ /** Snapshot the map's current Web IDL attributes — the imperative sibling of getProps-less reads.
75
+ * @returns {Record<string, any>} Attribute name → current value.
76
+ */
77
+ getProps(): Record<string, any>;
78
+ /** Get a layer element added under the <gmp-map-3d> by its id (the element's `name` attribute).
79
+ * @param {string} id - The layer id.
80
+ * @returns {Element|null} The layer's element, or null when absent.
81
+ */
82
+ getLayer(id: string): Element | null;
83
+ /** Keep the Map3DElement in sync with a reactive options object (per-key JSON diff). One
84
+ * watcher per wrapper: further calls warn and return.
85
+ * @param {import('vue').Ref<Record<string, any>>} opts - Reactive options bag; every changed key is assigned onto the element.
86
+ * @param {import('vue').WatchOptions} [options] - Extra vue watch options, merged over `{ immediate: true, deep: true }`.
87
+ * @returns {void}
88
+ */
89
+ watchOptions(opts: import('vue').Ref<Record<string, any>>, options?: import('vue').WatchOptions): void;
90
+ /** Keep the <gmp-map-3d> children in sync with a reactive layers array: by-id diff (#195),
91
+ * array order = z-order via insertBefore. One watcher per wrapper: further calls warn and return.
92
+ * @param {import('vue').Ref<GoogleMapsMap3DLayer[]>} layers - Reactive layers; shallow-compared — swap array/layer identity (shallowRef) to update.
93
+ * @param {import('vue').WatchOptions} [options] - Extra vue watch options, merged over `{ immediate: true }`.
94
+ * @returns {void}
95
+ */
96
+ watchLayers(layers: import('vue').Ref<GoogleMapsMap3DLayer[]>, options?: import('vue').WatchOptions): void;
97
+ }
98
+ export type GoogleMapsMountHook = {
99
+ /**
100
+ * - Defers map creation: called at component mount with `loadMap` instead of an immediate load — the map exists only once you invoke it.
101
+ */
102
+ onMounted?: (loadMap: () => void) => void;
103
+ };
104
+ export type GoogleMapsMapOptions = GoogleMapsMountHook & Record<string, any>;
105
+ export type GoogleMapsWatcherOptions = {
106
+ /**
107
+ * - Vue watch options for the internal options watcher.
108
+ */
109
+ watchOptionsOptions?: import('vue').WatchOptions;
110
+ /**
111
+ * - Vue watch options for the internal layers watcher.
112
+ */
113
+ watchLayersOptions?: import('vue').WatchOptions;
114
+ };
115
+ export type GoogleMapsMap3DOptions = GoogleMapsMountHook & GoogleMapsWatcherOptions & Record<string, any>;
116
+ export type GoogleMapsMapProps = {
117
+ /**
118
+ * - Passed once to google.maps.Map — NOT reactive (an update logs an error; drive the loaded wrapper's `.map` through Google's own setters instead).
119
+ */
120
+ options?: GoogleMapsMapOptions;
121
+ };
122
+ export type GoogleMapsMap3DProps = {
123
+ /**
124
+ * - Watched (per-key JSON diff) and assigned onto the Map3DElement.
125
+ */
126
+ options?: GoogleMapsMap3DOptions;
127
+ /**
128
+ * - Watched with a by-id diff (#195); shallow-compared — swap array/layer identity (shallowRef) to update.
129
+ */
130
+ layers?: GoogleMapsMap3DLayer[];
131
+ };
132
+ export type GoogleMapsDeckGLOverlayProps = {
133
+ /**
134
+ * - GoogleMapsOverlay props, watched deep → overlay.setProps().
135
+ */
136
+ options?: import('@deck.gl/google-maps').GoogleMapsOverlayProps & GoogleMapsWatcherOptions;
137
+ /**
138
+ * - deck.gl layers, watched → setProps({ layers }); shallow-compared — swap identity to update.
139
+ */
140
+ layers?: import('@deck.gl/core').LayersList;
141
+ };
142
+ export type GoogleMapsDeckGL3DTileLayerProps = {
143
+ /**
144
+ * - Tile3DLayer prop overrides (over the Google 3D Tiles defaults) — NOT reactive: replace the component to change them.
145
+ */
146
+ options?: Partial<import('@deck.gl/geo-layers').Tile3DLayerProps>;
147
+ };
148
+ export type GoogleMapsMapComponent = import('vue').DefineSetupFnComponent<GoogleMapsMapProps, {
149
+ loaded: (map: GoogleMapsMap) => void;
150
+ error: (error: Error) => void;
151
+ }>;
152
+ export type GoogleMapsMap3DComponent = import('vue').DefineSetupFnComponent<GoogleMapsMap3DProps, {
153
+ loaded: (map: GoogleMapsMap3D) => void;
154
+ error: (error: Error) => void;
155
+ }>;
156
+ export type GoogleMapsDeckGLOverlayComponent = import('vue').DefineSetupFnComponent<GoogleMapsDeckGLOverlayProps, {
157
+ loaded: (overlay: GoogleMapsDeckGLOverlay) => void;
158
+ error: (error: Error) => void;
159
+ }>;
160
+ export type GoogleMapsDeckGL3DTileLayerComponent = import('vue').DefineSetupFnComponent<GoogleMapsDeckGL3DTileLayerProps, {
161
+ error: (error: Error) => void;
162
+ }, import('vue').SlotsType<{
163
+ appendMap?: {
164
+ credits: string;
165
+ };
166
+ }>>;
167
+ /**
168
+ * Module-side mount hook recognised by createMap/createMap3D (every other option key is forwarded
169
+ * to Google untouched).
170
+ * @typedef {object} GoogleMapsMountHook
171
+ * @property {(loadMap: () => void) => void} [onMounted] - Defers map creation: called at component mount with `loadMap` instead of an immediate load — the map exists only once you invoke it.
172
+ */
173
+ /**
174
+ * Options for createMap / the 2D Map component's `options` prop: google.maps.MapOptions
175
+ * (runtime-loaded API — untyped here: center/zoom/mapId/…) plus {@link GoogleMapsMountHook}.
176
+ * @typedef {GoogleMapsMountHook & Record<string, any>} GoogleMapsMapOptions
177
+ */
178
+ /**
179
+ * Per-watcher tuning read by the Map3D and DeckGLOverlay components from their `options` prop.
180
+ * @typedef {object} GoogleMapsWatcherOptions
181
+ * @property {import('vue').WatchOptions} [watchOptionsOptions] - Vue watch options for the internal options watcher.
182
+ * @property {import('vue').WatchOptions} [watchLayersOptions] - Vue watch options for the internal layers watcher.
183
+ */
184
+ /**
185
+ * Options for createMap3D / the Map3D component's `options` prop: Map3DElement attributes
186
+ * (runtime-loaded API — untyped here: center/range/tilt/…) plus the module-side keys.
187
+ * @typedef {GoogleMapsMountHook & GoogleMapsWatcherOptions & Record<string, any>} GoogleMapsMap3DOptions
188
+ */
189
+ /**
190
+ * Props of the 2D Map component. NO `layers` prop: deck.gl layers on a Google 2D map go through
191
+ * DeckGLOverlay only.
192
+ * @typedef {object} GoogleMapsMapProps
193
+ * @property {GoogleMapsMapOptions} [options] - Passed once to google.maps.Map — NOT reactive (an update logs an error; drive the loaded wrapper's `.map` through Google's own setters instead).
194
+ */
195
+ /**
196
+ * Props of the Map3D component.
197
+ * @typedef {object} GoogleMapsMap3DProps
198
+ * @property {GoogleMapsMap3DOptions} [options] - Watched (per-key JSON diff) and assigned onto the Map3DElement.
199
+ * @property {GoogleMapsMap3DLayer[]} [layers] - Watched with a by-id diff (#195); shallow-compared — swap array/layer identity (shallowRef) to update.
200
+ */
201
+ /**
202
+ * Props of the DeckGLOverlay component (nests inside the 2D Map).
203
+ * @typedef {object} GoogleMapsDeckGLOverlayProps
204
+ * @property {import('@deck.gl/google-maps').GoogleMapsOverlayProps & GoogleMapsWatcherOptions} [options] - GoogleMapsOverlay props, watched deep → overlay.setProps().
205
+ * @property {import('@deck.gl/core').LayersList} [layers] - deck.gl layers, watched → setProps({ layers }); shallow-compared — swap identity to update.
206
+ */
207
+ /**
208
+ * Props of the DeckGL3DTileLayer component (nests inside the deckGL provider's Map).
209
+ * @typedef {object} GoogleMapsDeckGL3DTileLayerProps
210
+ * @property {Partial<import('@deck.gl/geo-layers').Tile3DLayerProps>} [options] - Tile3DLayer prop overrides (over the Google 3D Tiles defaults) — NOT reactive: replace the component to change them.
211
+ */
212
+ /**
213
+ * The 2D Map component type: `loaded` emits the {@link GoogleMapsMap} wrapper, `error` every load failure (#148/#378).
214
+ * @typedef {import('vue').DefineSetupFnComponent<GoogleMapsMapProps, { loaded: (map: GoogleMapsMap) => void, error: (error: Error) => void }>} GoogleMapsMapComponent
215
+ */
216
+ /**
217
+ * The Map3D component type: `loaded` emits the {@link GoogleMapsMap3D} wrapper, `error` every load failure (#148/#378).
218
+ * @typedef {import('vue').DefineSetupFnComponent<GoogleMapsMap3DProps, { loaded: (map: GoogleMapsMap3D) => void, error: (error: Error) => void }>} GoogleMapsMap3DComponent
219
+ */
220
+ /**
221
+ * The DeckGLOverlay component type: `loaded` emits the {@link GoogleMapsDeckGLOverlay} wrapper, `error` every load failure (#194).
222
+ * @typedef {import('vue').DefineSetupFnComponent<GoogleMapsDeckGLOverlayProps, { loaded: (overlay: GoogleMapsDeckGLOverlay) => void, error: (error: Error) => void }>} GoogleMapsDeckGLOverlayComponent
223
+ */
224
+ /**
225
+ * The DeckGL3DTileLayer component type: `error` on load failure (#194); the #appendMap slot
226
+ * receives `{ credits }` — Google's 3D Tiles attribution, which must stay visible.
227
+ * @typedef {import('vue').DefineSetupFnComponent<GoogleMapsDeckGL3DTileLayerProps, { error: (error: Error) => void }, import('vue').SlotsType<{ appendMap?: { credits: string } }>>} GoogleMapsDeckGL3DTileLayerComponent
228
+ */
229
+ /**
230
+ * Google Maps provider: one instance per `maps` config entry with `type: 'google'`/`'google-maps'`,
231
+ * exposed as `yAppKit.maps.<key>` — Vue components (Map, Map3D, DeckGLOverlay, DeckGL3DTileLayer)
232
+ * plus the imperative SDK (getSDK, createMap, createMap3D, createDeckGL3DTileLayer).
233
+ */
234
+ export default class GoogleMaps {
235
+ apiKey: string;
236
+ libraries: string[];
237
+ version: string;
238
+ _mapsApiConfigured: boolean;
239
+ authFailed: boolean;
240
+ /** @type {Record<string, object>} Loaded google library namespaces by name (runtime-loaded API — untyped here), filled by getSDK. */
241
+ sdk: Record<string, object>;
242
+ deckgl: {
243
+ Tile3DLayer: typeof import("@deck.gl/geo-layers").Tile3DLayer;
244
+ } | null;
245
+ /** @type {GoogleMapsMapComponent|null} 2D Map memo. */
246
+ _MapComponent: GoogleMapsMapComponent | null;
247
+ /** @type {GoogleMapsMap3DComponent|null} Map3D memo. */
248
+ _Map3DComponent: GoogleMapsMap3DComponent | null;
249
+ /** @type {GoogleMapsDeckGLOverlayComponent|null} DeckGLOverlay memo. */
250
+ _DeckGLOverlayComponent: GoogleMapsDeckGLOverlayComponent | null;
251
+ /** @type {GoogleMapsDeckGL3DTileLayerComponent|null} DeckGL3DTileLayer memo. */
252
+ _DeckGL3DTileLayerComponent: GoogleMapsDeckGL3DTileLayerComponent | null;
253
+ /** @type {Promise<Record<string, object>>} The initial libraries preload: resolves with the `sdk` map, rejects like getSDK(). */
254
+ ready: Promise<Record<string, object>>;
255
+ /** Validates the config and starts the SDK preload (`this.ready`, #149).
256
+ * @param {import('../main.js').GoogleMapsConfig} mapConfig - The provider's `maps` config entry (apiKey/libraries/version; `type` is consumed by the module loader).
257
+ */
258
+ constructor(mapConfig: import('../main.js').GoogleMapsConfig);
259
+ /** The 2D Map component (memoized per provider instance, #139): `options` prop only — nest
260
+ * DeckGLOverlay inside for deck.gl layers; `@loaded` emits the {@link GoogleMapsMap} wrapper.
261
+ * @returns {GoogleMapsMapComponent} The memoized component definition.
262
+ */
263
+ get Map(): GoogleMapsMapComponent;
264
+ /** The Map3D component (memoized, #139): `options` + `layers` props, both watched; `@loaded`
265
+ * emits the {@link GoogleMapsMap3D} wrapper.
266
+ * @returns {GoogleMapsMap3DComponent} The memoized component definition.
267
+ */
268
+ get Map3D(): GoogleMapsMap3DComponent;
269
+ /** The DeckGLOverlay component (memoized, #139; shared wiring #174): nests inside the 2D Map;
270
+ * `options`/`layers` props, `@loaded` emits the {@link GoogleMapsDeckGLOverlay} wrapper.
271
+ * @returns {GoogleMapsDeckGLOverlayComponent} The memoized component definition.
272
+ */
273
+ get DeckGLOverlay(): GoogleMapsDeckGLOverlayComponent;
274
+ /** The DeckGL3DTileLayer component (memoized, #139): nests inside the deckGL provider's Map and
275
+ * prepends the Google 3D Tiles layer; its #appendMap slot receives `{ credits }` (attribution
276
+ * that must stay visible).
277
+ * @returns {GoogleMapsDeckGL3DTileLayerComponent} The memoized component definition.
278
+ */
279
+ get DeckGL3DTileLayer(): GoogleMapsDeckGL3DTileLayerComponent;
280
+ /** Configure the js-api-loader once (page-level, #188) and import every wanted library into
281
+ * `this.sdk` (already-loaded ones are reused).
282
+ * @param {object} [options] - Load options.
283
+ * @param {string[]} [options.libraries] - Extra libraries to load on top of the config's.
284
+ * @returns {Promise<void>} Resolves once every wanted library is in `this.sdk`.
285
+ */
286
+ loadGoogleMapsSDK({ libraries }?: {
287
+ libraries?: string[];
288
+ }): Promise<void>;
289
+ getSDK(options: string): Promise<object>;
290
+ getSDK(options?: {
291
+ libraries?: string[];
292
+ }): Promise<Record<string, object>>;
293
+ /** Create a google.maps.Map into `elemRef` and resolve with its wrapper. Must run during a
294
+ * component's setup(): it registers onMounted/onUnmounted (teardown, #148/#156).
295
+ * @param {import('vue').Ref<HTMLElement|null>} elemRef - Template ref of the map's container element.
296
+ * @param {GoogleMapsMapOptions} [options] - google.maps.MapOptions plus the module's mount hook.
297
+ * @returns {Promise<GoogleMapsMap>} The 2D wrapper (setDeckGLOverlay/.map); rejects on unmount-before-load (error.code 'MAP_UNMOUNTED'), SDK failure, or page-level auth failure (#378).
298
+ */
299
+ createMap(elemRef: import('vue').Ref<HTMLElement | null>, options?: GoogleMapsMapOptions): Promise<GoogleMapsMap>;
300
+ /** Create a <gmp-map-3d> Map3DElement into `elemRef` and resolve with its wrapper. Must run
301
+ * during a component's setup(): it registers onMounted/onUnmounted (teardown, #148/#156).
302
+ * Requires the 'maps3d' library — `version: 'alpha'` plus a pre-authorized key.
303
+ * @param {import('vue').Ref<HTMLElement|null>} elemRef - Template ref of the map's container element.
304
+ * @param {GoogleMapsMap3DOptions} [options] - Map3DElement attributes plus the module-side keys.
305
+ * @returns {Promise<GoogleMapsMap3D>} The 3D wrapper (watchOptions/watchLayers/setProps/…); rejects on unmount-before-load (error.code 'MAP_UNMOUNTED'), SDK failure, or page-level auth failure (#378).
306
+ */
307
+ createMap3D(elemRef: import('vue').Ref<HTMLElement | null>, options?: GoogleMapsMap3DOptions): Promise<GoogleMapsMap3D>;
308
+ /** Lazy-import Tile3DLayer into `this.deckgl`.
309
+ * @returns {Promise<void>} Resolves once Tile3DLayer is available.
310
+ */
311
+ loadDeckGL(): Promise<void>;
312
+ /** Build a Tile3DLayer preconfigured for Google's photorealistic 3D Tiles (keyed with this
313
+ * provider's apiKey), wiring the tileset copyrights into `credits` — Google's terms require
314
+ * showing them (the DeckGL3DTileLayer component's #appendMap slot).
315
+ * @param {import('vue').Ref<string>} credits - Written on every tileset traversal with the '; '-joined copyrights (#328).
316
+ * @param {Partial<import('@deck.gl/geo-layers').Tile3DLayerProps>} [options] - Tile3DLayer prop overrides; a consumer `onTilesetLoad` is composed after the credits wiring, not clobbering it (#391).
317
+ * @returns {Promise<import('@deck.gl/geo-layers').Tile3DLayer>} The layer, for the deckGL provider Map's `layers`.
318
+ */
319
+ createDeckGL3DTileLayer(credits: import('vue').Ref<string>, options?: Partial<import('@deck.gl/geo-layers').Tile3DLayerProps>): Promise<import('@deck.gl/geo-layers').Tile3DLayer>;
320
+ }
321
+ export {};