@@ -1273,12 +1273,24 @@ declare var DOMStringList: {
12731273
12741274interface DedicatedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {
12751275 "message" : MessageEvent ;
1276+ "messageerror" : MessageEvent ;
12761277}
12771278
12781279/** (the Worker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See also: Functions available to workers. */
12791280interface DedicatedWorkerGlobalScope extends WorkerGlobalScope , AnimationFrameProvider {
1281+ /**
1282+ * Returns dedicatedWorkerGlobal's name, i.e. the value given to the Worker constructor. Primarily useful for debugging.
1283+ */
1284+ readonly name : string ;
12801285 onmessage : ( ( this : DedicatedWorkerGlobalScope , ev : MessageEvent ) => any ) | null ;
1286+ onmessageerror : ( ( this : DedicatedWorkerGlobalScope , ev : MessageEvent ) => any ) | null ;
1287+ /**
1288+ * Aborts dedicatedWorkerGlobal.
1289+ */
12811290 close ( ) : void ;
1291+ /**
1292+ * Clones message and transmits it to the Worker object associated with dedicatedWorkerGlobal. transfer can be passed as a list of objects that are to be transferred rather than cloned.
1293+ */
12821294 postMessage ( message : any , transfer : Transferable [ ] ) : void ;
12831295 postMessage ( message : any , options ?: PostMessageOptions ) : void ;
12841296 addEventListener < K extends keyof DedicatedWorkerGlobalScopeEventMap > ( type : K , listener : ( this : DedicatedWorkerGlobalScope , ev : DedicatedWorkerGlobalScopeEventMap [ K ] ) => any , options ?: boolean | AddEventListenerOptions ) : void ;
@@ -2318,10 +2330,6 @@ declare var NavigationPreloadManager: {
23182330 new ( ) : NavigationPreloadManager ;
23192331} ;
23202332
2321- interface NavigatorBeacon {
2322- sendBeacon ( url : string , data ?: Blob | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | FormData | string | null ) : boolean ;
2323- }
2324-
23252333interface NavigatorConcurrentHardware {
23262334 readonly hardwareConcurrency : number ;
23272335}
@@ -2335,6 +2343,11 @@ interface NavigatorID {
23352343 readonly userAgent : string ;
23362344}
23372345
2346+ interface NavigatorLanguage {
2347+ readonly language : string ;
2348+ readonly languages : ReadonlyArray < string > ;
2349+ }
2350+
23382351interface NavigatorOnLine {
23392352 readonly onLine : boolean ;
23402353}
@@ -3001,6 +3014,47 @@ declare var ServiceWorkerRegistration: {
30013014 new ( ) : ServiceWorkerRegistration ;
30023015} ;
30033016
3017+ interface SharedWorker extends EventTarget , AbstractWorker {
3018+ /**
3019+ * Returns sharedWorker's MessagePort object which can be used to communicate with the global environment.
3020+ */
3021+ readonly port : MessagePort ;
3022+ addEventListener < K extends keyof AbstractWorkerEventMap > ( type : K , listener : ( this : SharedWorker , ev : AbstractWorkerEventMap [ K ] ) => any , options ?: boolean | AddEventListenerOptions ) : void ;
3023+ addEventListener ( type : string , listener : EventListenerOrEventListenerObject , options ?: boolean | AddEventListenerOptions ) : void ;
3024+ removeEventListener < K extends keyof AbstractWorkerEventMap > ( type : K , listener : ( this : SharedWorker , ev : AbstractWorkerEventMap [ K ] ) => any , options ?: boolean | EventListenerOptions ) : void ;
3025+ removeEventListener ( type : string , listener : EventListenerOrEventListenerObject , options ?: boolean | EventListenerOptions ) : void ;
3026+ }
3027+
3028+ declare var SharedWorker : {
3029+ prototype : SharedWorker ;
3030+ new ( scriptURL : string , options ?: string | WorkerOptions ) : SharedWorker ;
3031+ } ;
3032+
3033+ interface SharedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {
3034+ "connect" : MessageEvent ;
3035+ }
3036+
3037+ interface SharedWorkerGlobalScope extends WorkerGlobalScope {
3038+ /**
3039+ * Returns sharedWorkerGlobal's name, i.e. the value given to the SharedWorker constructor. Multiple SharedWorker objects can correspond to the same shared worker (and SharedWorkerGlobalScope), by reusing the same name.
3040+ */
3041+ readonly name : string ;
3042+ onconnect : ( ( this : SharedWorkerGlobalScope , ev : MessageEvent ) => any ) | null ;
3043+ /**
3044+ * Aborts sharedWorkerGlobal.
3045+ */
3046+ close ( ) : void ;
3047+ addEventListener < K extends keyof SharedWorkerGlobalScopeEventMap > ( type : K , listener : ( this : SharedWorkerGlobalScope , ev : SharedWorkerGlobalScopeEventMap [ K ] ) => any , options ?: boolean | AddEventListenerOptions ) : void ;
3048+ addEventListener ( type : string , listener : EventListenerOrEventListenerObject , options ?: boolean | AddEventListenerOptions ) : void ;
3049+ removeEventListener < K extends keyof SharedWorkerGlobalScopeEventMap > ( type : K , listener : ( this : SharedWorkerGlobalScope , ev : SharedWorkerGlobalScopeEventMap [ K ] ) => any , options ?: boolean | EventListenerOptions ) : void ;
3050+ removeEventListener ( type : string , listener : EventListenerOrEventListenerObject , options ?: boolean | EventListenerOptions ) : void ;
3051+ }
3052+
3053+ declare var SharedWorkerGlobalScope : {
3054+ prototype : SharedWorkerGlobalScope ;
3055+ new ( ) : SharedWorkerGlobalScope ;
3056+ } ;
3057+
30043058interface StorageManager {
30053059 estimate ( ) : Promise < StorageEstimate > ;
30063060 persisted ( ) : Promise < boolean > ;
@@ -5342,11 +5396,6 @@ declare var WebSocket: {
53425396 readonly OPEN : number ;
53435397} ;
53445398
5345- interface WindowBase64 {
5346- atob ( encodedString : string ) : string ;
5347- btoa ( rawString : string ) : string ;
5348- }
5349-
53505399/** This ServiceWorker API interface represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. The service worker client independently selects and uses a service worker for its own loading and sub-resources. */
53515400interface WindowClient extends Client {
53525401 readonly ancestorOrigins : ReadonlyArray < string > ;
@@ -5369,6 +5418,7 @@ interface WindowOrWorkerGlobalScope {
53695418 readonly caches : CacheStorage ;
53705419 readonly crypto : Crypto ;
53715420 readonly indexedDB : IDBFactory ;
5421+ readonly isSecureContext : boolean ;
53725422 readonly origin : string ;
53735423 readonly performance : Performance ;
53745424 atob ( data : string ) : string ;
@@ -5385,13 +5435,21 @@ interface WindowOrWorkerGlobalScope {
53855435
53865436interface WorkerEventMap extends AbstractWorkerEventMap {
53875437 "message" : MessageEvent ;
5438+ "messageerror" : MessageEvent ;
53885439}
53895440
53905441/** This Web Workers API interface represents a background task that can be easily created and can send messages back to its creator. Creating a worker is as simple as calling the Worker() constructor and specifying a script to be run in the worker thread. */
53915442interface Worker extends EventTarget , AbstractWorker {
53925443 onmessage : ( ( this : Worker , ev : MessageEvent ) => any ) | null ;
5444+ onmessageerror : ( ( this : Worker , ev : MessageEvent ) => any ) | null ;
5445+ /**
5446+ * Clones message and transmits it to worker's global environment. transfer can be passed as a list of objects that are to be transferred rather than cloned.
5447+ */
53935448 postMessage ( message : any , transfer : Transferable [ ] ) : void ;
53945449 postMessage ( message : any , options ?: PostMessageOptions ) : void ;
5450+ /**
5451+ * Aborts worker's associated global environment.
5452+ */
53955453 terminate ( ) : void ;
53965454 addEventListener < K extends keyof WorkerEventMap > ( type : K , listener : ( this : Worker , ev : WorkerEventMap [ K ] ) => any , options ?: boolean | AddEventListenerOptions ) : void ;
53975455 addEventListener ( type : string , listener : EventListenerOrEventListenerObject , options ?: boolean | AddEventListenerOptions ) : void ;
@@ -5406,17 +5464,34 @@ declare var Worker: {
54065464
54075465interface WorkerGlobalScopeEventMap {
54085466 "error" : ErrorEvent ;
5467+ "languagechange" : Event ;
5468+ "offline" : Event ;
5469+ "online" : Event ;
5470+ "rejectionhandled" : PromiseRejectionEvent ;
5471+ "unhandledrejection" : PromiseRejectionEvent ;
54095472}
54105473
54115474/** This Web Workers API interface is an interface representing the scope of any worker. Workers have no browsing context; this scope contains the information usually conveyed by Window objects — in this case event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop. */
5412- interface WorkerGlobalScope extends EventTarget , WindowConsole , WindowOrWorkerGlobalScope , WorkerUtils {
5413- readonly caches : CacheStorage ;
5414- readonly isSecureContext : boolean ;
5475+ interface WorkerGlobalScope extends EventTarget , WindowConsole , WindowOrWorkerGlobalScope {
5476+ /**
5477+ * Returns workerGlobal's WorkerLocation object.
5478+ */
54155479 readonly location : WorkerLocation ;
5480+ readonly navigator : WorkerNavigator ;
54165481 onerror : ( ( this : WorkerGlobalScope , ev : ErrorEvent ) => any ) | null ;
5417- readonly performance : Performance ;
5482+ onlanguagechange : ( ( this : WorkerGlobalScope , ev : Event ) => any ) | null ;
5483+ onoffline : ( ( this : WorkerGlobalScope , ev : Event ) => any ) | null ;
5484+ ononline : ( ( this : WorkerGlobalScope , ev : Event ) => any ) | null ;
5485+ onrejectionhandled : ( ( this : WorkerGlobalScope , ev : PromiseRejectionEvent ) => any ) | null ;
5486+ onunhandledrejection : ( ( this : WorkerGlobalScope , ev : PromiseRejectionEvent ) => any ) | null ;
5487+ /**
5488+ * Returns workerGlobal.
5489+ */
54185490 readonly self : WorkerGlobalScope & typeof globalThis ;
5419- msWriteProfilerMark ( profilerMarkName : string ) : void ;
5491+ /**
5492+ * Fetches each URL in urls, executes them one-by-one in the order they are passed, and then returns (or throws if something went amiss).
5493+ */
5494+ importScripts ( ...urls : string [ ] ) : void ;
54205495 addEventListener < K extends keyof WorkerGlobalScopeEventMap > ( type : K , listener : ( this : WorkerGlobalScope , ev : WorkerGlobalScopeEventMap [ K ] ) => any , options ?: boolean | AddEventListenerOptions ) : void ;
54215496 addEventListener ( type : string , listener : EventListenerOrEventListenerObject , options ?: boolean | AddEventListenerOptions ) : void ;
54225497 removeEventListener < K extends keyof WorkerGlobalScopeEventMap > ( type : K , listener : ( this : WorkerGlobalScope , ev : WorkerGlobalScopeEventMap [ K ] ) => any , options ?: boolean | EventListenerOptions ) : void ;
@@ -5448,7 +5523,7 @@ declare var WorkerLocation: {
54485523} ;
54495524
54505525/** A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator. */
5451- interface WorkerNavigator extends NavigatorBeacon , NavigatorConcurrentHardware , NavigatorID , NavigatorOnLine , NavigatorStorage {
5526+ interface WorkerNavigator extends NavigatorConcurrentHardware , NavigatorID , NavigatorLanguage , NavigatorOnLine , NavigatorStorage {
54525527 readonly permissions : Permissions ;
54535528 readonly serviceWorker : ServiceWorkerContainer ;
54545529}
@@ -5458,13 +5533,6 @@ declare var WorkerNavigator: {
54585533 new ( ) : WorkerNavigator ;
54595534} ;
54605535
5461- interface WorkerUtils extends WindowBase64 {
5462- readonly indexedDB : IDBFactory ;
5463- readonly msIndexedDB : IDBFactory ;
5464- readonly navigator : WorkerNavigator ;
5465- importScripts ( ...urls : string [ ] ) : void ;
5466- }
5467-
54685536/** This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing. */
54695537interface WritableStream < W = any > {
54705538 readonly locked : boolean ;
@@ -5747,14 +5815,14 @@ declare namespace WebAssembly {
57475815 function validate ( bytes : BufferSource ) : boolean ;
57485816}
57495817
5750- interface EventHandlerNonNull {
5751- ( event : Event ) : any ;
5752- }
5753-
57545818interface FrameRequestCallback {
57555819 ( time : number ) : void ;
57565820}
57575821
5822+ interface OnErrorEventHandlerNonNull {
5823+ ( event : Event | string , source ?: string , lineno ?: number , colno ?: number , error ?: Error ) : any ;
5824+ }
5825+
57585826interface PerformanceObserverCallback {
57595827 ( entries : PerformanceObserverEntryList , observer : PerformanceObserver ) : void ;
57605828}
@@ -5803,35 +5871,52 @@ interface WritableStreamErrorCallback {
58035871 ( reason : any ) : void | PromiseLike < void > ;
58045872}
58055873
5874+ /**
5875+ * Returns dedicatedWorkerGlobal's name, i.e. the value given to the Worker constructor. Primarily useful for debugging.
5876+ */
5877+ declare var name : string ;
58065878declare var onmessage : ( ( this : DedicatedWorkerGlobalScope , ev : MessageEvent ) => any ) | null ;
5879+ declare var onmessageerror : ( ( this : DedicatedWorkerGlobalScope , ev : MessageEvent ) => any ) | null ;
5880+ /**
5881+ * Aborts dedicatedWorkerGlobal.
5882+ */
58075883declare function close ( ) : void ;
5884+ /**
5885+ * Clones message and transmits it to the Worker object associated with dedicatedWorkerGlobal. transfer can be passed as a list of objects that are to be transferred rather than cloned.
5886+ */
58085887declare function postMessage ( message : any , transfer : Transferable [ ] ) : void ;
58095888declare function postMessage ( message : any , options ?: PostMessageOptions ) : void ;
58105889/**
58115890 * 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.
58125891 */
58135892declare function dispatchEvent ( event : Event ) : boolean ;
5814- declare var caches : CacheStorage ;
5815- declare var isSecureContext : boolean ;
5893+ /**
5894+ * Returns workerGlobal's WorkerLocation object.
5895+ */
58165896declare var location : WorkerLocation ;
5897+ declare var navigator : WorkerNavigator ;
58175898declare var onerror : ( ( this : DedicatedWorkerGlobalScope , ev : ErrorEvent ) => any ) | null ;
5818- declare var performance : Performance ;
5899+ declare var onlanguagechange : ( ( this : DedicatedWorkerGlobalScope , ev : Event ) => any ) | null ;
5900+ declare var onoffline : ( ( this : DedicatedWorkerGlobalScope , ev : Event ) => any ) | null ;
5901+ declare var ononline : ( ( this : DedicatedWorkerGlobalScope , ev : Event ) => any ) | null ;
5902+ declare var onrejectionhandled : ( ( this : DedicatedWorkerGlobalScope , ev : PromiseRejectionEvent ) => any ) | null ;
5903+ declare var onunhandledrejection : ( ( this : DedicatedWorkerGlobalScope , ev : PromiseRejectionEvent ) => any ) | null ;
5904+ /**
5905+ * Returns workerGlobal.
5906+ */
58195907declare var self : WorkerGlobalScope & typeof globalThis ;
5820- declare function msWriteProfilerMark ( profilerMarkName : string ) : void ;
5908+ /**
5909+ * Fetches each URL in urls, executes them one-by-one in the order they are passed, and then returns (or throws if something went amiss).
5910+ */
5911+ declare function importScripts ( ...urls : string [ ] ) : void ;
58215912/**
58225913 * 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.
58235914 */
58245915declare function dispatchEvent ( event : Event ) : boolean ;
5825- declare var indexedDB : IDBFactory ;
5826- declare var msIndexedDB : IDBFactory ;
5827- declare var navigator : WorkerNavigator ;
5828- declare function importScripts ( ...urls : string [ ] ) : void ;
5829- declare function atob ( encodedString : string ) : string ;
5830- declare function btoa ( rawString : string ) : string ;
5831- declare var console : Console ;
58325916declare var caches : CacheStorage ;
58335917declare var crypto : Crypto ;
58345918declare var indexedDB : IDBFactory ;
5919+ declare var isSecureContext : boolean ;
58355920declare var origin : string ;
58365921declare var performance : Performance ;
58375922declare function atob ( data : string ) : string ;
@@ -5844,6 +5929,7 @@ declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response
58445929declare function queueMicrotask ( callback : VoidFunction ) : void ;
58455930declare function setInterval ( handler : TimerHandler , timeout ?: number , ...arguments : any [ ] ) : number ;
58465931declare function setTimeout ( handler : TimerHandler , timeout ?: number , ...arguments : any [ ] ) : number ;
5932+ declare var console : Console ;
58475933declare function cancelAnimationFrame ( handle : number ) : void ;
58485934declare function requestAnimationFrame ( callback : FrameRequestCallback ) : number ;
58495935declare function addEventListener < K extends keyof DedicatedWorkerGlobalScopeEventMap > ( type : K , listener : ( this : DedicatedWorkerGlobalScope , ev : DedicatedWorkerGlobalScopeEventMap [ K ] ) => any , options ?: boolean | AddEventListenerOptions ) : void ;
@@ -5859,6 +5945,7 @@ type CanvasImageSource = ImageBitmap | OffscreenCanvas;
58595945type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext ;
58605946type MessageEventSource = MessagePort | ServiceWorker ;
58615947type ImageBitmapSource = CanvasImageSource | Blob | ImageData ;
5948+ type OnErrorEventHandler = OnErrorEventHandlerNonNull | null ;
58625949type TimerHandler = string | Function ;
58635950type PerformanceEntryList = PerformanceEntry [ ] ;
58645951type PushMessageDataInit = BufferSource | string ;
0 commit comments