Skip to content

Commit cbebb04

Browse files
chore(cloudflare:test): improve runInDurableObject type (#5975)
* chore(cloudflare:test): improve `runInDurableObject` type - this insures the callback's `instance` parameter infers the stub's type, which will include any typed RPC methods if they exist * Update packages/vitest-pool-workers/types/cloudflare-test.d.ts Co-authored-by: Rahul Sethi <[email protected]> --------- Co-authored-by: Rahul Sethi <[email protected]>
1 parent 3b99e63 commit cbebb04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/vitest-pool-workers/types/cloudflare-test.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ declare module "cloudflare:test" {
4545
* Objects defined in the `main` worker.
4646
*/
4747
export function runInDurableObject<O extends DurableObject, R>(
48-
stub: DurableObjectStub,
48+
stub: DurableObjectStub<O>,
4949
callback: (instance: O, state: DurableObjectState) => R | Promise<R>
5050
): Promise<R>;
5151
/**

0 commit comments

Comments
 (0)