@cloudflare/workers-types 0.20230404.0 → 0.20230512.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2021-11-03/index.d.ts +44 -2
- package/2021-11-03/index.ts +44 -2
- package/2022-01-31/index.d.ts +44 -2
- package/2022-01-31/index.ts +44 -2
- package/2022-03-21/index.d.ts +44 -2
- package/2022-03-21/index.ts +44 -2
- package/2022-08-04/index.d.ts +44 -2
- package/2022-08-04/index.ts +44 -2
- package/2022-10-31/index.d.ts +46 -4
- package/2022-10-31/index.ts +46 -4
- package/2022-11-30/index.d.ts +46 -4
- package/2022-11-30/index.ts +46 -4
- package/experimental/index.d.ts +31 -4
- package/experimental/index.ts +31 -4
- package/index.d.ts +44 -2
- package/index.ts +44 -2
- package/oldest/index.d.ts +44 -2
- package/oldest/index.ts +44 -2
- package/package.json +1 -1
package/2022-11-30/index.d.ts
CHANGED
|
@@ -184,11 +184,14 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
184
184
|
crypto: Crypto;
|
|
185
185
|
caches: CacheStorage;
|
|
186
186
|
scheduler: Scheduler;
|
|
187
|
+
performance: Performance;
|
|
188
|
+
readonly origin: string;
|
|
187
189
|
Event: typeof Event;
|
|
188
190
|
ExtendableEvent: typeof ExtendableEvent;
|
|
189
191
|
PromiseRejectionEvent: typeof PromiseRejectionEvent;
|
|
190
192
|
FetchEvent: typeof FetchEvent;
|
|
191
|
-
|
|
193
|
+
TailEvent: typeof TailEvent;
|
|
194
|
+
TraceEvent: typeof TailEvent;
|
|
192
195
|
ScheduledEvent: typeof ScheduledEvent;
|
|
193
196
|
MessageEvent: typeof MessageEvent;
|
|
194
197
|
CloseEvent: typeof CloseEvent;
|
|
@@ -286,6 +289,8 @@ declare const self: ServiceWorkerGlobalScope;
|
|
|
286
289
|
declare const crypto: Crypto;
|
|
287
290
|
declare const caches: CacheStorage;
|
|
288
291
|
declare const scheduler: Scheduler;
|
|
292
|
+
declare const performance: Performance;
|
|
293
|
+
declare const origin: string;
|
|
289
294
|
declare const navigator: Navigator;
|
|
290
295
|
declare interface TestController {}
|
|
291
296
|
declare interface ExecutionContext {
|
|
@@ -300,6 +305,11 @@ declare type ExportedHandlerFetchHandler<
|
|
|
300
305
|
env: Env,
|
|
301
306
|
ctx: ExecutionContext
|
|
302
307
|
) => Response | Promise<Response>;
|
|
308
|
+
declare type ExportedHandlerTailHandler<Env = unknown> = (
|
|
309
|
+
events: TraceItem[],
|
|
310
|
+
env: Env,
|
|
311
|
+
ctx: ExecutionContext
|
|
312
|
+
) => void | Promise<void>;
|
|
303
313
|
declare type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
304
314
|
traces: TraceItem[],
|
|
305
315
|
env: Env,
|
|
@@ -326,6 +336,7 @@ declare interface ExportedHandler<
|
|
|
326
336
|
CfHostMetadata = unknown
|
|
327
337
|
> {
|
|
328
338
|
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
339
|
+
tail?: ExportedHandlerTailHandler<Env>;
|
|
329
340
|
trace?: ExportedHandlerTraceHandler<Env>;
|
|
330
341
|
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
331
342
|
test?: ExportedHandlerTestHandler<Env>;
|
|
@@ -341,6 +352,11 @@ declare abstract class PromiseRejectionEvent extends Event {
|
|
|
341
352
|
declare abstract class Navigator {
|
|
342
353
|
readonly userAgent: string;
|
|
343
354
|
}
|
|
355
|
+
/** 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. */
|
|
356
|
+
declare interface Performance {
|
|
357
|
+
readonly timeOrigin: number;
|
|
358
|
+
now(): number;
|
|
359
|
+
}
|
|
344
360
|
declare interface DurableObject {
|
|
345
361
|
fetch(request: Request): Response | Promise<Response>;
|
|
346
362
|
alarm?(): void | Promise<void>;
|
|
@@ -388,6 +404,8 @@ declare interface DurableObjectState {
|
|
|
388
404
|
readonly id: DurableObjectId;
|
|
389
405
|
readonly storage: DurableObjectStorage;
|
|
390
406
|
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
407
|
+
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
|
|
408
|
+
getWebSockets(tag?: string): WebSocket[];
|
|
391
409
|
}
|
|
392
410
|
declare interface DurableObjectTransaction {
|
|
393
411
|
get<T = unknown>(
|
|
@@ -454,6 +472,7 @@ declare interface DurableObjectStorage {
|
|
|
454
472
|
): Promise<void>;
|
|
455
473
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
456
474
|
sync(): Promise<void>;
|
|
475
|
+
transactionSync<T>(closure: () => T): T;
|
|
457
476
|
}
|
|
458
477
|
declare interface DurableObjectListOptions {
|
|
459
478
|
start?: string;
|
|
@@ -563,6 +582,7 @@ declare class AbortController {
|
|
|
563
582
|
declare abstract class AbortSignal extends EventTarget {
|
|
564
583
|
static abort(reason?: any): AbortSignal;
|
|
565
584
|
static timeout(delay: number): AbortSignal;
|
|
585
|
+
static any(signals: AbortSignal[]): AbortSignal;
|
|
566
586
|
get aborted(): boolean;
|
|
567
587
|
get reason(): any;
|
|
568
588
|
throwIfAborted(): void;
|
|
@@ -1049,6 +1069,7 @@ declare interface RequestInit<Cf = CfProperties> {
|
|
|
1049
1069
|
}
|
|
1050
1070
|
declare abstract class Fetcher {
|
|
1051
1071
|
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
1072
|
+
connect(address: SocketAddress | string, options?: SocketOptions): Socket;
|
|
1052
1073
|
}
|
|
1053
1074
|
declare interface FetcherPutOptions {
|
|
1054
1075
|
expiration?: number;
|
|
@@ -1621,7 +1642,8 @@ declare interface QueuingStrategyInit {
|
|
|
1621
1642
|
*/
|
|
1622
1643
|
highWaterMark: number;
|
|
1623
1644
|
}
|
|
1624
|
-
declare abstract class
|
|
1645
|
+
declare abstract class TailEvent extends ExtendableEvent {
|
|
1646
|
+
readonly events: TraceItem[];
|
|
1625
1647
|
readonly traces: TraceItem[];
|
|
1626
1648
|
}
|
|
1627
1649
|
declare interface TraceItem {
|
|
@@ -1725,10 +1747,10 @@ declare class URLSearchParams {
|
|
|
1725
1747
|
);
|
|
1726
1748
|
get size(): number;
|
|
1727
1749
|
append(name: string, value: string): void;
|
|
1728
|
-
delete(name: string): void;
|
|
1750
|
+
delete(name: string, value?: any): void;
|
|
1729
1751
|
get(name: string): string | null;
|
|
1730
1752
|
getAll(name: string): string[];
|
|
1731
|
-
has(name: string): boolean;
|
|
1753
|
+
has(name: string, value?: any): boolean;
|
|
1732
1754
|
set(name: string, value: string): void;
|
|
1733
1755
|
sort(): void;
|
|
1734
1756
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
@@ -1828,6 +1850,8 @@ declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
1828
1850
|
accept(): void;
|
|
1829
1851
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
|
1830
1852
|
close(code?: number, reason?: string): void;
|
|
1853
|
+
serializeAttachment(attachment: any): void;
|
|
1854
|
+
deserializeAttachment(): any | null;
|
|
1831
1855
|
static readonly READY_STATE_CONNECTING: number;
|
|
1832
1856
|
static readonly READY_STATE_OPEN: number;
|
|
1833
1857
|
static readonly READY_STATE_CLOSING: number;
|
|
@@ -1843,6 +1867,24 @@ declare const WebSocketPair: {
|
|
|
1843
1867
|
1: WebSocket;
|
|
1844
1868
|
};
|
|
1845
1869
|
};
|
|
1870
|
+
declare interface Socket {
|
|
1871
|
+
get readable(): ReadableStream;
|
|
1872
|
+
get writable(): WritableStream;
|
|
1873
|
+
get closed(): Promise<void>;
|
|
1874
|
+
close(): Promise<void>;
|
|
1875
|
+
startTls(options?: TlsOptions): Socket;
|
|
1876
|
+
}
|
|
1877
|
+
declare interface SocketOptions {
|
|
1878
|
+
secureTransport?: string;
|
|
1879
|
+
allowHalfOpen: boolean;
|
|
1880
|
+
}
|
|
1881
|
+
declare interface SocketAddress {
|
|
1882
|
+
hostname: string;
|
|
1883
|
+
port: number;
|
|
1884
|
+
}
|
|
1885
|
+
declare interface TlsOptions {
|
|
1886
|
+
expectedServerHostname?: string;
|
|
1887
|
+
}
|
|
1846
1888
|
declare interface BasicImageTransformations {
|
|
1847
1889
|
/**
|
|
1848
1890
|
* Maximum width in image pixels. The value must be an integer.
|
package/2022-11-30/index.ts
CHANGED
|
@@ -184,11 +184,14 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
184
184
|
crypto: Crypto;
|
|
185
185
|
caches: CacheStorage;
|
|
186
186
|
scheduler: Scheduler;
|
|
187
|
+
performance: Performance;
|
|
188
|
+
readonly origin: string;
|
|
187
189
|
Event: typeof Event;
|
|
188
190
|
ExtendableEvent: typeof ExtendableEvent;
|
|
189
191
|
PromiseRejectionEvent: typeof PromiseRejectionEvent;
|
|
190
192
|
FetchEvent: typeof FetchEvent;
|
|
191
|
-
|
|
193
|
+
TailEvent: typeof TailEvent;
|
|
194
|
+
TraceEvent: typeof TailEvent;
|
|
192
195
|
ScheduledEvent: typeof ScheduledEvent;
|
|
193
196
|
MessageEvent: typeof MessageEvent;
|
|
194
197
|
CloseEvent: typeof CloseEvent;
|
|
@@ -288,6 +291,8 @@ export declare const self: ServiceWorkerGlobalScope;
|
|
|
288
291
|
export declare const crypto: Crypto;
|
|
289
292
|
export declare const caches: CacheStorage;
|
|
290
293
|
export declare const scheduler: Scheduler;
|
|
294
|
+
export declare const performance: Performance;
|
|
295
|
+
export declare const origin: string;
|
|
291
296
|
export declare const navigator: Navigator;
|
|
292
297
|
export interface TestController {}
|
|
293
298
|
export interface ExecutionContext {
|
|
@@ -302,6 +307,11 @@ export type ExportedHandlerFetchHandler<
|
|
|
302
307
|
env: Env,
|
|
303
308
|
ctx: ExecutionContext
|
|
304
309
|
) => Response | Promise<Response>;
|
|
310
|
+
export type ExportedHandlerTailHandler<Env = unknown> = (
|
|
311
|
+
events: TraceItem[],
|
|
312
|
+
env: Env,
|
|
313
|
+
ctx: ExecutionContext
|
|
314
|
+
) => void | Promise<void>;
|
|
305
315
|
export type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
306
316
|
traces: TraceItem[],
|
|
307
317
|
env: Env,
|
|
@@ -328,6 +338,7 @@ export interface ExportedHandler<
|
|
|
328
338
|
CfHostMetadata = unknown
|
|
329
339
|
> {
|
|
330
340
|
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
341
|
+
tail?: ExportedHandlerTailHandler<Env>;
|
|
331
342
|
trace?: ExportedHandlerTraceHandler<Env>;
|
|
332
343
|
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
333
344
|
test?: ExportedHandlerTestHandler<Env>;
|
|
@@ -343,6 +354,11 @@ export declare abstract class PromiseRejectionEvent extends Event {
|
|
|
343
354
|
export declare abstract class Navigator {
|
|
344
355
|
readonly userAgent: string;
|
|
345
356
|
}
|
|
357
|
+
/** 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. */
|
|
358
|
+
export interface Performance {
|
|
359
|
+
readonly timeOrigin: number;
|
|
360
|
+
now(): number;
|
|
361
|
+
}
|
|
346
362
|
export interface DurableObject {
|
|
347
363
|
fetch(request: Request): Response | Promise<Response>;
|
|
348
364
|
alarm?(): void | Promise<void>;
|
|
@@ -390,6 +406,8 @@ export interface DurableObjectState {
|
|
|
390
406
|
readonly id: DurableObjectId;
|
|
391
407
|
readonly storage: DurableObjectStorage;
|
|
392
408
|
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
409
|
+
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
|
|
410
|
+
getWebSockets(tag?: string): WebSocket[];
|
|
393
411
|
}
|
|
394
412
|
export interface DurableObjectTransaction {
|
|
395
413
|
get<T = unknown>(
|
|
@@ -456,6 +474,7 @@ export interface DurableObjectStorage {
|
|
|
456
474
|
): Promise<void>;
|
|
457
475
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
458
476
|
sync(): Promise<void>;
|
|
477
|
+
transactionSync<T>(closure: () => T): T;
|
|
459
478
|
}
|
|
460
479
|
export interface DurableObjectListOptions {
|
|
461
480
|
start?: string;
|
|
@@ -565,6 +584,7 @@ export declare class AbortController {
|
|
|
565
584
|
export declare abstract class AbortSignal extends EventTarget {
|
|
566
585
|
static abort(reason?: any): AbortSignal;
|
|
567
586
|
static timeout(delay: number): AbortSignal;
|
|
587
|
+
static any(signals: AbortSignal[]): AbortSignal;
|
|
568
588
|
get aborted(): boolean;
|
|
569
589
|
get reason(): any;
|
|
570
590
|
throwIfAborted(): void;
|
|
@@ -1051,6 +1071,7 @@ export interface RequestInit<Cf = CfProperties> {
|
|
|
1051
1071
|
}
|
|
1052
1072
|
export declare abstract class Fetcher {
|
|
1053
1073
|
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
1074
|
+
connect(address: SocketAddress | string, options?: SocketOptions): Socket;
|
|
1054
1075
|
}
|
|
1055
1076
|
export interface FetcherPutOptions {
|
|
1056
1077
|
expiration?: number;
|
|
@@ -1626,7 +1647,8 @@ export interface QueuingStrategyInit {
|
|
|
1626
1647
|
*/
|
|
1627
1648
|
highWaterMark: number;
|
|
1628
1649
|
}
|
|
1629
|
-
export declare abstract class
|
|
1650
|
+
export declare abstract class TailEvent extends ExtendableEvent {
|
|
1651
|
+
readonly events: TraceItem[];
|
|
1630
1652
|
readonly traces: TraceItem[];
|
|
1631
1653
|
}
|
|
1632
1654
|
export interface TraceItem {
|
|
@@ -1730,10 +1752,10 @@ export declare class URLSearchParams {
|
|
|
1730
1752
|
);
|
|
1731
1753
|
get size(): number;
|
|
1732
1754
|
append(name: string, value: string): void;
|
|
1733
|
-
delete(name: string): void;
|
|
1755
|
+
delete(name: string, value?: any): void;
|
|
1734
1756
|
get(name: string): string | null;
|
|
1735
1757
|
getAll(name: string): string[];
|
|
1736
|
-
has(name: string): boolean;
|
|
1758
|
+
has(name: string, value?: any): boolean;
|
|
1737
1759
|
set(name: string, value: string): void;
|
|
1738
1760
|
sort(): void;
|
|
1739
1761
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
@@ -1833,6 +1855,8 @@ export declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
1833
1855
|
accept(): void;
|
|
1834
1856
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
|
1835
1857
|
close(code?: number, reason?: string): void;
|
|
1858
|
+
serializeAttachment(attachment: any): void;
|
|
1859
|
+
deserializeAttachment(): any | null;
|
|
1836
1860
|
static readonly READY_STATE_CONNECTING: number;
|
|
1837
1861
|
static readonly READY_STATE_OPEN: number;
|
|
1838
1862
|
static readonly READY_STATE_CLOSING: number;
|
|
@@ -1848,6 +1872,24 @@ export declare const WebSocketPair: {
|
|
|
1848
1872
|
1: WebSocket;
|
|
1849
1873
|
};
|
|
1850
1874
|
};
|
|
1875
|
+
export interface Socket {
|
|
1876
|
+
get readable(): ReadableStream;
|
|
1877
|
+
get writable(): WritableStream;
|
|
1878
|
+
get closed(): Promise<void>;
|
|
1879
|
+
close(): Promise<void>;
|
|
1880
|
+
startTls(options?: TlsOptions): Socket;
|
|
1881
|
+
}
|
|
1882
|
+
export interface SocketOptions {
|
|
1883
|
+
secureTransport?: string;
|
|
1884
|
+
allowHalfOpen: boolean;
|
|
1885
|
+
}
|
|
1886
|
+
export interface SocketAddress {
|
|
1887
|
+
hostname: string;
|
|
1888
|
+
port: number;
|
|
1889
|
+
}
|
|
1890
|
+
export interface TlsOptions {
|
|
1891
|
+
expectedServerHostname?: string;
|
|
1892
|
+
}
|
|
1851
1893
|
export interface BasicImageTransformations {
|
|
1852
1894
|
/**
|
|
1853
1895
|
* Maximum width in image pixels. The value must be an integer.
|
package/experimental/index.d.ts
CHANGED
|
@@ -184,11 +184,14 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
184
184
|
crypto: Crypto;
|
|
185
185
|
caches: CacheStorage;
|
|
186
186
|
scheduler: Scheduler;
|
|
187
|
+
performance: Performance;
|
|
188
|
+
readonly origin: string;
|
|
187
189
|
Event: typeof Event;
|
|
188
190
|
ExtendableEvent: typeof ExtendableEvent;
|
|
189
191
|
PromiseRejectionEvent: typeof PromiseRejectionEvent;
|
|
190
192
|
FetchEvent: typeof FetchEvent;
|
|
191
|
-
|
|
193
|
+
TailEvent: typeof TailEvent;
|
|
194
|
+
TraceEvent: typeof TailEvent;
|
|
192
195
|
ScheduledEvent: typeof ScheduledEvent;
|
|
193
196
|
MessageEvent: typeof MessageEvent;
|
|
194
197
|
CloseEvent: typeof CloseEvent;
|
|
@@ -286,6 +289,8 @@ declare const self: ServiceWorkerGlobalScope;
|
|
|
286
289
|
declare const crypto: Crypto;
|
|
287
290
|
declare const caches: CacheStorage;
|
|
288
291
|
declare const scheduler: Scheduler;
|
|
292
|
+
declare const performance: Performance;
|
|
293
|
+
declare const origin: string;
|
|
289
294
|
declare const navigator: Navigator;
|
|
290
295
|
declare interface TestController {}
|
|
291
296
|
declare interface ExecutionContext {
|
|
@@ -300,6 +305,11 @@ declare type ExportedHandlerFetchHandler<
|
|
|
300
305
|
env: Env,
|
|
301
306
|
ctx: ExecutionContext
|
|
302
307
|
) => Response | Promise<Response>;
|
|
308
|
+
declare type ExportedHandlerTailHandler<Env = unknown> = (
|
|
309
|
+
events: TraceItem[],
|
|
310
|
+
env: Env,
|
|
311
|
+
ctx: ExecutionContext
|
|
312
|
+
) => void | Promise<void>;
|
|
303
313
|
declare type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
304
314
|
traces: TraceItem[],
|
|
305
315
|
env: Env,
|
|
@@ -326,6 +336,7 @@ declare interface ExportedHandler<
|
|
|
326
336
|
CfHostMetadata = unknown
|
|
327
337
|
> {
|
|
328
338
|
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
339
|
+
tail?: ExportedHandlerTailHandler<Env>;
|
|
329
340
|
trace?: ExportedHandlerTraceHandler<Env>;
|
|
330
341
|
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
331
342
|
test?: ExportedHandlerTestHandler<Env>;
|
|
@@ -341,6 +352,11 @@ declare abstract class PromiseRejectionEvent extends Event {
|
|
|
341
352
|
declare abstract class Navigator {
|
|
342
353
|
readonly userAgent: string;
|
|
343
354
|
}
|
|
355
|
+
/** 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. */
|
|
356
|
+
declare interface Performance {
|
|
357
|
+
readonly timeOrigin: number;
|
|
358
|
+
now(): number;
|
|
359
|
+
}
|
|
344
360
|
declare interface DurableObject {
|
|
345
361
|
fetch(request: Request): Response | Promise<Response>;
|
|
346
362
|
alarm?(): void | Promise<void>;
|
|
@@ -392,6 +408,9 @@ declare interface DurableObjectState {
|
|
|
392
408
|
readonly id: DurableObjectId;
|
|
393
409
|
readonly storage: DurableObjectStorage;
|
|
394
410
|
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
411
|
+
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
|
|
412
|
+
getWebSockets(tag?: string): WebSocket[];
|
|
413
|
+
abort(reason?: string): void;
|
|
395
414
|
}
|
|
396
415
|
declare interface DurableObjectTransaction {
|
|
397
416
|
get<T = unknown>(
|
|
@@ -459,6 +478,7 @@ declare interface DurableObjectStorage {
|
|
|
459
478
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
460
479
|
sync(): Promise<void>;
|
|
461
480
|
sql: SqlStorage;
|
|
481
|
+
transactionSync<T>(closure: () => T): T;
|
|
462
482
|
}
|
|
463
483
|
declare interface DurableObjectListOptions {
|
|
464
484
|
start?: string;
|
|
@@ -568,6 +588,7 @@ declare class AbortController {
|
|
|
568
588
|
declare abstract class AbortSignal extends EventTarget {
|
|
569
589
|
static abort(reason?: any): AbortSignal;
|
|
570
590
|
static timeout(delay: number): AbortSignal;
|
|
591
|
+
static any(signals: AbortSignal[]): AbortSignal;
|
|
571
592
|
get aborted(): boolean;
|
|
572
593
|
get reason(): any;
|
|
573
594
|
throwIfAborted(): void;
|
|
@@ -1644,7 +1665,8 @@ declare interface QueuingStrategyInit {
|
|
|
1644
1665
|
*/
|
|
1645
1666
|
highWaterMark: number;
|
|
1646
1667
|
}
|
|
1647
|
-
declare abstract class
|
|
1668
|
+
declare abstract class TailEvent extends ExtendableEvent {
|
|
1669
|
+
readonly events: TraceItem[];
|
|
1648
1670
|
readonly traces: TraceItem[];
|
|
1649
1671
|
}
|
|
1650
1672
|
declare interface TraceItem {
|
|
@@ -1748,10 +1770,10 @@ declare class URLSearchParams {
|
|
|
1748
1770
|
);
|
|
1749
1771
|
get size(): number;
|
|
1750
1772
|
append(name: string, value: string): void;
|
|
1751
|
-
delete(name: string): void;
|
|
1773
|
+
delete(name: string, value?: any): void;
|
|
1752
1774
|
get(name: string): string | null;
|
|
1753
1775
|
getAll(name: string): string[];
|
|
1754
|
-
has(name: string): boolean;
|
|
1776
|
+
has(name: string, value?: any): boolean;
|
|
1755
1777
|
set(name: string, value: string): void;
|
|
1756
1778
|
sort(): void;
|
|
1757
1779
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
@@ -1851,6 +1873,8 @@ declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
1851
1873
|
accept(): void;
|
|
1852
1874
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
|
1853
1875
|
close(code?: number, reason?: string): void;
|
|
1876
|
+
serializeAttachment(attachment: any): void;
|
|
1877
|
+
deserializeAttachment(): any | null;
|
|
1854
1878
|
static readonly READY_STATE_CONNECTING: number;
|
|
1855
1879
|
static readonly READY_STATE_OPEN: number;
|
|
1856
1880
|
static readonly READY_STATE_CLOSING: number;
|
|
@@ -1869,6 +1893,9 @@ declare const WebSocketPair: {
|
|
|
1869
1893
|
declare interface SqlStorage {
|
|
1870
1894
|
exec(query: string, ...bindings: any[]): SqlStorageCursor;
|
|
1871
1895
|
prepare(query: string): SqlStorageStatement;
|
|
1896
|
+
get databaseSize(): number;
|
|
1897
|
+
get voluntarySizeLimit(): number;
|
|
1898
|
+
set voluntarySizeLimit(value: number);
|
|
1872
1899
|
Cursor: typeof SqlStorageCursor;
|
|
1873
1900
|
Statement: typeof SqlStorageStatement;
|
|
1874
1901
|
}
|
package/experimental/index.ts
CHANGED
|
@@ -184,11 +184,14 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
184
184
|
crypto: Crypto;
|
|
185
185
|
caches: CacheStorage;
|
|
186
186
|
scheduler: Scheduler;
|
|
187
|
+
performance: Performance;
|
|
188
|
+
readonly origin: string;
|
|
187
189
|
Event: typeof Event;
|
|
188
190
|
ExtendableEvent: typeof ExtendableEvent;
|
|
189
191
|
PromiseRejectionEvent: typeof PromiseRejectionEvent;
|
|
190
192
|
FetchEvent: typeof FetchEvent;
|
|
191
|
-
|
|
193
|
+
TailEvent: typeof TailEvent;
|
|
194
|
+
TraceEvent: typeof TailEvent;
|
|
192
195
|
ScheduledEvent: typeof ScheduledEvent;
|
|
193
196
|
MessageEvent: typeof MessageEvent;
|
|
194
197
|
CloseEvent: typeof CloseEvent;
|
|
@@ -288,6 +291,8 @@ export declare const self: ServiceWorkerGlobalScope;
|
|
|
288
291
|
export declare const crypto: Crypto;
|
|
289
292
|
export declare const caches: CacheStorage;
|
|
290
293
|
export declare const scheduler: Scheduler;
|
|
294
|
+
export declare const performance: Performance;
|
|
295
|
+
export declare const origin: string;
|
|
291
296
|
export declare const navigator: Navigator;
|
|
292
297
|
export interface TestController {}
|
|
293
298
|
export interface ExecutionContext {
|
|
@@ -302,6 +307,11 @@ export type ExportedHandlerFetchHandler<
|
|
|
302
307
|
env: Env,
|
|
303
308
|
ctx: ExecutionContext
|
|
304
309
|
) => Response | Promise<Response>;
|
|
310
|
+
export type ExportedHandlerTailHandler<Env = unknown> = (
|
|
311
|
+
events: TraceItem[],
|
|
312
|
+
env: Env,
|
|
313
|
+
ctx: ExecutionContext
|
|
314
|
+
) => void | Promise<void>;
|
|
305
315
|
export type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
306
316
|
traces: TraceItem[],
|
|
307
317
|
env: Env,
|
|
@@ -328,6 +338,7 @@ export interface ExportedHandler<
|
|
|
328
338
|
CfHostMetadata = unknown
|
|
329
339
|
> {
|
|
330
340
|
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
341
|
+
tail?: ExportedHandlerTailHandler<Env>;
|
|
331
342
|
trace?: ExportedHandlerTraceHandler<Env>;
|
|
332
343
|
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
333
344
|
test?: ExportedHandlerTestHandler<Env>;
|
|
@@ -343,6 +354,11 @@ export declare abstract class PromiseRejectionEvent extends Event {
|
|
|
343
354
|
export declare abstract class Navigator {
|
|
344
355
|
readonly userAgent: string;
|
|
345
356
|
}
|
|
357
|
+
/** 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. */
|
|
358
|
+
export interface Performance {
|
|
359
|
+
readonly timeOrigin: number;
|
|
360
|
+
now(): number;
|
|
361
|
+
}
|
|
346
362
|
export interface DurableObject {
|
|
347
363
|
fetch(request: Request): Response | Promise<Response>;
|
|
348
364
|
alarm?(): void | Promise<void>;
|
|
@@ -394,6 +410,9 @@ export interface DurableObjectState {
|
|
|
394
410
|
readonly id: DurableObjectId;
|
|
395
411
|
readonly storage: DurableObjectStorage;
|
|
396
412
|
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
413
|
+
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
|
|
414
|
+
getWebSockets(tag?: string): WebSocket[];
|
|
415
|
+
abort(reason?: string): void;
|
|
397
416
|
}
|
|
398
417
|
export interface DurableObjectTransaction {
|
|
399
418
|
get<T = unknown>(
|
|
@@ -461,6 +480,7 @@ export interface DurableObjectStorage {
|
|
|
461
480
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
462
481
|
sync(): Promise<void>;
|
|
463
482
|
sql: SqlStorage;
|
|
483
|
+
transactionSync<T>(closure: () => T): T;
|
|
464
484
|
}
|
|
465
485
|
export interface DurableObjectListOptions {
|
|
466
486
|
start?: string;
|
|
@@ -570,6 +590,7 @@ export declare class AbortController {
|
|
|
570
590
|
export declare abstract class AbortSignal extends EventTarget {
|
|
571
591
|
static abort(reason?: any): AbortSignal;
|
|
572
592
|
static timeout(delay: number): AbortSignal;
|
|
593
|
+
static any(signals: AbortSignal[]): AbortSignal;
|
|
573
594
|
get aborted(): boolean;
|
|
574
595
|
get reason(): any;
|
|
575
596
|
throwIfAborted(): void;
|
|
@@ -1649,7 +1670,8 @@ export interface QueuingStrategyInit {
|
|
|
1649
1670
|
*/
|
|
1650
1671
|
highWaterMark: number;
|
|
1651
1672
|
}
|
|
1652
|
-
export declare abstract class
|
|
1673
|
+
export declare abstract class TailEvent extends ExtendableEvent {
|
|
1674
|
+
readonly events: TraceItem[];
|
|
1653
1675
|
readonly traces: TraceItem[];
|
|
1654
1676
|
}
|
|
1655
1677
|
export interface TraceItem {
|
|
@@ -1753,10 +1775,10 @@ export declare class URLSearchParams {
|
|
|
1753
1775
|
);
|
|
1754
1776
|
get size(): number;
|
|
1755
1777
|
append(name: string, value: string): void;
|
|
1756
|
-
delete(name: string): void;
|
|
1778
|
+
delete(name: string, value?: any): void;
|
|
1757
1779
|
get(name: string): string | null;
|
|
1758
1780
|
getAll(name: string): string[];
|
|
1759
|
-
has(name: string): boolean;
|
|
1781
|
+
has(name: string, value?: any): boolean;
|
|
1760
1782
|
set(name: string, value: string): void;
|
|
1761
1783
|
sort(): void;
|
|
1762
1784
|
entries(): IterableIterator<[key: string, value: string]>;
|
|
@@ -1856,6 +1878,8 @@ export declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
1856
1878
|
accept(): void;
|
|
1857
1879
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
|
1858
1880
|
close(code?: number, reason?: string): void;
|
|
1881
|
+
serializeAttachment(attachment: any): void;
|
|
1882
|
+
deserializeAttachment(): any | null;
|
|
1859
1883
|
static readonly READY_STATE_CONNECTING: number;
|
|
1860
1884
|
static readonly READY_STATE_OPEN: number;
|
|
1861
1885
|
static readonly READY_STATE_CLOSING: number;
|
|
@@ -1874,6 +1898,9 @@ export declare const WebSocketPair: {
|
|
|
1874
1898
|
export interface SqlStorage {
|
|
1875
1899
|
exec(query: string, ...bindings: any[]): SqlStorageCursor;
|
|
1876
1900
|
prepare(query: string): SqlStorageStatement;
|
|
1901
|
+
get databaseSize(): number;
|
|
1902
|
+
get voluntarySizeLimit(): number;
|
|
1903
|
+
set voluntarySizeLimit(value: number);
|
|
1877
1904
|
Cursor: typeof SqlStorageCursor;
|
|
1878
1905
|
Statement: typeof SqlStorageStatement;
|
|
1879
1906
|
}
|
package/index.d.ts
CHANGED
|
@@ -184,11 +184,14 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
184
184
|
crypto: Crypto;
|
|
185
185
|
caches: CacheStorage;
|
|
186
186
|
scheduler: Scheduler;
|
|
187
|
+
performance: Performance;
|
|
188
|
+
readonly origin: string;
|
|
187
189
|
Event: typeof Event;
|
|
188
190
|
ExtendableEvent: typeof ExtendableEvent;
|
|
189
191
|
PromiseRejectionEvent: typeof PromiseRejectionEvent;
|
|
190
192
|
FetchEvent: typeof FetchEvent;
|
|
191
|
-
|
|
193
|
+
TailEvent: typeof TailEvent;
|
|
194
|
+
TraceEvent: typeof TailEvent;
|
|
192
195
|
ScheduledEvent: typeof ScheduledEvent;
|
|
193
196
|
MessageEvent: typeof MessageEvent;
|
|
194
197
|
CloseEvent: typeof CloseEvent;
|
|
@@ -280,6 +283,8 @@ declare const self: ServiceWorkerGlobalScope;
|
|
|
280
283
|
declare const crypto: Crypto;
|
|
281
284
|
declare const caches: CacheStorage;
|
|
282
285
|
declare const scheduler: Scheduler;
|
|
286
|
+
declare const performance: Performance;
|
|
287
|
+
declare const origin: string;
|
|
283
288
|
declare interface TestController {}
|
|
284
289
|
declare interface ExecutionContext {
|
|
285
290
|
waitUntil(promise: Promise<any>): void;
|
|
@@ -293,6 +298,11 @@ declare type ExportedHandlerFetchHandler<
|
|
|
293
298
|
env: Env,
|
|
294
299
|
ctx: ExecutionContext
|
|
295
300
|
) => Response | Promise<Response>;
|
|
301
|
+
declare type ExportedHandlerTailHandler<Env = unknown> = (
|
|
302
|
+
events: TraceItem[],
|
|
303
|
+
env: Env,
|
|
304
|
+
ctx: ExecutionContext
|
|
305
|
+
) => void | Promise<void>;
|
|
296
306
|
declare type ExportedHandlerTraceHandler<Env = unknown> = (
|
|
297
307
|
traces: TraceItem[],
|
|
298
308
|
env: Env,
|
|
@@ -319,6 +329,7 @@ declare interface ExportedHandler<
|
|
|
319
329
|
CfHostMetadata = unknown
|
|
320
330
|
> {
|
|
321
331
|
fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata>;
|
|
332
|
+
tail?: ExportedHandlerTailHandler<Env>;
|
|
322
333
|
trace?: ExportedHandlerTraceHandler<Env>;
|
|
323
334
|
scheduled?: ExportedHandlerScheduledHandler<Env>;
|
|
324
335
|
test?: ExportedHandlerTestHandler<Env>;
|
|
@@ -331,6 +342,11 @@ declare abstract class PromiseRejectionEvent extends Event {
|
|
|
331
342
|
readonly promise: Promise<any>;
|
|
332
343
|
readonly reason: any;
|
|
333
344
|
}
|
|
345
|
+
/** 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. */
|
|
346
|
+
declare interface Performance {
|
|
347
|
+
readonly timeOrigin: number;
|
|
348
|
+
now(): number;
|
|
349
|
+
}
|
|
334
350
|
declare interface DurableObject {
|
|
335
351
|
fetch(request: Request): Response | Promise<Response>;
|
|
336
352
|
alarm?(): void | Promise<void>;
|
|
@@ -378,6 +394,8 @@ declare interface DurableObjectState {
|
|
|
378
394
|
readonly id: DurableObjectId;
|
|
379
395
|
readonly storage: DurableObjectStorage;
|
|
380
396
|
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
397
|
+
acceptWebSocket(ws: WebSocket, tags?: string[]): void;
|
|
398
|
+
getWebSockets(tag?: string): WebSocket[];
|
|
381
399
|
}
|
|
382
400
|
declare interface DurableObjectTransaction {
|
|
383
401
|
get<T = unknown>(
|
|
@@ -444,6 +462,7 @@ declare interface DurableObjectStorage {
|
|
|
444
462
|
): Promise<void>;
|
|
445
463
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
446
464
|
sync(): Promise<void>;
|
|
465
|
+
transactionSync<T>(closure: () => T): T;
|
|
447
466
|
}
|
|
448
467
|
declare interface DurableObjectListOptions {
|
|
449
468
|
start?: string;
|
|
@@ -564,6 +583,7 @@ declare class AbortController {
|
|
|
564
583
|
declare abstract class AbortSignal extends EventTarget {
|
|
565
584
|
static abort(reason?: any): AbortSignal;
|
|
566
585
|
static timeout(delay: number): AbortSignal;
|
|
586
|
+
static any(signals: AbortSignal[]): AbortSignal;
|
|
567
587
|
/** Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */
|
|
568
588
|
readonly aborted: boolean;
|
|
569
589
|
readonly reason: any;
|
|
@@ -1059,6 +1079,7 @@ declare interface RequestInit<Cf = CfProperties> {
|
|
|
1059
1079
|
}
|
|
1060
1080
|
declare abstract class Fetcher {
|
|
1061
1081
|
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
|
1082
|
+
connect(address: SocketAddress | string, options?: SocketOptions): Socket;
|
|
1062
1083
|
}
|
|
1063
1084
|
declare interface FetcherPutOptions {
|
|
1064
1085
|
expiration?: number;
|
|
@@ -1631,7 +1652,8 @@ declare interface QueuingStrategyInit {
|
|
|
1631
1652
|
*/
|
|
1632
1653
|
highWaterMark: number;
|
|
1633
1654
|
}
|
|
1634
|
-
declare abstract class
|
|
1655
|
+
declare abstract class TailEvent extends ExtendableEvent {
|
|
1656
|
+
readonly events: TraceItem[];
|
|
1635
1657
|
readonly traces: TraceItem[];
|
|
1636
1658
|
}
|
|
1637
1659
|
declare interface TraceItem {
|
|
@@ -1831,6 +1853,8 @@ declare class WebSocket extends EventTarget<WebSocketEventMap> {
|
|
|
1831
1853
|
accept(): void;
|
|
1832
1854
|
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
|
1833
1855
|
close(code?: number, reason?: string): void;
|
|
1856
|
+
serializeAttachment(attachment: any): void;
|
|
1857
|
+
deserializeAttachment(): any | null;
|
|
1834
1858
|
static readonly READY_STATE_CONNECTING: number;
|
|
1835
1859
|
static readonly READY_STATE_OPEN: number;
|
|
1836
1860
|
static readonly READY_STATE_CLOSING: number;
|
|
@@ -1850,6 +1874,24 @@ declare const WebSocketPair: {
|
|
|
1850
1874
|
1: WebSocket;
|
|
1851
1875
|
};
|
|
1852
1876
|
};
|
|
1877
|
+
declare interface Socket {
|
|
1878
|
+
get readable(): ReadableStream;
|
|
1879
|
+
get writable(): WritableStream;
|
|
1880
|
+
get closed(): Promise<void>;
|
|
1881
|
+
close(): Promise<void>;
|
|
1882
|
+
startTls(options?: TlsOptions): Socket;
|
|
1883
|
+
}
|
|
1884
|
+
declare interface SocketOptions {
|
|
1885
|
+
secureTransport?: string;
|
|
1886
|
+
allowHalfOpen: boolean;
|
|
1887
|
+
}
|
|
1888
|
+
declare interface SocketAddress {
|
|
1889
|
+
hostname: string;
|
|
1890
|
+
port: number;
|
|
1891
|
+
}
|
|
1892
|
+
declare interface TlsOptions {
|
|
1893
|
+
expectedServerHostname?: string;
|
|
1894
|
+
}
|
|
1853
1895
|
declare interface BasicImageTransformations {
|
|
1854
1896
|
/**
|
|
1855
1897
|
* Maximum width in image pixels. The value must be an integer.
|