@loro-dev/flock-sqlite 0.1.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts CHANGED
@@ -16,7 +16,10 @@ export type ExportRecord = {
16
16
  m?: MetadataMap;
17
17
  };
18
18
 
19
- export type ExportBundle = { version: number; entries: Record<string, ExportRecord> };
19
+ export type ExportBundle = {
20
+ version: number;
21
+ entries: Record<string, ExportRecord>;
22
+ };
20
23
 
21
24
  export type EntryClock = {
22
25
  physicalTime: number;
@@ -24,6 +27,12 @@ export type EntryClock = {
24
27
  peerId: string;
25
28
  };
26
29
 
30
+ export type EntryInfo = {
31
+ data?: Value;
32
+ metadata: MetadataMap;
33
+ clock: EntryClock;
34
+ };
35
+
27
36
  export type ExportPayload = {
28
37
  data?: Value;
29
38
  metadata?: MetadataMap;
@@ -38,7 +47,10 @@ export type ExportHookContext = {
38
47
  export type MaybePromise<T> = T | Promise<T>;
39
48
 
40
49
  export type ExportHooks = {
41
- transform?: (context: ExportHookContext, payload: ExportPayload) => MaybePromise<ExportPayload | void>;
50
+ transform?: (
51
+ context: ExportHookContext,
52
+ payload: ExportPayload,
53
+ ) => MaybePromise<ExportPayload | void>;
42
54
  };
43
55
 
44
56
  export type ImportPayload = ExportPayload;
@@ -50,7 +62,10 @@ export type ImportSkip = { accept: false; reason: string };
50
62
  export type ImportDecision = ImportAccept | ImportSkip | ImportPayload | void;
51
63
 
52
64
  export type ImportHooks = {
53
- preprocess?: (context: ImportHookContext, payload: ImportPayload) => MaybePromise<ImportDecision>;
65
+ preprocess?: (
66
+ context: ImportHookContext,
67
+ payload: ImportPayload,
68
+ ) => MaybePromise<ImportDecision>;
54
69
  };
55
70
 
56
71
  export type ImportReport = {
@@ -116,7 +131,10 @@ export type PutHookContext = {
116
131
  };
117
132
 
118
133
  export type PutHooks = {
119
- transform?: (context: PutHookContext, payload: PutPayload) => MaybePromise<PutPayload | void>;
134
+ transform?: (
135
+ context: PutHookContext,
136
+ payload: PutPayload,
137
+ ) => MaybePromise<PutPayload | void>;
120
138
  };
121
139
 
122
140
  export type PutWithMetaOptions = {