@ember-data/store 5.4.0-alpha.32 → 5.4.0-alpha.33

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 (35) hide show
  1. package/package.json +9 -9
  2. package/unstable-preview-types/-private/cache-handler.d.ts +101 -99
  3. package/unstable-preview-types/-private/caches/cache-utils.d.ts +11 -9
  4. package/unstable-preview-types/-private/caches/identifier-cache.d.ts +181 -179
  5. package/unstable-preview-types/-private/caches/instance-cache.d.ts +63 -61
  6. package/unstable-preview-types/-private/caches/resource-utils.d.ts +12 -10
  7. package/unstable-preview-types/-private/document.d.ts +146 -144
  8. package/unstable-preview-types/-private/index.d.ts +18 -16
  9. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +178 -176
  10. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +19 -17
  11. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +29 -27
  12. package/unstable-preview-types/-private/managers/cache-manager.d.ts +442 -440
  13. package/unstable-preview-types/-private/managers/notification-manager.d.ts +98 -96
  14. package/unstable-preview-types/-private/managers/record-array-manager.d.ts +97 -95
  15. package/unstable-preview-types/-private/network/request-cache.d.ts +109 -107
  16. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +134 -132
  17. package/unstable-preview-types/-private/store-service.d.ts +1503 -1501
  18. package/unstable-preview-types/-private/utils/coerce-id.d.ts +10 -8
  19. package/unstable-preview-types/-private/utils/construct-resource.d.ts +10 -8
  20. package/unstable-preview-types/-private/utils/identifier-debug-consts.d.ts +7 -5
  21. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +4 -2
  22. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +4 -2
  23. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +4 -2
  24. package/unstable-preview-types/-private.d.ts +4 -2
  25. package/unstable-preview-types/-types/overview.d.ts +21 -19
  26. package/unstable-preview-types/-types/q/cache-store-wrapper.d.ts +107 -105
  27. package/unstable-preview-types/-types/q/cache.d.ts +47 -45
  28. package/unstable-preview-types/-types/q/ds-model.d.ts +15 -13
  29. package/unstable-preview-types/-types/q/identifier.d.ts +169 -167
  30. package/unstable-preview-types/-types/q/promise-proxies.d.ts +4 -2
  31. package/unstable-preview-types/-types/q/record-data-json-api.d.ts +36 -34
  32. package/unstable-preview-types/-types/q/record-instance.d.ts +29 -27
  33. package/unstable-preview-types/-types/q/schema-service.d.ts +214 -212
  34. package/unstable-preview-types/-types/q/store.d.ts +17 -15
  35. package/unstable-preview-types/index.d.ts +220 -185
@@ -1,135 +1,137 @@
1
- import type { Signal } from '@ember-data/tracking/-private';
2
- import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
3
- import type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';
4
- import type { ImmutableRequestInfo } from '@warp-drive/core-types/request';
5
- import type { Links, PaginationLinks } from '@warp-drive/core-types/spec/raw';
6
- import type RecordArrayManager from '../managers/record-array-manager';
7
- import type Store from '../store-service';
8
- export declare const ARRAY_SIGNAL: unique symbol;
9
- export declare const SOURCE: unique symbol;
10
- export declare const MUTATE: unique symbol;
11
- export declare const NOTIFY: unique symbol;
12
- declare const IS_COLLECTION: unique symbol;
13
- export declare function notifyArray(arr: IdentifierArray): void;
14
- declare global {
15
- interface ProxyConstructor {
16
- new <TSource extends object, TTarget extends object>(target: TSource, handler: ProxyHandler<TSource>): TTarget;
17
- }
18
- }
19
- export type IdentifierArrayCreateOptions<T = unknown> = {
20
- identifiers: StableRecordIdentifier[];
21
- type?: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
22
- store: Store;
23
- allowMutation: boolean;
24
- manager: RecordArrayManager;
25
- links?: Links | PaginationLinks | null;
26
- meta?: Record<string, unknown> | null;
27
- };
28
- /**
29
- A record array is an array that contains records of a certain type (or modelName).
30
- The record array materializes records as needed when they are retrieved for the first
31
- time. You should not create record arrays yourself. Instead, an instance of
32
- `RecordArray` or its subclasses will be returned by your application's store
33
- in response to queries.
34
-
35
- This class should not be imported and instantiated by consuming applications.
36
-
37
- @class RecordArray
38
- @public
39
- */
40
- interface IdentifierArray<T = unknown> extends Omit<Array<T>, '[]'> {
41
- [MUTATE]?(target: StableRecordIdentifier[], receiver: typeof Proxy<StableRecordIdentifier[], T[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
42
- }
43
- declare class IdentifierArray<T = unknown> {
44
- DEPRECATED_CLASS_NAME: string;
45
- /**
46
- The flag to signal a `RecordArray` is currently loading data.
47
- Example
48
- ```javascript
49
- let people = store.peekAll('person');
50
- people.isUpdating; // false
51
- people.update();
52
- people.isUpdating; // true
53
- ```
54
- @property isUpdating
55
- @public
56
- @type Boolean
57
- */
58
- isUpdating: boolean;
59
- isLoaded: boolean;
60
- isDestroying: boolean;
61
- isDestroyed: boolean;
62
- _updatingPromise: Promise<IdentifierArray<T>> | null;
63
- [IS_COLLECTION]: boolean;
64
- [ARRAY_SIGNAL]: Signal;
65
- [SOURCE]: StableRecordIdentifier[];
66
- [NOTIFY](): void;
67
- links: Links | PaginationLinks | null;
68
- meta: Record<string, unknown> | null;
69
- modelName?: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
70
- /**
71
- The store that created this record array.
1
+ declare module '@ember-data/store/-private/record-arrays/identifier-array' {
2
+ import type { Signal } from '@ember-data/tracking/-private';
3
+ import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
4
+ import type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';
5
+ import type { ImmutableRequestInfo } from '@warp-drive/core-types/request';
6
+ import type { Links, PaginationLinks } from '@warp-drive/core-types/spec/raw';
7
+ import type RecordArrayManager from '@ember-data/store/-private/managers/record-array-manager';
8
+ import type Store from '@ember-data/store/-private/store-service';
9
+ export declare const ARRAY_SIGNAL: unique symbol;
10
+ export declare const SOURCE: unique symbol;
11
+ export declare const MUTATE: unique symbol;
12
+ export declare const NOTIFY: unique symbol;
13
+ declare const IS_COLLECTION: unique symbol;
14
+ export declare function notifyArray(arr: IdentifierArray): void;
15
+ declare global {
16
+ interface ProxyConstructor {
17
+ new <TSource extends object, TTarget extends object>(target: TSource, handler: ProxyHandler<TSource>): TTarget;
18
+ }
19
+ }
20
+ export type IdentifierArrayCreateOptions<T = unknown> = {
21
+ identifiers: StableRecordIdentifier[];
22
+ type?: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
23
+ store: Store;
24
+ allowMutation: boolean;
25
+ manager: RecordArrayManager;
26
+ links?: Links | PaginationLinks | null;
27
+ meta?: Record<string, unknown> | null;
28
+ };
29
+ /**
30
+ A record array is an array that contains records of a certain type (or modelName).
31
+ The record array materializes records as needed when they are retrieved for the first
32
+ time. You should not create record arrays yourself. Instead, an instance of
33
+ `RecordArray` or its subclasses will be returned by your application's store
34
+ in response to queries.
72
35
 
73
- @property store
74
- @private
75
- @type Store
76
- */
77
- store: Store;
78
- _manager: RecordArrayManager;
79
- destroy(clear: boolean): void;
80
- get length(): number;
81
- set length(value: number);
82
- constructor(options: IdentifierArrayCreateOptions<T>);
83
- /**
84
- Used to get the latest version of all of the records in this array
85
- from the adapter.
86
-
87
- Example
88
-
89
- ```javascript
90
- let people = store.peekAll('person');
91
- people.isUpdating; // false
36
+ This class should not be imported and instantiated by consuming applications.
92
37
 
93
- people.update().then(function() {
38
+ @class RecordArray
39
+ @public
40
+ */
41
+ interface IdentifierArray<T = unknown> extends Omit<Array<T>, '[]'> {
42
+ [MUTATE]?(target: StableRecordIdentifier[], receiver: typeof Proxy<StableRecordIdentifier[], T[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
43
+ }
44
+ declare class IdentifierArray<T = unknown> {
45
+ DEPRECATED_CLASS_NAME: string;
46
+ /**
47
+ The flag to signal a `RecordArray` is currently loading data.
48
+ Example
49
+ ```javascript
50
+ let people = store.peekAll('person');
94
51
  people.isUpdating; // false
95
- });
96
-
97
- people.isUpdating; // true
98
- ```
99
-
100
- @method update
101
- @public
102
- */
103
- update(): Promise<IdentifierArray<T>>;
104
- _update(): Promise<IdentifierArray<T>>;
105
- /**
106
- Saves all of the records in the `RecordArray`.
107
-
108
- Example
109
-
110
- ```javascript
111
- let messages = store.peekAll('message');
112
- messages.forEach(function(message) {
113
- message.hasBeenSeen = true;
114
- });
115
- messages.save();
116
- ```
117
-
118
- @method save
119
- @public
120
- @return {Promise<IdentifierArray>} promise
121
- */
122
- save(): Promise<IdentifierArray>;
123
- }
124
- export default IdentifierArray;
125
- export type CollectionCreateOptions = IdentifierArrayCreateOptions & {
126
- query: ImmutableRequestInfo | Record<string, unknown> | null;
127
- isLoaded: boolean;
128
- };
129
- export declare class Collection<T = unknown> extends IdentifierArray<T> {
130
- query: ImmutableRequestInfo | Record<string, unknown> | null;
131
- constructor(options: CollectionCreateOptions);
132
- _update(): Promise<Collection<T>>;
133
- destroy(clear: boolean): void;
134
- }
135
- //# sourceMappingURL=identifier-array.d.ts.map
52
+ people.update();
53
+ people.isUpdating; // true
54
+ ```
55
+ @property isUpdating
56
+ @public
57
+ @type Boolean
58
+ */
59
+ isUpdating: boolean;
60
+ isLoaded: boolean;
61
+ isDestroying: boolean;
62
+ isDestroyed: boolean;
63
+ _updatingPromise: Promise<IdentifierArray<T>> | null;
64
+ [IS_COLLECTION]: boolean;
65
+ [ARRAY_SIGNAL]: Signal;
66
+ [SOURCE]: StableRecordIdentifier[];
67
+ [NOTIFY](): void;
68
+ links: Links | PaginationLinks | null;
69
+ meta: Record<string, unknown> | null;
70
+ modelName?: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
71
+ /**
72
+ The store that created this record array.
73
+
74
+ @property store
75
+ @private
76
+ @type Store
77
+ */
78
+ store: Store;
79
+ _manager: RecordArrayManager;
80
+ destroy(clear: boolean): void;
81
+ get length(): number;
82
+ set length(value: number);
83
+ constructor(options: IdentifierArrayCreateOptions<T>);
84
+ /**
85
+ Used to get the latest version of all of the records in this array
86
+ from the adapter.
87
+
88
+ Example
89
+
90
+ ```javascript
91
+ let people = store.peekAll('person');
92
+ people.isUpdating; // false
93
+
94
+ people.update().then(function() {
95
+ people.isUpdating; // false
96
+ });
97
+
98
+ people.isUpdating; // true
99
+ ```
100
+
101
+ @method update
102
+ @public
103
+ */
104
+ update(): Promise<IdentifierArray<T>>;
105
+ _update(): Promise<IdentifierArray<T>>;
106
+ /**
107
+ Saves all of the records in the `RecordArray`.
108
+
109
+ Example
110
+
111
+ ```javascript
112
+ let messages = store.peekAll('message');
113
+ messages.forEach(function(message) {
114
+ message.hasBeenSeen = true;
115
+ });
116
+ messages.save();
117
+ ```
118
+
119
+ @method save
120
+ @public
121
+ @return {Promise<IdentifierArray>} promise
122
+ */
123
+ save(): Promise<IdentifierArray>;
124
+ }
125
+ export default IdentifierArray;
126
+ export type CollectionCreateOptions = IdentifierArrayCreateOptions & {
127
+ query: ImmutableRequestInfo | Record<string, unknown> | null;
128
+ isLoaded: boolean;
129
+ };
130
+ export declare class Collection<T = unknown> extends IdentifierArray<T> {
131
+ query: ImmutableRequestInfo | Record<string, unknown> | null;
132
+ constructor(options: CollectionCreateOptions);
133
+ _update(): Promise<Collection<T>>;
134
+ destroy(clear: boolean): void;
135
+ }
136
+ //# sourceMappingURL=identifier-array.d.ts.map
137
+ }