Skip to content

Fixed inconsistent typescript types between InterpolationAlgorithm and its implementations#13645

Open
jfayot wants to merge 3 commits into
CesiumGS:mainfrom
jfayot:fix_13644
Open

Fixed inconsistent typescript types between InterpolationAlgorithm and its implementations#13645
jfayot wants to merge 3 commits into
CesiumGS:mainfrom
jfayot:fix_13644

Conversation

@jfayot

@jfayot jfayot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes inconsistent generated typescript types between InterpolationAlgorithm and its Hermite, Lagrange, and Linear implementations.

SampledPositionProperty.setInterpolationOptions expects an InterpolationAlgorithm, but the generated declarations did not correctly represent the implementations:

  • type was not emitted when declared only within the namespace object literal.
  • interpolate was emitted as required even though only Hermite supports it.

This PR:

  • Declares each interpolation algorithm’s type property explicitly so it is included in generated declarations
  • Adds a JSDoc @optional tag
  • Marks InterpolationAlgorithm.interpolate as optional but preserves its API documentation
  • Adds typetcript smoke tests covering Hermite, Lagrange, and Linear with SampledPositionProperty.setInterpolationOptions

The generated interface now correctly includes:

interpolate?(...): number[];

Issue number and link

Fixes: #13644

Testing plan

  • run typescript definition generation and check the generated Cesium.d.ts
  • run the non-webgl tests

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

AI acknowledgment

  • I used AI to generate content in this PR
  • If yes, I have reviewed the AI-generated content before submitting

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for the pull request, @jfayot!

✅ We can confirm we have a CLA on file for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typescript type mismatch between LagrangePolynomialApproximation and InterpolationAlgorithm

1 participant