import * as _trpc_client1 from "@trpc/client"; import { CreateTRPCClientOptions, TRPCClient, TRPCClientError, TRPCClientErrorLike, TRPCRequestOptions, TRPCUntypedClient, createTRPCClient } from "@trpc/client"; import { CancelOptions, DataTag, DefinedInitialDataInfiniteOptions, DefinedInitialDataOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, FetchInfiniteQueryOptions, FetchQueryOptions, InfiniteData, InfiniteQueryObserverSuccessResult, InitialDataFunction, InvalidateOptions, InvalidateQueryFilters, MutationOptions, Query, QueryClient, QueryClientConfig, QueryFilters, QueryKey, QueryObserverSuccessResult, QueryOptions, RefetchOptions, RefetchQueryFilters, ResetOptions, SetDataOptions, SkipToken, UndefinedInitialDataInfiniteOptions, UndefinedInitialDataOptions, UnusedSkipTokenInfiniteOptions, UnusedSkipTokenOptions, Updater, UseBaseQueryOptions, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query"; import { AnyClientTypes, AnyMutationProcedure, AnyProcedure, AnyQueryProcedure, AnyRootTypes, AnyRouter, DeepPartial, DistributiveOmit, MaybePromise, ProcedureType, ProtectedIntersection, RouterRecord, Simplify, coerceAsyncIterableToArray, inferAsyncIterableYield, inferProcedureInput, inferProcedureOutput, inferTransformedProcedureOutput } from "@trpc/server/unstable-core-do-not-import"; import * as React$1 from "react"; import { JSX, ReactNode } from "react"; //#region src/internals/context.d.ts interface TRPCUseUtilsOptions { /** * tRPC-related options */ trpc?: TRPCRequestOptions; } interface TRPCFetchQueryOptions extends DistributiveOmit, 'queryKey'>, TRPCUseUtilsOptions {} type TRPCFetchInfiniteQueryOptions = DistributiveOmit>, 'queryKey' | 'initialPageParam'> & TRPCUseUtilsOptions & { initialCursor?: ExtractCursorType; }; /** @internal */ type SSRState = 'mounted' | 'mounting' | 'prepass' | false; interface TRPCContextPropsBase { /** * The `TRPCClient` */ client: TRPCUntypedClient; /** * The SSR context when server-side rendering * @default null */ ssrContext?: TSSRContext | null; /** * State of SSR hydration. * - `false` if not using SSR. * - `prepass` when doing a prepass to fetch queries' data * - `mounting` before TRPCProvider has been rendered on the client * - `mounted` when the TRPCProvider has been rendered on the client * @default false */ ssrState?: SSRState; /** * @deprecated pass abortOnUnmount to `createTRPCReact` instead * Abort loading query calls when unmounting a component - usually when navigating to a new page * @default false */ abortOnUnmount?: boolean; } /** * @internal */ type DecoratedTRPCContextProps = TRPCContextPropsBase & { client: TRPCClient; }; interface TRPCContextProps extends TRPCContextPropsBase { /** * The react-query `QueryClient` */ queryClient: QueryClient; } declare const contextProps: (keyof TRPCContextPropsBase)[]; /** * @internal */ interface TRPCContextState extends Required>, TRPCQueryUtils {} /** * @internal */ interface TRPCQueryUtils { /** * @see https://tanstack.com/query/latest/docs/framework/react/reference/queryOptions#queryoptions */ queryOptions(path: readonly string[], // <-- look into if needed queryKey: TRPCQueryKey, opts?: UndefinedTRPCQueryOptionsIn>): UndefinedTRPCQueryOptionsOut>; queryOptions(path: readonly string[], // <-- look into if needed queryKey: TRPCQueryKey, opts: DefinedTRPCQueryOptionsIn>): DefinedTRPCQueryOptionsOut>; /** * @see https://tanstack.com/query/latest/docs/framework/react/reference/infiniteQueryOptions#infinitequeryoptions */ infiniteQueryOptions(path: readonly string[], // <-- look into if needed queryKey: TRPCQueryKey, opts: UndefinedTRPCInfiniteQueryOptionsIn>): UndefinedTRPCInfiniteQueryOptionsOut>; infiniteQueryOptions(path: readonly string[], // <-- look into if needed queryKey: TRPCQueryKey, opts: DefinedTRPCInfiniteQueryOptionsIn>): DefinedTRPCInfiniteQueryOptionsOut>; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientfetchquery */ fetchQuery: (queryKey: TRPCQueryKey, opts?: TRPCFetchQueryOptions>) => Promise; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientfetchinfinitequery */ fetchInfiniteQuery: (queryKey: TRPCQueryKey, opts?: TRPCFetchInfiniteQueryOptions>) => Promise>; /** * @see https://tanstack.com/query/v5/docs/framework/react/guides/prefetching */ prefetchQuery: (queryKey: TRPCQueryKey, opts?: TRPCFetchQueryOptions>) => Promise; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientprefetchinfinitequery */ prefetchInfiniteQuery: (queryKey: TRPCQueryKey, opts?: TRPCFetchInfiniteQueryOptions>) => Promise; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientensurequerydata */ ensureQueryData: (queryKey: TRPCQueryKey, opts?: TRPCFetchQueryOptions>) => Promise; /** * @see https://tanstack.com/query/v5/docs/framework/react/guides/query-invalidation */ invalidateQueries: (queryKey: TRPCQueryKey, filters?: InvalidateQueryFilters, options?: InvalidateOptions) => Promise; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientresetqueries */ resetQueries: (queryKey: TRPCQueryKey, filters?: QueryFilters, options?: ResetOptions) => Promise; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientrefetchqueries */ refetchQueries: (queryKey: TRPCQueryKey, filters?: RefetchQueryFilters, options?: RefetchOptions) => Promise; /** * @see https://tanstack.com/query/v5/docs/framework/react/guides/query-cancellation */ cancelQuery: (queryKey: TRPCQueryKey, options?: CancelOptions) => Promise; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetquerydata */ setQueryData: (queryKey: TRPCQueryKey, updater: Updater, options?: SetDataOptions) => void; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetqueriesdata */ setQueriesData: (queryKey: TRPCQueryKey, filters: QueryFilters, updater: Updater, options?: SetDataOptions) => [QueryKey, unknown][]; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientgetquerydata */ getQueryData: (queryKey: TRPCQueryKey) => unknown; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetquerydata */ setInfiniteQueryData: (queryKey: TRPCQueryKey, updater: Updater | undefined, InfiniteData | undefined>, options?: SetDataOptions) => void; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientgetquerydata */ getInfiniteQueryData: (queryKey: TRPCQueryKey) => InfiniteData | undefined; /** * @see https://tanstack.com/query/latest/docs/reference/QueryClient/#queryclientsetmutationdefaults */ setMutationDefaults: (mutationKey: TRPCMutationKey, options: MutationOptions | ((args: { canonicalMutationFn: (input: unknown) => Promise; }) => MutationOptions)) => void; /** * @see https://tanstack.com/query/latest/docs/reference/QueryClient#queryclientgetmutationdefaults */ getMutationDefaults: (mutationKey: TRPCMutationKey) => MutationOptions | undefined; /** * @see https://tanstack.com/query/latest/docs/reference/QueryClient#queryclientismutating */ isMutating: (filters: { mutationKey: TRPCMutationKey; }) => number; } declare const TRPCContext: React$1.Context; //#endregion //#region src/shared/hooks/types.d.ts type OutputWithCursor = { cursor: TCursor | null; data: TData; }; interface TRPCReactRequestOptions extends Omit { /** * Opt out of SSR for this query by passing `ssr: false` */ ssr?: boolean; /** * Opt out or into aborting request on unmount */ abortOnUnmount?: boolean; } interface TRPCUseQueryBaseOptions { /** * tRPC-related options */ trpc?: TRPCReactRequestOptions; } interface UseTRPCQueryOptions extends DistributiveOmit, 'queryKey'>, TRPCUseQueryBaseOptions {} interface UseTRPCSuspenseQueryOptions extends DistributiveOmit, 'queryKey'>, TRPCUseQueryBaseOptions {} interface UseTRPCPrefetchQueryOptions extends DistributiveOmit, 'queryKey'>, TRPCUseQueryBaseOptions {} /** @internal **/ interface DefinedUseTRPCQueryOptions extends DistributiveOmit, 'queryKey'> { initialData: InitialDataFunction | TQueryOptsData; } interface TRPCQueryOptions extends DistributiveOmit, 'queryKey'>, TRPCUseQueryBaseOptions { queryKey: TRPCQueryKey; } type ExtractCursorType = TInput extends { cursor?: any; } ? TInput['cursor'] : unknown; interface UseTRPCInfiniteQueryOptions extends DistributiveOmit>, 'queryKey' | 'initialPageParam'>, TRPCUseQueryBaseOptions { initialCursor?: ExtractCursorType; } type UseTRPCPrefetchInfiniteQueryOptions = DistributiveOmit>, 'queryKey' | 'initialPageParam'> & TRPCUseQueryBaseOptions & { initialCursor?: ExtractCursorType; }; interface UseTRPCSuspenseInfiniteQueryOptions extends DistributiveOmit>, 'queryKey' | 'initialPageParam'>, TRPCUseQueryBaseOptions { initialCursor?: ExtractCursorType; } interface UseTRPCMutationOptions extends UseMutationOptions, TRPCUseQueryBaseOptions {} interface UseTRPCSubscriptionOptions { /** * @deprecated * use a `skipToken` from `@tanstack/react-query` instead * this will be removed in v12 */ enabled?: boolean; /** * Called when the subscription is started */ onStarted?: () => void; /** * Called when new data is received */ onData?: (data: TOutput) => void; /** * Called when an **unrecoverable error** occurs and the subscription is closed */ onError?: (err: TError) => void; /** * Called when the subscription is completed on the server */ onComplete?: () => void; } interface TRPCSubscriptionBaseResult { status: 'idle' | 'connecting' | 'pending' | 'error'; data: undefined | TOutput; error: null | TError; /** * Reset the subscription */ reset: () => void; } interface TRPCSubscriptionIdleResult extends TRPCSubscriptionBaseResult { status: 'idle'; data: undefined; error: null; } interface TRPCSubscriptionConnectingResult extends TRPCSubscriptionBaseResult { status: 'connecting'; data: undefined | TOutput; error: TError | null; } interface TRPCSubscriptionPendingResult extends TRPCSubscriptionBaseResult { status: 'pending'; data: TOutput | undefined; error: null; } interface TRPCSubscriptionErrorResult extends TRPCSubscriptionBaseResult { status: 'error'; data: TOutput | undefined; error: TError; } type TRPCSubscriptionResult = TRPCSubscriptionIdleResult | TRPCSubscriptionConnectingResult | TRPCSubscriptionErrorResult | TRPCSubscriptionPendingResult; interface TRPCProviderProps extends Omit, 'client'> { children: ReactNode; client: TRPCClient | TRPCUntypedClient; } type TRPCProvider = (props: TRPCProviderProps) => JSX.Element; type CreateClient = (opts: CreateTRPCClientOptions) => TRPCUntypedClient; /** * @internal */ type UseTRPCQueryResult = TRPCHookResult & UseQueryResult, TError>; /** * @internal */ type DefinedUseTRPCQueryResult = DefinedUseQueryResult & TRPCHookResult; /** * @internal */ type UseTRPCQuerySuccessResult = QueryObserverSuccessResult & TRPCHookResult; /** * @internal */ type UseTRPCSuspenseQueryResult = [TData, UseSuspenseQueryResult & TRPCHookResult]; /** * @internal */ type UseTRPCInfiniteQueryResult = TRPCHookResult & UseInfiniteQueryResult> | null>, TError>; /** * @internal */ type UseTRPCInfiniteQuerySuccessResult = InfiniteQueryObserverSuccessResult> | null>, TError> & TRPCHookResult; /** * @internal */ type UseTRPCSuspenseInfiniteQueryResult = [InfiniteData> | null>, UseSuspenseInfiniteQueryResult> | null>, TError> & TRPCHookResult]; /** * @internal */ type UseTRPCMutationResult = TRPCHookResult & UseMutationResult; interface TRPCHookResult { trpc: { path: string; }; } //# sourceMappingURL=types.d.ts.map //#endregion //#region src/shared/types.d.ts interface TRPCQueryBaseOptions { /** * tRPC-related options */ trpc?: TRPCReactRequestOptions; } interface TRPCQueryOptionsResult { trpc: { path: string; }; } type TRPCOptionOverrides = 'queryKey' | 'queryFn' | 'queryHashFn' | 'queryHash'; type TRPCInfiniteOptionOverrides = TRPCOptionOverrides | 'initialPageParam'; /** * QueryOptions API helpers */ interface UndefinedTRPCQueryOptionsIn extends DistributiveOmit, TError, coerceAsyncIterableToArray, TRPCQueryKey>, TRPCOptionOverrides>, TRPCQueryBaseOptions {} interface UndefinedTRPCQueryOptionsOut extends UndefinedInitialDataOptions, TError, coerceAsyncIterableToArray, TRPCQueryKey>, TRPCQueryOptionsResult { queryKey: DataTag, TError>; } interface DefinedTRPCQueryOptionsIn extends DistributiveOmit, TError, coerceAsyncIterableToArray, TRPCQueryKey>, TRPCOptionOverrides>, TRPCQueryBaseOptions {} interface DefinedTRPCQueryOptionsOut extends DefinedInitialDataOptions, TError, coerceAsyncIterableToArray, TRPCQueryKey>, TRPCQueryOptionsResult { queryKey: DataTag, TError>; } interface UnusedSkipTokenTRPCQueryOptionsIn extends DistributiveOmit, TError, coerceAsyncIterableToArray, TRPCQueryKey>, TRPCOptionOverrides>, TRPCQueryBaseOptions {} interface UnusedSkipTokenTRPCQueryOptionsOut extends UnusedSkipTokenOptions, TError, coerceAsyncIterableToArray, TRPCQueryKey>, TRPCQueryOptionsResult { queryKey: DataTag, TError>; } /** * InifiniteQueryOptions helpers */ interface UndefinedTRPCInfiniteQueryOptionsIn extends DistributiveOmit> | null>, TRPCQueryKey, NonNullable> | null>, TRPCInfiniteOptionOverrides>, TRPCQueryBaseOptions { initialCursor?: NonNullable> | null; } interface UndefinedTRPCInfiniteQueryOptionsOut extends DistributiveOmit> | null>, TRPCQueryKey, NonNullable> | null>, 'initialPageParam'>, TRPCQueryOptionsResult { queryKey: DataTag; initialPageParam: NonNullable> | null; } interface DefinedTRPCInfiniteQueryOptionsIn extends DistributiveOmit> | null>, TRPCQueryKey, NonNullable> | null>, TRPCInfiniteOptionOverrides>, TRPCQueryBaseOptions { initialCursor?: NonNullable> | null; } interface DefinedTRPCInfiniteQueryOptionsOut extends DistributiveOmit> | null>, TRPCQueryKey, NonNullable> | null>, 'initialPageParam'>, TRPCQueryOptionsResult { queryKey: DataTag; initialPageParam: NonNullable> | null; } interface UnusedSkipTokenTRPCInfiniteQueryOptionsIn extends DistributiveOmit> | null>, TRPCQueryKey, NonNullable> | null>, TRPCInfiniteOptionOverrides>, TRPCQueryBaseOptions { initialCursor?: NonNullable> | null; } interface UnusedSkipTokenTRPCInfiniteQueryOptionsOut extends DistributiveOmit> | null>, TRPCQueryKey, NonNullable> | null>, 'initialPageParam'>, TRPCQueryOptionsResult { queryKey: DataTag; initialPageParam: NonNullable> | null; } /** * @internal */ interface UseMutationOverride { onSuccess: (opts: { /** * Calls the original function that was defined in the query's `onSuccess` option */ originalFn: () => MaybePromise; queryClient: QueryClient; /** * Meta data passed in from the `useMutation()` hook */ meta: Record; }) => MaybePromise; } /** * @internal */ interface CreateTRPCReactOptions<_TRouter extends AnyRouter> { /** * Override behaviors of the built-in hooks */ overrides?: { useMutation?: Partial; }; /** * Abort all queries when unmounting * @default false */ abortOnUnmount?: boolean; /** * Override the default context provider * @default undefined */ context?: React.Context; } //#endregion //#region src/shared/hooks/createHooksInternal.d.ts /** * @internal */ declare function createRootHooks(config?: CreateTRPCReactOptions): { Provider: TRPCProvider; createClient: (opts: _trpc_client1.CreateTRPCClientOptions) => _trpc_client1.TRPCClient; useContext: () => TRPCContextState; useUtils: () => TRPCContextState; useQuery: (path: readonly string[], input: unknown, opts?: UseTRPCQueryOptions>) => UseTRPCQueryResult>; usePrefetchQuery: (path: string[], input: unknown, opts?: UseTRPCPrefetchQueryOptions>) => void; useSuspenseQuery: (path: readonly string[], input: unknown, opts?: UseTRPCSuspenseQueryOptions>) => UseTRPCSuspenseQueryResult>; useQueries: TRPCUseQueries; useSuspenseQueries: TRPCUseSuspenseQueries; useMutation: (path: readonly string[], opts?: UseTRPCMutationOptions, unknown, unknown>) => UseTRPCMutationResult, unknown, unknown>; useSubscription: (path: readonly string[], input: unknown, opts: UseTRPCSubscriptionOptions>) => TRPCSubscriptionResult>; useInfiniteQuery: (path: readonly string[], input: unknown, opts: UseTRPCInfiniteQueryOptions>) => UseTRPCInfiniteQueryResult, unknown>; usePrefetchInfiniteQuery: (path: string[], input: unknown, opts: UseTRPCPrefetchInfiniteQueryOptions>) => void; useSuspenseInfiniteQuery: (path: readonly string[], input: unknown, opts: UseTRPCSuspenseInfiniteQueryOptions>) => UseTRPCSuspenseInfiniteQueryResult, unknown>; }; /** * Infer the type of a `createReactQueryHooks` function * @internal */ type CreateReactQueryHooks = ReturnType>; //# sourceMappingURL=createHooksInternal.d.ts.map //#endregion //#region src/shared/proxy/decorationProxy.d.ts /** * Create proxy for decorating procedures * @internal */ declare function createReactDecoration(hooks: CreateReactQueryHooks): unknown; //# sourceMappingURL=decorationProxy.d.ts.map //#endregion //#region src/utils/inferReactQueryProcedure.d.ts /** * @internal */ type InferQueryOptions> = Omit, inferTransformedProcedureOutput, TRPCClientErrorLike, TData>, 'select' | 'queryFn'>; /** * @internal */ type InferMutationOptions = UseTRPCMutationOptions, TRPCClientErrorLike, inferTransformedProcedureOutput, TMeta>; /** * @internal */ type InferQueryResult = UseTRPCQueryResult, TRPCClientErrorLike>; /** * @internal */ type InferMutationResult = UseTRPCMutationResult, TRPCClientErrorLike, inferProcedureInput, TContext>; type inferReactQueryProcedureOptionsInner = { [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyQueryProcedure ? InferQueryOptions : $Value extends AnyMutationProcedure ? InferMutationOptions : $Value extends RouterRecord ? inferReactQueryProcedureOptionsInner : never : never }; type inferReactQueryProcedureOptions = inferReactQueryProcedureOptionsInner; //#endregion //#region src/shared/proxy/utilsProxy.d.ts type DecorateQueryProcedure = { /** * @see https://tanstack.com/query/latest/docs/framework/react/reference/queryOptions#queryoptions */ queryOptions, TData = TQueryFnData>(input: inferProcedureInput | SkipToken, opts: DefinedTRPCQueryOptionsIn>): DefinedTRPCQueryOptionsOut>; /** * @see https://tanstack.com/query/latest/docs/framework/react/reference/queryOptions#queryoptions */ queryOptions, TData = TQueryFnData>(input: inferProcedureInput | SkipToken, opts?: UnusedSkipTokenTRPCQueryOptionsIn>): UnusedSkipTokenTRPCQueryOptionsOut>; /** * @see https://tanstack.com/query/latest/docs/framework/react/reference/queryOptions#queryoptions */ queryOptions, TData = TQueryFnData>(input: inferProcedureInput | SkipToken, opts?: UndefinedTRPCQueryOptionsIn>): UndefinedTRPCQueryOptionsOut>; /** * @see https://tanstack.com/query/latest/docs/framework/react/reference/infiniteQueryOptions#infinitequeryoptions */ infiniteQueryOptions, TData = TQueryFnData>(input: inferProcedureInput | SkipToken, opts: DefinedTRPCInfiniteQueryOptionsIn, TQueryFnData, TData, TRPCClientError>): DefinedTRPCInfiniteQueryOptionsOut, TQueryFnData, TData, TRPCClientError>; /** * @see https://tanstack.com/query/latest/docs/framework/react/reference/infiniteQueryOptions#infinitequeryoptions */ infiniteQueryOptions, TData = TQueryFnData>(input: inferProcedureInput, opts: UnusedSkipTokenTRPCInfiniteQueryOptionsIn, TQueryFnData, TData, TRPCClientError>): UnusedSkipTokenTRPCInfiniteQueryOptionsOut, TQueryFnData, TData, TRPCClientError>; /** * @see https://tanstack.com/query/latest/docs/framework/react/reference/infiniteQueryOptions#infinitequeryoptions */ infiniteQueryOptions, TData = TQueryFnData>(input: inferProcedureInput | SkipToken, opts?: UndefinedTRPCInfiniteQueryOptionsIn, TQueryFnData, TData, TRPCClientError>): UndefinedTRPCInfiniteQueryOptionsOut, TQueryFnData, TData, TRPCClientError>; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientfetchquery */ fetch(input: inferProcedureInput, opts?: TRPCFetchQueryOptions, TRPCClientError>): Promise>; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientfetchinfinitequery */ fetchInfinite(input: inferProcedureInput, opts?: TRPCFetchInfiniteQueryOptions, inferTransformedProcedureOutput, TRPCClientError>): Promise, NonNullable>> | null>>; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientprefetchquery */ prefetch(input: inferProcedureInput, opts?: TRPCFetchQueryOptions, TRPCClientError>): Promise; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientprefetchinfinitequery */ prefetchInfinite(input: inferProcedureInput, opts?: TRPCFetchInfiniteQueryOptions, inferTransformedProcedureOutput, TRPCClientError>): Promise; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientensurequerydata */ ensureData(input: inferProcedureInput, opts?: TRPCFetchQueryOptions, TRPCClientError>): Promise>; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientinvalidatequeries */ invalidate(input?: DeepPartial>, filters?: Omit & { predicate?: (query: Query, TRPCClientError, inferTransformedProcedureOutput, QueryKeyKnown, inferProcedureInput extends { cursor?: any; } | void ? 'infinite' : 'query'>>) => boolean; }, options?: InvalidateOptions): Promise; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientrefetchqueries */ refetch(input?: inferProcedureInput, filters?: RefetchQueryFilters, options?: RefetchOptions): Promise; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientcancelqueries */ cancel(input?: inferProcedureInput, options?: CancelOptions): Promise; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientresetqueries */ reset(input?: inferProcedureInput, options?: ResetOptions): Promise; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetquerydata */ setData( /** * The input of the procedure */ input: inferProcedureInput, updater: Updater | undefined, inferTransformedProcedureOutput | undefined>, options?: SetDataOptions): void; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetquerydata */ setQueriesData( /** * The input of the procedure */ input: inferProcedureInput, filters: QueryFilters, updater: Updater | undefined, inferTransformedProcedureOutput | undefined>, options?: SetDataOptions): [QueryKey, inferTransformedProcedureOutput]; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetquerydata */ setInfiniteData(input: inferProcedureInput, updater: Updater, NonNullable>> | null> | undefined, InfiniteData, NonNullable>> | null> | undefined>, options?: SetDataOptions): void; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientgetquerydata */ getData(input?: inferProcedureInput): inferTransformedProcedureOutput | undefined; /** * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientgetquerydata */ getInfiniteData(input?: inferProcedureInput): InfiniteData, NonNullable>> | null> | undefined; }; type DecorateMutationProcedure = { setMutationDefaults(options: InferMutationOptions | ((args: { canonicalMutationFn: NonNullable['mutationFn']>; }) => InferMutationOptions)): void; getMutationDefaults(): InferMutationOptions | undefined; isMutating(): number; }; /** * this is the type that is used to add in procedures that can be used on * an entire router */ type DecorateRouter = { /** * Invalidate the full router * @see https://trpc.io/docs/v10/useContext#query-invalidation * @see https://tanstack.com/query/v5/docs/framework/react/guides/query-invalidation */ invalidate(input?: undefined, filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise; }; /** * @internal */ type DecoratedProcedureUtilsRecord = DecorateRouter & { [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyQueryProcedure ? DecorateQueryProcedure : $Value extends AnyMutationProcedure ? DecorateMutationProcedure : $Value extends RouterRecord ? DecoratedProcedureUtilsRecord & DecorateRouter : never : never }; type AnyDecoratedProcedure = DecorateQueryProcedure & DecorateMutationProcedure; type CreateReactUtils = ProtectedIntersection, DecoratedProcedureUtilsRecord>; type CreateQueryUtils = DecoratedProcedureUtilsRecord; declare const getQueryType: (utilName: keyof AnyDecoratedProcedure) => QueryType; /** * @internal */ declare function createReactQueryUtils(context: TRPCContextState): ProtectedIntersection, DecoratedProcedureUtilsRecord>; /** * @internal */ declare function createQueryUtilsProxy(context: TRPCQueryUtils): CreateQueryUtils; //#endregion //#region src/shared/proxy/useQueriesProxy.d.ts type GetQueryOptions = >(input: inferProcedureInput, opts?: TrpcQueryOptionsForUseQueries, TData, TRPCClientError>) => TrpcQueryOptionsForUseQueries, TData, TRPCClientError>; /** * @internal */ type UseQueriesProcedureRecord = { [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyQueryProcedure ? GetQueryOptions : $Value extends RouterRecord ? UseQueriesProcedureRecord : never : never }; type GetSuspenseQueryOptions = >(input: inferProcedureInput, opts?: TrpcQueryOptionsForUseSuspenseQueries, TData, TRPCClientError>) => TrpcQueryOptionsForUseSuspenseQueries, TData, TRPCClientError>; /** * @internal */ type UseSuspenseQueriesProcedureRecord = { [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyQueryProcedure ? GetSuspenseQueryOptions : $Value extends RouterRecord ? UseSuspenseQueriesProcedureRecord : never : never }; /** * Create proxy for `useQueries` options * @internal */ declare function createUseQueries(client: TRPCUntypedClient | TRPCClient): UseQueriesProcedureRecord; //#endregion //#region src/shared/queryClient.d.ts /** * @internal */ type CreateTRPCReactQueryClientConfig = { queryClient?: QueryClient; queryClientConfig?: never; } | { queryClientConfig?: QueryClientConfig; queryClient?: never; }; /** * @internal */ declare const getQueryClient: (config: CreateTRPCReactQueryClientConfig) => QueryClient; //# sourceMappingURL=queryClient.d.ts.map //#endregion //#region src/shared/polymorphism/mutationLike.d.ts /** * Use to describe a mutation route which matches a given mutation procedure's interface */ type MutationLike = { useMutation: (opts?: InferMutationOptions) => InferMutationResult; }; /** * Use to unwrap a MutationLike's input */ type InferMutationLikeInput> = TMutationLike extends MutationLike ? inferProcedureInput<$Procedure> : never; /** * Use to unwrap a MutationLike's data output */ type InferMutationLikeData> = TMutationLike extends MutationLike ? inferTransformedProcedureOutput : never; //# sourceMappingURL=mutationLike.d.ts.map //#endregion //#region src/shared/polymorphism/queryLike.d.ts /** * Use to request a query route which matches a given query procedure's interface */ type QueryLike = { useQuery: (variables: inferProcedureInput, opts?: InferQueryOptions) => InferQueryResult; useSuspenseQuery: (variables: inferProcedureInput, opts?: InferQueryOptions) => UseTRPCSuspenseQueryResult, TRPCClientErrorLike>; }; /** * Use to unwrap a QueryLike's input */ type InferQueryLikeInput = TQueryLike extends DecoratedQuery ? $Def['input'] : TQueryLike extends QueryLike ? inferProcedureInput : never; /** * Use to unwrap a QueryLike's data output */ type InferQueryLikeData = TQueryLike extends DecoratedQuery ? $Def['output'] : TQueryLike extends QueryLike ? inferTransformedProcedureOutput : never; //# sourceMappingURL=queryLike.d.ts.map //#endregion //#region src/shared/polymorphism/routerLike.d.ts /** * Use to describe a route path which matches a given route's interface */ type RouterLike = RouterLikeInner; type RouterLikeInner = { [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyQueryProcedure ? QueryLike : $Value extends AnyMutationProcedure ? MutationLike : $Value extends RouterRecord ? RouterLikeInner : never : never }; //# sourceMappingURL=routerLike.d.ts.map //#endregion //#region src/shared/polymorphism/utilsLike.d.ts /** * Use to describe a Utils/Context path which matches the given route's interface */ type UtilsLike = DecoratedProcedureUtilsRecord; //# sourceMappingURL=utilsLike.d.ts.map //#endregion //#region src/internals/getClientArgs.d.ts /** * @internal */ declare function getClientArgs(queryKey: TRPCQueryKey, opts: TOptions, infiniteParams?: { pageParam: any; direction: 'forward' | 'backward'; }): readonly [string, unknown, any]; //# sourceMappingURL=getClientArgs.d.ts.map //#endregion //#region src/internals/useQueries.d.ts /** * @internal */ type UseQueryOptionsForUseQueries = DistributiveOmit, 'queryKey'>; /** * @internal */ type UseQueryOptionsForUseSuspenseQueries = DistributiveOmit, 'queryKey'>; /** * @internal */ type TrpcQueryOptionsForUseQueries = DistributiveOmit, 'queryKey'>; /** * @internal */ type TrpcQueryOptionsForUseSuspenseQueries = DistributiveOmit, 'queryKey'>; /** * @internal */ declare type QueriesResults[]> = { [TKey in keyof TQueriesOptions]: TQueriesOptions[TKey] extends UseQueryOptionsForUseQueries ? UseTRPCQueryResult : never }; /** * @internal */ declare type SuspenseQueriesResults[]> = [{ [TKey in keyof TQueriesOptions]: TQueriesOptions[TKey] extends UseQueryOptionsForUseSuspenseQueries ? unknown extends TData ? TQueryFnData : TData : never }, { [TKey in keyof TQueriesOptions]: TQueriesOptions[TKey] extends UseQueryOptionsForUseSuspenseQueries ? UseSuspenseQueryResult : never }]; type GetOptions = TQueryOptions extends UseQueryOptionsForUseQueries ? TQueryOptions : never; /** * @internal */ type QueriesOptions = TQueriesOptions extends [] ? [] : TQueriesOptions extends [infer Head] ? [...TResult, GetOptions] : TQueriesOptions extends [infer Head, ...infer Tail] ? QueriesOptions]> : unknown[] extends TQueriesOptions ? TQueriesOptions : TQueriesOptions extends UseQueryOptionsForUseQueries[] ? UseQueryOptionsForUseQueries[] : UseQueryOptionsForUseQueries[]; type GetSuspenseOptions = TQueryOptions extends UseQueryOptionsForUseSuspenseQueries ? TQueryOptions : never; /** * @internal */ type SuspenseQueriesOptions = TQueriesOptions extends [] ? [] : TQueriesOptions extends [infer Head] ? [...TResult, GetSuspenseOptions] : TQueriesOptions extends [infer Head, ...infer Tail] ? SuspenseQueriesOptions]> : unknown[] extends TQueriesOptions ? TQueriesOptions : TQueriesOptions extends UseQueryOptionsForUseSuspenseQueries[] ? UseQueryOptionsForUseSuspenseQueries[] : UseQueryOptionsForUseSuspenseQueries[]; /** * @internal */ type TRPCUseQueries = [], TCombinedResult = QueriesResults>(queriesCallback: (t: UseQueriesProcedureRecord) => readonly [...QueriesOptions], options?: { combine?: (results: QueriesResults) => TCombinedResult; }) => TCombinedResult; /** * @internal */ type TRPCUseSuspenseQueries = []>(queriesCallback: (t: UseSuspenseQueriesProcedureRecord) => readonly [...SuspenseQueriesOptions]) => SuspenseQueriesResults; //#endregion //#region src/createTRPCReact.d.ts type ResolverDef = { input: any; output: any; transformer: boolean; errorShape: any; }; /** * @internal */ interface ProcedureUseQuery { (input: TDef['input'] | SkipToken, opts: DefinedUseTRPCQueryOptions, TDef['output']>): DefinedUseTRPCQueryResult>; (input: TDef['input'] | SkipToken, opts?: UseTRPCQueryOptions, TDef['output']>): UseTRPCQueryResult>; } /** * @internal */ type ProcedureUsePrefetchQuery = (input: TDef['input'] | SkipToken, opts?: TRPCFetchQueryOptions>) => void; /** * @remark `void` is here due to https://github.com/trpc/trpc/pull/4374 */ type CursorInput = { cursor?: any; } | void; type ReservedInfiniteQueryKeys = 'cursor' | 'direction'; type InfiniteInput = Omit | SkipToken; type inferCursorType = TInput extends { cursor?: any; } ? TInput['cursor'] : unknown; type makeInfiniteQueryOptions = Omit & TRPCUseQueryBaseOptions & { initialCursor?: TCursor; }; type trpcInfiniteData = Simplify>>; interface useTRPCInfiniteQuery { >(input: InfiniteInput, opts: makeInfiniteQueryOptions, DefinedInitialDataInfiniteOptions, TData, any, inferCursorType>>): TRPCHookResult & DefinedUseInfiniteQueryResult>; >(input: InfiniteInput, opts?: makeInfiniteQueryOptions, UndefinedInitialDataInfiniteOptions, TData, any, inferCursorType>>): TRPCHookResult & UseInfiniteQueryResult>; >(input: InfiniteInput, opts?: makeInfiniteQueryOptions, UseInfiniteQueryOptions, TData, any, inferCursorType>>): TRPCHookResult & UseInfiniteQueryResult>; } type useTRPCSuspenseInfiniteQuery = (input: InfiniteInput, opts: makeInfiniteQueryOptions, UseSuspenseInfiniteQueryOptions, trpcInfiniteData, any, inferCursorType>>) => [trpcInfiniteData, TRPCHookResult & UseSuspenseInfiniteQueryResult, TRPCClientErrorLike>]; /** * @internal */ type MaybeDecoratedInfiniteQuery = TDef['input'] extends CursorInput ? { /** * @see https://trpc.io/docs/v11/client/react/useInfiniteQuery */ useInfiniteQuery: useTRPCInfiniteQuery; /** * @see https://trpc.io/docs/client/react/suspense#usesuspenseinfinitequery */ useSuspenseInfiniteQuery: useTRPCSuspenseInfiniteQuery; usePrefetchInfiniteQuery: (input: Omit | SkipToken, opts: TRPCFetchInfiniteQueryOptions>) => void; } : object; /** * @internal */ type DecoratedQueryMethods = { /** * @see https://trpc.io/docs/v11/client/react/useQuery */ useQuery: ProcedureUseQuery; usePrefetchQuery: ProcedureUsePrefetchQuery; /** * @see https://trpc.io/docs/v11/client/react/suspense#usesuspensequery */ useSuspenseQuery: (input: TDef['input'], opts?: UseTRPCSuspenseQueryOptions>) => [TData, UseSuspenseQueryResult> & TRPCHookResult]; }; /** * @internal */ type DecoratedQuery = MaybeDecoratedInfiniteQuery & DecoratedQueryMethods; type DecoratedMutation = { /** * @see https://trpc.io/docs/v11/client/react/useMutation */ useMutation: (opts?: UseTRPCMutationOptions, TDef['output'], TContext>) => UseTRPCMutationResult, TDef['input'], TContext>; }; interface ProcedureUseSubscription { (input: TDef['input'], opts?: UseTRPCSubscriptionOptions, TRPCClientErrorLike>): TRPCSubscriptionResult, TRPCClientErrorLike>; (input: TDef['input'] | SkipToken, opts?: Omit, TRPCClientErrorLike>, 'enabled'>): TRPCSubscriptionResult, TRPCClientErrorLike>; } /** * @internal */ type DecorateProcedure = TType extends 'query' ? DecoratedQuery : TType extends 'mutation' ? DecoratedMutation : TType extends 'subscription' ? { /** * @see https://trpc.io/docs/v11/subscriptions */ useSubscription: ProcedureUseSubscription; } : never; /** * @internal */ type DecorateRouterRecord = { [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyProcedure ? DecorateProcedure<$Value['_def']['type'], { input: inferProcedureInput<$Value>; output: inferTransformedProcedureOutput; transformer: TRoot['transformer']; errorShape: TRoot['errorShape']; }> : $Value extends RouterRecord ? DecorateRouterRecord : never : never }; /** * @internal */ type CreateTRPCReactBase = { /** * @deprecated renamed to `useUtils` and will be removed in a future tRPC version * * @see https://trpc.io/docs/v11/client/react/useUtils */ useContext(): CreateReactUtils; /** * @see https://trpc.io/docs/v11/client/react/useUtils */ useUtils(): CreateReactUtils; Provider: TRPCProvider; createClient: typeof createTRPCClient; useQueries: TRPCUseQueries; useSuspenseQueries: TRPCUseSuspenseQueries; }; type CreateTRPCReact = ProtectedIntersection, DecorateRouterRecord>; /** * @internal */ declare function createTRPCReact(opts?: CreateTRPCReactOptions): CreateTRPCReact; //#endregion //#region src/internals/getQueryKey.d.ts type QueryType = 'any' | 'infinite' | 'query'; type TRPCQueryKey = [readonly string[], { input?: unknown; type?: Exclude; }?]; type TRPCMutationKey = [readonly string[]]; type ProcedureOrRouter = DecoratedMutation | DecoratedQuery | DecorateRouterRecord; /** * To allow easy interactions with groups of related queries, such as * invalidating all queries of a router, we use an array as the path when * storing in tanstack query. **/ type GetInfiniteQueryInput> = keyof TInputWithoutCursorAndDirection extends never ? undefined : DeepPartial | undefined; /** @internal */ type GetQueryProcedureInput = TProcedureInput extends { cursor?: any; } ? GetInfiniteQueryInput : DeepPartial | undefined; type GetParams = TProcedureOrRouter extends DecoratedQuery ? [input?: GetQueryProcedureInput<$Def['input']>, type?: QueryType] : []; /** * Method to extract the query key for a procedure * @param procedureOrRouter - procedure or AnyRouter * @param input - input to procedureOrRouter * @param type - defaults to `any` * @see https://trpc.io/docs/v11/getQueryKey */ declare function getQueryKey(procedureOrRouter: TProcedureOrRouter, ..._params: GetParams): TRPCQueryKey; type QueryKeyKnown> = [string[], { input?: GetQueryProcedureInput; type: TType; }?]; /** * Method to extract the mutation key for a procedure * @param procedure - procedure * @see https://trpc.io/docs/v11/getQueryKey#mutations */ declare function getMutationKey>(procedure: TProcedure): TRPCMutationKey; //#endregion export { CreateClient, CreateQueryUtils, CreateReactUtils, CreateTRPCReact, CreateTRPCReactBase, CreateTRPCReactOptions, CreateTRPCReactQueryClientConfig, DecorateProcedure, DecorateQueryProcedure, DecorateRouterRecord, DecoratedProcedureUtilsRecord, DecoratedTRPCContextProps, DefinedTRPCInfiniteQueryOptionsIn, DefinedTRPCInfiniteQueryOptionsOut, DefinedTRPCQueryOptionsIn, DefinedTRPCQueryOptionsOut, DefinedUseTRPCQueryOptions, DefinedUseTRPCQueryResult, ExtractCursorType, InferMutationLikeData, InferMutationLikeInput, InferQueryLikeData, InferQueryLikeInput, MutationLike, OutputWithCursor, QueryLike, RouterLike, RouterLikeInner, SSRState, TRPCContext, TRPCContextProps, TRPCContextPropsBase, TRPCContextState, TRPCFetchInfiniteQueryOptions, TRPCFetchQueryOptions, TRPCHookResult, TRPCProvider, TRPCProviderProps, TRPCQueryBaseOptions, TRPCQueryOptions, TRPCQueryOptionsResult, TRPCQueryUtils, TRPCReactRequestOptions, TRPCSubscriptionBaseResult, TRPCSubscriptionConnectingResult, TRPCSubscriptionErrorResult, TRPCSubscriptionIdleResult, TRPCSubscriptionPendingResult, TRPCSubscriptionResult, TRPCUseQueries, TRPCUseQueryBaseOptions, TRPCUseSuspenseQueries, UndefinedTRPCInfiniteQueryOptionsIn, UndefinedTRPCInfiniteQueryOptionsOut, UndefinedTRPCQueryOptionsIn, UndefinedTRPCQueryOptionsOut, UnusedSkipTokenTRPCInfiniteQueryOptionsIn, UnusedSkipTokenTRPCInfiniteQueryOptionsOut, UnusedSkipTokenTRPCQueryOptionsIn, UnusedSkipTokenTRPCQueryOptionsOut, UseMutationOverride, UseQueriesProcedureRecord, UseSuspenseQueriesProcedureRecord, UseTRPCInfiniteQueryOptions, UseTRPCInfiniteQueryResult, UseTRPCInfiniteQuerySuccessResult, UseTRPCMutationOptions, UseTRPCMutationResult, UseTRPCPrefetchInfiniteQueryOptions, UseTRPCPrefetchQueryOptions, UseTRPCQueryOptions, UseTRPCQueryResult, UseTRPCQuerySuccessResult, UseTRPCSubscriptionOptions, UseTRPCSuspenseInfiniteQueryOptions, UseTRPCSuspenseInfiniteQueryResult, UseTRPCSuspenseQueryOptions, UseTRPCSuspenseQueryResult, UtilsLike, contextProps, createQueryUtilsProxy, createReactDecoration, createReactQueryUtils, createRootHooks, createTRPCReact, createUseQueries, getClientArgs, getMutationKey, getQueryClient, getQueryKey, getQueryType, inferReactQueryProcedureOptions }; //# sourceMappingURL=getQueryKey.d-CruH3ncI.d.mts.map