Functions

@system-inc/base-foundation · 515c140 · 3 symbols

Injects a Cloudflare Container bound to the namespace declared by the given ContainerBinding.

InjectContainerProvider(namespaceToken: ContainerBinding): TypedParameterDecorator<CfContainerProvider<object, object>>

View source ↗

Injects a CloudflareDurableObjectProvider bound to the namespace declared by the given DurableObjectBinding<RpcInterface>. The resolved CfDurableObjectProvider<RpcInterface> is verified against the parameter's declared type at lint time.

InjectDurableObjectProvider(namespaceToken: DurableObjectBinding<RpcInterface, StubRpcInterface>): TypedParameterDecorator<CfDurableObjectProvider<RpcInterface, StubRpcInterface>>

View source ↗

Resolves the explicit DurableObjectId named by a CfDurableObjectInput, or undefined when neither id nor name was supplied — leaving the caller to choose its own default (a fresh unique id for durable objects, the singleton name for containers).

An empty-string id/name is rejected rather than silently ignored: a truthiness check used to let { id: '' } fall through to the default, so an uninitialized identifier quietly addressed a brand-new instance instead of the one the caller meant.

resolveExplicitObjectId(namespace: Pick<DurableObjectNamespace<Rpc.DurableObjectBranded>, "idFromString" | "idFromName">, input: CfDurableObjectInput | undefined): any

View source ↗