import {type UseMutationReturnType, type UseQueryReturnType} from '@tanstack/vue-query'; import {type AdminContextKey, type BackendEndpoint} from '@myparcel-pdk/common'; import {type ApiException} from '@myparcel/sdk'; import { type ActionInput, type AdminContext, type BackendEndpointResponse, type BackendMutationEndpoints, type BackendQueryEndpoints, } from '../types'; import {type QueryModifier} from '../actions'; type EndpointQuery = E extends BackendMutationEndpoints ? UseMutationReturnType, ApiException, ActionInput, unknown> : E extends BackendQueryEndpoints ? UseQueryReturnType, ApiException> : never; export type ContextQuery = UseQueryReturnType< AdminContext, ApiException >; export type ResolvedQuery = E extends BackendEndpoint ? EndpointQuery : never; export type RegisterQuery = { = ResolvedQuery>(endpoint: E, query: Q, arg3?: never): Q; = ResolvedQuery>( endpoint: E, modifier: QueryModifier, query: Q, ): Q; };