Skip to content

chore: add missing TypeScript field declarations to UI classes#1897

Merged
kpal81xd merged 4 commits intomainfrom
chore/ui-class-field-decls
Mar 5, 2026
Merged

chore: add missing TypeScript field declarations to UI classes#1897
kpal81xd merged 4 commits intomainfrom
chore/ui-class-field-decls

Conversation

@kpal81xd
Copy link
Contributor

@kpal81xd kpal81xd commented Mar 5, 2026

Summary

  • Add explicit field declarations to 20 legacy UI classes in src/common/ui/ that assigned properties in constructors without declaring them, causing ~894 TS2339/TS2551/TS2425 errors
  • Convert _onLinkChange from a field declaration to a protected method in base LegacyElement class, fixing TS2425 field/method conflicts in 9 subclasses (checkbox, color-field, curve-field, image-field, label, number-field, select-field, slider, text-field, textarea-field)
  • Convert innerElement from a plain property to a getter/setter backed by _innerElement to fix TS2611 accessor override conflict in LegacyContainer
  • Move _observerOptions from prototype assignment into the constructor and add field declarations for _observer, _observerChanged, _observerOptions in LegacyContainer

Test plan

  • npm run type:check shows 0 errors in src/common/ui/ (down from 894)
  • npm run lint passes
  • npm run build succeeds
  • npm test passes (157 tests)
  • No regressions in overall type-check error count (reduced from 4608 to 3651)

@kpal81xd kpal81xd self-assigned this Mar 5, 2026
@vercel
Copy link

vercel bot commented Mar 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
editor Ready Ready Preview, Comment Mar 5, 2026 4:33pm

Request Review

kpal81xd added 2 commits March 5, 2026 16:13
Add explicit field declarations to 20 legacy UI classes in
src/common/ui/ that were assigning properties in constructors
without declaring them, causing ~894 TS2339/TS2551/TS2425 errors.

Key changes:
- Convert _onLinkChange from field to method in base LegacyElement
  class to fix TS2425 field/method conflicts in 9 subclasses
- Convert innerElement from plain property to getter/setter backed
  by _innerElement to fix TS2611 accessor override in LegacyContainer
- Move _observerOptions from prototype assignment into constructor
- Add field declarations for all constructor-assigned properties
  across all 20 UI classes
- Fix ancillary type errors (Webkit prefixes, number-to-string
  assignments, EventTarget comparisons, DOM element casts)

Resolves all 894 TS errors in src/common/ui/.
@kpal81xd kpal81xd merged commit 699a25f into main Mar 5, 2026
2 checks passed
@kpal81xd kpal81xd deleted the chore/ui-class-field-decls branch March 5, 2026 16:55
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.

1 participant