Skip to content
module@warp-drive/legacy/compat @legacy

Interface LegacyStoreCompat ​

ts
interface LegacyStoreCompat extends Store$1 {
  [key: string]: any;
  adapterFor(this: Store$1, modelName: string): MinimumAdapterInterface;
  adapterFor(this: Store$1, modelName: string, _allowMissing: true): MinimumAdapterInterface | undefined;
  normalize(modelName: string, payload: ObjectValue): ObjectValue;
  pushPayload(modelName: string, payload: ObjectValue): void;
  serializeRecord(record: unknown, options?: SerializerOptions): unknown;
  serializerFor<K extends string>(modelName: K, _allowMissing?: boolean): MinimumSerializerInterface | null;
}

Defined in: warp-drive-packages/legacy/src/compat.ts:73

No Inherit Doc Legacy

Extends the signature of Store with additional methods available when using the legacy network layer.

Extends ​

  • Store$1

Indexable ​

ts
[key: string]: any

Methods ​

adapterFor() ​

ts
adapterFor(this: Store$1, modelName: string): MinimumAdapterInterface;
adapterFor(
   this: Store$1, 
   modelName: string, 
   _allowMissing: true
): MinimumAdapterInterface | undefined;

Call Signature ​

ts
adapterFor(this: Store$1, modelName: string): MinimumAdapterInterface;

Defined in: warp-drive-packages/legacy/src/compat.ts:83

Returns the adapter instance for the given model type, instantiating it (and caching the instance) if necessary. See adapterFor.

Parameters ​
this ​

Store$1

modelName ​

string

Returns ​

MinimumAdapterInterface

Call Signature ​

ts
adapterFor(
   this: Store$1, 
   modelName: string, 
   _allowMissing: true
): MinimumAdapterInterface | undefined;

Defined in: warp-drive-packages/legacy/src/compat.ts:89

Same as the single-argument overload, but returns undefined instead of throwing/asserting when _allowMissing is true and no adapter is found.

Parameters ​
this ​

Store$1

modelName ​

string

_allowMissing ​

true

Returns ​

MinimumAdapterInterface | undefined


normalize() ​

ts
normalize(modelName: string, payload: ObjectValue): ObjectValue;

Defined in: warp-drive-packages/legacy/src/compat.ts:101

Normalizes a payload for the given model type using its serializer. See normalize.

Parameters ​

modelName ​

string

payload ​

ObjectValue

Returns ​

ObjectValue


pushPayload() ​

ts
pushPayload(modelName: string, payload: ObjectValue): void;

Defined in: warp-drive-packages/legacy/src/compat.ts:107

Pushes a payload into the store using the appropriate serializer to normalize it first. See pushPayload.

Parameters ​

modelName ​

string

payload ​

ObjectValue

Returns ​

void


serializeRecord() ​

ts
serializeRecord(record: unknown, options?: SerializerOptions): unknown;

Defined in: warp-drive-packages/legacy/src/compat.ts:112

Serializes a record using its serializer. See serializeRecord.

Parameters ​

record ​

unknown

options? ​

SerializerOptions

Returns ​

unknown


serializerFor() ​

ts
serializerFor<K extends string>(modelName: K, _allowMissing?: boolean): MinimumSerializerInterface | null;

Defined in: warp-drive-packages/legacy/src/compat.ts:95

Returns the serializer instance for the given model type, instantiating it (and caching the instance) if necessary. See serializerFor.

Type Parameters ​

K ​

K extends string

Parameters ​

modelName ​

K

_allowMissing? ​

boolean

Returns ​

MinimumSerializerInterface | null

Released under the MIT License.