@cloudflare/workers-types 3.9.0 → 3.12.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 +26 -20
- 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;
|
|
@@ -621,7 +623,7 @@ declare class ExtendableEvent extends Event {
|
|
|
621
623
|
waitUntil(promise: Promise<any>): void;
|
|
622
624
|
}
|
|
623
625
|
|
|
624
|
-
declare abstract class FetchEvent extends
|
|
626
|
+
declare abstract class FetchEvent extends ExtendableEvent {
|
|
625
627
|
readonly request: Request;
|
|
626
628
|
respondWith(promise: Response | Promise<Response>): void;
|
|
627
629
|
passThroughOnException(): void;
|
|
@@ -986,6 +988,7 @@ interface PipeToOptions {
|
|
|
986
988
|
preventClose?: boolean;
|
|
987
989
|
preventAbort?: boolean;
|
|
988
990
|
preventCancel?: boolean;
|
|
991
|
+
signal?: AbortSignal;
|
|
989
992
|
}
|
|
990
993
|
|
|
991
994
|
declare abstract class PromiseRejectionEvent extends Event {
|
|
@@ -1001,8 +1004,19 @@ interface QueuingStrategyInit {
|
|
|
1001
1004
|
* An instance of the R2 bucket binding.
|
|
1002
1005
|
*/
|
|
1003
1006
|
interface R2Bucket {
|
|
1004
|
-
head(key: string
|
|
1005
|
-
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>;
|
|
1006
1020
|
put(
|
|
1007
1021
|
key: string,
|
|
1008
1022
|
value:
|
|
@@ -1028,10 +1042,6 @@ interface R2Conditional {
|
|
|
1028
1042
|
uploadedAfter?: Date;
|
|
1029
1043
|
}
|
|
1030
1044
|
|
|
1031
|
-
interface R2Error {
|
|
1032
|
-
readonly stack: string;
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
1045
|
/**
|
|
1036
1046
|
* Options for retrieving the object metadata nad payload.
|
|
1037
1047
|
*/
|
|
@@ -1060,13 +1070,6 @@ interface R2HTTPMetadata {
|
|
|
1060
1070
|
cacheExpiry?: Date;
|
|
1061
1071
|
}
|
|
1062
1072
|
|
|
1063
|
-
/**
|
|
1064
|
-
* Options for retrieving the object metadata.
|
|
1065
|
-
*/
|
|
1066
|
-
interface R2HeadOptions {
|
|
1067
|
-
onlyIf?: R2Conditional | Headers;
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
1073
|
interface R2ListOptions {
|
|
1071
1074
|
limit?: number;
|
|
1072
1075
|
prefix?: string;
|
|
@@ -1126,13 +1129,12 @@ interface R2PutOptions {
|
|
|
1126
1129
|
httpMetadata?: R2HTTPMetadata | Headers;
|
|
1127
1130
|
customMetadata?: Record<string, string>;
|
|
1128
1131
|
md5?: ArrayBuffer | string;
|
|
1129
|
-
sha1?: ArrayBuffer | string;
|
|
1130
1132
|
}
|
|
1131
1133
|
|
|
1132
|
-
|
|
1133
|
-
offset: number;
|
|
1134
|
-
length: number
|
|
1135
|
-
}
|
|
1134
|
+
declare type R2Range =
|
|
1135
|
+
| { offset: number; length?: number }
|
|
1136
|
+
| { offset?: number; length: number }
|
|
1137
|
+
| { suffix: number };
|
|
1136
1138
|
|
|
1137
1139
|
interface ReadResult {
|
|
1138
1140
|
value?: any;
|
|
@@ -1540,7 +1542,7 @@ declare type StreamPipeOptions = PipeToOptions;
|
|
|
1540
1542
|
|
|
1541
1543
|
interface StreamQueuingStrategy {
|
|
1542
1544
|
highWaterMark?: number;
|
|
1543
|
-
size(chunk:
|
|
1545
|
+
size(chunk: any): number;
|
|
1544
1546
|
}
|
|
1545
1547
|
|
|
1546
1548
|
declare abstract class SubtleCrypto {
|
|
@@ -2013,3 +2015,7 @@ declare type PagesPluginFunction<
|
|
|
2013
2015
|
> = (
|
|
2014
2016
|
context: EventPluginContext<Env, Params, Data, PluginArgs>
|
|
2015
2017
|
) => Response | Promise<Response>;
|
|
2018
|
+
|
|
2019
|
+
declare module "assets:*" {
|
|
2020
|
+
export const onRequest: PagesFunction;
|
|
2021
|
+
}
|