terra-draw 1.0.0-beta.3 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,69 @@
1
+ import { TerraDrawMouseEvent, TerraDrawAdapterStyling, TerraDrawKeyboardEvent, HexColorStyling, NumericStyling, Cursor } from "../../common";
2
+ import { TerraDrawBaseDrawMode, BaseModeOptions, CustomStyling } from "../base.mode";
3
+ import { GeoJSONStoreFeatures } from "../../store/store";
4
+ type TerraDrawSensorModeKeyEvents = {
5
+ cancel?: KeyboardEvent["key"] | null;
6
+ finish?: KeyboardEvent["key"] | null;
7
+ };
8
+ type SensorPolygonStyling = {
9
+ centerPointColor: HexColorStyling;
10
+ centerPointWidth: NumericStyling;
11
+ centerPointOutlineColor: HexColorStyling;
12
+ centerPointOutlineWidth: NumericStyling;
13
+ fillColor: HexColorStyling;
14
+ outlineColor: HexColorStyling;
15
+ outlineWidth: NumericStyling;
16
+ fillOpacity: NumericStyling;
17
+ };
18
+ interface Cursors {
19
+ start?: Cursor;
20
+ close?: Cursor;
21
+ }
22
+ interface TerraDrawSensorModeOptions<T extends CustomStyling> extends BaseModeOptions<T> {
23
+ arcPoints?: number;
24
+ pointerDistance?: number;
25
+ keyEvents?: TerraDrawSensorModeKeyEvents | null;
26
+ cursors?: Cursors;
27
+ }
28
+ export declare class TerraDrawSensorMode extends TerraDrawBaseDrawMode<SensorPolygonStyling> {
29
+ mode: string;
30
+ private currentCoordinate;
31
+ private currentId;
32
+ private currentInitialArcId;
33
+ private currentStartingPointId;
34
+ private keyEvents;
35
+ private direction;
36
+ private arcPoints;
37
+ private cursors;
38
+ private mouseMove;
39
+ constructor(options?: TerraDrawSensorModeOptions<SensorPolygonStyling>);
40
+ private close;
41
+ /** @internal */
42
+ start(): void;
43
+ /** @internal */
44
+ stop(): void;
45
+ /** @internal */
46
+ onMouseMove(event: TerraDrawMouseEvent): void;
47
+ private updateLineStringGeometry;
48
+ private updatePolygonGeometry;
49
+ /** @internal */
50
+ onClick(event: TerraDrawMouseEvent): void;
51
+ /** @internal */
52
+ onKeyUp(event: TerraDrawKeyboardEvent): void;
53
+ /** @internal */
54
+ onKeyDown(): void;
55
+ /** @internal */
56
+ onDragStart(): void;
57
+ /** @internal */
58
+ onDrag(): void;
59
+ /** @internal */
60
+ onDragEnd(): void;
61
+ /** @internal */
62
+ cleanUp(): void;
63
+ /** @internal */
64
+ styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
65
+ validateFeature(feature: unknown): feature is GeoJSONStoreFeatures;
66
+ private getDeltaBearing;
67
+ private notInSector;
68
+ }
69
+ export {};