@mappable-world/mappable-types 0.0.5 → 0.0.7
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/common/types/data-source-description.d.ts +29 -19
- package/common/types/geojson.d.ts +9 -9
- package/common/types/layer-description.d.ts +6 -8
- package/imperative/Entities.d.ts +0 -57
- package/imperative/MMap/index.d.ts +0 -13
- package/imperative/MMapControl/MMapControl.d.ts +0 -6
- package/imperative/MMapControl/MMapControlButton.d.ts +1 -0
- package/imperative/MMapCopyrights/index.d.ts +0 -1
- package/imperative/MMapDefaultFeaturesLayer/index.d.ts +0 -1
- package/imperative/MMapDefaultSchemeLayer/index.d.ts +0 -10
- package/imperative/MMapFeature/index.d.ts +0 -1
- package/imperative/MMapFeature/types.d.ts +5 -5
- package/imperative/MMapLayer/index.d.ts +0 -1
- package/imperative/MMapListener/index.d.ts +0 -2
- package/imperative/MMapMarker/index.d.ts +0 -24
- package/imperative/MMapReactContainer/index.d.ts +0 -5
- package/imperative/suggest.d.ts +8 -0
- package/imperative/utils/metrics.d.ts +0 -5
- package/import.d.ts +0 -13
- package/main.d.ts +0 -7
- package/modules/editors/MMapFeatureEditor/MMapFeatureEditor.d.ts +0 -1
- package/modules/utils/MMapCursor/index.d.ts +0 -1
- package/package.json +1 -1
- package/packages/clusterer/MMapClusterer/MMapClusterer.d.ts +0 -9
- package/packages/clusterer/MMapClusterer/helpers/throttle.d.ts +0 -8
- package/packages/clusterer/MMapClusterer/react/MMapClusterer.d.ts +3 -3
- package/packages/controls/MMapGeolocationControl/index.d.ts +0 -1
- package/packages/controls/MMapZoomControl/index.d.ts +0 -1
- package/packages/hint/MMapHint/index.d.ts +0 -2
- package/packages/markers/MMapDefaultMarker/index.d.ts +0 -11
- package/reactify/reactify.d.ts +6 -5
|
@@ -55,12 +55,12 @@ type ComposeTileUrlFunction = (x: number, y: number, z: number, scale: number, s
|
|
|
55
55
|
type FetchHotspotsFunction = (x: number, y: number, z: number, signal: AbortSignal) => Promise<Hotspot[]>;
|
|
56
56
|
interface RasterTileDataSourceDescription {
|
|
57
57
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
* Either template tile url:
|
|
59
|
+
* - {{x}} {{y}} {{z}} placeholders for tile coordinates
|
|
60
|
+
* - {{scale}} placeholders for pixel scale (e.g. retina is 2)
|
|
61
|
+
* Or function that returns final url.
|
|
62
|
+
* Or function that fetches tile manually.
|
|
63
|
+
*/
|
|
64
64
|
fetchTile: string | ComposeTileUrlFunction | FetchTileFunction;
|
|
65
65
|
/** Name of data provided by this data source. Should be referenced in layer. */
|
|
66
66
|
type: string;
|
|
@@ -68,25 +68,25 @@ interface RasterTileDataSourceDescription {
|
|
|
68
68
|
size?: number;
|
|
69
69
|
transparent?: boolean;
|
|
70
70
|
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
* Returns promise that is going to be resolved by hotspots for tile, or rejected with {name: 'AbortError'}.
|
|
72
|
+
* Hotspots are expected to be sorted from bottom to top (aka far to near).
|
|
73
|
+
*/
|
|
74
74
|
fetchHotspots?: FetchHotspotsFunction;
|
|
75
75
|
/**
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
* Defines maximum distance between tile and pointer, till which we keep alive unfinished requests
|
|
77
|
+
* for hotspots for that tile.
|
|
78
|
+
*/
|
|
79
79
|
hotspotAbortRadius?: number;
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
* Defines how far inside into tile hotspots from other tile can go.
|
|
82
|
+
* For example, tile may have a little part of POI from neightbour tile, but no hotspot for it in data.
|
|
83
|
+
*/
|
|
84
84
|
hotspotInset?: number;
|
|
85
85
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
* Defines how much pixels should be added to hotspot to increase its area.
|
|
87
|
+
* Moves each point of hotspot X pixels away from the center of the hotspots.
|
|
88
|
+
* NOTE: Currently works only on hotspots with Polygon geometry.
|
|
89
|
+
*/
|
|
90
90
|
hotspotPadding?: number;
|
|
91
91
|
}
|
|
92
92
|
interface HotspotsOptions {
|
|
@@ -97,25 +97,35 @@ type VectorTileSize = 'X1' | 'X4' | 'X16';
|
|
|
97
97
|
type VectorDataSourcePriority = 'low' | 'medium' | 'high';
|
|
98
98
|
type VectorObjectsCollisionPriority = 'low' | 'medium' | 'high' | 'ultra';
|
|
99
99
|
interface VectorTileDataSourceDescription {
|
|
100
|
+
/** Default is `'vmap2'` */
|
|
101
|
+
tileFormat?: 'vmap2' | 'vmap3';
|
|
100
102
|
tileUrl: string;
|
|
101
103
|
imageUrl?: string;
|
|
102
104
|
meshUrl?: string;
|
|
105
|
+
richModelUrl?: string;
|
|
103
106
|
glyphRangeUrl?: string;
|
|
104
107
|
indoorPlanUrl?: string;
|
|
108
|
+
styleUrl?: string;
|
|
109
|
+
fontListUrl?: string;
|
|
110
|
+
fontObjectUrl?: string;
|
|
105
111
|
tileRequestWithCredentials?: boolean;
|
|
106
112
|
imageRequestWithCredentials?: boolean;
|
|
107
113
|
meshRequestWithCredentials?: boolean;
|
|
108
114
|
glyphRequestWithCredentials?: boolean;
|
|
115
|
+
richModelRequestWithCredentials?: boolean;
|
|
109
116
|
tileRequestHeaders?: Record<string, string>;
|
|
110
117
|
iconRequestHeaders?: Record<string, string>;
|
|
111
118
|
glyphRequestHeaders?: Record<string, string>;
|
|
112
119
|
meshRequestHeaders?: Record<string, string>;
|
|
120
|
+
richModelRequestHeaders?: Record<string, string>;
|
|
113
121
|
priority: VectorDataSourcePriority;
|
|
114
122
|
collisionPriority?: VectorObjectsCollisionPriority;
|
|
115
123
|
requestTileSize?: VectorTileSize;
|
|
116
124
|
tileBeltSize?: number;
|
|
117
125
|
lowPrecisionBeltTiles?: boolean;
|
|
118
126
|
tileCacheSize?: number;
|
|
127
|
+
richModelCacheSize?: number;
|
|
128
|
+
richModelEnabled?: boolean;
|
|
119
129
|
allObjectsInteractive?: boolean;
|
|
120
130
|
/** Forces tiles to wait for the icons, disables hiding icons by zoom diff */
|
|
121
131
|
iconsOnlyTiles?: boolean;
|
|
@@ -2,12 +2,12 @@ import type { LngLat } from "./lng-lat";
|
|
|
2
2
|
interface GenericPolygonGeometry<TCoordinates> {
|
|
3
3
|
type: 'Polygon';
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
* Polygon's rings.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Inner rings may extend beyond outer ring.
|
|
9
|
+
* GeoJSON doesn't allow this, but there's a lot of data like this in this JS API.
|
|
10
|
+
*/
|
|
11
11
|
coordinates: TCoordinates[][];
|
|
12
12
|
}
|
|
13
13
|
interface GenericMultiPolygonGeometry<TCoordinates> {
|
|
@@ -40,9 +40,9 @@ interface GenericPointFeature<TCoordinates> extends GenericFeature<TCoordinates>
|
|
|
40
40
|
interface GenericMappableFeatureCollection<TCoordinates> {
|
|
41
41
|
type: 'FeatureCollection';
|
|
42
42
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
* Could be collection of features or collection of feature collections.
|
|
44
|
+
* This is not defined by GEO JSON spec, but there is such cases in our data.
|
|
45
|
+
*/
|
|
46
46
|
features: (GenericFeature<TCoordinates> | GenericMappableFeatureCollection<TCoordinates>)[];
|
|
47
47
|
properties?: Record<string, unknown>;
|
|
48
48
|
}
|
|
@@ -7,21 +7,19 @@ interface VectorObjectsInteractiveArea {
|
|
|
7
7
|
type RasterLayerOptions = Record<string, unknown> & {
|
|
8
8
|
opacity?: number;
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
* Show all tiles simultaneously on a first display
|
|
11
|
+
* However if map state changed original logic is applied
|
|
12
|
+
*/
|
|
13
13
|
awaitAllTilesOnFirstDisplay?: boolean;
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
* Controls animation duration of the revealing newly downloaded tiles
|
|
16
|
+
* Values less than or equal to zero turn off animation
|
|
17
|
+
*/
|
|
18
18
|
tileRevealDuration?: number;
|
|
19
19
|
};
|
|
20
20
|
type VectorLayerOptions = Record<string, unknown> & {
|
|
21
21
|
modelsAppearingAnimation?: {
|
|
22
|
-
transitionZoom: number;
|
|
23
22
|
duration: number;
|
|
24
|
-
limitByZoom: number;
|
|
25
23
|
};
|
|
26
24
|
iconsInteractiveArea?: VectorObjectsInteractiveArea;
|
|
27
25
|
transformLayers?: Record<string, {
|
package/imperative/Entities.d.ts
CHANGED
|
@@ -9,83 +9,31 @@ declare class ContextProvider<T> {
|
|
|
9
9
|
consume(): T | undefined;
|
|
10
10
|
provide(nextContext: T): void;
|
|
11
11
|
}
|
|
12
|
-
/** @internal */
|
|
13
|
-
export interface __ImplEntity {
|
|
14
|
-
__implUpdateProps(props: unknown): void;
|
|
15
|
-
__implAttach(): void;
|
|
16
|
-
__implDetach(): void;
|
|
17
|
-
__implAttachTo?(parent: GenericComplexEntity<unknown> | null): void;
|
|
18
|
-
readonly children?: ReadonlyArray<GenericEntity<unknown>>;
|
|
19
|
-
readonly __implChildren?: ReadonlyArray<GenericEntity<unknown>>;
|
|
20
|
-
readonly __implParent: GenericComplexEntity<unknown> | null;
|
|
21
|
-
__implNotifyDomContextOnDescendantMoved: boolean;
|
|
22
|
-
addChild(child: GenericEntity<unknown>, before?: GenericEntity<unknown>): this;
|
|
23
|
-
removeChild(child: GenericEntity<unknown>): this;
|
|
24
|
-
_consumeContext<T>(consumer: Context<T>): T | undefined;
|
|
25
|
-
_provideContext<T>(consumer: Context<T>, ctx: T): void;
|
|
26
|
-
}
|
|
27
|
-
/** @internal */
|
|
28
|
-
export declare const __implHooks: {
|
|
29
|
-
DomContextOnDescendantMoved?: (entity: GenericComplexEntity<unknown>, descendant: GenericEntity<unknown>) => void;
|
|
30
|
-
};
|
|
31
12
|
type WithDefaults<Props, DefaultProps extends Partial<Props>> = Props & {
|
|
32
13
|
[K in keyof DefaultProps]: K extends keyof Props ? NonNullable<Props[K]> : never;
|
|
33
14
|
};
|
|
34
|
-
/** @internal */
|
|
35
15
|
declare abstract class GenericEntity<Props, DefaultProps extends {} = {}, Root extends GenericRootEntity<unknown> = GenericRootEntity<unknown>> {
|
|
36
16
|
protected _props: WithDefaults<Props, DefaultProps>;
|
|
37
|
-
private __implRoot;
|
|
38
|
-
private __implParent;
|
|
39
|
-
protected __implProxyParent: GenericComplexEntity<unknown> | null;
|
|
40
|
-
protected __implNotifyDomContextOnDescendantMoved: boolean;
|
|
41
|
-
private __implCtxMap?;
|
|
42
|
-
private __implCtxWatchers?;
|
|
43
17
|
/**
|
|
44
|
-
* @internal
|
|
45
18
|
* @param {Props} props
|
|
46
19
|
* @param {DefaultProps} defaultProps
|
|
47
20
|
*/
|
|
48
21
|
constructor(props: Props);
|
|
49
|
-
protected __implGetDefaultProps(_props: Props): DefaultProps | undefined;
|
|
50
22
|
destroy?(): void;
|
|
51
23
|
update(changedProps: Partial<Props>): void;
|
|
52
|
-
private __implUpdateProps;
|
|
53
24
|
protected _onAttach?(): void;
|
|
54
25
|
protected _onDetach?(): void;
|
|
55
26
|
protected _onUpdate?(props: Partial<Props>, oldProps: Props): void;
|
|
56
|
-
protected __implAttachExtra(): void;
|
|
57
|
-
protected __implDetachExtra(): void;
|
|
58
|
-
protected __implAttachTo?(parent: GenericComplexEntity<unknown> | null): void;
|
|
59
27
|
get parent(): GenericComplexEntity<unknown> | null;
|
|
60
28
|
get root(): Root | null;
|
|
61
|
-
private __implFindRoot;
|
|
62
|
-
private __implAttach;
|
|
63
|
-
private __implDetach;
|
|
64
29
|
protected _provideContext<T>(consumer: Context<T>, ctx: T): void;
|
|
65
|
-
private __implGetContextProvider;
|
|
66
30
|
protected _consumeContext<T>(consumer: Context<T>): T | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Subscribes to changes in a context.
|
|
69
|
-
* @param context
|
|
70
|
-
* @param watcher
|
|
71
|
-
* @param params
|
|
72
|
-
* @param params.immediate Calls watcher immediately. For most handlers it allows to inline watcher function.
|
|
73
|
-
* @returns Function to unsubscribe from changes context.
|
|
74
|
-
* For most handlers it can be, because it is called automatically on detach.
|
|
75
|
-
* @internal
|
|
76
|
-
*/
|
|
77
|
-
protected _watchContext<T>(context: Context<T>, watcher: ContextWatcherFn, params?: {
|
|
78
|
-
immediate: boolean;
|
|
79
|
-
}): () => void;
|
|
80
|
-
protected __implReposition(): void;
|
|
81
31
|
}
|
|
82
32
|
interface ComplexOptions<Root extends GenericRootEntity<unknown> = GenericRootEntity<unknown>> {
|
|
83
33
|
children?: GenericEntity<unknown, {}, Root>[];
|
|
84
34
|
container?: boolean;
|
|
85
35
|
}
|
|
86
|
-
/** @internal */
|
|
87
36
|
declare class GenericComplexEntity<Props, DefaultProps extends {} = {}, Root extends GenericRootEntity<unknown> = GenericRootEntity<unknown>> extends GenericEntity<Props, DefaultProps, Root> {
|
|
88
|
-
private __implChildren;
|
|
89
37
|
protected readonly children: readonly GenericEntity<unknown, {}, Root>[];
|
|
90
38
|
protected readonly _childContainer: GenericComplexEntity<unknown, {}, Root>;
|
|
91
39
|
constructor(props: Props, options?: ComplexOptions<Root>);
|
|
@@ -97,10 +45,7 @@ declare class GenericComplexEntity<Props, DefaultProps extends {} = {}, Root ext
|
|
|
97
45
|
protected addChild(child: GenericEntity<unknown, {}, Root>, index?: number): this;
|
|
98
46
|
protected _removeDirectChild(child: GenericEntity<unknown, {}, Root>): void;
|
|
99
47
|
protected removeChild(child: GenericEntity<unknown, {}, Root>): this;
|
|
100
|
-
protected __implAttachExtra(): void;
|
|
101
|
-
protected __implDetachExtra(): void;
|
|
102
48
|
}
|
|
103
|
-
/** @internal */
|
|
104
49
|
declare class GenericGroupEntity<Props, DefaultProps extends {} = {}, Root extends GenericRootEntity<unknown> = GenericRootEntity<unknown>> extends GenericComplexEntity<Props, DefaultProps, Root> {
|
|
105
50
|
readonly children: readonly GenericEntity<unknown, {}, Root>[];
|
|
106
51
|
protected readonly _childContainer: GenericGroupEntity<unknown, {}, Root>;
|
|
@@ -108,12 +53,10 @@ declare class GenericGroupEntity<Props, DefaultProps extends {} = {}, Root exten
|
|
|
108
53
|
addChild(child: GenericEntity<unknown, {}, Root>, index?: number): this;
|
|
109
54
|
removeChild(child: GenericEntity<unknown, {}, Root>): this;
|
|
110
55
|
}
|
|
111
|
-
/** @internal */
|
|
112
56
|
declare abstract class GenericRootEntity<Props, DefaultProps extends {} = {}> extends GenericGroupEntity<Props, DefaultProps> {
|
|
113
57
|
get root(): this;
|
|
114
58
|
protected _onAttach: undefined;
|
|
115
59
|
protected _onDetach: undefined;
|
|
116
|
-
protected __implAttachTo: undefined;
|
|
117
60
|
}
|
|
118
61
|
type EntityProps<T extends GenericEntity<unknown>> = T extends GenericEntity<infer P> ? P : never;
|
|
119
62
|
type EntityConstructor<TEntity extends GenericEntity<unknown>> = new (...args: any[]) => TEntity;
|
|
@@ -82,12 +82,6 @@ export type MMapProps = {
|
|
|
82
82
|
config?: Config;
|
|
83
83
|
/** Strategy for fetching hotspots, for whole viewport or for tiles that pointer is hovering at */
|
|
84
84
|
hotspotsStrategy?: "forViewport" | "forPointerPosition";
|
|
85
|
-
/**
|
|
86
|
-
* Whether to show map copyrights.
|
|
87
|
-
* > The option is ignored if `config.meta.copyrights.allowRemove` has a falsy value
|
|
88
|
-
* @internal
|
|
89
|
-
*/
|
|
90
|
-
copyrights?: boolean;
|
|
91
85
|
/** Position of copyright on the page. Default is 'bottom right' */
|
|
92
86
|
copyrightsPosition?: MMapCopyrightsPosition;
|
|
93
87
|
/**
|
|
@@ -167,12 +161,6 @@ declare class MMap extends GenericRootEntity<MMapProps, DefaultProps> {
|
|
|
167
161
|
readonly config: Config;
|
|
168
162
|
projection: Projection;
|
|
169
163
|
}>;
|
|
170
|
-
/** @internal */
|
|
171
|
-
static [reactify.overrideKey]: import("../../reactify/reactify").CustomReactify<MMap, import("react").ForwardRefExoticComponent<MMapProps & {
|
|
172
|
-
children?: import("react").ReactNode;
|
|
173
|
-
} & import("react").RefAttributes<GenericRootEntity<MMapProps & {
|
|
174
|
-
container: HTMLElement;
|
|
175
|
-
}, {}>>>>;
|
|
176
164
|
private readonly _rootContainer;
|
|
177
165
|
private readonly _container;
|
|
178
166
|
private readonly _resizeObserver;
|
|
@@ -185,7 +173,6 @@ declare class MMap extends GenericRootEntity<MMapProps, DefaultProps> {
|
|
|
185
173
|
readonly children: MMapEntity<unknown>[];
|
|
186
174
|
addChild(child: MMapEntity<unknown>, index?: number): this;
|
|
187
175
|
removeChild(child: MMapEntity<unknown>): this;
|
|
188
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
189
176
|
private _canBeMainLayer;
|
|
190
177
|
private _prepareLayersToSet;
|
|
191
178
|
private _filterLayers;
|
|
@@ -31,12 +31,6 @@ export type MMapControlProps = {};
|
|
|
31
31
|
* @module MMapControl
|
|
32
32
|
*/
|
|
33
33
|
export declare class MMapControl<T extends MMapControlProps = MMapControlProps> extends DomEntity<T> {
|
|
34
|
-
/** @internal */
|
|
35
|
-
static [reactify.overrideKey]: import("../../reactify/reactify").CustomReactify<MMapControl<MMapControlProps>, import("react").ForwardRefExoticComponent<{
|
|
36
|
-
children?: import("react").ReactNode;
|
|
37
|
-
} & import("react").RefAttributes<import("../Entities").GenericEntity<{
|
|
38
|
-
controlElement: HTMLElement;
|
|
39
|
-
}, {}, import("../Entities").GenericRootEntity<unknown, {}>>>>>;
|
|
40
34
|
protected _createDom(): {
|
|
41
35
|
element: HTMLElement;
|
|
42
36
|
container: HTMLElement;
|
|
@@ -27,7 +27,6 @@ declare class MMapCopyrights extends DomEntity<MMapCopyrightsProps, HTMLElement,
|
|
|
27
27
|
private _userAgreementState;
|
|
28
28
|
private _unwatchMapContext?;
|
|
29
29
|
constructor(props?: MMapCopyrightsProps);
|
|
30
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
31
30
|
protected _updateDom(): void;
|
|
32
31
|
protected _onAttach(): void;
|
|
33
32
|
protected _onDetach(): void;
|
|
@@ -33,7 +33,6 @@ declare class MMapDefaultFeaturesLayer extends MMapComplexEntity<MMapDefaultFeat
|
|
|
33
33
|
private _dataSource?;
|
|
34
34
|
private _featuresLayer?;
|
|
35
35
|
private _markerLayer?;
|
|
36
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
37
36
|
protected _onAttach(): void;
|
|
38
37
|
protected _onUpdate(propsDiff: Partial<MMapDefaultFeaturesLayerProps>): void;
|
|
39
38
|
protected _onDetach(): void;
|
|
@@ -8,19 +8,12 @@ type MMapDefaultSchemeLayerProps = {
|
|
|
8
8
|
visible?: boolean;
|
|
9
9
|
/** Vector tiles customization. Not allowed on a free tariff. */
|
|
10
10
|
customization?: VectorCustomization;
|
|
11
|
-
/**
|
|
12
|
-
* Should to fetch hotspots
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
hotspotsEnabled?: boolean;
|
|
16
11
|
/** Theme applied to the scheme */
|
|
17
12
|
theme?: "dark" | "light";
|
|
18
13
|
};
|
|
19
14
|
declare const defaultProps: {
|
|
20
15
|
visible: boolean;
|
|
21
16
|
source: string;
|
|
22
|
-
/** @internal */
|
|
23
|
-
hotspotsEnabled: boolean;
|
|
24
17
|
layersInfo: {
|
|
25
18
|
ground: {
|
|
26
19
|
type: string;
|
|
@@ -57,8 +50,6 @@ declare class MMapDefaultSchemeLayer extends MMapComplexEntity<MMapDefaultScheme
|
|
|
57
50
|
static defaultProps: {
|
|
58
51
|
visible: boolean;
|
|
59
52
|
source: string;
|
|
60
|
-
/** @internal */
|
|
61
|
-
hotspotsEnabled: boolean;
|
|
62
53
|
layersInfo: {
|
|
63
54
|
ground: {
|
|
64
55
|
type: string;
|
|
@@ -81,7 +72,6 @@ declare class MMapDefaultSchemeLayer extends MMapComplexEntity<MMapDefaultScheme
|
|
|
81
72
|
private _dataSource?;
|
|
82
73
|
private _layers;
|
|
83
74
|
private _unwatchMapContext?;
|
|
84
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
85
75
|
protected _onAttach(): void;
|
|
86
76
|
protected _onDetach(): void;
|
|
87
77
|
protected _onUpdate(propsDiff: Partial<MMapDefaultSchemeLayerProps>): void;
|
|
@@ -54,7 +54,6 @@ declare class MMapFeature extends MMapEntity<MMapFeatureProps, DefaultProps> {
|
|
|
54
54
|
protected _onAttach(): void;
|
|
55
55
|
protected _onDetach(): void;
|
|
56
56
|
protected _onUpdate({ style, id, source }: Partial<MMapFeatureProps>): void;
|
|
57
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
58
57
|
private __onDragStart;
|
|
59
58
|
private __onDragMove;
|
|
60
59
|
private __onDragEnd;
|
|
@@ -9,11 +9,11 @@ export interface DraggableProps<Callback> {
|
|
|
9
9
|
/** Fires on drag start */
|
|
10
10
|
onDragStart?: Callback;
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
* Maybe a function which will be called when the user drags and drops the element to a new position in the map.
|
|
13
|
+
* The arguments to the function will be with new coordinates.
|
|
14
|
+
* A component using with component should immediately store the new coordinates into its state and then pass
|
|
15
|
+
* the new coordinates as the marker's props.
|
|
16
|
+
* */
|
|
17
17
|
onDragEnd?: Callback;
|
|
18
18
|
/** Fires on drag move */
|
|
19
19
|
onDragMove?: Callback;
|
|
@@ -30,7 +30,6 @@ declare class MMapLayer extends MMapEntity<MMapLayerProps, DefaultProps> {
|
|
|
30
30
|
static defaultProps: Readonly<{
|
|
31
31
|
zIndex: 1500;
|
|
32
32
|
}>;
|
|
33
|
-
protected __implGetDefaultProps(props: MMapLayerProps): DefaultProps;
|
|
34
33
|
protected _onAttach(): void;
|
|
35
34
|
protected _onDetach(): void;
|
|
36
35
|
protected _onUpdate(): void;
|
|
@@ -65,8 +65,6 @@ export type DomEvents = {
|
|
|
65
65
|
export type MapEvents = {
|
|
66
66
|
onUpdate: MapEventUpdateHandler;
|
|
67
67
|
onResize: MapEventResizeHandler;
|
|
68
|
-
/** @internal */
|
|
69
|
-
onIndoorPlansChanged: IndoorPlansHandler;
|
|
70
68
|
};
|
|
71
69
|
export type BehaviorEvents = {
|
|
72
70
|
onActionStart: BehaviorMapEventHandler;
|
|
@@ -53,30 +53,6 @@ declare class MMapMarker extends MMapGroupEntity<MMapMarkerProps, DefaultProps>
|
|
|
53
53
|
zIndex: 0;
|
|
54
54
|
source: "mappable-default-feature";
|
|
55
55
|
}>;
|
|
56
|
-
/** @internal */
|
|
57
|
-
static [reactify.overrideKey]: import("../../reactify/reactify").CustomReactify<MMapMarker, import("react").ForwardRefExoticComponent<{
|
|
58
|
-
/** Coordinates of the marker */
|
|
59
|
-
coordinates: LngLat;
|
|
60
|
-
source?: string | undefined;
|
|
61
|
-
/** z index of the marker, defaults to 0 */
|
|
62
|
-
zIndex?: number | undefined;
|
|
63
|
-
properties?: Record<string, unknown> | undefined;
|
|
64
|
-
id?: string | undefined;
|
|
65
|
-
} & DraggableProps<MMapMarkerEventHandler> & FeatureClickEvents & {
|
|
66
|
-
markerElement?: HTMLElement | undefined;
|
|
67
|
-
} & {
|
|
68
|
-
children?: import("react").ReactNode;
|
|
69
|
-
} & import("react").RefAttributes<import("../Entities").GenericEntity<{
|
|
70
|
-
/** Coordinates of the marker */
|
|
71
|
-
coordinates: LngLat;
|
|
72
|
-
source?: string | undefined;
|
|
73
|
-
/** z index of the marker, defaults to 0 */
|
|
74
|
-
zIndex?: number | undefined;
|
|
75
|
-
properties?: Record<string, unknown> | undefined;
|
|
76
|
-
id?: string | undefined;
|
|
77
|
-
} & DraggableProps<MMapMarkerEventHandler> & FeatureClickEvents & {
|
|
78
|
-
markerElement?: HTMLElement | undefined;
|
|
79
|
-
}, {}, import("../Entities").GenericRootEntity<unknown, {}>>>>>;
|
|
80
56
|
readonly element: HTMLElement;
|
|
81
57
|
private _destroyDomCtx?;
|
|
82
58
|
constructor(props: MMapMarkerProps, element?: HTMLElement);
|
|
@@ -21,14 +21,9 @@ declare class MMapReactContainer extends MMapGroupEntity<ComputedMMapReactContai
|
|
|
21
21
|
static defaultProps: {
|
|
22
22
|
tagName: string;
|
|
23
23
|
};
|
|
24
|
-
/** @internal */
|
|
25
|
-
static [overrideKeyReactify]: import("../../reactify/reactify").CustomReactify<MMapReactContainer, TReact.FC<MMapReactContainerProps<unknown> & {
|
|
26
|
-
children?: TReact.ReactNode;
|
|
27
|
-
}>>;
|
|
28
24
|
element?: Element;
|
|
29
25
|
private _detachDom?;
|
|
30
26
|
private _disposeWatch?;
|
|
31
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
32
27
|
protected _onAttach(): void;
|
|
33
28
|
private _adjustContext;
|
|
34
29
|
protected _onDetach(): void;
|
package/imperative/suggest.d.ts
CHANGED
|
@@ -47,5 +47,13 @@ export type SuggestResponseItem = {
|
|
|
47
47
|
type?: DeprecatedObjectType;
|
|
48
48
|
};
|
|
49
49
|
export type SuggestResponse = SuggestResponseItem[];
|
|
50
|
+
/**
|
|
51
|
+
* Static function to work with Suggest API.
|
|
52
|
+
*
|
|
53
|
+
*
|
|
54
|
+
* @param {SuggestOptions} options Request options
|
|
55
|
+
* @param {Config} config Current config
|
|
56
|
+
* @returns {Promise<SuggestResponse>}
|
|
57
|
+
*/
|
|
50
58
|
export declare function suggest(options: SuggestOptions, config?: Config | undefined): Promise<SuggestResponse>;
|
|
51
59
|
export {};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** @internal */
|
|
2
|
-
export type MetricsConfig = {};
|
|
3
1
|
type Metrics = {};
|
|
4
2
|
type TransportOptions = {
|
|
5
3
|
share?: number;
|
|
@@ -10,8 +8,5 @@ type CreateTransportOptions = {
|
|
|
10
8
|
/** Events with share (if defined) less than this value will not be sent, should be in [0, 1] range */
|
|
11
9
|
sendBoundary?: number;
|
|
12
10
|
};
|
|
13
|
-
export declare function createMetricsTransport<T extends Record<string, unknown>>(config: MetricsConfig, options?: CreateTransportOptions): MetricsTransport<T>;
|
|
14
11
|
export declare const SEND_BOUNDARY: number;
|
|
15
|
-
export declare function initMetrics(config: MetricsConfig): void;
|
|
16
|
-
export declare function sendMetrics(data: Metrics, options?: TransportOptions): void;
|
|
17
12
|
export {};
|
package/import.d.ts
CHANGED
|
@@ -5,24 +5,11 @@ export type Module = Function | null | {
|
|
|
5
5
|
};
|
|
6
6
|
export type Loader = (pkg: string) => Promise<Module> | Module;
|
|
7
7
|
export interface Import {
|
|
8
|
-
/** @internal */
|
|
9
|
-
__implCache: Record<string, Promise<Module>>;
|
|
10
|
-
/** @internal */
|
|
11
|
-
__implInit(base: string, ready: Promise<unknown>): void;
|
|
12
|
-
/** @internal */
|
|
13
|
-
__implInlineModules: Record<string, () => Promise<Module>>;
|
|
14
8
|
loaders: Loader[];
|
|
15
9
|
default: Loader;
|
|
16
10
|
script: (url: string) => Promise<unknown>;
|
|
17
11
|
cssText: (cssText: string, name: string) => Promise<unknown>;
|
|
18
12
|
style: (url: string) => Promise<unknown>;
|
|
19
13
|
}
|
|
20
|
-
declare global {
|
|
21
|
-
const __MODULES__: string[];
|
|
22
|
-
const __PACKAGES__: string[];
|
|
23
|
-
const __VENDOR__: "mappable-world" | "mappable-world";
|
|
24
|
-
const __NAMESPACE__: "mappable" | "mappable";
|
|
25
|
-
const __LOGO_WIDHT__: `${number}px`;
|
|
26
|
-
}
|
|
27
14
|
declare const mappableImport: Import;
|
|
28
15
|
export { mappableImport };
|
package/main.d.ts
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
1
|
export * from "./imperative";
|
|
2
|
-
export * as __implReactify from "./reactify";
|
|
3
|
-
export declare const __implReactifyOverride: (reactify: import("./reactify").Reactify) => {
|
|
4
|
-
reactify: import("./reactify").Reactify;
|
|
5
|
-
MMapReactContainer: import("react").FC<import("./imperative/MMapReactContainer").MMapReactContainerProps<unknown> & {
|
|
6
|
-
children?: import("react").ReactNode;
|
|
7
|
-
}>;
|
|
8
|
-
};
|
|
@@ -31,7 +31,6 @@ declare class MMapFeatureEditor extends MMapComplexEntity<MMapFeatureEditorProps
|
|
|
31
31
|
private shape;
|
|
32
32
|
private line;
|
|
33
33
|
constructor(props: MMapFeatureEditorProps);
|
|
34
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
35
34
|
private _updatePreviewPoint;
|
|
36
35
|
private _updateDraggingPoint;
|
|
37
36
|
protected _onUpdate({ points, geometry, featureStyle, isActive, prefix, zIndex }: Partial<MMapFeatureEditorProps>): void;
|
|
@@ -21,7 +21,6 @@ declare class MMapCursor extends MMapComplexEntity<MMapCursorProps, DefaultProps
|
|
|
21
21
|
isActive: (object: MMapEntity<unknown, {}> | MMapHotspot) => boolean;
|
|
22
22
|
}>;
|
|
23
23
|
constructor(props: MMapCursorProps);
|
|
24
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
25
24
|
private _onMouseMove;
|
|
26
25
|
private _onMouseLeave;
|
|
27
26
|
}
|
package/package.json
CHANGED
|
@@ -50,14 +50,6 @@ declare class MMapClusterer extends mappable.MMapComplexEntity<MMapClustererProp
|
|
|
50
50
|
static defaultProps: Readonly<{
|
|
51
51
|
tickTimeout: 200;
|
|
52
52
|
}>;
|
|
53
|
-
/** @internal */
|
|
54
|
-
static [mappable.overrideKeyReactify]: import("../../../reactify/reactify").CustomReactify<MMapClusterer, import("react").ForwardRefExoticComponent<MMapClustererProps & {
|
|
55
|
-
marker: (feature: Feature) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
56
|
-
cluster: (coordinates: LngLat, features: Feature[]) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
57
|
-
} & import("react").RefAttributes<MMapEntity<MMapClustererProps & {
|
|
58
|
-
marker: (feature: Feature) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
59
|
-
cluster: (coordinates: LngLat, features: Feature[]) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
60
|
-
}, {}>>>>;
|
|
61
53
|
/** All created entities with cluster id*/
|
|
62
54
|
private _entitiesCache;
|
|
63
55
|
/** Viewport entities with cluster id */
|
|
@@ -99,7 +91,6 @@ declare class MMapClusterer extends mappable.MMapComplexEntity<MMapClustererProp
|
|
|
99
91
|
*/
|
|
100
92
|
private _syncVisibleEntities;
|
|
101
93
|
private _render;
|
|
102
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
103
94
|
protected _onAttach(): void;
|
|
104
95
|
protected _onDetach(): void;
|
|
105
96
|
protected _onUpdate(): void;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Throttles a function and delays its execution, so it's only called at most
|
|
3
|
-
* once within a given time period.
|
|
4
|
-
*
|
|
5
|
-
* @param {Function} fn The function to throttle.
|
|
6
|
-
* @param {number} wait The amount of time that must pass before the function can be called again.
|
|
7
|
-
* @return {Function} The throttled function.
|
|
8
|
-
*/
|
|
9
1
|
/**
|
|
10
2
|
* Throttles a function and delays its execution, so it's only called at most
|
|
11
3
|
* once within a given time period.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type TReact from "react";
|
|
2
2
|
import type { LngLat, MMapEntity } from "../../../..";
|
|
3
|
-
import type { CustomReactify } from "../../../../reactify/reactify";
|
|
3
|
+
import type { CustomReactify, OverrideProps } from "../../../../reactify/reactify";
|
|
4
4
|
import type { Feature } from "../interface";
|
|
5
5
|
import type { MMapClusterer as MMapClustererI, MMapClustererProps } from "../MMapClusterer";
|
|
6
6
|
/**
|
|
@@ -33,12 +33,12 @@ import type { MMapClusterer as MMapClustererI, MMapClustererProps } from "../MMa
|
|
|
33
33
|
* </MMap>
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
type MMapClustererReactifiedProps = MMapClustererProps
|
|
36
|
+
type MMapClustererReactifiedProps = OverrideProps<MMapClustererProps, {
|
|
37
37
|
/** Function that returns MMapMarker react component to render marker*/
|
|
38
38
|
marker: (feature: Feature) => TReact.ReactElement;
|
|
39
39
|
/** Function that returns MMapMarker react component to render cluster*/
|
|
40
40
|
cluster: (coordinates: LngLat, features: Feature[]) => TReact.ReactElement;
|
|
41
|
-
}
|
|
41
|
+
}>;
|
|
42
42
|
type MMapClustererR = TReact.ForwardRefExoticComponent<MMapClustererReactifiedProps & React.RefAttributes<MMapEntity<MMapClustererReactifiedProps>>>;
|
|
43
43
|
export declare const MMapClustererReactifyOverride: CustomReactify<MMapClustererI, MMapClustererR>;
|
|
44
44
|
export {};
|
|
@@ -39,7 +39,6 @@ declare class MMapGeolocationControl extends mappable.MMapGroupEntity<MMapGeoloc
|
|
|
39
39
|
private _element;
|
|
40
40
|
private _unwatchMapContext?;
|
|
41
41
|
constructor(props: MMapGeolocationControlProps);
|
|
42
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
43
42
|
private _timeout;
|
|
44
43
|
private _setLoading;
|
|
45
44
|
private _position;
|
|
@@ -35,7 +35,6 @@ declare class MMapZoomControl extends mappable.MMapControl<MMapZoomControlProps>
|
|
|
35
35
|
protected _listener: MMapListener;
|
|
36
36
|
private _currentZoom;
|
|
37
37
|
constructor(props: MMapZoomControlProps);
|
|
38
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
39
38
|
private _onMapUpdate;
|
|
40
39
|
private _changeZoom;
|
|
41
40
|
protected _onAttach(): void;
|
|
@@ -39,8 +39,6 @@ declare const MMapHintContext: import("../../../imperative/Entities").Context<un
|
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
declare class MMapHint extends mappable.MMapGroupEntity<MMapHintProps> {
|
|
42
|
-
/** @internal */
|
|
43
|
-
static [reactify.overrideKey]: CustomReactify<MMapHint, TReact.FC<MMapHintProps>>;
|
|
44
42
|
private _destroyDomContext;
|
|
45
43
|
private _detachDom;
|
|
46
44
|
private _element;
|
|
@@ -43,16 +43,6 @@ declare class MMapDefaultMarker extends mappable.MMapComplexEntity<MMapDefaultMa
|
|
|
43
43
|
static defaultProps: Readonly<{
|
|
44
44
|
color: "#f33";
|
|
45
45
|
}>;
|
|
46
|
-
/** @internal */
|
|
47
|
-
static [mappable.overrideKeyReactify]: import("../../../reactify/reactify").CustomReactify<MMapDefaultMarker, import("react").ForwardRefExoticComponent<{
|
|
48
|
-
coordinates: LngLat; /** Should popup hide marker. Default is false */
|
|
49
|
-
source?: string | undefined;
|
|
50
|
-
zIndex?: number | undefined;
|
|
51
|
-
properties?: Record<string, unknown> | undefined;
|
|
52
|
-
id?: string | undefined;
|
|
53
|
-
} & import("../../../imperative/MMapFeature/types").DraggableProps<import("../../../imperative/MMapMarker").MMapMarkerEventHandler> & import("../../../imperative/MMapFeature/types").FeatureClickEvents & DefaultMarkerCustomProps & {
|
|
54
|
-
children?: import("react").ReactNode;
|
|
55
|
-
} & import("react").RefAttributes<import("../../../imperative/MMapEnities").MMapEntity<MMapDefaultMarkerProps, {}>>>>;
|
|
56
46
|
private _marker;
|
|
57
47
|
private _container;
|
|
58
48
|
private _popup;
|
|
@@ -62,7 +52,6 @@ declare class MMapDefaultMarker extends mappable.MMapComplexEntity<MMapDefaultMa
|
|
|
62
52
|
constructor(props: MMapDefaultMarkerProps);
|
|
63
53
|
private _createMarker;
|
|
64
54
|
private __onElementClick;
|
|
65
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
66
55
|
private _togglePopup;
|
|
67
56
|
private _createPopup;
|
|
68
57
|
protected _onUpdate(changedProps: Partial<MMapDefaultMarkerProps>): void;
|
package/reactify/reactify.d.ts
CHANGED
|
@@ -26,20 +26,21 @@ export type CustomReactify<TEntity extends GenericEntity<unknown>, TResult> = (c
|
|
|
26
26
|
React: typeof TReact;
|
|
27
27
|
ReactDOM: typeof TReactDOM;
|
|
28
28
|
}) => TResult;
|
|
29
|
-
export type Overrided<TReactResult> = {
|
|
30
|
-
[overrideKeyReactify]: CustomReactify<
|
|
29
|
+
export type Overrided<TCtor extends EntityConstructor<GenericEntity<unknown>>, TReactResult> = {
|
|
30
|
+
[overrideKeyReactify]: CustomReactify<InstanceType<TCtor>, TReactResult>;
|
|
31
31
|
};
|
|
32
32
|
type InternalReactify<TEntity extends GenericEntity<unknown>> = (ctor: EntityConstructor<TEntity>, displayName?: string) => TReact.ForwardRefExoticComponent<TReact.PropsWithoutRef<TReact.PropsWithChildren<EntityProps<TEntity>>> & React.RefAttributes<TEntity | undefined>>;
|
|
33
|
-
type InternalReactifyEntity<TCtor extends EntityConstructor<GenericEntity<unknown>>> = (ctor: TCtor, displayName?: string) => TCtor extends Overrided<infer TResult> ? TResult : ReturnType<InternalReactify<InstanceType<TCtor>>>;
|
|
33
|
+
type InternalReactifyEntity<TCtor extends EntityConstructor<GenericEntity<unknown>>> = (ctor: TCtor, displayName?: string) => TCtor extends Overrided<TCtor, infer TResult> ? TResult : ReturnType<InternalReactify<InstanceType<TCtor>>>;
|
|
34
34
|
export type ReactifyEntity = <TCtor extends EntityConstructor<GenericEntity<unknown>>>(...args: Parameters<InternalReactifyEntity<TCtor>>) => ReturnType<InternalReactifyEntity<TCtor>>;
|
|
35
35
|
export type ReactifiedEntity<TCtor extends EntityConstructor<GenericEntity<unknown>>> = ReturnType<InternalReactifyEntity<TCtor>>;
|
|
36
|
-
export interface ReactifyModule
|
|
37
|
-
(module: TModule): ReactifiedModule<TModule>;
|
|
36
|
+
export interface ReactifyModule {
|
|
37
|
+
<TModule extends BaseModule = BaseModule>(module: TModule): ReactifiedModule<TModule>;
|
|
38
38
|
}
|
|
39
39
|
export type GetReactContext<TContext extends Context<unknown>> = (context?: TContext | undefined) => React.Context<unknown>;
|
|
40
40
|
export type ReactifiedModule<TModule extends BaseModule> = {
|
|
41
41
|
[Property in keyof TModule]: TModule[Property] extends EntityConstructor<GenericEntity<unknown>> ? ReturnType<InternalReactifyEntity<TModule[Property]>> : TModule[Property] extends typeof Context ? ReturnType<GetReactContext<TModule[Property]>> : TModule[Property];
|
|
42
42
|
};
|
|
43
43
|
export type BaseModule = Record<string | symbol, unknown>;
|
|
44
|
+
export type OverrideProps<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
|
|
44
45
|
export default function createReactify(React: typeof TReact, ReactDOM: typeof TReactDOM): Reactify;
|
|
45
46
|
export {};
|