cherry-studio/packages
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
..
ai-sdk-provider fix: interleaved thinking support (#12084) 2025-12-23 20:08:53 +08:00
aiCore Merge branch 'main' into v2 2025-12-24 17:30:49 +08:00
extension-table-plus chore[lint]: add import type lint (#11091) 2025-11-01 10:40:02 +08:00
mcp-trace chore[lint]: add import type lint (#11091) 2025-11-01 10:40:02 +08:00
shared feat(cache): add template key support for useCache with type inference 2026-01-05 12:23:19 +08:00
ui refactor(ui): update utility imports to use internal lib 2025-12-29 18:58:13 +08:00