-
Notifications
You must be signed in to change notification settings - Fork 443
Open
Description
In the event payload there is always the source and the possibility to add custom properties. Is it possible to extend types and make a base event type with source and custom properties?
TS:
leaflet-geoman/leaflet-geoman.d.ts
Lines 1437 to 1440 in 1fdc918
| export type GlobalRotateModeToggledEventHandler = (e: { | |
| enabled: boolean; | |
| map: L.Map; | |
| }) => void; |
JS where the payload and the custom payload are merged:
leaflet-geoman/src/js/Mixins/Events.js
Lines 615 to 618 in 1fdc918
| __fire(fireLayer, type, payload, source, customPayload = {}) { | |
| payload = merge(payload, customPayload, { source }); | |
| L.PM.Utils._fireEvent(fireLayer, type, payload); | |
| }, |
@ryan-morris maybe you have time to check this?
Reactions are currently unavailable