Skip to content

Commit 17e75fc

Browse files
committed
(feat:lib.dom): Add specific return types for StylePropertyMapReadOnly.get()
Move type definitions to overrideTypes to generate corresponding return types, include MDN references Closes microsoft#1863
1 parent 50db672 commit 17e75fc

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

Diff for: baselines/dom.generated.d.ts

-9
Original file line numberDiff line numberDiff line change
@@ -22785,15 +22785,6 @@ interface StylePropertyMapReadOnly {
2278522785
readonly size: number;
2278622786
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/get) */
2278722787
get(property: string): undefined | CSSStyleValue;
22788-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnitValue) */
22789-
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;
22790-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeywordValue) */
22791-
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;
22792-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue) */
22793-
get(property: "transform"): undefined | CSSTransformValue;
22794-
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/CSSPositionValue) */
22795-
get(property: "object-position" | "perspective-origin"): undefined | CSSStyleValue;
22796-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/getAll) */
2279722788
getAll(property: string): CSSStyleValue[];
2279822789
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/has) */
2279922790
has(property: string): boolean;

Diff for: inputfiles/overridingTypes.jsonc

+15-5
Original file line numberDiff line numberDiff line change
@@ -3600,12 +3600,22 @@
36003600
"methods": {
36013601
"method": {
36023602
"get": {
3603-
// https://github.com/w3c/css-houdini-drafts/pull/1087
3604-
"signature": {
3605-
"0": {
3606-
"overrideType": "undefined | CSSStyleValue"
3603+
"mdnUrl": "https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/get",
3604+
"overrideSignatures": [
3605+
"get(parameter: string): undefined | CSSStyleValue",
3606+
{
3607+
"signature": "get(parameter: \"animation-delay\" | ... | \"y\"): undefined | CSSUnitValue",
3608+
"mdnUrl": "https://developer.mozilla.org/docs/Web/API/CSSUnitValue"
3609+
},
3610+
{
3611+
"signature": "get(parameter: \"transform\"): undefined | CSSTransformValue",
3612+
"mdnUrl": "https://developer.mozilla.org/docs/Web/API/CSSTransformValue"
3613+
},
3614+
{
3615+
"signature": "get(parameter: \"accent-color\" | ... | \"z-index\"): undefined | CSSKeywordValue",
3616+
"mdnUrl": "https://developer.mozilla.org/docs/Web/API/CSSKeywordValue"
36073617
}
3608-
}
3618+
]
36093619
}
36103620
}
36113621
}

0 commit comments

Comments
 (0)