@ember-data/store 5.4.0-alpha.32 → 5.4.0-alpha.34
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/addon/-private.js +1 -1
- package/addon/{cache-handler-oB00-31L.js → cache-handler-k7I5KvcC.js} +11 -1
- package/addon/cache-handler-k7I5KvcC.js.map +1 -0
- package/addon/index.js +1 -1
- package/package.json +9 -9
- package/unstable-preview-types/-private/cache-handler.d.ts +99 -97
- package/unstable-preview-types/-private/caches/cache-utils.d.ts +10 -8
- package/unstable-preview-types/-private/caches/identifier-cache.d.ts +179 -177
- package/unstable-preview-types/-private/caches/instance-cache.d.ts +61 -59
- package/unstable-preview-types/-private/caches/resource-utils.d.ts +11 -9
- package/unstable-preview-types/-private/document.d.ts +144 -142
- package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +176 -174
- package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +17 -15
- package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +27 -25
- package/unstable-preview-types/-private/managers/cache-manager.d.ts +440 -438
- package/unstable-preview-types/-private/managers/notification-manager.d.ts +96 -94
- package/unstable-preview-types/-private/managers/record-array-manager.d.ts +95 -93
- package/unstable-preview-types/-private/network/request-cache.d.ts +107 -105
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +128 -130
- package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +1 -1
- package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +118 -0
- package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts.map +1 -0
- package/unstable-preview-types/-private/store-service.d.ts +1501 -1499
- package/unstable-preview-types/-private/utils/coerce-id.d.ts +9 -7
- package/unstable-preview-types/-private/utils/construct-resource.d.ts +9 -7
- package/unstable-preview-types/-private/utils/identifier-debug-consts.d.ts +6 -4
- package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +3 -1
- package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +3 -1
- package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +3 -1
- package/unstable-preview-types/-private.d.ts +18 -1
- package/unstable-preview-types/-private.d.ts.map +1 -1
- package/unstable-preview-types/-types/overview.d.ts +20 -18
- package/unstable-preview-types/-types/q/cache-store-wrapper.d.ts +105 -103
- package/unstable-preview-types/-types/q/cache.d.ts +45 -43
- package/unstable-preview-types/-types/q/ds-model.d.ts +13 -11
- package/unstable-preview-types/-types/q/identifier.d.ts +167 -165
- package/unstable-preview-types/-types/q/promise-proxies.d.ts +3 -1
- package/unstable-preview-types/-types/q/record-data-json-api.d.ts +34 -32
- package/unstable-preview-types/-types/q/record-instance.d.ts +28 -26
- package/unstable-preview-types/-types/q/schema-service.d.ts +212 -210
- package/unstable-preview-types/-types/q/store.d.ts +15 -13
- package/unstable-preview-types/index.d.ts +219 -184
- package/addon/cache-handler-oB00-31L.js.map +0 -1
- package/unstable-preview-types/-private/index.d.ts +0 -16
- package/unstable-preview-types/-private/index.d.ts.map +0 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
1
|
+
declare module '@ember-data/store/-private/utils/coerce-id' {
|
|
2
|
+
/**
|
|
3
|
+
@module @ember-data/store
|
|
4
|
+
*/
|
|
5
|
+
type Coercable = string | number | boolean | null | undefined | symbol;
|
|
6
|
+
declare function coerceId(id: unknown): string | null;
|
|
7
|
+
export declare function ensureStringId(id: Coercable): string;
|
|
8
|
+
export default coerceId;
|
|
9
|
+
}
|
|
8
10
|
//# sourceMappingURL=coerce-id.d.ts.map
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare function constructResource(type:
|
|
4
|
-
declare function constructResource(type: string
|
|
5
|
-
declare function constructResource(type: string, id:
|
|
6
|
-
declare function constructResource(type: string, id
|
|
7
|
-
|
|
1
|
+
declare module '@ember-data/store/-private/utils/construct-resource' {
|
|
2
|
+
import type { ExistingResourceIdentifierObject, ResourceIdentifierObject } from '@warp-drive/core-types/spec/raw';
|
|
3
|
+
declare function constructResource(type: ResourceIdentifierObject): ResourceIdentifierObject;
|
|
4
|
+
declare function constructResource(type: string, id: string, lid: string): ExistingResourceIdentifierObject;
|
|
5
|
+
declare function constructResource(type: string | undefined, id: null | undefined, lid: string): ExistingResourceIdentifierObject;
|
|
6
|
+
declare function constructResource(type: string, id: string, lid?: string | null): ExistingResourceIdentifierObject;
|
|
7
|
+
declare function constructResource(type: string, id?: string | number | null, lid?: string | null): ResourceIdentifierObject;
|
|
8
|
+
export default constructResource;
|
|
9
|
+
}
|
|
8
10
|
//# sourceMappingURL=construct-resource.d.ts.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
1
|
+
declare module '@ember-data/store/-private/utils/identifier-debug-consts' {
|
|
2
|
+
export declare const DEBUG_CLIENT_ORIGINATED: unique symbol;
|
|
3
|
+
export declare const DEBUG_IDENTIFIER_BUCKET: unique symbol;
|
|
4
|
+
export declare const DEBUG_STALE_CACHE_OWNER: unique symbol;
|
|
5
|
+
export declare const CACHE_OWNER: unique symbol;
|
|
6
|
+
}
|
|
5
7
|
//# sourceMappingURL=identifier-debug-consts.d.ts.map
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
declare module '@ember-data/store/-private/utils/is-non-empty-string' {
|
|
2
|
+
export default function isNonEmptyString(str: unknown): str is string;
|
|
3
|
+
}
|
|
2
4
|
//# sourceMappingURL=is-non-empty-string.d.ts.map
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
declare module '@ember-data/store/-private' {
|
|
2
|
+
/**
|
|
3
|
+
@module @ember-data/store
|
|
4
|
+
*/
|
|
5
|
+
export { default as Store, storeFor } from '@ember-data/store/-private/store-service';
|
|
6
|
+
export { recordIdentifierFor } from '@ember-data/store/-private/caches/instance-cache';
|
|
7
|
+
export { CacheHandler, type LifetimesService } from '@ember-data/store/-private/cache-handler';
|
|
8
|
+
export { setIdentifierGenerationMethod, setIdentifierUpdateMethod, setIdentifierForgetMethod, setIdentifierResetMethod, isStableIdentifier, } from '@ember-data/store/-private/caches/identifier-cache';
|
|
9
|
+
export { default as coerceId } from '@ember-data/store/-private/utils/coerce-id';
|
|
10
|
+
export type { NativeProxy } from './-private/record-arrays/native-proxy-type-fix';
|
|
11
|
+
export { default as RecordArray, default as IdentifierArray, Collection as AdapterPopulatedRecordArray, notifyArray, SOURCE, MUTATE, ARRAY_SIGNAL, } from '@ember-data/store/-private/record-arrays/identifier-array';
|
|
12
|
+
export { default as RecordArrayManager, fastPush } from '@ember-data/store/-private/managers/record-array-manager';
|
|
13
|
+
export { _clearCaches } from '@ember-data/store/-private/caches/instance-cache';
|
|
14
|
+
export { default as peekCache, removeRecordDataFor } from '@ember-data/store/-private/caches/cache-utils';
|
|
15
|
+
export { setRecordIdentifier, StoreMap } from '@ember-data/store/-private/caches/instance-cache';
|
|
16
|
+
export { setCacheFor } from '@ember-data/store/-private/caches/cache-utils';
|
|
17
|
+
export { default as _deprecatingNormalize } from '@ember-data/store/-private/utils/normalize-model-name';
|
|
18
|
+
}
|
|
2
19
|
//# sourceMappingURL=-private.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"-private.d.ts","sourceRoot":"","sources":["../src/-private.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"-private.d.ts","sourceRoot":"","sources":["../src/-private.ts"],"names":[],"mappings":"AAAA;;EAEE;AAEF,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE/E,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,oCAAoC,CAAC;AAI5C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACjE,YAAY,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,OAAO,IAAI,eAAe,EAC1B,UAAU,IAAI,2BAA2B,EACzC,WAAW,EACX,MAAM,EACN,MAAM,EACN,YAAY,GACb,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AAGnG,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAG1F,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,uCAAuC,CAAC"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
declare module '@ember-data/store/-types/overview' {
|
|
2
|
+
export {};
|
|
3
|
+
/**
|
|
4
|
+
* Many parts of EmberData are interface-driven,
|
|
5
|
+
* meaning that no specific base-class is necessary
|
|
6
|
+
* to implement an interopable module of your own
|
|
7
|
+
* utilizing only public APIs.
|
|
8
|
+
*
|
|
9
|
+
* Examples of primitives in EmberData that are interface-driven
|
|
10
|
+
* include Adapters, Serializers, Request Handlers, and the Cache.
|
|
11
|
+
*
|
|
12
|
+
* These **Not Yet Installable** Typescript Types
|
|
13
|
+
* Document key interfaces that libraries and
|
|
14
|
+
* applications interfacing with EmberData would need
|
|
15
|
+
* to conform to.
|
|
16
|
+
*
|
|
17
|
+
@module @ember-data/experimental-preview-types
|
|
18
|
+
@main @ember-data/experimental-preview-types
|
|
19
|
+
*/
|
|
20
|
+
}
|
|
19
21
|
//# sourceMappingURL=overview.d.ts.map
|
|
@@ -1,105 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
1
|
+
declare module '@ember-data/store/-types/q/cache-store-wrapper' {
|
|
2
|
+
import type { StableDocumentIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
3
|
+
import type { IdentifierCache } from '@ember-data/store/-private/caches/identifier-cache';
|
|
4
|
+
import type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';
|
|
5
|
+
import type { SchemaService } from '@ember-data/store/-types/q/schema-service';
|
|
6
|
+
/**
|
|
7
|
+
@module @ember-data/store
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* CacheCapabilitiesManager provides encapsulated API access to the minimal
|
|
11
|
+
* subset of the Store's functionality that Cache implementations
|
|
12
|
+
* should interact with. It is provided to the Store's `createRecordDataFor`
|
|
13
|
+
* and `createCache` hooks.
|
|
14
|
+
*
|
|
15
|
+
* Cache implementations should not need more than this API provides.
|
|
16
|
+
*
|
|
17
|
+
* This class cannot be directly instantiated.
|
|
18
|
+
*
|
|
19
|
+
* @class CacheCapabilitiesManager
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export interface CacheCapabilitiesManager {
|
|
23
|
+
/**
|
|
24
|
+
* Provides access to the IdentifierCache instance
|
|
25
|
+
* for this Store instance.
|
|
26
|
+
*
|
|
27
|
+
* The IdentifierCache can be used to peek, generate or
|
|
28
|
+
* retrieve a stable unique identifier for any resource.
|
|
29
|
+
*
|
|
30
|
+
* @property {IdentifierCache} identifierCache
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
identifierCache: IdentifierCache;
|
|
34
|
+
/**
|
|
35
|
+
* Provides access to the SchemaService instance
|
|
36
|
+
* for this Store instance.
|
|
37
|
+
*
|
|
38
|
+
* The SchemaService can be used to query for
|
|
39
|
+
* information about the schema of a resource.
|
|
40
|
+
*
|
|
41
|
+
* @method getSchemaDefinitionService
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
getSchemaDefinitionService(): SchemaService;
|
|
45
|
+
/**
|
|
46
|
+
* Provides access to the SchemaService instance
|
|
47
|
+
* for this Store instance.
|
|
48
|
+
*
|
|
49
|
+
* The SchemaService can be used to query for
|
|
50
|
+
* information about the schema of a resource.
|
|
51
|
+
*
|
|
52
|
+
* @property schema
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
schema: SchemaService;
|
|
56
|
+
/**
|
|
57
|
+
* Update the `id` for the record corresponding to the identifier
|
|
58
|
+
* This operation can only be done for records whose `id` is `null`.
|
|
59
|
+
*
|
|
60
|
+
* @method setRecordId
|
|
61
|
+
* @param {StableRecordIdentifier} identifier;
|
|
62
|
+
* @param {string} id;
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
setRecordId(identifier: StableRecordIdentifier, id: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Signal to the store that the specified record may be considered fully
|
|
68
|
+
* removed from the cache. Generally this means that not only does no
|
|
69
|
+
* data exist for the identified resource, no known relationships still
|
|
70
|
+
* point to it either.
|
|
71
|
+
*
|
|
72
|
+
* @method disconnectRecord
|
|
73
|
+
* @param {StableRecordIdentifier} identifier
|
|
74
|
+
* @public
|
|
75
|
+
*/
|
|
76
|
+
disconnectRecord(identifier: StableRecordIdentifier): void;
|
|
77
|
+
/**
|
|
78
|
+
* Use this method to determine if the Store has an instantiated record associated
|
|
79
|
+
* with an identifier.
|
|
80
|
+
*
|
|
81
|
+
* @method hasRecord
|
|
82
|
+
* @param identifier
|
|
83
|
+
* @return {boolean}
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
hasRecord(identifier: StableRecordIdentifier): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Notify subscribers of the NotificationManager that cache state has changed.
|
|
89
|
+
*
|
|
90
|
+
* `attributes` and `relationships` do not require a key, but if one is specified it
|
|
91
|
+
* is assumed to be the name of the attribute or relationship that has been updated.
|
|
92
|
+
*
|
|
93
|
+
* No other namespaces currently expect the `key` argument.
|
|
94
|
+
*
|
|
95
|
+
* @method notifyChange
|
|
96
|
+
* @param {StableRecordIdentifier} identifier
|
|
97
|
+
* @param {'attributes' | 'relationships' | 'identity' | 'errors' | 'meta' | 'state'} namespace
|
|
98
|
+
* @param {string|undefined} key
|
|
99
|
+
* @public
|
|
100
|
+
*/
|
|
101
|
+
notifyChange(identifier: StableRecordIdentifier, namespace: 'added' | 'removed'): void;
|
|
102
|
+
notifyChange(identifier: StableDocumentIdentifier, namespace: 'added' | 'updated' | 'removed'): void;
|
|
103
|
+
notifyChange(identifier: StableRecordIdentifier, namespace: NotificationType, key?: string): void;
|
|
104
|
+
notifyChange(identifier: StableRecordIdentifier | StableDocumentIdentifier, namespace: NotificationType | 'added' | 'removed' | 'updated', key?: string): void;
|
|
105
|
+
}
|
|
104
106
|
}
|
|
105
107
|
//# sourceMappingURL=cache-store-wrapper.d.ts.map
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
declare module '@ember-data/store/-types/q/cache' {
|
|
2
|
+
import type { Cache, ChangedAttributesHash } from '@warp-drive/core-types/cache';
|
|
3
|
+
import type { RecordIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
4
|
+
import type { ApiError } from '@warp-drive/core-types/spec/error';
|
|
5
|
+
import type { CollectionResourceRelationship, SingleResourceRelationship } from '@warp-drive/core-types/spec/raw';
|
|
6
|
+
import type { JsonApiResource } from '@ember-data/store/-types/q/record-data-json-api';
|
|
7
|
+
/**
|
|
8
|
+
@module @ember-data/store
|
|
9
|
+
*/
|
|
10
|
+
export interface MergeOperation {
|
|
11
|
+
op: 'mergeIdentifiers';
|
|
12
|
+
record: StableRecordIdentifier;
|
|
13
|
+
value: StableRecordIdentifier;
|
|
14
|
+
}
|
|
15
|
+
export interface CacheV1 {
|
|
16
|
+
version?: '1';
|
|
17
|
+
getResourceIdentifier(): RecordIdentifier | undefined;
|
|
18
|
+
pushData(data: JsonApiResource, calculateChange: true): string[];
|
|
19
|
+
pushData(data: JsonApiResource, calculateChange?: false): void;
|
|
20
|
+
pushData(data: JsonApiResource, calculateChange?: boolean): string[] | void;
|
|
21
|
+
clientDidCreate(): void;
|
|
22
|
+
_initRecordCreateOptions(options?: Record<string, unknown>): Record<string, unknown>;
|
|
23
|
+
willCommit(): void;
|
|
24
|
+
didCommit(data: JsonApiResource | null): void;
|
|
25
|
+
commitWasRejected(recordIdentifier?: RecordIdentifier, errors?: ApiError[]): void;
|
|
26
|
+
unloadRecord(): void;
|
|
27
|
+
getAttr(key: string): unknown;
|
|
28
|
+
setDirtyAttribute(key: string, value: unknown): void;
|
|
29
|
+
changedAttributes(): ChangedAttributesHash;
|
|
30
|
+
hasChangedAttributes(): boolean;
|
|
31
|
+
rollbackAttributes(): string[];
|
|
32
|
+
getBelongsTo(key: string): SingleResourceRelationship;
|
|
33
|
+
getHasMany(key: string): CollectionResourceRelationship;
|
|
34
|
+
setDirtyBelongsTo(name: string, recordData: Cache | null): void;
|
|
35
|
+
setDirtyHasMany(key: string, recordDatas: Cache[]): void;
|
|
36
|
+
addToHasMany(key: string, recordDatas: Cache[], idx?: number): void;
|
|
37
|
+
removeFromHasMany(key: string, recordDatas: Cache[]): void;
|
|
38
|
+
setIsDeleted(isDeleted: boolean): void;
|
|
39
|
+
getErrors(identifier: StableRecordIdentifier): ApiError[];
|
|
40
|
+
isEmpty?(identifier: StableRecordIdentifier): boolean;
|
|
41
|
+
isNew(identifier: StableRecordIdentifier): boolean;
|
|
42
|
+
isDeleted(identifier: StableRecordIdentifier): boolean;
|
|
43
|
+
isDeletionCommitted(identifier: StableRecordIdentifier): boolean;
|
|
44
|
+
}
|
|
45
|
+
export type { Cache };
|
|
13
46
|
}
|
|
14
|
-
export interface CacheV1 {
|
|
15
|
-
version?: '1';
|
|
16
|
-
getResourceIdentifier(): RecordIdentifier | undefined;
|
|
17
|
-
pushData(data: JsonApiResource, calculateChange: true): string[];
|
|
18
|
-
pushData(data: JsonApiResource, calculateChange?: false): void;
|
|
19
|
-
pushData(data: JsonApiResource, calculateChange?: boolean): string[] | void;
|
|
20
|
-
clientDidCreate(): void;
|
|
21
|
-
_initRecordCreateOptions(options?: Record<string, unknown>): Record<string, unknown>;
|
|
22
|
-
willCommit(): void;
|
|
23
|
-
didCommit(data: JsonApiResource | null): void;
|
|
24
|
-
commitWasRejected(recordIdentifier?: RecordIdentifier, errors?: ApiError[]): void;
|
|
25
|
-
unloadRecord(): void;
|
|
26
|
-
getAttr(key: string): unknown;
|
|
27
|
-
setDirtyAttribute(key: string, value: unknown): void;
|
|
28
|
-
changedAttributes(): ChangedAttributesHash;
|
|
29
|
-
hasChangedAttributes(): boolean;
|
|
30
|
-
rollbackAttributes(): string[];
|
|
31
|
-
getBelongsTo(key: string): SingleResourceRelationship;
|
|
32
|
-
getHasMany(key: string): CollectionResourceRelationship;
|
|
33
|
-
setDirtyBelongsTo(name: string, recordData: Cache | null): void;
|
|
34
|
-
setDirtyHasMany(key: string, recordDatas: Cache[]): void;
|
|
35
|
-
addToHasMany(key: string, recordDatas: Cache[], idx?: number): void;
|
|
36
|
-
removeFromHasMany(key: string, recordDatas: Cache[]): void;
|
|
37
|
-
setIsDeleted(isDeleted: boolean): void;
|
|
38
|
-
getErrors(identifier: StableRecordIdentifier): ApiError[];
|
|
39
|
-
isEmpty?(identifier: StableRecordIdentifier): boolean;
|
|
40
|
-
isNew(identifier: StableRecordIdentifier): boolean;
|
|
41
|
-
isDeleted(identifier: StableRecordIdentifier): boolean;
|
|
42
|
-
isDeletionCommitted(identifier: StableRecordIdentifier): boolean;
|
|
43
|
-
}
|
|
44
|
-
export type { Cache };
|
|
45
47
|
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
declare module '@ember-data/store/-types/q/ds-model' {
|
|
2
|
+
import type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';
|
|
3
|
+
import type { AttributeSchema, RelationshipSchema } from '@warp-drive/core-types/schema';
|
|
4
|
+
export type KeyOrString<T> = keyof T & string extends never ? string : keyof T & string;
|
|
5
|
+
export interface ModelSchema<T = unknown> {
|
|
6
|
+
modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
|
|
7
|
+
fields: Map<KeyOrString<T>, 'attribute' | 'belongsTo' | 'hasMany'>;
|
|
8
|
+
attributes: Map<KeyOrString<T>, AttributeSchema>;
|
|
9
|
+
relationshipsByName: Map<KeyOrString<T>, RelationshipSchema>;
|
|
10
|
+
eachAttribute<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, attribute: AttributeSchema) => void, binding?: T): void;
|
|
11
|
+
eachRelationship<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, relationship: RelationshipSchema) => void, binding?: T): void;
|
|
12
|
+
eachTransformedAttribute<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, type: string | null) => void, binding?: T): void;
|
|
13
|
+
}
|
|
12
14
|
}
|
|
13
15
|
//# sourceMappingURL=ds-model.d.ts.map
|