Large inline type definitions may shadow trailing unions with pre-existing types. I think that there was a similar rule for regular javascript objects (I thought it was object-shorthand)
const foo = {
bar, // shorthand first
foo: 1 // inline values after
}
This is unrelated to my request though, which is about types.
type ElementUnion = {
readonly attributes: NamedNodeMap;
/** Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object. */
readonly classList: DOMTokenList;
/** Returns the value of element's class content attribute. Can be set to change it. */
className: string;
readonly clientHeight: number;
readonly clientLeft: number;
readonly clientTop: number;
readonly clientWidth: number;
} | Other;
type ElementIntersection = {
readonly clientHeight: number;
readonly clientLeft: number;
readonly clientTop: number;
readonly clientWidth: number;
} & Other;
type ElementUnion = Other | {
readonly attributes: NamedNodeMap;
/** Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object. */
readonly classList: DOMTokenList;
/** Returns the value of element's class content attribute. Can be set to change it. */
className: string;
readonly clientHeight: number;
readonly clientLeft: number;
readonly clientTop: number;
readonly clientWidth: number;
};
type ElementIntersection = Other & {
readonly clientHeight: number;
readonly clientLeft: number;
readonly clientTop: number;
readonly clientWidth: number;
};
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too