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
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;Related
ContractTestOptions runAdapterContract AdapterCtx CacheAdapter CacheInstance CacheKey CacheSchema CacheSchemaShape
MetadataOpen in GitHub ↗
encodeSegment
Encodes a single cachekey segment so it is safe to join with . as a separator; escapes . and : in addition to the characters encodeURIComponent already handles.
EntityDecl
Declares a single entity within a cache schema, specifying the optional params it accepts for leaflevel key building and the parent entity names whose cache ent