Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types fix (for crucial for react-leaflet users) #1515

Open
roigarmi33 opened this issue Sep 19, 2024 · 5 comments
Open

Types fix (for crucial for react-leaflet users) #1515

roigarmi33 opened this issue Sep 19, 2024 · 5 comments

Comments

@roigarmi33
Copy link

Hey! I'm using the free version with react-leaflet, and all seems to work quite well but there is one main problem which is types of event handlers. The type definitions for pm event is on interface Evented, while for react-leaflet users, the event handler's prop type (which are passed to each layer's component) are inferred LeafletEventHandlerFnMap. So far, I have built my own leaflet.d.ts file to extend the type infer to match what geoman is adding. I'd for it to come by default or listen to other possible solutions from the community

@Falke-Design
Copy link
Collaborator

Hi,
we are happy to add solutions but we are nor TypeScript developers, so we are limited with our knowledge.

Any help is welcome

@roigarmi33
Copy link
Author

So basically what I did was adding another file on my own of leaflet.d.ts in my project, which is nice but it is not where it really should be placed since I'm not really supposed to define the types of the external library I am using. I think I will be able to provide some help but I only know my use cases with this library.

@raprocks
Copy link

@roigarmi33 could you try creating a PR with you code? ive been facing the same issue and maybe i can contribute to the PR with what you have currently built

@roigarmi33
Copy link
Author

roigarmi33 commented Oct 29, 2024 via email

@roigarmi33
Copy link
Author

roigarmi33 commented Oct 29, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants