@cloudflare/workers-types 3.5.1 → 3.6.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.
Files changed (2) hide show
  1. package/index.d.ts +25 -21
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -345,10 +345,6 @@ interface DurableObject {
345
345
  fetch(request: Request): Promise<Response>;
346
346
  }
347
347
 
348
- interface DurableObjectGetAlarmOptions {
349
- allowConcurrency?: boolean;
350
- }
351
-
352
348
  interface DurableObjectGetOptions {
353
349
  allowConcurrency?: boolean;
354
350
  noCache?: boolean;
@@ -389,11 +385,6 @@ interface DurableObjectPutOptions {
389
385
  noCache?: boolean;
390
386
  }
391
387
 
392
- interface DurableObjectSetAlarmOptions {
393
- allowConcurrency?: boolean;
394
- allowUnconfirmed?: boolean;
395
- }
396
-
397
388
  interface DurableObjectState {
398
389
  waitUntil(promise: Promise<any>): void;
399
390
  readonly id: DurableObjectId | string;
@@ -428,8 +419,17 @@ interface DurableObjectStorage {
428
419
  transaction<T>(
429
420
  closure: (txn: DurableObjectTransaction) => Promise<T>
430
421
  ): 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;
433
433
  }
434
434
 
435
435
  /**
@@ -451,6 +451,11 @@ declare type DurableObjectStorageOperationsListOptions =
451
451
  */
452
452
  declare type DurableObjectStorageOperationsPutOptions = DurableObjectPutOptions;
453
453
 
454
+ interface DurableObjectStorageOperationsSetAlarmOptions {
455
+ allowConcurrency?: boolean;
456
+ allowUnconfirmed?: boolean;
457
+ }
458
+
454
459
  interface DurableObjectStub extends Fetcher {
455
460
  readonly id: DurableObjectId;
456
461
  readonly name?: string;
@@ -477,8 +482,13 @@ interface DurableObjectTransaction {
477
482
  delete(key: string, options?: DurableObjectPutOptions): Promise<boolean>;
478
483
  delete(keys: string[], options?: DurableObjectPutOptions): Promise<number>;
479
484
  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>;
482
492
  }
483
493
 
484
494
  interface Element {
@@ -993,13 +1003,7 @@ interface R2Bucket {
993
1003
  get(key: string, options?: R2GetOptions): Promise<R2ObjectBody | null>;
994
1004
  put(
995
1005
  key: string,
996
- value:
997
- | ReadableStream
998
- | ArrayBuffer
999
- | ArrayBufferView
1000
- | string
1001
- | null
1002
- | Blob,
1006
+ value: ReadableStream | ArrayBuffer | ArrayBufferView | string | null,
1003
1007
  options?: R2PutOptions
1004
1008
  ): Promise<R2Object>;
1005
1009
  delete(key: string): Promise<void>;
@@ -1073,7 +1077,7 @@ interface R2ListOptions {
1073
1077
  * }
1074
1078
  * ```
1075
1079
  */
1076
- include?: ("httpMetadata" | "customMetadata")[];
1080
+ include: ("httpMetadata" | "customMetadata")[];
1077
1081
  }
1078
1082
 
1079
1083
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/workers-types",
3
- "version": "3.5.1",
3
+ "version": "3.6.0",
4
4
  "description": "TypeScript typings for Cloudflare Workers",
5
5
  "repository": {
6
6
  "type": "git",