Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 9409be6

Browse files
autodecl-bot[bot]vlovich
authored andcommitted
Updated types for 2022-05-11
1 parent 4d2664b commit 9409be6

File tree

3 files changed

+98
-56
lines changed

3 files changed

+98
-56
lines changed

.changeset/2022-05-11.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/workers-types": minor
3+
---
4+
5+
Updated auto-generated types @ 2022-05-11

index.d.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ interface DurableObjectId {
363363

364364
interface DurableObjectListOptions {
365365
start?: string;
366+
startAfter?: string;
366367
end?: string;
367368
prefix?: string;
368369
reverse?: boolean;
@@ -622,7 +623,7 @@ declare class ExtendableEvent extends Event {
622623
waitUntil(promise: Promise<any>): void;
623624
}
624625

625-
declare abstract class FetchEvent extends ExtendableEvent {
626+
declare abstract class FetchEvent extends Event {
626627
readonly request: Request;
627628
respondWith(promise: Response | Promise<Response>): void;
628629
passThroughOnException(): void;
@@ -1002,8 +1003,19 @@ interface QueuingStrategyInit {
10021003
* An instance of the R2 bucket binding.
10031004
*/
10041005
interface R2Bucket {
1005-
head(key: string, options?: R2HeadOptions): Promise<R2Object | null>;
1006-
get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
1006+
head(key: string): Promise<R2Object | null>;
1007+
get(key: string): Promise<R2ObjectBody | null>;
1008+
/**
1009+
* Returns R2Object on a failure of the conditional specified in onlyIf.
1010+
*/
1011+
get(
1012+
key: string,
1013+
options: R2GetOptions
1014+
): Promise<R2ObjectBody | R2Object | null>;
1015+
get(
1016+
key: string,
1017+
options?: R2GetOptions
1018+
): Promise<R2ObjectBody | R2Object | null>;
10071019
put(
10081020
key: string,
10091021
value:
@@ -1057,13 +1069,6 @@ interface R2HTTPMetadata {
10571069
cacheExpiry?: Date;
10581070
}
10591071

1060-
/**
1061-
* Options for retrieving the object metadata.
1062-
*/
1063-
interface R2HeadOptions {
1064-
onlyIf?: R2Conditional | Headers;
1065-
}
1066-
10671072
interface R2ListOptions {
10681073
limit?: number;
10691074
prefix?: string;
@@ -1123,7 +1128,6 @@ interface R2PutOptions {
11231128
httpMetadata?: R2HTTPMetadata | Headers;
11241129
customMetadata?: Record<string, string>;
11251130
md5?: ArrayBuffer | string;
1126-
sha1?: ArrayBuffer | string;
11271131
}
11281132

11291133
interface R2Range {
@@ -1537,7 +1541,7 @@ declare type StreamPipeOptions = PipeToOptions;
15371541

15381542
interface StreamQueuingStrategy {
15391543
highWaterMark?: number;
1540-
size(chunk: ArrayBuffer): number;
1544+
size(chunk: any): number;
15411545
}
15421546

15431547
declare abstract class SubtleCrypto {

src/workers.json

Lines changed: 77 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,13 @@
20132013
"optional": true
20142014
}
20152015
},
2016+
{
2017+
"name": "startAfter",
2018+
"type": {
2019+
"name": "string",
2020+
"optional": true
2021+
}
2022+
},
20162023
{
20172024
"name": "end",
20182025
"type": {
@@ -4355,7 +4362,7 @@
43554362
],
43564363
"extends": [
43574364
{
4358-
"name": "ExtendableEvent"
4365+
"name": "Event"
43594366
}
43604367
],
43614368
"kind": "class"
@@ -7270,6 +7277,64 @@
72707277
"members": [
72717278
{
72727279
"name": "head",
7280+
"type": {
7281+
"params": [
7282+
{
7283+
"name": "key",
7284+
"type": {
7285+
"name": "string"
7286+
}
7287+
}
7288+
],
7289+
"returns": {
7290+
"name": "Promise",
7291+
"args": [
7292+
{
7293+
"name": "|",
7294+
"args": [
7295+
{
7296+
"name": "R2Object"
7297+
},
7298+
{
7299+
"name": "null"
7300+
}
7301+
]
7302+
}
7303+
]
7304+
}
7305+
}
7306+
},
7307+
{
7308+
"name": "get",
7309+
"type": {
7310+
"params": [
7311+
{
7312+
"name": "key",
7313+
"type": {
7314+
"name": "string"
7315+
}
7316+
}
7317+
],
7318+
"returns": {
7319+
"name": "Promise",
7320+
"args": [
7321+
{
7322+
"name": "|",
7323+
"args": [
7324+
{
7325+
"name": "R2ObjectBody"
7326+
},
7327+
{
7328+
"name": "null"
7329+
}
7330+
]
7331+
}
7332+
]
7333+
}
7334+
}
7335+
},
7336+
{
7337+
"name": "get",
72737338
"type": {
72747339
"params": [
72757340
{
@@ -7281,8 +7346,7 @@
72817346
{
72827347
"name": "options",
72837348
"type": {
7284-
"name": "R2HeadOptions",
7285-
"optional": true
7349+
"name": "R2GetOptions"
72867350
}
72877351
}
72887352
],
@@ -7292,6 +7356,9 @@
72927356
{
72937357
"name": "|",
72947358
"args": [
7359+
{
7360+
"name": "R2ObjectBody"
7361+
},
72957362
{
72967363
"name": "R2Object"
72977364
},
@@ -7302,6 +7369,9 @@
73027369
}
73037370
]
73047371
}
7372+
},
7373+
"comment": {
7374+
"text": "Returns R2Object on a failure of the conditional specified in onlyIf."
73057375
}
73067376
},
73077377
{
@@ -7331,6 +7401,9 @@
73317401
{
73327402
"name": "R2ObjectBody"
73337403
},
7404+
{
7405+
"name": "R2Object"
7406+
},
73347407
{
73357408
"name": "null"
73367409
}
@@ -7566,31 +7639,6 @@
75667639
},
75677640
"kind": "struct"
75687641
},
7569-
"R2HeadOptions": {
7570-
"name": "R2HeadOptions",
7571-
"members": [
7572-
{
7573-
"name": "onlyIf",
7574-
"type": {
7575-
"name": "|",
7576-
"args": [
7577-
{
7578-
"name": "R2Conditional"
7579-
},
7580-
{
7581-
"name": "Headers"
7582-
}
7583-
],
7584-
"optional": true
7585-
}
7586-
}
7587-
],
7588-
"comment": {
7589-
"text": "Options for retrieving the object metadata.",
7590-
"renamed": true
7591-
},
7592-
"kind": "struct"
7593-
},
75947642
"R2ListOptions": {
75957643
"name": "R2ListOptions",
75967644
"members": [
@@ -7924,21 +7972,6 @@
79247972
],
79257973
"optional": true
79267974
}
7927-
},
7928-
{
7929-
"name": "sha1",
7930-
"type": {
7931-
"name": "|",
7932-
"args": [
7933-
{
7934-
"name": "ArrayBuffer"
7935-
},
7936-
{
7937-
"name": "string"
7938-
}
7939-
],
7940-
"optional": true
7941-
}
79427975
}
79437976
],
79447977
"comment": {
@@ -10668,7 +10701,7 @@
1066810701
{
1066910702
"name": "chunk",
1067010703
"type": {
10671-
"name": "ArrayBuffer"
10704+
"name": "any"
1067210705
}
1067310706
}
1067410707
],

0 commit comments

Comments
 (0)