Skip to content

Commit

Permalink
chore(cloudflare:test): improve runInDurableObject type (#5975)
Browse files Browse the repository at this point in the history
* 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 <5822355+RamIdeas@users.noreply.github.com>

---------

Co-authored-by: Rahul Sethi <5822355+RamIdeas@users.noreply.github.com>
  • Loading branch information
thiskevinwang and RamIdeas authored Jun 7, 2024
1 parent 3b99e63 commit cbebb04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vitest-pool-workers/types/cloudflare-test.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ declare module "cloudflare:test" {
* Objects defined in the `main` worker.
*/
export function runInDurableObject<O extends DurableObject, R>(
stub: DurableObjectStub,
stub: DurableObjectStub<O>,
callback: (instance: O, state: DurableObjectState) => R | Promise<R>
): Promise<R>;
/**
Expand Down

0 comments on commit cbebb04

Please sign in to comment.