Skip to content

Commit

Permalink
Support for type definition when using suspense
Browse files Browse the repository at this point in the history
  • Loading branch information
sskmy1024y committed Aug 31, 2023
1 parent 84054db commit b4dfced
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/client/src/createSWRProxyHooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ type DecorateProcedure<
TPath extends string
> = TProcedure extends AnyQueryProcedure
? {
useSWR: <TData = inferProcedureOutput<TProcedure>>(
useSWR: <
TData = inferProcedureOutput<TProcedure>,
TConfig extends SWRConfiguration<TData> = {}
>(
input: inferProcedureInput<TProcedure>,
opts?: SWRConfiguration<TData> & {
opts?: TConfig & {
isDisabled?: boolean;
}
) => SWRResponse<TData, TRPCClientErrorLike<TProcedure>>;
) => SWRResponse<TData, TRPCClientErrorLike<TProcedure>, TConfig>;

preload: (input: inferProcedureInput<TProcedure>) => Promise<void>;
getKey: GetKey<TProcedure, TPath>;
Expand Down

0 comments on commit b4dfced

Please sign in to comment.