How to use special ImageryProvider in TypeScript environment?

Hi, I’m currently testing the new TypeScript support and run into some problems. Before, the following code would compile and run properly:

    const urlTemplateImageryProvider = new UrlTemplateImageryProvider({
        ...
    });

    this.viewer.scene.imageryLayers.addImageryProvider(urlTemplateImageryProvider);

But now the compiler throws an error, because addImageryProvider expects an ImageryProvider, and the special versions like UriTemplateImageryProvider, or the WMS / WMTS provider are no ImageryProvider.

How can I solve this?

Thanks for reporting this! Looks like this is a bug, as pointed out here: https://github.com/CesiumGS/cesium/issues/8901

Oh, thanks. Haven’t seen that bug. So I hope, it’s gonna be fixed soon.

@Matt_Amato just opened a fix for this here: https://github.com/CesiumGS/cesium/pull/8908. So it’ll be in the next CesiumJS release or a patch release coming out sooner than that.