Closed rpolonsky closed 4 years ago
Hi! CARTO VL can be used with Typescript. You're right, we don't have types, you'd have to define your own types manually when needed. There's no plan to add TS types in the long term, but PRs are welcome :)
In addition, you'd need to add some configuration in your TS project, adding this to a type definition file (for example: your_file_name.d.ts
):
declare module '@carto/carto-vl' {
const content: any;
export default content;
}
declare module '@carto/carto-vl/src' {
const content: any;
export default content;
}
Then, you'd be able to import it:
import carto from '@carto/carto-vl';
Hope it helps 👌
Yeah, it helps, better than nothing Thank you!
Hello! How to use carto-vl in typescript project? I'm getting error:
Didn't find any types for this library