1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
/**
* CRDT Module
*
* This module provides Automerge CRDT-based sync functionality for Kioku.
* It enables conflict-free synchronization of data between clients and server.
*/
// Document lifecycle management
export {
// Core document operations
applyChanges,
// Entity to/from CRDT document conversions
cardToCrdtDocument,
crdtDocumentToCard,
crdtDocumentToDeck,
crdtDocumentToNote,
crdtDocumentToNoteFieldType,
crdtDocumentToNoteFieldValue,
crdtDocumentToNoteType,
crdtDocumentToReviewLog,
createDocument,
// Generic entity conversion
createDocumentFromEntity,
createEmptyDocument,
// Types
type DocumentChange,
type DocumentSnapshot,
deckToCrdtDocument,
// Actor ID management
getActorId,
getChanges,
// Conflict detection and utilities
getLastModified,
hasConflicts,
initDocumentWithActor,
isDeleted,
loadDocument,
loadIncremental,
type MergeResult,
mergeDocuments,
noteFieldTypeToCrdtDocument,
noteFieldValueToCrdtDocument,
noteToCrdtDocument,
noteTypeToCrdtDocument,
reviewLogToCrdtDocument,
saveDocument,
saveIncremental,
updateDocument,
} from "./document-manager";
// Type definitions
export {
type CrdtCardDocument,
type CrdtDeckDocument,
type CrdtDocument,
type CrdtDocumentMap,
CrdtEntityType,
type CrdtEntityTypeValue,
type CrdtMetadata,
type CrdtNoteDocument,
type CrdtNoteFieldTypeDocument,
type CrdtNoteFieldValueDocument,
type CrdtNoteTypeDocument,
type CrdtReviewLogDocument,
createCrdtMetadata,
createDeletedCrdtMetadata,
createDocumentId,
type DocumentId,
parseDocumentId,
} from "./types";
|