@warp-drive/core 5.6.0-alpha.15 → 5.6.0-alpha.17

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 (286) hide show
  1. package/declarations/build-config/babel-macros.d.ts +1 -2
  2. package/declarations/build-config/canary-features.d.ts +1 -2
  3. package/declarations/build-config/debugging.d.ts +1 -2
  4. package/declarations/build-config/deprecations.d.ts +1 -2
  5. package/declarations/build-config/env.d.ts +1 -2
  6. package/declarations/build-config/macros.d.ts +1 -2
  7. package/declarations/build-config.d.ts +1 -2
  8. package/declarations/configure.d.ts +6 -7
  9. package/declarations/graph/-private/-diff.d.ts +21 -22
  10. package/declarations/graph/-private/-edge-definition.d.ts +134 -135
  11. package/declarations/graph/-private/-state.d.ts +93 -7
  12. package/declarations/graph/-private/-utils.d.ts +18 -13
  13. package/declarations/graph/-private/coerce-id.d.ts +6 -1
  14. package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +15 -4
  15. package/declarations/graph/-private/edges/collection.d.ts +35 -36
  16. package/declarations/graph/-private/edges/implicit.d.ts +28 -29
  17. package/declarations/graph/-private/edges/resource.d.ts +19 -20
  18. package/declarations/graph/-private/graph.d.ts +83 -48
  19. package/declarations/graph/-private/normalize-link.d.ts +7 -2
  20. package/declarations/graph/-private/operations/add-to-related-records.d.ts +3 -4
  21. package/declarations/graph/-private/operations/merge-identifier.d.ts +2 -3
  22. package/declarations/graph/-private/operations/remove-from-related-records.d.ts +3 -4
  23. package/declarations/graph/-private/operations/replace-related-record.d.ts +2 -3
  24. package/declarations/graph/-private/operations/replace-related-records.d.ts +58 -4
  25. package/declarations/graph/-private/operations/update-relationship.d.ts +11 -9
  26. package/declarations/graph/-private.d.ts +9 -10
  27. package/declarations/index.d.ts +11 -12
  28. package/declarations/reactive/-private/document.d.ts +143 -144
  29. package/declarations/reactive/-private/fields/compute.d.ts +31 -28
  30. package/declarations/reactive/-private/fields/extension.d.ts +2 -3
  31. package/declarations/reactive/-private/fields/managed-array.d.ts +19 -20
  32. package/declarations/reactive/-private/fields/managed-object.d.ts +16 -16
  33. package/declarations/reactive/-private/fields/many-array-manager.d.ts +15 -16
  34. package/declarations/reactive/-private/hooks.d.ts +3 -4
  35. package/declarations/reactive/-private/record.d.ts +61 -59
  36. package/declarations/reactive/-private/schema.d.ts +242 -224
  37. package/declarations/reactive/-private/symbols.d.ts +26 -1
  38. package/declarations/reactive/-private.d.ts +1 -2
  39. package/declarations/reactive.d.ts +4 -5
  40. package/declarations/request/-private/context.d.ts +34 -35
  41. package/declarations/request/-private/debug.d.ts +2 -3
  42. package/declarations/request/-private/fetch.d.ts +23 -24
  43. package/declarations/request/-private/future.d.ts +3 -4
  44. package/declarations/request/-private/manager.d.ts +159 -157
  45. package/declarations/request/-private/promise-cache.d.ts +21 -13
  46. package/declarations/request/-private/types.d.ts +124 -124
  47. package/declarations/request/-private/utils.d.ts +8 -9
  48. package/declarations/request.d.ts +5 -6
  49. package/declarations/store/-private/cache-handler/handler.d.ts +57 -52
  50. package/declarations/store/-private/cache-handler/types.d.ts +95 -96
  51. package/declarations/store/-private/cache-handler/utils.d.ts +16 -16
  52. package/declarations/store/-private/caches/cache-utils.d.ts +7 -4
  53. package/declarations/store/-private/caches/identifier-cache.d.ts +234 -246
  54. package/declarations/store/-private/caches/instance-cache.d.ts +47 -47
  55. package/declarations/store/-private/caches/resource-utils.d.ts +3 -4
  56. package/declarations/store/-private/debug/utils.d.ts +6 -7
  57. package/declarations/store/-private/default-cache-policy.d.ts +362 -361
  58. package/declarations/store/-private/legacy-model-support/record-reference.d.ts +154 -159
  59. package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +14 -14
  60. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +21 -22
  61. package/declarations/store/-private/managers/cache-manager.d.ts +440 -425
  62. package/declarations/store/-private/managers/notification-manager.d.ts +88 -83
  63. package/declarations/store/-private/managers/record-array-manager.d.ts +89 -90
  64. package/declarations/store/-private/network/request-cache.d.ts +86 -83
  65. package/declarations/store/-private/new-core-tmp/promise-state.d.ts +252 -244
  66. package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +154 -155
  67. package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +148 -149
  68. package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +28 -23
  69. package/declarations/store/-private/new-core-tmp/request-state.d.ts +263 -241
  70. package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +253 -223
  71. package/declarations/store/-private/record-arrays/identifier-array.d.ts +125 -121
  72. package/declarations/store/-private/record-arrays/many-array.d.ts +180 -184
  73. package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +120 -110
  74. package/declarations/store/-private/store-service.d.ts +1594 -1586
  75. package/declarations/store/-private/utils/coerce-id.d.ts +6 -1
  76. package/declarations/store/-private/utils/construct-resource.d.ts +1 -2
  77. package/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
  78. package/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
  79. package/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
  80. package/declarations/store/-private.d.ts +31 -28
  81. package/declarations/store/-types/q/cache-capabilities-manager.d.ts +96 -97
  82. package/declarations/store/-types/q/ds-model.d.ts +17 -18
  83. package/declarations/store/-types/q/identifier.d.ts +11 -12
  84. package/declarations/store/-types/q/record-instance.d.ts +16 -17
  85. package/declarations/store/-types/q/schema-service.d.ts +346 -343
  86. package/declarations/store/-types/q/store.d.ts +25 -28
  87. package/declarations/store.d.ts +1 -2
  88. package/declarations/types/-private.d.ts +16 -8
  89. package/declarations/types/cache/aliases.d.ts +11 -1
  90. package/declarations/types/cache/change.d.ts +4 -5
  91. package/declarations/types/cache/mutations.d.ts +51 -28
  92. package/declarations/types/cache/operations.d.ts +60 -47
  93. package/declarations/types/cache/relationship.d.ts +11 -9
  94. package/declarations/types/cache.d.ts +495 -484
  95. package/declarations/types/graph.d.ts +31 -32
  96. package/declarations/types/identifier.d.ts +83 -82
  97. package/declarations/types/json/raw.d.ts +1 -2
  98. package/declarations/types/params.d.ts +4 -5
  99. package/declarations/types/record.d.ts +117 -76
  100. package/declarations/types/request.d.ts +289 -266
  101. package/declarations/types/runtime.d.ts +8 -9
  102. package/declarations/types/schema/concepts.d.ts +19 -13
  103. package/declarations/types/schema/fields.d.ts +1712 -1713
  104. package/declarations/types/schema/fields.type-test.d.ts +0 -1
  105. package/declarations/types/spec/document.d.ts +28 -22
  106. package/declarations/types/spec/error.d.ts +16 -17
  107. package/declarations/types/spec/json-api-raw.d.ts +102 -102
  108. package/declarations/types/symbols.d.ts +74 -75
  109. package/declarations/types/utils.d.ts +5 -5
  110. package/declarations/types.d.ts +10 -11
  111. package/declarations/utils/string.d.ts +43 -40
  112. package/dist/graph/-private.js +1 -1
  113. package/dist/{handler-D1C3Innj.js → handler-C2T-IyJK.js} +1 -1
  114. package/dist/index.js +2 -2
  115. package/dist/reactive/-private.js +1 -1
  116. package/dist/reactive.js +42 -73
  117. package/dist/{request-state-CCOJIj5i.js → request-state-CjLph1LP.js} +275 -261
  118. package/dist/store/-private.js +2 -2
  119. package/dist/{symbols-epHW0Vm9.js → symbols-SIstXMLI.js} +1 -1
  120. package/dist/types/-private.js +1 -1
  121. package/package.json +4 -4
  122. package/declarations/build-config/babel-macros.d.ts.map +0 -1
  123. package/declarations/build-config/canary-features.d.ts.map +0 -1
  124. package/declarations/build-config/debugging.d.ts.map +0 -1
  125. package/declarations/build-config/deprecations.d.ts.map +0 -1
  126. package/declarations/build-config/env.d.ts.map +0 -1
  127. package/declarations/build-config/macros.d.ts.map +0 -1
  128. package/declarations/build-config.d.ts.map +0 -1
  129. package/declarations/configure.d.ts.map +0 -1
  130. package/declarations/graph/-private/-diff.d.ts.map +0 -1
  131. package/declarations/graph/-private/-edge-definition.d.ts.map +0 -1
  132. package/declarations/graph/-private/-state.d.ts.map +0 -1
  133. package/declarations/graph/-private/-utils.d.ts.map +0 -1
  134. package/declarations/graph/-private/coerce-id.d.ts.map +0 -1
  135. package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts.map +0 -1
  136. package/declarations/graph/-private/edges/collection.d.ts.map +0 -1
  137. package/declarations/graph/-private/edges/implicit.d.ts.map +0 -1
  138. package/declarations/graph/-private/edges/resource.d.ts.map +0 -1
  139. package/declarations/graph/-private/graph.d.ts.map +0 -1
  140. package/declarations/graph/-private/normalize-link.d.ts.map +0 -1
  141. package/declarations/graph/-private/operations/add-to-related-records.d.ts.map +0 -1
  142. package/declarations/graph/-private/operations/merge-identifier.d.ts.map +0 -1
  143. package/declarations/graph/-private/operations/remove-from-related-records.d.ts.map +0 -1
  144. package/declarations/graph/-private/operations/replace-related-record.d.ts.map +0 -1
  145. package/declarations/graph/-private/operations/replace-related-records.d.ts.map +0 -1
  146. package/declarations/graph/-private/operations/update-relationship.d.ts.map +0 -1
  147. package/declarations/graph/-private.d.ts.map +0 -1
  148. package/declarations/index.d.ts.map +0 -1
  149. package/declarations/reactive/-private/document.d.ts.map +0 -1
  150. package/declarations/reactive/-private/fields/compute.d.ts.map +0 -1
  151. package/declarations/reactive/-private/fields/extension.d.ts.map +0 -1
  152. package/declarations/reactive/-private/fields/managed-array.d.ts.map +0 -1
  153. package/declarations/reactive/-private/fields/managed-object.d.ts.map +0 -1
  154. package/declarations/reactive/-private/fields/many-array-manager.d.ts.map +0 -1
  155. package/declarations/reactive/-private/hooks.d.ts.map +0 -1
  156. package/declarations/reactive/-private/record.d.ts.map +0 -1
  157. package/declarations/reactive/-private/schema.d.ts.map +0 -1
  158. package/declarations/reactive/-private/symbols.d.ts.map +0 -1
  159. package/declarations/reactive/-private.d.ts.map +0 -1
  160. package/declarations/reactive.d.ts.map +0 -1
  161. package/declarations/request/-private/context.d.ts.map +0 -1
  162. package/declarations/request/-private/debug.d.ts.map +0 -1
  163. package/declarations/request/-private/fetch.d.ts.map +0 -1
  164. package/declarations/request/-private/future.d.ts.map +0 -1
  165. package/declarations/request/-private/manager.d.ts.map +0 -1
  166. package/declarations/request/-private/promise-cache.d.ts.map +0 -1
  167. package/declarations/request/-private/types.d.ts.map +0 -1
  168. package/declarations/request/-private/utils.d.ts.map +0 -1
  169. package/declarations/request.d.ts.map +0 -1
  170. package/declarations/store/-private/cache-handler/handler.d.ts.map +0 -1
  171. package/declarations/store/-private/cache-handler/types.d.ts.map +0 -1
  172. package/declarations/store/-private/cache-handler/utils.d.ts.map +0 -1
  173. package/declarations/store/-private/caches/cache-utils.d.ts.map +0 -1
  174. package/declarations/store/-private/caches/identifier-cache.d.ts.map +0 -1
  175. package/declarations/store/-private/caches/instance-cache.d.ts.map +0 -1
  176. package/declarations/store/-private/caches/resource-utils.d.ts.map +0 -1
  177. package/declarations/store/-private/debug/utils.d.ts.map +0 -1
  178. package/declarations/store/-private/default-cache-policy.d.ts.map +0 -1
  179. package/declarations/store/-private/legacy-model-support/record-reference.d.ts.map +0 -1
  180. package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts.map +0 -1
  181. package/declarations/store/-private/managers/cache-capabilities-manager.d.ts.map +0 -1
  182. package/declarations/store/-private/managers/cache-manager.d.ts.map +0 -1
  183. package/declarations/store/-private/managers/notification-manager.d.ts.map +0 -1
  184. package/declarations/store/-private/managers/record-array-manager.d.ts.map +0 -1
  185. package/declarations/store/-private/network/request-cache.d.ts.map +0 -1
  186. package/declarations/store/-private/new-core-tmp/promise-state.d.ts.map +0 -1
  187. package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts.map +0 -1
  188. package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts.map +0 -1
  189. package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts.map +0 -1
  190. package/declarations/store/-private/new-core-tmp/request-state.d.ts.map +0 -1
  191. package/declarations/store/-private/new-core-tmp/request-subscription.d.ts.map +0 -1
  192. package/declarations/store/-private/record-arrays/identifier-array.d.ts.map +0 -1
  193. package/declarations/store/-private/record-arrays/many-array.d.ts.map +0 -1
  194. package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts.map +0 -1
  195. package/declarations/store/-private/store-service.d.ts.map +0 -1
  196. package/declarations/store/-private/store-service.type-test.d.ts +0 -2
  197. package/declarations/store/-private/store-service.type-test.d.ts.map +0 -1
  198. package/declarations/store/-private/utils/coerce-id.d.ts.map +0 -1
  199. package/declarations/store/-private/utils/construct-resource.d.ts.map +0 -1
  200. package/declarations/store/-private/utils/is-non-empty-string.d.ts.map +0 -1
  201. package/declarations/store/-private/utils/normalize-model-name.d.ts.map +0 -1
  202. package/declarations/store/-private/utils/uuid-polyfill.d.ts.map +0 -1
  203. package/declarations/store/-private.d.ts.map +0 -1
  204. package/declarations/store/-types/q/cache-capabilities-manager.d.ts.map +0 -1
  205. package/declarations/store/-types/q/ds-model.d.ts.map +0 -1
  206. package/declarations/store/-types/q/identifier.d.ts.map +0 -1
  207. package/declarations/store/-types/q/promise-proxies.d.ts +0 -2
  208. package/declarations/store/-types/q/promise-proxies.d.ts.map +0 -1
  209. package/declarations/store/-types/q/record-data-json-api.d.ts +0 -31
  210. package/declarations/store/-types/q/record-data-json-api.d.ts.map +0 -1
  211. package/declarations/store/-types/q/record-instance.d.ts.map +0 -1
  212. package/declarations/store/-types/q/schema-service.d.ts.map +0 -1
  213. package/declarations/store/-types/q/store.d.ts.map +0 -1
  214. package/declarations/store.d.ts.map +0 -1
  215. package/declarations/types/-private.d.ts.map +0 -1
  216. package/declarations/types/cache/aliases.d.ts.map +0 -1
  217. package/declarations/types/cache/change.d.ts.map +0 -1
  218. package/declarations/types/cache/mutations.d.ts.map +0 -1
  219. package/declarations/types/cache/operations.d.ts.map +0 -1
  220. package/declarations/types/cache/relationship.d.ts.map +0 -1
  221. package/declarations/types/cache.d.ts.map +0 -1
  222. package/declarations/types/graph.d.ts.map +0 -1
  223. package/declarations/types/identifier.d.ts.map +0 -1
  224. package/declarations/types/json/raw.d.ts.map +0 -1
  225. package/declarations/types/params.d.ts.map +0 -1
  226. package/declarations/types/record.d.ts.map +0 -1
  227. package/declarations/types/record.type-test.d.ts +0 -2
  228. package/declarations/types/record.type-test.d.ts.map +0 -1
  229. package/declarations/types/request.d.ts.map +0 -1
  230. package/declarations/types/request.type-test.d.ts +0 -2
  231. package/declarations/types/request.type-test.d.ts.map +0 -1
  232. package/declarations/types/runtime.d.ts.map +0 -1
  233. package/declarations/types/schema/concepts.d.ts.map +0 -1
  234. package/declarations/types/schema/fields.d.ts.map +0 -1
  235. package/declarations/types/schema/fields.type-test.d.ts.map +0 -1
  236. package/declarations/types/spec/document.d.ts.map +0 -1
  237. package/declarations/types/spec/error.d.ts.map +0 -1
  238. package/declarations/types/spec/json-api-raw.d.ts.map +0 -1
  239. package/declarations/types/symbols.d.ts.map +0 -1
  240. package/declarations/types/utils.d.ts.map +0 -1
  241. package/declarations/types.d.ts.map +0 -1
  242. package/declarations/utils/string.d.ts.map +0 -1
  243. package/dist/build-config/babel-macros.js.map +0 -1
  244. package/dist/build-config/canary-features.js.map +0 -1
  245. package/dist/build-config/debugging.js.map +0 -1
  246. package/dist/build-config/deprecations.js.map +0 -1
  247. package/dist/build-config/env.js.map +0 -1
  248. package/dist/build-config/macros.js.map +0 -1
  249. package/dist/build-config.js.map +0 -1
  250. package/dist/configure-B48bFHOl.js.map +0 -1
  251. package/dist/configure.js.map +0 -1
  252. package/dist/context-COmAnXUQ.js.map +0 -1
  253. package/dist/graph/-private.js.map +0 -1
  254. package/dist/handler-D1C3Innj.js.map +0 -1
  255. package/dist/index.js.map +0 -1
  256. package/dist/reactive/-private.js.map +0 -1
  257. package/dist/reactive.js.map +0 -1
  258. package/dist/request-state-CCOJIj5i.js.map +0 -1
  259. package/dist/request.js.map +0 -1
  260. package/dist/store/-private.js.map +0 -1
  261. package/dist/store.js.map +0 -1
  262. package/dist/symbols-epHW0Vm9.js.map +0 -1
  263. package/dist/types/-private.js.map +0 -1
  264. package/dist/types/cache/aliases.js.map +0 -1
  265. package/dist/types/cache/change.js.map +0 -1
  266. package/dist/types/cache/mutations.js.map +0 -1
  267. package/dist/types/cache/operations.js.map +0 -1
  268. package/dist/types/cache/relationship.js.map +0 -1
  269. package/dist/types/cache.js.map +0 -1
  270. package/dist/types/graph.js.map +0 -1
  271. package/dist/types/identifier.js.map +0 -1
  272. package/dist/types/json/raw.js.map +0 -1
  273. package/dist/types/params.js.map +0 -1
  274. package/dist/types/record.js.map +0 -1
  275. package/dist/types/request.js.map +0 -1
  276. package/dist/types/runtime.js.map +0 -1
  277. package/dist/types/schema/concepts.js.map +0 -1
  278. package/dist/types/schema/fields.js.map +0 -1
  279. package/dist/types/schema/fields.type-test.js.map +0 -1
  280. package/dist/types/spec/document.js.map +0 -1
  281. package/dist/types/spec/error.js.map +0 -1
  282. package/dist/types/spec/json-api-raw.js.map +0 -1
  283. package/dist/types/symbols.js.map +0 -1
  284. package/dist/types/utils.js.map +0 -1
  285. package/dist/types.js.map +0 -1
  286. package/dist/utils/string.js.map +0 -1
@@ -1,231 +1,261 @@
1
- import type { RequestManager, Store, StoreRequestInput } from '../../../index';
2
- import type { Future } from '../../../request';
1
+ import type { RequestManager, Store, StoreRequestInput } from "../../../index.js";
2
+ import type { Future } from "../../../request.js";
3
+ import type { StructuredErrorDocument } from "../../../types/request.js";
4
+ import type { RequestState } from "../../-private.js";
3
5
  export declare const DISPOSE: "(symbol) dispose";
4
- type AutorefreshBehaviorType = 'online' | 'interval' | 'invalid';
6
+ interface ErrorFeatures {
7
+ isHidden: boolean;
8
+ isOnline: boolean;
9
+ retry: () => Promise<void>;
10
+ }
11
+ type AutorefreshBehaviorType = "online" | "interval" | "invalid";
5
12
  type AutorefreshBehaviorCombos = boolean | AutorefreshBehaviorType | `${AutorefreshBehaviorType},${AutorefreshBehaviorType}` | `${AutorefreshBehaviorType},${AutorefreshBehaviorType},${AutorefreshBehaviorType}`;
6
13
  type ContentFeatures<RT> = {
7
- isOnline: boolean;
8
- isHidden: boolean;
9
- isRefreshing: boolean;
10
- refresh: () => Promise<void>;
11
- reload: () => Promise<void>;
12
- abort?: () => void;
13
- latestRequest?: Future<RT>;
14
+ isOnline: boolean;
15
+ isHidden: boolean;
16
+ isRefreshing: boolean;
17
+ refresh: () => Promise<void>;
18
+ reload: () => Promise<void>;
19
+ abort?: () => void;
20
+ latestRequest?: Future<RT>;
14
21
  };
15
- export interface SubscriptionArgs<RT, T, E> {
16
- /**
17
- * The request to monitor. This should be a `Future` instance returned
18
- * by either the `store.request` or `store.requestManager.request` methods.
19
- *
20
- */
21
- request?: Future<RT>;
22
- /**
23
- * A query to use for the request. This should be an object that can be
24
- * passed to `store.request`. Use this in place of `@request` if you would
25
- * like the component to also initiate the request.
26
- *
27
- */
28
- query?: StoreRequestInput<RT, T>;
29
- /**
30
- * The autorefresh behavior for the request. This can be a boolean, or any
31
- * combination of the following values: `'online'`, `'interval'`, `'invalid'`.
32
- *
33
- * - `'online'`: Refresh the request when the browser comes back online
34
- * - `'interval'`: Refresh the request at a specified interval
35
- * - `'invalid'`: Refresh the request when the store emits an invalidation
36
- *
37
- * If `true`, this is equivalent to `'online,invalid'`.
38
- *
39
- * Defaults to `false`.
40
- *
41
- */
42
- autorefresh?: AutorefreshBehaviorCombos;
43
- /**
44
- * The number of milliseconds to wait before refreshing the request when the
45
- * browser comes back online or the network becomes available.
46
- *
47
- * This also controls the interval at which the request will be refreshed if
48
- * the `interval` autorefresh type is enabled.
49
- *
50
- * Defaults to `30_000` (30 seconds).
51
- *
52
- */
53
- autorefreshThreshold?: number;
54
- /**
55
- * The behavior of the request initiated by autorefresh. This can be one of
56
- * the following values:
57
- *
58
- * - `'refresh'`: Refresh the request in the background
59
- * - `'reload'`: Force a reload of the request
60
- * - `'policy'` (**default**): Let the store's configured CachePolicy decide whether to
61
- * reload, refresh, or do nothing.
62
- *
63
- * Defaults to `'policy'`.
64
- *
65
- */
66
- autorefreshBehavior?: 'refresh' | 'reload' | 'policy';
22
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
23
+ export interface SubscriptionArgs<
24
+ RT,
25
+ T,
26
+ E
27
+ > {
28
+ /**
29
+ * The request to monitor. This should be a `Future` instance returned
30
+ * by either the `store.request` or `store.requestManager.request` methods.
31
+ *
32
+ */
33
+ request?: Future<RT>;
34
+ /**
35
+ * A query to use for the request. This should be an object that can be
36
+ * passed to `store.request`. Use this in place of `@request` if you would
37
+ * like the component to also initiate the request.
38
+ *
39
+ */
40
+ query?: StoreRequestInput<RT, T>;
41
+ /**
42
+ * The autorefresh behavior for the request. This can be a boolean, or any
43
+ * combination of the following values: `'online'`, `'interval'`, `'invalid'`.
44
+ *
45
+ * - `'online'`: Refresh the request when the browser comes back online
46
+ * - `'interval'`: Refresh the request at a specified interval
47
+ * - `'invalid'`: Refresh the request when the store emits an invalidation
48
+ *
49
+ * If `true`, this is equivalent to `'online,invalid'`.
50
+ *
51
+ * Defaults to `false`.
52
+ *
53
+ */
54
+ autorefresh?: AutorefreshBehaviorCombos;
55
+ /**
56
+ * The number of milliseconds to wait before refreshing the request when the
57
+ * browser comes back online or the network becomes available.
58
+ *
59
+ * This also controls the interval at which the request will be refreshed if
60
+ * the `interval` autorefresh type is enabled.
61
+ *
62
+ * Defaults to `30_000` (30 seconds).
63
+ *
64
+ */
65
+ autorefreshThreshold?: number;
66
+ /**
67
+ * The behavior of the request initiated by autorefresh. This can be one of
68
+ * the following values:
69
+ *
70
+ * - `'refresh'`: Refresh the request in the background
71
+ * - `'reload'`: Force a reload of the request
72
+ * - `'policy'` (**default**): Let the store's configured CachePolicy decide whether to
73
+ * reload, refresh, or do nothing.
74
+ *
75
+ * Defaults to `'policy'`.
76
+ *
77
+ */
78
+ autorefreshBehavior?: "refresh" | "reload" | "policy";
79
+ }
80
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
81
+ export interface RequestSubscription<
82
+ RT,
83
+ T,
84
+ E
85
+ > {
86
+ /**
87
+ * The method to call when the component this subscription is attached to
88
+ * unmounts.
89
+ */
90
+ [DISPOSE](): void;
67
91
  }
68
92
  /**
69
- * A reactive class
70
- *
71
- * @hideconstructor
72
- */
73
- export declare class RequestSubscription<RT, T, E> {
74
- /**
75
- * Whether the browser reports that the network is online.
76
- */
77
- isOnline: boolean;
78
- /**
79
- * Whether the browser reports that the tab is hidden.
80
- */
81
- isHidden: boolean;
82
- /**
83
- * Whether the component is currently refreshing the request.
84
- */
85
- isRefreshing: boolean;
86
- /**
87
- * The most recent blocking request that was made, typically
88
- * the result of a reload.
89
- *
90
- * This will never be the original request passed as an arg to
91
- * the component.
92
- *
93
- * @internal
94
- */
95
- private _localRequest;
96
- /**
97
- * The most recent request that was made, typically due to either a
98
- * reload or a refresh.
99
- *
100
- * This will never be the original request passed as an arg to
101
- * the component.
102
- *
103
- * @internal
104
- */
105
- private _latestRequest;
106
- /**
107
- * The time at which the network was reported as offline.
108
- *
109
- * @internal
110
- */
111
- private _unavailableStart;
112
- /** @internal */
113
- private _intervalStart;
114
- /** @internal */
115
- private _nextInterval;
116
- /** @internal */
117
- private _invalidated;
118
- /** @internal */
119
- private _isUpdating;
120
- /** @internal */
121
- private isDestroyed;
122
- /**
123
- * The event listener for network status changes,
124
- * cached to use the reference for removal.
125
- *
126
- * @internal
127
- */
128
- private _onlineChanged;
129
- /**
130
- * The event listener for visibility status changes,
131
- * cached to use the reference for removal.
132
- *
133
- * @internal
134
- */
135
- private _backgroundChanged;
136
- /**
137
- * The last request passed as an arg to the component,
138
- * cached for comparison.
139
- *
140
- * @internal
141
- */
142
- private _originalRequest;
143
- /**
144
- * The last query passed as an arg to the component,
145
- * cached for comparison.
146
- *
147
- * @internal
148
- */
149
- private _originalQuery;
150
- /** @internal */
151
- private _subscription;
152
- /** @internal */
153
- private _subscribedTo;
154
- /** @internal */
155
- private _args;
156
- /** @internal */
157
- store: Store | RequestManager;
158
- constructor(store: Store | RequestManager, args: SubscriptionArgs<RT, T, E>);
159
- /**
160
- * @internal
161
- */
162
- private _beginPolling;
163
- get isIdle(): boolean;
164
- get autorefreshTypes(): Set<AutorefreshBehaviorType>;
165
- private _scheduleInterval;
166
- private _clearInterval;
167
- /**
168
- * @internal
169
- */
170
- private _updateSubscriptions;
171
- /**
172
- * @internal
173
- */
174
- private _removeSubscriptions;
175
- /**
176
- * Install the event listeners for network and visibility changes.
177
- * This is only done in browser environments with a global `window`.
178
- *
179
- * @internal
180
- */
181
- private _installListeners;
182
- /**
183
- * If the network is online and the tab is visible, either reload or refresh the request
184
- * based on the component's configuration and the requested update mode.
185
- *
186
- * Valid modes are:
187
- *
188
- * - `'reload'`: Force a reload of the request.
189
- * - `'refresh'`: Refresh the request in the background.
190
- * - `'policy'`: Make the request, letting the store's configured CachePolicy decide whether to reload, refresh, or do nothing.
191
- * - `undefined`: Make the request using the component's autorefreshBehavior setting if the autorefreshThreshold has passed.
192
- *
193
- * @internal
194
- */
195
- private _maybeUpdate;
196
- /**
197
- * Retry the request, reloading it from the server.
198
- */
199
- retry: () => Promise<void>;
200
- /**
201
- * Refresh the request, updating it in the background.
202
- */
203
- refresh: () => Promise<void>;
204
- /**
205
- * features to yield to the error slot of a component
206
- */
207
- get errorFeatures(): {
208
- isHidden: boolean;
209
- isOnline: boolean;
210
- retry: () => Promise<void>;
211
- };
212
- /**
213
- * features to yield to the content slot of a component
214
- */
215
- get contentFeatures(): ContentFeatures<RT>;
216
- /**
217
- * The method to call when the component this subscription is attached to
218
- * unmounts.
219
- */
220
- [DISPOSE](): void;
221
- /**
222
- * @internal
223
- */
224
- get _request(): Future<RT>;
225
- get request(): Future<RT>;
226
- get reqState(): Readonly<import("./request-state").RequestCacheRequestState<RT, T, import("../../../types/request").StructuredErrorDocument<E>>>;
227
- get result(): RT;
93
+ * A reactive class
94
+ *
95
+ * @hideconstructor
96
+ */
97
+ export declare class RequestSubscription<
98
+ RT,
99
+ T,
100
+ E
101
+ > {
102
+ /**
103
+ * Whether the browser reports that the network is online.
104
+ */
105
+ isOnline: boolean;
106
+ /**
107
+ * Whether the browser reports that the tab is hidden.
108
+ */
109
+ isHidden: boolean;
110
+ /**
111
+ * Whether the component is currently refreshing the request.
112
+ */
113
+ isRefreshing: boolean;
114
+ /**
115
+ * The most recent blocking request that was made, typically
116
+ * the result of a reload.
117
+ *
118
+ * This will never be the original request passed as an arg to
119
+ * the component.
120
+ *
121
+ * @internal
122
+ */
123
+ private _localRequest;
124
+ /**
125
+ * The most recent request that was made, typically due to either a
126
+ * reload or a refresh.
127
+ *
128
+ * This will never be the original request passed as an arg to
129
+ * the component.
130
+ *
131
+ * @internal
132
+ */
133
+ private _latestRequest;
134
+ /**
135
+ * The time at which the network was reported as offline.
136
+ *
137
+ * @internal
138
+ */
139
+ private _unavailableStart;
140
+ /** @internal */
141
+ private _intervalStart;
142
+ /** @internal */
143
+ private _nextInterval;
144
+ /** @internal */
145
+ private _invalidated;
146
+ /** @internal */
147
+ private _isUpdating;
148
+ /** @internal */
149
+ private isDestroyed;
150
+ /**
151
+ * The event listener for network status changes,
152
+ * cached to use the reference for removal.
153
+ *
154
+ * @internal
155
+ */
156
+ private _onlineChanged;
157
+ /**
158
+ * The event listener for visibility status changes,
159
+ * cached to use the reference for removal.
160
+ *
161
+ * @internal
162
+ */
163
+ private _backgroundChanged;
164
+ /**
165
+ * The last request passed as an arg to the component,
166
+ * cached for comparison.
167
+ *
168
+ * @internal
169
+ */
170
+ private _originalRequest;
171
+ /**
172
+ * The last query passed as an arg to the component,
173
+ * cached for comparison.
174
+ *
175
+ * @internal
176
+ */
177
+ private _originalQuery;
178
+ /** @internal */
179
+ private _subscription;
180
+ /** @internal */
181
+ private _subscribedTo;
182
+ /** @internal */
183
+ private _args;
184
+ /** @internal */
185
+ store: Store | RequestManager;
186
+ constructor(store: Store | RequestManager, args: SubscriptionArgs<RT, T, E>);
187
+ /**
188
+ * @internal
189
+ */
190
+ private _beginPolling;
191
+ get isIdle(): boolean;
192
+ get autorefreshTypes(): Set<AutorefreshBehaviorType>;
193
+ // we only run this function on component creation
194
+ // and when an update is triggered, so it does not
195
+ // react to changes in the autorefreshThreshold
196
+ // or autorefresh args.
197
+ //
198
+ // if we need to react to those changes, we can
199
+ // use a modifier or internal component or some
200
+ // such to trigger a re-run of this function.
201
+ private _scheduleInterval;
202
+ private _clearInterval;
203
+ /**
204
+ * @internal
205
+ */
206
+ private _updateSubscriptions;
207
+ /**
208
+ * @internal
209
+ */
210
+ private _removeSubscriptions;
211
+ /**
212
+ * Install the event listeners for network and visibility changes.
213
+ * This is only done in browser environments with a global `window`.
214
+ *
215
+ * @internal
216
+ */
217
+ private _installListeners;
218
+ /**
219
+ * If the network is online and the tab is visible, either reload or refresh the request
220
+ * based on the component's configuration and the requested update mode.
221
+ *
222
+ * Valid modes are:
223
+ *
224
+ * - `'reload'`: Force a reload of the request.
225
+ * - `'refresh'`: Refresh the request in the background.
226
+ * - `'policy'`: Make the request, letting the store's configured CachePolicy decide whether to reload, refresh, or do nothing.
227
+ * - `undefined`: Make the request using the component's autorefreshBehavior setting if the autorefreshThreshold has passed.
228
+ *
229
+ * @internal
230
+ */
231
+ private _maybeUpdate;
232
+ /**
233
+ * Retry the request, reloading it from the server.
234
+ */
235
+ retry: () => Promise<void>;
236
+ /**
237
+ * Refresh the request, updating it in the background.
238
+ */
239
+ refresh: () => Promise<void>;
240
+ /**
241
+ * features to yield to the error slot of a component
242
+ */
243
+ get errorFeatures(): ErrorFeatures;
244
+ /**
245
+ * features to yield to the content slot of a component
246
+ */
247
+ get contentFeatures(): ContentFeatures<RT>;
248
+ /**
249
+ * @internal
250
+ */
251
+ get _request(): Future<RT>;
252
+ get request(): Future<RT>;
253
+ get reqState(): RequestState<RT, T, StructuredErrorDocument<E>>;
254
+ get result(): RT;
228
255
  }
229
- export declare function createRequestSubscription<RT, T, E>(store: Store | RequestManager, args: SubscriptionArgs<RT, T, E>): RequestSubscription<RT, T, E>;
256
+ export declare function createRequestSubscription<
257
+ RT,
258
+ T,
259
+ E
260
+ >(store: Store | RequestManager, args: SubscriptionArgs<RT, T, E>): RequestSubscription<RT, T, E>;
230
261
  export {};
231
- //# sourceMappingURL=request-subscription.d.ts.map