dimfeld / svelte-maplibre

Svelte bindings for the MapLibre mapping library
https://svelte-maplibre.vercel.app
MIT License
318 stars 39 forks source link

Clarify Typescript types for MaplibreMap slot #129

Closed singingwolfboy closed 7 months ago

singingwolfboy commented 7 months ago

Typescript was incorrectly detecting the type of the map prop in the <MaplibreMap> slot to be type maplibregl.Map | null. This is understandable, since that is the type of the store in the MapLibre.svelte file, but in order for the child components to be rendered, the store cannot be null. As a result, the type was too wide.

The Svelte documentation states that it's possible to override the detected types using some advanced typing systems. It notes that "The API is experimental and may change at any point," but for now, this seems to be the right way to accomplish this.

I don't know if this change should be considered "minor" or "patch" level; feel free to change the changeset, if you want!

changeset-bot[bot] commented 7 months ago

🦋 Changeset detected

Latest commit: 9dd50f9150e4664666661a65e5d15c1233577ce9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | --------------- | ----- | | svelte-maplibre | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 7 months ago

Someone is attempting to deploy a commit to a Personal Account owned by @dimfeld on Vercel.

@dimfeld first needs to authorize it.

dimfeld commented 7 months ago

Thanks!

dimfeld commented 7 months ago

Released in v0.8.1