OpenLayers and TypeScript?

I was interested to know if there are any existing TypeScript definition files for OpenLayers (or if they are already in the process of being created).

I parsed the OpenLayers source files myself and used the documentation comments to create the TypeScript definition file, but to do this I would need a full JavaScript parser that also understands the documentation syntax in OpenLayers (it uses NaturalDocs, http://naturaldocs.org ), and I'm starting to think that translating information manually is easier than writing such a parser: (.

So, does anyone from a similar project or have an idea on how to accomplish the task of creating these TypeScript definition files?

Thanks in advance!

+6
source share
5 answers

Today I downloaded the definitions for OL 3.1.1 on Github: https://github.com/3x0dv5/ol3-typescript-definitions Feel free to use

+2
source

I have not yet seen the mention of the OpenLayers.d.ts file, but there is a growing list of definition files that are tracked here .

+1
source

There is no definition file yet. I also thought about creating one, but instead just resorted to using it through declaring an environment variable.

0
source

Here is a link to TypeScript definition files for Openlayers.

Openlayers definitionfiles

0
source

This is not really the answer, but have you looked into closing? https://github.com/teppeis/closure-ts It seems promising, however, I could not convert the ol3 js files. I will try to dig a little deeper and inform you.

0
source

Source: https://habr.com/ru/post/927194/


All Articles