mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-23 20:18:42 +08:00
feat: native sync state (#14190)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added indexed clock management capabilities for documents, enabling
get, set, and clear operations across Android, iOS, Electron, and web
platforms.
* **Refactor**
* Improved storage architecture to dynamically select platform-specific
implementations (SQLite for Electron, IndexedDB for others).
* **Bug Fixes**
* Enhanced document operations to properly maintain and clean up indexer
synchronization state during document lifecycle changes.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Vendored
+9
@@ -65,6 +65,9 @@ export declare class DocStoragePool {
|
||||
deleteDoc(universalId: string, docId: string): Promise<void>
|
||||
getDocClocks(universalId: string, after?: Date | undefined | null): Promise<Array<DocClock>>
|
||||
getDocClock(universalId: string, docId: string): Promise<DocClock | null>
|
||||
getDocIndexedClock(universalId: string, docId: string): Promise<DocIndexedClock | null>
|
||||
setDocIndexedClock(universalId: string, docId: string, indexedClock: Date, indexerVersion: number): Promise<void>
|
||||
clearDocIndexedClock(universalId: string, docId: string): Promise<void>
|
||||
getBlob(universalId: string, key: string): Promise<Blob | null>
|
||||
setBlob(universalId: string, blob: SetBlob): Promise<void>
|
||||
deleteBlob(universalId: string, key: string, permanently: boolean): Promise<void>
|
||||
@@ -104,6 +107,12 @@ export interface DocClock {
|
||||
timestamp: Date
|
||||
}
|
||||
|
||||
export interface DocIndexedClock {
|
||||
docId: string
|
||||
timestamp: Date
|
||||
indexerVersion: number
|
||||
}
|
||||
|
||||
export interface DocRecord {
|
||||
docId: string
|
||||
bin: Uint8Array
|
||||
|
||||
Reference in New Issue
Block a user