/
githubmirror
/
trpc
Обзор
Документация
Войти
/
githubmirror
/
trpc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/react-query/src/shared/polymorphism/mutationLike.ts
42 строки
1 KB
Julius Marminge
chore(deps): modernize deps & tooling (#6164)
30 окт 2024, 21:40
Не верифицирован
30 окт 2024, 21:40
84e267e
Код
Авторство
О чём код?
import type { AnyProcedure, AnyRootTypes, inferProcedureInput, inferTransformedProcedureOutput, } from '@trpc/server/unstable-core-do-not-import'; import type { InferMutationOptions, InferMutationResult, } from '../../utils/inferReactQueryProcedure'; /** * Use to describe a mutation route which matches a given mutation procedure's interface */ export type MutationLike< TRoot extends AnyRootTypes, TProcedure extends AnyProcedure, > = { useMutation: ( opts?: InferMutationOptions<TRoot, TProcedure>, ) => InferMutationResult<TRoot, TProcedure>; }; /** * Use to unwrap a MutationLike's input */ export type InferMutationLikeInput< TMutationLike extends MutationLike<any, any>, > = TMutationLike extends MutationLike<any, infer $Procedure> ? inferProcedureInput<$Procedure> : never; /** * Use to unwrap a MutationLike's data output */ export type InferMutationLikeData< TMutationLike extends MutationLike<any, any>, > = TMutationLike extends MutationLike<infer TRoot, infer TProcedure> ? inferTransformedProcedureOutput<TRoot, TProcedure> : never;