Skip to main content

Type Alias: RpcAccessible<T>

RpcAccessible<T> = Omit<T, "ctx" | "env"> & object

Defined in: rpc/src/types.ts:150

Exposes ctx and env as public properties for TypeScript.

These properties are protected in DurableObject but accessible at runtime through the RPC proxy. This type makes TypeScript happy about that access.

Type Declaration​

ctx​

ctx: DurableObjectState

env​

env: any

Type Parameters​

T​

T

Example​

type MyDOType = RpcAccessible<InstanceType<typeof MyDO>>;
using client = createRpcClient<MyDOType>(...);
await client.ctx.storage.put('key', 'value'); // TypeScript allows this