@sfutureapps/nextquery
Version:
A simple package to api query combine with ReactQuery, Moment and lodash
48 lines (37 loc) • 1.52 kB
text/typescript
import * as _tanstack_react_query from '@tanstack/react-query';
import { QueryClient, useQueryClient, QueryClientProvider } from '@tanstack/react-query';
import { create as create$1 } from 'zustand';
import _ from 'lodash';
import moment from 'moment';
type QueryProps = {
key: string;
endpoint: string;
data?: any | null;
};
type MutateProps = {
key: string;
endpoint: string;
};
declare const Mutate: ({ key, endpoint }: MutateProps) => _tanstack_react_query.UseMutationResult<any, Error, any, unknown>;
declare const Query: ({ key, endpoint, data }: QueryProps) => _tanstack_react_query.UseQueryResult<any, Error>;
declare const NextQueryClient: typeof QueryClient;
declare const useNextQueryClient: typeof useQueryClient;
declare const NextQueryClientProvider: typeof QueryClientProvider;
declare const create: typeof create$1;
declare const useLodash: _.LoDashStatic;
declare const useMoment: typeof moment;
declare const Post: ({ endpoint, data, revalidate, isExternalUrl }: {
endpoint: string;
data?: any | null;
revalidate?: number;
isExternalUrl?: boolean;
}) => Promise<any>;
declare const Get: ({ endpoint, data, revalidate, isExternalUrl }: {
endpoint: string;
data?: any | null;
revalidate?: number;
isExternalUrl?: boolean;
}) => Promise<any>;
declare const usePost: typeof Post;
declare const useGet: typeof Get;
export { Mutate, NextQueryClient, NextQueryClientProvider, Query, create, useGet, useLodash, useMoment, useNextQueryClient, usePost };