cherry-studio/packages/shared/data/cache
fullex fb51df99d0 feat(cache): add template key support for useCache with type inference
- Add type utilities for template key matching (IsTemplateKey, ExpandTemplateKey, ProcessKey)
- Add InferUseCacheValue<K> for automatic value type inference from template patterns
- Update useCache hook to support template keys with default value fallback
- Extend ESLint rule to validate template key syntax (e.g., 'scroll.position:${id}')
- Update CacheService.get() docs: clarify | undefined return is intentional
  (developers need to know when value doesn't exist after deletion/TTL expiry)
- Update cache documentation with template key usage examples

BREAKING CHANGE: CacheService.get() now explicitly returns T | undefined
(was implicit before). Callers should use ?? defaultValue for fallback.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 12:23:19 +08:00
..
cacheSchemas.ts feat(cache): add template key support for useCache with type inference 2026-01-05 12:23:19 +08:00
cacheTypes.ts feat(cache): enhance shared cache functionality and synchronization in main 2025-12-29 23:56:27 +08:00
cacheValueTypes.ts Merge branch 'main' into v2 2025-12-09 10:45:35 +08:00