Skip to content

Commit dab2303

Browse files
committed
fix(40454): update IDL url for Intersection Observer and add type map from undefined to void
1 parent ca4a0da commit dab2303

File tree

5 files changed

+22
-13
lines changed

5 files changed

+22
-13
lines changed

baselines/dom.generated.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ interface IntersectionObserverEntryInit {
611611
}
612612

613613
interface IntersectionObserverInit {
614-
root?: Element | null;
614+
root?: Element | Document | null;
615615
rootMargin?: string;
616616
threshold?: number | number[];
617617
}
@@ -9607,7 +9607,7 @@ declare var InputEvent: {
96079607

96089608
/** provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's viewport. */
96099609
interface IntersectionObserver {
9610-
readonly root: Element | null;
9610+
readonly root: Node | null;
96119611
readonly rootMargin: string;
96129612
readonly thresholds: ReadonlyArray<number>;
96139613
disconnect(): void;

baselines/webworker.iterable.generated.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ interface Headers {
5050
values(): IterableIterator<string>;
5151
}
5252

53+
interface IDBDatabase {
54+
/**
55+
* Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names.
56+
*/
57+
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
58+
}
59+
5360
interface IDBObjectStore {
5461
/**
5562
* Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be satisfied with the data already in store the upgrade transaction will abort with a "ConstraintError" DOMException.

inputfiles/idl/Intersection Observer.widl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
1+
callback IntersectionObserverCallback = undefined (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
22

3-
[Constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options),
4-
Exposed=Window]
3+
[Exposed=Window]
54
interface IntersectionObserver {
6-
readonly attribute Element? root;
5+
constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options = {});
6+
readonly attribute Node? root;
77
readonly attribute DOMString rootMargin;
88
readonly attribute FrozenArray<double> thresholds;
9-
void observe(Element target);
10-
void unobserve(Element target);
11-
void disconnect();
9+
undefined observe(Element target);
10+
undefined unobserve(Element target);
11+
undefined disconnect();
1212
sequence<IntersectionObserverEntry> takeRecords();
1313
};
1414

15-
[Constructor(IntersectionObserverEntryInit intersectionObserverEntryInit)]
15+
[Exposed=Window]
1616
interface IntersectionObserverEntry {
17+
constructor(IntersectionObserverEntryInit intersectionObserverEntryInit);
1718
readonly attribute DOMHighResTimeStamp time;
1819
readonly attribute DOMRectReadOnly? rootBounds;
1920
readonly attribute DOMRectReadOnly boundingClientRect;
@@ -34,7 +35,7 @@ dictionary IntersectionObserverEntryInit {
3435
};
3536

3637
dictionary IntersectionObserverInit {
37-
Element? root = null;
38+
(Element or Document)? root = null;
3839
DOMString rootMargin = "0px";
3940
(double or sequence<double>) threshold = 0;
4041
};

inputfiles/idlSources.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@
387387
"title": "Indexed Database"
388388
},
389389
{
390-
"url": "https://www.w3.org/TR/intersection-observer/",
390+
"url": "https://w3c.github.io/IntersectionObserver/",
391391
"title": "Intersection Observer"
392392
},
393393
{

src/helpers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export const baseTypeConversionMap = new Map<string, string>([
1616
["sequence", "Array"],
1717
["record", "Record"],
1818
["FrozenArray", "ReadonlyArray"],
19-
["EventHandler", "EventHandler"]
19+
["EventHandler", "EventHandler"],
20+
["undefined", "void"]
2021
]);
2122

2223
export function filter<T>(obj: T, fn: (o: any, n: string | undefined) => boolean): T {

0 commit comments

Comments
 (0)