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

Commit

Permalink
Updated types for 2022-05-11
Browse files Browse the repository at this point in the history
  • Loading branch information
autodecl-bot[bot] authored and vlovich committed May 19, 2022
1 parent 4d2664b commit 9409be6
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 56 deletions.
5 changes: 5 additions & 0 deletions .changeset/2022-05-11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/workers-types": minor
---

Updated auto-generated types @ 2022-05-11
28 changes: 16 additions & 12 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ interface DurableObjectId {

interface DurableObjectListOptions {
start?: string;
startAfter?: string;
end?: string;
prefix?: string;
reverse?: boolean;
Expand Down Expand Up @@ -622,7 +623,7 @@ declare class ExtendableEvent extends Event {
waitUntil(promise: Promise<any>): void;
}

declare abstract class FetchEvent extends ExtendableEvent {
declare abstract class FetchEvent extends Event {
readonly request: Request;
respondWith(promise: Response | Promise<Response>): void;
passThroughOnException(): void;
Expand Down Expand Up @@ -1002,8 +1003,19 @@ interface QueuingStrategyInit {
* An instance of the R2 bucket binding.
*/
interface R2Bucket {
head(key: string, options?: R2HeadOptions): Promise<R2Object | null>;
get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
head(key: string): Promise<R2Object | null>;
get(key: string): Promise<R2ObjectBody | null>;
/**
* Returns R2Object on a failure of the conditional specified in onlyIf.
*/
get(
key: string,
options: R2GetOptions
): Promise<R2ObjectBody | R2Object | null>;
get(
key: string,
options?: R2GetOptions
): Promise<R2ObjectBody | R2Object | null>;
put(
key: string,
value:
Expand Down Expand Up @@ -1057,13 +1069,6 @@ interface R2HTTPMetadata {
cacheExpiry?: Date;
}

/**
* Options for retrieving the object metadata.
*/
interface R2HeadOptions {
onlyIf?: R2Conditional | Headers;
}

interface R2ListOptions {
limit?: number;
prefix?: string;
Expand Down Expand Up @@ -1123,7 +1128,6 @@ interface R2PutOptions {
httpMetadata?: R2HTTPMetadata | Headers;
customMetadata?: Record<string, string>;
md5?: ArrayBuffer | string;
sha1?: ArrayBuffer | string;
}

interface R2Range {
Expand Down Expand Up @@ -1537,7 +1541,7 @@ declare type StreamPipeOptions = PipeToOptions;

interface StreamQueuingStrategy {
highWaterMark?: number;
size(chunk: ArrayBuffer): number;
size(chunk: any): number;
}

declare abstract class SubtleCrypto {
Expand Down
121 changes: 77 additions & 44 deletions src/workers.json
Original file line number Diff line number Diff line change
Expand Up @@ -2013,6 +2013,13 @@
"optional": true
}
},
{
"name": "startAfter",
"type": {
"name": "string",
"optional": true
}
},
{
"name": "end",
"type": {
Expand Down Expand Up @@ -4355,7 +4362,7 @@
],
"extends": [
{
"name": "ExtendableEvent"
"name": "Event"
}
],
"kind": "class"
Expand Down Expand Up @@ -7270,6 +7277,64 @@
"members": [
{
"name": "head",
"type": {
"params": [
{
"name": "key",
"type": {
"name": "string"
}
}
],
"returns": {
"name": "Promise",
"args": [
{
"name": "|",
"args": [
{
"name": "R2Object"
},
{
"name": "null"
}
]
}
]
}
}
},
{
"name": "get",
"type": {
"params": [
{
"name": "key",
"type": {
"name": "string"
}
}
],
"returns": {
"name": "Promise",
"args": [
{
"name": "|",
"args": [
{
"name": "R2ObjectBody"
},
{
"name": "null"
}
]
}
]
}
}
},
{
"name": "get",
"type": {
"params": [
{
Expand All @@ -7281,8 +7346,7 @@
{
"name": "options",
"type": {
"name": "R2HeadOptions",
"optional": true
"name": "R2GetOptions"
}
}
],
Expand All @@ -7292,6 +7356,9 @@
{
"name": "|",
"args": [
{
"name": "R2ObjectBody"
},
{
"name": "R2Object"
},
Expand All @@ -7302,6 +7369,9 @@
}
]
}
},
"comment": {
"text": "Returns R2Object on a failure of the conditional specified in onlyIf."
}
},
{
Expand Down Expand Up @@ -7331,6 +7401,9 @@
{
"name": "R2ObjectBody"
},
{
"name": "R2Object"
},
{
"name": "null"
}
Expand Down Expand Up @@ -7566,31 +7639,6 @@
},
"kind": "struct"
},
"R2HeadOptions": {
"name": "R2HeadOptions",
"members": [
{
"name": "onlyIf",
"type": {
"name": "|",
"args": [
{
"name": "R2Conditional"
},
{
"name": "Headers"
}
],
"optional": true
}
}
],
"comment": {
"text": "Options for retrieving the object metadata.",
"renamed": true
},
"kind": "struct"
},
"R2ListOptions": {
"name": "R2ListOptions",
"members": [
Expand Down Expand Up @@ -7924,21 +7972,6 @@
],
"optional": true
}
},
{
"name": "sha1",
"type": {
"name": "|",
"args": [
{
"name": "ArrayBuffer"
},
{
"name": "string"
}
],
"optional": true
}
}
],
"comment": {
Expand Down Expand Up @@ -10668,7 +10701,7 @@
{
"name": "chunk",
"type": {
"name": "ArrayBuffer"
"name": "any"
}
}
],
Expand Down

0 comments on commit 9409be6

Please sign in to comment.