fix: correct TypeScript typing for Automerge.from() optimization
Use double type assertion for TLStoreSnapshot → Record<string, unknown> to satisfy Automerge.from() type constraints. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
06f41e8fec
commit
1dc8f4f1b8
|
|
@ -157,7 +157,8 @@ export class AutomergeR2Storage {
|
|||
}
|
||||
|
||||
// Automerge.from() is optimized for creating documents from existing state
|
||||
const doc = Automerge.from<TLStoreSnapshot>(initialState)
|
||||
// Type assertion needed because TLStoreSnapshot doesn't have index signature
|
||||
const doc = Automerge.from(initialState as unknown as Record<string, unknown>) as Automerge.Doc<TLStoreSnapshot>
|
||||
|
||||
const conversionTime = Date.now() - startTime
|
||||
console.log(`⏱️ Automerge conversion took ${conversionTime}ms for ${recordCount} records`)
|
||||
|
|
|
|||
Loading…
Reference in New Issue