typescript type definitions for Open Layers 6

1.5k Views Asked by At

The @types/openlayers package (https://www.npmjs.com/package/@types/openlayers) only supplies type definitions for OpenLayers 4.6. This is stated explicitly at the top comment in file index.d.ts.

Are types for OpenLayers 6 available and, failing that, what should be the course of action for developing Typescript applications with OpenLayers 6 ?

3

There are 3 best solutions below

0
On BEST ANSWER

Take a look at @types/ol:

This package contains type definitions for ol (https://github.com/openlayers/openlayers).

Version 6.4.2

0
On

If I believe this source the official package holding openlayers types is @types/ol

0
On

With ol 6.6+ type definitions should be included directly in openlayers. No additional @types/.. needed anymore.