terra-draw 1.0.0-beta.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.versionrc.cjs +9 -0
- package/README.md +4 -47
- package/dist/common/adapter-listener.spec.d.ts +1 -0
- package/dist/{adapters/common → common}/base.adapter.d.ts +1 -1
- package/dist/common.d.ts +11 -6
- package/dist/extend.d.ts +4 -3
- package/dist/geometry/boolean/is-valid-coordinate.spec.d.ts +1 -0
- package/dist/geometry/boolean/point-in-polygon.spec.d.ts +1 -0
- package/dist/geometry/boolean/self-intersects.spec.d.ts +1 -0
- package/dist/geometry/calculate-relative-angle.d.ts +2 -10
- package/dist/geometry/calculate-relative-angle.spec.d.ts +1 -0
- package/dist/geometry/centroid.spec.d.ts +1 -0
- package/dist/geometry/clockwise.d.ts +2 -10
- package/dist/geometry/clockwise.spec.d.ts +1 -0
- package/dist/geometry/coordinates-identical.spec.d.ts +1 -0
- package/dist/geometry/determine-halfplane.d.ts +2 -10
- package/dist/geometry/determine-halfplane.spec.d.ts +1 -0
- package/dist/geometry/get-coordinates-as-points.spec.d.ts +1 -0
- package/dist/geometry/get-midpoint.spec.d.ts +1 -0
- package/dist/geometry/limit-decimal-precision.spec.d.ts +1 -0
- package/dist/geometry/measure/bearing.d.ts +2 -7
- package/dist/geometry/measure/bearing.spec.d.ts +1 -0
- package/dist/geometry/measure/desination.spec.d.ts +1 -0
- package/dist/geometry/measure/destination.d.ts +2 -7
- package/dist/geometry/measure/haversine-distance.spec.d.ts +1 -0
- package/dist/geometry/measure/pixel-distance-to-line.d.ts +2 -10
- package/dist/geometry/measure/pixel-distance-to-line.spec.d.ts +1 -0
- package/dist/geometry/measure/pixel-distance.d.ts +2 -7
- package/dist/geometry/measure/pixel-distance.spec.d.ts +1 -0
- package/dist/geometry/measure/rhumb-bearing.spec.d.ts +1 -0
- package/dist/geometry/measure/rhumb-destination.spec.d.ts +1 -0
- package/dist/geometry/measure/rhumb-distance.spec.d.ts +1 -0
- package/dist/geometry/point-on-line.d.ts +5 -0
- package/dist/geometry/point-on-line.spec.d.ts +1 -0
- package/dist/geometry/project/web-mercator.d.ts +2 -4
- package/dist/geometry/project/web-mercator.spec.d.ts +1 -0
- package/dist/geometry/shape/create-bbox.spec.d.ts +1 -0
- package/dist/geometry/shape/create-circle.spec.d.ts +1 -0
- package/dist/geometry/shape/great-circle-coordinates.spec.d.ts +1 -0
- package/dist/geometry/shape/web-mercator-distortion.spec.d.ts +1 -0
- package/dist/geometry/transform/rotate.spec.d.ts +1 -0
- package/dist/geometry/transform/scale.spec.d.ts +1 -0
- package/dist/geometry/web-mercator-centroid.d.ts +2 -4
- package/dist/geometry/web-mercator-centroid.spec.d.ts +1 -0
- package/dist/geometry/web-mercator-point-on-line.d.ts +11 -0
- package/dist/geometry/web-mercator-point-on-line.spec.d.ts +1 -0
- package/dist/modes/angled-rectangle/angled-rectangle.mode.d.ts +2 -3
- package/dist/modes/angled-rectangle/angled-rectangle.mode.spec.d.ts +1 -0
- package/dist/modes/base.mode.d.ts +3 -1
- package/dist/modes/circle/circle.mode.d.ts +3 -2
- package/dist/modes/circle/circle.mode.spec.d.ts +1 -0
- package/dist/modes/click-bounding-box.behavior.spec.d.ts +1 -0
- package/dist/modes/coordinate-snapping.behavior.d.ts +16 -0
- package/dist/modes/coordinate-snapping.behavior.spec.d.ts +1 -0
- package/dist/modes/freehand/freehand.mode.d.ts +8 -2
- package/dist/modes/freehand/freehand.mode.spec.d.ts +1 -0
- package/dist/modes/insert-coordinates.behavior.spec.d.ts +1 -0
- package/dist/modes/{snapping.behavior.d.ts → line-snapping.behavior.d.ts} +1 -1
- package/dist/modes/line-snapping.behavior.spec.d.ts +1 -0
- package/dist/modes/linestring/linestring.mode.d.ts +16 -5
- package/dist/modes/linestring/linestring.mode.spec.d.ts +1 -0
- package/dist/modes/pixel-distance.behavior.spec.d.ts +1 -0
- package/dist/modes/point/point.mode.d.ts +2 -2
- package/dist/modes/point/point.mode.spec.d.ts +1 -0
- package/dist/modes/polygon/behaviors/closing-points.behavior.spec.d.ts +1 -0
- package/dist/modes/polygon/polygon.mode.d.ts +17 -4
- package/dist/modes/polygon/polygon.mode.spec.d.ts +1 -0
- package/dist/modes/rectangle/rectangle.mode.d.ts +2 -2
- package/dist/modes/rectangle/rectangle.mode.spec.d.ts +1 -0
- package/dist/modes/render/render.mode.d.ts +2 -1
- package/dist/modes/render/render.mode.spec.d.ts +1 -0
- package/dist/modes/sector/sector.mode.d.ts +2 -2
- package/dist/modes/sector/sector.mode.spec.d.ts +1 -0
- package/dist/modes/select/behaviors/drag-coordinate-resize.behavior.spec.d.ts +1 -0
- package/dist/modes/select/behaviors/drag-coordinate.behavior.spec.d.ts +1 -0
- package/dist/modes/select/behaviors/drag-feature.behavior.d.ts +2 -2
- package/dist/modes/select/behaviors/drag-feature.behavior.spec.d.ts +1 -0
- package/dist/modes/select/behaviors/feature-at-pointer-event.behavior.spec.d.ts +1 -0
- package/dist/modes/select/behaviors/midpoint.behavior.spec.d.ts +1 -0
- package/dist/modes/select/behaviors/rotate-feature.behavior.spec.d.ts +1 -0
- package/dist/modes/select/behaviors/scale-feature.behavior.spec.d.ts +1 -0
- package/dist/modes/select/behaviors/selection-point.behavior.spec.d.ts +1 -0
- package/dist/modes/select/select.mode.spec.d.ts +1 -0
- package/dist/modes/sensor/sensor.mode.d.ts +2 -2
- package/dist/modes/sensor/sensor.mode.spec.d.ts +1 -0
- package/dist/modes/static/static.mode.spec.d.ts +1 -0
- package/dist/store/spatial-index/quickselect.spec.d.ts +1 -0
- package/dist/store/spatial-index/rbush.spec.d.ts +1 -0
- package/dist/store/spatial-index/spatial-index.spec.d.ts +1 -0
- package/dist/store/store-feature-validation.d.ts +8 -2
- package/dist/store/store-validation.spec.d.ts +1 -0
- package/dist/store/store.d.ts +5 -1
- package/dist/store/store.spec.d.ts +1 -0
- package/dist/terra-draw.cjs +1 -1
- package/dist/terra-draw.cjs.map +1 -1
- package/dist/terra-draw.d.ts +13 -14
- package/dist/terra-draw.extensions.spec.d.ts +28 -0
- package/dist/terra-draw.modern.js +1 -1
- package/dist/terra-draw.modern.js.map +1 -1
- package/dist/terra-draw.module.js +1 -1
- package/dist/terra-draw.module.js.map +1 -1
- package/dist/terra-draw.spec.d.ts +1 -0
- package/dist/terra-draw.umd.js +1 -1
- package/dist/terra-draw.umd.js.map +1 -1
- package/dist/test/create-store-features.d.ts +6 -0
- package/dist/test/jest.matchers.d.ts +1 -0
- package/dist/test/mock-behavior-config.d.ts +2 -0
- package/dist/test/mock-callbacks.d.ts +2 -0
- package/dist/test/mock-cursor-event.d.ts +6 -0
- package/dist/test/mock-features.d.ts +4 -0
- package/dist/test/mock-keyboard-event.d.ts +5 -0
- package/dist/test/mock-mode-config.d.ts +21 -0
- package/dist/test/mock-pointer-event.d.ts +1 -0
- package/dist/util/geom.spec.d.ts +1 -0
- package/dist/util/id.spec.d.ts +1 -0
- package/dist/util/styling.spec.d.ts +1 -0
- package/dist/validation-reasons.d.ts +13 -0
- package/dist/validations/common-validations.d.ts +2 -0
- package/dist/validations/linestring.validation.d.ts +4 -1
- package/dist/validations/linestring.validation.spec.d.ts +1 -0
- package/dist/validations/max-size.validation.d.ts +3 -1
- package/dist/validations/max-size.validation.spec.d.ts +1 -0
- package/dist/validations/min-size.validation.d.ts +3 -1
- package/dist/validations/min-size.validation.spec.d.ts +1 -0
- package/dist/validations/not-self-intersecting.validation.d.ts +4 -1
- package/dist/validations/not-self-intersecting.validation.spec.d.ts +1 -0
- package/dist/validations/point.validation.d.ts +4 -1
- package/dist/validations/point.validation.spec.d.ts +1 -0
- package/dist/validations/polygon.validation.d.ts +8 -2
- package/dist/validations/polygon.validation.spec.d.ts +1 -0
- package/jest.nocheck.config.ts +5 -14
- package/package.json +12 -137
- package/tsconfig.json +6 -25
- package/.devcontainer/Dockerfile +0 -8
- package/.devcontainer/devcontainer.json +0 -27
- package/.devcontainer/post-create.sh +0 -16
- package/LICENSE +0 -8
- package/dist/adapters/arcgis-maps-sdk.adapter.d.ts +0 -106
- package/dist/adapters/google-maps.adapter.d.ts +0 -90
- package/dist/adapters/leaflet.adapter.d.ts +0 -99
- package/dist/adapters/mapbox-gl.adapter.d.ts +0 -90
- package/dist/adapters/maplibre-gl.adapter.d.ts +0 -72
- package/dist/adapters/openlayers.adapter.d.ts +0 -121
- package/e2e/README.md +0 -29
- package/e2e/package-lock.json +0 -4274
- package/e2e/package.json +0 -26
- package/e2e/playwright.config.ts +0 -77
- package/e2e/public/favicon.ico +0 -0
- package/e2e/public/index.html +0 -55
- package/e2e/tests/leaflet.spec.ts +0 -1040
- package/e2e/tests/setup.ts +0 -208
- package/e2e/webpack.config.js +0 -36
- /package/dist/{adapters/common → common}/adapter-listener.d.ts +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TerraDrawMouseEvent, TerraDrawAdapterStyling, TerraDrawKeyboardEvent, HexColorStyling, NumericStyling, Cursor } from "../../common";
|
|
2
|
+
import { Position } from "geojson";
|
|
2
3
|
import { TerraDrawBaseDrawMode, BaseModeOptions, CustomStyling } from "../base.mode";
|
|
3
4
|
import { BehaviorConfig } from "../base.behavior";
|
|
4
|
-
import { GeoJSONStoreFeatures } from "../../store/store";
|
|
5
|
+
import { GeoJSONStoreFeatures, StoreValidation } from "../../store/store";
|
|
5
6
|
type TerraDrawPolygonModeKeyEvents = {
|
|
6
7
|
cancel?: KeyboardEvent["key"] | null;
|
|
7
8
|
finish?: KeyboardEvent["key"] | null;
|
|
@@ -15,13 +16,22 @@ type PolygonStyling = {
|
|
|
15
16
|
closingPointColor: HexColorStyling;
|
|
16
17
|
closingPointOutlineWidth: NumericStyling;
|
|
17
18
|
closingPointOutlineColor: HexColorStyling;
|
|
19
|
+
snappingPointWidth: NumericStyling;
|
|
20
|
+
snappingPointColor: HexColorStyling;
|
|
21
|
+
snappingPointOutlineWidth: NumericStyling;
|
|
22
|
+
snappingPointOutlineColor: HexColorStyling;
|
|
18
23
|
};
|
|
19
24
|
interface Cursors {
|
|
20
25
|
start?: Cursor;
|
|
21
26
|
close?: Cursor;
|
|
22
27
|
}
|
|
28
|
+
interface Snapping {
|
|
29
|
+
toLine?: boolean;
|
|
30
|
+
toCoordinate?: boolean;
|
|
31
|
+
toCustom?: (event: TerraDrawMouseEvent) => Position | undefined;
|
|
32
|
+
}
|
|
23
33
|
interface TerraDrawPolygonModeOptions<T extends CustomStyling> extends BaseModeOptions<T> {
|
|
24
|
-
snapping?:
|
|
34
|
+
snapping?: Snapping;
|
|
25
35
|
pointerDistance?: number;
|
|
26
36
|
keyEvents?: TerraDrawPolygonModeKeyEvents | null;
|
|
27
37
|
cursors?: Cursors;
|
|
@@ -31,8 +41,10 @@ export declare class TerraDrawPolygonMode extends TerraDrawBaseDrawMode<PolygonS
|
|
|
31
41
|
private currentCoordinate;
|
|
32
42
|
private currentId;
|
|
33
43
|
private keyEvents;
|
|
34
|
-
private snappingEnabled;
|
|
35
44
|
private snapping;
|
|
45
|
+
private snappedPointId;
|
|
46
|
+
private lineSnapping;
|
|
47
|
+
private coordinateSnapping;
|
|
36
48
|
private pixelDistance;
|
|
37
49
|
private closingPoints;
|
|
38
50
|
private cursors;
|
|
@@ -48,6 +60,7 @@ export declare class TerraDrawPolygonMode extends TerraDrawBaseDrawMode<PolygonS
|
|
|
48
60
|
/** @internal */
|
|
49
61
|
onMouseMove(event: TerraDrawMouseEvent): void;
|
|
50
62
|
private updatePolygonGeometry;
|
|
63
|
+
private snapCoordinate;
|
|
51
64
|
/** @internal */
|
|
52
65
|
onClick(event: TerraDrawMouseEvent): void;
|
|
53
66
|
/** @internal */
|
|
@@ -64,6 +77,6 @@ export declare class TerraDrawPolygonMode extends TerraDrawBaseDrawMode<PolygonS
|
|
|
64
77
|
cleanUp(): void;
|
|
65
78
|
/** @internal */
|
|
66
79
|
styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
|
|
67
|
-
validateFeature(feature: unknown):
|
|
80
|
+
validateFeature(feature: unknown): StoreValidation;
|
|
68
81
|
}
|
|
69
82
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TerraDrawMouseEvent, TerraDrawAdapterStyling, TerraDrawKeyboardEvent, HexColorStyling, NumericStyling, Cursor } from "../../common";
|
|
2
|
-
import { GeoJSONStoreFeatures } from "../../store/store";
|
|
2
|
+
import { GeoJSONStoreFeatures, StoreValidation } from "../../store/store";
|
|
3
3
|
import { BaseModeOptions, CustomStyling, TerraDrawBaseDrawMode } from "../base.mode";
|
|
4
4
|
type TerraDrawRectangleModeKeyEvents = {
|
|
5
5
|
cancel: KeyboardEvent["key"] | null;
|
|
@@ -50,6 +50,6 @@ export declare class TerraDrawRectangleMode extends TerraDrawBaseDrawMode<Rectan
|
|
|
50
50
|
cleanUp(): void;
|
|
51
51
|
/** @internal */
|
|
52
52
|
styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
|
|
53
|
-
validateFeature(feature: unknown):
|
|
53
|
+
validateFeature(feature: unknown): StoreValidation;
|
|
54
54
|
}
|
|
55
55
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { HexColorStyling, NumericStyling, TerraDrawAdapterStyling } from "../../
|
|
|
2
2
|
import { BaseModeOptions, CustomStyling, ModeTypes, TerraDrawBaseDrawMode } from "../base.mode";
|
|
3
3
|
import { BehaviorConfig } from "../base.behavior";
|
|
4
4
|
import { GeoJSONStoreFeatures } from "../../terra-draw";
|
|
5
|
+
import { StoreValidation } from "../../store/store";
|
|
5
6
|
type RenderModeStyling = {
|
|
6
7
|
pointColor: HexColorStyling;
|
|
7
8
|
pointWidth: NumericStyling;
|
|
@@ -47,6 +48,6 @@ export declare class TerraDrawRenderMode extends TerraDrawBaseDrawMode<RenderMod
|
|
|
47
48
|
cleanUp(): void;
|
|
48
49
|
/** @internal */
|
|
49
50
|
styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
|
|
50
|
-
validateFeature(feature: unknown):
|
|
51
|
+
validateFeature(feature: unknown): StoreValidation;
|
|
51
52
|
}
|
|
52
53
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TerraDrawMouseEvent, TerraDrawAdapterStyling, TerraDrawKeyboardEvent, HexColorStyling, NumericStyling, Cursor } from "../../common";
|
|
2
2
|
import { TerraDrawBaseDrawMode, BaseModeOptions, CustomStyling } from "../base.mode";
|
|
3
|
-
import { GeoJSONStoreFeatures } from "../../store/store";
|
|
3
|
+
import { GeoJSONStoreFeatures, StoreValidation } from "../../store/store";
|
|
4
4
|
type TerraDrawSectorModeKeyEvents = {
|
|
5
5
|
cancel?: KeyboardEvent["key"] | null;
|
|
6
6
|
finish?: KeyboardEvent["key"] | null;
|
|
@@ -55,6 +55,6 @@ export declare class TerraDrawSectorMode extends TerraDrawBaseDrawMode<SectorPol
|
|
|
55
55
|
cleanUp(): void;
|
|
56
56
|
/** @internal */
|
|
57
57
|
styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
|
|
58
|
-
validateFeature(feature: unknown):
|
|
58
|
+
validateFeature(feature: unknown): StoreValidation;
|
|
59
59
|
}
|
|
60
60
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,10 +6,10 @@ import { MidPointBehavior } from "./midpoint.behavior";
|
|
|
6
6
|
import { FeatureId } from "../../../store/store";
|
|
7
7
|
export declare class DragFeatureBehavior extends TerraDrawModeBehavior {
|
|
8
8
|
readonly config: BehaviorConfig;
|
|
9
|
-
private readonly
|
|
9
|
+
private readonly featuresAtCursorEvent;
|
|
10
10
|
private readonly selectionPoints;
|
|
11
11
|
private readonly midPoints;
|
|
12
|
-
constructor(config: BehaviorConfig,
|
|
12
|
+
constructor(config: BehaviorConfig, featuresAtCursorEvent: FeatureAtPointerEventBehavior, selectionPoints: SelectionPointBehavior, midPoints: MidPointBehavior);
|
|
13
13
|
private draggedFeatureId;
|
|
14
14
|
private dragPosition;
|
|
15
15
|
startDragging(event: TerraDrawMouseEvent, id: FeatureId): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TerraDrawMouseEvent, TerraDrawAdapterStyling, TerraDrawKeyboardEvent, HexColorStyling, NumericStyling, Cursor } from "../../common";
|
|
2
2
|
import { TerraDrawBaseDrawMode, BaseModeOptions, CustomStyling } from "../base.mode";
|
|
3
|
-
import { GeoJSONStoreFeatures } from "../../store/store";
|
|
3
|
+
import { GeoJSONStoreFeatures, StoreValidation } from "../../store/store";
|
|
4
4
|
type TerraDrawSensorModeKeyEvents = {
|
|
5
5
|
cancel?: KeyboardEvent["key"] | null;
|
|
6
6
|
finish?: KeyboardEvent["key"] | null;
|
|
@@ -62,7 +62,7 @@ export declare class TerraDrawSensorMode extends TerraDrawBaseDrawMode<SensorPol
|
|
|
62
62
|
cleanUp(): void;
|
|
63
63
|
/** @internal */
|
|
64
64
|
styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
|
|
65
|
-
validateFeature(feature: unknown):
|
|
65
|
+
validateFeature(feature: unknown): StoreValidation;
|
|
66
66
|
private getDeltaBearing;
|
|
67
67
|
private notInSector;
|
|
68
68
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Validation } from "../common";
|
|
2
|
+
import { FeatureId, IdStrategy } from "./store";
|
|
2
3
|
export declare const StoreValidationErrors: {
|
|
3
4
|
readonly FeatureHasNoId: "Feature has no id";
|
|
4
5
|
readonly FeatureIsNotObject: "Feature is not object";
|
|
@@ -12,5 +13,10 @@ export declare const StoreValidationErrors: {
|
|
|
12
13
|
readonly FeatureCoordinatesNotAnArray: "Feature coordinates is not an array";
|
|
13
14
|
readonly InvalidModeProperty: "Feature does not have a valid mode property";
|
|
14
15
|
};
|
|
16
|
+
export declare function hasModeProperty(feature: unknown): feature is {
|
|
17
|
+
properties: {
|
|
18
|
+
mode: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
15
21
|
export declare function isValidTimestamp(timestamp: unknown): boolean;
|
|
16
|
-
export declare function isValidStoreFeature(feature: unknown, isValidId: IdStrategy<FeatureId>["isValidId"]):
|
|
22
|
+
export declare function isValidStoreFeature(feature: unknown, isValidId: IdStrategy<FeatureId>["isValidId"]): ReturnType<Validation>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/store/store.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Feature, Point, Polygon, LineString } from "geojson";
|
|
2
|
+
import { Validation } from "../common";
|
|
2
3
|
type JSON = string | number | boolean | null | JSONArray | JSONObject;
|
|
3
4
|
export interface JSONObject {
|
|
4
5
|
[member: string]: JSON;
|
|
@@ -8,6 +9,9 @@ type DefinedProperties = Record<string, JSON>;
|
|
|
8
9
|
export type GeoJSONStoreGeometries = Polygon | LineString | Point;
|
|
9
10
|
export type BBoxPolygon = Feature<Polygon, DefinedProperties>;
|
|
10
11
|
export type GeoJSONStoreFeatures = Feature<GeoJSONStoreGeometries, DefinedProperties>;
|
|
12
|
+
export type StoreValidation = {
|
|
13
|
+
id?: FeatureId;
|
|
14
|
+
} & ReturnType<Validation>;
|
|
11
15
|
type StoreChangeEvents = "delete" | "create" | "update" | "styling";
|
|
12
16
|
export type StoreChangeHandler = (ids: FeatureId[], change: StoreChangeEvents) => void;
|
|
13
17
|
export type FeatureId = string | number;
|
|
@@ -33,7 +37,7 @@ export declare class GeoJSONStore<Id extends FeatureId = FeatureId> {
|
|
|
33
37
|
private clone;
|
|
34
38
|
getId(): FeatureId;
|
|
35
39
|
has(id: FeatureId): boolean;
|
|
36
|
-
load(data: GeoJSONStoreFeatures[], featureValidation?: (feature: unknown, tracked?: boolean) =>
|
|
40
|
+
load(data: GeoJSONStoreFeatures[], featureValidation?: (feature: unknown, tracked?: boolean) => StoreValidation): StoreValidation[];
|
|
37
41
|
search(bbox: BBoxPolygon, filter?: (feature: GeoJSONStoreFeatures) => boolean): GeoJSONStoreFeatures[];
|
|
38
42
|
registerOnChange(onChange: StoreChangeHandler): void;
|
|
39
43
|
getGeometryCopy<T extends GeoJSONStoreGeometries>(id: FeatureId): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|