import { Query } from './query'; import { MutationFunction, MutationKey, MutationOptions, QueryFunction, QueryKey, QueryKeyHashFunction, QueryOptions, QueryStatus } from './types'; export interface QueryFilters { /** * Include or exclude active queries */ active?: boolean; /** * Match query key exactly */ exact?: boolean; /** * Include or exclude inactive queries */ inactive?: boolean; /** * Include queries matching this predicate function */ predicate?: (query: Query) => boolean; /** * Include queries matching this query key */ queryKey?: QueryKey; /** * Include or exclude stale queries */ stale?: boolean; /** * Include or exclude fetching queries */ fetching?: boolean; } export declare type DataUpdateFunction = (input: TInput) => TOutput; export declare type Updater = TOutput | DataUpdateFunction; export declare const isServer: boolean; export declare function noop(): undefined; export declare function functionalUpdate(updater: Updater, input: TInput): TOutput; export declare function isValidTimeout(value: any): value is number; export declare function ensureArray(value: T | T[]): T[]; export declare function difference(array1: T[], array2: T[]): T[]; export declare function replaceAt(array: T[], index: number, value: T): T[]; export declare function timeUntilStale(updatedAt: number, staleTime?: number): number; export declare function parseQueryArgs>(arg1: QueryKey | TOptions, arg2?: QueryFunction | TOptions, arg3?: TOptions): TOptions; export declare function parseMutationArgs>(arg1: MutationKey | MutationFunction | TOptions, arg2?: MutationFunction | TOptions, arg3?: TOptions): TOptions; export declare function parseFilterArgs(arg1?: QueryKey | TFilters, arg2?: TFilters | TOptions, arg3?: TOptions): [TFilters, TOptions | undefined]; export declare function matchQuery(filters: QueryFilters, query: Query): boolean; export declare function getQueryKeyHashFn(options?: QueryOptions): QueryKeyHashFunction; /** * Default query keys hash function. */ export declare function hashQueryKey(queryKey: QueryKey): string; /** * Hashes the value into a stable hash. */ export declare function stableValueHash(value: any): string; /** * Checks if key `b` partially matches with key `a`. */ export declare function partialMatchKey(a: string | unknown[], b: string | unknown[]): boolean; /** * Checks if `b` partially matches with `a`. */ export declare function partialDeepEqual(a: any, b: any): boolean; /** * This function returns `a` if `b` is deeply equal. * If not, it will replace any deeply equal children of `b` with those of `a`. * This can be used for structural sharing between JSON values for example. */ export declare function replaceEqualDeep(a: unknown, b: T): T; /** * Shallow compare objects. Only works with objects that always have the same properties. */ export declare function shallowEqualObjects(a: T, b: T): boolean; export declare function isPlainObject(o: any): o is Object; export declare function isQueryKey(value: any): value is QueryKey; export declare function isError(value: any): value is Error; export declare function sleep(timeout: number): Promise; export declare function getStatusProps(status: T): { status: T; isLoading: boolean; isSuccess: boolean; isError: boolean; isIdle: boolean; }; /** * Schedules a microtask. * This can be useful to schedule state updates after rendering. */ export declare function scheduleMicrotask(callback: () => void): void;