Skip to content

Commit

Permalink
🏷️ [alex3165#188] Fixing type import
Browse files Browse the repository at this point in the history
Import `EditOptions` directly from 'leaflet' results into a "Cannot use namespace EditOptions as a type" error.
  • Loading branch information
robinmolen committed Jan 14, 2025
1 parent 7963cfe commit 9167a30
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 273 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/preset-react": "^7.12.1",
"@types/leaflet": "^1.7.11",
"@types/leaflet": "^1.9.16",
"@types/leaflet-draw": "^1.0.11",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"babel-loader": "^8.1.0",
"eslint": "^8.17.0",
"eslint-plugin-react": "^7.21.5",
"leaflet": "^1.8.0",
"leaflet": "^1.9.4",
"leaflet-draw": "^1.0.4",
"lodash-webpack-plugin": "^0.11.5",
"lodash.isequal": "^4.4.0",
Expand Down
5 changes: 3 additions & 2 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as React from 'react';
import 'leaflet-draw';
import type {
DrawOptions,
EditOptions,
Control,
ControlPosition,
DrawEvents,
} from 'leaflet';
Expand All @@ -22,7 +23,7 @@ interface EditControlProps {

onCreated?: (v: DrawEvents.Created) => void;
onMounted?: Function;
edit?: EditOptions;
edit?: Omit<Control.EditOptions, "featureGroup">;
draw: {
polyline?: DrawOptions.PolylineOptions | boolean;
polygon?: DrawOptions.PolygonOptions | boolean;
Expand Down
Loading

0 comments on commit 9167a30

Please sign in to comment.