@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/2022-03-21/index.d.ts
CHANGED
|
@@ -377,6 +377,10 @@ declare interface Performance {
|
|
|
377
377
|
readonly timeOrigin: number;
|
|
378
378
|
now(): number;
|
|
379
379
|
}
|
|
380
|
+
declare interface AlarmInvocationInfo {
|
|
381
|
+
readonly isRetry: boolean;
|
|
382
|
+
readonly retryCount: number;
|
|
383
|
+
}
|
|
380
384
|
declare interface DurableObject {
|
|
381
385
|
fetch(request: Request): Response | Promise<Response>;
|
|
382
386
|
alarm?(): void | Promise<void>;
|
|
@@ -392,7 +396,7 @@ declare interface DurableObject {
|
|
|
392
396
|
): void | Promise<void>;
|
|
393
397
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
394
398
|
}
|
|
395
|
-
declare interface DurableObjectStub extends
|
|
399
|
+
declare interface DurableObjectStub extends Fetcher {
|
|
396
400
|
readonly id: DurableObjectId;
|
|
397
401
|
readonly name?: string;
|
|
398
402
|
}
|
|
@@ -638,9 +642,9 @@ declare interface SchedulerWaitOptions {
|
|
|
638
642
|
declare abstract class ExtendableEvent extends Event {
|
|
639
643
|
waitUntil(promise: Promise<any>): void;
|
|
640
644
|
}
|
|
641
|
-
declare class CustomEvent extends Event {
|
|
645
|
+
declare class CustomEvent<T = any> extends Event {
|
|
642
646
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
643
|
-
get detail():
|
|
647
|
+
get detail(): T;
|
|
644
648
|
}
|
|
645
649
|
declare interface CustomEventCustomEventInit {
|
|
646
650
|
bubbles?: boolean;
|
|
@@ -1243,32 +1247,43 @@ declare interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
|
1243
1247
|
declare type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1244
1248
|
declare interface Queue<Body = unknown> {
|
|
1245
1249
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1246
|
-
sendBatch(
|
|
1250
|
+
sendBatch(
|
|
1251
|
+
messages: Iterable<MessageSendRequest<Body>>,
|
|
1252
|
+
options?: QueueSendBatchOptions
|
|
1253
|
+
): Promise<void>;
|
|
1247
1254
|
}
|
|
1248
1255
|
declare interface QueueSendOptions {
|
|
1249
1256
|
contentType?: QueueContentType;
|
|
1257
|
+
delaySeconds?: number;
|
|
1258
|
+
}
|
|
1259
|
+
declare interface QueueSendBatchOptions {
|
|
1260
|
+
delaySeconds?: number;
|
|
1250
1261
|
}
|
|
1251
1262
|
declare interface MessageSendRequest<Body = unknown> {
|
|
1252
1263
|
body: Body;
|
|
1253
1264
|
contentType?: QueueContentType;
|
|
1265
|
+
delaySeconds?: number;
|
|
1266
|
+
}
|
|
1267
|
+
declare interface QueueRetryOptions {
|
|
1268
|
+
delaySeconds?: number;
|
|
1254
1269
|
}
|
|
1255
1270
|
declare interface Message<Body = unknown> {
|
|
1256
1271
|
readonly id: string;
|
|
1257
1272
|
readonly timestamp: Date;
|
|
1258
1273
|
readonly body: Body;
|
|
1259
|
-
retry(): void;
|
|
1274
|
+
retry(options?: QueueRetryOptions): void;
|
|
1260
1275
|
ack(): void;
|
|
1261
1276
|
}
|
|
1262
1277
|
declare interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1263
1278
|
readonly messages: readonly Message<Body>[];
|
|
1264
1279
|
readonly queue: string;
|
|
1265
|
-
retryAll(): void;
|
|
1280
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1266
1281
|
ackAll(): void;
|
|
1267
1282
|
}
|
|
1268
1283
|
declare interface MessageBatch<Body = unknown> {
|
|
1269
1284
|
readonly messages: readonly Message<Body>[];
|
|
1270
1285
|
readonly queue: string;
|
|
1271
|
-
retryAll(): void;
|
|
1286
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1272
1287
|
ackAll(): void;
|
|
1273
1288
|
}
|
|
1274
1289
|
declare interface R2Error extends Error {
|
|
@@ -1433,7 +1448,6 @@ declare type R2Objects = {
|
|
|
1433
1448
|
truncated: false;
|
|
1434
1449
|
}
|
|
1435
1450
|
);
|
|
1436
|
-
declare abstract class WorkerRpc extends Fetcher {}
|
|
1437
1451
|
declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1438
1452
|
readonly scheduledTime: number;
|
|
1439
1453
|
readonly cron: string;
|
|
@@ -1574,6 +1588,9 @@ declare class ReadableStreamBYOBReader {
|
|
|
1574
1588
|
view: T
|
|
1575
1589
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1576
1590
|
}
|
|
1591
|
+
declare interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1592
|
+
min?: number;
|
|
1593
|
+
}
|
|
1577
1594
|
declare interface ReadableStreamGetReaderOptions {
|
|
1578
1595
|
mode: "byob";
|
|
1579
1596
|
}
|
|
@@ -1874,7 +1891,11 @@ declare class URLSearchParams {
|
|
|
1874
1891
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1875
1892
|
}
|
|
1876
1893
|
declare class URLPattern {
|
|
1877
|
-
constructor(
|
|
1894
|
+
constructor(
|
|
1895
|
+
input?: string | URLPatternURLPatternInit,
|
|
1896
|
+
baseURL?: string,
|
|
1897
|
+
patternOptions?: URLPatternURLPatternOptions
|
|
1898
|
+
);
|
|
1878
1899
|
get protocol(): string;
|
|
1879
1900
|
get username(): string;
|
|
1880
1901
|
get password(): string;
|
|
@@ -1915,6 +1936,9 @@ declare interface URLPatternURLPatternResult {
|
|
|
1915
1936
|
search: URLPatternURLPatternComponentResult;
|
|
1916
1937
|
hash: URLPatternURLPatternComponentResult;
|
|
1917
1938
|
}
|
|
1939
|
+
declare interface URLPatternURLPatternOptions {
|
|
1940
|
+
ignoreCase?: boolean;
|
|
1941
|
+
}
|
|
1918
1942
|
declare class CloseEvent extends Event {
|
|
1919
1943
|
constructor(type: string, initializer: CloseEventInit);
|
|
1920
1944
|
/** Returns the WebSocket connection close code provided by the server. */
|
|
@@ -2074,9 +2098,9 @@ declare interface gpuGPUBuffer {
|
|
|
2074
2098
|
unmap(): void;
|
|
2075
2099
|
destroy(): void;
|
|
2076
2100
|
mapAsync(
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2101
|
+
offset: number,
|
|
2102
|
+
size?: number | bigint,
|
|
2103
|
+
param3?: number | bigint
|
|
2080
2104
|
): Promise<void>;
|
|
2081
2105
|
get size(): number | bigint;
|
|
2082
2106
|
get usage(): number;
|
|
@@ -3521,7 +3545,10 @@ declare abstract class D1PreparedStatement {
|
|
|
3521
3545
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
3522
3546
|
run(): Promise<D1Response>;
|
|
3523
3547
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
3524
|
-
raw<T = unknown[]>(
|
|
3548
|
+
raw<T = unknown[]>(options: {
|
|
3549
|
+
columnNames: true;
|
|
3550
|
+
}): Promise<[string[], ...T[]]>;
|
|
3551
|
+
raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
|
|
3525
3552
|
}
|
|
3526
3553
|
/**
|
|
3527
3554
|
* An email message that can be sent from a Worker.
|
|
@@ -3636,7 +3663,7 @@ declare interface Hyperdrive {
|
|
|
3636
3663
|
}
|
|
3637
3664
|
declare type Params<P extends string = any> = Record<P, string | string[]>;
|
|
3638
3665
|
declare type EventContext<Env, P extends string, Data> = {
|
|
3639
|
-
request: Request
|
|
3666
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3640
3667
|
functionPath: string;
|
|
3641
3668
|
waitUntil: (promise: Promise<any>) => void;
|
|
3642
3669
|
passThroughOnException: () => void;
|
|
@@ -3655,7 +3682,7 @@ declare type PagesFunction<
|
|
|
3655
3682
|
Data extends Record<string, unknown> = Record<string, unknown>
|
|
3656
3683
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
3657
3684
|
declare type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
3658
|
-
request: Request
|
|
3685
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3659
3686
|
functionPath: string;
|
|
3660
3687
|
waitUntil: (promise: Promise<any>) => void;
|
|
3661
3688
|
passThroughOnException: () => void;
|
package/2022-03-21/index.ts
CHANGED
|
@@ -379,6 +379,10 @@ export interface Performance {
|
|
|
379
379
|
readonly timeOrigin: number;
|
|
380
380
|
now(): number;
|
|
381
381
|
}
|
|
382
|
+
export interface AlarmInvocationInfo {
|
|
383
|
+
readonly isRetry: boolean;
|
|
384
|
+
readonly retryCount: number;
|
|
385
|
+
}
|
|
382
386
|
export interface DurableObject {
|
|
383
387
|
fetch(request: Request): Response | Promise<Response>;
|
|
384
388
|
alarm?(): void | Promise<void>;
|
|
@@ -394,7 +398,7 @@ export interface DurableObject {
|
|
|
394
398
|
): void | Promise<void>;
|
|
395
399
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
396
400
|
}
|
|
397
|
-
export interface DurableObjectStub extends
|
|
401
|
+
export interface DurableObjectStub extends Fetcher {
|
|
398
402
|
readonly id: DurableObjectId;
|
|
399
403
|
readonly name?: string;
|
|
400
404
|
}
|
|
@@ -640,9 +644,9 @@ export interface SchedulerWaitOptions {
|
|
|
640
644
|
export declare abstract class ExtendableEvent extends Event {
|
|
641
645
|
waitUntil(promise: Promise<any>): void;
|
|
642
646
|
}
|
|
643
|
-
export declare class CustomEvent extends Event {
|
|
647
|
+
export declare class CustomEvent<T = any> extends Event {
|
|
644
648
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
645
|
-
get detail():
|
|
649
|
+
get detail(): T;
|
|
646
650
|
}
|
|
647
651
|
export interface CustomEventCustomEventInit {
|
|
648
652
|
bubbles?: boolean;
|
|
@@ -1245,32 +1249,43 @@ export interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
|
1245
1249
|
export type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1246
1250
|
export interface Queue<Body = unknown> {
|
|
1247
1251
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1248
|
-
sendBatch(
|
|
1252
|
+
sendBatch(
|
|
1253
|
+
messages: Iterable<MessageSendRequest<Body>>,
|
|
1254
|
+
options?: QueueSendBatchOptions
|
|
1255
|
+
): Promise<void>;
|
|
1249
1256
|
}
|
|
1250
1257
|
export interface QueueSendOptions {
|
|
1251
1258
|
contentType?: QueueContentType;
|
|
1259
|
+
delaySeconds?: number;
|
|
1260
|
+
}
|
|
1261
|
+
export interface QueueSendBatchOptions {
|
|
1262
|
+
delaySeconds?: number;
|
|
1252
1263
|
}
|
|
1253
1264
|
export interface MessageSendRequest<Body = unknown> {
|
|
1254
1265
|
body: Body;
|
|
1255
1266
|
contentType?: QueueContentType;
|
|
1267
|
+
delaySeconds?: number;
|
|
1268
|
+
}
|
|
1269
|
+
export interface QueueRetryOptions {
|
|
1270
|
+
delaySeconds?: number;
|
|
1256
1271
|
}
|
|
1257
1272
|
export interface Message<Body = unknown> {
|
|
1258
1273
|
readonly id: string;
|
|
1259
1274
|
readonly timestamp: Date;
|
|
1260
1275
|
readonly body: Body;
|
|
1261
|
-
retry(): void;
|
|
1276
|
+
retry(options?: QueueRetryOptions): void;
|
|
1262
1277
|
ack(): void;
|
|
1263
1278
|
}
|
|
1264
1279
|
export interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1265
1280
|
readonly messages: readonly Message<Body>[];
|
|
1266
1281
|
readonly queue: string;
|
|
1267
|
-
retryAll(): void;
|
|
1282
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1268
1283
|
ackAll(): void;
|
|
1269
1284
|
}
|
|
1270
1285
|
export interface MessageBatch<Body = unknown> {
|
|
1271
1286
|
readonly messages: readonly Message<Body>[];
|
|
1272
1287
|
readonly queue: string;
|
|
1273
|
-
retryAll(): void;
|
|
1288
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1274
1289
|
ackAll(): void;
|
|
1275
1290
|
}
|
|
1276
1291
|
export interface R2Error extends Error {
|
|
@@ -1435,7 +1450,6 @@ export type R2Objects = {
|
|
|
1435
1450
|
truncated: false;
|
|
1436
1451
|
}
|
|
1437
1452
|
);
|
|
1438
|
-
export declare abstract class WorkerRpc extends Fetcher {}
|
|
1439
1453
|
export declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1440
1454
|
readonly scheduledTime: number;
|
|
1441
1455
|
readonly cron: string;
|
|
@@ -1576,6 +1590,9 @@ export declare class ReadableStreamBYOBReader {
|
|
|
1576
1590
|
view: T
|
|
1577
1591
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1578
1592
|
}
|
|
1593
|
+
export interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1594
|
+
min?: number;
|
|
1595
|
+
}
|
|
1579
1596
|
export interface ReadableStreamGetReaderOptions {
|
|
1580
1597
|
mode: "byob";
|
|
1581
1598
|
}
|
|
@@ -1879,7 +1896,11 @@ export declare class URLSearchParams {
|
|
|
1879
1896
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1880
1897
|
}
|
|
1881
1898
|
export declare class URLPattern {
|
|
1882
|
-
constructor(
|
|
1899
|
+
constructor(
|
|
1900
|
+
input?: string | URLPatternURLPatternInit,
|
|
1901
|
+
baseURL?: string,
|
|
1902
|
+
patternOptions?: URLPatternURLPatternOptions
|
|
1903
|
+
);
|
|
1883
1904
|
get protocol(): string;
|
|
1884
1905
|
get username(): string;
|
|
1885
1906
|
get password(): string;
|
|
@@ -1920,6 +1941,9 @@ export interface URLPatternURLPatternResult {
|
|
|
1920
1941
|
search: URLPatternURLPatternComponentResult;
|
|
1921
1942
|
hash: URLPatternURLPatternComponentResult;
|
|
1922
1943
|
}
|
|
1944
|
+
export interface URLPatternURLPatternOptions {
|
|
1945
|
+
ignoreCase?: boolean;
|
|
1946
|
+
}
|
|
1923
1947
|
export declare class CloseEvent extends Event {
|
|
1924
1948
|
constructor(type: string, initializer: CloseEventInit);
|
|
1925
1949
|
/** Returns the WebSocket connection close code provided by the server. */
|
|
@@ -2079,9 +2103,9 @@ export interface gpuGPUBuffer {
|
|
|
2079
2103
|
unmap(): void;
|
|
2080
2104
|
destroy(): void;
|
|
2081
2105
|
mapAsync(
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2106
|
+
offset: number,
|
|
2107
|
+
size?: number | bigint,
|
|
2108
|
+
param3?: number | bigint
|
|
2085
2109
|
): Promise<void>;
|
|
2086
2110
|
get size(): number | bigint;
|
|
2087
2111
|
get usage(): number;
|
|
@@ -3526,7 +3550,10 @@ export declare abstract class D1PreparedStatement {
|
|
|
3526
3550
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
3527
3551
|
run(): Promise<D1Response>;
|
|
3528
3552
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
3529
|
-
raw<T = unknown[]>(
|
|
3553
|
+
raw<T = unknown[]>(options: {
|
|
3554
|
+
columnNames: true;
|
|
3555
|
+
}): Promise<[string[], ...T[]]>;
|
|
3556
|
+
raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
|
|
3530
3557
|
}
|
|
3531
3558
|
/**
|
|
3532
3559
|
* An email message that can be sent from a Worker.
|
|
@@ -3634,7 +3661,7 @@ export interface Hyperdrive {
|
|
|
3634
3661
|
}
|
|
3635
3662
|
export type Params<P extends string = any> = Record<P, string | string[]>;
|
|
3636
3663
|
export type EventContext<Env, P extends string, Data> = {
|
|
3637
|
-
request: Request
|
|
3664
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3638
3665
|
functionPath: string;
|
|
3639
3666
|
waitUntil: (promise: Promise<any>) => void;
|
|
3640
3667
|
passThroughOnException: () => void;
|
|
@@ -3653,7 +3680,7 @@ export type PagesFunction<
|
|
|
3653
3680
|
Data extends Record<string, unknown> = Record<string, unknown>
|
|
3654
3681
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
3655
3682
|
export type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
3656
|
-
request: Request
|
|
3683
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3657
3684
|
functionPath: string;
|
|
3658
3685
|
waitUntil: (promise: Promise<any>) => void;
|
|
3659
3686
|
passThroughOnException: () => void;
|
package/2022-08-04/index.d.ts
CHANGED
|
@@ -377,6 +377,10 @@ declare interface Performance {
|
|
|
377
377
|
readonly timeOrigin: number;
|
|
378
378
|
now(): number;
|
|
379
379
|
}
|
|
380
|
+
declare interface AlarmInvocationInfo {
|
|
381
|
+
readonly isRetry: boolean;
|
|
382
|
+
readonly retryCount: number;
|
|
383
|
+
}
|
|
380
384
|
declare interface DurableObject {
|
|
381
385
|
fetch(request: Request): Response | Promise<Response>;
|
|
382
386
|
alarm?(): void | Promise<void>;
|
|
@@ -392,7 +396,7 @@ declare interface DurableObject {
|
|
|
392
396
|
): void | Promise<void>;
|
|
393
397
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
394
398
|
}
|
|
395
|
-
declare interface DurableObjectStub extends
|
|
399
|
+
declare interface DurableObjectStub extends Fetcher {
|
|
396
400
|
readonly id: DurableObjectId;
|
|
397
401
|
readonly name?: string;
|
|
398
402
|
}
|
|
@@ -638,9 +642,9 @@ declare interface SchedulerWaitOptions {
|
|
|
638
642
|
declare abstract class ExtendableEvent extends Event {
|
|
639
643
|
waitUntil(promise: Promise<any>): void;
|
|
640
644
|
}
|
|
641
|
-
declare class CustomEvent extends Event {
|
|
645
|
+
declare class CustomEvent<T = any> extends Event {
|
|
642
646
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
643
|
-
get detail():
|
|
647
|
+
get detail(): T;
|
|
644
648
|
}
|
|
645
649
|
declare interface CustomEventCustomEventInit {
|
|
646
650
|
bubbles?: boolean;
|
|
@@ -1243,32 +1247,43 @@ declare interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
|
1243
1247
|
declare type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1244
1248
|
declare interface Queue<Body = unknown> {
|
|
1245
1249
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1246
|
-
sendBatch(
|
|
1250
|
+
sendBatch(
|
|
1251
|
+
messages: Iterable<MessageSendRequest<Body>>,
|
|
1252
|
+
options?: QueueSendBatchOptions
|
|
1253
|
+
): Promise<void>;
|
|
1247
1254
|
}
|
|
1248
1255
|
declare interface QueueSendOptions {
|
|
1249
1256
|
contentType?: QueueContentType;
|
|
1257
|
+
delaySeconds?: number;
|
|
1258
|
+
}
|
|
1259
|
+
declare interface QueueSendBatchOptions {
|
|
1260
|
+
delaySeconds?: number;
|
|
1250
1261
|
}
|
|
1251
1262
|
declare interface MessageSendRequest<Body = unknown> {
|
|
1252
1263
|
body: Body;
|
|
1253
1264
|
contentType?: QueueContentType;
|
|
1265
|
+
delaySeconds?: number;
|
|
1266
|
+
}
|
|
1267
|
+
declare interface QueueRetryOptions {
|
|
1268
|
+
delaySeconds?: number;
|
|
1254
1269
|
}
|
|
1255
1270
|
declare interface Message<Body = unknown> {
|
|
1256
1271
|
readonly id: string;
|
|
1257
1272
|
readonly timestamp: Date;
|
|
1258
1273
|
readonly body: Body;
|
|
1259
|
-
retry(): void;
|
|
1274
|
+
retry(options?: QueueRetryOptions): void;
|
|
1260
1275
|
ack(): void;
|
|
1261
1276
|
}
|
|
1262
1277
|
declare interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1263
1278
|
readonly messages: readonly Message<Body>[];
|
|
1264
1279
|
readonly queue: string;
|
|
1265
|
-
retryAll(): void;
|
|
1280
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1266
1281
|
ackAll(): void;
|
|
1267
1282
|
}
|
|
1268
1283
|
declare interface MessageBatch<Body = unknown> {
|
|
1269
1284
|
readonly messages: readonly Message<Body>[];
|
|
1270
1285
|
readonly queue: string;
|
|
1271
|
-
retryAll(): void;
|
|
1286
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1272
1287
|
ackAll(): void;
|
|
1273
1288
|
}
|
|
1274
1289
|
declare interface R2Error extends Error {
|
|
@@ -1434,7 +1449,6 @@ declare type R2Objects = {
|
|
|
1434
1449
|
truncated: false;
|
|
1435
1450
|
}
|
|
1436
1451
|
);
|
|
1437
|
-
declare abstract class WorkerRpc extends Fetcher {}
|
|
1438
1452
|
declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1439
1453
|
readonly scheduledTime: number;
|
|
1440
1454
|
readonly cron: string;
|
|
@@ -1575,6 +1589,9 @@ declare class ReadableStreamBYOBReader {
|
|
|
1575
1589
|
view: T
|
|
1576
1590
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1577
1591
|
}
|
|
1592
|
+
declare interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1593
|
+
min?: number;
|
|
1594
|
+
}
|
|
1578
1595
|
declare interface ReadableStreamGetReaderOptions {
|
|
1579
1596
|
mode: "byob";
|
|
1580
1597
|
}
|
|
@@ -1875,7 +1892,11 @@ declare class URLSearchParams {
|
|
|
1875
1892
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1876
1893
|
}
|
|
1877
1894
|
declare class URLPattern {
|
|
1878
|
-
constructor(
|
|
1895
|
+
constructor(
|
|
1896
|
+
input?: string | URLPatternURLPatternInit,
|
|
1897
|
+
baseURL?: string,
|
|
1898
|
+
patternOptions?: URLPatternURLPatternOptions
|
|
1899
|
+
);
|
|
1879
1900
|
get protocol(): string;
|
|
1880
1901
|
get username(): string;
|
|
1881
1902
|
get password(): string;
|
|
@@ -1916,6 +1937,9 @@ declare interface URLPatternURLPatternResult {
|
|
|
1916
1937
|
search: URLPatternURLPatternComponentResult;
|
|
1917
1938
|
hash: URLPatternURLPatternComponentResult;
|
|
1918
1939
|
}
|
|
1940
|
+
declare interface URLPatternURLPatternOptions {
|
|
1941
|
+
ignoreCase?: boolean;
|
|
1942
|
+
}
|
|
1919
1943
|
declare class CloseEvent extends Event {
|
|
1920
1944
|
constructor(type: string, initializer: CloseEventInit);
|
|
1921
1945
|
/** Returns the WebSocket connection close code provided by the server. */
|
|
@@ -2075,9 +2099,9 @@ declare interface gpuGPUBuffer {
|
|
|
2075
2099
|
unmap(): void;
|
|
2076
2100
|
destroy(): void;
|
|
2077
2101
|
mapAsync(
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2102
|
+
offset: number,
|
|
2103
|
+
size?: number | bigint,
|
|
2104
|
+
param3?: number | bigint
|
|
2081
2105
|
): Promise<void>;
|
|
2082
2106
|
get size(): number | bigint;
|
|
2083
2107
|
get usage(): number;
|
|
@@ -3522,7 +3546,10 @@ declare abstract class D1PreparedStatement {
|
|
|
3522
3546
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
3523
3547
|
run(): Promise<D1Response>;
|
|
3524
3548
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
3525
|
-
raw<T = unknown[]>(
|
|
3549
|
+
raw<T = unknown[]>(options: {
|
|
3550
|
+
columnNames: true;
|
|
3551
|
+
}): Promise<[string[], ...T[]]>;
|
|
3552
|
+
raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
|
|
3526
3553
|
}
|
|
3527
3554
|
/**
|
|
3528
3555
|
* An email message that can be sent from a Worker.
|
|
@@ -3637,7 +3664,7 @@ declare interface Hyperdrive {
|
|
|
3637
3664
|
}
|
|
3638
3665
|
declare type Params<P extends string = any> = Record<P, string | string[]>;
|
|
3639
3666
|
declare type EventContext<Env, P extends string, Data> = {
|
|
3640
|
-
request: Request
|
|
3667
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3641
3668
|
functionPath: string;
|
|
3642
3669
|
waitUntil: (promise: Promise<any>) => void;
|
|
3643
3670
|
passThroughOnException: () => void;
|
|
@@ -3656,7 +3683,7 @@ declare type PagesFunction<
|
|
|
3656
3683
|
Data extends Record<string, unknown> = Record<string, unknown>
|
|
3657
3684
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
3658
3685
|
declare type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
3659
|
-
request: Request
|
|
3686
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3660
3687
|
functionPath: string;
|
|
3661
3688
|
waitUntil: (promise: Promise<any>) => void;
|
|
3662
3689
|
passThroughOnException: () => void;
|
package/2022-08-04/index.ts
CHANGED
|
@@ -379,6 +379,10 @@ export interface Performance {
|
|
|
379
379
|
readonly timeOrigin: number;
|
|
380
380
|
now(): number;
|
|
381
381
|
}
|
|
382
|
+
export interface AlarmInvocationInfo {
|
|
383
|
+
readonly isRetry: boolean;
|
|
384
|
+
readonly retryCount: number;
|
|
385
|
+
}
|
|
382
386
|
export interface DurableObject {
|
|
383
387
|
fetch(request: Request): Response | Promise<Response>;
|
|
384
388
|
alarm?(): void | Promise<void>;
|
|
@@ -394,7 +398,7 @@ export interface DurableObject {
|
|
|
394
398
|
): void | Promise<void>;
|
|
395
399
|
webSocketError?(ws: WebSocket, error: unknown): void | Promise<void>;
|
|
396
400
|
}
|
|
397
|
-
export interface DurableObjectStub extends
|
|
401
|
+
export interface DurableObjectStub extends Fetcher {
|
|
398
402
|
readonly id: DurableObjectId;
|
|
399
403
|
readonly name?: string;
|
|
400
404
|
}
|
|
@@ -640,9 +644,9 @@ export interface SchedulerWaitOptions {
|
|
|
640
644
|
export declare abstract class ExtendableEvent extends Event {
|
|
641
645
|
waitUntil(promise: Promise<any>): void;
|
|
642
646
|
}
|
|
643
|
-
export declare class CustomEvent extends Event {
|
|
647
|
+
export declare class CustomEvent<T = any> extends Event {
|
|
644
648
|
constructor(type: string, init?: CustomEventCustomEventInit);
|
|
645
|
-
get detail():
|
|
649
|
+
get detail(): T;
|
|
646
650
|
}
|
|
647
651
|
export interface CustomEventCustomEventInit {
|
|
648
652
|
bubbles?: boolean;
|
|
@@ -1245,32 +1249,43 @@ export interface KVNamespaceGetWithMetadataResult<Value, Metadata> {
|
|
|
1245
1249
|
export type QueueContentType = "text" | "bytes" | "json" | "v8";
|
|
1246
1250
|
export interface Queue<Body = unknown> {
|
|
1247
1251
|
send(message: Body, options?: QueueSendOptions): Promise<void>;
|
|
1248
|
-
sendBatch(
|
|
1252
|
+
sendBatch(
|
|
1253
|
+
messages: Iterable<MessageSendRequest<Body>>,
|
|
1254
|
+
options?: QueueSendBatchOptions
|
|
1255
|
+
): Promise<void>;
|
|
1249
1256
|
}
|
|
1250
1257
|
export interface QueueSendOptions {
|
|
1251
1258
|
contentType?: QueueContentType;
|
|
1259
|
+
delaySeconds?: number;
|
|
1260
|
+
}
|
|
1261
|
+
export interface QueueSendBatchOptions {
|
|
1262
|
+
delaySeconds?: number;
|
|
1252
1263
|
}
|
|
1253
1264
|
export interface MessageSendRequest<Body = unknown> {
|
|
1254
1265
|
body: Body;
|
|
1255
1266
|
contentType?: QueueContentType;
|
|
1267
|
+
delaySeconds?: number;
|
|
1268
|
+
}
|
|
1269
|
+
export interface QueueRetryOptions {
|
|
1270
|
+
delaySeconds?: number;
|
|
1256
1271
|
}
|
|
1257
1272
|
export interface Message<Body = unknown> {
|
|
1258
1273
|
readonly id: string;
|
|
1259
1274
|
readonly timestamp: Date;
|
|
1260
1275
|
readonly body: Body;
|
|
1261
|
-
retry(): void;
|
|
1276
|
+
retry(options?: QueueRetryOptions): void;
|
|
1262
1277
|
ack(): void;
|
|
1263
1278
|
}
|
|
1264
1279
|
export interface QueueEvent<Body = unknown> extends ExtendableEvent {
|
|
1265
1280
|
readonly messages: readonly Message<Body>[];
|
|
1266
1281
|
readonly queue: string;
|
|
1267
|
-
retryAll(): void;
|
|
1282
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1268
1283
|
ackAll(): void;
|
|
1269
1284
|
}
|
|
1270
1285
|
export interface MessageBatch<Body = unknown> {
|
|
1271
1286
|
readonly messages: readonly Message<Body>[];
|
|
1272
1287
|
readonly queue: string;
|
|
1273
|
-
retryAll(): void;
|
|
1288
|
+
retryAll(options?: QueueRetryOptions): void;
|
|
1274
1289
|
ackAll(): void;
|
|
1275
1290
|
}
|
|
1276
1291
|
export interface R2Error extends Error {
|
|
@@ -1436,7 +1451,6 @@ export type R2Objects = {
|
|
|
1436
1451
|
truncated: false;
|
|
1437
1452
|
}
|
|
1438
1453
|
);
|
|
1439
|
-
export declare abstract class WorkerRpc extends Fetcher {}
|
|
1440
1454
|
export declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1441
1455
|
readonly scheduledTime: number;
|
|
1442
1456
|
readonly cron: string;
|
|
@@ -1577,6 +1591,9 @@ export declare class ReadableStreamBYOBReader {
|
|
|
1577
1591
|
view: T
|
|
1578
1592
|
): Promise<ReadableStreamReadResult<T>>;
|
|
1579
1593
|
}
|
|
1594
|
+
export interface ReadableStreamBYOBReaderReadableStreamBYOBReaderReadOptions {
|
|
1595
|
+
min?: number;
|
|
1596
|
+
}
|
|
1580
1597
|
export interface ReadableStreamGetReaderOptions {
|
|
1581
1598
|
mode: "byob";
|
|
1582
1599
|
}
|
|
@@ -1880,7 +1897,11 @@ export declare class URLSearchParams {
|
|
|
1880
1897
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
1881
1898
|
}
|
|
1882
1899
|
export declare class URLPattern {
|
|
1883
|
-
constructor(
|
|
1900
|
+
constructor(
|
|
1901
|
+
input?: string | URLPatternURLPatternInit,
|
|
1902
|
+
baseURL?: string,
|
|
1903
|
+
patternOptions?: URLPatternURLPatternOptions
|
|
1904
|
+
);
|
|
1884
1905
|
get protocol(): string;
|
|
1885
1906
|
get username(): string;
|
|
1886
1907
|
get password(): string;
|
|
@@ -1921,6 +1942,9 @@ export interface URLPatternURLPatternResult {
|
|
|
1921
1942
|
search: URLPatternURLPatternComponentResult;
|
|
1922
1943
|
hash: URLPatternURLPatternComponentResult;
|
|
1923
1944
|
}
|
|
1945
|
+
export interface URLPatternURLPatternOptions {
|
|
1946
|
+
ignoreCase?: boolean;
|
|
1947
|
+
}
|
|
1924
1948
|
export declare class CloseEvent extends Event {
|
|
1925
1949
|
constructor(type: string, initializer: CloseEventInit);
|
|
1926
1950
|
/** Returns the WebSocket connection close code provided by the server. */
|
|
@@ -2080,9 +2104,9 @@ export interface gpuGPUBuffer {
|
|
|
2080
2104
|
unmap(): void;
|
|
2081
2105
|
destroy(): void;
|
|
2082
2106
|
mapAsync(
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2107
|
+
offset: number,
|
|
2108
|
+
size?: number | bigint,
|
|
2109
|
+
param3?: number | bigint
|
|
2086
2110
|
): Promise<void>;
|
|
2087
2111
|
get size(): number | bigint;
|
|
2088
2112
|
get usage(): number;
|
|
@@ -3527,7 +3551,10 @@ export declare abstract class D1PreparedStatement {
|
|
|
3527
3551
|
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
3528
3552
|
run(): Promise<D1Response>;
|
|
3529
3553
|
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
3530
|
-
raw<T = unknown[]>(
|
|
3554
|
+
raw<T = unknown[]>(options: {
|
|
3555
|
+
columnNames: true;
|
|
3556
|
+
}): Promise<[string[], ...T[]]>;
|
|
3557
|
+
raw<T = unknown[]>(options?: { columnNames?: false }): Promise<T[]>;
|
|
3531
3558
|
}
|
|
3532
3559
|
/**
|
|
3533
3560
|
* An email message that can be sent from a Worker.
|
|
@@ -3635,7 +3662,7 @@ export interface Hyperdrive {
|
|
|
3635
3662
|
}
|
|
3636
3663
|
export type Params<P extends string = any> = Record<P, string | string[]>;
|
|
3637
3664
|
export type EventContext<Env, P extends string, Data> = {
|
|
3638
|
-
request: Request
|
|
3665
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3639
3666
|
functionPath: string;
|
|
3640
3667
|
waitUntil: (promise: Promise<any>) => void;
|
|
3641
3668
|
passThroughOnException: () => void;
|
|
@@ -3654,7 +3681,7 @@ export type PagesFunction<
|
|
|
3654
3681
|
Data extends Record<string, unknown> = Record<string, unknown>
|
|
3655
3682
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
3656
3683
|
export type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
3657
|
-
request: Request
|
|
3684
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown>>;
|
|
3658
3685
|
functionPath: string;
|
|
3659
3686
|
waitUntil: (promise: Promise<any>) => void;
|
|
3660
3687
|
passThroughOnException: () => void;
|