microsoft / TypeScript-DOM-lib-generator

Tool for generating dom related TypeScript and JavaScript library files
Apache License 2.0
622 stars 421 forks source link

Missing properties on CSSStyleDeclaration in upstream TypeScript #1826

Closed rishipal closed 3 weeks ago

rishipal commented 1 month ago

We're seeing a deprecation error in our tooling when someone tries to use the property webkitLineClamp in their code. Error:

webkitLineClamp is deprecated: This is a legacy alias of `lineClamp`.

I checked that the property is defined in https://fossies.org/linux/TypeScript/src/lib/dom.generated.d.ts and is marked @deprecated.

...
 4900     /**
 4901      * @deprecated This is a legacy alias of `lineClamp`.
 4902      *
 4903      * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/-webkit-line-clamp)
 4904      */
 4905     webkitLineClamp: string;
...
  1. Why is this property (and others) not a part of TypeScript's definition of CSSStyleDeclaration interface in the lib.dom.d.ts file? Instead I see an ~empty definition of CSSStyleDeclaration in the dom.iterable.generated.d.ts file instead. Am I mistaken to think this property should exist in lib.dom.d.ts?
  2. Even if the property gets defined in the right place in the future, it will be deprecated. So which property should we use instead? I don't see any property named lineClamp defined anywhere in either of the two .d.ts files in TypeScript.
saschanaz commented 3 weeks ago

It's in dom.generated.d.ts, without iterable. That said, this should probably not have the deprecation mark, as nobody implemented lineClamp.