Skip to content

Commit

Permalink
fix(schema): prefer ReturnType instead of infer (#415)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Huang <[email protected]>
  • Loading branch information
huang-julien and Julien Huang authored Nov 21, 2024
1 parent 2577f49 commit 0460f9e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/schema/src/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export interface ScriptInstance<T extends BaseScriptApi> {
}
}

export type UseFunctionType<T, U> = T extends { use: infer V } ? V extends () => infer W ? W : U : U
export type UseFunctionType<T, U> = T extends {
use: infer V;
} ? V extends (...args: any) => any ? ReturnType<V> : U : U

export interface UseScriptOptions<T extends BaseScriptApi = {}, U = {}> extends HeadEntryOptions {
/**
Expand Down

0 comments on commit 0460f9e

Please sign in to comment.