/** * Generated by orval v7.17.0 🍺 * Do not edit manually. * OpenAPI definition * OpenAPI spec version: v0 */ import { useQuery } from '@tanstack/react-query'; import type { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryFunction, QueryKey, UndefinedInitialDataOptions, UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; import type { DefaultResponseDTOListMangaContentDTO, DefaultResponseDTOMangaContentImagesDTO } from '../api.schemas'; import { customInstance } from '../../api'; type SecondParameter unknown> = Parameters[1]; /** * Retrieve the content for a specific manga/content provider combination. * @summary Get the content for a specific manga/content provider combination */ export const getMangaProviderContent = ( mangaContentProviderId: number, options?: SecondParameter,signal?: AbortSignal ) => { return customInstance( {url: `/content/${encodeURIComponent(String(mangaContentProviderId))}`, method: 'GET', signal }, options); } export const getGetMangaProviderContentQueryKey = (mangaContentProviderId?: number,) => { return [ `/content/${mangaContentProviderId}` ] as const; } export const getGetMangaProviderContentQueryOptions = >, TError = unknown>(mangaContentProviderId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetMangaProviderContentQueryKey(mangaContentProviderId); const queryFn: QueryFunction>> = ({ signal }) => getMangaProviderContent(mangaContentProviderId, requestOptions, signal); return { queryKey, queryFn, enabled: !!(mangaContentProviderId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } } export type GetMangaProviderContentQueryResult = NonNullable>> export type GetMangaProviderContentQueryError = unknown export function useGetMangaProviderContent>, TError = unknown>( mangaContentProviderId: number, options: { query:Partial>, TError, TData>> & Pick< DefinedInitialDataOptions< Awaited>, TError, Awaited> > , 'initialData' >, request?: SecondParameter} , queryClient?: QueryClient ): DefinedUseQueryResult & { queryKey: DataTag } export function useGetMangaProviderContent>, TError = unknown>( mangaContentProviderId: number, options?: { query?:Partial>, TError, TData>> & Pick< UndefinedInitialDataOptions< Awaited>, TError, Awaited> > , 'initialData' >, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } export function useGetMangaProviderContent>, TError = unknown>( mangaContentProviderId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } /** * @summary Get the content for a specific manga/content provider combination */ export function useGetMangaProviderContent>, TError = unknown>( mangaContentProviderId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } { const queryOptions = getGetMangaProviderContentQueryOptions(mangaContentProviderId,options) const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; query.queryKey = queryOptions.queryKey ; return query; } /** * Retrieve a list of manga content images for a specific manga/provider combination. * @summary Get the content images for a specific manga/provider combination */ export const getMangaContentImages = ( mangaContentId: number, options?: SecondParameter,signal?: AbortSignal ) => { return customInstance( {url: `/content/${encodeURIComponent(String(mangaContentId))}/images`, method: 'GET', signal }, options); } export const getGetMangaContentImagesQueryKey = (mangaContentId?: number,) => { return [ `/content/${mangaContentId}/images` ] as const; } export const getGetMangaContentImagesQueryOptions = >, TError = unknown>(mangaContentId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetMangaContentImagesQueryKey(mangaContentId); const queryFn: QueryFunction>> = ({ signal }) => getMangaContentImages(mangaContentId, requestOptions, signal); return { queryKey, queryFn, enabled: !!(mangaContentId), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } } export type GetMangaContentImagesQueryResult = NonNullable>> export type GetMangaContentImagesQueryError = unknown export function useGetMangaContentImages>, TError = unknown>( mangaContentId: number, options: { query:Partial>, TError, TData>> & Pick< DefinedInitialDataOptions< Awaited>, TError, Awaited> > , 'initialData' >, request?: SecondParameter} , queryClient?: QueryClient ): DefinedUseQueryResult & { queryKey: DataTag } export function useGetMangaContentImages>, TError = unknown>( mangaContentId: number, options?: { query?:Partial>, TError, TData>> & Pick< UndefinedInitialDataOptions< Awaited>, TError, Awaited> > , 'initialData' >, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } export function useGetMangaContentImages>, TError = unknown>( mangaContentId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } /** * @summary Get the content images for a specific manga/provider combination */ export function useGetMangaContentImages>, TError = unknown>( mangaContentId: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } { const queryOptions = getGetMangaContentImagesQueryOptions(mangaContentId,options) const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; query.queryKey = queryOptions.queryKey ; return query; }