Skip to content

Instantly share code, notes, and snippets.

@mtiller
Created December 2, 2019 20:48
Show Gist options
  • Save mtiller/587f888de2cdaa76ee91939b85899151 to your computer and use it in GitHub Desktop.
Save mtiller/587f888de2cdaa76ee91939b85899151 to your computer and use it in GitHub Desktop.
Sample types generated for react-query
export function ReactQueryConfigProvider({ config, children }: {
config: any;
children: any;
}): JSX.Element;
export function useQuery(queryKey: any, queryFn: any, config?: {}): any;
export function prefetchQuery(queryKey: any, queryFn: any, config?: {}): Promise<any>;
export function refetchQuery(queryKey: any, config?: {}): Promise<void[] | undefined>;
export function useMutation(mutationFn: any, { refetchQueries, refetchQueriesOnFailure }?: {
refetchQueries: any;
refetchQueriesOnFailure: any;
}): (((variables: any, { updateQuery, waitForRefetchQueries }?: any) => Promise<any>) | {
data: null;
isLoading: boolean;
error: null;
})[];
export function useIsFetching(): boolean;
export function setQueryData(userQueryKey: any, updater: any, { shouldRefetch }?: {
shouldRefetch?: boolean | undefined;
}): Promise<void[] | undefined> | undefined;
export function refetchAllQueries({ includeInactive, force, }?: {
includeInactive: any;
force?: any;
}): Promise<any[]>;
export function clearQueryCache(): void;
export function stableStringify(obj: any): string;
export let queries: any[];
export let globalStateListeners: any[];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment