Skip to content

Typescript type mismatch between LagrangePolynomialApproximation and InterpolationAlgorithm #13644

Description

@jfayot

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

  • I used AI to generate this issue report.
  • (If the above is checked) I have reviewed the AI-generated content before submitting.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions