()
| 197 | } |
| 198 | |
| 199 | #hostStub<T extends object>(): Rpc.DurableObjectBranded & T { |
| 200 | const { binding, id } = this.ctx.props; |
| 201 | const ns = (this.env as Record<string, unknown>)[binding] as |
| 202 | | DurableObjectNamespace<Rpc.DurableObjectBranded & T> |
| 203 | | undefined; |
| 204 | if (!ns) { |
| 205 | throw new Error(`WorkspaceServiceProxy: env.${binding} is not a DurableObjectNamespace`); |
| 206 | } |
| 207 | return ns.get(ns.idFromString(id)) as unknown as Rpc.DurableObjectBranded & T; |
| 208 | } |
| 209 | } |
no test coverage detected