@tanstack/query-core 5.90.20 → 5.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.cts +2227 -0
  2. package/build/legacy/_tsup-dts-rollup.d.ts +2227 -0
  3. package/build/legacy/environmentManager.cjs +48 -0
  4. package/build/legacy/environmentManager.cjs.map +1 -0
  5. package/build/legacy/environmentManager.d.cts +2 -0
  6. package/build/legacy/environmentManager.d.ts +2 -0
  7. package/build/legacy/environmentManager.js +25 -0
  8. package/build/legacy/environmentManager.js.map +1 -0
  9. package/build/legacy/focusManager.cjs +1 -2
  10. package/build/legacy/focusManager.cjs.map +1 -1
  11. package/build/legacy/focusManager.d.cts +2 -17
  12. package/build/legacy/focusManager.d.ts +2 -17
  13. package/build/legacy/focusManager.js +1 -2
  14. package/build/legacy/focusManager.js.map +1 -1
  15. package/build/legacy/hydration.d.cts +7 -3
  16. package/build/legacy/hydration.d.ts +7 -3
  17. package/build/legacy/index.cjs +3 -0
  18. package/build/legacy/index.cjs.map +1 -1
  19. package/build/legacy/index.d.cts +142 -10
  20. package/build/legacy/index.d.ts +142 -10
  21. package/build/legacy/index.js +2 -0
  22. package/build/legacy/index.js.map +1 -1
  23. package/build/legacy/infiniteQueryBehavior.d.cts +3 -15
  24. package/build/legacy/infiniteQueryBehavior.d.ts +3 -15
  25. package/build/legacy/infiniteQueryObserver.d.cts +1 -20
  26. package/build/legacy/infiniteQueryObserver.d.ts +1 -20
  27. package/build/legacy/mutation.d.cts +4 -3
  28. package/build/legacy/mutation.d.ts +4 -3
  29. package/build/legacy/mutationCache.d.cts +2 -3
  30. package/build/legacy/mutationCache.d.ts +2 -3
  31. package/build/legacy/mutationObserver.d.cts +1 -3
  32. package/build/legacy/mutationObserver.d.ts +1 -3
  33. package/build/legacy/notifyManager.d.cts +3 -46
  34. package/build/legacy/notifyManager.d.ts +3 -46
  35. package/build/legacy/onlineManager.cjs +1 -2
  36. package/build/legacy/onlineManager.cjs.map +1 -1
  37. package/build/legacy/onlineManager.d.cts +2 -16
  38. package/build/legacy/onlineManager.d.ts +2 -16
  39. package/build/legacy/onlineManager.js +1 -2
  40. package/build/legacy/onlineManager.js.map +1 -1
  41. package/build/legacy/queriesObserver.d.cts +2 -27
  42. package/build/legacy/queriesObserver.d.ts +2 -27
  43. package/build/legacy/query.d.cts +10 -3
  44. package/build/legacy/query.d.ts +10 -3
  45. package/build/legacy/queryCache.d.cts +3 -3
  46. package/build/legacy/queryCache.d.ts +3 -3
  47. package/build/legacy/queryClient.d.cts +1 -3
  48. package/build/legacy/queryClient.d.ts +1 -3
  49. package/build/legacy/queryObserver.cjs +3 -2
  50. package/build/legacy/queryObserver.cjs.map +1 -1
  51. package/build/legacy/queryObserver.d.cts +1 -3
  52. package/build/legacy/queryObserver.d.ts +1 -3
  53. package/build/legacy/queryObserver.js +3 -3
  54. package/build/legacy/queryObserver.js.map +1 -1
  55. package/build/legacy/removable.cjs +2 -1
  56. package/build/legacy/removable.cjs.map +1 -1
  57. package/build/legacy/removable.d.cts +1 -11
  58. package/build/legacy/removable.d.ts +1 -11
  59. package/build/legacy/removable.js +3 -2
  60. package/build/legacy/removable.js.map +1 -1
  61. package/build/legacy/retryer.cjs +2 -1
  62. package/build/legacy/retryer.cjs.map +1 -1
  63. package/build/legacy/retryer.d.cts +7 -3
  64. package/build/legacy/retryer.d.ts +7 -3
  65. package/build/legacy/retryer.js +3 -2
  66. package/build/legacy/retryer.js.map +1 -1
  67. package/build/legacy/streamedQuery.d.cts +1 -34
  68. package/build/legacy/streamedQuery.d.ts +1 -34
  69. package/build/legacy/subscribable.d.cts +1 -10
  70. package/build/legacy/subscribable.d.ts +1 -10
  71. package/build/legacy/thenable.cjs.map +1 -1
  72. package/build/legacy/thenable.d.cts +6 -47
  73. package/build/legacy/thenable.d.ts +6 -47
  74. package/build/legacy/thenable.js.map +1 -1
  75. package/build/legacy/timeoutManager.d.cts +7 -58
  76. package/build/legacy/timeoutManager.d.ts +7 -58
  77. package/build/legacy/types.d.cts +95 -3
  78. package/build/legacy/types.d.ts +95 -3
  79. package/build/legacy/utils.cjs.map +1 -1
  80. package/build/legacy/utils.d.cts +30 -3
  81. package/build/legacy/utils.d.ts +30 -3
  82. package/build/legacy/utils.js.map +1 -1
  83. package/build/modern/_tsup-dts-rollup.d.cts +2227 -0
  84. package/build/modern/_tsup-dts-rollup.d.ts +2227 -0
  85. package/build/modern/environmentManager.cjs +48 -0
  86. package/build/modern/environmentManager.cjs.map +1 -0
  87. package/build/modern/environmentManager.d.cts +2 -0
  88. package/build/modern/environmentManager.d.ts +2 -0
  89. package/build/modern/environmentManager.js +23 -0
  90. package/build/modern/environmentManager.js.map +1 -0
  91. package/build/modern/focusManager.cjs +1 -2
  92. package/build/modern/focusManager.cjs.map +1 -1
  93. package/build/modern/focusManager.d.cts +2 -17
  94. package/build/modern/focusManager.d.ts +2 -17
  95. package/build/modern/focusManager.js +1 -2
  96. package/build/modern/focusManager.js.map +1 -1
  97. package/build/modern/hydration.d.cts +7 -3
  98. package/build/modern/hydration.d.ts +7 -3
  99. package/build/modern/index.cjs +3 -0
  100. package/build/modern/index.cjs.map +1 -1
  101. package/build/modern/index.d.cts +142 -10
  102. package/build/modern/index.d.ts +142 -10
  103. package/build/modern/index.js +2 -0
  104. package/build/modern/index.js.map +1 -1
  105. package/build/modern/infiniteQueryBehavior.d.cts +3 -15
  106. package/build/modern/infiniteQueryBehavior.d.ts +3 -15
  107. package/build/modern/infiniteQueryObserver.d.cts +1 -20
  108. package/build/modern/infiniteQueryObserver.d.ts +1 -20
  109. package/build/modern/mutation.d.cts +4 -3
  110. package/build/modern/mutation.d.ts +4 -3
  111. package/build/modern/mutationCache.d.cts +2 -3
  112. package/build/modern/mutationCache.d.ts +2 -3
  113. package/build/modern/mutationObserver.d.cts +1 -3
  114. package/build/modern/mutationObserver.d.ts +1 -3
  115. package/build/modern/notifyManager.d.cts +3 -46
  116. package/build/modern/notifyManager.d.ts +3 -46
  117. package/build/modern/onlineManager.cjs +1 -2
  118. package/build/modern/onlineManager.cjs.map +1 -1
  119. package/build/modern/onlineManager.d.cts +2 -16
  120. package/build/modern/onlineManager.d.ts +2 -16
  121. package/build/modern/onlineManager.js +1 -2
  122. package/build/modern/onlineManager.js.map +1 -1
  123. package/build/modern/queriesObserver.d.cts +2 -27
  124. package/build/modern/queriesObserver.d.ts +2 -27
  125. package/build/modern/query.d.cts +10 -3
  126. package/build/modern/query.d.ts +10 -3
  127. package/build/modern/queryCache.d.cts +3 -3
  128. package/build/modern/queryCache.d.ts +3 -3
  129. package/build/modern/queryClient.d.cts +1 -3
  130. package/build/modern/queryClient.d.ts +1 -3
  131. package/build/modern/queryObserver.cjs +3 -2
  132. package/build/modern/queryObserver.cjs.map +1 -1
  133. package/build/modern/queryObserver.d.cts +1 -3
  134. package/build/modern/queryObserver.d.ts +1 -3
  135. package/build/modern/queryObserver.js +3 -3
  136. package/build/modern/queryObserver.js.map +1 -1
  137. package/build/modern/removable.cjs +2 -1
  138. package/build/modern/removable.cjs.map +1 -1
  139. package/build/modern/removable.d.cts +1 -11
  140. package/build/modern/removable.d.ts +1 -11
  141. package/build/modern/removable.js +3 -2
  142. package/build/modern/removable.js.map +1 -1
  143. package/build/modern/retryer.cjs +2 -1
  144. package/build/modern/retryer.cjs.map +1 -1
  145. package/build/modern/retryer.d.cts +7 -3
  146. package/build/modern/retryer.d.ts +7 -3
  147. package/build/modern/retryer.js +3 -2
  148. package/build/modern/retryer.js.map +1 -1
  149. package/build/modern/streamedQuery.d.cts +1 -34
  150. package/build/modern/streamedQuery.d.ts +1 -34
  151. package/build/modern/subscribable.d.cts +1 -10
  152. package/build/modern/subscribable.d.ts +1 -10
  153. package/build/modern/thenable.cjs.map +1 -1
  154. package/build/modern/thenable.d.cts +6 -47
  155. package/build/modern/thenable.d.ts +6 -47
  156. package/build/modern/thenable.js.map +1 -1
  157. package/build/modern/timeoutManager.d.cts +7 -58
  158. package/build/modern/timeoutManager.d.ts +7 -58
  159. package/build/modern/types.d.cts +95 -3
  160. package/build/modern/types.d.ts +95 -3
  161. package/build/modern/utils.cjs.map +1 -1
  162. package/build/modern/utils.d.cts +30 -3
  163. package/build/modern/utils.d.ts +30 -3
  164. package/build/modern/utils.js.map +1 -1
  165. package/package.json +4 -5
  166. package/src/environmentManager.ts +25 -0
  167. package/src/focusManager.ts +1 -2
  168. package/src/index.ts +1 -0
  169. package/src/onlineManager.ts +1 -2
  170. package/src/queryObserver.ts +7 -3
  171. package/src/removable.ts +3 -2
  172. package/src/retryer.ts +3 -2
  173. package/src/thenable.ts +1 -1
  174. package/src/utils.ts +3 -0
  175. package/build/legacy/hydration-BlEVG2Lp.d.ts +0 -1384
  176. package/build/legacy/hydration-uphG6M-i.d.cts +0 -1384
  177. package/build/modern/hydration-BlEVG2Lp.d.ts +0 -1384
  178. package/build/modern/hydration-uphG6M-i.d.cts +0 -1384
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { Thenable } from './thenable'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig<TData = unknown, TError = DefaultError> {\n fn: () => TData | Promise<TData>\n initialPromise?: Promise<TData>\n onCancel?: (error: TError) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue<TError>\n retryDelay?: RetryDelayValue<TError>\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer<TData = unknown> {\n promise: Promise<TData>\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise<unknown>\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise<TData>\n status: () => 'pending' | 'resolved' | 'rejected'\n}\n\nexport type RetryValue<TError> = boolean | number | ShouldRetryFunction<TError>\n\ntype ShouldRetryFunction<TError = DefaultError> = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue<TError> = number | RetryDelayFunction<TError>\n\ntype RetryDelayFunction<TError = DefaultError> = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\n/**\n * @deprecated Use instanceof `CancelledError` instead.\n */\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer<TData = unknown, TError = DefaultError>(\n config: RetryerConfig<TData, TError>,\n): Retryer<TData> {\n let isRetryCancelled = false\n let failureCount = 0\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable<TData>()\n\n const isResolved = () =>\n (thenable.status as Thenable<TData>['status']) !== 'pending'\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved()) {\n const error = new CancelledError(cancelOptions) as TError\n reject(error)\n\n config.onCancel?.(error)\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved() || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved()) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved()) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved()) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n status: () => thenable.status,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../../src/retryer.ts"],"sourcesContent":["import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { environmentManager } from './environmentManager'\nimport { sleep } from './utils'\nimport type { Thenable } from './thenable'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig<TData = unknown, TError = DefaultError> {\n fn: () => TData | Promise<TData>\n initialPromise?: Promise<TData>\n onCancel?: (error: TError) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue<TError>\n retryDelay?: RetryDelayValue<TError>\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer<TData = unknown> {\n promise: Promise<TData>\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise<unknown>\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise<TData>\n status: () => 'pending' | 'resolved' | 'rejected'\n}\n\nexport type RetryValue<TError> = boolean | number | ShouldRetryFunction<TError>\n\ntype ShouldRetryFunction<TError = DefaultError> = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue<TError> = number | RetryDelayFunction<TError>\n\ntype RetryDelayFunction<TError = DefaultError> = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\n/**\n * @deprecated Use instanceof `CancelledError` instead.\n */\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer<TData = unknown, TError = DefaultError>(\n config: RetryerConfig<TData, TError>,\n): Retryer<TData> {\n let isRetryCancelled = false\n let failureCount = 0\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable<TData>()\n\n const isResolved = () =>\n (thenable.status as Thenable<TData>['status']) !== 'pending'\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved()) {\n const error = new CancelledError(cancelOptions) as TError\n reject(error)\n\n config.onCancel?.(error)\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved() || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved()) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved()) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved()) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (environmentManager.isServer() ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n status: () => thenable.status,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n"],"mappings":";;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,aAAa;AA4CtB,SAAS,kBAAkB,cAAsB;AAC/C,SAAO,KAAK,IAAI,MAAO,KAAK,cAAc,GAAK;AACjD;AAEO,SAAS,SAAS,aAA+C;AACtE,UAAQ,eAAe,cAAc,WACjC,cAAc,SAAS,IACvB;AACN;AAEO,IAAM,iBAAN,cAA6B,MAAM;AAAA,EAGxC,YAAY,SAAyB;AACnC,UAAM,gBAAgB;AACtB,SAAK,SAAS,mCAAS;AACvB,SAAK,SAAS,mCAAS;AAAA,EACzB;AACF;AAKO,SAAS,iBAAiB,OAAqC;AACpE,SAAO,iBAAiB;AAC1B;AAEO,SAAS,cACd,QACgB;AAChB,MAAI,mBAAmB;AACvB,MAAI,eAAe;AACnB,MAAI;AAEJ,QAAM,WAAW,gBAAuB;AAExC,QAAM,aAAa,MAChB,SAAS,WAAyC;AAErD,QAAM,SAAS,CAAC,kBAAwC;AAvF1D;AAwFI,QAAI,CAAC,WAAW,GAAG;AACjB,YAAM,QAAQ,IAAI,eAAe,aAAa;AAC9C,aAAO,KAAK;AAEZ,mBAAO,aAAP,gCAAkB;AAAA,IACpB;AAAA,EACF;AACA,QAAM,cAAc,MAAM;AACxB,uBAAmB;AAAA,EACrB;AAEA,QAAM,gBAAgB,MAAM;AAC1B,uBAAmB;AAAA,EACrB;AAEA,QAAM,cAAc,MAClB,aAAa,UAAU,MACtB,OAAO,gBAAgB,YAAY,cAAc,SAAS,MAC3D,OAAO,OAAO;AAEhB,QAAM,WAAW,MAAM,SAAS,OAAO,WAAW,KAAK,OAAO,OAAO;AAErE,QAAM,UAAU,CAAC,UAAe;AAC9B,QAAI,CAAC,WAAW,GAAG;AACjB;AACA,eAAS,QAAQ,KAAK;AAAA,IACxB;AAAA,EACF;AAEA,QAAM,SAAS,CAAC,UAAe;AAC7B,QAAI,CAAC,WAAW,GAAG;AACjB;AACA,eAAS,OAAO,KAAK;AAAA,IACvB;AAAA,EACF;AAEA,QAAM,QAAQ,MAAM;AAClB,WAAO,IAAI,QAAQ,CAAC,oBAAoB;AA7H5C;AA8HM,mBAAa,CAAC,UAAU;AACtB,YAAI,WAAW,KAAK,YAAY,GAAG;AACjC,0BAAgB,KAAK;AAAA,QACvB;AAAA,MACF;AACA,mBAAO,YAAP;AAAA,IACF,CAAC,EAAE,KAAK,MAAM;AApIlB;AAqIM,mBAAa;AACb,UAAI,CAAC,WAAW,GAAG;AACjB,qBAAO,eAAP;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAGA,QAAM,MAAM,MAAM;AAEhB,QAAI,WAAW,GAAG;AAChB;AAAA,IACF;AAEA,QAAI;AAGJ,UAAM,iBACJ,iBAAiB,IAAI,OAAO,iBAAiB;AAG/C,QAAI;AACF,uBAAiB,kBAAkB,OAAO,GAAG;AAAA,IAC/C,SAAS,OAAO;AACd,uBAAiB,QAAQ,OAAO,KAAK;AAAA,IACvC;AAEA,YAAQ,QAAQ,cAAc,EAC3B,KAAK,OAAO,EACZ,MAAM,CAAC,UAAU;AAlKxB;AAoKQ,UAAI,WAAW,GAAG;AAChB;AAAA,MACF;AAGA,YAAM,QAAQ,OAAO,UAAU,mBAAmB,SAAS,IAAI,IAAI;AACnE,YAAM,aAAa,OAAO,cAAc;AACxC,YAAM,QACJ,OAAO,eAAe,aAClB,WAAW,cAAc,KAAK,IAC9B;AACN,YAAM,cACJ,UAAU,QACT,OAAO,UAAU,YAAY,eAAe,SAC5C,OAAO,UAAU,cAAc,MAAM,cAAc,KAAK;AAE3D,UAAI,oBAAoB,CAAC,aAAa;AAEpC,eAAO,KAAK;AACZ;AAAA,MACF;AAEA;AAGA,mBAAO,WAAP,gCAAgB,cAAc;AAG9B,YAAM,KAAK,EAER,KAAK,MAAM;AACV,eAAO,YAAY,IAAI,SAAY,MAAM;AAAA,MAC3C,CAAC,EACA,KAAK,MAAM;AACV,YAAI,kBAAkB;AACpB,iBAAO,KAAK;AAAA,QACd,OAAO;AACL,cAAI;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACL,CAAC;AAAA,EACL;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,QAAQ,MAAM,SAAS;AAAA,IACvB;AAAA,IACA,UAAU,MAAM;AACd;AACA,aAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,MAAM;AAEX,UAAI,SAAS,GAAG;AACd,YAAI;AAAA,MACN,OAAO;AACL,cAAM,EAAE,KAAK,GAAG;AAAA,MAClB;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":[]}
@@ -1,34 +1 @@
1
- import { I as QueryKey, a1 as QueryFunctionContext, Y as QueryFunction } from './hydration-uphG6M-i.cjs';
2
- import './removable.cjs';
3
- import './subscribable.cjs';
4
-
5
- type BaseStreamedQueryParams<TQueryFnData, TQueryKey extends QueryKey> = {
6
- streamFn: (context: QueryFunctionContext<TQueryKey>) => AsyncIterable<TQueryFnData> | Promise<AsyncIterable<TQueryFnData>>;
7
- refetchMode?: 'append' | 'reset' | 'replace';
8
- };
9
- type SimpleStreamedQueryParams<TQueryFnData, TQueryKey extends QueryKey> = BaseStreamedQueryParams<TQueryFnData, TQueryKey> & {
10
- reducer?: never;
11
- initialValue?: never;
12
- };
13
- type ReducibleStreamedQueryParams<TQueryFnData, TData, TQueryKey extends QueryKey> = BaseStreamedQueryParams<TQueryFnData, TQueryKey> & {
14
- reducer: (acc: TData, chunk: TQueryFnData) => TData;
15
- initialValue: TData;
16
- };
17
- type StreamedQueryParams<TQueryFnData, TData, TQueryKey extends QueryKey> = SimpleStreamedQueryParams<TQueryFnData, TQueryKey> | ReducibleStreamedQueryParams<TQueryFnData, TData, TQueryKey>;
18
- /**
19
- * This is a helper function to create a query function that streams data from an AsyncIterable.
20
- * Data will be an Array of all the chunks received.
21
- * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that.
22
- * The query will stay in fetchStatus 'fetching' until the stream ends.
23
- * @param queryFn - The function that returns an AsyncIterable to stream data from.
24
- * @param refetchMode - Defines how re-fetches are handled.
25
- * Defaults to `'reset'`, erases all data and puts the query back into `pending` state.
26
- * Set to `'append'` to append new data to the existing data.
27
- * Set to `'replace'` to write all data to the cache once the stream ends.
28
- * @param reducer - A function to reduce the streamed chunks into the final data.
29
- * Defaults to a function that appends chunks to the end of the array.
30
- * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.
31
- */
32
- declare function streamedQuery<TQueryFnData = unknown, TData = Array<TQueryFnData>, TQueryKey extends QueryKey = QueryKey>({ streamFn, refetchMode, reducer, initialValue, }: StreamedQueryParams<TQueryFnData, TData, TQueryKey>): QueryFunction<TData, TQueryKey>;
33
-
34
- export { streamedQuery };
1
+ export { streamedQuery } from './_tsup-dts-rollup.cjs';
@@ -1,34 +1 @@
1
- import { I as QueryKey, a1 as QueryFunctionContext, Y as QueryFunction } from './hydration-BlEVG2Lp.js';
2
- import './removable.js';
3
- import './subscribable.js';
4
-
5
- type BaseStreamedQueryParams<TQueryFnData, TQueryKey extends QueryKey> = {
6
- streamFn: (context: QueryFunctionContext<TQueryKey>) => AsyncIterable<TQueryFnData> | Promise<AsyncIterable<TQueryFnData>>;
7
- refetchMode?: 'append' | 'reset' | 'replace';
8
- };
9
- type SimpleStreamedQueryParams<TQueryFnData, TQueryKey extends QueryKey> = BaseStreamedQueryParams<TQueryFnData, TQueryKey> & {
10
- reducer?: never;
11
- initialValue?: never;
12
- };
13
- type ReducibleStreamedQueryParams<TQueryFnData, TData, TQueryKey extends QueryKey> = BaseStreamedQueryParams<TQueryFnData, TQueryKey> & {
14
- reducer: (acc: TData, chunk: TQueryFnData) => TData;
15
- initialValue: TData;
16
- };
17
- type StreamedQueryParams<TQueryFnData, TData, TQueryKey extends QueryKey> = SimpleStreamedQueryParams<TQueryFnData, TQueryKey> | ReducibleStreamedQueryParams<TQueryFnData, TData, TQueryKey>;
18
- /**
19
- * This is a helper function to create a query function that streams data from an AsyncIterable.
20
- * Data will be an Array of all the chunks received.
21
- * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that.
22
- * The query will stay in fetchStatus 'fetching' until the stream ends.
23
- * @param queryFn - The function that returns an AsyncIterable to stream data from.
24
- * @param refetchMode - Defines how re-fetches are handled.
25
- * Defaults to `'reset'`, erases all data and puts the query back into `pending` state.
26
- * Set to `'append'` to append new data to the existing data.
27
- * Set to `'replace'` to write all data to the cache once the stream ends.
28
- * @param reducer - A function to reduce the streamed chunks into the final data.
29
- * Defaults to a function that appends chunks to the end of the array.
30
- * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.
31
- */
32
- declare function streamedQuery<TQueryFnData = unknown, TData = Array<TQueryFnData>, TQueryKey extends QueryKey = QueryKey>({ streamFn, refetchMode, reducer, initialValue, }: StreamedQueryParams<TQueryFnData, TData, TQueryKey>): QueryFunction<TData, TQueryKey>;
33
-
34
- export { streamedQuery };
1
+ export { streamedQuery } from './_tsup-dts-rollup.js';
@@ -1,10 +1 @@
1
- declare class Subscribable<TListener extends Function> {
2
- protected listeners: Set<TListener>;
3
- constructor();
4
- subscribe(listener: TListener): () => void;
5
- hasListeners(): boolean;
6
- protected onSubscribe(): void;
7
- protected onUnsubscribe(): void;
8
- }
9
-
10
- export { Subscribable };
1
+ export { Subscribable } from './_tsup-dts-rollup.cjs';
@@ -1,10 +1 @@
1
- declare class Subscribable<TListener extends Function> {
2
- protected listeners: Set<TListener>;
3
- constructor();
4
- subscribe(listener: TListener): () => void;
5
- hasListeners(): boolean;
6
- protected onSubscribe(): void;
7
- protected onUnsubscribe(): void;
8
- }
9
-
10
- export { Subscribable };
1
+ export { Subscribable } from './_tsup-dts-rollup.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled<T> {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending<T> {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable<T> = Promise<T> & Fulfilled<T>\nexport type RejectedThenable<T> = Promise<T> & Rejected\nexport type PendingThenable<T> = Promise<T> & Pending<T>\n\nexport type Thenable<T> =\n | FulfilledThenable<T>\n | RejectedThenable<T>\n | PendingThenable<T>\n\nexport function pendingThenable<T>(): PendingThenable<T> {\n let resolve: Pending<T>['resolve']\n let reject: Pending<T>['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable<T>\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled<T> | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial<PendingThenable<T>>).resolve\n delete (thenable as Partial<PendingThenable<T>>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise<unknown> | Thenable<unknown>) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,mBAAqB;AAkCd,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;AAUO,SAAS,eAAe,SAA+C;AA7F9E;AA8FE,MAAI;AAEJ,gBACG,KAAK,CAAC,WAAW;AAChB,WAAO;AACP,WAAO;AAAA,EACT,GAAG,iBAAI,MAJT,mBAOI,MAAM;AAEV,MAAI,SAAS,QAAW;AACtB,WAAO,EAAE,KAAK;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled<T> {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending<T> {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable<T> = Promise<T> & Fulfilled<T>\nexport type RejectedThenable<T> = Promise<T> & Rejected\nexport type PendingThenable<T> = Promise<T> & Pending<T>\n\nexport type Thenable<T> =\n | FulfilledThenable<T>\n | RejectedThenable<T>\n | PendingThenable<T>\n\nexport function pendingThenable<T>(): PendingThenable<T> {\n let resolve: Pending<T>['resolve']\n let reject: Pending<T>['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable<T>\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled<T> | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props to avoid calling them twice\n delete (thenable as Partial<PendingThenable<T>>).resolve\n delete (thenable as Partial<PendingThenable<T>>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise<unknown> | Thenable<unknown>) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,mBAAqB;AAkCd,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;AAUO,SAAS,eAAe,SAA+C;AA7F9E;AA8FE,MAAI;AAEJ,gBACG,KAAK,CAAC,WAAW;AAChB,WAAO;AACP,WAAO;AAAA,EACT,GAAG,iBAAI,MAJT,mBAOI,MAAM;AAEV,MAAI,SAAS,QAAW;AACtB,WAAO,EAAE,KAAK;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]}
@@ -1,47 +1,6 @@
1
- /**
2
- * Thenable types which matches React's types for promises
3
- *
4
- * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises
5
- *
6
- * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138
7
- * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227
8
- */
9
- interface Fulfilled<T> {
10
- status: 'fulfilled';
11
- value: T;
12
- }
13
- interface Rejected {
14
- status: 'rejected';
15
- reason: unknown;
16
- }
17
- interface Pending<T> {
18
- status: 'pending';
19
- /**
20
- * Resolve the promise with a value.
21
- * Will remove the `resolve` and `reject` properties from the promise.
22
- */
23
- resolve: (value: T) => void;
24
- /**
25
- * Reject the promise with a reason.
26
- * Will remove the `resolve` and `reject` properties from the promise.
27
- */
28
- reject: (reason: unknown) => void;
29
- }
30
- type FulfilledThenable<T> = Promise<T> & Fulfilled<T>;
31
- type RejectedThenable<T> = Promise<T> & Rejected;
32
- type PendingThenable<T> = Promise<T> & Pending<T>;
33
- type Thenable<T> = FulfilledThenable<T> | RejectedThenable<T> | PendingThenable<T>;
34
- declare function pendingThenable<T>(): PendingThenable<T>;
35
- /**
36
- * This function takes a Promise-like input and detects whether the data
37
- * is synchronously available or not.
38
- *
39
- * It does not inspect .status, .value or .reason properties of the promise,
40
- * as those are not always available, and the .status of React's promises
41
- * should not be considered part of the public API.
42
- */
43
- declare function tryResolveSync(promise: Promise<unknown> | Thenable<unknown>): {
44
- data: {} | null;
45
- } | undefined;
46
-
47
- export { type FulfilledThenable, type PendingThenable, type RejectedThenable, type Thenable, pendingThenable, tryResolveSync };
1
+ export { pendingThenable } from './_tsup-dts-rollup.cjs';
2
+ export { tryResolveSync } from './_tsup-dts-rollup.cjs';
3
+ export { FulfilledThenable } from './_tsup-dts-rollup.cjs';
4
+ export { RejectedThenable } from './_tsup-dts-rollup.cjs';
5
+ export { PendingThenable } from './_tsup-dts-rollup.cjs';
6
+ export { Thenable } from './_tsup-dts-rollup.cjs';
@@ -1,47 +1,6 @@
1
- /**
2
- * Thenable types which matches React's types for promises
3
- *
4
- * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises
5
- *
6
- * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138
7
- * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227
8
- */
9
- interface Fulfilled<T> {
10
- status: 'fulfilled';
11
- value: T;
12
- }
13
- interface Rejected {
14
- status: 'rejected';
15
- reason: unknown;
16
- }
17
- interface Pending<T> {
18
- status: 'pending';
19
- /**
20
- * Resolve the promise with a value.
21
- * Will remove the `resolve` and `reject` properties from the promise.
22
- */
23
- resolve: (value: T) => void;
24
- /**
25
- * Reject the promise with a reason.
26
- * Will remove the `resolve` and `reject` properties from the promise.
27
- */
28
- reject: (reason: unknown) => void;
29
- }
30
- type FulfilledThenable<T> = Promise<T> & Fulfilled<T>;
31
- type RejectedThenable<T> = Promise<T> & Rejected;
32
- type PendingThenable<T> = Promise<T> & Pending<T>;
33
- type Thenable<T> = FulfilledThenable<T> | RejectedThenable<T> | PendingThenable<T>;
34
- declare function pendingThenable<T>(): PendingThenable<T>;
35
- /**
36
- * This function takes a Promise-like input and detects whether the data
37
- * is synchronously available or not.
38
- *
39
- * It does not inspect .status, .value or .reason properties of the promise,
40
- * as those are not always available, and the .status of React's promises
41
- * should not be considered part of the public API.
42
- */
43
- declare function tryResolveSync(promise: Promise<unknown> | Thenable<unknown>): {
44
- data: {} | null;
45
- } | undefined;
46
-
47
- export { type FulfilledThenable, type PendingThenable, type RejectedThenable, type Thenable, pendingThenable, tryResolveSync };
1
+ export { pendingThenable } from './_tsup-dts-rollup.js';
2
+ export { tryResolveSync } from './_tsup-dts-rollup.js';
3
+ export { FulfilledThenable } from './_tsup-dts-rollup.js';
4
+ export { RejectedThenable } from './_tsup-dts-rollup.js';
5
+ export { PendingThenable } from './_tsup-dts-rollup.js';
6
+ export { Thenable } from './_tsup-dts-rollup.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled<T> {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending<T> {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable<T> = Promise<T> & Fulfilled<T>\nexport type RejectedThenable<T> = Promise<T> & Rejected\nexport type PendingThenable<T> = Promise<T> & Pending<T>\n\nexport type Thenable<T> =\n | FulfilledThenable<T>\n | RejectedThenable<T>\n | PendingThenable<T>\n\nexport function pendingThenable<T>(): PendingThenable<T> {\n let resolve: Pending<T>['resolve']\n let reject: Pending<T>['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable<T>\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled<T> | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial<PendingThenable<T>>).resolve\n delete (thenable as Partial<PendingThenable<T>>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise<unknown> | Thenable<unknown>) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n"],"mappings":";;;AASA,SAAS,YAAY;AAkCd,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;AAUO,SAAS,eAAe,SAA+C;AA7F9E;AA8FE,MAAI;AAEJ,gBACG,KAAK,CAAC,WAAW;AAChB,WAAO;AACP,WAAO;AAAA,EACT,GAAG,IAAI,MAJT,mBAOI,MAAM;AAEV,MAAI,SAAS,QAAW;AACtB,WAAO,EAAE,KAAK;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/thenable.ts"],"sourcesContent":["/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled<T> {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending<T> {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable<T> = Promise<T> & Fulfilled<T>\nexport type RejectedThenable<T> = Promise<T> & Rejected\nexport type PendingThenable<T> = Promise<T> & Pending<T>\n\nexport type Thenable<T> =\n | FulfilledThenable<T>\n | RejectedThenable<T>\n | PendingThenable<T>\n\nexport function pendingThenable<T>(): PendingThenable<T> {\n let resolve: Pending<T>['resolve']\n let reject: Pending<T>['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable<T>\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled<T> | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props to avoid calling them twice\n delete (thenable as Partial<PendingThenable<T>>).resolve\n delete (thenable as Partial<PendingThenable<T>>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise<unknown> | Thenable<unknown>) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n"],"mappings":";;;AASA,SAAS,YAAY;AAkCd,SAAS,kBAAyC;AACvD,MAAI;AACJ,MAAI;AAEJ,QAAM,WAAW,IAAI,QAAQ,CAAC,UAAU,YAAY;AAClD,cAAU;AACV,aAAS;AAAA,EACX,CAAC;AAED,WAAS,SAAS;AAClB,WAAS,MAAM,MAAM;AAAA,EAErB,CAAC;AAED,WAAS,SAAS,MAA+B;AAC/C,WAAO,OAAO,UAAU,IAAI;AAG5B,WAAQ,SAAyC;AACjD,WAAQ,SAAyC;AAAA,EACnD;AAEA,WAAS,UAAU,CAAC,UAAU;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,YAAQ,KAAK;AAAA,EACf;AACA,WAAS,SAAS,CAAC,WAAW;AAC5B,aAAS;AAAA,MACP,QAAQ;AAAA,MACR;AAAA,IACF,CAAC;AAED,WAAO,MAAM;AAAA,EACf;AAEA,SAAO;AACT;AAUO,SAAS,eAAe,SAA+C;AA7F9E;AA8FE,MAAI;AAEJ,gBACG,KAAK,CAAC,WAAW;AAChB,WAAO;AACP,WAAO;AAAA,EACT,GAAG,IAAI,MAJT,mBAOI,MAAM;AAEV,MAAI,SAAS,QAAW;AACtB,WAAO,EAAE,KAAK;AAAA,EAChB;AAEA,SAAO;AACT;","names":[]}
@@ -1,58 +1,7 @@
1
- /**
2
- * {@link TimeoutManager} does not support passing arguments to the callback.
3
- *
4
- * `(_: void)` is the argument type inferred by TypeScript's default typings for
5
- * `setTimeout(cb, number)`.
6
- * If we don't accept a single void argument, then
7
- * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.
8
- */
9
- type TimeoutCallback = (_: void) => void;
10
- /**
11
- * Wrapping `setTimeout` is awkward from a typing perspective because platform
12
- * typings may extend the return type of `setTimeout`. For example, NodeJS
13
- * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be
14
- * able to return such a type.
15
- */
16
- type ManagedTimerId = number | {
17
- [Symbol.toPrimitive]: () => number;
18
- };
19
- /**
20
- * Backend for timer functions.
21
- */
22
- type TimeoutProvider<TTimerId extends ManagedTimerId = ManagedTimerId> = {
23
- readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId;
24
- readonly clearTimeout: (timeoutId: TTimerId | undefined) => void;
25
- readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId;
26
- readonly clearInterval: (intervalId: TTimerId | undefined) => void;
27
- };
28
- declare const defaultTimeoutProvider: TimeoutProvider<ReturnType<typeof setTimeout>>;
29
- /**
30
- * Allows customization of how timeouts are created.
31
- *
32
- * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`
33
- * and `gcTime`. The default TimeoutManager provider uses the platform's global
34
- * `setTimeout` implementation, which is known to have scalability issues with
35
- * thousands of timeouts on the event loop.
36
- *
37
- * If you hit this limitation, consider providing a custom TimeoutProvider that
38
- * coalesces timeouts.
39
- */
40
- declare class TimeoutManager implements Omit<TimeoutProvider, 'name'> {
41
- #private;
42
- setTimeoutProvider<TTimerId extends ManagedTimerId>(provider: TimeoutProvider<TTimerId>): void;
43
- setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId;
44
- clearTimeout(timeoutId: ManagedTimerId | undefined): void;
45
- setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId;
46
- clearInterval(intervalId: ManagedTimerId | undefined): void;
47
- }
48
- declare const timeoutManager: TimeoutManager;
49
- /**
50
- * In many cases code wants to delay to the next event loop tick; this is not
51
- * mediated by {@link timeoutManager}.
52
- *
53
- * This function is provided to make auditing the `tanstack/query-core` for
54
- * incorrect use of system `setTimeout` easier.
55
- */
56
- declare function systemSetTimeoutZero(callback: TimeoutCallback): void;
57
-
58
- export { type ManagedTimerId, type TimeoutCallback, TimeoutManager, type TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager };
1
+ export { systemSetTimeoutZero } from './_tsup-dts-rollup.cjs';
2
+ export { TimeoutCallback_alias_1 as TimeoutCallback } from './_tsup-dts-rollup.cjs';
3
+ export { ManagedTimerId_alias_1 as ManagedTimerId } from './_tsup-dts-rollup.cjs';
4
+ export { TimeoutProvider_alias_1 as TimeoutProvider } from './_tsup-dts-rollup.cjs';
5
+ export { defaultTimeoutProvider } from './_tsup-dts-rollup.cjs';
6
+ export { TimeoutManager } from './_tsup-dts-rollup.cjs';
7
+ export { timeoutManager_alias_1 as timeoutManager } from './_tsup-dts-rollup.cjs';
@@ -1,58 +1,7 @@
1
- /**
2
- * {@link TimeoutManager} does not support passing arguments to the callback.
3
- *
4
- * `(_: void)` is the argument type inferred by TypeScript's default typings for
5
- * `setTimeout(cb, number)`.
6
- * If we don't accept a single void argument, then
7
- * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.
8
- */
9
- type TimeoutCallback = (_: void) => void;
10
- /**
11
- * Wrapping `setTimeout` is awkward from a typing perspective because platform
12
- * typings may extend the return type of `setTimeout`. For example, NodeJS
13
- * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be
14
- * able to return such a type.
15
- */
16
- type ManagedTimerId = number | {
17
- [Symbol.toPrimitive]: () => number;
18
- };
19
- /**
20
- * Backend for timer functions.
21
- */
22
- type TimeoutProvider<TTimerId extends ManagedTimerId = ManagedTimerId> = {
23
- readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId;
24
- readonly clearTimeout: (timeoutId: TTimerId | undefined) => void;
25
- readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId;
26
- readonly clearInterval: (intervalId: TTimerId | undefined) => void;
27
- };
28
- declare const defaultTimeoutProvider: TimeoutProvider<ReturnType<typeof setTimeout>>;
29
- /**
30
- * Allows customization of how timeouts are created.
31
- *
32
- * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`
33
- * and `gcTime`. The default TimeoutManager provider uses the platform's global
34
- * `setTimeout` implementation, which is known to have scalability issues with
35
- * thousands of timeouts on the event loop.
36
- *
37
- * If you hit this limitation, consider providing a custom TimeoutProvider that
38
- * coalesces timeouts.
39
- */
40
- declare class TimeoutManager implements Omit<TimeoutProvider, 'name'> {
41
- #private;
42
- setTimeoutProvider<TTimerId extends ManagedTimerId>(provider: TimeoutProvider<TTimerId>): void;
43
- setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId;
44
- clearTimeout(timeoutId: ManagedTimerId | undefined): void;
45
- setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId;
46
- clearInterval(intervalId: ManagedTimerId | undefined): void;
47
- }
48
- declare const timeoutManager: TimeoutManager;
49
- /**
50
- * In many cases code wants to delay to the next event loop tick; this is not
51
- * mediated by {@link timeoutManager}.
52
- *
53
- * This function is provided to make auditing the `tanstack/query-core` for
54
- * incorrect use of system `setTimeout` easier.
55
- */
56
- declare function systemSetTimeoutZero(callback: TimeoutCallback): void;
57
-
58
- export { type ManagedTimerId, type TimeoutCallback, TimeoutManager, type TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager };
1
+ export { systemSetTimeoutZero } from './_tsup-dts-rollup.js';
2
+ export { TimeoutCallback_alias_1 as TimeoutCallback } from './_tsup-dts-rollup.js';
3
+ export { ManagedTimerId_alias_1 as ManagedTimerId } from './_tsup-dts-rollup.js';
4
+ export { TimeoutProvider_alias_1 as TimeoutProvider } from './_tsup-dts-rollup.js';
5
+ export { defaultTimeoutProvider } from './_tsup-dts-rollup.js';
6
+ export { TimeoutManager } from './_tsup-dts-rollup.js';
7
+ export { timeoutManager_alias_1 as timeoutManager } from './_tsup-dts-rollup.js';
@@ -1,3 +1,95 @@
1
- export { T as AnyDataTag, b7 as CancelOptions, V as DataTag, G as DefaultError, b6 as DefaultOptions, ak as DefaultedInfiniteQueryObserverOptions, ai as DefaultedQueryObserverOptions, aP as DefinedInfiniteQueryObserverResult, aG as DefinedQueryObserverResult, B as DistributiveOmit, $ as Enabled, an as EnsureInfiniteQueryDataOptions, am as EnsureQueryDataOptions, ao as FetchInfiniteQueryOptions, av as FetchNextPageOptions, aw as FetchPreviousPageOptions, al as FetchQueryOptions, ay as FetchStatus, a7 as GetNextPageParamFunction, a6 as GetPreviousPageParamFunction, W as InferDataFromTag, X as InferErrorFromTag, a8 as InfiniteData, aI as InfiniteQueryObserverBaseResult, aL as InfiniteQueryObserverLoadingErrorResult, aK as InfiniteQueryObserverLoadingResult, aj as InfiniteQueryObserverOptions, aJ as InfiniteQueryObserverPendingResult, aO as InfiniteQueryObserverPlaceholderResult, aM as InfiniteQueryObserverRefetchErrorResult, aQ as InfiniteQueryObserverResult, aN as InfiniteQueryObserverSuccessResult, ae as InfiniteQueryPageParamsOptions, a2 as InitialDataFunction, ad as InitialPageParam, at as InvalidateOptions, ar as InvalidateQueryFilters, a_ as MutateFunction, aZ as MutateOptions, aW as MutationFunction, aV as MutationFunctionContext, aR as MutationKey, aU as MutationMeta, a$ as MutationObserverBaseResult, b2 as MutationObserverErrorResult, b0 as MutationObserverIdleResult, b1 as MutationObserverLoadingResult, aY as MutationObserverOptions, b4 as MutationObserverResult, b3 as MutationObserverSuccessResult, aX as MutationOptions, aT as MutationScope, aS as MutationStatus, aa as NetworkMode, F as NoInfer, N as NonUndefinedGuard, ba as NotifyEvent, b9 as NotifyEventType, ab as NotifyOnChangeProps, O as OmitKeyof, E as Override, a3 as PlaceholderDataFunction, a4 as QueriesPlaceholderDataFunction, b5 as QueryClientConfig, Y as QueryFunction, a1 as QueryFunctionContext, I as QueryKey, a5 as QueryKeyHashFunction, a9 as QueryMeta, az as QueryObserverBaseResult, aC as QueryObserverLoadingErrorResult, aB as QueryObserverLoadingResult, ag as QueryObserverOptions, aA as QueryObserverPendingResult, aF as QueryObserverPlaceholderResult, aD as QueryObserverRefetchErrorResult, aH as QueryObserverResult, aE as QueryObserverSuccessResult, ac as QueryOptions, a0 as QueryPersister, ax as QueryStatus, aq as RefetchOptions, as as RefetchQueryFilters, R as Register, au as ResetOptions, ap as ResultOptions, b8 as SetDataOptions, Z as StaleTime, _ as StaleTimeFunction, af as ThrowOnError, P as UnsetMarker, ah as WithRequired, K as dataTagErrorSymbol, J as dataTagSymbol, L as unsetMarker } from './hydration-uphG6M-i.cjs';
2
- import './removable.cjs';
3
- import './subscribable.cjs';
1
+ export { NonUndefinedGuard_alias_1 as NonUndefinedGuard } from './_tsup-dts-rollup.cjs';
2
+ export { DistributiveOmit_alias_1 as DistributiveOmit } from './_tsup-dts-rollup.cjs';
3
+ export { OmitKeyof_alias_1 as OmitKeyof } from './_tsup-dts-rollup.cjs';
4
+ export { Override_alias_1 as Override } from './_tsup-dts-rollup.cjs';
5
+ export { NoInfer_alias_1 as NoInfer } from './_tsup-dts-rollup.cjs';
6
+ export { Register_alias_1 as Register } from './_tsup-dts-rollup.cjs';
7
+ export { DefaultError_alias_1 as DefaultError } from './_tsup-dts-rollup.cjs';
8
+ export { QueryKey_alias_1 as QueryKey } from './_tsup-dts-rollup.cjs';
9
+ export { dataTagSymbol_alias_1 as dataTagSymbol } from './_tsup-dts-rollup.cjs';
10
+ export { dataTagErrorSymbol_alias_1 as dataTagErrorSymbol } from './_tsup-dts-rollup.cjs';
11
+ export { unsetMarker_alias_1 as unsetMarker } from './_tsup-dts-rollup.cjs';
12
+ export { UnsetMarker_alias_1 as UnsetMarker } from './_tsup-dts-rollup.cjs';
13
+ export { AnyDataTag_alias_1 as AnyDataTag } from './_tsup-dts-rollup.cjs';
14
+ export { DataTag_alias_1 as DataTag } from './_tsup-dts-rollup.cjs';
15
+ export { InferDataFromTag_alias_1 as InferDataFromTag } from './_tsup-dts-rollup.cjs';
16
+ export { InferErrorFromTag_alias_1 as InferErrorFromTag } from './_tsup-dts-rollup.cjs';
17
+ export { QueryFunction_alias_1 as QueryFunction } from './_tsup-dts-rollup.cjs';
18
+ export { StaleTime_alias_1 as StaleTime } from './_tsup-dts-rollup.cjs';
19
+ export { StaleTimeFunction_alias_1 as StaleTimeFunction } from './_tsup-dts-rollup.cjs';
20
+ export { Enabled_alias_1 as Enabled } from './_tsup-dts-rollup.cjs';
21
+ export { QueryPersister_alias_1 as QueryPersister } from './_tsup-dts-rollup.cjs';
22
+ export { QueryFunctionContext_alias_1 as QueryFunctionContext } from './_tsup-dts-rollup.cjs';
23
+ export { InitialDataFunction_alias_1 as InitialDataFunction } from './_tsup-dts-rollup.cjs';
24
+ export { PlaceholderDataFunction_alias_1 as PlaceholderDataFunction } from './_tsup-dts-rollup.cjs';
25
+ export { QueriesPlaceholderDataFunction_alias_1 as QueriesPlaceholderDataFunction } from './_tsup-dts-rollup.cjs';
26
+ export { QueryKeyHashFunction_alias_1 as QueryKeyHashFunction } from './_tsup-dts-rollup.cjs';
27
+ export { GetPreviousPageParamFunction_alias_1 as GetPreviousPageParamFunction } from './_tsup-dts-rollup.cjs';
28
+ export { GetNextPageParamFunction_alias_1 as GetNextPageParamFunction } from './_tsup-dts-rollup.cjs';
29
+ export { InfiniteData_alias_1 as InfiniteData } from './_tsup-dts-rollup.cjs';
30
+ export { QueryMeta_alias_1 as QueryMeta } from './_tsup-dts-rollup.cjs';
31
+ export { NetworkMode_alias_1 as NetworkMode } from './_tsup-dts-rollup.cjs';
32
+ export { NotifyOnChangeProps_alias_1 as NotifyOnChangeProps } from './_tsup-dts-rollup.cjs';
33
+ export { QueryOptions_alias_1 as QueryOptions } from './_tsup-dts-rollup.cjs';
34
+ export { InitialPageParam_alias_1 as InitialPageParam } from './_tsup-dts-rollup.cjs';
35
+ export { InfiniteQueryPageParamsOptions_alias_1 as InfiniteQueryPageParamsOptions } from './_tsup-dts-rollup.cjs';
36
+ export { ThrowOnError_alias_1 as ThrowOnError } from './_tsup-dts-rollup.cjs';
37
+ export { QueryObserverOptions_alias_1 as QueryObserverOptions } from './_tsup-dts-rollup.cjs';
38
+ export { WithRequired_alias_1 as WithRequired } from './_tsup-dts-rollup.cjs';
39
+ export { DefaultedQueryObserverOptions_alias_1 as DefaultedQueryObserverOptions } from './_tsup-dts-rollup.cjs';
40
+ export { InfiniteQueryObserverOptions_alias_1 as InfiniteQueryObserverOptions } from './_tsup-dts-rollup.cjs';
41
+ export { DefaultedInfiniteQueryObserverOptions_alias_1 as DefaultedInfiniteQueryObserverOptions } from './_tsup-dts-rollup.cjs';
42
+ export { FetchQueryOptions_alias_1 as FetchQueryOptions } from './_tsup-dts-rollup.cjs';
43
+ export { EnsureQueryDataOptions_alias_1 as EnsureQueryDataOptions } from './_tsup-dts-rollup.cjs';
44
+ export { EnsureInfiniteQueryDataOptions_alias_1 as EnsureInfiniteQueryDataOptions } from './_tsup-dts-rollup.cjs';
45
+ export { FetchInfiniteQueryOptions_alias_1 as FetchInfiniteQueryOptions } from './_tsup-dts-rollup.cjs';
46
+ export { ResultOptions_alias_1 as ResultOptions } from './_tsup-dts-rollup.cjs';
47
+ export { RefetchOptions_alias_1 as RefetchOptions } from './_tsup-dts-rollup.cjs';
48
+ export { InvalidateQueryFilters_alias_1 as InvalidateQueryFilters } from './_tsup-dts-rollup.cjs';
49
+ export { RefetchQueryFilters_alias_1 as RefetchQueryFilters } from './_tsup-dts-rollup.cjs';
50
+ export { InvalidateOptions_alias_1 as InvalidateOptions } from './_tsup-dts-rollup.cjs';
51
+ export { ResetOptions_alias_1 as ResetOptions } from './_tsup-dts-rollup.cjs';
52
+ export { FetchNextPageOptions_alias_1 as FetchNextPageOptions } from './_tsup-dts-rollup.cjs';
53
+ export { FetchPreviousPageOptions_alias_1 as FetchPreviousPageOptions } from './_tsup-dts-rollup.cjs';
54
+ export { QueryStatus_alias_1 as QueryStatus } from './_tsup-dts-rollup.cjs';
55
+ export { FetchStatus_alias_1 as FetchStatus } from './_tsup-dts-rollup.cjs';
56
+ export { QueryObserverBaseResult_alias_1 as QueryObserverBaseResult } from './_tsup-dts-rollup.cjs';
57
+ export { QueryObserverPendingResult_alias_1 as QueryObserverPendingResult } from './_tsup-dts-rollup.cjs';
58
+ export { QueryObserverLoadingResult_alias_1 as QueryObserverLoadingResult } from './_tsup-dts-rollup.cjs';
59
+ export { QueryObserverLoadingErrorResult_alias_1 as QueryObserverLoadingErrorResult } from './_tsup-dts-rollup.cjs';
60
+ export { QueryObserverRefetchErrorResult_alias_1 as QueryObserverRefetchErrorResult } from './_tsup-dts-rollup.cjs';
61
+ export { QueryObserverSuccessResult_alias_1 as QueryObserverSuccessResult } from './_tsup-dts-rollup.cjs';
62
+ export { QueryObserverPlaceholderResult_alias_1 as QueryObserverPlaceholderResult } from './_tsup-dts-rollup.cjs';
63
+ export { DefinedQueryObserverResult_alias_1 as DefinedQueryObserverResult } from './_tsup-dts-rollup.cjs';
64
+ export { QueryObserverResult_alias_1 as QueryObserverResult } from './_tsup-dts-rollup.cjs';
65
+ export { InfiniteQueryObserverBaseResult_alias_1 as InfiniteQueryObserverBaseResult } from './_tsup-dts-rollup.cjs';
66
+ export { InfiniteQueryObserverPendingResult_alias_1 as InfiniteQueryObserverPendingResult } from './_tsup-dts-rollup.cjs';
67
+ export { InfiniteQueryObserverLoadingResult_alias_1 as InfiniteQueryObserverLoadingResult } from './_tsup-dts-rollup.cjs';
68
+ export { InfiniteQueryObserverLoadingErrorResult_alias_1 as InfiniteQueryObserverLoadingErrorResult } from './_tsup-dts-rollup.cjs';
69
+ export { InfiniteQueryObserverRefetchErrorResult_alias_1 as InfiniteQueryObserverRefetchErrorResult } from './_tsup-dts-rollup.cjs';
70
+ export { InfiniteQueryObserverSuccessResult_alias_1 as InfiniteQueryObserverSuccessResult } from './_tsup-dts-rollup.cjs';
71
+ export { InfiniteQueryObserverPlaceholderResult_alias_1 as InfiniteQueryObserverPlaceholderResult } from './_tsup-dts-rollup.cjs';
72
+ export { DefinedInfiniteQueryObserverResult_alias_1 as DefinedInfiniteQueryObserverResult } from './_tsup-dts-rollup.cjs';
73
+ export { InfiniteQueryObserverResult_alias_1 as InfiniteQueryObserverResult } from './_tsup-dts-rollup.cjs';
74
+ export { MutationKey_alias_1 as MutationKey } from './_tsup-dts-rollup.cjs';
75
+ export { MutationStatus_alias_1 as MutationStatus } from './_tsup-dts-rollup.cjs';
76
+ export { MutationScope_alias_1 as MutationScope } from './_tsup-dts-rollup.cjs';
77
+ export { MutationMeta_alias_1 as MutationMeta } from './_tsup-dts-rollup.cjs';
78
+ export { MutationFunctionContext_alias_1 as MutationFunctionContext } from './_tsup-dts-rollup.cjs';
79
+ export { MutationFunction_alias_1 as MutationFunction } from './_tsup-dts-rollup.cjs';
80
+ export { MutationOptions_alias_1 as MutationOptions } from './_tsup-dts-rollup.cjs';
81
+ export { MutationObserverOptions_alias_1 as MutationObserverOptions } from './_tsup-dts-rollup.cjs';
82
+ export { MutateOptions_alias_1 as MutateOptions } from './_tsup-dts-rollup.cjs';
83
+ export { MutateFunction_alias_1 as MutateFunction } from './_tsup-dts-rollup.cjs';
84
+ export { MutationObserverBaseResult_alias_1 as MutationObserverBaseResult } from './_tsup-dts-rollup.cjs';
85
+ export { MutationObserverIdleResult_alias_1 as MutationObserverIdleResult } from './_tsup-dts-rollup.cjs';
86
+ export { MutationObserverLoadingResult_alias_1 as MutationObserverLoadingResult } from './_tsup-dts-rollup.cjs';
87
+ export { MutationObserverErrorResult_alias_1 as MutationObserverErrorResult } from './_tsup-dts-rollup.cjs';
88
+ export { MutationObserverSuccessResult_alias_1 as MutationObserverSuccessResult } from './_tsup-dts-rollup.cjs';
89
+ export { MutationObserverResult_alias_1 as MutationObserverResult } from './_tsup-dts-rollup.cjs';
90
+ export { QueryClientConfig_alias_1 as QueryClientConfig } from './_tsup-dts-rollup.cjs';
91
+ export { DefaultOptions_alias_1 as DefaultOptions } from './_tsup-dts-rollup.cjs';
92
+ export { CancelOptions_alias_1 as CancelOptions } from './_tsup-dts-rollup.cjs';
93
+ export { SetDataOptions_alias_1 as SetDataOptions } from './_tsup-dts-rollup.cjs';
94
+ export { NotifyEventType_alias_1 as NotifyEventType } from './_tsup-dts-rollup.cjs';
95
+ export { NotifyEvent_alias_1 as NotifyEvent } from './_tsup-dts-rollup.cjs';