Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CSS Typed OM property return types #60837

Closed

Conversation

ophirbucai
Copy link

Narrow down return type of StylePropertyMapReadOnly.get() to match CSS Types OM specification. Properties now return their specific CSSStyleValue sub classes:

  • CSSUnitValue
  • CSSKeywordValue
  • CSSTransformValue
  • Default: CSSStyleValue

This change provides better type safety and autocompletion when working with computedStyleMap().

Changes:

  • Added specific return types for common CSS properties in StylePropertyMap
  • Maintained backwards compatibility with fallback to CSSStyleValue
  • Included links to MDN documentation

Tests:

  • hereby runtests completed successfully

Narrow down return type of `StylePropertyMapReadOnly.get()` to match CSS Types OM specification. Properties now return their specific CSSStyleValue sub classes:
- CSSUnitValue
- CSSKeywordValue
- CSSTransformValue
- Default: CSSStyleValue
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 22, 2024
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@typescript-bot
Copy link
Collaborator

It looks like you've sent a pull request to update some generated declaration files related to the DOM. These files aren't meant to be edited by hand, as they are synchronized with files in the TypeScript-DOM-lib-generator repository. You can read more here. For house-keeping purposes, this pull request will be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants