@cloudflare/workers-types 3.8.0 → 3.11.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/index.d.ts +34 -25
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -231,6 +231,7 @@ declare abstract class Crypto {
|
|
|
231
231
|
| BigUint64Array
|
|
232
232
|
>(buffer: T): T;
|
|
233
233
|
randomUUID(): string;
|
|
234
|
+
DigestStream: typeof DigestStream;
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
declare abstract class CryptoKey {
|
|
@@ -362,6 +363,7 @@ interface DurableObjectId {
|
|
|
362
363
|
|
|
363
364
|
interface DurableObjectListOptions {
|
|
364
365
|
start?: string;
|
|
366
|
+
startAfter?: string;
|
|
365
367
|
end?: string;
|
|
366
368
|
prefix?: string;
|
|
367
369
|
reverse?: boolean;
|
|
@@ -430,7 +432,7 @@ interface DurableObjectStorage {
|
|
|
430
432
|
): Promise<T>;
|
|
431
433
|
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
|
|
432
434
|
setAlarm(
|
|
433
|
-
scheduledTime: Date,
|
|
435
|
+
scheduledTime: number | Date,
|
|
434
436
|
options?: DurableObjectSetAlarmOptions
|
|
435
437
|
): Promise<void>;
|
|
436
438
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
@@ -483,7 +485,7 @@ interface DurableObjectTransaction {
|
|
|
483
485
|
rollback(): void;
|
|
484
486
|
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<number | null>;
|
|
485
487
|
setAlarm(
|
|
486
|
-
scheduledTime: Date,
|
|
488
|
+
scheduledTime: number | Date,
|
|
487
489
|
options?: DurableObjectSetAlarmOptions
|
|
488
490
|
): Promise<void>;
|
|
489
491
|
deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
|
|
@@ -616,11 +618,15 @@ declare type ExportedHandlerScheduledHandler<Env = unknown> = (
|
|
|
616
618
|
ctx: ExecutionContext
|
|
617
619
|
) => void | Promise<void>;
|
|
618
620
|
|
|
619
|
-
declare
|
|
621
|
+
declare class ExtendableEvent extends Event {
|
|
622
|
+
constructor(type: string, init?: EventInit);
|
|
623
|
+
waitUntil(promise: Promise<any>): void;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
declare abstract class FetchEvent extends ExtendableEvent {
|
|
620
627
|
readonly request: Request;
|
|
621
628
|
respondWith(promise: Response | Promise<Response>): void;
|
|
622
629
|
passThroughOnException(): void;
|
|
623
|
-
waitUntil(promise: Promise<any>): void;
|
|
624
630
|
}
|
|
625
631
|
|
|
626
632
|
declare abstract class Fetcher {
|
|
@@ -982,6 +988,7 @@ interface PipeToOptions {
|
|
|
982
988
|
preventClose?: boolean;
|
|
983
989
|
preventAbort?: boolean;
|
|
984
990
|
preventCancel?: boolean;
|
|
991
|
+
signal?: AbortSignal;
|
|
985
992
|
}
|
|
986
993
|
|
|
987
994
|
declare abstract class PromiseRejectionEvent extends Event {
|
|
@@ -997,8 +1004,19 @@ interface QueuingStrategyInit {
|
|
|
997
1004
|
* An instance of the R2 bucket binding.
|
|
998
1005
|
*/
|
|
999
1006
|
interface R2Bucket {
|
|
1000
|
-
head(key: string
|
|
1001
|
-
get(key: string
|
|
1007
|
+
head(key: string): Promise<R2Object | null>;
|
|
1008
|
+
get(key: string): Promise<R2ObjectBody | null>;
|
|
1009
|
+
/**
|
|
1010
|
+
* Returns R2Object on a failure of the conditional specified in onlyIf.
|
|
1011
|
+
*/
|
|
1012
|
+
get(
|
|
1013
|
+
key: string,
|
|
1014
|
+
options: R2GetOptions
|
|
1015
|
+
): Promise<R2ObjectBody | R2Object | null>;
|
|
1016
|
+
get(
|
|
1017
|
+
key: string,
|
|
1018
|
+
options?: R2GetOptions
|
|
1019
|
+
): Promise<R2ObjectBody | R2Object | null>;
|
|
1002
1020
|
put(
|
|
1003
1021
|
key: string,
|
|
1004
1022
|
value:
|
|
@@ -1024,10 +1042,6 @@ interface R2Conditional {
|
|
|
1024
1042
|
uploadedAfter?: Date;
|
|
1025
1043
|
}
|
|
1026
1044
|
|
|
1027
|
-
interface R2Error {
|
|
1028
|
-
readonly stack: string;
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
1045
|
/**
|
|
1032
1046
|
* Options for retrieving the object metadata nad payload.
|
|
1033
1047
|
*/
|
|
@@ -1056,13 +1070,6 @@ interface R2HTTPMetadata {
|
|
|
1056
1070
|
cacheExpiry?: Date;
|
|
1057
1071
|
}
|
|
1058
1072
|
|
|
1059
|
-
/**
|
|
1060
|
-
* Options for retrieving the object metadata.
|
|
1061
|
-
*/
|
|
1062
|
-
interface R2HeadOptions {
|
|
1063
|
-
onlyIf?: R2Conditional | Headers;
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
1073
|
interface R2ListOptions {
|
|
1067
1074
|
limit?: number;
|
|
1068
1075
|
prefix?: string;
|
|
@@ -1122,13 +1129,12 @@ interface R2PutOptions {
|
|
|
1122
1129
|
httpMetadata?: R2HTTPMetadata | Headers;
|
|
1123
1130
|
customMetadata?: Record<string, string>;
|
|
1124
1131
|
md5?: ArrayBuffer | string;
|
|
1125
|
-
sha1?: ArrayBuffer | string;
|
|
1126
1132
|
}
|
|
1127
1133
|
|
|
1128
|
-
|
|
1129
|
-
offset: number;
|
|
1130
|
-
length: number
|
|
1131
|
-
}
|
|
1134
|
+
declare type R2Range =
|
|
1135
|
+
| { offset: number; length?: number }
|
|
1136
|
+
| { offset?: number; length: number }
|
|
1137
|
+
| { suffix: number };
|
|
1132
1138
|
|
|
1133
1139
|
interface ReadResult {
|
|
1134
1140
|
value?: any;
|
|
@@ -1481,11 +1487,10 @@ interface ScheduledController {
|
|
|
1481
1487
|
noRetry(): void;
|
|
1482
1488
|
}
|
|
1483
1489
|
|
|
1484
|
-
declare abstract class ScheduledEvent extends
|
|
1490
|
+
declare abstract class ScheduledEvent extends ExtendableEvent {
|
|
1485
1491
|
readonly scheduledTime: number;
|
|
1486
1492
|
readonly cron: string;
|
|
1487
1493
|
noRetry(): void;
|
|
1488
|
-
waitUntil(promise: Promise<any>): void;
|
|
1489
1494
|
}
|
|
1490
1495
|
|
|
1491
1496
|
interface Scheduler {
|
|
@@ -1537,7 +1542,7 @@ declare type StreamPipeOptions = PipeToOptions;
|
|
|
1537
1542
|
|
|
1538
1543
|
interface StreamQueuingStrategy {
|
|
1539
1544
|
highWaterMark?: number;
|
|
1540
|
-
size(chunk:
|
|
1545
|
+
size(chunk: any): number;
|
|
1541
1546
|
}
|
|
1542
1547
|
|
|
1543
1548
|
declare abstract class SubtleCrypto {
|
|
@@ -2010,3 +2015,7 @@ declare type PagesPluginFunction<
|
|
|
2010
2015
|
> = (
|
|
2011
2016
|
context: EventPluginContext<Env, Params, Data, PluginArgs>
|
|
2012
2017
|
) => Response | Promise<Response>;
|
|
2018
|
+
|
|
2019
|
+
declare module "assets:*" {
|
|
2020
|
+
export const onRequest: PagesFunction;
|
|
2021
|
+
}
|