Replies: 3 comments
-
I just created pull request #15481 to generate types for the full build and add them to the distribution. |
Beta Was this translation helpful? Give feedback.
-
Hello! First I would like to thank you for taking time to answer my question! Sorry for the late response, I have been trying different solutions to this problem, all tools available to generate a single .d.ts file from the ol.d.ts files, but I have not gotten them to work properly. Unfortunately I don't understand how the ol.d.ts will help me with the legacy build (without other toolings to generate a single d.ts) since I don't use the import and export command. As I understand it is necessary to use import/export in order to use the generated d.ts file, but if I use import/export it would not be necessary to use the legacy build at all? |
Beta Was this translation helpful? Give feedback.
-
@HansBM If you download the legacy package (e.g. https://github.com/openlayers/openlayers/releases/download/v9.0.0/v9.0.0-package.zip) and make the extracted contents available to your project, you have all the linked .d.ts files referenced from |
Beta Was this translation helpful? Give feedback.
-
Hello!
I have a legacy project of my own where I have used OL 4.6.5 with TS types from DefinitelyTyped. I now need to update OL to a newer version but there are no d.ts for the full (legacy) build for OL 8+. I have tried all possible external libraries (rollup-plugin-dts, dts-bundle-generator etc) to generate such a file but I have not been successful. I have also tried to generate it from the full legacy build without the terser plugin to get a none mimimized version of the full legacy build, but when I try to generate a d.ts file from that debug legacy build I get a 227MB d.ts file. I used the command
tsc --declaration --declarationMap --emitDeclarationOnly --module commonjs --allowjs --outfile index.d.ts ol.js
. Is it possible to generate a d.ts from the full debug build?I am aware that OL recommends to use node or similar instead of the legacy build it seems like it would take a lot of work to switch everything over to node or webpack.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions