// Credit: https://github.com/TanStack/query/blob/01ce023826b81e6c41e354f27691f65c9725af67/packages/vue-query/src/types.ts import type { Config, Connector } from '@wagmi/core' import type { MaybeRef, Ref, UnwrapRef } from 'vue' type Primitive = string | number | boolean | bigint | symbol | undefined | null type UnwrapLeaf = | Primitive // biome-ignore lint/complexity/noBannedTypes: we need to support all types | Function | Date | Error | RegExp | Map | WeakMap | Set | WeakSet export type DeepMaybeRef = MaybeRef< // biome-ignore lint/complexity/noBannedTypes: allowed value extends Function | Config | Connector ? value : value extends object | any[] ? { [key in keyof value]: DeepMaybeRef } : value > export type DeepUnwrapRef = T extends UnwrapLeaf ? T : T extends Ref ? DeepUnwrapRef : // biome-ignore lint/complexity/noBannedTypes: allowed T extends {} ? { [Property in keyof T]: DeepUnwrapRef } : UnwrapRef