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

Commit 402e4cc

Browse files
author
autodecl-bot[bot]
authored
Updated types for 2022-04-15 (#218)
Co-authored-by: autodecl-bot[bot] <91285878+autodecl-bot[bot]@users.noreply.github.com>
1 parent 8f52551 commit 402e4cc

File tree

3 files changed

+68
-83
lines changed

3 files changed

+68
-83
lines changed

.changeset/2022-04-15.md

+5
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-04-15

index.d.ts

+25-21
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,6 @@ interface DurableObject {
345345
fetch(request: Request): Promise<Response>;
346346
}
347347

348-
interface DurableObjectGetAlarmOptions {
349-
allowConcurrency?: boolean;
350-
}
351-
352348
interface DurableObjectGetOptions {
353349
allowConcurrency?: boolean;
354350
noCache?: boolean;
@@ -389,11 +385,6 @@ interface DurableObjectPutOptions {
389385
noCache?: boolean;
390386
}
391387

392-
interface DurableObjectSetAlarmOptions {
393-
allowConcurrency?: boolean;
394-
allowUnconfirmed?: boolean;
395-
}
396-
397388
interface DurableObjectState {
398389
waitUntil(promise: Promise<any>): void;
399390
readonly id: DurableObjectId | string;
@@ -428,8 +419,17 @@ interface DurableObjectStorage {
428419
transaction<T>(
429420
closure: (txn: DurableObjectTransaction) => Promise<T>
430421
): Promise<T>;
431-
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<Date | null>;
432-
setAlarm(arg2: Date, options?: DurableObjectSetAlarmOptions): Promise<void>;
422+
getAlarm(
423+
options?: DurableObjectStorageOperationsGetAlarmOptions
424+
): Promise<Date | null>;
425+
setAlarm(
426+
arg2: Date,
427+
options?: DurableObjectStorageOperationsSetAlarmOptions
428+
): Promise<void>;
429+
}
430+
431+
interface DurableObjectStorageOperationsGetAlarmOptions {
432+
allowConcurrency?: boolean;
433433
}
434434

435435
/**
@@ -451,6 +451,11 @@ declare type DurableObjectStorageOperationsListOptions =
451451
*/
452452
declare type DurableObjectStorageOperationsPutOptions = DurableObjectPutOptions;
453453

454+
interface DurableObjectStorageOperationsSetAlarmOptions {
455+
allowConcurrency?: boolean;
456+
allowUnconfirmed?: boolean;
457+
}
458+
454459
interface DurableObjectStub extends Fetcher {
455460
readonly id: DurableObjectId;
456461
readonly name?: string;
@@ -477,8 +482,13 @@ interface DurableObjectTransaction {
477482
delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
478483
delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
479484
rollback(): void;
480-
getAlarm(options?: DurableObjectGetAlarmOptions): Promise<Date | null>;
481-
setAlarm(arg2: Date, options?: DurableObjectSetAlarmOptions): Promise<void>;
485+
getAlarm(
486+
options?: DurableObjectStorageOperationsGetAlarmOptions
487+
): Promise<Date | null>;
488+
setAlarm(
489+
arg2: Date,
490+
options?: DurableObjectStorageOperationsSetAlarmOptions
491+
): Promise<void>;
482492
}
483493

484494
interface Element {
@@ -993,13 +1003,7 @@ interface R2Bucket {
9931003
get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
9941004
put(
9951005
key: string,
996-
value:
997-
| ReadableStream
998-
| ArrayBuffer
999-
| ArrayBufferView
1000-
| string
1001-
| null
1002-
| Blob,
1006+
value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null,
10031007
options?: R2PutOptions
10041008
): Promise<R2Object>;
10051009
delete(key: string): Promise<void>;
@@ -1073,7 +1077,7 @@ interface R2ListOptions {
10731077
* }
10741078
* ```
10751079
*/
1076-
include?: ("httpMetadata" | "customMetadata")[];
1080+
include: ("httpMetadata" | "customMetadata")[];
10771081
}
10781082

10791083
/**

src/workers.json

+38-62
Original file line numberDiff line numberDiff line change
@@ -1914,23 +1914,6 @@
19141914
],
19151915
"kind": "struct"
19161916
},
1917-
"DurableObjectGetAlarmOptions": {
1918-
"name": "DurableObjectGetAlarmOptions",
1919-
"members": [
1920-
{
1921-
"name": "allowConcurrency",
1922-
"type": {
1923-
"name": "boolean",
1924-
"optional": true
1925-
}
1926-
}
1927-
],
1928-
"comment": {
1929-
"text": "",
1930-
"renamed": true
1931-
},
1932-
"kind": "struct"
1933-
},
19341917
"DurableObjectGetOptions": {
19351918
"name": "DurableObjectGetOptions",
19361919
"members": [
@@ -2156,30 +2139,6 @@
21562139
],
21572140
"kind": "struct"
21582141
},
2159-
"DurableObjectSetAlarmOptions": {
2160-
"name": "DurableObjectSetAlarmOptions",
2161-
"members": [
2162-
{
2163-
"name": "allowConcurrency",
2164-
"type": {
2165-
"name": "boolean",
2166-
"optional": true
2167-
}
2168-
},
2169-
{
2170-
"name": "allowUnconfirmed",
2171-
"type": {
2172-
"name": "boolean",
2173-
"optional": true
2174-
}
2175-
}
2176-
],
2177-
"comment": {
2178-
"text": "",
2179-
"renamed": true
2180-
},
2181-
"kind": "struct"
2182-
},
21832142
"DurableObjectState": {
21842143
"name": "DurableObjectState",
21852144
"members": [
@@ -2608,7 +2567,7 @@
26082567
{
26092568
"name": "options",
26102569
"type": {
2611-
"name": "DurableObjectGetAlarmOptions",
2570+
"name": "DurableObjectStorageOperationsGetAlarmOptions",
26122571
"optional": true
26132572
}
26142573
}
@@ -2644,7 +2603,7 @@
26442603
{
26452604
"name": "options",
26462605
"type": {
2647-
"name": "DurableObjectSetAlarmOptions",
2606+
"name": "DurableObjectStorageOperationsSetAlarmOptions",
26482607
"optional": true
26492608
}
26502609
}
@@ -2662,6 +2621,19 @@
26622621
],
26632622
"kind": "class"
26642623
},
2624+
"DurableObjectStorageOperationsGetAlarmOptions": {
2625+
"name": "DurableObjectStorageOperationsGetAlarmOptions",
2626+
"members": [
2627+
{
2628+
"name": "allowConcurrency",
2629+
"type": {
2630+
"name": "boolean",
2631+
"optional": true
2632+
}
2633+
}
2634+
],
2635+
"kind": "struct"
2636+
},
26652637
"DurableObjectStorageOperationsGetOptions": {
26662638
"name": "DurableObjectStorageOperationsGetOptions",
26672639
"type": {
@@ -2695,6 +2667,26 @@
26952667
},
26962668
"kind": "typedef"
26972669
},
2670+
"DurableObjectStorageOperationsSetAlarmOptions": {
2671+
"name": "DurableObjectStorageOperationsSetAlarmOptions",
2672+
"members": [
2673+
{
2674+
"name": "allowConcurrency",
2675+
"type": {
2676+
"name": "boolean",
2677+
"optional": true
2678+
}
2679+
},
2680+
{
2681+
"name": "allowUnconfirmed",
2682+
"type": {
2683+
"name": "boolean",
2684+
"optional": true
2685+
}
2686+
}
2687+
],
2688+
"kind": "struct"
2689+
},
26982690
"DurableObjectStub": {
26992691
"name": "DurableObjectStub",
27002692
"members": [
@@ -3004,7 +2996,7 @@
30042996
{
30052997
"name": "options",
30062998
"type": {
3007-
"name": "DurableObjectGetAlarmOptions",
2999+
"name": "DurableObjectStorageOperationsGetAlarmOptions",
30083000
"optional": true
30093001
}
30103002
}
@@ -3040,7 +3032,7 @@
30403032
{
30413033
"name": "options",
30423034
"type": {
3043-
"name": "DurableObjectSetAlarmOptions",
3035+
"name": "DurableObjectStorageOperationsSetAlarmOptions",
30443036
"optional": true
30453037
}
30463038
}
@@ -7281,9 +7273,6 @@
72817273
},
72827274
{
72837275
"name": "null"
7284-
},
7285-
{
7286-
"name": "Blob"
72877276
}
72887277
]
72897278
}
@@ -7563,8 +7552,7 @@
75637552
}
75647553
]
75657554
}
7566-
],
7567-
"optional": true
7555+
]
75687556
},
75697557
"comment": {
75707558
"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```"
@@ -7894,18 +7882,6 @@
78947882
},
78957883
"kind": "struct"
78967884
},
7897-
"QueuingStrategyInit": {
7898-
"name": "QueuingStrategyInit",
7899-
"members": [
7900-
{
7901-
"name": "highWaterMark",
7902-
"type": {
7903-
"name": "double"
7904-
}
7905-
}
7906-
],
7907-
"kind": "struct"
7908-
},
79097885
"ReadResult": {
79107886
"name": "ReadResult",
79117887
"members": [

0 commit comments

Comments
 (0)