@workers-community/workers-types 4.20250903.0 → 4.20250904.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 (3) hide show
  1. package/index.d.ts +17 -1
  2. package/index.ts +17 -1
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -514,7 +514,7 @@ interface DurableObjectId {
514
514
  equals(other: DurableObjectId): boolean;
515
515
  readonly name?: string;
516
516
  }
517
- interface DurableObjectNamespace<
517
+ declare abstract class DurableObjectNamespace<
518
518
  T extends Rpc.DurableObjectBranded | undefined = undefined,
519
519
  > {
520
520
  newUniqueId(
@@ -553,6 +553,7 @@ interface DurableObjectNamespaceGetDurableObjectOptions {
553
553
  }
554
554
  interface DurableObjectState {
555
555
  waitUntil(promise: Promise<any>): void;
556
+ props: any;
556
557
  readonly id: DurableObjectId;
557
558
  readonly storage: DurableObjectStorage;
558
559
  container?: Container;
@@ -633,6 +634,7 @@ interface DurableObjectStorage {
633
634
  deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
634
635
  sync(): Promise<void>;
635
636
  sql: SqlStorage;
637
+ kv: SyncKvStorage;
636
638
  transactionSync<T>(closure: () => T): T;
637
639
  getCurrentBookmark(): Promise<string>;
638
640
  getBookmarkForTime(timestamp: number | Date): Promise<string>;
@@ -3089,6 +3091,20 @@ interface MessagePort extends EventTarget {
3089
3091
  interface MessagePortPostMessageOptions {
3090
3092
  transfer?: any[];
3091
3093
  }
3094
+ interface SyncKvStorage {
3095
+ get<T = unknown>(key: string): T | undefined;
3096
+ list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
3097
+ put<T>(key: string, value: T): void;
3098
+ delete(key: string): boolean;
3099
+ }
3100
+ interface SyncKvListOptions {
3101
+ start?: string;
3102
+ startAfter?: string;
3103
+ end?: string;
3104
+ prefix?: string;
3105
+ reverse?: boolean;
3106
+ limit?: number;
3107
+ }
3092
3108
  type AiImageClassificationInput = {
3093
3109
  image: number[];
3094
3110
  };
package/index.ts CHANGED
@@ -519,7 +519,7 @@ export interface DurableObjectId {
519
519
  equals(other: DurableObjectId): boolean;
520
520
  readonly name?: string;
521
521
  }
522
- export interface DurableObjectNamespace<
522
+ export declare abstract class DurableObjectNamespace<
523
523
  T extends Rpc.DurableObjectBranded | undefined = undefined,
524
524
  > {
525
525
  newUniqueId(
@@ -558,6 +558,7 @@ export interface DurableObjectNamespaceGetDurableObjectOptions {
558
558
  }
559
559
  export interface DurableObjectState {
560
560
  waitUntil(promise: Promise<any>): void;
561
+ props: any;
561
562
  readonly id: DurableObjectId;
562
563
  readonly storage: DurableObjectStorage;
563
564
  container?: Container;
@@ -638,6 +639,7 @@ export interface DurableObjectStorage {
638
639
  deleteAlarm(options?: DurableObjectSetAlarmOptions): Promise<void>;
639
640
  sync(): Promise<void>;
640
641
  sql: SqlStorage;
642
+ kv: SyncKvStorage;
641
643
  transactionSync<T>(closure: () => T): T;
642
644
  getCurrentBookmark(): Promise<string>;
643
645
  getBookmarkForTime(timestamp: number | Date): Promise<string>;
@@ -3100,6 +3102,20 @@ export interface MessagePort extends EventTarget {
3100
3102
  export interface MessagePortPostMessageOptions {
3101
3103
  transfer?: any[];
3102
3104
  }
3105
+ export interface SyncKvStorage {
3106
+ get<T = unknown>(key: string): T | undefined;
3107
+ list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
3108
+ put<T>(key: string, value: T): void;
3109
+ delete(key: string): boolean;
3110
+ }
3111
+ export interface SyncKvListOptions {
3112
+ start?: string;
3113
+ startAfter?: string;
3114
+ end?: string;
3115
+ prefix?: string;
3116
+ reverse?: boolean;
3117
+ limit?: number;
3118
+ }
3103
3119
  export type AiImageClassificationInput = {
3104
3120
  image: number[];
3105
3121
  };
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "author": "Workers Community",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20250903.0",
10
+ "version": "4.20250904.0",
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./index.d.ts",