Workers Types Diff

2022-03-21

Below is the change introduced in this compatibility date:

===================================================================
--- 2022-01-31
+++ 2022-03-21
@@ -212,8 +212,10 @@
   AbortController: typeof AbortController;
   AbortSignal: typeof AbortSignal;
   TextDecoder: typeof TextDecoder;
   TextEncoder: typeof TextEncoder;
+  navigator: Navigator;
+  Navigator: typeof Navigator;
   URL: typeof URL;
   URLSearchParams: typeof URLSearchParams;
   URLPattern: typeof URLPattern;
   Blob: typeof Blob;
@@ -278,8 +280,9 @@
 declare const self: ServiceWorkerGlobalScope;
 declare const crypto: Crypto;
 declare const caches: CacheStorage;
 declare const scheduler: Scheduler;
+declare const navigator: Navigator;
 declare interface ExecutionContext {
   waitUntil(promise: Promise<any>): void;
   passThroughOnException(): void;
 }
@@ -315,8 +318,11 @@
 declare abstract class PromiseRejectionEvent extends Event {
   readonly promise: Promise<any>;
   readonly reason: any;
 }
+declare abstract class Navigator {
+  readonly userAgent: string;
+}
 declare interface DurableObject {
   fetch(request: Request): Response | Promise<Response>;
   alarm?(): void | Promise<void>;
 }