Skip to content

Commit 3649604

Browse files
authored
🤖 Update TypeScript DOM Libs
1 parent d60747f commit 3649604

11 files changed

+269
-147
lines changed

src/lib/dom.generated.d.ts

+186-92
Large diffs are not rendered by default.

src/lib/dom.iterable.generated.d.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ interface NamedNodeMap {
135135
}
136136

137137
interface Navigator {
138+
/** Available only in secure contexts. */
138139
requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: Iterable<MediaKeySystemConfiguration>): Promise<MediaKeySystemAccess>;
139140
vibrate(pattern: Iterable<number>): boolean;
140141
}
@@ -170,13 +171,6 @@ interface PluginArray {
170171
interface RTCStatsReport extends ReadonlyMap<string, any> {
171172
}
172173

173-
interface ReadableStream<R = any> {
174-
[Symbol.iterator](): IterableIterator<any>;
175-
entries(): IterableIterator<[number, any]>;
176-
keys(): IterableIterator<number>;
177-
values(): IterableIterator<any>;
178-
}
179-
180174
interface SVGLengthList {
181175
[Symbol.iterator](): IterableIterator<SVGLength>;
182176
}

src/lib/webworker.generated.d.ts

+60-19
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ interface RequestInit {
477477
/** An AbortSignal to set request's signal. */
478478
signal?: AbortSignal | null;
479479
/** Can only be null. Used to disassociate request from any Window. */
480-
window?: any;
480+
window?: null;
481481
}
482482

483483
interface ResponseInit {
@@ -671,7 +671,7 @@ interface AbortSignal extends EventTarget {
671671
declare var AbortSignal: {
672672
prototype: AbortSignal;
673673
new(): AbortSignal;
674-
// abort(): AbortSignal;
674+
// abort(): AbortSignal; - To be re-added in the future
675675
};
676676

677677
interface AbstractWorkerEventMap {
@@ -752,7 +752,10 @@ declare var ByteLengthQueuingStrategy: {
752752
new(init: QueuingStrategyInit): ByteLengthQueuingStrategy;
753753
};
754754

755-
/** Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. */
755+
/**
756+
* Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec.
757+
* Available only in secure contexts.
758+
*/
756759
interface Cache {
757760
add(request: RequestInfo): Promise<void>;
758761
addAll(requests: RequestInfo[]): Promise<void>;
@@ -768,7 +771,10 @@ declare var Cache: {
768771
new(): Cache;
769772
};
770773

771-
/** The storage for Cache objects. */
774+
/**
775+
* The storage for Cache objects.
776+
* Available only in secure contexts.
777+
*/
772778
interface CacheStorage {
773779
delete(cacheName: string): Promise<boolean>;
774780
has(cacheName: string): Promise<boolean>;
@@ -876,6 +882,7 @@ declare var CountQueuingStrategy: {
876882

877883
/** Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. */
878884
interface Crypto {
885+
/** Available only in secure contexts. */
879886
readonly subtle: SubtleCrypto;
880887
getRandomValues<T extends ArrayBufferView | null>(array: T): T;
881888
}
@@ -885,7 +892,10 @@ declare var Crypto: {
885892
new(): Crypto;
886893
};
887894

888-
/** The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. */
895+
/**
896+
* The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
897+
* Available only in secure contexts.
898+
*/
889899
interface CryptoKey {
890900
readonly algorithm: KeyAlgorithm;
891901
readonly extractable: boolean;
@@ -2137,6 +2147,7 @@ interface NavigatorOnLine {
21372147
readonly onLine: boolean;
21382148
}
21392149

2150+
/** Available only in secure contexts. */
21402151
interface NavigatorStorage {
21412152
readonly storage: StorageManager;
21422153
}
@@ -2431,7 +2442,10 @@ declare var PromiseRejectionEvent: {
24312442
new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;
24322443
};
24332444

2434-
/** This Push API interface represents a push message that has been received. This event is sent to the global scope of a ServiceWorker. It contains the information sent from an application server to a PushSubscription. */
2445+
/**
2446+
* This Push API interface represents a push message that has been received. This event is sent to the global scope of a ServiceWorker. It contains the information sent from an application server to a PushSubscription.
2447+
* Available only in secure contexts.
2448+
*/
24352449
interface PushEvent extends ExtendableEvent {
24362450
readonly data: PushMessageData | null;
24372451
}
@@ -2441,7 +2455,10 @@ declare var PushEvent: {
24412455
new(type: string, eventInitDict?: PushEventInit): PushEvent;
24422456
};
24432457

2444-
/** This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications. */
2458+
/**
2459+
* This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications.
2460+
* Available only in secure contexts.
2461+
*/
24452462
interface PushManager {
24462463
getSubscription(): Promise<PushSubscription | null>;
24472464
permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>;
@@ -2454,7 +2471,10 @@ declare var PushManager: {
24542471
readonly supportedContentEncodings: ReadonlyArray<string>;
24552472
};
24562473

2457-
/** This Push API interface provides methods which let you retrieve the push data sent by a server in various formats. */
2474+
/**
2475+
* This Push API interface provides methods which let you retrieve the push data sent by a server in various formats.
2476+
* Available only in secure contexts.
2477+
*/
24582478
interface PushMessageData {
24592479
arrayBuffer(): ArrayBuffer;
24602480
blob(): Blob;
@@ -2467,7 +2487,10 @@ declare var PushMessageData: {
24672487
new(): PushMessageData;
24682488
};
24692489

2470-
/** This Push API interface provides a subcription's URL endpoint and allows unsubscription from a push service. */
2490+
/**
2491+
* This Push API interface provides a subcription's URL endpoint and allows unsubscription from a push service.
2492+
* Available only in secure contexts.
2493+
*/
24712494
interface PushSubscription {
24722495
readonly endpoint: string;
24732496
readonly options: PushSubscriptionOptions;
@@ -2481,6 +2504,7 @@ declare var PushSubscription: {
24812504
new(): PushSubscription;
24822505
};
24832506

2507+
/** Available only in secure contexts. */
24842508
interface PushSubscriptionOptions {
24852509
readonly applicationServerKey: ArrayBuffer | null;
24862510
}
@@ -2498,7 +2522,6 @@ interface ReadableStream<R = any> {
24982522
pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>;
24992523
pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>;
25002524
tee(): [ReadableStream<R>, ReadableStream<R>];
2501-
forEach(callbackfn: (value: any, key: number, parent: ReadableStream<R>) => void, thisArg?: any): void;
25022525
}
25032526

25042527
declare var ReadableStream: {
@@ -2613,7 +2636,10 @@ interface ServiceWorkerEventMap extends AbstractWorkerEventMap {
26132636
"statechange": Event;
26142637
}
26152638

2616-
/** This ServiceWorker API interface provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object. */
2639+
/**
2640+
* This ServiceWorker API interface provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object.
2641+
* Available only in secure contexts.
2642+
*/
26172643
interface ServiceWorker extends EventTarget, AbstractWorker {
26182644
onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;
26192645
readonly scriptURL: string;
@@ -2637,7 +2663,10 @@ interface ServiceWorkerContainerEventMap {
26372663
"messageerror": MessageEvent;
26382664
}
26392665

2640-
/** The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations. */
2666+
/**
2667+
* The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations.
2668+
* Available only in secure contexts.
2669+
*/
26412670
interface ServiceWorkerContainer extends EventTarget {
26422671
readonly controller: ServiceWorker | null;
26432672
oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null;
@@ -2698,7 +2727,10 @@ interface ServiceWorkerRegistrationEventMap {
26982727
"updatefound": Event;
26992728
}
27002729

2701-
/** This ServiceWorker API interface represents the service worker registration. You register a service worker to control one or more pages that share the same origin. */
2730+
/**
2731+
* This ServiceWorker API interface represents the service worker registration. You register a service worker to control one or more pages that share the same origin.
2732+
* Available only in secure contexts.
2733+
*/
27022734
interface ServiceWorkerRegistration extends EventTarget {
27032735
readonly active: ServiceWorker | null;
27042736
readonly installing: ServiceWorker | null;
@@ -2743,6 +2775,7 @@ declare var SharedWorkerGlobalScope: {
27432775
new(): SharedWorkerGlobalScope;
27442776
};
27452777

2778+
/** Available only in secure contexts. */
27462779
interface StorageManager {
27472780
estimate(): Promise<StorageEstimate>;
27482781
persisted(): Promise<boolean>;
@@ -2753,7 +2786,10 @@ declare var StorageManager: {
27532786
new(): StorageManager;
27542787
};
27552788

2756-
/** This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). */
2789+
/**
2790+
* This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).
2791+
* Available only in secure contexts.
2792+
*/
27572793
interface SubtleCrypto {
27582794
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
27592795
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
@@ -5030,6 +5066,7 @@ declare var WindowClient: {
50305066
};
50315067

50325068
interface WindowOrWorkerGlobalScope {
5069+
/** Available only in secure contexts. */
50335070
readonly caches: CacheStorage;
50345071
readonly crossOriginIsolated: boolean;
50355072
readonly crypto: Crypto;
@@ -5352,7 +5389,8 @@ declare namespace WebAssembly {
53525389

53535390
var CompileError: {
53545391
prototype: CompileError;
5355-
new(): CompileError;
5392+
new(message?: string): CompileError;
5393+
(message?: string): CompileError;
53565394
};
53575395

53585396
interface Global {
@@ -5379,7 +5417,8 @@ declare namespace WebAssembly {
53795417

53805418
var LinkError: {
53815419
prototype: LinkError;
5382-
new(): LinkError;
5420+
new(message?: string): LinkError;
5421+
(message?: string): LinkError;
53835422
};
53845423

53855424
interface Memory {
@@ -5408,7 +5447,8 @@ declare namespace WebAssembly {
54085447

54095448
var RuntimeError: {
54105449
prototype: RuntimeError;
5411-
new(): RuntimeError;
5450+
new(message?: string): RuntimeError;
5451+
(message?: string): RuntimeError;
54125452
};
54135453

54145454
interface Table {
@@ -5485,7 +5525,7 @@ interface PerformanceObserverCallback {
54855525
}
54865526

54875527
interface QueuingStrategySize<T = any> {
5488-
(chunk?: T): number;
5528+
(chunk: T): number;
54895529
}
54905530

54915531
interface TransformerFlushCallback<O> {
@@ -5560,6 +5600,7 @@ declare function importScripts(...urls: (string | URL)[]): void;
55605600
/** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
55615601
declare function dispatchEvent(event: Event): boolean;
55625602
declare var fonts: FontFaceSet;
5603+
/** Available only in secure contexts. */
55635604
declare var caches: CacheStorage;
55645605
declare var crossOriginIsolated: boolean;
55655606
declare var crypto: Crypto;
@@ -5648,7 +5689,7 @@ type MediaDecodingType = "file" | "media-source" | "webrtc";
56485689
type MediaEncodingType = "record" | "webrtc";
56495690
type NotificationDirection = "auto" | "ltr" | "rtl";
56505691
type NotificationPermission = "default" | "denied" | "granted";
5651-
type PermissionName = "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock";
5692+
type PermissionName = "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "xr-spatial-tracking";
56525693
type PermissionState = "denied" | "granted" | "prompt";
56535694
type PredefinedColorSpace = "display-p3" | "srgb";
56545695
type PremultiplyAlpha = "default" | "none" | "premultiply";

src/lib/webworker.iterable.generated.d.ts

-7
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@ interface MessageEvent<T = any> {
5656
initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
5757
}
5858

59-
interface ReadableStream<R = any> {
60-
[Symbol.iterator](): IterableIterator<any>;
61-
entries(): IterableIterator<[number, any]>;
62-
keys(): IterableIterator<number>;
63-
values(): IterableIterator<any>;
64-
}
65-
6659
interface SubtleCrypto {
6760
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
6861
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;

tests/baselines/reference/extendArray.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ tests/cases/compiler/extendArray.ts(7,32): error TS2552: Cannot find name '_elem
1212
collect(fn:(e:_element) => _element[]) : any[];
1313
~~~~~~~~
1414
!!! error TS2552: Cannot find name '_element'. Did you mean 'Element'?
15-
!!! related TS2728 /.ts/lib.dom.d.ts:4792:13: 'Element' is declared here.
15+
!!! related TS2728 /.ts/lib.dom.d.ts:4829:13: 'Element' is declared here.
1616
~~~~~~~~
1717
!!! error TS2552: Cannot find name '_element'. Did you mean 'Element'?
18-
!!! related TS2728 /.ts/lib.dom.d.ts:4792:13: 'Element' is declared here.
18+
!!! related TS2728 /.ts/lib.dom.d.ts:4829:13: 'Element' is declared here.
1919
}
2020
}
2121

0 commit comments

Comments
 (0)