-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
microsoft/TypeScript-DOM-lib-generator
#909Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the
87A7
different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisYou can do this
Milestone
Description
According to https://w3c.github.io/IntersectionObserver/#dictdef-intersectionobserverinit, the IntersectionObserverInit.root should be of type Document | Element | null
instead of just Element | null
(https://github.com/microsoft/TypeScript/blob/v4.0.2/lib/lib.dom.d.ts#L638)
TypeScript Version: 4.0.2
Search Terms:
Intersection Observer, IntersectionObserverInit
Code
const intersectionObserver = new IntersectionObserver(
() => {},
{
root: document,
}
);
Expected behavior:
No error should be raised
Actual behavior:
See error:
TS2740: Type 'Document' is missing the following properties from type 'Element': assignedSlot, attributes, classList, className, and 58 more.
Playground Link:
Related Issues:
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisYou can do this