@mappedin/react-native-sdk 6.0.0-beta.1 → 6.0.0-rc.5
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/THIRD_PARTY_LICENSES.txt +13487 -0
- package/lib/controls/event-control.d.ts +28 -11
- package/lib/controls/event-control.d.ts.map +1 -1
- package/lib/controls/map-view-control.d.ts +16 -118
- package/lib/controls/map-view-control.d.ts.map +1 -1
- package/lib/hooks/use-map-view-event.d.ts +6 -6
- package/lib/hooks/use-map-view-event.d.ts.map +1 -1
- package/lib/index.d.ts +5 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +16958 -16539
- package/lib/index.js.map +3 -3
- package/lib/map-view.d.ts.map +1 -1
- package/package.json +6 -27
|
@@ -19,6 +19,11 @@ import type { TEvents } from '@mappedin/mappedin-js';
|
|
|
19
19
|
* - When the WebView event fires, React Native receives it via the bridge
|
|
20
20
|
* - React Native then fires **all registered callbacks** for that event type
|
|
21
21
|
*
|
|
22
|
+
* ### 3. Extension Event Support
|
|
23
|
+
* - The system also supports extension events with the pattern `extensionname:eventname`
|
|
24
|
+
* - Extension events are handled the same way as regular events but with prefixed keys
|
|
25
|
+
* - Examples: `'dynamic-focus:focus'`, `'hover-tooltip:show'`
|
|
26
|
+
*
|
|
22
27
|
* ## Event Flow
|
|
23
28
|
*
|
|
24
29
|
* ```
|
|
@@ -47,10 +52,23 @@ import type { TEvents } from '@mappedin/mappedin-js';
|
|
|
47
52
|
* ```
|
|
48
53
|
* @internal This module is used internally by the SDK
|
|
49
54
|
*/
|
|
50
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Supported event types - includes regular map events and extension events
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export type SupportedEvents = keyof TEvents | `${string}:${string}`;
|
|
60
|
+
/**
|
|
61
|
+
* Extract payload type for regular events
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
export type TEventPayload<EventName extends keyof TEvents> = TEvents[EventName] extends {
|
|
51
65
|
data: null;
|
|
52
66
|
} ? TEvents[EventName]['data'] : TEvents[EventName];
|
|
53
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Unified event callback type that handles both regular events and extension events
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
export type EventCallback<T extends SupportedEvents> = T extends keyof TEvents ? (payload: TEventPayload<T>) => void : (payload: any) => void;
|
|
54
72
|
/**
|
|
55
73
|
* Creates an event control system for managing event callbacks.
|
|
56
74
|
* This is used internally to manage event subscriptions and callbacks.
|
|
@@ -59,25 +77,25 @@ type EventCallback<T extends keyof TEvents> = (payload: TEventPayload<T>) => voi
|
|
|
59
77
|
*/
|
|
60
78
|
export declare function createEventControl(): {
|
|
61
79
|
/**
|
|
62
|
-
* Register a callback for a specific event type
|
|
80
|
+
* Register a callback for a specific event type (regular or extension event)
|
|
63
81
|
* @internal
|
|
64
82
|
*/
|
|
65
|
-
registerEventCallback<T extends
|
|
83
|
+
registerEventCallback<T extends SupportedEvents>(event: T, callback: EventCallback<T>): void;
|
|
66
84
|
/**
|
|
67
|
-
* Unregister a callback for a specific event type
|
|
85
|
+
* Unregister a callback for a specific event type (regular or extension event)
|
|
68
86
|
* @internal
|
|
69
87
|
*/
|
|
70
|
-
unregisterEventCallback<T extends
|
|
88
|
+
unregisterEventCallback<T extends SupportedEvents>(event: T, callback: EventCallback<T>): void;
|
|
71
89
|
/**
|
|
72
|
-
* Check if there are any callbacks registered for a specific event type
|
|
90
|
+
* Check if there are any callbacks registered for a specific event type (regular or extension event)
|
|
73
91
|
* @internal
|
|
74
92
|
*/
|
|
75
|
-
hasEventCallbacks<T extends
|
|
93
|
+
hasEventCallbacks<T extends SupportedEvents>(event: T): boolean;
|
|
76
94
|
/**
|
|
77
|
-
* Trigger all callbacks for a specific event with the given payload
|
|
95
|
+
* Trigger all callbacks for a specific event with the given payload (regular or extension event)
|
|
78
96
|
* @internal
|
|
79
97
|
*/
|
|
80
|
-
handleEvent<T extends
|
|
98
|
+
handleEvent<T extends SupportedEvents>(event: T, payload: T extends keyof TEvents ? TEventPayload<T> : any): void;
|
|
81
99
|
/**
|
|
82
100
|
* Destroy all event callbacks
|
|
83
101
|
* @internal
|
|
@@ -85,5 +103,4 @@ export declare function createEventControl(): {
|
|
|
85
103
|
destroy(): void;
|
|
86
104
|
};
|
|
87
105
|
export type EventControl = ReturnType<typeof createEventControl>;
|
|
88
|
-
export {};
|
|
89
106
|
//# sourceMappingURL=event-control.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-control.d.ts","sourceRoot":"","sources":["../../src/controls/event-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD
|
|
1
|
+
{"version":3,"file":"event-control.d.ts","sourceRoot":"","sources":["../../src/controls/event-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAEpE;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,SAAS,SAAS,MAAM,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC,SAAS;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACnG,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAC1B,OAAO,CAAC,SAAS,CAAC,CAAC;AAEtB;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,SAAS,MAAM,OAAO,GAC3E,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,GACnC,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;AAE1B;;;;;GAKG;AACH,wBAAgB,kBAAkB;IAKhC;;;OAGG;0BACmB,CAAC,SAAS,eAAe,SAAS,CAAC,YAAY,aAAa,CAAC,CAAC,CAAC;IAYrF;;;OAGG;4BACqB,CAAC,SAAS,eAAe,SAAS,CAAC,YAAY,aAAa,CAAC,CAAC,CAAC;IAYvF;;;OAGG;sBACe,CAAC,SAAS,eAAe,SAAS,CAAC,GAAG,OAAO;IAO/D;;;OAGG;gBACS,CAAC,SAAS,eAAe,SAAS,CAAC,WAAW,CAAC,SAAS,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,GAAG;IAgB1G;;;OAGG;;EAKJ;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MapView,
|
|
1
|
+
import type { MapView, Directions, TNavigationOptions, TAddMarkerOptions, TStateChangedInternalPayload, Image3D, Shapes, Models, Markers, Labels, Camera, Text3D, Style, Outdoor, Paths } from '@mappedin/mappedin-js';
|
|
2
2
|
import type { UseBridgeHook } from '../hooks/use-bridge.js';
|
|
3
3
|
import type { Mappedin } from '../types.js';
|
|
4
4
|
import type { EventControl } from './event-control.js';
|
|
@@ -95,60 +95,6 @@ export type ExtendedNavigationOptions = Omit<TNavigationOptions, 'createMarkers'
|
|
|
95
95
|
export type Promisify<T> = {
|
|
96
96
|
[K in keyof T]: T[K] extends (...args: infer Args) => infer Return ? Return extends Promise<any> ? T[K] : (...args: Args) => Promise<Return> : T[K] extends object ? Promisify<T[K]> : T[K];
|
|
97
97
|
};
|
|
98
|
-
/**
|
|
99
|
-
* Type definition for the promisified updateState method with function overloads preserved.
|
|
100
|
-
*
|
|
101
|
-
* This type specifically handles the complex overloaded signatures of updateState that the generic
|
|
102
|
-
* Promisify utility cannot properly preserve. It maintains full type safety for both entity objects
|
|
103
|
-
* and string IDs while ensuring all calls return Promises for bridge communication.
|
|
104
|
-
*
|
|
105
|
-
* @template T - The entity type being updated (Space, Text3D, etc.) or string ID
|
|
106
|
-
*
|
|
107
|
-
* @example Type-safe entity updates
|
|
108
|
-
* ```typescript
|
|
109
|
-
* // Space update with full type safety
|
|
110
|
-
* const space: Space = mapData.getByType('space')[0];
|
|
111
|
-
* await mapView.updateState(space, {
|
|
112
|
-
* color: '#ff0000', // ✅ Valid Space property
|
|
113
|
-
* opacity: 0.8, // ✅ Valid Space property
|
|
114
|
-
* invalidProp: 'value' // ❌ TypeScript error - not a Space property
|
|
115
|
-
* });
|
|
116
|
-
*
|
|
117
|
-
* // Text3D update with specific styling options
|
|
118
|
-
* const text3D: Text3D = await mapView.Text3D.label(space, 'Room 101');
|
|
119
|
-
* await mapView.updateState(text3D, {
|
|
120
|
-
* color: '#0066cc', // ✅ Valid Text3D property
|
|
121
|
-
* fontSize: 16, // ✅ Valid Text3D property
|
|
122
|
-
* fillOpacity: 0.9 // ✅ Valid Text3D property
|
|
123
|
-
* });
|
|
124
|
-
*
|
|
125
|
-
* // Marker update with positioning and visibility
|
|
126
|
-
* const marker: Marker = await mapView.Markers.add(coordinate, '<div>Pin</div>');
|
|
127
|
-
* await mapView.updateState(marker, {
|
|
128
|
-
* rank: 'always-visible' // ✅ Valid Marker property
|
|
129
|
-
* });
|
|
130
|
-
* ```
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* @example Error handling and validation
|
|
134
|
-
* ```typescript
|
|
135
|
-
* try {
|
|
136
|
-
* await mapView.updateState(space, { color: '#invalid-color' });
|
|
137
|
-
* } catch (error) {
|
|
138
|
-
* console.error('State update failed:', error);
|
|
139
|
-
* // Handle bridge communication errors
|
|
140
|
-
* }
|
|
141
|
-
* ```
|
|
142
|
-
*
|
|
143
|
-
* @remarks
|
|
144
|
-
* **Why this type exists:**
|
|
145
|
-
* - The generic `Promisify<T>` utility cannot preserve function overloads
|
|
146
|
-
* - TypeScript intersection types from overloads lose individual signature information
|
|
147
|
-
* - This explicit type maintains both overload signatures with proper type safety
|
|
148
|
-
* - Ensures consistent Promise return types for all bridge operations
|
|
149
|
-
*
|
|
150
|
-
*/
|
|
151
|
-
export type PromisifiedUpdateState = <T extends MapElementsWithState>(target: T, state: TUpdateState<T>) => Promise<void>;
|
|
152
98
|
/**
|
|
153
99
|
* Extended navigation with custom marker templates
|
|
154
100
|
*
|
|
@@ -210,81 +156,33 @@ type MapViewMethods = Omit<MapView, 'on' | 'off' | 'emit' | '__core' | 'then' |
|
|
|
210
156
|
*
|
|
211
157
|
* @interface
|
|
212
158
|
*/
|
|
213
|
-
export type MapViewControl = Omit<Promisify<MapViewMethods>, '
|
|
214
|
-
/**
|
|
215
|
-
* Promisified version of updateState that asynchronously updates visual properties of map entities.
|
|
216
|
-
*
|
|
217
|
-
* This method provides type-safe updates for various map entities with async bridge communication.
|
|
218
|
-
* All state changes are applied through the React Native bridge and return a Promise.
|
|
219
|
-
*
|
|
220
|
-
* @param target - The entity to update (Space, Text3D, Marker, Label, etc.) or its string ID
|
|
221
|
-
* @param state - The new state properties to apply to the entity
|
|
222
|
-
* @returns Promise that resolves when the update is complete
|
|
223
|
-
*
|
|
224
|
-
* @example
|
|
225
|
-
* ```typescript
|
|
226
|
-
* // Update a space's appearance
|
|
227
|
-
* const space = mapData.getByType('space')[0];
|
|
228
|
-
* await mapView.updateState(space, {
|
|
229
|
-
* color: '#ff0000',
|
|
230
|
-
* opacity: 0.8
|
|
231
|
-
* });
|
|
232
|
-
*
|
|
233
|
-
* // Update a 3D text label
|
|
234
|
-
* const text3D = await mapView.Text3D.label(space, 'Room 101');
|
|
235
|
-
* await mapView.updateState(text3D, {
|
|
236
|
-
* color: '#0066cc',
|
|
237
|
-
* fontSize: 16,
|
|
238
|
-
* fillOpacity: 0.9
|
|
239
|
-
* });
|
|
240
|
-
*
|
|
241
|
-
* // Update a marker's styling
|
|
242
|
-
* const marker = await mapView.Markers.add(coordinate, '<div>Custom Marker</div>');
|
|
243
|
-
* await mapView.updateState(marker, {
|
|
244
|
-
* rank: 'always-visible'
|
|
245
|
-
* });
|
|
246
|
-
*
|
|
247
|
-
* // Update using string ID
|
|
248
|
-
* await mapView.updateState('space-id-123', {
|
|
249
|
-
* color: '#00ff00',
|
|
250
|
-
* opacity: 0.5
|
|
251
|
-
* });
|
|
252
|
-
*
|
|
253
|
-
* @remarks
|
|
254
|
-
* Unlike the synchronous MapView.updateState, this method:
|
|
255
|
-
* - Returns a Promise that resolves when the bridge operation completes
|
|
256
|
-
* - Provides full TypeScript type safety for all supported entity types
|
|
257
|
-
* - Handles bridge communication errors gracefully
|
|
258
|
-
* - Supports both entity objects and string IDs as targets
|
|
259
|
-
*
|
|
260
|
-
* Supported entity types include: Space, Text3D, MapObject, Label, Marker, Shape,
|
|
261
|
-
* Door, Facade, Floor, Model, Path, PathSegment, and string IDs.
|
|
262
|
-
*/
|
|
263
|
-
updateState: PromisifiedUpdateState;
|
|
159
|
+
export type MapViewControl = Omit<Promisify<MapViewMethods>, 'Navigation' | 'Text3D' | 'BlueDot' | 'Camera' | 'Labels' | 'Markers' | 'Models' | 'Image3D' | 'Paths' | 'Shapes' | 'Style' | 'Outdoor'> & {
|
|
264
160
|
/** Extended navigation with custom marker templates */
|
|
265
161
|
Navigation: Navigation;
|
|
266
162
|
/** 3D text controls with async methods */
|
|
267
|
-
Text3D: Promisify<
|
|
268
|
-
/**
|
|
269
|
-
|
|
163
|
+
Text3D: Promisify<Text3D>;
|
|
164
|
+
/**
|
|
165
|
+
* @deprecated use `@mappedin/blue-dot` useBlueDot hooks instead
|
|
166
|
+
**/
|
|
167
|
+
BlueDot: Promisify<MapView['__BlueDot']>;
|
|
270
168
|
/** Camera controls with async methods */
|
|
271
|
-
Camera: Promisify<
|
|
169
|
+
Camera: Promisify<Camera>;
|
|
272
170
|
/** Label controls with async methods */
|
|
273
|
-
Labels: Promisify<
|
|
171
|
+
Labels: Promisify<Labels>;
|
|
274
172
|
/** Marker controls with async methods */
|
|
275
|
-
Markers: Promisify<
|
|
173
|
+
Markers: Promisify<Markers>;
|
|
276
174
|
/** Model controls with async methods */
|
|
277
|
-
Models: Promisify<
|
|
175
|
+
Models: Promisify<Models>;
|
|
278
176
|
/** Image controls with async methods */
|
|
279
|
-
|
|
177
|
+
Image3D: Promisify<Image3D>;
|
|
280
178
|
/** Path controls with async methods */
|
|
281
|
-
Paths: Promisify<
|
|
179
|
+
Paths: Promisify<Paths>;
|
|
282
180
|
/** Shape controls with async methods */
|
|
283
|
-
Shapes: Promisify<
|
|
181
|
+
Shapes: Promisify<Shapes>;
|
|
284
182
|
/** Style controls with async methods */
|
|
285
|
-
Style: Promisify<
|
|
183
|
+
Style: Promisify<Style>;
|
|
286
184
|
/** Outdoor controls with async methods */
|
|
287
|
-
Outdoor: Promisify<
|
|
185
|
+
Outdoor: Promisify<Outdoor>;
|
|
288
186
|
/** Subscribe to map events */
|
|
289
187
|
on: MapView['on'];
|
|
290
188
|
/** Unsubscribe from map events */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-view-control.d.ts","sourceRoot":"","sources":["../../src/controls/map-view-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,OAAO,
|
|
1
|
+
{"version":3,"file":"map-view-control.d.ts","sourceRoot":"","sources":["../../src/controls/map-view-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,OAAO,EAEP,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,4BAA4B,EAG5B,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,EACP,KAAK,EACL,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD;;;;;;;;;;;;;;;;;GAiBG;AACH,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AAE,SAAS,CAAC,KAAK,CAAC,CAAC;IACxB,0CAA0C;IAC1C,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAE5B,8BAA8B;IAC9B,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAElB,kCAAkC;IAClC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAEpB,yDAAyD;IACzD,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAe3E,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAsB,oBAAoB,CACzC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,EACnC,OAAO,EAAE,QAAQ,CAAC,OAAO,EACzB,YAAY,EAAE,YAAY,EAC1B,EAAE,iBAAsB,EAAE,GAAE;IAAE,iBAAiB,CAAC,EAAE,4BAA4B,CAAA;CAAO,GACnF,OAAO,CAAC,cAAc,CAAC,CA2fzB"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { TEvents } from '@mappedin/mappedin-js';
|
|
2
|
-
type TEventPayload<EventName extends keyof TEvents> = TEvents[EventName] extends {
|
|
3
|
-
data: null;
|
|
4
|
-
} ? TEvents[EventName]['data'] : TEvents[EventName];
|
|
5
2
|
/**
|
|
6
3
|
* Hook to subscribe to an event on the MapView in React Native.
|
|
7
4
|
*
|
|
8
5
|
* This hook uses the MapView's .on() and .off() methods to subscribe to events
|
|
9
6
|
* on the MapView instance running in the WebView.
|
|
10
7
|
*
|
|
11
|
-
*
|
|
8
|
+
* Supports both MapView events (e.g., 'click', 'hover')
|
|
9
|
+
*
|
|
10
|
+
* @param event - The event to listen for (regular or extension event).
|
|
12
11
|
* @param callback - The callback to call when the event is triggered.
|
|
13
12
|
*
|
|
14
13
|
* @category Hooks
|
|
@@ -22,6 +21,7 @@ type TEventPayload<EventName extends keyof TEvents> = TEvents[EventName] extends
|
|
|
22
21
|
* });
|
|
23
22
|
* ```
|
|
24
23
|
*/
|
|
25
|
-
export declare function useMapViewEvent<T extends keyof TEvents>(event: T, callback: (payload:
|
|
26
|
-
|
|
24
|
+
export declare function useMapViewEvent<T extends keyof TEvents>(event: T, callback: (payload: TEvents[T] extends {
|
|
25
|
+
data: null;
|
|
26
|
+
} ? TEvents[T]['data'] : TEvents[T]) => void): void;
|
|
27
27
|
//# sourceMappingURL=use-map-view-event.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-map-view-event.d.ts","sourceRoot":"","sources":["../../src/hooks/use-map-view-event.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,
|
|
1
|
+
{"version":3,"file":"use-map-view-event.d.ts","sourceRoot":"","sources":["../../src/hooks/use-map-view-event.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,OAAO,EACtD,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,QA0ChG"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module @mappedin/react-native-sdk
|
|
3
|
+
*/
|
|
1
4
|
export { MapView } from './map-view';
|
|
2
5
|
export type { MapViewProps } from './map-view';
|
|
3
6
|
export { useMap, MappedinContext } from './hooks/use-map';
|
|
4
|
-
export type { MapViewControl, Promisify
|
|
7
|
+
export type { MapViewControl, Promisify } from './controls/map-view-control';
|
|
5
8
|
export type { ExtensionRegistry } from './extension-registry';
|
|
6
9
|
export { useMapViewEvent } from './hooks/use-map-view-event';
|
|
7
10
|
export { useEventCallback } from './hooks/use-event-callback';
|
|
8
11
|
export type { UseEventCallbackOptions } from './hooks/use-event-callback';
|
|
12
|
+
export type { SupportedEvents, EventCallback, TEventPayload } from './controls/event-control';
|
|
9
13
|
export { Marker } from './components/marker';
|
|
10
14
|
export type { MarkerProps } from './components/marker';
|
|
11
15
|
export { Label } from './components/label';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7E,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,YAAY,EAAE,uBA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