How to use some cesium property since Cesium 1.7

In Cesium 1.7, you added “built in” types so that I do not need to use anymore @types/cesium

I made all the changes needed, but I have a problem when using some global types.

ts.config
{ "compileOnSave": false, "compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, "target": "es5", "typeRoots": [ "node_modules/@types", "./src/typings.d.ts" ], "types": [ "cesium" ], "lib": [ "es2018", "dom" ] } }

but how do I defined for exemple

Cesium.when
Cesium.buildModuleUrl
Cesium.OpenStreetMapImageryProvider
Cesium.TileMapServiceImageryProvider

those method are on the global scope if I am correct, but they are not defined in the cesium types files. should I also create an object global.type and assign cesium to it ?

I reply to myself.

Apparently, many issue went up on the github, and will be fixed in 1.70.1 (including this)


1 Like