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

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,143 +1,147 @@
1
- import type { BaseFinderOptions } from '../../../types';
2
- import type { LocalRelationshipOperation } from '../../../types/graph.ts';
3
- import type { StableDocumentIdentifier, StableRecordIdentifier } from '../../../types/identifier.ts';
4
- import type { TypeFromInstanceOrString } from '../../../types/record.ts';
5
- import type { ImmutableRequestInfo } from '../../../types/request.ts';
6
- import type { LegacyHasManyField, LinksModeHasManyField } from '../../../types/schema/fields.ts';
7
- import type { Links, PaginationLinks } from '../../../types/spec/json-api-raw.ts';
8
- import type { RecordArrayManager } from '../managers/record-array-manager.ts';
9
- import type { WarpDriveSignal } from '../new-core-tmp/reactivity/internal.ts';
10
- import { ARRAY_SIGNAL } from '../new-core-tmp/reactivity/internal.ts';
11
- import type { Store } from '../store-service.ts';
12
- import { NativeProxy } from './native-proxy-type-fix.ts';
1
+ import type { BaseFinderOptions } from "../../../types.js";
2
+ import type { LocalRelationshipOperation } from "../../../types/graph.js";
3
+ import type { StableDocumentIdentifier, StableRecordIdentifier } from "../../../types/identifier.js";
4
+ import type { TypeFromInstanceOrString } from "../../../types/record.js";
5
+ import type { ImmutableRequestInfo } from "../../../types/request.js";
6
+ import type { LegacyHasManyField, LinksModeHasManyField } from "../../../types/schema/fields.js";
7
+ import type { Links, PaginationLinks } from "../../../types/spec/json-api-raw.js";
8
+ import type { RecordArrayManager } from "../managers/record-array-manager.js";
9
+ import type { WarpDriveSignal } from "../new-core-tmp/reactivity/internal.js";
10
+ import { ARRAY_SIGNAL } from "../new-core-tmp/reactivity/internal.js";
11
+ import type { Store } from "../store-service.js";
12
+ import { NativeProxy } from "./native-proxy-type-fix.js";
13
13
  export declare const SOURCE: "___(unique) Symbol(#source)";
14
14
  export declare const MUTATE: "___(unique) Symbol(#update)";
15
15
  declare const IS_COLLECTION: "___(unique) Symbol(IS_COLLECTION)";
16
16
  export type IdentifierArrayCreateOptions<T = unknown> = {
17
- identifiers: StableRecordIdentifier<TypeFromInstanceOrString<T>>[];
18
- type?: TypeFromInstanceOrString<T>;
19
- store: Store;
20
- allowMutation: boolean;
21
- manager: MinimumManager;
22
- field?: LegacyHasManyField | LinksModeHasManyField;
23
- links?: Links | PaginationLinks | null;
24
- meta?: Record<string, unknown> | null;
25
- identifier?: StableDocumentIdentifier | null;
17
+ identifiers: StableRecordIdentifier<TypeFromInstanceOrString<T>>[];
18
+ type?: TypeFromInstanceOrString<T>;
19
+ store: Store;
20
+ allowMutation: boolean;
21
+ manager: MinimumManager;
22
+ field?: LegacyHasManyField | LinksModeHasManyField;
23
+ links?: Links | PaginationLinks | null;
24
+ meta?: Record<string, unknown> | null;
25
+ identifier?: StableDocumentIdentifier | null;
26
+ [MUTATE]?(target: StableRecordIdentifier[], receiver: typeof NativeProxy<StableRecordIdentifier[], T[]>, prop: string, args: unknown[], _SIGNAL: WarpDriveSignal): unknown;
26
27
  };
27
28
  type PromiseTo<T> = Omit<Promise<T>, typeof Symbol.toStringTag>;
28
29
  type PromiseManyArray<T> = {
29
- length: number;
30
- content: IdentifierArray<T> | null;
31
- promise: Promise<IdentifierArray<T>> | null;
30
+ length: number;
31
+ content: IdentifierArray<T> | null;
32
+ promise: Promise<IdentifierArray<T>> | null;
32
33
  } & PromiseTo<IdentifierArray<T>>;
33
34
  export type MinimumManager = {
34
- _syncArray: (array: IdentifierArray) => void;
35
- mutate?(mutation: LocalRelationshipOperation): void;
36
- reloadHasMany?<T>(key: string, options?: BaseFinderOptions): Promise<IdentifierArray<T>> | PromiseManyArray<T>;
35
+ _syncArray: (array: IdentifierArray) => void;
36
+ mutate?(mutation: LocalRelationshipOperation): void;
37
+ reloadHasMany?<T>(key: string, options?: BaseFinderOptions): Promise<IdentifierArray<T>> | PromiseManyArray<T>;
37
38
  };
38
39
  /**
39
- A record array is an array that contains records of a certain type (or modelName).
40
- The record array materializes records as needed when they are retrieved for the first
41
- time. You should not create record arrays yourself. Instead, an instance of
42
- `RecordArray` or its subclasses will be returned by your application's store
43
- in response to queries.
40
+ A record array is an array that contains records of a certain type (or modelName).
41
+ The record array materializes records as needed when they are retrieved for the first
42
+ time. You should not create record arrays yourself. Instead, an instance of
43
+ `RecordArray` or its subclasses will be returned by your application's store
44
+ in response to queries.
44
45
 
45
- This class should not be imported and instantiated by consuming applications.
46
+ This class should not be imported and instantiated by consuming applications.
46
47
 
47
- @class RecordArray
48
- @public
48
+ @class RecordArray
49
+ @public
49
50
  */
50
- export interface IdentifierArray<T = unknown> extends Omit<Array<T>, '[]'> {
51
- [MUTATE]?(target: StableRecordIdentifier[], receiver: typeof NativeProxy<StableRecordIdentifier[], T[]>, prop: string, args: unknown[], _SIGNAL: WarpDriveSignal): unknown;
51
+ export interface IdentifierArray<T = unknown> extends Omit<Array<T>, "[]"> {
52
+ [IS_COLLECTION]: boolean;
53
+ [ARRAY_SIGNAL]: WarpDriveSignal;
54
+ [SOURCE]: StableRecordIdentifier[];
52
55
  }
53
56
  export declare class IdentifierArray<T = unknown> {
54
- DEPRECATED_CLASS_NAME: string;
55
- /**
56
- The flag to signal a `RecordArray` is currently loading data.
57
- Example
58
- ```javascript
59
- let people = store.peekAll('person');
60
- people.isUpdating; // false
61
- people.update();
62
- people.isUpdating; // true
63
- ```
64
- @property isUpdating
65
- @public
66
- @type Boolean
67
- */
68
- isUpdating: boolean;
69
- isLoaded: boolean;
70
- isDestroying: boolean;
71
- isDestroyed: boolean;
72
- _updatingPromise: Promise<IdentifierArray<T>> | null;
73
- readonly identifier: StableDocumentIdentifier | null;
74
- [IS_COLLECTION]: boolean;
75
- [ARRAY_SIGNAL]: WarpDriveSignal;
76
- [SOURCE]: StableRecordIdentifier[];
77
- links: Links | PaginationLinks | null;
78
- meta: Record<string, unknown> | null;
79
- modelName?: TypeFromInstanceOrString<T>;
80
- /**
81
- The store that created this record array.
82
-
83
- @property store
84
- @private
85
- @type Store
86
- */
87
- store: Store;
88
- _manager: MinimumManager;
89
- destroy(clear: boolean): void;
90
- constructor(options: IdentifierArrayCreateOptions<T>);
91
- /**
92
- Used to get the latest version of all of the records in this array
93
- from the adapter.
94
-
95
- Example
96
-
97
- ```javascript
98
- let people = store.peekAll('person');
99
- people.isUpdating; // false
100
-
101
- people.update().then(function() {
102
- people.isUpdating; // false
103
- });
104
-
105
- people.isUpdating; // true
106
- ```
107
-
108
- @public
109
- */
110
- update(): Promise<IdentifierArray<T>>;
111
- _update(): Promise<IdentifierArray<T>>;
112
- /**
113
- Saves all of the records in the `RecordArray`.
114
-
115
- Example
116
-
117
- ```javascript
118
- let messages = store.peekAll('message');
119
- messages.forEach(function(message) {
120
- message.hasBeenSeen = true;
121
- });
122
- messages.save();
123
- ```
124
-
125
- @public
126
- @return {Promise<IdentifierArray>} promise
127
- */
128
- save(): Promise<IdentifierArray>;
57
+ DEPRECATED_CLASS_NAME: string;
58
+ /**
59
+ The flag to signal a `RecordArray` is currently loading data.
60
+ Example
61
+ ```javascript
62
+ let people = store.peekAll('person');
63
+ people.isUpdating; // false
64
+ people.update();
65
+ people.isUpdating; // true
66
+ ```
67
+ @property isUpdating
68
+ @public
69
+ @type Boolean
70
+ */
71
+ isUpdating: boolean;
72
+ isLoaded: boolean;
73
+ isDestroying: boolean;
74
+ isDestroyed: boolean;
75
+ _updatingPromise: Promise<IdentifierArray<T>> | null;
76
+ readonly identifier: StableDocumentIdentifier | null;
77
+ links: Links | PaginationLinks | null;
78
+ meta: Record<string, unknown> | null;
79
+ modelName?: TypeFromInstanceOrString<T>;
80
+ /**
81
+ The store that created this record array.
82
+
83
+ @property store
84
+ @private
85
+ @type Store
86
+ */
87
+ store: Store;
88
+ _manager: MinimumManager;
89
+ destroy(clear: boolean): void;
90
+ constructor(options: IdentifierArrayCreateOptions<T>);
91
+ /**
92
+ Used to get the latest version of all of the records in this array
93
+ from the adapter.
94
+
95
+ Example
96
+
97
+ ```javascript
98
+ let people = store.peekAll('person');
99
+ people.isUpdating; // false
100
+
101
+ people.update().then(function() {
102
+ people.isUpdating; // false
103
+ });
104
+
105
+ people.isUpdating; // true
106
+ ```
107
+
108
+ @public
109
+ */
110
+ update(): Promise<IdentifierArray<T>>;
111
+ /*
112
+ Update this Array and return a promise which resolves once the update
113
+ is finished.
114
+ */
115
+ _update(): Promise<IdentifierArray<T>>;
116
+ // TODO deprecate
117
+ /**
118
+ Saves all of the records in the `RecordArray`.
119
+
120
+ Example
121
+
122
+ ```javascript
123
+ let messages = store.peekAll('message');
124
+ messages.forEach(function(message) {
125
+ message.hasBeenSeen = true;
126
+ });
127
+ messages.save();
128
+ ```
129
+
130
+ @public
131
+ @return {Promise<IdentifierArray>} promise
132
+ */
133
+ save(): Promise<IdentifierArray>;
129
134
  }
130
135
  export type CollectionCreateOptions = IdentifierArrayCreateOptions & {
131
- manager: RecordArrayManager;
132
- query: ImmutableRequestInfo | Record<string, unknown> | null;
133
- isLoaded: boolean;
136
+ manager: RecordArrayManager;
137
+ query: ImmutableRequestInfo | Record<string, unknown> | null;
138
+ isLoaded: boolean;
134
139
  };
135
140
  export declare class Collection<T = unknown> extends IdentifierArray<T> {
136
- query: ImmutableRequestInfo | Record<string, unknown> | null;
137
- _manager: RecordArrayManager;
138
- constructor(options: CollectionCreateOptions);
139
- _update(): Promise<Collection<T>>;
140
- destroy(clear: boolean): void;
141
+ query: ImmutableRequestInfo | Record<string, unknown> | null;
142
+ _manager: RecordArrayManager;
143
+ constructor(options: CollectionCreateOptions);
144
+ _update(): Promise<Collection<T>>;
145
+ destroy(clear: boolean): void;
141
146
  }
142
147
  export {};
143
- //# sourceMappingURL=identifier-array.d.ts.map
@@ -1,201 +1,197 @@
1
- import type { BaseFinderOptions, ModelSchema, StableRecordIdentifier } from '../../../types.ts';
2
- import type { Cache } from '../../../types/cache.ts';
3
- import type { TypedRecordInstance, TypeFromInstance, TypeFromInstanceOrString } from '../../../types/record.ts';
4
- import type { LegacyHasManyField, LinksModeHasManyField } from '../../../types/schema/fields.ts';
5
- import type { Links, PaginationLinks } from '../../../types/spec/json-api-raw.ts';
6
- import { type WarpDriveSignal } from '../new-core-tmp/reactivity/internal.ts';
7
- import type { CreateRecordProperties, Store } from '../store-service.ts';
8
- import type { MinimumManager } from './identifier-array.ts';
9
- import { IdentifierArray, MUTATE } from './identifier-array.ts';
10
- import type { NativeProxy } from './native-proxy-type-fix.ts';
1
+ import type { BaseFinderOptions, ModelSchema, StableRecordIdentifier } from "../../../types.js";
2
+ import type { Cache } from "../../../types/cache.js";
3
+ import type { TypedRecordInstance, TypeFromInstance, TypeFromInstanceOrString } from "../../../types/record.js";
4
+ import type { LegacyHasManyField, LinksModeHasManyField } from "../../../types/schema/fields.js";
5
+ import type { Links, PaginationLinks } from "../../../types/spec/json-api-raw.js";
6
+ import type { CreateRecordProperties, Store } from "../store-service.js";
7
+ import type { MinimumManager } from "./identifier-array.js";
8
+ import { IdentifierArray } from "./identifier-array.js";
11
9
  export interface ManyArrayCreateArgs<T> {
12
- identifiers: StableRecordIdentifier<TypeFromInstanceOrString<T>>[];
13
- type: TypeFromInstanceOrString<T>;
14
- store: Store;
15
- allowMutation: boolean;
16
- manager: MinimumManager;
17
- field?: LegacyHasManyField | LinksModeHasManyField;
18
- identifier: StableRecordIdentifier;
19
- cache: Cache;
20
- meta: Record<string, unknown> | null;
21
- links: Links | PaginationLinks | null;
22
- key: string;
23
- isPolymorphic: boolean;
24
- isAsync: boolean;
25
- _inverseIsAsync: boolean;
26
- isLoaded: boolean;
10
+ identifiers: StableRecordIdentifier<TypeFromInstanceOrString<T>>[];
11
+ type: TypeFromInstanceOrString<T>;
12
+ store: Store;
13
+ allowMutation: boolean;
14
+ manager: MinimumManager;
15
+ field?: LegacyHasManyField | LinksModeHasManyField;
16
+ identifier: StableRecordIdentifier;
17
+ cache: Cache;
18
+ meta: Record<string, unknown> | null;
19
+ links: Links | PaginationLinks | null;
20
+ key: string;
21
+ isPolymorphic: boolean;
22
+ isAsync: boolean;
23
+ _inverseIsAsync: boolean;
24
+ isLoaded: boolean;
27
25
  }
28
26
  /**
29
- A `ManyArray` is a `MutableArray` that represents the contents of a has-many
30
- relationship.
27
+ A `ManyArray` is a `MutableArray` that represents the contents of a has-many
28
+ relationship.
31
29
 
32
- The `ManyArray` is instantiated lazily the first time the relationship is
33
- requested.
30
+ The `ManyArray` is instantiated lazily the first time the relationship is
31
+ requested.
34
32
 
35
- This class is not intended to be directly instantiated by consuming applications.
33
+ This class is not intended to be directly instantiated by consuming applications.
36
34
 
37
- ### Inverses
35
+ ### Inverses
38
36
 
39
- Often, the relationships in Ember Data applications will have
40
- an inverse. For example, imagine the following models are
41
- defined:
37
+ Often, the relationships in Ember Data applications will have
38
+ an inverse. For example, imagine the following models are
39
+ defined:
42
40
 
43
- ```js [app/models/post.js]
44
- import Model, { hasMany } from '@ember-data/model';
41
+ ```js [app/models/post.js]
42
+ import Model, { hasMany } from '@ember-data/model';
45
43
 
46
- export default class PostModel extends Model {
47
- @hasMany('comment') comments;
48
- }
49
- ```
44
+ export default class PostModel extends Model {
45
+ @hasMany('comment') comments;
46
+ }
47
+ ```
50
48
 
51
- ```js [app/models/comment.js]
52
- import { Model, belongsTo } from '@warp-drive/legacy/model';
49
+ ```js [app/models/comment.js]
50
+ import { Model, belongsTo } from '@warp-drive/legacy/model';
53
51
 
54
- export default class CommentModel extends Model {
55
- @belongsTo('post') post;
56
- }
57
- ```
52
+ export default class CommentModel extends Model {
53
+ @belongsTo('post') post;
54
+ }
55
+ ```
58
56
 
59
- If you created a new instance of `Post` and added
60
- a `Comment` record to its `comments` has-many
61
- relationship, you would expect the comment's `post`
62
- property to be set to the post that contained
63
- the has-many.
57
+ If you created a new instance of `Post` and added
58
+ a `Comment` record to its `comments` has-many
59
+ relationship, you would expect the comment's `post`
60
+ property to be set to the post that contained
61
+ the has-many.
64
62
 
65
- We call the record to which a relationship belongs-to the
66
- relationship's _owner_.
63
+ We call the record to which a relationship belongs-to the
64
+ relationship's _owner_.
67
65
 
68
- @class ManyArray
69
- @public
66
+ @class ManyArray
67
+ @public
70
68
  */
71
69
  export declare class RelatedCollection<T = unknown> extends IdentifierArray<T> {
72
- isAsync: boolean;
73
- /**
74
- The loading state of this array
75
-
76
- @property isLoaded
77
- @type {Boolean}
78
- @public
79
- */
80
- isLoaded: boolean;
81
- /**
82
- `true` if the relationship is polymorphic, `false` otherwise.
83
-
84
- @property isPolymorphic
85
- @type {Boolean}
86
- @private
87
- */
88
- isPolymorphic: boolean;
89
- _inverseIsAsync: boolean;
90
- /**
91
- Metadata associated with the request for async hasMany relationships.
92
-
93
- Example
94
-
95
- Given that the server returns the following JSON payload when fetching a
96
- hasMany relationship:
97
-
98
- ```js
99
- {
100
- "comments": [{
101
- "id": 1,
102
- "comment": "This is the first comment",
103
- }, {
104
- // ...
105
- }],
106
-
107
- "meta": {
108
- "page": 1,
109
- "total": 5
110
- }
111
- }
112
- ```
113
-
114
- You can then access the meta data via the `meta` property:
115
-
116
- ```js
117
- let comments = await post.comments;
118
- let meta = comments.meta;
119
-
120
- // meta.page => 1
121
- // meta.total => 5
122
- ```
123
-
124
- @property meta
125
- @type {Object | null}
126
- @public
127
- */
128
- meta: Record<string, unknown> | null;
129
- /**
130
- * Retrieve the links for this relationship
131
- *
132
- @property links
133
- @type {Object | null}
134
- @public
135
- */
136
- links: Links | PaginationLinks | null;
137
- identifier: StableRecordIdentifier;
138
- cache: Cache;
139
- _manager: MinimumManager;
140
- store: Store;
141
- key: string;
142
- type: ModelSchema;
143
- modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
144
- constructor(options: ManyArrayCreateArgs<T>);
145
- [MUTATE](target: StableRecordIdentifier[], receiver: typeof NativeProxy<StableRecordIdentifier[], T[]>, prop: string, args: unknown[], _SIGNAL: WarpDriveSignal): unknown;
146
- notify(): void;
147
- /**
148
- Reloads all of the records in the manyArray. If the manyArray
149
- holds a relationship that was originally fetched using a links url
150
- WarpDrive will revisit the original links url to repopulate the
151
- relationship.
152
-
153
- If the ManyArray holds the result of a `store.query()` reload will
154
- re-run the original query.
155
-
156
- Example
157
-
158
- ```javascript
159
- let user = store.peekRecord('user', '1')
160
- await login(user);
161
-
162
- let permissions = await user.permissions;
163
- await permissions.reload();
164
- ```
165
-
166
- @public
167
- */
168
- reload(options?: BaseFinderOptions): Promise<this>;
169
- /**
170
- Create a child record within the owner
171
-
172
- @public
173
- @param {Object} hash
174
- @return {Model} record
175
- */
176
- createRecord(hash: CreateRecordProperties<T>): T;
177
- /**
178
- Saves all of the records in the `ManyArray`.
179
-
180
- Note: this API can only be used in legacy mode with a configured Adapter.
181
-
182
- Example
183
-
184
- ```javascript
185
- const { content: { data: inbox } } = await store.request(findRecord({ type: 'inbox', id: '1' }));
186
-
187
- let messages = await inbox.messages;
188
- messages.forEach((message) => {
189
- message.isRead = true;
190
- });
191
- messages.save();
192
- ```
193
-
194
- @public
195
- @return {PromiseArray} promise
196
- */
197
- save: () => Promise<IdentifierArray<T>>;
198
- /** @internal */
199
- destroy(): void;
70
+ isAsync: boolean;
71
+ /**
72
+ The loading state of this array
73
+
74
+ @property isLoaded
75
+ @type {Boolean}
76
+ @public
77
+ */
78
+ isLoaded: boolean;
79
+ /**
80
+ `true` if the relationship is polymorphic, `false` otherwise.
81
+
82
+ @property isPolymorphic
83
+ @type {Boolean}
84
+ @private
85
+ */
86
+ isPolymorphic: boolean;
87
+ _inverseIsAsync: boolean;
88
+ /**
89
+ Metadata associated with the request for async hasMany relationships.
90
+
91
+ Example
92
+
93
+ Given that the server returns the following JSON payload when fetching a
94
+ hasMany relationship:
95
+
96
+ ```js
97
+ {
98
+ "comments": [{
99
+ "id": 1,
100
+ "comment": "This is the first comment",
101
+ }, {
102
+ // ...
103
+ }],
104
+
105
+ "meta": {
106
+ "page": 1,
107
+ "total": 5
108
+ }
109
+ }
110
+ ```
111
+
112
+ You can then access the meta data via the `meta` property:
113
+
114
+ ```js
115
+ let comments = await post.comments;
116
+ let meta = comments.meta;
117
+
118
+ // meta.page => 1
119
+ // meta.total => 5
120
+ ```
121
+
122
+ @property meta
123
+ @type {Object | null}
124
+ @public
125
+ */
126
+ meta: Record<string, unknown> | null;
127
+ /**
128
+ * Retrieve the links for this relationship
129
+ *
130
+ @property links
131
+ @type {Object | null}
132
+ @public
133
+ */
134
+ links: Links | PaginationLinks | null;
135
+ identifier: StableRecordIdentifier;
136
+ cache: Cache;
137
+ _manager: MinimumManager;
138
+ store: Store;
139
+ key: string;
140
+ type: ModelSchema;
141
+ modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
142
+ constructor(options: ManyArrayCreateArgs<T>);
143
+ notify(): void;
144
+ /**
145
+ Reloads all of the records in the manyArray. If the manyArray
146
+ holds a relationship that was originally fetched using a links url
147
+ WarpDrive will revisit the original links url to repopulate the
148
+ relationship.
149
+
150
+ If the ManyArray holds the result of a `store.query()` reload will
151
+ re-run the original query.
152
+
153
+ Example
154
+
155
+ ```javascript
156
+ let user = store.peekRecord('user', '1')
157
+ await login(user);
158
+
159
+ let permissions = await user.permissions;
160
+ await permissions.reload();
161
+ ```
162
+
163
+ @public
164
+ */
165
+ reload(options?: BaseFinderOptions): Promise<this>;
166
+ /**
167
+ Create a child record within the owner
168
+
169
+ @public
170
+ @param {Object} hash
171
+ @return {Model} record
172
+ */
173
+ createRecord(hash: CreateRecordProperties<T>): T;
174
+ /**
175
+ Saves all of the records in the `ManyArray`.
176
+
177
+ Note: this API can only be used in legacy mode with a configured Adapter.
178
+
179
+ Example
180
+
181
+ ```javascript
182
+ const { content: { data: inbox } } = await store.request(findRecord({ type: 'inbox', id: '1' }));
183
+
184
+ let messages = await inbox.messages;
185
+ messages.forEach((message) => {
186
+ message.isRead = true;
187
+ });
188
+ messages.save();
189
+ ```
190
+
191
+ @public
192
+ @return {PromiseArray} promise
193
+ */
194
+ save: () => Promise<IdentifierArray<T>>;
195
+ /** @internal */
196
+ destroy(): void;
200
197
  }
201
- //# sourceMappingURL=many-array.d.ts.map