-
Notifications
You must be signed in to change notification settings - Fork 38
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
TypeScript: index.d.ts
file?
#107
Comments
index.d.ts
file?
+1 , this is still an issue |
@titouanmathis is there a chance to fix that? |
This should be easier to implement since the mapbox-gl package is now written in Typescript as well. With that said, this is not a priority on our end for now, so any PR on the subject is welcome. |
For those who want to try this out for feedback, you can install v2.7.0-alpha.0:
|
@titouanmathis thanks for the fix. I tried and the problem has gone, but new appeared: I can't use import type { LngLatLike } from 'mapbox-gl'
const markers: LngLatLike[] = [mapCenter.value, [13.360610, 52.505995]] <MapboxMarker v-for="coord in markers" :key="coord" :lng-lat="coord" />
|
My dirty fix: const mapCenter = ref<LngLatLike>([lng.value, lat.value])
type Coordinates = [number, number]
const markers: Coordinates[] = [[lng.value, lat.value], [13.360610, 52.505995]]
<MapboxMarker v-for="coord in markers" :key="`${coord[0]}-${coord[1]}`" :lng-lat="coord" /> |
Thanks for the feedback @steklopod. Types are generated from the props config for now, so some props might not be correctly typed. The way to fix this should be to change how props are declared to the type only way: https://vuejs.org/api/sfc-script-setup.html#type-only-props-emit-declarations In the meantime, you will have to use some hacks as you did. |
First of all, thanks for this project 👍🏻
Map is working.
But when I do type check with
nuxi typecheck
command I get:Installing these deps did not help:
Solved it by adding into
shims.d.ts
file:Could
index.d.ts
be added to library?The text was updated successfully, but these errors were encountered: