@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.
- package/package.json +9 -9
- package/unstable-preview-types/-private/cache-handler.d.ts +101 -99
- package/unstable-preview-types/-private/caches/cache-utils.d.ts +11 -9
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts +181 -179
- package/unstable-preview-types/-private/caches/instance-cache.d.ts +63 -61
- package/unstable-preview-types/-private/caches/resource-utils.d.ts +12 -10
- package/unstable-preview-types/-private/document.d.ts +146 -144
- package/unstable-preview-types/-private/index.d.ts +18 -16
- package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +178 -176
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +19 -17
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +29 -27
- package/unstable-preview-types/-private/managers/cache-manager.d.ts +442 -440
- package/unstable-preview-types/-private/managers/notification-manager.d.ts +98 -96
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts +97 -95
- package/unstable-preview-types/-private/network/request-cache.d.ts +109 -107
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +134 -132
- package/unstable-preview-types/-private/store-service.d.ts +1503 -1501
- package/unstable-preview-types/-private/utils/coerce-id.d.ts +10 -8
- package/unstable-preview-types/-private/utils/construct-resource.d.ts +10 -8
- package/unstable-preview-types/-private/utils/identifier-debug-consts.d.ts +7 -5
- package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +4 -2
- package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +4 -2
- package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +4 -2
- package/unstable-preview-types/-private.d.ts +4 -2
- package/unstable-preview-types/-types/overview.d.ts +21 -19
- package/unstable-preview-types/-types/q/cache-store-wrapper.d.ts +107 -105
- package/unstable-preview-types/-types/q/cache.d.ts +47 -45
- package/unstable-preview-types/-types/q/ds-model.d.ts +15 -13
- package/unstable-preview-types/-types/q/identifier.d.ts +169 -167
- package/unstable-preview-types/-types/q/promise-proxies.d.ts +4 -2
- package/unstable-preview-types/-types/q/record-data-json-api.d.ts +36 -34
- package/unstable-preview-types/-types/q/record-instance.d.ts +29 -27
- package/unstable-preview-types/-types/q/schema-service.d.ts +214 -212
- package/unstable-preview-types/-types/q/store.d.ts +17 -15
- package/unstable-preview-types/index.d.ts +220 -185
|
@@ -1,135 +1,137 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type
|
|
7
|
-
import type
|
|
8
|
-
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
declare const
|
|
13
|
-
|
|
14
|
-
declare
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
+
}
|