So in the current codebase, the setter leaves the supplied value as an any type.
If the developer wants to set the class(es) on an Element, they should get the class (via the getter) and then simply call the DOMTokenList#add function. As it happens, this is exactly what all (PlayCanvas) PCUI apps do! I can find no instance anywhere where the class setter is called. Therefore, I am taking the opportunity to remove it from the API.
The signature for the
Element#class
setter is:However, the getter has the signature:
This is problematic for TypeScript though:
So in the current codebase, the setter leaves the supplied value as an
any
type.If the developer wants to set the class(es) on an Element, they should get the
class
(via the getter) and then simply call theDOMTokenList#add
function. As it happens, this is exactly what all (PlayCanvas) PCUI apps do! I can find no instance anywhere where theclass
setter is called. Therefore, I am taking the opportunity to remove it from the API.