terra-draw 1.26.0 → 1.28.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/dist/common.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { LineString, Polygon, Position } from "geojson";
2
2
  import { StoreChangeHandler, GeoJSONStore, GeoJSONStoreFeatures, FeatureId } from "./store/store";
3
3
  export type HexColor = `#${string}`;
4
- export type HexColorStyling = HexColor | ((feature: GeoJSONStoreFeatures) => HexColor);
5
- export type NumericStyling = number | ((feature: GeoJSONStoreFeatures) => number);
4
+ export type HexColorStyling = HexColor | ((feature: GeoJSONStoreFeatures) => HexColor | undefined);
5
+ export type NumericStyling = number | ((feature: GeoJSONStoreFeatures) => number | undefined);
6
6
  export type UrlStyling = string | ((feature: GeoJSONStoreFeatures) => string);
7
7
  export interface TerraDrawAdapterStyling {
8
8
  pointColor: HexColor;
@@ -80,6 +80,7 @@ export declare abstract class TerraDrawBaseDrawMode<Styling extends CustomStylin
80
80
  onKeyDown(event: TerraDrawKeyboardEvent): void;
81
81
  onKeyUp(event: TerraDrawKeyboardEvent): void;
82
82
  undo(): void;
83
+ clearHistory(): void;
83
84
  undoSize(): number;
84
85
  redoSize(): number;
85
86
  redo(): void;
@@ -88,8 +89,8 @@ export declare abstract class TerraDrawBaseDrawMode<Styling extends CustomStylin
88
89
  onDragStart(event: TerraDrawMouseEvent, setMapDraggability: (enabled: boolean) => void): void;
89
90
  onDrag(event: TerraDrawMouseEvent, setMapDraggability: (enabled: boolean) => void): void;
90
91
  onDragEnd(event: TerraDrawMouseEvent, setMapDraggability: (enabled: boolean) => void): void;
91
- protected getHexColorStylingValue(value: HexColor | ((feature: GeoJSONStoreFeatures) => HexColor) | undefined, defaultValue: HexColor, feature: GeoJSONStoreFeatures): HexColor;
92
- protected getNumericStylingValue(value: number | ((feature: GeoJSONStoreFeatures) => number) | undefined, defaultValue: number, feature: GeoJSONStoreFeatures): number;
92
+ protected getHexColorStylingValue(value: HexColor | ((feature: GeoJSONStoreFeatures) => HexColor | undefined) | undefined, defaultValue: HexColor, feature: GeoJSONStoreFeatures): HexColor;
93
+ protected getNumericStylingValue(value: number | ((feature: GeoJSONStoreFeatures) => number | undefined) | undefined, defaultValue: number, feature: GeoJSONStoreFeatures): number;
93
94
  protected getUrlStylingValue(value: UrlStyling | undefined, defaultValue: string, feature: GeoJSONStoreFeatures): string;
94
95
  private getStylingValue;
95
96
  }
@@ -89,6 +89,7 @@ export declare class TerraDrawLineStringMode extends TerraDrawBaseDrawMode<LineS
89
89
  private firstUpdateToLine;
90
90
  private updateToLine;
91
91
  undoSize(): number;
92
+ clearHistory(): void;
92
93
  private pushHistorySnapshot;
93
94
  private updateSnappedGuidancePointFromLastMouseMove;
94
95
  private syncClosingPoints;
@@ -89,6 +89,7 @@ export declare class TerraDrawPolygonMode extends TerraDrawBaseDrawMode<PolygonS
89
89
  stop(): void;
90
90
  private updateSnappedCoordinate;
91
91
  undoSize(): number;
92
+ clearHistory(): void;
92
93
  private pushHistorySnapshot;
93
94
  private updateSnappedGuidancePointFromLastMouseMove;
94
95
  private syncClosingPoints;
@@ -73,10 +73,12 @@ interface TerraDrawSelectModeOptions<T extends CustomStyling> extends BaseModeOp
73
73
  dragEventThrottle?: number;
74
74
  cursors?: Cursors;
75
75
  allowManualDeselection?: boolean;
76
+ allowManualSelection?: boolean;
76
77
  }
77
78
  export declare class TerraDrawSelectMode extends TerraDrawBaseSelectMode<SelectionStyling> {
78
79
  mode: string;
79
80
  private allowManualDeselection;
81
+ private allowManualSelection;
80
82
  private dragEventThrottle;
81
83
  private dragEventCount;
82
84
  private selected;