Breaking change syncing TypeScript declarations with their implementations - #3617
Open
PaulHax wants to merge 1 commit into
Open
Breaking change syncing TypeScript declarations with their implementations#3617PaulHax wants to merge 1 commit into
PaulHax wants to merge 1 commit into
Conversation
The hand-maintained .d.ts files have accumulated gaps and inaccuracies. Some downstream projects carry local declaration shims to cover missing entry points. Add declarations for previously untyped modules and correct known issues in existing declarations. The changes were derived from macro definitions, implementation exports, and the built ESM output. BREAKING CHANGE: TypeScript builds that compiled against the previous declarations may now fail. Runtime behavior is unchanged. Consumers should remove overlapping local declaration shims. Code may need updates for corrected return types, nullability, exports, and constants.
PaulHax
force-pushed
the
typescript-types-sync
branch
from
August 28, 2026 02:45
c64bb85 to
4883512
Compare
daker
approved these changes
Aug 28, 2026
daker
left a comment
Collaborator
There was a problem hiding this comment.
LGTM i didn't run a check to validate all +500 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Bring most of the published TypeScript surface back in sync with the JavaScript implementation.
Results
Every module under
Sourcesnow has a declaration, and every declared member exists on the implementation —.d.tsfiles underSources: 287 → 540.No runtime file is touched. This PR changes
.d.tsfiles,package.json, andBREAKING_CHANGES.mdonly. Consumers can remove localdeclare module '@kitware/vtk.js/...'shims.Downstream
src/shims-vtk.d.ts, 310 lines of local@kitware/vtk.jsstubs.vtk-types-compattypes the custom render-pass locals and drops aninvokeEventsuppression.Changes
253 declarations added for modules that shipped none, and 246 corrected to match their implementation: member surface, accessor return types, nullability,
newInstanceoption types, and static exports.Accessors:
setXFromand setters that onlyreturn;are nowvoid, notboolean. Accessors that can read backnull/undefinedsay so, and fields absent fromDEFAULT_VALUESareT | undefinedrather thanNullable<T>.Named exports reachable only through a module's default export are no longer declared. Importing them by name never resolved at runtime.
DesiredOutputPrecision,VtkDataTypes,BoundaryCondition, andPolygonWithPointIntersectionStatecome from<Module>/Constants.vtkPolygon:PolygonIntersectionStatewas off by one against the runtime constant (FAILUREis-1, not0). It is now an alias ofPolygonWithPointIntersectionStateand cannot be used in value position.package.json: adds@webgpu/types, required by the WebGPU declarations.Documentation and TypeScript definitions were updated to match those changes
PR and Code Checklist
npm run reformatto have correctly formatted codeTesting
No unit tests added because there are no runtime changes. The declarations are verified with
npm run typecheck; formatting is verified withnpm run validate.For additional validation context, the internal fork has companion PRs for the declaration conformance scripts and the runtime bug fixes uncovered by the declaration work.