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

Improve typescript bindings #1369

Merged
merged 1 commit into from
Feb 25, 2021
Merged

Conversation

Jamie5
Copy link
Contributor

@Jamie5 Jamie5 commented Feb 24, 2021

  • Make MapEvent.point/lngLat 2-arrays
  • From MjolnirEvent remove deltaX/deltaY/scale/rotation/metaKey which seem like they might not exist, or at least are not in the public API documentation
  • From MjolnirEvent make delta/pointerType/rightButton optional, as the API documentation states they are only present for some events
  • From MjolnirEvent add stopImmediatePropagation/leftButton/middleButton/key which are supposed to exist per docs
  • From MjolnirEvent make typings for stopPropagation/preventDefault/srcEvent more specific

rightButton: boolean,
stopPropagation: Function,
preventDefault: Function,
delta?: number,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are some of the fields deleted? They are accessed in map-controller.js:

  • deltaX
  • deltaY
  • scale
  • rotation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm they aren't documented as existing so I wasn't sure if they existed, but given we use them then they certainly do exist. So restored them (but made them optional, because they only exist for some events)

- Make MapEvent.point/lngLat 2-arrays
- From MjolnirEvent make deltaX/deltaY/scale/rotation/metaKey optional, as they are undocumented and don't exist for all events
- From MjolnirEvent make delta/pointerType/rightButton optional, as the API documentation states they are only present for some events
- From MjolnirEvent add stopImmediatePropagation/leftButton/middleButton/key which are supposed to exist per docs
- From MjolnirEvent make typings for stopPropagation/preventDefault/srcEvent more specific
Copy link
Collaborator

@Pessimistress Pessimistress left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Pessimistress Pessimistress merged commit 5927899 into visgl:master Feb 25, 2021
VictorVelarde pushed a commit that referenced this pull request Feb 26, 2021
VictorVelarde pushed a commit that referenced this pull request Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants