EntitiesMap

tagtree · /core·type

Constraint type for the entities record passed to defineCache; maps entity names to their EntityDecl shapes, ensuring all values conform to the expected param and parent structure before the schema is frozen.

Definition

@nordcom/commerce-tagtree
type EntitiesMap = Record<string, EntityDecl<ParamMap | undefined, readonly string[]>>;

Record<string, EntityDecl<ParamMap | undefined, readonly string[]>>

Example

const entities = {
    product: { params: { id: str } },
    collection: { params: { handle: str }, parents: ['product'] },
} satisfies EntitiesMap;

ContractTestOptions runAdapterContract AdapterCtx CacheAdapter CacheInstance CacheKey CacheSchema CacheSchemaShape

Sourceschema.ts:59Edit the JSDoc directly

On this page