@cloudflare/workers-types 4.20240208.0 → 4.20240312.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 +42 -15
- package/2021-11-03/index.ts +42 -15
- package/2022-01-31/index.d.ts +42 -15
- package/2022-01-31/index.ts +42 -15
- package/2022-03-21/index.d.ts +42 -15
- package/2022-03-21/index.ts +42 -15
- package/2022-08-04/index.d.ts +42 -15
- package/2022-08-04/index.ts +42 -15
- package/2022-10-31/index.d.ts +69 -42
- package/2022-10-31/index.ts +69 -42
- package/2022-11-30/index.d.ts +69 -42
- package/2022-11-30/index.ts +69 -42
- package/2023-03-01/index.d.ts +69 -42
- package/2023-03-01/index.ts +69 -42
- package/2023-07-01/index.d.ts +69 -42
- package/2023-07-01/index.ts +69 -42
- package/experimental/index.d.ts +86 -48
- package/experimental/index.ts +86 -48
- package/index.d.ts +42 -15
- package/index.ts +42 -15
- package/oldest/index.d.ts +42 -15
- package/oldest/index.ts +42 -15
- package/package.json +1 -1
package/2021-11-03/index.d.ts
CHANGED
|
@@ -360,6 +360,10 @@ declare interface Performance {
|
|
|
360
360
|
readonly timeOrigin: number;
|
|
361
361
|
now(): number;
|
|
362
362
|
}
|
|
363
|
+
declare interface AlarmInvocationInfo {
|
|
364
|
+
readonly isRetry: boolean;
|
|
365
|
+
readonly retryCount: number;
|
|
366
|
+
}
|
|
363
367
|
declare interface DurableObject {
|
|
364
368
|
fetch(request: Request): Response | Promise<Response>;
|
|
365
369
|
alarm?(): void | Promise<void>;
|
|
@@ -375,7 +379,7 @@ declare interface DurableObject {
|
|
|
375
379
|
): void | Promise<void>;
|
|
376
380
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
377
381
|
}
|
|
378
|
-
declare interface DurableObjectStub extends
|
|
382
|
+
declare interface DurableObjectStub extends Fetcher {
|
|
379
383
|
readonly id: DurableObjectId;
|
|
380
384
|
readonly name?: string;
|
|
381
385
|
}
|
|
@@ -633,9 +637,9 @@ declare interface SchedulerWaitOptions {
|
|
|
633
637
|
declare abstract class ExtendableEvent extends Event {
|
|
634
638
|
waitUntil(promise: Promise<any>): void;
|
|
635
639
|
}
|
|
636
|
-
declare class CustomEvent extends Event {
|
|
640
|
+
declare class CustomEvent<T = any> extends Event {
|
|
637
641
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
638
|
-
get detail():
|
|
642
|
+
get detail(): T;
|
|
639
643
|
}
|
|
640
644
|
declare interface CustomEventCustomEventInit {
|
|
641
645
|
bubbles?: boolean;
|
|
@@ -1246,32 +1250,43 @@ declare interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
|
1246
1250
|
declare type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1247
1251
|
declare interface Queue<Body = unknown> {
|
|
1248
1252
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1249
|
-
sendBatch(
|
|
1253
|
+
sendBatch(
|
|
1254
|
+
messages: Iterable<MessageSendRequest<Body>>,
|
|
1255
|
+
options?: QueueSendBatchOptions
|
|
1256
|
+
): Promise<void>;
|
|
1250
1257
|
}
|
|
1251
1258
|
declare interface QueueSendOptions {
|
|
1252
1259
|
contentType?: QueueContentType;
|
|
1260
|
+
delaySeconds?: number;
|
|
1261
|
+
}
|
|
1262
|
+
declare interface QueueSendBatchOptions {
|
|
1263
|
+
delaySeconds?: number;
|
|
1253
1264
|
}
|
|
1254
1265
|
declare interface MessageSendRequest<Body = unknown> {
|
|
1255
1266
|
body: Body;
|
|
1256
1267
|
contentType?: QueueContentType;
|
|
1268
|
+
delaySeconds?: number;
|
|
1269
|
+
}
|
|
1270
|
+
declare interface QueueRetryOptions {
|
|
1271
|
+
delaySeconds?: number;
|
|
1257
1272
|
}
|
|
1258
1273
|
declare interface Message<Body = unknown> {
|
|
1259
1274
|
readonly id: string;
|
|
1260
1275
|
readonly timestamp: Date;
|
|
1261
1276
|
readonly body: Body;
|
|
1262
|
-
retry(): void;
|
|
1277
|
+
retry(options?: QueueRetryOptions): void;
|
|
1263
1278
|
ack(): void;
|
|
1264
1279
|
}
|
|
1265
1280
|
declare interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1266
1281
|
readonly messages: readonly Message<Body>[];
|
|
1267
1282
|
readonly queue: string;
|
|
1268
|
-
retryAll(): void;
|
|
1283
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1269
1284
|
ackAll(): void;
|
|
1270
1285
|
}
|
|
1271
1286
|
declare interface MessageBatch<Body = unknown> {
|
|
1272
1287
|
readonly messages: readonly Message<Body>[];
|
|
1273
1288
|
readonly queue: string;
|
|
1274
|
-
retryAll(): void;
|
|
1289
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1275
1290
|
ackAll(): void;
|
|
1276
1291
|
}
|
|
1277
1292
|
declare interface R2Error extends Error {
|
|
@@ -1436,7 +1451,6 @@ declare type R2Objects = {
|
|
|
1436
1451
|
truncated: false;
|
|
1437
1452
|
}
|
|
1438
1453
|
);
|
|
1439
|
-
declare abstract class WorkerRpc extends Fetcher {}
|
|
1440
1454
|
declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1441
1455
|
readonly scheduledTime: number;
|
|
1442
1456
|
readonly cron: string;
|
|
@@ -1577,6 +1591,9 @@ declare class ReadableStreamBYOBReader {
|
|
|
1577
1591
|
view: T
|
|
1578
1592
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1579
1593
|
}
|
|
1594
|
+
declare interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1595
|
+
min?: number;
|
|
1596
|
+
}
|
|
1580
1597
|
declare interface ReadableStreamGetReaderOptions {
|
|
1581
1598
|
mode: "byob";
|
|
1582
1599
|
}
|
|
@@ -1867,7 +1884,11 @@ declare class URLSearchParams {
|
|
|
1867
1884
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1868
1885
|
}
|
|
1869
1886
|
declare class URLPattern {
|
|
1870
|
-
constructor(
|
|
1887
|
+
constructor(
|
|
1888
|
+
input?: string | URLPatternURLPatternInit,
|
|
1889
|
+
baseURL?: string,
|
|
1890
|
+
patternOptions?: URLPatternURLPatternOptions
|
|
1891
|
+
);
|
|
1871
1892
|
get protocol(): string;
|
|
1872
1893
|
get username(): string;
|
|
1873
1894
|
get password(): string;
|
|
@@ -1908,6 +1929,9 @@ declare interface URLPatternURLPatternResult {
|
|
|
1908
1929
|
search: URLPatternURLPatternComponentResult;
|
|
1909
1930
|
hash: URLPatternURLPatternComponentResult;
|
|
1910
1931
|
}
|
|
1932
|
+
declare interface URLPatternURLPatternOptions {
|
|
1933
|
+
ignoreCase?: boolean;
|
|
1934
|
+
}
|
|
1911
1935
|
declare class CloseEvent extends Event {
|
|
1912
1936
|
constructor(type: string, initializer: CloseEventInit);
|
|
1913
1937
|
/** Returns the WebSocket connection close code provided by the server. */
|
|
@@ -2066,9 +2090,9 @@ declare interface gpuGPUBuffer {
|
|
|
2066
2090
|
unmap(): void;
|
|
2067
2091
|
destroy(): void;
|
|
2068
2092
|
mapAsync(
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2093
|
+
offset: number,
|
|
2094
|
+
size?: number | bigint,
|
|
2095
|
+
param3?: number | bigint
|
|
2072
2096
|
): Promise<void>;
|
|
2073
2097
|
get size(): number | bigint;
|
|
2074
2098
|
get usage(): number;
|
|
@@ -3509,7 +3533,10 @@ declare abstract class D1PreparedStatement {
|
|
|
3509
3533
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
3510
3534
|
run(): Promise<D1Response>;
|
|
3511
3535
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
3512
|
-
raw<T = unknown[]>(
|
|
3536
|
+
raw<T = unknown[]>(options: {
|
|
3537
|
+
columnNames: true;
|
|
3538
|
+
}): Promise<[string[], ...T[]]>;
|
|
3539
|
+
raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
|
|
3513
3540
|
}
|
|
3514
3541
|
/**
|
|
3515
3542
|
* An email message that can be sent from a Worker.
|
|
@@ -3624,7 +3651,7 @@ declare interface Hyperdrive {
|
|
|
3624
3651
|
}
|
|
3625
3652
|
declare type Params<P extends string = any> = Record<P, string | string[]>;
|
|
3626
3653
|
declare type EventContext<Env, P extends string, Data> = {
|
|
3627
|
-
request: Request
|
|
3654
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3628
3655
|
functionPath: string;
|
|
3629
3656
|
waitUntil: (promise: Promise<any>) => void;
|
|
3630
3657
|
passThroughOnException: () => void;
|
|
@@ -3643,7 +3670,7 @@ declare type PagesFunction<
|
|
|
3643
3670
|
Data extends Record<string, unknown> = Record<string, unknown>
|
|
3644
3671
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
3645
3672
|
declare type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
3646
|
-
request: Request
|
|
3673
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3647
3674
|
functionPath: string;
|
|
3648
3675
|
waitUntil: (promise: Promise<any>) => void;
|
|
3649
3676
|
passThroughOnException: () => void;
|
package/2021-11-03/index.ts
CHANGED
|
@@ -362,6 +362,10 @@ export interface Performance {
|
|
|
362
362
|
readonly timeOrigin: number;
|
|
363
363
|
now(): number;
|
|
364
364
|
}
|
|
365
|
+
export interface AlarmInvocationInfo {
|
|
366
|
+
readonly isRetry: boolean;
|
|
367
|
+
readonly retryCount: number;
|
|
368
|
+
}
|
|
365
369
|
export interface DurableObject {
|
|
366
370
|
fetch(request: Request): Response | Promise<Response>;
|
|
367
371
|
alarm?(): void | Promise<void>;
|
|
@@ -377,7 +381,7 @@ export interface DurableObject {
|
|
|
377
381
|
): void | Promise<void>;
|
|
378
382
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
379
383
|
}
|
|
380
|
-
export interface DurableObjectStub extends
|
|
384
|
+
export interface DurableObjectStub extends Fetcher {
|
|
381
385
|
readonly id: DurableObjectId;
|
|
382
386
|
readonly name?: string;
|
|
383
387
|
}
|
|
@@ -635,9 +639,9 @@ export interface SchedulerWaitOptions {
|
|
|
635
639
|
export declare abstract class ExtendableEvent extends Event {
|
|
636
640
|
waitUntil(promise: Promise<any>): void;
|
|
637
641
|
}
|
|
638
|
-
export declare class CustomEvent extends Event {
|
|
642
|
+
export declare class CustomEvent<T = any> extends Event {
|
|
639
643
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
640
|
-
get detail():
|
|
644
|
+
get detail(): T;
|
|
641
645
|
}
|
|
642
646
|
export interface CustomEventCustomEventInit {
|
|
643
647
|
bubbles?: boolean;
|
|
@@ -1248,32 +1252,43 @@ export interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
|
1248
1252
|
export type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1249
1253
|
export interface Queue<Body = unknown> {
|
|
1250
1254
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1251
|
-
sendBatch(
|
|
1255
|
+
sendBatch(
|
|
1256
|
+
messages: Iterable<MessageSendRequest<Body>>,
|
|
1257
|
+
options?: QueueSendBatchOptions
|
|
1258
|
+
): Promise<void>;
|
|
1252
1259
|
}
|
|
1253
1260
|
export interface QueueSendOptions {
|
|
1254
1261
|
contentType?: QueueContentType;
|
|
1262
|
+
delaySeconds?: number;
|
|
1263
|
+
}
|
|
1264
|
+
export interface QueueSendBatchOptions {
|
|
1265
|
+
delaySeconds?: number;
|
|
1255
1266
|
}
|
|
1256
1267
|
export interface MessageSendRequest<Body = unknown> {
|
|
1257
1268
|
body: Body;
|
|
1258
1269
|
contentType?: QueueContentType;
|
|
1270
|
+
delaySeconds?: number;
|
|
1271
|
+
}
|
|
1272
|
+
export interface QueueRetryOptions {
|
|
1273
|
+
delaySeconds?: number;
|
|
1259
1274
|
}
|
|
1260
1275
|
export interface Message<Body = unknown> {
|
|
1261
1276
|
readonly id: string;
|
|
1262
1277
|
readonly timestamp: Date;
|
|
1263
1278
|
readonly body: Body;
|
|
1264
|
-
retry(): void;
|
|
1279
|
+
retry(options?: QueueRetryOptions): void;
|
|
1265
1280
|
ack(): void;
|
|
1266
1281
|
}
|
|
1267
1282
|
export interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1268
1283
|
readonly messages: readonly Message<Body>[];
|
|
1269
1284
|
readonly queue: string;
|
|
1270
|
-
retryAll(): void;
|
|
1285
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1271
1286
|
ackAll(): void;
|
|
1272
1287
|
}
|
|
1273
1288
|
export interface MessageBatch<Body = unknown> {
|
|
1274
1289
|
readonly messages: readonly Message<Body>[];
|
|
1275
1290
|
readonly queue: string;
|
|
1276
|
-
retryAll(): void;
|
|
1291
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1277
1292
|
ackAll(): void;
|
|
1278
1293
|
}
|
|
1279
1294
|
export interface R2Error extends Error {
|
|
@@ -1438,7 +1453,6 @@ export type R2Objects = {
|
|
|
1438
1453
|
truncated: false;
|
|
1439
1454
|
}
|
|
1440
1455
|
);
|
|
1441
|
-
export declare abstract class WorkerRpc extends Fetcher {}
|
|
1442
1456
|
export declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1443
1457
|
readonly scheduledTime: number;
|
|
1444
1458
|
readonly cron: string;
|
|
@@ -1579,6 +1593,9 @@ export declare class ReadableStreamBYOBReader {
|
|
|
1579
1593
|
view: T
|
|
1580
1594
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1581
1595
|
}
|
|
1596
|
+
export interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1597
|
+
min?: number;
|
|
1598
|
+
}
|
|
1582
1599
|
export interface ReadableStreamGetReaderOptions {
|
|
1583
1600
|
mode: "byob";
|
|
1584
1601
|
}
|
|
@@ -1872,7 +1889,11 @@ export declare class URLSearchParams {
|
|
|
1872
1889
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1873
1890
|
}
|
|
1874
1891
|
export declare class URLPattern {
|
|
1875
|
-
constructor(
|
|
1892
|
+
constructor(
|
|
1893
|
+
input?: string | URLPatternURLPatternInit,
|
|
1894
|
+
baseURL?: string,
|
|
1895
|
+
patternOptions?: URLPatternURLPatternOptions
|
|
1896
|
+
);
|
|
1876
1897
|
get protocol(): string;
|
|
1877
1898
|
get username(): string;
|
|
1878
1899
|
get password(): string;
|
|
@@ -1913,6 +1934,9 @@ export interface URLPatternURLPatternResult {
|
|
|
1913
1934
|
search: URLPatternURLPatternComponentResult;
|
|
1914
1935
|
hash: URLPatternURLPatternComponentResult;
|
|
1915
1936
|
}
|
|
1937
|
+
export interface URLPatternURLPatternOptions {
|
|
1938
|
+
ignoreCase?: boolean;
|
|
1939
|
+
}
|
|
1916
1940
|
export declare class CloseEvent extends Event {
|
|
1917
1941
|
constructor(type: string, initializer: CloseEventInit);
|
|
1918
1942
|
/** Returns the WebSocket connection close code provided by the server. */
|
|
@@ -2071,9 +2095,9 @@ export interface gpuGPUBuffer {
|
|
|
2071
2095
|
unmap(): void;
|
|
2072
2096
|
destroy(): void;
|
|
2073
2097
|
mapAsync(
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2098
|
+
offset: number,
|
|
2099
|
+
size?: number | bigint,
|
|
2100
|
+
param3?: number | bigint
|
|
2077
2101
|
): Promise<void>;
|
|
2078
2102
|
get size(): number | bigint;
|
|
2079
2103
|
get usage(): number;
|
|
@@ -3514,7 +3538,10 @@ export declare abstract class D1PreparedStatement {
|
|
|
3514
3538
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
3515
3539
|
run(): Promise<D1Response>;
|
|
3516
3540
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
3517
|
-
raw<T = unknown[]>(
|
|
3541
|
+
raw<T = unknown[]>(options: {
|
|
3542
|
+
columnNames: true;
|
|
3543
|
+
}): Promise<[string[], ...T[]]>;
|
|
3544
|
+
raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
|
|
3518
3545
|
}
|
|
3519
3546
|
/**
|
|
3520
3547
|
* An email message that can be sent from a Worker.
|
|
@@ -3622,7 +3649,7 @@ export interface Hyperdrive {
|
|
|
3622
3649
|
}
|
|
3623
3650
|
export type Params<P extends string = any> = Record<P, string | string[]>;
|
|
3624
3651
|
export type EventContext<Env, P extends string, Data> = {
|
|
3625
|
-
request: Request
|
|
3652
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3626
3653
|
functionPath: string;
|
|
3627
3654
|
waitUntil: (promise: Promise<any>) => void;
|
|
3628
3655
|
passThroughOnException: () => void;
|
|
@@ -3641,7 +3668,7 @@ export type PagesFunction<
|
|
|
3641
3668
|
Data extends Record<string, unknown> = Record<string, unknown>
|
|
3642
3669
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
3643
3670
|
export type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
3644
|
-
request: Request
|
|
3671
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3645
3672
|
functionPath: string;
|
|
3646
3673
|
waitUntil: (promise: Promise<any>) => void;
|
|
3647
3674
|
passThroughOnException: () => void;
|
package/2022-01-31/index.d.ts
CHANGED
|
@@ -360,6 +360,10 @@ declare interface Performance {
|
|
|
360
360
|
readonly timeOrigin: number;
|
|
361
361
|
now(): number;
|
|
362
362
|
}
|
|
363
|
+
declare interface AlarmInvocationInfo {
|
|
364
|
+
readonly isRetry: boolean;
|
|
365
|
+
readonly retryCount: number;
|
|
366
|
+
}
|
|
363
367
|
declare interface DurableObject {
|
|
364
368
|
fetch(request: Request): Response | Promise<Response>;
|
|
365
369
|
alarm?(): void | Promise<void>;
|
|
@@ -375,7 +379,7 @@ declare interface DurableObject {
|
|
|
375
379
|
): void | Promise<void>;
|
|
376
380
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
377
381
|
}
|
|
378
|
-
declare interface DurableObjectStub extends
|
|
382
|
+
declare interface DurableObjectStub extends Fetcher {
|
|
379
383
|
readonly id: DurableObjectId;
|
|
380
384
|
readonly name?: string;
|
|
381
385
|
}
|
|
@@ -621,9 +625,9 @@ declare interface SchedulerWaitOptions {
|
|
|
621
625
|
declare abstract class ExtendableEvent extends Event {
|
|
622
626
|
waitUntil(promise: Promise<any>): void;
|
|
623
627
|
}
|
|
624
|
-
declare class CustomEvent extends Event {
|
|
628
|
+
declare class CustomEvent<T = any> extends Event {
|
|
625
629
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
626
|
-
get detail():
|
|
630
|
+
get detail(): T;
|
|
627
631
|
}
|
|
628
632
|
declare interface CustomEventCustomEventInit {
|
|
629
633
|
bubbles?: boolean;
|
|
@@ -1226,32 +1230,43 @@ declare interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
|
1226
1230
|
declare type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1227
1231
|
declare interface Queue<Body = unknown> {
|
|
1228
1232
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1229
|
-
sendBatch(
|
|
1233
|
+
sendBatch(
|
|
1234
|
+
messages: Iterable<MessageSendRequest<Body>>,
|
|
1235
|
+
options?: QueueSendBatchOptions
|
|
1236
|
+
): Promise<void>;
|
|
1230
1237
|
}
|
|
1231
1238
|
declare interface QueueSendOptions {
|
|
1232
1239
|
contentType?: QueueContentType;
|
|
1240
|
+
delaySeconds?: number;
|
|
1241
|
+
}
|
|
1242
|
+
declare interface QueueSendBatchOptions {
|
|
1243
|
+
delaySeconds?: number;
|
|
1233
1244
|
}
|
|
1234
1245
|
declare interface MessageSendRequest<Body = unknown> {
|
|
1235
1246
|
body: Body;
|
|
1236
1247
|
contentType?: QueueContentType;
|
|
1248
|
+
delaySeconds?: number;
|
|
1249
|
+
}
|
|
1250
|
+
declare interface QueueRetryOptions {
|
|
1251
|
+
delaySeconds?: number;
|
|
1237
1252
|
}
|
|
1238
1253
|
declare interface Message<Body = unknown> {
|
|
1239
1254
|
readonly id: string;
|
|
1240
1255
|
readonly timestamp: Date;
|
|
1241
1256
|
readonly body: Body;
|
|
1242
|
-
retry(): void;
|
|
1257
|
+
retry(options?: QueueRetryOptions): void;
|
|
1243
1258
|
ack(): void;
|
|
1244
1259
|
}
|
|
1245
1260
|
declare interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1246
1261
|
readonly messages: readonly Message<Body>[];
|
|
1247
1262
|
readonly queue: string;
|
|
1248
|
-
retryAll(): void;
|
|
1263
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1249
1264
|
ackAll(): void;
|
|
1250
1265
|
}
|
|
1251
1266
|
declare interface MessageBatch<Body = unknown> {
|
|
1252
1267
|
readonly messages: readonly Message<Body>[];
|
|
1253
1268
|
readonly queue: string;
|
|
1254
|
-
retryAll(): void;
|
|
1269
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1255
1270
|
ackAll(): void;
|
|
1256
1271
|
}
|
|
1257
1272
|
declare interface R2Error extends Error {
|
|
@@ -1416,7 +1431,6 @@ declare type R2Objects = {
|
|
|
1416
1431
|
truncated: false;
|
|
1417
1432
|
}
|
|
1418
1433
|
);
|
|
1419
|
-
declare abstract class WorkerRpc extends Fetcher {}
|
|
1420
1434
|
declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1421
1435
|
readonly scheduledTime: number;
|
|
1422
1436
|
readonly cron: string;
|
|
@@ -1557,6 +1571,9 @@ declare class ReadableStreamBYOBReader {
|
|
|
1557
1571
|
view: T
|
|
1558
1572
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1559
1573
|
}
|
|
1574
|
+
declare interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1575
|
+
min?: number;
|
|
1576
|
+
}
|
|
1560
1577
|
declare interface ReadableStreamGetReaderOptions {
|
|
1561
1578
|
mode: "byob";
|
|
1562
1579
|
}
|
|
@@ -1857,7 +1874,11 @@ declare class URLSearchParams {
|
|
|
1857
1874
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1858
1875
|
}
|
|
1859
1876
|
declare class URLPattern {
|
|
1860
|
-
constructor(
|
|
1877
|
+
constructor(
|
|
1878
|
+
input?: string | URLPatternURLPatternInit,
|
|
1879
|
+
baseURL?: string,
|
|
1880
|
+
patternOptions?: URLPatternURLPatternOptions
|
|
1881
|
+
);
|
|
1861
1882
|
get protocol(): string;
|
|
1862
1883
|
get username(): string;
|
|
1863
1884
|
get password(): string;
|
|
@@ -1898,6 +1919,9 @@ declare interface URLPatternURLPatternResult {
|
|
|
1898
1919
|
search: URLPatternURLPatternComponentResult;
|
|
1899
1920
|
hash: URLPatternURLPatternComponentResult;
|
|
1900
1921
|
}
|
|
1922
|
+
declare interface URLPatternURLPatternOptions {
|
|
1923
|
+
ignoreCase?: boolean;
|
|
1924
|
+
}
|
|
1901
1925
|
declare class CloseEvent extends Event {
|
|
1902
1926
|
constructor(type: string, initializer: CloseEventInit);
|
|
1903
1927
|
/** Returns the WebSocket connection close code provided by the server. */
|
|
@@ -2052,9 +2076,9 @@ declare interface gpuGPUBuffer {
|
|
|
2052
2076
|
unmap(): void;
|
|
2053
2077
|
destroy(): void;
|
|
2054
2078
|
mapAsync(
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2079
|
+
offset: number,
|
|
2080
|
+
size?: number | bigint,
|
|
2081
|
+
param3?: number | bigint
|
|
2058
2082
|
): Promise<void>;
|
|
2059
2083
|
get size(): number | bigint;
|
|
2060
2084
|
get usage(): number;
|
|
@@ -3495,7 +3519,10 @@ declare abstract class D1PreparedStatement {
|
|
|
3495
3519
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
3496
3520
|
run(): Promise<D1Response>;
|
|
3497
3521
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
3498
|
-
raw<T = unknown[]>(
|
|
3522
|
+
raw<T = unknown[]>(options: {
|
|
3523
|
+
columnNames: true;
|
|
3524
|
+
}): Promise<[string[], ...T[]]>;
|
|
3525
|
+
raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
|
|
3499
3526
|
}
|
|
3500
3527
|
/**
|
|
3501
3528
|
* An email message that can be sent from a Worker.
|
|
@@ -3610,7 +3637,7 @@ declare interface Hyperdrive {
|
|
|
3610
3637
|
}
|
|
3611
3638
|
declare type Params<P extends string = any> = Record<P, string | string[]>;
|
|
3612
3639
|
declare type EventContext<Env, P extends string, Data> = {
|
|
3613
|
-
request: Request
|
|
3640
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3614
3641
|
functionPath: string;
|
|
3615
3642
|
waitUntil: (promise: Promise<any>) => void;
|
|
3616
3643
|
passThroughOnException: () => void;
|
|
@@ -3629,7 +3656,7 @@ declare type PagesFunction<
|
|
|
3629
3656
|
Data extends Record<string, unknown> = Record<string, unknown>
|
|
3630
3657
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
3631
3658
|
declare type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
3632
|
-
request: Request
|
|
3659
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3633
3660
|
functionPath: string;
|
|
3634
3661
|
waitUntil: (promise: Promise<any>) => void;
|
|
3635
3662
|
passThroughOnException: () => void;
|
package/2022-01-31/index.ts
CHANGED
|
@@ -362,6 +362,10 @@ export interface Performance {
|
|
|
362
362
|
readonly timeOrigin: number;
|
|
363
363
|
now(): number;
|
|
364
364
|
}
|
|
365
|
+
export interface AlarmInvocationInfo {
|
|
366
|
+
readonly isRetry: boolean;
|
|
367
|
+
readonly retryCount: number;
|
|
368
|
+
}
|
|
365
369
|
export interface DurableObject {
|
|
366
370
|
fetch(request: Request): Response | Promise<Response>;
|
|
367
371
|
alarm?(): void | Promise<void>;
|
|
@@ -377,7 +381,7 @@ export interface DurableObject {
|
|
|
377
381
|
): void | Promise<void>;
|
|
378
382
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
379
383
|
}
|
|
380
|
-
export interface DurableObjectStub extends
|
|
384
|
+
export interface DurableObjectStub extends Fetcher {
|
|
381
385
|
readonly id: DurableObjectId;
|
|
382
386
|
readonly name?: string;
|
|
383
387
|
}
|
|
@@ -623,9 +627,9 @@ export interface SchedulerWaitOptions {
|
|
|
623
627
|
export declare abstract class ExtendableEvent extends Event {
|
|
624
628
|
waitUntil(promise: Promise<any>): void;
|
|
625
629
|
}
|
|
626
|
-
export declare class CustomEvent extends Event {
|
|
630
|
+
export declare class CustomEvent<T = any> extends Event {
|
|
627
631
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
628
|
-
get detail():
|
|
632
|
+
get detail(): T;
|
|
629
633
|
}
|
|
630
634
|
export interface CustomEventCustomEventInit {
|
|
631
635
|
bubbles?: boolean;
|
|
@@ -1228,32 +1232,43 @@ export interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
|
1228
1232
|
export type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1229
1233
|
export interface Queue<Body = unknown> {
|
|
1230
1234
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1231
|
-
sendBatch(
|
|
1235
|
+
sendBatch(
|
|
1236
|
+
messages: Iterable<MessageSendRequest<Body>>,
|
|
1237
|
+
options?: QueueSendBatchOptions
|
|
1238
|
+
): Promise<void>;
|
|
1232
1239
|
}
|
|
1233
1240
|
export interface QueueSendOptions {
|
|
1234
1241
|
contentType?: QueueContentType;
|
|
1242
|
+
delaySeconds?: number;
|
|
1243
|
+
}
|
|
1244
|
+
export interface QueueSendBatchOptions {
|
|
1245
|
+
delaySeconds?: number;
|
|
1235
1246
|
}
|
|
1236
1247
|
export interface MessageSendRequest<Body = unknown> {
|
|
1237
1248
|
body: Body;
|
|
1238
1249
|
contentType?: QueueContentType;
|
|
1250
|
+
delaySeconds?: number;
|
|
1251
|
+
}
|
|
1252
|
+
export interface QueueRetryOptions {
|
|
1253
|
+
delaySeconds?: number;
|
|
1239
1254
|
}
|
|
1240
1255
|
export interface Message<Body = unknown> {
|
|
1241
1256
|
readonly id: string;
|
|
1242
1257
|
readonly timestamp: Date;
|
|
1243
1258
|
readonly body: Body;
|
|
1244
|
-
retry(): void;
|
|
1259
|
+
retry(options?: QueueRetryOptions): void;
|
|
1245
1260
|
ack(): void;
|
|
1246
1261
|
}
|
|
1247
1262
|
export interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1248
1263
|
readonly messages: readonly Message<Body>[];
|
|
1249
1264
|
readonly queue: string;
|
|
1250
|
-
retryAll(): void;
|
|
1265
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1251
1266
|
ackAll(): void;
|
|
1252
1267
|
}
|
|
1253
1268
|
export interface MessageBatch<Body = unknown> {
|
|
1254
1269
|
readonly messages: readonly Message<Body>[];
|
|
1255
1270
|
readonly queue: string;
|
|
1256
|
-
retryAll(): void;
|
|
1271
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1257
1272
|
ackAll(): void;
|
|
1258
1273
|
}
|
|
1259
1274
|
export interface R2Error extends Error {
|
|
@@ -1418,7 +1433,6 @@ export type R2Objects = {
|
|
|
1418
1433
|
truncated: false;
|
|
1419
1434
|
}
|
|
1420
1435
|
);
|
|
1421
|
-
export declare abstract class WorkerRpc extends Fetcher {}
|
|
1422
1436
|
export declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1423
1437
|
readonly scheduledTime: number;
|
|
1424
1438
|
readonly cron: string;
|
|
@@ -1559,6 +1573,9 @@ export declare class ReadableStreamBYOBReader {
|
|
|
1559
1573
|
view: T
|
|
1560
1574
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1561
1575
|
}
|
|
1576
|
+
export interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1577
|
+
min?: number;
|
|
1578
|
+
}
|
|
1562
1579
|
export interface ReadableStreamGetReaderOptions {
|
|
1563
1580
|
mode: "byob";
|
|
1564
1581
|
}
|
|
@@ -1862,7 +1879,11 @@ export declare class URLSearchParams {
|
|
|
1862
1879
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1863
1880
|
}
|
|
1864
1881
|
export declare class URLPattern {
|
|
1865
|
-
constructor(
|
|
1882
|
+
constructor(
|
|
1883
|
+
input?: string | URLPatternURLPatternInit,
|
|
1884
|
+
baseURL?: string,
|
|
1885
|
+
patternOptions?: URLPatternURLPatternOptions
|
|
1886
|
+
);
|
|
1866
1887
|
get protocol(): string;
|
|
1867
1888
|
get username(): string;
|
|
1868
1889
|
get password(): string;
|
|
@@ -1903,6 +1924,9 @@ export interface URLPatternURLPatternResult {
|
|
|
1903
1924
|
search: URLPatternURLPatternComponentResult;
|
|
1904
1925
|
hash: URLPatternURLPatternComponentResult;
|
|
1905
1926
|
}
|
|
1927
|
+
export interface URLPatternURLPatternOptions {
|
|
1928
|
+
ignoreCase?: boolean;
|
|
1929
|
+
}
|
|
1906
1930
|
export declare class CloseEvent extends Event {
|
|
1907
1931
|
constructor(type: string, initializer: CloseEventInit);
|
|
1908
1932
|
/** Returns the WebSocket connection close code provided by the server. */
|
|
@@ -2057,9 +2081,9 @@ export interface gpuGPUBuffer {
|
|
|
2057
2081
|
unmap(): void;
|
|
2058
2082
|
destroy(): void;
|
|
2059
2083
|
mapAsync(
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2084
|
+
offset: number,
|
|
2085
|
+
size?: number | bigint,
|
|
2086
|
+
param3?: number | bigint
|
|
2063
2087
|
): Promise<void>;
|
|
2064
2088
|
get size(): number | bigint;
|
|
2065
2089
|
get usage(): number;
|
|
@@ -3500,7 +3524,10 @@ export declare abstract class D1PreparedStatement {
|
|
|
3500
3524
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
3501
3525
|
run(): Promise<D1Response>;
|
|
3502
3526
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
3503
|
-
raw<T = unknown[]>(
|
|
3527
|
+
raw<T = unknown[]>(options: {
|
|
3528
|
+
columnNames: true;
|
|
3529
|
+
}): Promise<[string[], ...T[]]>;
|
|
3530
|
+
raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
|
|
3504
3531
|
}
|
|
3505
3532
|
/**
|
|
3506
3533
|
* An email message that can be sent from a Worker.
|
|
@@ -3608,7 +3635,7 @@ export interface Hyperdrive {
|
|
|
3608
3635
|
}
|
|
3609
3636
|
export type Params<P extends string = any> = Record<P, string | string[]>;
|
|
3610
3637
|
export type EventContext<Env, P extends string, Data> = {
|
|
3611
|
-
request: Request
|
|
3638
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3612
3639
|
functionPath: string;
|
|
3613
3640
|
waitUntil: (promise: Promise<any>) => void;
|
|
3614
3641
|
passThroughOnException: () => void;
|
|
@@ -3627,7 +3654,7 @@ export type PagesFunction<
|
|
|
3627
3654
|
Data extends Record<string, unknown> = Record<string, unknown>
|
|
3628
3655
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
3629
3656
|
export type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
3630
|
-
request: Request
|
|
3657
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3631
3658
|
functionPath: string;
|
|
3632
3659
|
waitUntil: (promise: Promise<any>) => void;
|
|
3633
3660
|
passThroughOnException: () => void;
|