@cloudflare/workers-types 4.20260404.1 → 4.20260408.1

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.
@@ -544,6 +544,9 @@ interface AlarmInvocationInfo {
544
544
  interface Cloudflare {
545
545
  readonly compatibilityFlags: Record<string, boolean>;
546
546
  }
547
+ declare abstract class ColoLocalActorNamespace {
548
+ get(actorId: string): Fetcher;
549
+ }
547
550
  interface DurableObject {
548
551
  fetch(request: Request): Response | Promise<Response>;
549
552
  connect?(socket: Socket): void | Promise<void>;
@@ -623,6 +626,7 @@ interface DurableObjectState<Props = unknown> {
623
626
  readonly id: DurableObjectId;
624
627
  readonly storage: DurableObjectStorage;
625
628
  container?: Container;
629
+ facets: DurableObjectFacets;
626
630
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
627
631
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
628
632
  getWebSockets(tag?: string): WebSocket[];
@@ -737,6 +741,22 @@ declare class WebSocketRequestResponsePair {
737
741
  get request(): string;
738
742
  get response(): string;
739
743
  }
744
+ interface DurableObjectFacets {
745
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
746
+ name: string,
747
+ getStartupOptions: () =>
748
+ | FacetStartupOptions<T>
749
+ | Promise<FacetStartupOptions<T>>,
750
+ ): Fetcher<T>;
751
+ abort(name: string, reason: any): void;
752
+ delete(name: string): void;
753
+ }
754
+ interface FacetStartupOptions<
755
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
756
+ > {
757
+ id?: DurableObjectId | string;
758
+ class: DurableObjectClass<T>;
759
+ }
740
760
  interface AnalyticsEngineDataset {
741
761
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
742
762
  }
@@ -3757,6 +3777,8 @@ type LoopbackDurableObjectClass<
3757
3777
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3758
3778
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3759
3779
  : (opts: { props?: any }) => DurableObjectClass<T>);
3780
+ interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3781
+ interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3760
3782
  interface SyncKvStorage {
3761
3783
  get<T = unknown>(key: string): T | undefined;
3762
3784
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3776,6 +3798,10 @@ interface WorkerStub {
3776
3798
  name?: string,
3777
3799
  options?: WorkerStubEntrypointOptions,
3778
3800
  ): Fetcher<T>;
3801
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3802
+ name?: string,
3803
+ options?: WorkerStubEntrypointOptions,
3804
+ ): DurableObjectClass<T>;
3779
3805
  }
3780
3806
  interface WorkerStubEntrypointOptions {
3781
3807
  props?: any;
@@ -546,6 +546,9 @@ export interface AlarmInvocationInfo {
546
546
  export interface Cloudflare {
547
547
  readonly compatibilityFlags: Record<string, boolean>;
548
548
  }
549
+ export declare abstract class ColoLocalActorNamespace {
550
+ get(actorId: string): Fetcher;
551
+ }
549
552
  export interface DurableObject {
550
553
  fetch(request: Request): Response | Promise<Response>;
551
554
  connect?(socket: Socket): void | Promise<void>;
@@ -625,6 +628,7 @@ export interface DurableObjectState<Props = unknown> {
625
628
  readonly id: DurableObjectId;
626
629
  readonly storage: DurableObjectStorage;
627
630
  container?: Container;
631
+ facets: DurableObjectFacets;
628
632
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
629
633
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
630
634
  getWebSockets(tag?: string): WebSocket[];
@@ -739,6 +743,22 @@ export declare class WebSocketRequestResponsePair {
739
743
  get request(): string;
740
744
  get response(): string;
741
745
  }
746
+ export interface DurableObjectFacets {
747
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
748
+ name: string,
749
+ getStartupOptions: () =>
750
+ | FacetStartupOptions<T>
751
+ | Promise<FacetStartupOptions<T>>,
752
+ ): Fetcher<T>;
753
+ abort(name: string, reason: any): void;
754
+ delete(name: string): void;
755
+ }
756
+ export interface FacetStartupOptions<
757
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
758
+ > {
759
+ id?: DurableObjectId | string;
760
+ class: DurableObjectClass<T>;
761
+ }
742
762
  export interface AnalyticsEngineDataset {
743
763
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
744
764
  }
@@ -3763,6 +3783,8 @@ export type LoopbackDurableObjectClass<
3763
3783
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3764
3784
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3765
3785
  : (opts: { props?: any }) => DurableObjectClass<T>);
3786
+ export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3787
+ export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3766
3788
  export interface SyncKvStorage {
3767
3789
  get<T = unknown>(key: string): T | undefined;
3768
3790
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3782,6 +3804,10 @@ export interface WorkerStub {
3782
3804
  name?: string,
3783
3805
  options?: WorkerStubEntrypointOptions,
3784
3806
  ): Fetcher<T>;
3807
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3808
+ name?: string,
3809
+ options?: WorkerStubEntrypointOptions,
3810
+ ): DurableObjectClass<T>;
3785
3811
  }
3786
3812
  export interface WorkerStubEntrypointOptions {
3787
3813
  props?: any;
@@ -544,6 +544,9 @@ interface AlarmInvocationInfo {
544
544
  interface Cloudflare {
545
545
  readonly compatibilityFlags: Record<string, boolean>;
546
546
  }
547
+ declare abstract class ColoLocalActorNamespace {
548
+ get(actorId: string): Fetcher;
549
+ }
547
550
  interface DurableObject {
548
551
  fetch(request: Request): Response | Promise<Response>;
549
552
  connect?(socket: Socket): void | Promise<void>;
@@ -623,6 +626,7 @@ interface DurableObjectState<Props = unknown> {
623
626
  readonly id: DurableObjectId;
624
627
  readonly storage: DurableObjectStorage;
625
628
  container?: Container;
629
+ facets: DurableObjectFacets;
626
630
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
627
631
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
628
632
  getWebSockets(tag?: string): WebSocket[];
@@ -737,6 +741,22 @@ declare class WebSocketRequestResponsePair {
737
741
  get request(): string;
738
742
  get response(): string;
739
743
  }
744
+ interface DurableObjectFacets {
745
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
746
+ name: string,
747
+ getStartupOptions: () =>
748
+ | FacetStartupOptions<T>
749
+ | Promise<FacetStartupOptions<T>>,
750
+ ): Fetcher<T>;
751
+ abort(name: string, reason: any): void;
752
+ delete(name: string): void;
753
+ }
754
+ interface FacetStartupOptions<
755
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
756
+ > {
757
+ id?: DurableObjectId | string;
758
+ class: DurableObjectClass<T>;
759
+ }
740
760
  interface AnalyticsEngineDataset {
741
761
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
742
762
  }
@@ -3824,6 +3844,8 @@ type LoopbackDurableObjectClass<
3824
3844
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3825
3845
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3826
3846
  : (opts: { props?: any }) => DurableObjectClass<T>);
3847
+ interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3848
+ interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3827
3849
  interface SyncKvStorage {
3828
3850
  get<T = unknown>(key: string): T | undefined;
3829
3851
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3843,6 +3865,10 @@ interface WorkerStub {
3843
3865
  name?: string,
3844
3866
  options?: WorkerStubEntrypointOptions,
3845
3867
  ): Fetcher<T>;
3868
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3869
+ name?: string,
3870
+ options?: WorkerStubEntrypointOptions,
3871
+ ): DurableObjectClass<T>;
3846
3872
  }
3847
3873
  interface WorkerStubEntrypointOptions {
3848
3874
  props?: any;
@@ -546,6 +546,9 @@ export interface AlarmInvocationInfo {
546
546
  export interface Cloudflare {
547
547
  readonly compatibilityFlags: Record<string, boolean>;
548
548
  }
549
+ export declare abstract class ColoLocalActorNamespace {
550
+ get(actorId: string): Fetcher;
551
+ }
549
552
  export interface DurableObject {
550
553
  fetch(request: Request): Response | Promise<Response>;
551
554
  connect?(socket: Socket): void | Promise<void>;
@@ -625,6 +628,7 @@ export interface DurableObjectState<Props = unknown> {
625
628
  readonly id: DurableObjectId;
626
629
  readonly storage: DurableObjectStorage;
627
630
  container?: Container;
631
+ facets: DurableObjectFacets;
628
632
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
629
633
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
630
634
  getWebSockets(tag?: string): WebSocket[];
@@ -739,6 +743,22 @@ export declare class WebSocketRequestResponsePair {
739
743
  get request(): string;
740
744
  get response(): string;
741
745
  }
746
+ export interface DurableObjectFacets {
747
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
748
+ name: string,
749
+ getStartupOptions: () =>
750
+ | FacetStartupOptions<T>
751
+ | Promise<FacetStartupOptions<T>>,
752
+ ): Fetcher<T>;
753
+ abort(name: string, reason: any): void;
754
+ delete(name: string): void;
755
+ }
756
+ export interface FacetStartupOptions<
757
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
758
+ > {
759
+ id?: DurableObjectId | string;
760
+ class: DurableObjectClass<T>;
761
+ }
742
762
  export interface AnalyticsEngineDataset {
743
763
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
744
764
  }
@@ -3830,6 +3850,8 @@ export type LoopbackDurableObjectClass<
3830
3850
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3831
3851
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3832
3852
  : (opts: { props?: any }) => DurableObjectClass<T>);
3853
+ export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3854
+ export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3833
3855
  export interface SyncKvStorage {
3834
3856
  get<T = unknown>(key: string): T | undefined;
3835
3857
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3849,6 +3871,10 @@ export interface WorkerStub {
3849
3871
  name?: string,
3850
3872
  options?: WorkerStubEntrypointOptions,
3851
3873
  ): Fetcher<T>;
3874
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3875
+ name?: string,
3876
+ options?: WorkerStubEntrypointOptions,
3877
+ ): DurableObjectClass<T>;
3852
3878
  }
3853
3879
  export interface WorkerStubEntrypointOptions {
3854
3880
  props?: any;
@@ -552,6 +552,9 @@ interface AlarmInvocationInfo {
552
552
  interface Cloudflare {
553
553
  readonly compatibilityFlags: Record<string, boolean>;
554
554
  }
555
+ declare abstract class ColoLocalActorNamespace {
556
+ get(actorId: string): Fetcher;
557
+ }
555
558
  interface DurableObject {
556
559
  fetch(request: Request): Response | Promise<Response>;
557
560
  connect?(socket: Socket): void | Promise<void>;
@@ -631,6 +634,7 @@ interface DurableObjectState<Props = unknown> {
631
634
  readonly id: DurableObjectId;
632
635
  readonly storage: DurableObjectStorage;
633
636
  container?: Container;
637
+ facets: DurableObjectFacets;
634
638
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
635
639
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
636
640
  getWebSockets(tag?: string): WebSocket[];
@@ -745,6 +749,22 @@ declare class WebSocketRequestResponsePair {
745
749
  get request(): string;
746
750
  get response(): string;
747
751
  }
752
+ interface DurableObjectFacets {
753
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
754
+ name: string,
755
+ getStartupOptions: () =>
756
+ | FacetStartupOptions<T>
757
+ | Promise<FacetStartupOptions<T>>,
758
+ ): Fetcher<T>;
759
+ abort(name: string, reason: any): void;
760
+ delete(name: string): void;
761
+ }
762
+ interface FacetStartupOptions<
763
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
764
+ > {
765
+ id?: DurableObjectId | string;
766
+ class: DurableObjectClass<T>;
767
+ }
748
768
  interface AnalyticsEngineDataset {
749
769
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
750
770
  }
@@ -3832,6 +3852,8 @@ type LoopbackDurableObjectClass<
3832
3852
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3833
3853
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3834
3854
  : (opts: { props?: any }) => DurableObjectClass<T>);
3855
+ interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3856
+ interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3835
3857
  interface SyncKvStorage {
3836
3858
  get<T = unknown>(key: string): T | undefined;
3837
3859
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3851,6 +3873,10 @@ interface WorkerStub {
3851
3873
  name?: string,
3852
3874
  options?: WorkerStubEntrypointOptions,
3853
3875
  ): Fetcher<T>;
3876
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3877
+ name?: string,
3878
+ options?: WorkerStubEntrypointOptions,
3879
+ ): DurableObjectClass<T>;
3854
3880
  }
3855
3881
  interface WorkerStubEntrypointOptions {
3856
3882
  props?: any;
@@ -554,6 +554,9 @@ export interface AlarmInvocationInfo {
554
554
  export interface Cloudflare {
555
555
  readonly compatibilityFlags: Record<string, boolean>;
556
556
  }
557
+ export declare abstract class ColoLocalActorNamespace {
558
+ get(actorId: string): Fetcher;
559
+ }
557
560
  export interface DurableObject {
558
561
  fetch(request: Request): Response | Promise<Response>;
559
562
  connect?(socket: Socket): void | Promise<void>;
@@ -633,6 +636,7 @@ export interface DurableObjectState<Props = unknown> {
633
636
  readonly id: DurableObjectId;
634
637
  readonly storage: DurableObjectStorage;
635
638
  container?: Container;
639
+ facets: DurableObjectFacets;
636
640
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
637
641
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
638
642
  getWebSockets(tag?: string): WebSocket[];
@@ -747,6 +751,22 @@ export declare class WebSocketRequestResponsePair {
747
751
  get request(): string;
748
752
  get response(): string;
749
753
  }
754
+ export interface DurableObjectFacets {
755
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
756
+ name: string,
757
+ getStartupOptions: () =>
758
+ | FacetStartupOptions<T>
759
+ | Promise<FacetStartupOptions<T>>,
760
+ ): Fetcher<T>;
761
+ abort(name: string, reason: any): void;
762
+ delete(name: string): void;
763
+ }
764
+ export interface FacetStartupOptions<
765
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
766
+ > {
767
+ id?: DurableObjectId | string;
768
+ class: DurableObjectClass<T>;
769
+ }
750
770
  export interface AnalyticsEngineDataset {
751
771
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
752
772
  }
@@ -3838,6 +3858,8 @@ export type LoopbackDurableObjectClass<
3838
3858
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3839
3859
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3840
3860
  : (opts: { props?: any }) => DurableObjectClass<T>);
3861
+ export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3862
+ export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3841
3863
  export interface SyncKvStorage {
3842
3864
  get<T = unknown>(key: string): T | undefined;
3843
3865
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3857,6 +3879,10 @@ export interface WorkerStub {
3857
3879
  name?: string,
3858
3880
  options?: WorkerStubEntrypointOptions,
3859
3881
  ): Fetcher<T>;
3882
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3883
+ name?: string,
3884
+ options?: WorkerStubEntrypointOptions,
3885
+ ): DurableObjectClass<T>;
3860
3886
  }
3861
3887
  export interface WorkerStubEntrypointOptions {
3862
3888
  props?: any;
@@ -552,6 +552,9 @@ interface AlarmInvocationInfo {
552
552
  interface Cloudflare {
553
553
  readonly compatibilityFlags: Record<string, boolean>;
554
554
  }
555
+ declare abstract class ColoLocalActorNamespace {
556
+ get(actorId: string): Fetcher;
557
+ }
555
558
  interface DurableObject {
556
559
  fetch(request: Request): Response | Promise<Response>;
557
560
  connect?(socket: Socket): void | Promise<void>;
@@ -631,6 +634,7 @@ interface DurableObjectState<Props = unknown> {
631
634
  readonly id: DurableObjectId;
632
635
  readonly storage: DurableObjectStorage;
633
636
  container?: Container;
637
+ facets: DurableObjectFacets;
634
638
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
635
639
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
636
640
  getWebSockets(tag?: string): WebSocket[];
@@ -745,6 +749,22 @@ declare class WebSocketRequestResponsePair {
745
749
  get request(): string;
746
750
  get response(): string;
747
751
  }
752
+ interface DurableObjectFacets {
753
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
754
+ name: string,
755
+ getStartupOptions: () =>
756
+ | FacetStartupOptions<T>
757
+ | Promise<FacetStartupOptions<T>>,
758
+ ): Fetcher<T>;
759
+ abort(name: string, reason: any): void;
760
+ delete(name: string): void;
761
+ }
762
+ interface FacetStartupOptions<
763
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
764
+ > {
765
+ id?: DurableObjectId | string;
766
+ class: DurableObjectClass<T>;
767
+ }
748
768
  interface AnalyticsEngineDataset {
749
769
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
750
770
  }
@@ -3833,6 +3853,8 @@ type LoopbackDurableObjectClass<
3833
3853
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3834
3854
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3835
3855
  : (opts: { props?: any }) => DurableObjectClass<T>);
3856
+ interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3857
+ interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3836
3858
  interface SyncKvStorage {
3837
3859
  get<T = unknown>(key: string): T | undefined;
3838
3860
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3852,6 +3874,10 @@ interface WorkerStub {
3852
3874
  name?: string,
3853
3875
  options?: WorkerStubEntrypointOptions,
3854
3876
  ): Fetcher<T>;
3877
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3878
+ name?: string,
3879
+ options?: WorkerStubEntrypointOptions,
3880
+ ): DurableObjectClass<T>;
3855
3881
  }
3856
3882
  interface WorkerStubEntrypointOptions {
3857
3883
  props?: any;
@@ -554,6 +554,9 @@ export interface AlarmInvocationInfo {
554
554
  export interface Cloudflare {
555
555
  readonly compatibilityFlags: Record<string, boolean>;
556
556
  }
557
+ export declare abstract class ColoLocalActorNamespace {
558
+ get(actorId: string): Fetcher;
559
+ }
557
560
  export interface DurableObject {
558
561
  fetch(request: Request): Response | Promise<Response>;
559
562
  connect?(socket: Socket): void | Promise<void>;
@@ -633,6 +636,7 @@ export interface DurableObjectState<Props = unknown> {
633
636
  readonly id: DurableObjectId;
634
637
  readonly storage: DurableObjectStorage;
635
638
  container?: Container;
639
+ facets: DurableObjectFacets;
636
640
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
637
641
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
638
642
  getWebSockets(tag?: string): WebSocket[];
@@ -747,6 +751,22 @@ export declare class WebSocketRequestResponsePair {
747
751
  get request(): string;
748
752
  get response(): string;
749
753
  }
754
+ export interface DurableObjectFacets {
755
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
756
+ name: string,
757
+ getStartupOptions: () =>
758
+ | FacetStartupOptions<T>
759
+ | Promise<FacetStartupOptions<T>>,
760
+ ): Fetcher<T>;
761
+ abort(name: string, reason: any): void;
762
+ delete(name: string): void;
763
+ }
764
+ export interface FacetStartupOptions<
765
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
766
+ > {
767
+ id?: DurableObjectId | string;
768
+ class: DurableObjectClass<T>;
769
+ }
750
770
  export interface AnalyticsEngineDataset {
751
771
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
752
772
  }
@@ -3839,6 +3859,8 @@ export type LoopbackDurableObjectClass<
3839
3859
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3840
3860
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3841
3861
  : (opts: { props?: any }) => DurableObjectClass<T>);
3862
+ export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3863
+ export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3842
3864
  export interface SyncKvStorage {
3843
3865
  get<T = unknown>(key: string): T | undefined;
3844
3866
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3858,6 +3880,10 @@ export interface WorkerStub {
3858
3880
  name?: string,
3859
3881
  options?: WorkerStubEntrypointOptions,
3860
3882
  ): Fetcher<T>;
3883
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3884
+ name?: string,
3885
+ options?: WorkerStubEntrypointOptions,
3886
+ ): DurableObjectClass<T>;
3861
3887
  }
3862
3888
  export interface WorkerStubEntrypointOptions {
3863
3889
  props?: any;
@@ -552,6 +552,9 @@ interface AlarmInvocationInfo {
552
552
  interface Cloudflare {
553
553
  readonly compatibilityFlags: Record<string, boolean>;
554
554
  }
555
+ declare abstract class ColoLocalActorNamespace {
556
+ get(actorId: string): Fetcher;
557
+ }
555
558
  interface DurableObject {
556
559
  fetch(request: Request): Response | Promise<Response>;
557
560
  connect?(socket: Socket): void | Promise<void>;
@@ -631,6 +634,7 @@ interface DurableObjectState<Props = unknown> {
631
634
  readonly id: DurableObjectId;
632
635
  readonly storage: DurableObjectStorage;
633
636
  container?: Container;
637
+ facets: DurableObjectFacets;
634
638
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
635
639
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
636
640
  getWebSockets(tag?: string): WebSocket[];
@@ -745,6 +749,22 @@ declare class WebSocketRequestResponsePair {
745
749
  get request(): string;
746
750
  get response(): string;
747
751
  }
752
+ interface DurableObjectFacets {
753
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
754
+ name: string,
755
+ getStartupOptions: () =>
756
+ | FacetStartupOptions<T>
757
+ | Promise<FacetStartupOptions<T>>,
758
+ ): Fetcher<T>;
759
+ abort(name: string, reason: any): void;
760
+ delete(name: string): void;
761
+ }
762
+ interface FacetStartupOptions<
763
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
764
+ > {
765
+ id?: DurableObjectId | string;
766
+ class: DurableObjectClass<T>;
767
+ }
748
768
  interface AnalyticsEngineDataset {
749
769
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
750
770
  }
@@ -3853,6 +3873,8 @@ type LoopbackDurableObjectClass<
3853
3873
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3854
3874
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3855
3875
  : (opts: { props?: any }) => DurableObjectClass<T>);
3876
+ interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3877
+ interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3856
3878
  interface SyncKvStorage {
3857
3879
  get<T = unknown>(key: string): T | undefined;
3858
3880
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3872,6 +3894,10 @@ interface WorkerStub {
3872
3894
  name?: string,
3873
3895
  options?: WorkerStubEntrypointOptions,
3874
3896
  ): Fetcher<T>;
3897
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3898
+ name?: string,
3899
+ options?: WorkerStubEntrypointOptions,
3900
+ ): DurableObjectClass<T>;
3875
3901
  }
3876
3902
  interface WorkerStubEntrypointOptions {
3877
3903
  props?: any;
@@ -554,6 +554,9 @@ export interface AlarmInvocationInfo {
554
554
  export interface Cloudflare {
555
555
  readonly compatibilityFlags: Record<string, boolean>;
556
556
  }
557
+ export declare abstract class ColoLocalActorNamespace {
558
+ get(actorId: string): Fetcher;
559
+ }
557
560
  export interface DurableObject {
558
561
  fetch(request: Request): Response | Promise<Response>;
559
562
  connect?(socket: Socket): void | Promise<void>;
@@ -633,6 +636,7 @@ export interface DurableObjectState<Props = unknown> {
633
636
  readonly id: DurableObjectId;
634
637
  readonly storage: DurableObjectStorage;
635
638
  container?: Container;
639
+ facets: DurableObjectFacets;
636
640
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
637
641
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
638
642
  getWebSockets(tag?: string): WebSocket[];
@@ -747,6 +751,22 @@ export declare class WebSocketRequestResponsePair {
747
751
  get request(): string;
748
752
  get response(): string;
749
753
  }
754
+ export interface DurableObjectFacets {
755
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
756
+ name: string,
757
+ getStartupOptions: () =>
758
+ | FacetStartupOptions<T>
759
+ | Promise<FacetStartupOptions<T>>,
760
+ ): Fetcher<T>;
761
+ abort(name: string, reason: any): void;
762
+ delete(name: string): void;
763
+ }
764
+ export interface FacetStartupOptions<
765
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
766
+ > {
767
+ id?: DurableObjectId | string;
768
+ class: DurableObjectClass<T>;
769
+ }
750
770
  export interface AnalyticsEngineDataset {
751
771
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
752
772
  }
@@ -3859,6 +3879,8 @@ export type LoopbackDurableObjectClass<
3859
3879
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3860
3880
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3861
3881
  : (opts: { props?: any }) => DurableObjectClass<T>);
3882
+ export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3883
+ export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3862
3884
  export interface SyncKvStorage {
3863
3885
  get<T = unknown>(key: string): T | undefined;
3864
3886
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3878,6 +3900,10 @@ export interface WorkerStub {
3878
3900
  name?: string,
3879
3901
  options?: WorkerStubEntrypointOptions,
3880
3902
  ): Fetcher<T>;
3903
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3904
+ name?: string,
3905
+ options?: WorkerStubEntrypointOptions,
3906
+ ): DurableObjectClass<T>;
3881
3907
  }
3882
3908
  export interface WorkerStubEntrypointOptions {
3883
3909
  props?: any;
@@ -557,6 +557,9 @@ interface AlarmInvocationInfo {
557
557
  interface Cloudflare {
558
558
  readonly compatibilityFlags: Record<string, boolean>;
559
559
  }
560
+ declare abstract class ColoLocalActorNamespace {
561
+ get(actorId: string): Fetcher;
562
+ }
560
563
  interface DurableObject {
561
564
  fetch(request: Request): Response | Promise<Response>;
562
565
  connect?(socket: Socket): void | Promise<void>;
@@ -636,6 +639,7 @@ interface DurableObjectState<Props = unknown> {
636
639
  readonly id: DurableObjectId;
637
640
  readonly storage: DurableObjectStorage;
638
641
  container?: Container;
642
+ facets: DurableObjectFacets;
639
643
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
640
644
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
641
645
  getWebSockets(tag?: string): WebSocket[];
@@ -750,6 +754,22 @@ declare class WebSocketRequestResponsePair {
750
754
  get request(): string;
751
755
  get response(): string;
752
756
  }
757
+ interface DurableObjectFacets {
758
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
759
+ name: string,
760
+ getStartupOptions: () =>
761
+ | FacetStartupOptions<T>
762
+ | Promise<FacetStartupOptions<T>>,
763
+ ): Fetcher<T>;
764
+ abort(name: string, reason: any): void;
765
+ delete(name: string): void;
766
+ }
767
+ interface FacetStartupOptions<
768
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
769
+ > {
770
+ id?: DurableObjectId | string;
771
+ class: DurableObjectClass<T>;
772
+ }
753
773
  interface AnalyticsEngineDataset {
754
774
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
755
775
  }
@@ -3858,6 +3878,8 @@ type LoopbackDurableObjectClass<
3858
3878
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3859
3879
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3860
3880
  : (opts: { props?: any }) => DurableObjectClass<T>);
3881
+ interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3882
+ interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3861
3883
  interface SyncKvStorage {
3862
3884
  get<T = unknown>(key: string): T | undefined;
3863
3885
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3877,6 +3899,10 @@ interface WorkerStub {
3877
3899
  name?: string,
3878
3900
  options?: WorkerStubEntrypointOptions,
3879
3901
  ): Fetcher<T>;
3902
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3903
+ name?: string,
3904
+ options?: WorkerStubEntrypointOptions,
3905
+ ): DurableObjectClass<T>;
3880
3906
  }
3881
3907
  interface WorkerStubEntrypointOptions {
3882
3908
  props?: any;
@@ -559,6 +559,9 @@ export interface AlarmInvocationInfo {
559
559
  export interface Cloudflare {
560
560
  readonly compatibilityFlags: Record<string, boolean>;
561
561
  }
562
+ export declare abstract class ColoLocalActorNamespace {
563
+ get(actorId: string): Fetcher;
564
+ }
562
565
  export interface DurableObject {
563
566
  fetch(request: Request): Response | Promise<Response>;
564
567
  connect?(socket: Socket): void | Promise<void>;
@@ -638,6 +641,7 @@ export interface DurableObjectState<Props = unknown> {
638
641
  readonly id: DurableObjectId;
639
642
  readonly storage: DurableObjectStorage;
640
643
  container?: Container;
644
+ facets: DurableObjectFacets;
641
645
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
642
646
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
643
647
  getWebSockets(tag?: string): WebSocket[];
@@ -752,6 +756,22 @@ export declare class WebSocketRequestResponsePair {
752
756
  get request(): string;
753
757
  get response(): string;
754
758
  }
759
+ export interface DurableObjectFacets {
760
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
761
+ name: string,
762
+ getStartupOptions: () =>
763
+ | FacetStartupOptions<T>
764
+ | Promise<FacetStartupOptions<T>>,
765
+ ): Fetcher<T>;
766
+ abort(name: string, reason: any): void;
767
+ delete(name: string): void;
768
+ }
769
+ export interface FacetStartupOptions<
770
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
771
+ > {
772
+ id?: DurableObjectId | string;
773
+ class: DurableObjectClass<T>;
774
+ }
755
775
  export interface AnalyticsEngineDataset {
756
776
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
757
777
  }
@@ -3864,6 +3884,8 @@ export type LoopbackDurableObjectClass<
3864
3884
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3865
3885
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3866
3886
  : (opts: { props?: any }) => DurableObjectClass<T>);
3887
+ export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3888
+ export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3867
3889
  export interface SyncKvStorage {
3868
3890
  get<T = unknown>(key: string): T | undefined;
3869
3891
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3883,6 +3905,10 @@ export interface WorkerStub {
3883
3905
  name?: string,
3884
3906
  options?: WorkerStubEntrypointOptions,
3885
3907
  ): Fetcher<T>;
3908
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3909
+ name?: string,
3910
+ options?: WorkerStubEntrypointOptions,
3911
+ ): DurableObjectClass<T>;
3886
3912
  }
3887
3913
  export interface WorkerStubEntrypointOptions {
3888
3914
  props?: any;
@@ -557,6 +557,9 @@ interface AlarmInvocationInfo {
557
557
  interface Cloudflare {
558
558
  readonly compatibilityFlags: Record<string, boolean>;
559
559
  }
560
+ declare abstract class ColoLocalActorNamespace {
561
+ get(actorId: string): Fetcher;
562
+ }
560
563
  interface DurableObject {
561
564
  fetch(request: Request): Response | Promise<Response>;
562
565
  connect?(socket: Socket): void | Promise<void>;
@@ -636,6 +639,7 @@ interface DurableObjectState<Props = unknown> {
636
639
  readonly id: DurableObjectId;
637
640
  readonly storage: DurableObjectStorage;
638
641
  container?: Container;
642
+ facets: DurableObjectFacets;
639
643
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
640
644
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
641
645
  getWebSockets(tag?: string): WebSocket[];
@@ -750,6 +754,22 @@ declare class WebSocketRequestResponsePair {
750
754
  get request(): string;
751
755
  get response(): string;
752
756
  }
757
+ interface DurableObjectFacets {
758
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
759
+ name: string,
760
+ getStartupOptions: () =>
761
+ | FacetStartupOptions<T>
762
+ | Promise<FacetStartupOptions<T>>,
763
+ ): Fetcher<T>;
764
+ abort(name: string, reason: any): void;
765
+ delete(name: string): void;
766
+ }
767
+ interface FacetStartupOptions<
768
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
769
+ > {
770
+ id?: DurableObjectId | string;
771
+ class: DurableObjectClass<T>;
772
+ }
753
773
  interface AnalyticsEngineDataset {
754
774
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
755
775
  }
@@ -3864,6 +3884,8 @@ type LoopbackDurableObjectClass<
3864
3884
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3865
3885
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3866
3886
  : (opts: { props?: any }) => DurableObjectClass<T>);
3887
+ interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3888
+ interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3867
3889
  interface SyncKvStorage {
3868
3890
  get<T = unknown>(key: string): T | undefined;
3869
3891
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3883,6 +3905,10 @@ interface WorkerStub {
3883
3905
  name?: string,
3884
3906
  options?: WorkerStubEntrypointOptions,
3885
3907
  ): Fetcher<T>;
3908
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3909
+ name?: string,
3910
+ options?: WorkerStubEntrypointOptions,
3911
+ ): DurableObjectClass<T>;
3886
3912
  }
3887
3913
  interface WorkerStubEntrypointOptions {
3888
3914
  props?: any;
@@ -559,6 +559,9 @@ export interface AlarmInvocationInfo {
559
559
  export interface Cloudflare {
560
560
  readonly compatibilityFlags: Record<string, boolean>;
561
561
  }
562
+ export declare abstract class ColoLocalActorNamespace {
563
+ get(actorId: string): Fetcher;
564
+ }
562
565
  export interface DurableObject {
563
566
  fetch(request: Request): Response | Promise<Response>;
564
567
  connect?(socket: Socket): void | Promise<void>;
@@ -638,6 +641,7 @@ export interface DurableObjectState<Props = unknown> {
638
641
  readonly id: DurableObjectId;
639
642
  readonly storage: DurableObjectStorage;
640
643
  container?: Container;
644
+ facets: DurableObjectFacets;
641
645
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
642
646
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
643
647
  getWebSockets(tag?: string): WebSocket[];
@@ -752,6 +756,22 @@ export declare class WebSocketRequestResponsePair {
752
756
  get request(): string;
753
757
  get response(): string;
754
758
  }
759
+ export interface DurableObjectFacets {
760
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
761
+ name: string,
762
+ getStartupOptions: () =>
763
+ | FacetStartupOptions<T>
764
+ | Promise<FacetStartupOptions<T>>,
765
+ ): Fetcher<T>;
766
+ abort(name: string, reason: any): void;
767
+ delete(name: string): void;
768
+ }
769
+ export interface FacetStartupOptions<
770
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
771
+ > {
772
+ id?: DurableObjectId | string;
773
+ class: DurableObjectClass<T>;
774
+ }
755
775
  export interface AnalyticsEngineDataset {
756
776
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
757
777
  }
@@ -3870,6 +3890,8 @@ export type LoopbackDurableObjectClass<
3870
3890
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3871
3891
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3872
3892
  : (opts: { props?: any }) => DurableObjectClass<T>);
3893
+ export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3894
+ export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3873
3895
  export interface SyncKvStorage {
3874
3896
  get<T = unknown>(key: string): T | undefined;
3875
3897
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3889,6 +3911,10 @@ export interface WorkerStub {
3889
3911
  name?: string,
3890
3912
  options?: WorkerStubEntrypointOptions,
3891
3913
  ): Fetcher<T>;
3914
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3915
+ name?: string,
3916
+ options?: WorkerStubEntrypointOptions,
3917
+ ): DurableObjectClass<T>;
3892
3918
  }
3893
3919
  export interface WorkerStubEntrypointOptions {
3894
3920
  props?: any;
@@ -557,6 +557,9 @@ interface AlarmInvocationInfo {
557
557
  interface Cloudflare {
558
558
  readonly compatibilityFlags: Record<string, boolean>;
559
559
  }
560
+ declare abstract class ColoLocalActorNamespace {
561
+ get(actorId: string): Fetcher;
562
+ }
560
563
  interface DurableObject {
561
564
  fetch(request: Request): Response | Promise<Response>;
562
565
  connect?(socket: Socket): void | Promise<void>;
@@ -636,6 +639,7 @@ interface DurableObjectState<Props = unknown> {
636
639
  readonly id: DurableObjectId;
637
640
  readonly storage: DurableObjectStorage;
638
641
  container?: Container;
642
+ facets: DurableObjectFacets;
639
643
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
640
644
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
641
645
  getWebSockets(tag?: string): WebSocket[];
@@ -750,6 +754,22 @@ declare class WebSocketRequestResponsePair {
750
754
  get request(): string;
751
755
  get response(): string;
752
756
  }
757
+ interface DurableObjectFacets {
758
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
759
+ name: string,
760
+ getStartupOptions: () =>
761
+ | FacetStartupOptions<T>
762
+ | Promise<FacetStartupOptions<T>>,
763
+ ): Fetcher<T>;
764
+ abort(name: string, reason: any): void;
765
+ delete(name: string): void;
766
+ }
767
+ interface FacetStartupOptions<
768
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
769
+ > {
770
+ id?: DurableObjectId | string;
771
+ class: DurableObjectClass<T>;
772
+ }
753
773
  interface AnalyticsEngineDataset {
754
774
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
755
775
  }
@@ -3864,6 +3884,8 @@ type LoopbackDurableObjectClass<
3864
3884
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3865
3885
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3866
3886
  : (opts: { props?: any }) => DurableObjectClass<T>);
3887
+ interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3888
+ interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3867
3889
  interface SyncKvStorage {
3868
3890
  get<T = unknown>(key: string): T | undefined;
3869
3891
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3883,6 +3905,10 @@ interface WorkerStub {
3883
3905
  name?: string,
3884
3906
  options?: WorkerStubEntrypointOptions,
3885
3907
  ): Fetcher<T>;
3908
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3909
+ name?: string,
3910
+ options?: WorkerStubEntrypointOptions,
3911
+ ): DurableObjectClass<T>;
3886
3912
  }
3887
3913
  interface WorkerStubEntrypointOptions {
3888
3914
  props?: any;
@@ -559,6 +559,9 @@ export interface AlarmInvocationInfo {
559
559
  export interface Cloudflare {
560
560
  readonly compatibilityFlags: Record<string, boolean>;
561
561
  }
562
+ export declare abstract class ColoLocalActorNamespace {
563
+ get(actorId: string): Fetcher;
564
+ }
562
565
  export interface DurableObject {
563
566
  fetch(request: Request): Response | Promise<Response>;
564
567
  connect?(socket: Socket): void | Promise<void>;
@@ -638,6 +641,7 @@ export interface DurableObjectState<Props = unknown> {
638
641
  readonly id: DurableObjectId;
639
642
  readonly storage: DurableObjectStorage;
640
643
  container?: Container;
644
+ facets: DurableObjectFacets;
641
645
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
642
646
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
643
647
  getWebSockets(tag?: string): WebSocket[];
@@ -752,6 +756,22 @@ export declare class WebSocketRequestResponsePair {
752
756
  get request(): string;
753
757
  get response(): string;
754
758
  }
759
+ export interface DurableObjectFacets {
760
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
761
+ name: string,
762
+ getStartupOptions: () =>
763
+ | FacetStartupOptions<T>
764
+ | Promise<FacetStartupOptions<T>>,
765
+ ): Fetcher<T>;
766
+ abort(name: string, reason: any): void;
767
+ delete(name: string): void;
768
+ }
769
+ export interface FacetStartupOptions<
770
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
771
+ > {
772
+ id?: DurableObjectId | string;
773
+ class: DurableObjectClass<T>;
774
+ }
755
775
  export interface AnalyticsEngineDataset {
756
776
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
757
777
  }
@@ -3870,6 +3890,8 @@ export type LoopbackDurableObjectClass<
3870
3890
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3871
3891
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3872
3892
  : (opts: { props?: any }) => DurableObjectClass<T>);
3893
+ export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3894
+ export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3873
3895
  export interface SyncKvStorage {
3874
3896
  get<T = unknown>(key: string): T | undefined;
3875
3897
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3889,6 +3911,10 @@ export interface WorkerStub {
3889
3911
  name?: string,
3890
3912
  options?: WorkerStubEntrypointOptions,
3891
3913
  ): Fetcher<T>;
3914
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3915
+ name?: string,
3916
+ options?: WorkerStubEntrypointOptions,
3917
+ ): DurableObjectClass<T>;
3892
3918
  }
3893
3919
  export interface WorkerStubEntrypointOptions {
3894
3920
  props?: any;
package/index.d.ts CHANGED
@@ -544,6 +544,9 @@ interface AlarmInvocationInfo {
544
544
  interface Cloudflare {
545
545
  readonly compatibilityFlags: Record<string, boolean>;
546
546
  }
547
+ declare abstract class ColoLocalActorNamespace {
548
+ get(actorId: string): Fetcher;
549
+ }
547
550
  interface DurableObject {
548
551
  fetch(request: Request): Response | Promise<Response>;
549
552
  connect?(socket: Socket): void | Promise<void>;
@@ -623,6 +626,7 @@ interface DurableObjectState<Props = unknown> {
623
626
  readonly id: DurableObjectId;
624
627
  readonly storage: DurableObjectStorage;
625
628
  container?: Container;
629
+ facets: DurableObjectFacets;
626
630
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
627
631
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
628
632
  getWebSockets(tag?: string): WebSocket[];
@@ -737,6 +741,22 @@ declare class WebSocketRequestResponsePair {
737
741
  get request(): string;
738
742
  get response(): string;
739
743
  }
744
+ interface DurableObjectFacets {
745
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
746
+ name: string,
747
+ getStartupOptions: () =>
748
+ | FacetStartupOptions<T>
749
+ | Promise<FacetStartupOptions<T>>,
750
+ ): Fetcher<T>;
751
+ abort(name: string, reason: any): void;
752
+ delete(name: string): void;
753
+ }
754
+ interface FacetStartupOptions<
755
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
756
+ > {
757
+ id?: DurableObjectId | string;
758
+ class: DurableObjectClass<T>;
759
+ }
740
760
  interface AnalyticsEngineDataset {
741
761
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
742
762
  }
@@ -3757,6 +3777,8 @@ type LoopbackDurableObjectClass<
3757
3777
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3758
3778
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3759
3779
  : (opts: { props?: any }) => DurableObjectClass<T>);
3780
+ interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3781
+ interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3760
3782
  interface SyncKvStorage {
3761
3783
  get<T = unknown>(key: string): T | undefined;
3762
3784
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3776,6 +3798,10 @@ interface WorkerStub {
3776
3798
  name?: string,
3777
3799
  options?: WorkerStubEntrypointOptions,
3778
3800
  ): Fetcher<T>;
3801
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3802
+ name?: string,
3803
+ options?: WorkerStubEntrypointOptions,
3804
+ ): DurableObjectClass<T>;
3779
3805
  }
3780
3806
  interface WorkerStubEntrypointOptions {
3781
3807
  props?: any;
package/index.ts CHANGED
@@ -546,6 +546,9 @@ export interface AlarmInvocationInfo {
546
546
  export interface Cloudflare {
547
547
  readonly compatibilityFlags: Record<string, boolean>;
548
548
  }
549
+ export declare abstract class ColoLocalActorNamespace {
550
+ get(actorId: string): Fetcher;
551
+ }
549
552
  export interface DurableObject {
550
553
  fetch(request: Request): Response | Promise<Response>;
551
554
  connect?(socket: Socket): void | Promise<void>;
@@ -625,6 +628,7 @@ export interface DurableObjectState<Props = unknown> {
625
628
  readonly id: DurableObjectId;
626
629
  readonly storage: DurableObjectStorage;
627
630
  container?: Container;
631
+ facets: DurableObjectFacets;
628
632
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
629
633
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
630
634
  getWebSockets(tag?: string): WebSocket[];
@@ -739,6 +743,22 @@ export declare class WebSocketRequestResponsePair {
739
743
  get request(): string;
740
744
  get response(): string;
741
745
  }
746
+ export interface DurableObjectFacets {
747
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
748
+ name: string,
749
+ getStartupOptions: () =>
750
+ | FacetStartupOptions<T>
751
+ | Promise<FacetStartupOptions<T>>,
752
+ ): Fetcher<T>;
753
+ abort(name: string, reason: any): void;
754
+ delete(name: string): void;
755
+ }
756
+ export interface FacetStartupOptions<
757
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
758
+ > {
759
+ id?: DurableObjectId | string;
760
+ class: DurableObjectClass<T>;
761
+ }
742
762
  export interface AnalyticsEngineDataset {
743
763
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
744
764
  }
@@ -3763,6 +3783,8 @@ export type LoopbackDurableObjectClass<
3763
3783
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3764
3784
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3765
3785
  : (opts: { props?: any }) => DurableObjectClass<T>);
3786
+ export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3787
+ export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3766
3788
  export interface SyncKvStorage {
3767
3789
  get<T = unknown>(key: string): T | undefined;
3768
3790
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3782,6 +3804,10 @@ export interface WorkerStub {
3782
3804
  name?: string,
3783
3805
  options?: WorkerStubEntrypointOptions,
3784
3806
  ): Fetcher<T>;
3807
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3808
+ name?: string,
3809
+ options?: WorkerStubEntrypointOptions,
3810
+ ): DurableObjectClass<T>;
3785
3811
  }
3786
3812
  export interface WorkerStubEntrypointOptions {
3787
3813
  props?: any;
package/latest/index.d.ts CHANGED
@@ -562,6 +562,9 @@ interface AlarmInvocationInfo {
562
562
  interface Cloudflare {
563
563
  readonly compatibilityFlags: Record<string, boolean>;
564
564
  }
565
+ declare abstract class ColoLocalActorNamespace {
566
+ get(actorId: string): Fetcher;
567
+ }
565
568
  interface DurableObject {
566
569
  fetch(request: Request): Response | Promise<Response>;
567
570
  connect?(socket: Socket): void | Promise<void>;
@@ -642,6 +645,7 @@ interface DurableObjectState<Props = unknown> {
642
645
  readonly id: DurableObjectId;
643
646
  readonly storage: DurableObjectStorage;
644
647
  container?: Container;
648
+ facets: DurableObjectFacets;
645
649
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
646
650
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
647
651
  getWebSockets(tag?: string): WebSocket[];
@@ -756,6 +760,22 @@ declare class WebSocketRequestResponsePair {
756
760
  get request(): string;
757
761
  get response(): string;
758
762
  }
763
+ interface DurableObjectFacets {
764
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
765
+ name: string,
766
+ getStartupOptions: () =>
767
+ | FacetStartupOptions<T>
768
+ | Promise<FacetStartupOptions<T>>,
769
+ ): Fetcher<T>;
770
+ abort(name: string, reason: any): void;
771
+ delete(name: string): void;
772
+ }
773
+ interface FacetStartupOptions<
774
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
775
+ > {
776
+ id?: DurableObjectId | string;
777
+ class: DurableObjectClass<T>;
778
+ }
759
779
  interface AnalyticsEngineDataset {
760
780
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
761
781
  }
@@ -3897,6 +3917,8 @@ type LoopbackDurableObjectClass<
3897
3917
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3898
3918
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3899
3919
  : (opts: { props?: any }) => DurableObjectClass<T>);
3920
+ interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3921
+ interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3900
3922
  interface SyncKvStorage {
3901
3923
  get<T = unknown>(key: string): T | undefined;
3902
3924
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3916,6 +3938,10 @@ interface WorkerStub {
3916
3938
  name?: string,
3917
3939
  options?: WorkerStubEntrypointOptions,
3918
3940
  ): Fetcher<T>;
3941
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3942
+ name?: string,
3943
+ options?: WorkerStubEntrypointOptions,
3944
+ ): DurableObjectClass<T>;
3919
3945
  }
3920
3946
  interface WorkerStubEntrypointOptions {
3921
3947
  props?: any;
package/latest/index.ts CHANGED
@@ -564,6 +564,9 @@ export interface AlarmInvocationInfo {
564
564
  export interface Cloudflare {
565
565
  readonly compatibilityFlags: Record<string, boolean>;
566
566
  }
567
+ export declare abstract class ColoLocalActorNamespace {
568
+ get(actorId: string): Fetcher;
569
+ }
567
570
  export interface DurableObject {
568
571
  fetch(request: Request): Response | Promise<Response>;
569
572
  connect?(socket: Socket): void | Promise<void>;
@@ -644,6 +647,7 @@ export interface DurableObjectState<Props = unknown> {
644
647
  readonly id: DurableObjectId;
645
648
  readonly storage: DurableObjectStorage;
646
649
  container?: Container;
650
+ facets: DurableObjectFacets;
647
651
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
648
652
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
649
653
  getWebSockets(tag?: string): WebSocket[];
@@ -758,6 +762,22 @@ export declare class WebSocketRequestResponsePair {
758
762
  get request(): string;
759
763
  get response(): string;
760
764
  }
765
+ export interface DurableObjectFacets {
766
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
767
+ name: string,
768
+ getStartupOptions: () =>
769
+ | FacetStartupOptions<T>
770
+ | Promise<FacetStartupOptions<T>>,
771
+ ): Fetcher<T>;
772
+ abort(name: string, reason: any): void;
773
+ delete(name: string): void;
774
+ }
775
+ export interface FacetStartupOptions<
776
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
777
+ > {
778
+ id?: DurableObjectId | string;
779
+ class: DurableObjectClass<T>;
780
+ }
761
781
  export interface AnalyticsEngineDataset {
762
782
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
763
783
  }
@@ -3903,6 +3923,8 @@ export type LoopbackDurableObjectClass<
3903
3923
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3904
3924
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3905
3925
  : (opts: { props?: any }) => DurableObjectClass<T>);
3926
+ export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3927
+ export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3906
3928
  export interface SyncKvStorage {
3907
3929
  get<T = unknown>(key: string): T | undefined;
3908
3930
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3922,6 +3944,10 @@ export interface WorkerStub {
3922
3944
  name?: string,
3923
3945
  options?: WorkerStubEntrypointOptions,
3924
3946
  ): Fetcher<T>;
3947
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3948
+ name?: string,
3949
+ options?: WorkerStubEntrypointOptions,
3950
+ ): DurableObjectClass<T>;
3925
3951
  }
3926
3952
  export interface WorkerStubEntrypointOptions {
3927
3953
  props?: any;
package/oldest/index.d.ts CHANGED
@@ -544,6 +544,9 @@ interface AlarmInvocationInfo {
544
544
  interface Cloudflare {
545
545
  readonly compatibilityFlags: Record<string, boolean>;
546
546
  }
547
+ declare abstract class ColoLocalActorNamespace {
548
+ get(actorId: string): Fetcher;
549
+ }
547
550
  interface DurableObject {
548
551
  fetch(request: Request): Response | Promise<Response>;
549
552
  connect?(socket: Socket): void | Promise<void>;
@@ -623,6 +626,7 @@ interface DurableObjectState<Props = unknown> {
623
626
  readonly id: DurableObjectId;
624
627
  readonly storage: DurableObjectStorage;
625
628
  container?: Container;
629
+ facets: DurableObjectFacets;
626
630
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
627
631
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
628
632
  getWebSockets(tag?: string): WebSocket[];
@@ -737,6 +741,22 @@ declare class WebSocketRequestResponsePair {
737
741
  get request(): string;
738
742
  get response(): string;
739
743
  }
744
+ interface DurableObjectFacets {
745
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
746
+ name: string,
747
+ getStartupOptions: () =>
748
+ | FacetStartupOptions<T>
749
+ | Promise<FacetStartupOptions<T>>,
750
+ ): Fetcher<T>;
751
+ abort(name: string, reason: any): void;
752
+ delete(name: string): void;
753
+ }
754
+ interface FacetStartupOptions<
755
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
756
+ > {
757
+ id?: DurableObjectId | string;
758
+ class: DurableObjectClass<T>;
759
+ }
740
760
  interface AnalyticsEngineDataset {
741
761
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
742
762
  }
@@ -3757,6 +3777,8 @@ type LoopbackDurableObjectClass<
3757
3777
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3758
3778
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3759
3779
  : (opts: { props?: any }) => DurableObjectClass<T>);
3780
+ interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3781
+ interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3760
3782
  interface SyncKvStorage {
3761
3783
  get<T = unknown>(key: string): T | undefined;
3762
3784
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3776,6 +3798,10 @@ interface WorkerStub {
3776
3798
  name?: string,
3777
3799
  options?: WorkerStubEntrypointOptions,
3778
3800
  ): Fetcher<T>;
3801
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3802
+ name?: string,
3803
+ options?: WorkerStubEntrypointOptions,
3804
+ ): DurableObjectClass<T>;
3779
3805
  }
3780
3806
  interface WorkerStubEntrypointOptions {
3781
3807
  props?: any;
package/oldest/index.ts CHANGED
@@ -546,6 +546,9 @@ export interface AlarmInvocationInfo {
546
546
  export interface Cloudflare {
547
547
  readonly compatibilityFlags: Record<string, boolean>;
548
548
  }
549
+ export declare abstract class ColoLocalActorNamespace {
550
+ get(actorId: string): Fetcher;
551
+ }
549
552
  export interface DurableObject {
550
553
  fetch(request: Request): Response | Promise<Response>;
551
554
  connect?(socket: Socket): void | Promise<void>;
@@ -625,6 +628,7 @@ export interface DurableObjectState<Props = unknown> {
625
628
  readonly id: DurableObjectId;
626
629
  readonly storage: DurableObjectStorage;
627
630
  container?: Container;
631
+ facets: DurableObjectFacets;
628
632
  blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
629
633
  acceptWebSocket(ws: WebSocket, tags?: string[]): void;
630
634
  getWebSockets(tag?: string): WebSocket[];
@@ -739,6 +743,22 @@ export declare class WebSocketRequestResponsePair {
739
743
  get request(): string;
740
744
  get response(): string;
741
745
  }
746
+ export interface DurableObjectFacets {
747
+ get<T extends Rpc.DurableObjectBranded | undefined = undefined>(
748
+ name: string,
749
+ getStartupOptions: () =>
750
+ | FacetStartupOptions<T>
751
+ | Promise<FacetStartupOptions<T>>,
752
+ ): Fetcher<T>;
753
+ abort(name: string, reason: any): void;
754
+ delete(name: string): void;
755
+ }
756
+ export interface FacetStartupOptions<
757
+ T extends Rpc.DurableObjectBranded | undefined = undefined,
758
+ > {
759
+ id?: DurableObjectId | string;
760
+ class: DurableObjectClass<T>;
761
+ }
742
762
  export interface AnalyticsEngineDataset {
743
763
  writeDataPoint(event?: AnalyticsEngineDataPoint): void;
744
764
  }
@@ -3763,6 +3783,8 @@ export type LoopbackDurableObjectClass<
3763
3783
  (T extends CloudflareWorkersModule.DurableObject<any, infer Props>
3764
3784
  ? (opts: { props?: Props }) => DurableObjectClass<T>
3765
3785
  : (opts: { props?: any }) => DurableObjectClass<T>);
3786
+ export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
3787
+ export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
3766
3788
  export interface SyncKvStorage {
3767
3789
  get<T = unknown>(key: string): T | undefined;
3768
3790
  list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
@@ -3782,6 +3804,10 @@ export interface WorkerStub {
3782
3804
  name?: string,
3783
3805
  options?: WorkerStubEntrypointOptions,
3784
3806
  ): Fetcher<T>;
3807
+ getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
3808
+ name?: string,
3809
+ options?: WorkerStubEntrypointOptions,
3810
+ ): DurableObjectClass<T>;
3785
3811
  }
3786
3812
  export interface WorkerStubEntrypointOptions {
3787
3813
  props?: any;
package/package.json CHANGED
@@ -7,5 +7,5 @@
7
7
  },
8
8
  "author": "Cloudflare Workers DevProd Team <workers-devprod@cloudflare.com> (https://workers.cloudflare.com)",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20260404.1"
10
+ "version": "4.20260408.1"
11
11
  }