TypeScript-DOM-lib-generator icon indicating copy to clipboard operation
TypeScript-DOM-lib-generator copied to clipboard

Missing properties on CSSStyleDeclaration in upstream TypeScript

Open rishipal opened this issue 1 year ago • 0 comments

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.

rishipal avatar Oct 14 '24 22:10 rishipal