@mappable-world/mappable-types 0.0.1 → 0.0.3
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/README.md +2 -2
- package/imperative/MMap/index.d.ts +2 -5
- package/imperative/MMapCoverage/index.d.ts +1 -0
- package/imperative/MMapDefaultSchemeLayer/index.d.ts +1 -1
- package/imperative/MMapTileDataSource/index.d.ts +1 -1
- package/imperative/config.d.ts +3 -4
- package/imperative/index.d.ts +5 -3
- package/imperative/route/index.d.ts +3 -1
- package/imperative/suggest.d.ts +21 -7
- package/imperative/utils/metrics.d.ts +4 -3
- package/imperative/wrappers.d.ts +42 -0
- package/import.d.ts +1 -1
- package/main.d.ts +0 -2
- package/modules/types.d.ts +2 -2
- package/package.json +1 -1
- package/packages/cartesian-projection/index.d.ts +1 -1
- package/packages/clusterer/MMapClusterer/MMapClusterer.d.ts +4 -5
- package/packages/clusterer/MMapClusterer/constants.d.ts +1 -1
- package/packages/controls/MMapZoomControl/index.d.ts +1 -1
- package/packages/hint/MMapHint/index.d.ts +2 -2
- package/packages/markers/MMapDefaultMarker/index.d.ts +3 -4
- package/packages/spherical-mercator-projection/index.d.ts +1 -1
- package/packages/types.d.ts +6 -6
- package/reactify/index.d.ts +2 -2
- package/reactify/reactify.d.ts +2 -2
- package/imperative/MMapDefaultSatelliteLayer/index.d.ts +0 -41
- package/init.template.d.ts +0 -33
- /package/imperative/{mappableMaps.d.ts → mappable-worldMaps.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Type definitions for Mappable Maps JavaScript API (https://mappable.world).
|
|
|
7
7
|
## Getting started
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm i @mappable/mappable-types -D
|
|
10
|
+
npm i @mappable-world/mappable-types -D
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
tsconfig.json
|
|
@@ -15,7 +15,7 @@ tsconfig.json
|
|
|
15
15
|
```json
|
|
16
16
|
{
|
|
17
17
|
"compilerOptions": {
|
|
18
|
-
"types": ["@mappable/mappable-types"]
|
|
18
|
+
"types": ["@mappable-world/mappable-types"]
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
```
|
|
@@ -99,9 +99,6 @@ export type MMapProps = {
|
|
|
99
99
|
*/
|
|
100
100
|
worldOptions?: WorldOptions;
|
|
101
101
|
};
|
|
102
|
-
export interface Experiments {
|
|
103
|
-
mappableVectorGraphics?: boolean;
|
|
104
|
-
}
|
|
105
102
|
declare const defaultProps: Readonly<{
|
|
106
103
|
className: "";
|
|
107
104
|
camera: {
|
|
@@ -122,7 +119,7 @@ declare const defaultProps: Readonly<{
|
|
|
122
119
|
cycledY: boolean;
|
|
123
120
|
};
|
|
124
121
|
restrictMapArea: false;
|
|
125
|
-
readonly config: Config
|
|
122
|
+
readonly config: Config;
|
|
126
123
|
projection: Projection;
|
|
127
124
|
}>;
|
|
128
125
|
type DefaultProps = typeof defaultProps;
|
|
@@ -167,7 +164,7 @@ declare class MMap extends GenericRootEntity<MMapProps, DefaultProps> {
|
|
|
167
164
|
cycledY: boolean;
|
|
168
165
|
};
|
|
169
166
|
restrictMapArea: false;
|
|
170
|
-
readonly config: Config
|
|
167
|
+
readonly config: Config;
|
|
171
168
|
projection: Projection;
|
|
172
169
|
}>;
|
|
173
170
|
/** @internal */
|
|
@@ -2,6 +2,7 @@ import { MMapComplexEntity } from "../MMapEnities";
|
|
|
2
2
|
interface MMapCoverageProps {
|
|
3
3
|
onError?: (e: Error) => void;
|
|
4
4
|
}
|
|
5
|
+
export declare const COVERAGE_LAYERS_TO_SOURCES: Record<string, string>;
|
|
5
6
|
/**
|
|
6
7
|
* The component of loading data on copyrights on the map and the zoom range for
|
|
7
8
|
* the area where the center of the map is located
|
|
@@ -49,7 +49,7 @@ type MMapTileDataSourceProps = {
|
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
51
|
declare class MMapTileDataSource extends MMapEntity<MMapTileDataSourceProps> {
|
|
52
|
-
private _id
|
|
52
|
+
private _id;
|
|
53
53
|
protected _onAttach(): void;
|
|
54
54
|
protected _onDetach(): void;
|
|
55
55
|
protected _onUpdate(props: Partial<MMapTileDataSourceProps>): void;
|
package/imperative/config.d.ts
CHANGED
package/imperative/index.d.ts
CHANGED
|
@@ -3,24 +3,26 @@ export { MMapCopyrightsPosition } from "./MMapCopyrights";
|
|
|
3
3
|
export { MMapEntity, MMapComplexEntity, MMapGroupEntity, MMapContext } from "./MMapEnities";
|
|
4
4
|
export { MMapDefaultFeaturesLayer, MMapDefaultFeaturesLayerProps } from "./MMapDefaultFeaturesLayer";
|
|
5
5
|
export { MMapDefaultSchemeLayer, MMapDefaultSchemeLayerProps } from "./MMapDefaultSchemeLayer";
|
|
6
|
-
export { MMapDefaultSatelliteLayer, MMapDefaultSatelliteLayerProps } from "./MMapDefaultSatelliteLayer";
|
|
7
6
|
export * from "./MMapFeature";
|
|
8
7
|
export { MMapFeatureDataSource, MMapFeatureDataSourceProps } from "./MMapFeatureDataSource";
|
|
9
8
|
export { MMapLayer, MMapLayerProps } from "./MMapLayer";
|
|
10
9
|
export * from "./MMapListener";
|
|
11
10
|
export * from "./MMapHotspot";
|
|
11
|
+
export * from "./wrappers";
|
|
12
12
|
export { MMapMarker, MMapMarkerProps, MMapMarkerEventHandler } from "./MMapMarker";
|
|
13
13
|
export { MMapTileDataSource, MMapTileDataSourceProps } from "./MMapTileDataSource";
|
|
14
14
|
export { MMapControls, MMapControlsProps } from "./MMapControls";
|
|
15
15
|
export { MMapControl, MMapControlProps, MMapControlButton, MMapControlButtonProps, MMapControlCommonButton } from "./MMapControl";
|
|
16
16
|
export { MMapCollection } from "./MMapCollection";
|
|
17
|
-
export * from "./
|
|
17
|
+
export * from "./mappable-worldMaps";
|
|
18
18
|
export * from "./search";
|
|
19
19
|
export * from "./suggest";
|
|
20
20
|
export * from "./route";
|
|
21
21
|
export { geolocation } from "./geolocation";
|
|
22
22
|
export { useDomContext } from "./DomContext";
|
|
23
|
-
export { Config } from "./config";
|
|
23
|
+
export { Config, getDefaultConfig } from "./config";
|
|
24
24
|
export { fetchConfig, FetchConfigOptions } from "./fetchConfig";
|
|
25
25
|
export * as projections from "./utils/projections";
|
|
26
|
+
/** Toggle this to enable/disable strict mode. */
|
|
27
|
+
export declare let strictMode: boolean;
|
|
26
28
|
export type { LngLat, ReadonlyLngLat, LngLatBounds, BehaviorType, MapMode, Margin, ZoomRange, ZoomStrategy, ZoomRounding, VectorCustomization, RasterTileDataSourceDescription, VectorTileDataSourceDescription, RasterLayerOptions, EasingFunctionDescription, EasingPresetName, EasingBezierPreset, EasingFunction, DrawingStyle, DrawingStyleIcon, VectorTileSize, VectorObjectsCollisionPriority, VectorDataSourcePriority } from "../common/types";
|
|
@@ -44,8 +44,10 @@ export interface RouteOptions {
|
|
|
44
44
|
results?: 1;
|
|
45
45
|
/** Traffic jams requesting flag. If specified, jams will be returned in properties. Default is `false`. */
|
|
46
46
|
jams?: boolean;
|
|
47
|
-
/**
|
|
47
|
+
/** If specified, bounding box of the route will be returned in properties. Default is `false`. */
|
|
48
48
|
bounds?: boolean;
|
|
49
|
+
/** Avoid roads with tolls. Default is `false`. */
|
|
50
|
+
avoidTolls?: boolean;
|
|
49
51
|
}
|
|
50
52
|
export interface BaseRouteResponse {
|
|
51
53
|
/** Return requested route as {@link RouteFeature RouteFeature}. */
|
package/imperative/suggest.d.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import type { LngLat, LngLatBounds } from "../common/types";
|
|
2
2
|
import { Config } from "./config";
|
|
3
|
-
type
|
|
3
|
+
type DeprecatedGeoSuggestType = "all" | "toponyms" | "addresses" | "organizations";
|
|
4
|
+
type GeoSuggestType = "biz" | "geo" | "street" | "metro" | "district" | "locality" | "area" | "province" | "country" | "house";
|
|
4
5
|
export type SuggestOptions = {
|
|
5
6
|
text: string;
|
|
6
7
|
center?: LngLat;
|
|
7
8
|
span?: LngLat;
|
|
8
9
|
bounds?: LngLatBounds;
|
|
9
|
-
countries?: string;
|
|
10
|
-
type?: GeoSuggestType;
|
|
11
10
|
limit?: number;
|
|
12
11
|
localOnly?: number;
|
|
13
12
|
highlight?: boolean;
|
|
13
|
+
types?: GeoSuggestType[];
|
|
14
|
+
/** @deprecated */
|
|
15
|
+
countries?: string;
|
|
16
|
+
/** @deprecated use types instead */
|
|
17
|
+
type?: DeprecatedGeoSuggestType;
|
|
14
18
|
};
|
|
15
|
-
type
|
|
19
|
+
type DeprecatedObjectType = "unknown" | "toponym" | "business" | "transit";
|
|
16
20
|
/** Positions of chars to highlight between */
|
|
17
21
|
type Highlight = [
|
|
18
22
|
number,
|
|
@@ -22,15 +26,25 @@ type TextWithHighlight = {
|
|
|
22
26
|
text: string;
|
|
23
27
|
hl: Highlight[];
|
|
24
28
|
};
|
|
29
|
+
type Distance = {
|
|
30
|
+
text: string;
|
|
31
|
+
value: number;
|
|
32
|
+
};
|
|
25
33
|
export type SuggestResponseItem = {
|
|
26
|
-
/** Type of suggested object */
|
|
27
|
-
type?: ObjectType;
|
|
28
34
|
/** Human-readable object title with matching highlighting */
|
|
29
35
|
title: TextWithHighlight;
|
|
30
36
|
/** Human-readable object subtitle with matching highlighting */
|
|
31
37
|
subtitle?: TextWithHighlight;
|
|
32
|
-
/**
|
|
38
|
+
/** Distance to the object in meters */
|
|
39
|
+
distance?: Distance;
|
|
40
|
+
/** Additional object information that can be used in a Geocoder HTTP API request. */
|
|
41
|
+
uri?: string;
|
|
42
|
+
/** Object tags. Possible values: business, street, metro, district, locality, area, province, country, hydro, railway, station, route, vegetation, airport, other, house */
|
|
43
|
+
tags?: string[];
|
|
44
|
+
/** @deprecated Use uri instead */
|
|
33
45
|
value: string;
|
|
46
|
+
/** @deprecated Use tags instead */
|
|
47
|
+
type?: DeprecatedObjectType;
|
|
34
48
|
};
|
|
35
49
|
export type SuggestResponse = SuggestResponseItem[];
|
|
36
50
|
export declare function suggest(options: SuggestOptions, config?: Config | undefined): Promise<SuggestResponse>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** @internal */
|
|
2
|
+
export type MetricsConfig = {};
|
|
2
3
|
type Metrics = {};
|
|
3
4
|
type TransportOptions = {
|
|
4
5
|
share?: number;
|
|
@@ -9,8 +10,8 @@ type CreateTransportOptions = {
|
|
|
9
10
|
/** Events with share (if defined) less than this value will not be sent, should be in [0, 1] range */
|
|
10
11
|
sendBoundary?: number;
|
|
11
12
|
};
|
|
12
|
-
export declare function createMetricsTransport<T extends Record<string, unknown>>(
|
|
13
|
+
export declare function createMetricsTransport<T extends Record<string, unknown>>(config: MetricsConfig, options?: CreateTransportOptions): MetricsTransport<T>;
|
|
13
14
|
export declare const SEND_BOUNDARY: number;
|
|
14
|
-
export declare function initMetrics(config:
|
|
15
|
+
export declare function initMetrics(config: MetricsConfig): void;
|
|
15
16
|
export declare function sendMetrics(data: Metrics, options?: TransportOptions): void;
|
|
16
17
|
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Key is used in `reactify` wrapper, to define custom implementations for react mappable.MMapEntity entities
|
|
3
|
+
* ```typescript
|
|
4
|
+
* type MMapSomeClassProps = {
|
|
5
|
+
* id: string;
|
|
6
|
+
* };
|
|
7
|
+
* export class MMapSomeClass extends mappable.MMapComplexEntity<MMapSomeClassProps> {
|
|
8
|
+
* static [mappable.overrideKeyReactify] = MMapSomeClassReactifyOverride;
|
|
9
|
+
* //...
|
|
10
|
+
* }
|
|
11
|
+
* ```
|
|
12
|
+
* and
|
|
13
|
+
* ```jsx
|
|
14
|
+
* export const MMapSomeClassReactifyOverride = (
|
|
15
|
+
* MMapSomeClassI, // it is same MMapSomeClass
|
|
16
|
+
* {reactify, React}
|
|
17
|
+
* ) => {
|
|
18
|
+
* const MMapSomeClassReactified = reactify.entity(MMapSomeClassI); // Standard reactivation method
|
|
19
|
+
* const MMapSomeClassR = React.forwardRef((props, ref) => {
|
|
20
|
+
* return (<>
|
|
21
|
+
* <MMapSomeClassReactified {...props} ref={ref} ... />
|
|
22
|
+
* </>);
|
|
23
|
+
* })
|
|
24
|
+
* return MMapSomeClassR;
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
* and in the end app
|
|
28
|
+
* ```jsx
|
|
29
|
+
* import {MMapSomeClass} from './some-class';
|
|
30
|
+
* import React from 'react';
|
|
31
|
+
* import ReactDOM from 'react-dom';
|
|
32
|
+
* // ...
|
|
33
|
+
* const mappableReact = await mappable.import('@mappable-world/mappable-reactify');
|
|
34
|
+
* const reactify = mappableReact.reactify.bindTo(React, ReactDOM);
|
|
35
|
+
* const {MMapSomeClass as MMapSomeClassR} = reactify.module({MMapSomeClass});
|
|
36
|
+
*
|
|
37
|
+
* function App() {
|
|
38
|
+
* return <MMapSomeClassR id="some_id"/>;
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare const overrideKeyReactify: unique symbol;
|
package/import.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface Import {
|
|
|
20
20
|
declare global {
|
|
21
21
|
const __MODULES__: string[];
|
|
22
22
|
const __PACKAGES__: string[];
|
|
23
|
-
const __VENDOR__: "mappable" | "mappable";
|
|
23
|
+
const __VENDOR__: "mappable-world" | "mappable-world";
|
|
24
24
|
const __NAMESPACE__: "mappable" | "mappable";
|
|
25
25
|
const __LOGO_WIDHT__: `${number}px`;
|
|
26
26
|
}
|
package/main.d.ts
CHANGED
package/modules/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../import";
|
|
2
2
|
declare module "../import" {
|
|
3
3
|
interface Import {
|
|
4
|
-
(pkg: "@mappable/mappable-controls-extra"): Promise<typeof import("./controls-extra")>;
|
|
5
|
-
(pkg: "@mappable/mappable-reactify"): Promise<typeof import("../reactify")>;
|
|
4
|
+
(pkg: "@mappable-world/mappable-controls-extra"): Promise<typeof import("./controls-extra")>;
|
|
5
|
+
(pkg: "@mappable-world/mappable-reactify"): Promise<typeof import("../reactify")>;
|
|
6
6
|
}
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ import type { Projection, LngLat, WorldCoordinates } from "../../common/types";
|
|
|
18
18
|
* const PIC_WIDTH = 2526;
|
|
19
19
|
* const PIC_HEIGHT = 1642;
|
|
20
20
|
*
|
|
21
|
-
* const {Cartesian} = await mappable.import('@mappable/mappable-cartesian-projection@0.0.1');
|
|
21
|
+
* const {Cartesian} = await mappable.import('@mappable-world/mappable-cartesian-projection@0.0.1');
|
|
22
22
|
* // We set as a projection Cartesian. With this calculation, the center of the image will lie in the coordinates [0, 0].
|
|
23
23
|
* const projection = new Cartesian([
|
|
24
24
|
* [-PIC_WIDTH / 2, PIC_HEIGHT / 2 - worldSize],
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { MMapEntity } from "../../..";
|
|
2
2
|
import type { LngLat } from "../../../common/types";
|
|
3
|
-
import { reactify } from "../../../reactify";
|
|
4
3
|
import type { ClustererObject, Feature, IClusterMethod } from "./interface";
|
|
5
4
|
/**
|
|
6
5
|
* MMapClusterer props
|
|
@@ -21,7 +20,7 @@ type MMapClustererProps = {
|
|
|
21
20
|
};
|
|
22
21
|
type DefaultProps = typeof defaultProps;
|
|
23
22
|
declare const defaultProps: Readonly<{
|
|
24
|
-
tickTimeout:
|
|
23
|
+
tickTimeout: 200;
|
|
25
24
|
}>;
|
|
26
25
|
/**
|
|
27
26
|
* Display clustered features on a map.
|
|
@@ -49,10 +48,10 @@ declare const defaultProps: Readonly<{
|
|
|
49
48
|
*/
|
|
50
49
|
declare class MMapClusterer extends mappable.MMapComplexEntity<MMapClustererProps, DefaultProps> {
|
|
51
50
|
static defaultProps: Readonly<{
|
|
52
|
-
tickTimeout:
|
|
51
|
+
tickTimeout: 200;
|
|
53
52
|
}>;
|
|
54
53
|
/** @internal */
|
|
55
|
-
static [
|
|
54
|
+
static [mappable.overrideKeyReactify]: import("../../../reactify/reactify").CustomReactify<MMapClusterer, import("react").ForwardRefExoticComponent<MMapClustererProps & {
|
|
56
55
|
marker: (feature: Feature) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
57
56
|
cluster: (coordinates: LngLat, features: Feature[]) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
58
57
|
} & import("react").RefAttributes<MMapEntity<MMapClustererProps & {
|
|
@@ -60,7 +59,7 @@ declare class MMapClusterer extends mappable.MMapComplexEntity<MMapClustererProp
|
|
|
60
59
|
cluster: (coordinates: LngLat, features: Feature[]) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
61
60
|
}, {}>>>>;
|
|
62
61
|
/** All created entities with cluster id*/
|
|
63
|
-
private
|
|
62
|
+
private _entitiesCache;
|
|
64
63
|
/** Viewport entities with cluster id */
|
|
65
64
|
private _visibleEntities;
|
|
66
65
|
/** Store to add entities on a map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const THROTTLE_DEFAULT_TIMEOUT_MS =
|
|
1
|
+
export declare const THROTTLE_DEFAULT_TIMEOUT_MS = 200;
|
|
@@ -20,7 +20,7 @@ type DefaultProps = typeof defaultProps;
|
|
|
20
20
|
* @example
|
|
21
21
|
* ```javascript
|
|
22
22
|
* const controls = new MMapControls({position: 'right'});
|
|
23
|
-
* const {MMapZoomControl} = await mappable.import('@mappable/mappable-controls@0.0.1');
|
|
23
|
+
* const {MMapZoomControl} = await mappable.import('@mappable-world/mappable-controls@0.0.1');
|
|
24
24
|
* const zoomControl = new MMapZoomControl();
|
|
25
25
|
* controls.addChild(zoomControl);
|
|
26
26
|
* map.addChild(controls);
|
|
@@ -11,14 +11,14 @@ declare const MMapHintContext: import("../../../imperative/Entities").Context<un
|
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```javascript
|
|
14
|
-
* const {MMapHint, MMapHintContext} = await mappable.import('@mappable/mappable-hint@0.0.1');
|
|
14
|
+
* const {MMapHint, MMapHintContext} = await mappable.import('@mappable-world/mappable-hint@0.0.1');
|
|
15
15
|
* map.addChild(defaultFeatures = new MMapDefaultFeaturesLayer());
|
|
16
16
|
* map.addChild(hint = MMapHint({
|
|
17
17
|
* layers: [defaultFeatures.layer],
|
|
18
18
|
* hint: object => object?.properties?.hint
|
|
19
19
|
* }));
|
|
20
20
|
*
|
|
21
|
-
* const {MMapDefaultMarker} = await mappable.import('@mappable/mappable-markers@0.0.1');
|
|
21
|
+
* const {MMapDefaultMarker} = await mappable.import('@mappable-world/mappable-markers@0.0.1');
|
|
22
22
|
* map.addChild(new MMapDefaultMarker({coordinates: [37, 55], properties: {hint: 'Hello world!'}}));
|
|
23
23
|
*
|
|
24
24
|
* hint.addChild(new class MyHint extends mappable.MMapEntity {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { LngLat } from "../../../common/types";
|
|
2
2
|
import type { MMapMarkerProps } from "../../../imperative/MMapMarker";
|
|
3
|
-
import { reactify } from "../../../reactify";
|
|
4
3
|
type DefaultMarkerCustomProps = {
|
|
5
4
|
/** Marker title */
|
|
6
5
|
title?: string;
|
|
@@ -31,7 +30,7 @@ type DefaultProps = typeof defaultProps;
|
|
|
31
30
|
*
|
|
32
31
|
* @example
|
|
33
32
|
* ```javascript
|
|
34
|
-
* const {MMapDefaultMarker} = await mappable.import('@mappable/mappable-markers@0.0.1');
|
|
33
|
+
* const {MMapDefaultMarker} = await mappable.import('@mappable-world/mappable-markers@0.0.1');
|
|
35
34
|
* map.addChild(new MMapDefaultMarker({
|
|
36
35
|
* coordinates: [34, 54],
|
|
37
36
|
* title: 'Hello World!',
|
|
@@ -45,8 +44,8 @@ declare class MMapDefaultMarker extends mappable.MMapComplexEntity<MMapDefaultMa
|
|
|
45
44
|
color: "#f33";
|
|
46
45
|
}>;
|
|
47
46
|
/** @internal */
|
|
48
|
-
static [
|
|
49
|
-
coordinates: LngLat;
|
|
47
|
+
static [mappable.overrideKeyReactify]: import("../../../reactify/reactify").CustomReactify<MMapDefaultMarker, import("react").ForwardRefExoticComponent<{
|
|
48
|
+
coordinates: LngLat; /** Should popup hide marker. Default is false */
|
|
50
49
|
source?: string | undefined;
|
|
51
50
|
zIndex?: number | undefined;
|
|
52
51
|
properties?: Record<string, unknown> | undefined;
|
|
@@ -7,7 +7,7 @@ import type { Projection } from "../../common/types";
|
|
|
7
7
|
* @static
|
|
8
8
|
* @example
|
|
9
9
|
* ```js
|
|
10
|
-
* const { SphericalMercator } = await mappable.import('@mappable/mappable-spherical-mercator-projection@0.0.1');
|
|
10
|
+
* const { SphericalMercator } = await mappable.import('@mappable-world/mappable-spherical-mercator-projection@0.0.1');
|
|
11
11
|
* // Create a map in the spherical Mercator projection
|
|
12
12
|
* const map = new mappable.MMap(document.getElementById('MMapsID'), {
|
|
13
13
|
* location: {
|
package/packages/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "../import";
|
|
2
2
|
declare module "../import" {
|
|
3
3
|
interface Import {
|
|
4
|
-
(pkg: "@mappable/mappable-cartesian-projection@0.0.1"): Promise<typeof import("./cartesian-projection")>;
|
|
5
|
-
(pkg: "@mappable/mappable-spherical-mercator-projection@0.0.1"): Promise<typeof import("./spherical-mercator-projection")>;
|
|
6
|
-
(pkg: "@mappable/mappable-controls@0.0.1"): Promise<typeof import("./controls")>;
|
|
7
|
-
(pkg: "@mappable/mappable-markers@0.0.1"): Promise<typeof import("./markers")>;
|
|
8
|
-
(pkg: "@mappable/mappable-hint@0.0.1"): Promise<typeof import("./hint")>;
|
|
9
|
-
(pkg: "@mappable/mappable-clusterer@0.0.1"): Promise<typeof import("./clusterer")>;
|
|
4
|
+
(pkg: "@mappable-world/mappable-cartesian-projection@0.0.1"): Promise<typeof import("./cartesian-projection")>;
|
|
5
|
+
(pkg: "@mappable-world/mappable-spherical-mercator-projection@0.0.1"): Promise<typeof import("./spherical-mercator-projection")>;
|
|
6
|
+
(pkg: "@mappable-world/mappable-controls@0.0.1"): Promise<typeof import("./controls")>;
|
|
7
|
+
(pkg: "@mappable-world/mappable-markers@0.0.1"): Promise<typeof import("./markers")>;
|
|
8
|
+
(pkg: "@mappable-world/mappable-hint@0.0.1"): Promise<typeof import("./hint")>;
|
|
9
|
+
(pkg: "@mappable-world/mappable-clusterer@0.0.1"): Promise<typeof import("./clusterer")>;
|
|
10
10
|
}
|
|
11
11
|
}
|
package/reactify/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Reactify, ReactifyEntity, ReactifiedEntity, ReactifyModule, ReactifiedModule } from "./reactify";
|
|
2
|
-
import {
|
|
2
|
+
import { overrideKeyReactify } from "../imperative/wrappers";
|
|
3
3
|
type TReact = typeof import("react");
|
|
4
4
|
type TReactDOM = typeof import("react-dom");
|
|
5
5
|
export type { Reactify, ReactifyEntity, ReactifiedEntity, ReactifyModule, ReactifiedModule };
|
|
6
6
|
export type GenericReactify = {
|
|
7
|
-
readonly overrideKey: typeof
|
|
7
|
+
readonly overrideKey: typeof overrideKeyReactify;
|
|
8
8
|
bindTo(React: TReact, ReactDOM: TReactDOM): Reactify;
|
|
9
9
|
};
|
|
10
10
|
export declare const reactify: Readonly<GenericReactify>;
|
package/reactify/reactify.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type TReact from "react";
|
|
2
2
|
import type TReactDOM from "react-dom";
|
|
3
3
|
import { GenericEntity, Context, EntityConstructor, EntityProps } from "../imperative/Entities";
|
|
4
|
+
import { overrideKeyReactify } from "../imperative/wrappers";
|
|
4
5
|
type RefInstance<TEntity extends GenericEntity<unknown>> = React.MutableRefObject<TEntity | undefined>;
|
|
5
6
|
interface ReactParent {
|
|
6
7
|
entityRef: RefInstance<GenericEntity<unknown>>;
|
|
@@ -15,7 +16,6 @@ export type Reactify = {
|
|
|
15
16
|
entity: ReactifyEntity;
|
|
16
17
|
};
|
|
17
18
|
export declare const moduleOverrideExport: string;
|
|
18
|
-
export declare const overrideKey: unique symbol;
|
|
19
19
|
export type CustomReactify<TEntity extends GenericEntity<unknown>, TResult> = (ctor: EntityConstructor<TEntity>, params: {
|
|
20
20
|
reactify: {
|
|
21
21
|
module: <TModule extends BaseModule>(module: TModule) => ReactifiedModule<TModule>;
|
|
@@ -27,7 +27,7 @@ export type CustomReactify<TEntity extends GenericEntity<unknown>, TResult> = (c
|
|
|
27
27
|
ReactDOM: typeof TReactDOM;
|
|
28
28
|
}) => TResult;
|
|
29
29
|
export type Overrided<TReactResult> = {
|
|
30
|
-
[
|
|
30
|
+
[overrideKeyReactify]: CustomReactify<GenericEntity<unknown>, 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
33
|
type InternalReactifyEntity<TCtor extends EntityConstructor<GenericEntity<unknown>>> = (ctor: TCtor, displayName?: string) => TCtor extends Overrided<infer TResult> ? TResult : ReturnType<InternalReactify<InstanceType<TCtor>>>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { MMapComplexEntity } from "../MMapEnities";
|
|
2
|
-
/**
|
|
3
|
-
* MMapDefaultSatelliteLayer props
|
|
4
|
-
*/
|
|
5
|
-
type MMapDefaultSatelliteLayerProps = {
|
|
6
|
-
/** Should show layer */
|
|
7
|
-
visible?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const defaultProps: {
|
|
10
|
-
readonly visible: true;
|
|
11
|
-
readonly source: "mappable-default-satellite";
|
|
12
|
-
};
|
|
13
|
-
type DefaultProps = typeof defaultProps;
|
|
14
|
-
/**
|
|
15
|
-
* Map satellite layer to show satellite tiles on map.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```javascript
|
|
19
|
-
* const defaultSatelliteLayer = new MMapDefaultSatelliteLayer();
|
|
20
|
-
* // add to map
|
|
21
|
-
* map.addChild(defaultSatelliteLayer);
|
|
22
|
-
* // update
|
|
23
|
-
* defaultSatelliteLayer.update({visible: false});
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
declare class MMapDefaultSatelliteLayer extends MMapComplexEntity<MMapDefaultSatelliteLayerProps, DefaultProps> {
|
|
27
|
-
static defaultProps: {
|
|
28
|
-
readonly visible: true;
|
|
29
|
-
readonly source: "mappable-default-satellite";
|
|
30
|
-
};
|
|
31
|
-
private _dataSource?;
|
|
32
|
-
private _layer?;
|
|
33
|
-
private _unwatchMapContext?;
|
|
34
|
-
protected __implGetDefaultProps(): DefaultProps;
|
|
35
|
-
protected _onAttach(): void;
|
|
36
|
-
protected _onDetach(): void;
|
|
37
|
-
protected _onUpdate(propsDiff: Partial<MMapDefaultSatelliteLayerProps>): void;
|
|
38
|
-
private _createTileUrl;
|
|
39
|
-
private _getDataSourceDescription;
|
|
40
|
-
}
|
|
41
|
-
export { MMapDefaultSatelliteLayer, MMapDefaultSatelliteLayerProps };
|
package/init.template.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ConfigMeta } from "./imperative/config";
|
|
2
|
-
import type { Import } from "./import";
|
|
3
|
-
import { mappableImport } from "./import";
|
|
4
|
-
interface Config {
|
|
5
|
-
meta?: ConfigMeta;
|
|
6
|
-
src: {
|
|
7
|
-
base: string;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
interface AdhocConfig {
|
|
11
|
-
/** All logic with this field is for development and CI only. */
|
|
12
|
-
adhoc?: {
|
|
13
|
-
meta: {
|
|
14
|
-
hosts: ConfigMeta["hosts"];
|
|
15
|
-
apikey: string;
|
|
16
|
-
};
|
|
17
|
-
options: {
|
|
18
|
-
lang: string;
|
|
19
|
-
signal?: AbortSignal;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
type MainModule = typeof import("./main");
|
|
24
|
-
interface MMaps3 extends MainModule {
|
|
25
|
-
import: Import;
|
|
26
|
-
ready: Promise<void>;
|
|
27
|
-
__implReactify: typeof import("./reactify");
|
|
28
|
-
}
|
|
29
|
-
declare global {
|
|
30
|
-
const __CFG__: Config & AdhocConfig;
|
|
31
|
-
}
|
|
32
|
-
declare const ready: Promise<MMaps3>;
|
|
33
|
-
export { mappableImport as import, ready };
|
|
File without changes
|