What happened?
When configuring interpolation on a SampledPositionProperty in typetcript, passing the exported LagrangePolynomialApproximation object as interpolationAlgorithm produces a type error:
error TS2739: Type 'typeof LagrangePolynomialApproximation' is missing the following properties from type 'InterpolationAlgorithm': type, interpolate
The API documentation indicates that LagrangePolynomialApproximation is a valid interpolation algorithm, and the code works at runtime. However, its exported typescript type is not assignable to the InterpolationAlgorithm type expected by setInterpolationOptions
This is also applicable to LinearApproximation and HermitePolynomialApproximation
Reproduction steps
import {
LagrangePolynomialApproximation,
SampledPositionProperty,
} from "cesium";
const sampledPos = new SampledPositionProperty();
sampledPos.setInterpolationOptions({
interpolationAlgorithm: LagrangePolynomialApproximation,
interpolationDegree: 2,
});
Sandcastle example
No response
Environment
Browser: Chrome 150.0.7871.128
CesiumJS Version: 1.143
Operating System: macos Tahoe 26.5.2
AI acknowledgment
What happened?
When configuring interpolation on a
SampledPositionPropertyin typetcript, passing the exportedLagrangePolynomialApproximationobject as interpolationAlgorithm produces a type error:The API documentation indicates that
LagrangePolynomialApproximationis a valid interpolation algorithm, and the code works at runtime. However, its exported typescript type is not assignable to the InterpolationAlgorithm type expected by setInterpolationOptionsThis is also applicable to
LinearApproximationandHermitePolynomialApproximationReproduction steps
Sandcastle example
No response
Environment
Browser: Chrome 150.0.7871.128
CesiumJS Version: 1.143
Operating System: macos Tahoe 26.5.2
AI acknowledgment