{"version":3,"sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n DataTag,\n DefaultError,\n InitialDataFunction,\n QueryKey,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions & {\n initialData?: undefined | InitialDataFunction>\n}\n\ntype NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions & {\n initialData:\n | NonUndefinedGuard\n | (() => NonUndefinedGuard)\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n): DefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n): UndefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoDO,SAAS,aAAa,SAAkB;AAC7C,SAAO;AACT;","names":[]}