/** * Generated by orval v7.17.0 🍺 * Do not edit manually. * MangaMochi API * OpenAPI spec version: 1.0 */ import { useQuery } from '@tanstack/react-query'; import type { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, QueryClient, QueryFunction, QueryKey, UndefinedInitialDataOptions, UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; import type { DefaultResponseDTOListMangaProxyDataDTO, DefaultResponseDTOMangaProxyDataDTO } from '../api.schemas'; import { customInstance } from '../../api'; type SecondParameter unknown> = Parameters[1]; /** * Fetches manga information from MyAnimeList using the provided title. This endpoint serves as a proxy to search for manga data without directly exposing the MyAnimeList API. * @summary Get manga data from MyAnimeList by title */ export const searchMyAnimeListMangaDataByTitle = ( title: string, options?: SecondParameter,signal?: AbortSignal ) => { return customInstance( {url: `/catalog/proxy/myanimelist/${encodeURIComponent(String(title))}/search`, method: 'GET', signal }, options); } export const getSearchMyAnimeListMangaDataByTitleQueryKey = (title?: string,) => { return [ `/catalog/proxy/myanimelist/${title}/search` ] as const; } export const getSearchMyAnimeListMangaDataByTitleQueryOptions = >, TError = unknown>(title: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getSearchMyAnimeListMangaDataByTitleQueryKey(title); const queryFn: QueryFunction>> = ({ signal }) => searchMyAnimeListMangaDataByTitle(title, requestOptions, signal); return { queryKey, queryFn, enabled: !!(title), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } } export type SearchMyAnimeListMangaDataByTitleQueryResult = NonNullable>> export type SearchMyAnimeListMangaDataByTitleQueryError = unknown export function useSearchMyAnimeListMangaDataByTitle>, TError = unknown>( title: string, options: { query:Partial>, TError, TData>> & Pick< DefinedInitialDataOptions< Awaited>, TError, Awaited> > , 'initialData' >, request?: SecondParameter} , queryClient?: QueryClient ): DefinedUseQueryResult & { queryKey: DataTag } export function useSearchMyAnimeListMangaDataByTitle>, TError = unknown>( title: string, options?: { query?:Partial>, TError, TData>> & Pick< UndefinedInitialDataOptions< Awaited>, TError, Awaited> > , 'initialData' >, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } export function useSearchMyAnimeListMangaDataByTitle>, TError = unknown>( title: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } /** * @summary Get manga data from MyAnimeList by title */ export function useSearchMyAnimeListMangaDataByTitle>, TError = unknown>( title: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } { const queryOptions = getSearchMyAnimeListMangaDataByTitleQueryOptions(title,options) const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; query.queryKey = queryOptions.queryKey ; return query; } /** * Fetches manga information from MyAnimeList using the provided ID. This endpoint serves as a proxy to retrieve manga data without directly exposing the MyAnimeList API. * @summary Get manga data from MyAnimeList by ID */ export const getMyAnimeListMangaDataById = ( id: number, options?: SecondParameter,signal?: AbortSignal ) => { return customInstance( {url: `/catalog/proxy/myanimelist/${encodeURIComponent(String(id))}`, method: 'GET', signal }, options); } export const getGetMyAnimeListMangaDataByIdQueryKey = (id?: number,) => { return [ `/catalog/proxy/myanimelist/${id}` ] as const; } export const getGetMyAnimeListMangaDataByIdQueryOptions = >, TError = unknown>(id: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetMyAnimeListMangaDataByIdQueryKey(id); const queryFn: QueryFunction>> = ({ signal }) => getMyAnimeListMangaDataById(id, requestOptions, signal); return { queryKey, queryFn, enabled: !!(id), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } } export type GetMyAnimeListMangaDataByIdQueryResult = NonNullable>> export type GetMyAnimeListMangaDataByIdQueryError = unknown export function useGetMyAnimeListMangaDataById>, TError = unknown>( id: number, options: { query:Partial>, TError, TData>> & Pick< DefinedInitialDataOptions< Awaited>, TError, Awaited> > , 'initialData' >, request?: SecondParameter} , queryClient?: QueryClient ): DefinedUseQueryResult & { queryKey: DataTag } export function useGetMyAnimeListMangaDataById>, TError = unknown>( id: number, options?: { query?:Partial>, TError, TData>> & Pick< UndefinedInitialDataOptions< Awaited>, TError, Awaited> > , 'initialData' >, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } export function useGetMyAnimeListMangaDataById>, TError = unknown>( id: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } /** * @summary Get manga data from MyAnimeList by ID */ export function useGetMyAnimeListMangaDataById>, TError = unknown>( id: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } { const queryOptions = getGetMyAnimeListMangaDataByIdQueryOptions(id,options) const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; query.queryKey = queryOptions.queryKey ; return query; } /** * Fetches manga information from AniList using the provided title. This endpoint serves as a proxy to search for manga data without directly exposing the AniList API. * @summary Get manga data from AniList by title */ export const searchAniListMangaDataByTitle = ( title: string, options?: SecondParameter,signal?: AbortSignal ) => { return customInstance( {url: `/catalog/proxy/anilist/${encodeURIComponent(String(title))}/search`, method: 'GET', signal }, options); } export const getSearchAniListMangaDataByTitleQueryKey = (title?: string,) => { return [ `/catalog/proxy/anilist/${title}/search` ] as const; } export const getSearchAniListMangaDataByTitleQueryOptions = >, TError = unknown>(title: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getSearchAniListMangaDataByTitleQueryKey(title); const queryFn: QueryFunction>> = ({ signal }) => searchAniListMangaDataByTitle(title, requestOptions, signal); return { queryKey, queryFn, enabled: !!(title), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } } export type SearchAniListMangaDataByTitleQueryResult = NonNullable>> export type SearchAniListMangaDataByTitleQueryError = unknown export function useSearchAniListMangaDataByTitle>, TError = unknown>( title: string, options: { query:Partial>, TError, TData>> & Pick< DefinedInitialDataOptions< Awaited>, TError, Awaited> > , 'initialData' >, request?: SecondParameter} , queryClient?: QueryClient ): DefinedUseQueryResult & { queryKey: DataTag } export function useSearchAniListMangaDataByTitle>, TError = unknown>( title: string, options?: { query?:Partial>, TError, TData>> & Pick< UndefinedInitialDataOptions< Awaited>, TError, Awaited> > , 'initialData' >, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } export function useSearchAniListMangaDataByTitle>, TError = unknown>( title: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } /** * @summary Get manga data from AniList by title */ export function useSearchAniListMangaDataByTitle>, TError = unknown>( title: string, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } { const queryOptions = getSearchAniListMangaDataByTitleQueryOptions(title,options) const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; query.queryKey = queryOptions.queryKey ; return query; } /** * Fetches manga information from AniList using the provided ID. This endpoint serves as a proxy to retrieve manga data without directly exposing the AniList API. * @summary Get manga data from AniList by ID */ export const getAniListMangaDataById = ( id: number, options?: SecondParameter,signal?: AbortSignal ) => { return customInstance( {url: `/catalog/proxy/anilist/${encodeURIComponent(String(id))}`, method: 'GET', signal }, options); } export const getGetAniListMangaDataByIdQueryKey = (id?: number,) => { return [ `/catalog/proxy/anilist/${id}` ] as const; } export const getGetAniListMangaDataByIdQueryOptions = >, TError = unknown>(id: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} ) => { const {query: queryOptions, request: requestOptions} = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetAniListMangaDataByIdQueryKey(id); const queryFn: QueryFunction>> = ({ signal }) => getAniListMangaDataById(id, requestOptions, signal); return { queryKey, queryFn, enabled: !!(id), ...queryOptions} as UseQueryOptions>, TError, TData> & { queryKey: DataTag } } export type GetAniListMangaDataByIdQueryResult = NonNullable>> export type GetAniListMangaDataByIdQueryError = unknown export function useGetAniListMangaDataById>, TError = unknown>( id: number, options: { query:Partial>, TError, TData>> & Pick< DefinedInitialDataOptions< Awaited>, TError, Awaited> > , 'initialData' >, request?: SecondParameter} , queryClient?: QueryClient ): DefinedUseQueryResult & { queryKey: DataTag } export function useGetAniListMangaDataById>, TError = unknown>( id: number, options?: { query?:Partial>, TError, TData>> & Pick< UndefinedInitialDataOptions< Awaited>, TError, Awaited> > , 'initialData' >, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } export function useGetAniListMangaDataById>, TError = unknown>( id: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } /** * @summary Get manga data from AniList by ID */ export function useGetAniListMangaDataById>, TError = unknown>( id: number, options?: { query?:Partial>, TError, TData>>, request?: SecondParameter} , queryClient?: QueryClient ): UseQueryResult & { queryKey: DataTag } { const queryOptions = getGetAniListMangaDataByIdQueryOptions(id,options) const query = useQuery(queryOptions, queryClient) as UseQueryResult & { queryKey: DataTag }; query.queryKey = queryOptions.queryKey ; return query; }