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

TypeScript: index.d.ts file? #107

Open
steklopod opened this issue May 27, 2023 · 4 comments
Open

TypeScript: index.d.ts file? #107

steklopod opened this issue May 27, 2023 · 4 comments

Comments

@steklopod
Copy link

steklopod commented May 27, 2023

First of all, thanks for this project 👍🏻

Map is working.

But when I do type check with nuxi typecheck command I get:

Снимок экрана 2023-05-27 в 14 33 52
    "vue-tsc": "1.6.5"

Installing these deps did not help:

{
"@types/mapbox__mapbox-gl-geocoder": "^4.7.3",
 "@types/mapbox-gl": "^2.7.11"
}

Solved it by adding into shims.d.ts file:

declare module '@studiometa/vue-mapbox-gl' {
    export const MapboxMap: any;
    export const MapboxMarker: any;
    export const MapboxCluster: any;
    export const MapboxGeocoder: any;
    export const MapboxGeolocateControl: any;
    export const MapboxImage: any;
    export const MapboxImages: any;
    export const MapboxLayer: any;
    export const MapboxNavigationControl: any;
    export const MapboxPopup: any;
    export const MapboxSource: any;
    export const StoreLocator: any;
}

Could index.d.ts be added to library?

@steklopod steklopod changed the title vue-tsc: Could not find a declaration file for module '@studiometa/vue-mapbox-gl' TypeScript: index.d.ts file? May 27, 2023
@Ciriak
Copy link

Ciriak commented Oct 15, 2024

+1 , this is still an issue

@steklopod
Copy link
Author

@titouanmathis is there a chance to fix that?

Screenshot 2024-12-24 at 17 11 51

@titouanmathis
Copy link
Collaborator

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.

This was referenced Jan 2, 2025
@titouanmathis
Copy link
Collaborator

For those who want to try this out for feedback, you can install v2.7.0-alpha.0:

npm install @studiometa/vue-mapbox-gl@next

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

No branches or pull requests

3 participants