Skip to content

Documentation / @ember-data/store / types / ModelSchema

Defined in: packages/store/src/-types/q/ds-model.ts:15

Minimum subset of static schema methods and properties on the "model" class.

Only used when using the legacy schema-service implementation for @ember-data/model or when wrapping schema for legacy Adapters/Serializers.

Type Parameters

T

T = unknown

Properties

attributes

ts
attributes: Map<KeyOrString<T>, LegacyAttributeField>;

Defined in: packages/store/src/-types/q/ds-model.ts:18


fields

ts
fields: Map<KeyOrString<T>, "attribute" | "belongsTo" | "hasMany">;

Defined in: packages/store/src/-types/q/ds-model.ts:17


modelName

ts
modelName: T extends TypedRecordInstance ? TypeFromInstance<T<T>> : string;

Defined in: packages/store/src/-types/q/ds-model.ts:16


relationshipsByName

ts
relationshipsByName: Map<KeyOrString<T>, LegacyRelationshipField>;

Defined in: packages/store/src/-types/q/ds-model.ts:19

Methods

eachAttribute()

ts
eachAttribute<K>(callback, binding?): void;

Defined in: packages/store/src/-types/q/ds-model.ts:20

Type Parameters

K

K extends string

Parameters

callback

(this, key, attribute) => void

binding?

T

Returns

void


eachRelationship()

ts
eachRelationship<K>(callback, binding?): void;

Defined in: packages/store/src/-types/q/ds-model.ts:24

Type Parameters

K

K extends string

Parameters

callback

(this, key, relationship) => void

binding?

T

Returns

void


eachTransformedAttribute()

ts
eachTransformedAttribute<K>(callback, binding?): void;

Defined in: packages/store/src/-types/q/ds-model.ts:28

Type Parameters

K

K extends string

Parameters

callback

(this, key, type) => void

binding?

T

Returns

void

Released under the MIT License.