DX rules of thumb:
'user' as const) to get token-narrowed record types at call sites (no generics).entityManager.removeKeys(entityToken, records) in handlers when you want domain shapes.EntityClient carries a config literal type (CF), createQueryBuilder infers index tokens (ITS) and per-index page keys automatically.CF depends on your setup (for example, a values-first EntityManager factory), or by explicitly typing the client as EntityClient<C, typeof cf>.CF, ITS falls back to string.Patterns
// Token-aware get with projection tuple (const narrows the shape)
const out = await client.getItem('user', { hashKey2: 'h', rangeKey: 'r' }, [
'a',
] as const);
// QueryBuilder narrows per-index page keys automatically when the client carries CF
const qb = createQueryBuilder({
entityClient: client,
entityToken: 'user',
hashKeyToken: 'hashKey2',
});
Related