npm package diff

Package: @cloudflare/workers-types

Versions: 4.20230419.0 - 4.20230511.0

File: package/experimental/index.d.ts

Index: package/experimental/index.d.ts
===================================================================
--- package/experimental/index.d.ts
+++ package/experimental/index.d.ts
@@ -183,8 +183,10 @@
   self: ServiceWorkerGlobalScope;
   crypto: Crypto;
   caches: CacheStorage;
   scheduler: Scheduler;
+  performance: Performance;
+  readonly origin: string;
   Event: typeof Event;
   ExtendableEvent: typeof ExtendableEvent;
   PromiseRejectionEvent: typeof PromiseRejectionEvent;
   FetchEvent: typeof FetchEvent;
@@ -286,8 +288,10 @@
 declare const self: ServiceWorkerGlobalScope;
 declare const crypto: Crypto;
 declare const caches: CacheStorage;
 declare const scheduler: Scheduler;
+declare const performance: Performance;
+declare const origin: string;
 declare const navigator: Navigator;
 declare interface TestController {}
 declare interface ExecutionContext {
   waitUntil(promise: Promise<any>): void;
@@ -347,8 +351,13 @@
 }
 declare abstract class Navigator {
   readonly userAgent: string;
 }
+/** Provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API. */
+declare interface Performance {
+  readonly timeOrigin: number;
+  now(): number;
+}
 declare interface DurableObject {
   fetch(request: Request): Response | Promise<Response>;
   alarm?(): void | Promise<void>;
 }
@@ -398,8 +407,11 @@
   waitUntil(promise: Promise<any>): void;
   readonly id: DurableObjectId;
   readonly storage: DurableObjectStorage;
   blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
+  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
+  getWebSockets(tag?: string): WebSocket[];
+  abort(reason?: string): void;
 }
 declare interface DurableObjectTransaction {
   get<T = unknown>(
     key: string,
@@ -574,8 +586,9 @@
 }
 declare abstract class AbortSignal extends EventTarget {
   static abort(reason?: any): AbortSignal;
   static timeout(delay: number): AbortSignal;
+  static any(signals: AbortSignal[]): AbortSignal;
   get aborted(): boolean;
   get reason(): any;
   throwIfAborted(): void;
 }
@@ -1858,8 +1871,10 @@
   constructor(url: string, protocols?: string[] | string);
   accept(): void;
   send(message: (ArrayBuffer | ArrayBufferView) | string): void;
   close(code?: number, reason?: string): void;
+  serializeAttachment(attachment: any): void;
+  deserializeAttachment(): any | null;
   static readonly READY_STATE_CONNECTING: number;
   static readonly READY_STATE_OPEN: number;
   static readonly READY_STATE_CLOSING: number;
   static readonly READY_STATE_CLOSED: number;
@@ -1876,8 +1891,11 @@
 };
 declare interface SqlStorage {
   exec(query: string, ...bindings: any[]): SqlStorageCursor;
   prepare(query: string): SqlStorageStatement;
+  get databaseSize(): number;
+  get voluntarySizeLimit(): number;
+  set voluntarySizeLimit(value: number);
   Cursor: typeof SqlStorageCursor;
   Statement: typeof SqlStorageStatement;
 }
 declare abstract class SqlStorageStatement {}