Using addProperty with Typescript

Hi there.

I’m converting a JavaScript project that uses Cesium to Typescript. In my project, I use Entity#addProperty to add a specific property I want to define.

It seems that, while that property is being added to the entity, I also get a TypeScript error stating that the property isn’t defined.

In the screenshot, I try adding a conicSensor property. Everything works as intended. My code runs, but TypeScript says the property “conicSensor” doesn’t exist.

TypeScript is simply not aware of the functionality behind addProperty, and it can not “know” that this function actually adds a property called ‘conicSensor’ to the object. (You would probably not even need the addPropertyCall, depending on the type of the entity object…)