npm package diff
Package: @cloudflare/workers-types
Versions: 4.20230419.0 - 4.20230511.0
File: package/experimental/index.ts
Index: package/experimental/index.ts
===================================================================
--- package/experimental/index.ts
+++ package/experimental/index.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;
@@ -288,8 +290,10 @@
export declare const self: ServiceWorkerGlobalScope;
export declare const crypto: Crypto;
export declare const caches: CacheStorage;
export declare const scheduler: Scheduler;
+export declare const performance: Performance;
+export declare const origin: string;
export declare const navigator: Navigator;
export interface TestController {}
export interface ExecutionContext {
waitUntil(promise: Promise<any>): void;
@@ -349,8 +353,13 @@
}
export 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. */
+export interface Performance {
+ readonly timeOrigin: number;
+ now(): number;
+}
export interface DurableObject {
fetch(request: Request): Response | Promise<Response>;
alarm?(): void | Promise<void>;
}
@@ -400,8 +409,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;
}
export interface DurableObjectTransaction {
get<T = unknown>(
key: string,
@@ -576,8 +588,9 @@
}
export 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;
}
@@ -1863,8 +1876,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;
@@ -1881,8 +1896,11 @@
};
export 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;
}
export declare abstract class SqlStorageStatement {}