@warp-drive/legacy 5.6.0-beta.1 → 5.6.0-beta.3

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 (59) hide show
  1. package/declarations/adapter/-private/build-url-mixin.d.ts +0 -13
  2. package/declarations/adapter/-private/utils/continue-on-reject.d.ts +1 -7
  3. package/declarations/adapter/-private/utils/serialize-query-params.d.ts +0 -4
  4. package/declarations/adapter/error.d.ts +2 -3
  5. package/declarations/adapter/rest.d.ts +0 -2
  6. package/declarations/adapter.d.ts +0 -5
  7. package/declarations/compat/builders/find-all.d.ts +2 -2
  8. package/declarations/compat/builders/query.d.ts +2 -2
  9. package/declarations/compat/builders/save-record.d.ts +3 -3
  10. package/declarations/compat/legacy-network-handler/fetch-manager.d.ts +24 -17
  11. package/declarations/compat/legacy-network-handler/identifier-has-id.d.ts +2 -2
  12. package/declarations/compat/legacy-network-handler/legacy-data-fetch.d.ts +5 -5
  13. package/declarations/compat/legacy-network-handler/minimum-adapter-interface.d.ts +3 -8
  14. package/declarations/compat/legacy-network-handler/snapshot-record-array.d.ts +40 -18
  15. package/declarations/compat/legacy-network-handler/snapshot.d.ts +63 -44
  16. package/declarations/compat.d.ts +3 -6
  17. package/declarations/model/-private/attr.d.ts +1 -14
  18. package/declarations/model/-private/belongs-to.d.ts +0 -11
  19. package/declarations/model/-private/debug/assert-polymorphic-type.d.ts +2 -14
  20. package/declarations/model/-private/errors.d.ts +0 -6
  21. package/declarations/model/-private/has-many.d.ts +0 -4
  22. package/declarations/model/-private/hooks.d.ts +2 -2
  23. package/declarations/model/-private/legacy-relationships-support.d.ts +18 -27
  24. package/declarations/model/-private/model-for-mixin.d.ts +0 -16
  25. package/declarations/model/-private/model-methods.d.ts +3 -4
  26. package/declarations/model/-private/model.d.ts +14 -67
  27. package/declarations/model/-private/notify-changes.d.ts +2 -2
  28. package/declarations/model/-private/promise-belongs-to.d.ts +0 -6
  29. package/declarations/model/-private/promise-many-array.d.ts +0 -11
  30. package/declarations/model/-private/record-state.d.ts +2 -25
  31. package/declarations/model/-private/references/belongs-to.d.ts +6 -7
  32. package/declarations/model/-private/references/has-many.d.ts +6 -13
  33. package/declarations/model/-private/schema-provider.d.ts +6 -10
  34. package/declarations/model/-private.d.ts +2 -2
  35. package/declarations/model/migration-support.d.ts +11 -53
  36. package/declarations/model.d.ts +1 -1
  37. package/declarations/serializer/json-api.d.ts +0 -1
  38. package/declarations/serializer/json.d.ts +0 -1
  39. package/declarations/serializer/rest.d.ts +0 -1
  40. package/declarations/store/-private.d.ts +223 -0
  41. package/declarations/store.d.ts +3 -0
  42. package/dist/{-private-CKrP0ogQ.js → -private-8UmnAf9J.js} +169 -141
  43. package/dist/adapter/-private.js +1 -1
  44. package/dist/adapter/error.js +66 -0
  45. package/dist/adapter/json-api.js +1 -1
  46. package/dist/adapter/rest.js +2 -2
  47. package/dist/compat/-private.js +1 -1
  48. package/dist/compat/builders.js +4 -23
  49. package/dist/compat.js +7 -2
  50. package/dist/{errors-BX5wowuz.js → errors-8kD2mSe_.js} +66 -36
  51. package/dist/model/-private.js +1 -2
  52. package/dist/model/migration-support.js +96 -11
  53. package/dist/model.js +14 -11
  54. package/dist/{schema-provider-BdQhkT-Q.js → schema-provider-DQu4Rjco.js} +165 -60
  55. package/dist/{serialize-into-hash-Bp58npke.js → serialize-into-hash-CS0MIv4F.js} +2 -1
  56. package/dist/store.js +633 -0
  57. package/dist/util-Dul6TZts.js +35 -0
  58. package/dist/utils-Cqw9eRj5.js +23 -0
  59. package/package.json +15 -15
@@ -1,6 +1,6 @@
1
1
  import type { Store } from "@warp-drive/core";
2
2
  import type { SchemaService } from "@warp-drive/core/types";
3
- import type { RecordIdentifier, StableRecordIdentifier } from "@warp-drive/core/types/identifier";
3
+ import type { ResourceKey } from "@warp-drive/core/types/identifier";
4
4
  import type { ObjectValue } from "@warp-drive/core/types/json/raw";
5
5
  import type { Derivation, HashFn, Transformation } from "@warp-drive/core/types/schema/concepts";
6
6
  import type { ArrayField, DerivedField, GenericField, HashField, LegacyField, ObjectField, ObjectSchema, ResourceSchema } from "@warp-drive/core/types/schema/fields";
@@ -8,22 +8,19 @@ import type { ModelFactory, ModelStore } from "./model.js";
8
8
  type AttributesSchema = ReturnType<Exclude<SchemaService["attributesDefinitionFor"], undefined>>;
9
9
  type RelationshipsSchema = ReturnType<Exclude<SchemaService["relationshipsDefinitionFor"], undefined>>;
10
10
  export interface ModelSchemaProvider {
11
- attributesDefinitionFor(resource: RecordIdentifier | {
11
+ attributesDefinitionFor(resource: ResourceKey | {
12
12
  type: string;
13
13
  }): AttributesSchema;
14
- relationshipsDefinitionFor(resource: RecordIdentifier | {
14
+ relationshipsDefinitionFor(resource: ResourceKey | {
15
15
  type: string;
16
16
  }): RelationshipsSchema;
17
17
  doesTypeExist(type: string): boolean;
18
18
  }
19
19
  export declare class ModelSchemaProvider implements SchemaService {
20
- private store;
21
- private _schemas;
22
- private _typeMisses;
23
20
  constructor(store: ModelStore);
24
21
  resourceTypes(): Readonly<string[]>;
25
22
  hasTrait(type: string): boolean;
26
- resourceHasTrait(resource: StableRecordIdentifier | {
23
+ resourceHasTrait(resource: ResourceKey | {
27
24
  type: string;
28
25
  }, trait: string): boolean;
29
26
  transformation(field: GenericField | ObjectField | ArrayField | {
@@ -35,7 +32,7 @@ export declare class ModelSchemaProvider implements SchemaService {
35
32
  hashFn(field: HashField | {
36
33
  type: string;
37
34
  }): HashFn;
38
- resource(resource: StableRecordIdentifier | {
35
+ resource(resource: ResourceKey | {
39
36
  type: string;
40
37
  }): ResourceSchema | ObjectSchema;
41
38
  registerResources(schemas: Array<ResourceSchema | ObjectSchema>): void;
@@ -47,8 +44,7 @@ export declare class ModelSchemaProvider implements SchemaService {
47
44
  FM extends ObjectValue | null
48
45
  >(derivation: Derivation<R, T, FM>): void;
49
46
  registerHashFn(hashFn: HashFn): void;
50
- private _loadModelSchema;
51
- fields(resource: RecordIdentifier | {
47
+ fields(resource: ResourceKey | {
52
48
  type: string;
53
49
  }): Map<string, LegacyField>;
54
50
  hasResource(resource: {
@@ -1,8 +1,8 @@
1
1
  export { type MinimalLegacyRecord } from "./-private/model-methods.js";
2
2
  export type { ModelStore } from "./-private/model.js";
3
3
  export { Errors } from "./-private/errors.js";
4
- export { RelatedCollection as ManyArray } from "@warp-drive/core/store/-private";
4
+ export type { LegacyManyArray as ManyArray } from "@warp-drive/core/store/-private";
5
5
  export { PromiseBelongsTo } from "./-private/promise-belongs-to.js";
6
6
  export { PromiseManyArray } from "./-private/promise-many-array.js";
7
- // // Used by tests, migration support
8
7
  export { lookupLegacySupport, LEGACY_SUPPORT } from "./-private/legacy-relationships-support.js";
8
+ export type { MaybeHasManyFields, MaybeBelongsToFields, MaybeRelationshipFields } from "./-private/type-utils.js";
@@ -1,28 +1,9 @@
1
- /**
2
- * This module provides support for migrating away from @ember-data/model
3
- * to @warp-drive/schema-record.
4
- *
5
- * It includes:
6
- *
7
- * - A `withDefaults` function to assist in creating a schema in LegacyMode
8
- * - A `registerDerivations` function to register the derivations necessary to support LegacyMode
9
- * - A `DelegatingSchemaService` that can be used to provide a schema service that works with both
10
- * @ember-data/model and @warp-drive/schema-record simultaneously for migration purposes.
11
- * - A `WithLegacy` type util that can be used to create a type that includes the legacy
12
- * properties and methods of a record.
13
- *
14
- * Using LegacyMode features on a ReactiveResource *requires* the use of these derivations and schema
15
- * additions. LegacyMode is not intended to be a long-term solution, but rather a stepping stone
16
- * to assist in more rapidly adopting modern WarpDrive features.
17
- *
18
- * @module
19
- */
20
1
  import type { Store } from "@warp-drive/core";
21
2
  import type { CAUTION_MEGA_DANGER_ZONE_Extension, ProcessedExtension } from "@warp-drive/core/reactive";
22
3
  import type { ExtensibleField } from "@warp-drive/core/reactive/-private/schema";
23
4
  import type { SchemaService } from "@warp-drive/core/types";
24
5
  import type { ChangedAttributesHash } from "@warp-drive/core/types/cache";
25
- import type { StableRecordIdentifier } from "@warp-drive/core/types/identifier";
6
+ import type { ResourceKey } from "@warp-drive/core/types/identifier";
26
7
  import type { ObjectValue } from "@warp-drive/core/types/json/raw";
27
8
  import type { TypedRecordInstance, TypeFromInstance } from "@warp-drive/core/types/record";
28
9
  import type { Derivation, HashFn, Transformation } from "@warp-drive/core/types/schema/concepts";
@@ -170,6 +151,7 @@ export type WithLegacy<T extends TypedRecordInstance> = T & LegacyModeRecord<T>;
170
151
  * @public
171
152
  */
172
153
  export declare function withDefaults(schema: WithPartial<LegacyResourceSchema, "legacy" | "identity">): LegacyResourceSchema;
154
+ export declare function withRestoredDeprecatedModelRequestBehaviors(schema: WithPartial<LegacyResourceSchema, "legacy" | "identity">): LegacyResourceSchema;
173
155
  /**
174
156
  * A function which registers the necessary derivations to support
175
157
  * the LegacyMode features of @ember-data/model while migrating to WarpDrive.
@@ -216,10 +198,10 @@ export declare function registerDerivations(schema: SchemaService): void;
216
198
  * @public
217
199
  */
218
200
  export interface DelegatingSchemaService {
219
- attributesDefinitionFor?(resource: StableRecordIdentifier | {
201
+ attributesDefinitionFor?(resource: ResourceKey | {
220
202
  type: string;
221
203
  }): AttributesSchema;
222
- relationshipsDefinitionFor?(resource: StableRecordIdentifier | {
204
+ relationshipsDefinitionFor?(resource: ResourceKey | {
223
205
  type: string;
224
206
  }): RelationshipsSchema;
225
207
  doesTypeExist?(type: string): boolean;
@@ -228,18 +210,18 @@ export declare class DelegatingSchemaService implements SchemaService {
228
210
  _preferred: SchemaService;
229
211
  _secondary: SchemaService;
230
212
  constructor(store: Store, schema: SchemaService);
231
- isDelegated(resource: StableRecordIdentifier | {
213
+ isDelegated(resource: ResourceKey | {
232
214
  type: string;
233
215
  }): boolean;
234
216
  resourceTypes(): Readonly<string[]>;
235
- hasResource(resource: StableRecordIdentifier | {
217
+ hasResource(resource: ResourceKey | {
236
218
  type: string;
237
219
  }): boolean;
238
220
  hasTrait(type: string): boolean;
239
- resourceHasTrait(resource: StableRecordIdentifier | {
221
+ resourceHasTrait(resource: ResourceKey | {
240
222
  type: string;
241
223
  }, trait: string): boolean;
242
- fields(resource: StableRecordIdentifier | {
224
+ fields(resource: ResourceKey | {
243
225
  type: string;
244
226
  }): Map<string, FieldSchema>;
245
227
  transformation(field: GenericField | ObjectField | ArrayField | {
@@ -251,7 +233,7 @@ export declare class DelegatingSchemaService implements SchemaService {
251
233
  derivation(field: DerivedField | {
252
234
  type: string;
253
235
  }): Derivation;
254
- resource(resource: StableRecordIdentifier | {
236
+ resource(resource: ResourceKey | {
255
237
  type: string;
256
238
  }): ResourceSchema | ObjectSchema;
257
239
  registerResources(schemas: Array<ResourceSchema | ObjectSchema>): void;
@@ -264,34 +246,10 @@ export declare class DelegatingSchemaService implements SchemaService {
264
246
  >(derivation: Derivation<R, T, FM>): void;
265
247
  registerHashFn(hashFn: HashFn): void;
266
248
  CAUTION_MEGA_DANGER_ZONE_registerExtension(extension: CAUTION_MEGA_DANGER_ZONE_Extension): void;
267
- CAUTION_MEGA_DANGER_ZONE_resourceExtensions(resource: StableRecordIdentifier | {
249
+ CAUTION_MEGA_DANGER_ZONE_resourceExtensions(resource: ResourceKey | {
268
250
  type: string;
269
251
  }): null | ProcessedExtension["features"];
270
- CAUTION_MEGA_DANGER_ZONE_objectExtensions(field: ExtensibleField): null | ProcessedExtension["features"];
252
+ CAUTION_MEGA_DANGER_ZONE_objectExtensions(field: ExtensibleField, resolvedType: string | null): null | ProcessedExtension["features"];
271
253
  CAUTION_MEGA_DANGER_ZONE_arrayExtensions(field: ExtensibleField): null | ProcessedExtension["features"];
272
- /**
273
- * This is an internal method used to register behaviors for legacy mode.
274
- * It is not intended for public use.
275
- *
276
- * We do think a generalized `kind` registration system would be useful,
277
- * but we have not yet designed it.
278
- *
279
- * See https://github.com/emberjs/data/issues/9534
280
- *
281
- * @internal
282
- */
283
- _registerMode(mode: string, kinds: unknown): void;
284
- /**
285
- * This is an internal method used to enable legacy behaviors for legacy mode.
286
- * It is not intended for public use.
287
- *
288
- * We do think a generalized `kind` registration system would be useful,
289
- * but we have not yet designed it.
290
- *
291
- * See https://github.com/emberjs/data/issues/9534
292
- *
293
- * @internal
294
- */
295
- _kind(mode: string, kind: "belongsTo" | "hasMany"): () => unknown;
296
254
  }
297
255
  export {};
@@ -39,7 +39,7 @@ and dasherized.
39
39
  export { attr } from "./model/-private/attr.js";
40
40
  export { belongsTo } from "./model/-private/belongs-to.js";
41
41
  export { hasMany } from "./model/-private/has-many.js";
42
- export { Model } from "./model/-private/model.js";
42
+ export { Model, restoreDeprecatedModelRequestBehaviors } from "./model/-private/model.js";
43
43
  export { Model as default } from "./model/-private/model.js";
44
44
  export type { PromiseBelongsTo as AsyncBelongsTo } from "./model/-private/promise-belongs-to.js";
45
45
  export type { PromiseManyArray as AsyncHasMany } from "./model/-private/promise-many-array.js";
@@ -121,6 +121,5 @@ return normalizedRelationship;
121
121
  @class JSONAPISerializer
122
122
  @public
123
123
  */
124
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
125
124
  declare const JSONAPISerializer: any;
126
125
  export { JSONAPISerializer };
@@ -73,6 +73,5 @@ turn the record payload into the JSON API format.
73
73
  @class JSONSerializer
74
74
  @public
75
75
  */
76
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
77
76
  declare const JSONSerializer: any;
78
77
  export { JSONSerializer };
@@ -48,7 +48,6 @@ the method (`serialize` or `deserialize`) as the third parameter.
48
48
  @class RESTSerializer
49
49
  @public
50
50
  */
51
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
51
  declare const RESTSerializer: any;
53
52
  export { EmbeddedRecordsMixin } from "./-private/embedded-records-mixin.js";
54
53
  export { RESTSerializer };
@@ -0,0 +1,223 @@
1
+ import { type InstanceCache } from "@warp-drive/core/store/-private";
2
+ import type { NewResourceKey, ResourceKey } from "@warp-drive/core/types/identifier";
3
+ import type { Value } from "@warp-drive/core/types/json/raw";
4
+ import type { OpaqueRecordInstance, TypedRecordInstance, TypeFromInstance } from "@warp-drive/core/types/record";
5
+ import type { LegacyAttributeField, LegacyRelationshipField } from "@warp-drive/core/types/schema/fields";
6
+ import type { SingleResourceDocument } from "@warp-drive/core/types/spec/json-api-raw";
7
+ import type { Store } from "../store.js";
8
+ export declare function preloadData(store: Store, identifier: NewResourceKey, preload: Record<string, Value>): void;
9
+ export interface BaseFinderOptions {
10
+ reload?: boolean;
11
+ backgroundReload?: boolean;
12
+ include?: string | string[];
13
+ adapterOptions?: Record<string, unknown>;
14
+ }
15
+ export interface FindRecordOptions extends BaseFinderOptions {
16
+ /**
17
+ * Data to preload into the store before the request is made.
18
+ * This feature is *highly* discouraged and has no corresponding
19
+ * feature when using builders and handlers.
20
+ *
21
+ * Excepting relationships: the data should be in the form of a
22
+ * JSON object where the keys are fields on the record and the value
23
+ * is the raw value to be added to the cache.
24
+ *
25
+ * Relationships can either be provided as string IDs from which
26
+ * an identifier will be built base upon the relationship's expected
27
+ * resource type, or be record instances from which the identifier
28
+ * will be extracted.
29
+ *
30
+ */
31
+ preload?: Record<string, Value>;
32
+ }
33
+ export type QueryOptions = { [K in string | "adapterOptions"]? : K extends "adapterOptions" ? Record<string, unknown> : unknown };
34
+ export type FindAllOptions = BaseFinderOptions;
35
+ export type LegacyResourceQuery = {
36
+ include?: string | string[];
37
+ [key: string]: Value | undefined;
38
+ };
39
+ export type KeyOrString<T> = keyof T & string extends never ? string : keyof T & string;
40
+ /**
41
+ * Minimum subset of static schema methods and properties on the
42
+ * "model" class.
43
+ *
44
+ * Only used when using the legacy schema-service implementation
45
+ * for @ember-data/model or when wrapping schema for legacy
46
+ * Adapters/Serializers.
47
+ *
48
+ */
49
+ export interface ModelSchema<T = unknown> {
50
+ modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
51
+ fields: Map<KeyOrString<T>, "attribute" | "belongsTo" | "hasMany">;
52
+ attributes: Map<KeyOrString<T>, LegacyAttributeField>;
53
+ relationshipsByName: Map<KeyOrString<T>, LegacyRelationshipField>;
54
+ eachAttribute<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, attribute: LegacyAttributeField) => void, binding?: T): void;
55
+ eachRelationship<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, relationship: LegacyRelationshipField) => void, binding?: T): void;
56
+ eachTransformedAttribute<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, type: string | null) => void, binding?: T): void;
57
+ }
58
+ export declare function resourceIsFullyDeleted(instanceCache: InstanceCache, identifier: ResourceKey): boolean;
59
+ /**
60
+ A `RecordReference` is a low-level API that allows users and
61
+ addon authors to perform meta-operations on a record.
62
+
63
+ @hideconstructor
64
+ @public
65
+ */
66
+ export declare class RecordReference {
67
+ constructor(store: Store, identifier: ResourceKey);
68
+ get type(): string;
69
+ /**
70
+ The `id` of the record that this reference refers to.
71
+
72
+ Together, the `type` and `id` properties form a composite key for
73
+ the identity map.
74
+
75
+ Example
76
+
77
+ ```javascript
78
+ let userRef = store.getReference('user', 1);
79
+
80
+ userRef.id(); // '1'
81
+ ```
82
+
83
+ @public
84
+ @return The id of the record.
85
+ */
86
+ id(): string | null;
87
+ /**
88
+ The `identifier` of the record that this reference refers to.
89
+
90
+ Together, the `type` and `id` properties form a composite key for
91
+ the identity map.
92
+
93
+ Example
94
+
95
+ ```javascript
96
+ let userRef = store.getReference('user', 1);
97
+
98
+ userRef.identifier(); // '1'
99
+ ```
100
+
101
+ @public
102
+ @return The identifier of the record.
103
+ */
104
+ identifier(): ResourceKey;
105
+ /**
106
+ How the reference will be looked up when it is loaded. Currently
107
+ this always returns `identity` to signify that a record will be
108
+ loaded by its `type` and `id`.
109
+
110
+ Example
111
+
112
+ ```javascript
113
+ const userRef = store.getReference('user', 1);
114
+
115
+ userRef.remoteType(); // 'identity'
116
+ ```
117
+
118
+ @public
119
+ */
120
+ remoteType(): "identity";
121
+ /**
122
+ This API allows you to provide a reference with new data. The
123
+ simplest usage of this API is similar to `store.push`: you provide a
124
+ normalized hash of data and the object represented by the reference
125
+ will update.
126
+
127
+ If you pass a promise to `push`, Ember Data will not ask the adapter
128
+ for the data if another attempt to fetch it is made in the
129
+ interim. When the promise resolves, the underlying object is updated
130
+ with the new data, and the promise returned by *this function* is resolved
131
+ with that object.
132
+
133
+ For example, `recordReference.push(promise)` will be resolved with a
134
+ record.
135
+
136
+ Example
137
+
138
+ ```javascript
139
+ let userRef = store.getReference('user', 1);
140
+
141
+ // provide data for reference
142
+ userRef.push({
143
+ data: {
144
+ id: "1",
145
+ type: "user",
146
+ attributes: {
147
+ username: "@user"
148
+ }
149
+ }
150
+ }).then(function(user) {
151
+ userRef.value() === user;
152
+ });
153
+ ```
154
+
155
+ @public
156
+ @param objectOrPromise a JSON:API ResourceDocument or a promise resolving to one
157
+ @return a promise for the value (record or relationship)
158
+ */
159
+ push(objectOrPromise: SingleResourceDocument | Promise<SingleResourceDocument>): Promise<OpaqueRecordInstance>;
160
+ /**
161
+ If the entity referred to by the reference is already loaded, it is
162
+ present as `reference.value`. Otherwise the value returned by this function
163
+ is `null`.
164
+
165
+ Example
166
+
167
+ ```javascript
168
+ let userRef = store.getReference('user', 1);
169
+
170
+ userRef.value(); // user
171
+ ```
172
+
173
+ @public
174
+ @return {Model} the record for this RecordReference
175
+ */
176
+ value(): OpaqueRecordInstance | null;
177
+ /**
178
+ Triggers a fetch for the backing entity based on its `remoteType`
179
+ (see `remoteType` definitions per reference type).
180
+
181
+ Example
182
+
183
+ ```javascript
184
+ let userRef = store.getReference('user', 1);
185
+
186
+ // load user (via store.find)
187
+ userRef.load().then(...)
188
+ ```
189
+
190
+ @public
191
+ @return the record for this RecordReference
192
+ */
193
+ load(): Promise<unknown>;
194
+ /**
195
+ Reloads the record if it is already loaded. If the record is not
196
+ loaded it will load the record via `store.findRecord`
197
+
198
+ Example
199
+
200
+ ```javascript
201
+ let userRef = store.getReference('user', 1);
202
+
203
+ // or trigger a reload
204
+ userRef.reload().then(...)
205
+ ```
206
+
207
+ @public
208
+ @return the record for this RecordReference
209
+ */
210
+ reload(): Promise<unknown>;
211
+ }
212
+ export declare function getShimClass<T>(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string): ShimModelClass<T>;
213
+ export declare class ShimModelClass<T = unknown> implements ModelSchema<T> {
214
+ __store: Store;
215
+ modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
216
+ constructor(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string);
217
+ get fields(): Map<KeyOrString<T>, "attribute" | "belongsTo" | "hasMany">;
218
+ get attributes(): Map<KeyOrString<T>, LegacyAttributeField>;
219
+ get relationshipsByName(): Map<KeyOrString<T>, LegacyRelationshipField>;
220
+ eachAttribute<K extends KeyOrString<T>>(callback: (key: K, attribute: LegacyAttributeField) => void, binding?: T): void;
221
+ eachRelationship<K extends KeyOrString<T>>(callback: (key: K, relationship: LegacyRelationshipField) => void, binding?: T): void;
222
+ eachTransformedAttribute<K extends KeyOrString<T>>(callback: (key: K, type: string | null) => void, binding?: T): void;
223
+ }
@@ -0,0 +1,3 @@
1
+ import type { Store } from "@warp-drive/core";
2
+ export declare function restoreDeprecatedStoreBehaviors(StoreKlass: typeof Store): void;
3
+ export { Store };