Skip to content

Commit

Permalink
fix: plugin AsyncHook types
Browse files Browse the repository at this point in the history
  • Loading branch information
caohuilin committed Jan 23, 2025
1 parent e9d70c1 commit 5c74b47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
8 changes: 6 additions & 2 deletions packages/toolkit/plugin-v2/src/types/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ export type SyncHook<Callback extends (...args: any[]) => any> = {

export type AsyncHook<Callback extends (...args: any[]) => any> = {
tap: (cb: Callback) => void;
call: (...args: Parameters<Callback>) => Promise<ReturnType<Callback>>;
call: (
...args: Parameters<Callback>
) => Promise<UnwrapPromise<ReturnType<Callback>>>;
};

export type AsyncInterruptHook<Callback extends (...args: any[]) => any> = {
tap: (cb: Callback) => void;
call: (...args: Tail<Parameters<Callback>>) => Promise<ReturnType<Callback>>;
call: (
...args: Tail<Parameters<Callback>>
) => Promise<UnwrapPromise<ReturnType<Callback>>>;
};

export type CollectAsyncHook<Callback extends (...params: any[]) => any> = {
Expand Down
28 changes: 0 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5c74b47

Please sign in to comment.