restructure files onto electron-vite boilerplate

This commit is contained in:
jeffvli 2025-05-18 14:03:18 -07:00
parent 91ce2cd8a1
commit 1cf587bc8f
457 changed files with 9927 additions and 11705 deletions

View file

@ -1,10 +1,12 @@
import type {
UseQueryOptions,
DefaultOptions,
UseMutationOptions,
UseInfiniteQueryOptions,
UseMutationOptions,
UseQueryOptions,
} from '@tanstack/react-query';
import { QueryClient, QueryCache } from '@tanstack/react-query';
import { QueryCache, QueryClient } from '@tanstack/react-query';
import { toast } from '/@/renderer/components/toast/index';
const queryCache = new QueryCache({
@ -38,16 +40,45 @@ export const queryClient = new QueryClient({
queryCache,
});
export type QueryHookArgs<T> = {
options?: QueryOptions;
query: T;
serverId: string | undefined;
export type InfiniteQueryOptions = {
cacheTime?: UseInfiniteQueryOptions['cacheTime'];
enabled?: UseInfiniteQueryOptions['enabled'];
keepPreviousData?: UseInfiniteQueryOptions['keepPreviousData'];
meta?: UseInfiniteQueryOptions['meta'];
onError?: (err: any) => void;
onSettled?: any;
onSuccess?: any;
queryKey?: UseInfiniteQueryOptions['queryKey'];
refetchInterval?: number;
refetchIntervalInBackground?: UseInfiniteQueryOptions['refetchIntervalInBackground'];
refetchOnWindowFocus?: boolean;
retry?: UseInfiniteQueryOptions['retry'];
retryDelay?: UseInfiniteQueryOptions['retryDelay'];
staleTime?: UseInfiniteQueryOptions['staleTime'];
suspense?: UseInfiniteQueryOptions['suspense'];
useErrorBoundary?: boolean;
};
export type MutationHookArgs = {
options?: MutationOptions;
};
export type MutationOptions = {
mutationKey: UseMutationOptions['mutationKey'];
onError?: (err: any) => void;
onSettled?: any;
onSuccess?: any;
retry?: UseQueryOptions['retry'];
retryDelay?: UseQueryOptions['retryDelay'];
useErrorBoundary?: boolean;
};
export type QueryHookArgs<T> = {
options?: QueryOptions;
query: T;
serverId: string | undefined;
};
export type QueryOptions = {
cacheTime?: UseQueryOptions['cacheTime'];
enabled?: UseQueryOptions['enabled'];
@ -66,32 +97,3 @@ export type QueryOptions = {
suspense?: UseQueryOptions['suspense'];
useErrorBoundary?: boolean;
};
export type MutationOptions = {
mutationKey: UseMutationOptions['mutationKey'];
onError?: (err: any) => void;
onSettled?: any;
onSuccess?: any;
retry?: UseQueryOptions['retry'];
retryDelay?: UseQueryOptions['retryDelay'];
useErrorBoundary?: boolean;
};
export type InfiniteQueryOptions = {
cacheTime?: UseInfiniteQueryOptions['cacheTime'];
enabled?: UseInfiniteQueryOptions['enabled'];
keepPreviousData?: UseInfiniteQueryOptions['keepPreviousData'];
meta?: UseInfiniteQueryOptions['meta'];
onError?: (err: any) => void;
onSettled?: any;
onSuccess?: any;
queryKey?: UseInfiniteQueryOptions['queryKey'];
refetchInterval?: number;
refetchIntervalInBackground?: UseInfiniteQueryOptions['refetchIntervalInBackground'];
refetchOnWindowFocus?: boolean;
retry?: UseInfiniteQueryOptions['retry'];
retryDelay?: UseInfiniteQueryOptions['retryDelay'];
staleTime?: UseInfiniteQueryOptions['staleTime'];
suspense?: UseInfiniteQueryOptions['suspense'];
useErrorBoundary?: boolean;
};