Improve typing of `Map.on_click`
https://github.com/developmentseed/lonboard/blob/6899f08b9998ac35ee7a77c988aaa3f120a4819c/lonboard/_map.py#L135
We should be able to have better typing than just a bare Callable
Are you wanting to add the types to the Callable like:
callback: Callable[[tuple[float, float]], None]
Since the function provided to the callback should be expecting a tuple of floats for the coordinate and it shouldn't return anything?
or is there something besides Callable that you know of that would be better fit?
You can use a protocol to provide more detailed typing for a callback. For example https://github.com/developmentseed/obstore/blob/77a2b3a5cc8f0352f4e5e4f1b9e20d0885fd1e63/obstore/python/obstore/_store/_aws.pyi#L448-L449 defines a type hint for a callback that must return an explicit type.
We can define a similar protocol to say exactly what arguments are passed in and should be returned.
oh that's neat, I've never used a protocol before. It looks like something I could implement, but I'm not going to sign up to take it on (I'm limited on my free time right now) but if your or no one else gets to it in the next few weeks I may put in a PR for it