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-04-15 (#218)
Browse files Browse the repository at this point in the history
Co-authored-by: autodecl-bot[bot] <91285878+autodecl-bot[bot]@users.noreply.github.com>
  • Loading branch information
autodecl-bot[bot] committed Apr 21, 2022
1 parent 8f52551 commit 402e4cc
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 83 deletions.
5 changes: 5 additions & 0 deletions .changeset/2022-04-15.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/workers-types": minor
---

Updated auto-generated types @ 2022-04-15
46 changes: 25 additions & 21 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,6 @@ interface DurableObject {
fetch(request: Request): Promise<Response>;
}

interface DurableObjectGetAlarmOptions {
allowConcurrency?: boolean;
}

interface DurableObjectGetOptions {
allowConcurrency?: boolean;
noCache?: boolean;
Expand Down Expand Up @@ -389,11 +385,6 @@ interface DurableObjectPutOptions {
noCache?: boolean;
}

interface DurableObjectSetAlarmOptions {
allowConcurrency?: boolean;
allowUnconfirmed?: boolean;
}

interface DurableObjectState {
waitUntil(promise: Promise<any>): void;
readonly id: DurableObjectId | string;
Expand Down Expand Up @@ -428,8 +419,17 @@ interface DurableObjectStorage {
transaction<T>(
closure: (txn: DurableObjectTransaction) => Promise<T>
): Promise<T>;
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<Date | null>;
setAlarm(arg2: Date, options?: DurableObjectSetAlarmOptions): Promise<void>;
getAlarm(
options?: DurableObjectStorageOperationsGetAlarmOptions
): Promise<Date | null>;
setAlarm(
arg2: Date,
options?: DurableObjectStorageOperationsSetAlarmOptions
): Promise<void>;
}

interface DurableObjectStorageOperationsGetAlarmOptions {
allowConcurrency?: boolean;
}

/**
Expand All @@ -451,6 +451,11 @@ declare type DurableObjectStorageOperationsListOptions =
*/
declare type DurableObjectStorageOperationsPutOptions = DurableObjectPutOptions;

interface DurableObjectStorageOperationsSetAlarmOptions {
allowConcurrency?: boolean;
allowUnconfirmed?: boolean;
}

interface DurableObjectStub extends Fetcher {
readonly id: DurableObjectId;
readonly name?: string;
Expand All @@ -477,8 +482,13 @@ interface DurableObjectTransaction {
delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
rollback(): void;
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<Date | null>;
setAlarm(arg2: Date, options?: DurableObjectSetAlarmOptions): Promise<void>;
getAlarm(
options?: DurableObjectStorageOperationsGetAlarmOptions
): Promise<Date | null>;
setAlarm(
arg2: Date,
options?: DurableObjectStorageOperationsSetAlarmOptions
): Promise<void>;
}

interface Element {
Expand Down Expand Up @@ -993,13 +1003,7 @@ interface R2Bucket {
get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
put(
key: string,
value:
| ReadableStream
| ArrayBuffer
| ArrayBufferView
| string
| null
| Blob,
value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null,
options?: R2PutOptions
): Promise<R2Object>;
delete(key: string): Promise<void>;
Expand Down Expand Up @@ -1073,7 +1077,7 @@ interface R2ListOptions {
* }
* ```
*/
include?: ("httpMetadata" | "customMetadata")[];
include: ("httpMetadata" | "customMetadata")[];
}

/**
Expand Down
100 changes: 38 additions & 62 deletions src/workers.json
Original file line number Diff line number Diff line change
Expand Up @@ -1914,23 +1914,6 @@
],
"kind": "struct"
},
"DurableObjectGetAlarmOptions": {
"name": "DurableObjectGetAlarmOptions",
"members": [
{
"name": "allowConcurrency",
"type": {
"name": "boolean",
"optional": true
}
}
],
"comment": {
"text": "",
"renamed": true
},
"kind": "struct"
},
"DurableObjectGetOptions": {
"name": "DurableObjectGetOptions",
"members": [
Expand Down Expand Up @@ -2156,30 +2139,6 @@
],
"kind": "struct"
},
"DurableObjectSetAlarmOptions": {
"name": "DurableObjectSetAlarmOptions",
"members": [
{
"name": "allowConcurrency",
"type": {
"name": "boolean",
"optional": true
}
},
{
"name": "allowUnconfirmed",
"type": {
"name": "boolean",
"optional": true
}
}
],
"comment": {
"text": "",
"renamed": true
},
"kind": "struct"
},
"DurableObjectState": {
"name": "DurableObjectState",
"members": [
Expand Down Expand Up @@ -2608,7 +2567,7 @@
{
"name": "options",
"type": {
"name": "DurableObjectGetAlarmOptions",
"name": "DurableObjectStorageOperationsGetAlarmOptions",
"optional": true
}
}
Expand Down Expand Up @@ -2644,7 +2603,7 @@
{
"name": "options",
"type": {
"name": "DurableObjectSetAlarmOptions",
"name": "DurableObjectStorageOperationsSetAlarmOptions",
"optional": true
}
}
Expand All @@ -2662,6 +2621,19 @@
],
"kind": "class"
},
"DurableObjectStorageOperationsGetAlarmOptions": {
"name": "DurableObjectStorageOperationsGetAlarmOptions",
"members": [
{
"name": "allowConcurrency",
"type": {
"name": "boolean",
"optional": true
}
}
],
"kind": "struct"
},
"DurableObjectStorageOperationsGetOptions": {
"name": "DurableObjectStorageOperationsGetOptions",
"type": {
Expand Down Expand Up @@ -2695,6 +2667,26 @@
},
"kind": "typedef"
},
"DurableObjectStorageOperationsSetAlarmOptions": {
"name": "DurableObjectStorageOperationsSetAlarmOptions",
"members": [
{
"name": "allowConcurrency",
"type": {
"name": "boolean",
"optional": true
}
},
{
"name": "allowUnconfirmed",
"type": {
"name": "boolean",
"optional": true
}
}
],
"kind": "struct"
},
"DurableObjectStub": {
"name": "DurableObjectStub",
"members": [
Expand Down Expand Up @@ -3004,7 +2996,7 @@
{
"name": "options",
"type": {
"name": "DurableObjectGetAlarmOptions",
"name": "DurableObjectStorageOperationsGetAlarmOptions",
"optional": true
}
}
Expand Down Expand Up @@ -3040,7 +3032,7 @@
{
"name": "options",
"type": {
"name": "DurableObjectSetAlarmOptions",
"name": "DurableObjectStorageOperationsSetAlarmOptions",
"optional": true
}
}
Expand Down Expand Up @@ -7281,9 +7273,6 @@
},
{
"name": "null"
},
{
"name": "Blob"
}
]
}
Expand Down Expand Up @@ -7563,8 +7552,7 @@
}
]
}
],
"optional": true
]
},
"comment": {
"text": "If you populate this array, then items returned will include this metadata.\nA tradeoff is that fewer results may be returned depending on how big this\ndata is. For now the caps are TBD but expect the total memory usage for a list\noperation may need to be <1MB or even <128kb depending on how many list operations\nyou are sending into one bucket. Make sure to look at `truncated` for the result\nrather than having logic like\n```\nwhile (listed.length < limit) {\n listed = myBucket.list({ limit, include: ['customMetadata'] })\n}\n```"
Expand Down Expand Up @@ -7894,18 +7882,6 @@
},
"kind": "struct"
},
"QueuingStrategyInit": {
"name": "QueuingStrategyInit",
"members": [
{
"name": "highWaterMark",
"type": {
"name": "double"
}
}
],
"kind": "struct"
},
"ReadResult": {
"name": "ReadResult",
"members": [
Expand Down

0 comments on commit 402e4cc

Please sign in to comment.