Skip to content

Commit

Permalink
feat(lib.dom): Improve CSS Typed OM property return types
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ophirbucai committed Dec 22, 2024
1 parent 56a0825 commit 28e9ce8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22366,6 +22366,14 @@ interface StylePropertyMapReadOnly {
readonly size: number;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/get) */
get(property: string): undefined | CSSStyleValue;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnitValue) */
get(property: "animation-delay" | "animation-iteration-count" | "baseline-shift" | "block-size" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-bottom-width" | "border-end-end-radius" | "border-end-start-radius" | "border-left-width" | "border-right-width" | "border-start-end-radius" | "border-start-start-radius" | "border-top-left-radius" | "border-top-right-radius" | "border-top-width" | "column-rule-width" | "cx" | "cy" | "fill-opacity" | "flex-grow" | "flex-shrink" | "flood-opacity" | "font-size" | "font-stretch" | "font-weight" | "height" | "inline-size" | "line-height" | "margin-block-end" | "margin-block-start" | "margin-bottom" | "margin-inline-end" | "margin-inline-start" | "margin-left" | "margin-right" | "margin-top" | "math-depth" | "offset-distance" | "opacity" | "order" | "orphans" | "outline-offset" | "outline-width" | "padding-block-end" | "padding-block-start" | "padding-bottom" | "padding-inline-end" | "padding-inline-start" | "padding-left" | "padding-right" | "padding-top" | "r" | "scroll-margin-block-end" | "scroll-margin-block-start" | "scroll-margin-inline-end" | "scroll-margin-inline-start" | "shape-image-threshold" | "shape-margin" | "stop-opacity" | "stroke-dashoffset" | "stroke-miterlimit" | "stroke-opacity" | "stroke-width" | "tab-size" | "text-indent" | "text-size-adjust" | "transition-delay" | "transition-duration" | "widows" | "width" | "word-spacing" | "x" | "y"): undefined | CSSUnitValue;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeywordValue) */
get(property: "accent-color" | "alignment-baseline" | "anchor-name" | "anchor-scope" | "animation-composition" | "animation-direction" | "animation-duration" | "animation-fill-mode" | "animation-name" | "animation-play-state" | "animation-timeline" | "animation-timing-function" | "backdrop-filter" | "backface-visibility" | "background-attachment" | "background-blend-mode" | "background-clip" | "background-image" | "background-origin" | "background-size" | "baseline-source" | "border-bottom-style" | "border-collapse" | "border-image-source" | "border-left-style" | "border-right-style" | "border-top-style" | "bottom" | "box-shadow" | "box-sizing" | "break-after" | "break-before" | "break-inside" | "caption-side" | "clear" | "clip" | "clip-path" | "clip-rule" | "color-interpolation" | "color-interpolation-filters" | "color-rendering" | "column-count" | "column-gap" | "column-rule-style" | "column-span" | "column-width" | "contain-intrinsic-block-size" | "contain-intrinsic-inline-size" | "container-name" | "container-type" | "cursor" | "d" | "direction" | "display" | "dominant-baseline" | "empty-cells" | "field-sizing" | "fill-rule" | "filter" | "flex-basis" | "flex-direction" | "flex-wrap" | "float" | "font-kerning" | "font-optical-sizing" | "font-palette" | "font-size-adjust" | "font-style" | "font-synthesis-small-caps" | "font-synthesis-style" | "font-synthesis-weight" | "font-variant-alternates" | "font-variant-caps" | "font-variant-east-asian" | "font-variant-emoji" | "font-variant-ligatures" | "font-variant-numeric" | "font-variant-position" | "grid-auto-columns" | "grid-auto-flow" | "grid-auto-rows" | "grid-column-end" | "grid-column-start" | "grid-row-end" | "grid-row-start" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "hyphens" | "image-rendering" | "inset-block-end" | "inset-block-start" | "inset-inline-end" | "inset-inline-start" | "interpolate-size" | "isolation" | "left" | "letter-spacing" | "line-break" | "list-style-image" | "list-style-position" | "marker-end" | "marker-mid" | "marker-start" | "mask-type" | "math-shift" | "math-style" | "max-block-size" | "max-height" | "max-inline-size" | "max-width" | "min-block-size" | "min-height" | "min-inline-size" | "min-width" | "mix-blend-mode" | "object-fit" | "object-view-box" | "offset-anchor" | "offset-path" | "offset-position" | "outline-style" | "overflow-anchor" | "overflow-wrap" | "overflow-x" | "overflow-y" | "overlay" | "paint-order" | "perspective" | "pointer-events" | "position" | "position-anchor" | "position-area" | "position-try-fallbacks" | "position-try-order" | "position-visibility" | "resize" | "right" | "row-gap" | "rx" | "ry" | "scroll-behavior" | "scroll-padding-block-end" | "scroll-padding-block-start" | "scroll-padding-inline-end" | "scroll-padding-inline-start" | "scrollbar-gutter" | "scrollbar-width" | "shape-outside" | "shape-rendering" | "stroke-dasharray" | "stroke-linecap" | "stroke-linejoin" | "table-layout" | "text-align" | "text-align-last" | "text-anchor" | "text-decoration-line" | "text-decoration-skip-ink" | "text-decoration-style" | "text-overflow" | "text-rendering" | "text-shadow" | "text-spacing-trim" | "text-transform" | "text-underline-position" | "text-wrap-mode" | "text-wrap-style" | "top" | "touch-action" | "transform-style" | "transition-behavior" | "transition-property" | "transition-timing-function" | "unicode-bidi" | "user-select" | "vector-effect" | "vertical-align" | "view-transition-class" | "view-transition-name" | "visibility" | "white-space-collapse" | "will-change" | "word-break" | "writing-mode" | "z-index"): undefined | CSSKeywordValue;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue) */
get(property: "transform"): undefined | CSSTransformValue;
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/CSSPositionValue) */
get(property: "object-position" | "perspective-origin"): undefined | CSSStyleValue;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/getAll) */
getAll(property: string): CSSStyleValue[];
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/has) */
Expand Down

0 comments on commit 28e9ce8

Please sign in to comment.