@loro-dev/flock 2.1.2 → 3.1.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/README.md +8 -8
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/_moon_flock.d.ts +7 -5
- package/src/_moon_flock.ts +1425 -1242
- package/src/index.ts +47 -47
package/dist/index.d.mts
CHANGED
|
@@ -4,6 +4,7 @@ type ExportOptions = {
|
|
|
4
4
|
from?: VersionVector;
|
|
5
5
|
hooks?: ExportHooks;
|
|
6
6
|
pruneTombstonesBefore?: number;
|
|
7
|
+
peerId?: string;
|
|
7
8
|
};
|
|
8
9
|
type ImportOptions = {
|
|
9
10
|
bundle: ExportBundle;
|
|
@@ -31,8 +32,7 @@ type ExportBundle = {
|
|
|
31
32
|
type EntryClock = {
|
|
32
33
|
physicalTime: number;
|
|
33
34
|
logicalCounter: number;
|
|
34
|
-
|
|
35
|
-
peerId: Uint8Array;
|
|
35
|
+
peerId: string;
|
|
36
36
|
};
|
|
37
37
|
type ExportPayload = {
|
|
38
38
|
data?: Value;
|
|
@@ -111,12 +111,12 @@ type EventBatch = {
|
|
|
111
111
|
};
|
|
112
112
|
declare class Flock {
|
|
113
113
|
private inner;
|
|
114
|
-
constructor(peerId?:
|
|
114
|
+
constructor(peerId?: string);
|
|
115
115
|
private static fromInner;
|
|
116
|
-
static fromJson(bundle: ExportBundle, peerId:
|
|
116
|
+
static fromJson(bundle: ExportBundle, peerId: string): Flock;
|
|
117
117
|
static checkConsistency(a: Flock, b: Flock): boolean;
|
|
118
118
|
checkInvariants(): void;
|
|
119
|
-
setPeerId(peerId:
|
|
119
|
+
setPeerId(peerId: string): void;
|
|
120
120
|
private putWithMetaInternal;
|
|
121
121
|
private putWithMetaWithHooks;
|
|
122
122
|
/**
|
|
@@ -148,7 +148,7 @@ declare class Flock {
|
|
|
148
148
|
importJson(bundle: ExportBundle): ImportReport;
|
|
149
149
|
importJson(options: ImportOptions): Promise<ImportReport>;
|
|
150
150
|
getMaxPhysicalTime(): number;
|
|
151
|
-
peerId():
|
|
151
|
+
peerId(): string;
|
|
152
152
|
digest(): string;
|
|
153
153
|
kvToJson(): ExportBundle;
|
|
154
154
|
putMvr(key: KeyPart[], value: Value, now?: number): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ type ExportOptions = {
|
|
|
4
4
|
from?: VersionVector;
|
|
5
5
|
hooks?: ExportHooks;
|
|
6
6
|
pruneTombstonesBefore?: number;
|
|
7
|
+
peerId?: string;
|
|
7
8
|
};
|
|
8
9
|
type ImportOptions = {
|
|
9
10
|
bundle: ExportBundle;
|
|
@@ -31,8 +32,7 @@ type ExportBundle = {
|
|
|
31
32
|
type EntryClock = {
|
|
32
33
|
physicalTime: number;
|
|
33
34
|
logicalCounter: number;
|
|
34
|
-
|
|
35
|
-
peerId: Uint8Array;
|
|
35
|
+
peerId: string;
|
|
36
36
|
};
|
|
37
37
|
type ExportPayload = {
|
|
38
38
|
data?: Value;
|
|
@@ -111,12 +111,12 @@ type EventBatch = {
|
|
|
111
111
|
};
|
|
112
112
|
declare class Flock {
|
|
113
113
|
private inner;
|
|
114
|
-
constructor(peerId?:
|
|
114
|
+
constructor(peerId?: string);
|
|
115
115
|
private static fromInner;
|
|
116
|
-
static fromJson(bundle: ExportBundle, peerId:
|
|
116
|
+
static fromJson(bundle: ExportBundle, peerId: string): Flock;
|
|
117
117
|
static checkConsistency(a: Flock, b: Flock): boolean;
|
|
118
118
|
checkInvariants(): void;
|
|
119
|
-
setPeerId(peerId:
|
|
119
|
+
setPeerId(peerId: string): void;
|
|
120
120
|
private putWithMetaInternal;
|
|
121
121
|
private putWithMetaWithHooks;
|
|
122
122
|
/**
|
|
@@ -148,7 +148,7 @@ declare class Flock {
|
|
|
148
148
|
importJson(bundle: ExportBundle): ImportReport;
|
|
149
149
|
importJson(options: ImportOptions): Promise<ImportReport>;
|
|
150
150
|
getMaxPhysicalTime(): number;
|
|
151
|
-
peerId():
|
|
151
|
+
peerId(): string;
|
|
152
152
|
digest(): string;
|
|
153
153
|
kvToJson(): ExportBundle;
|
|
154
154
|
putMvr(key: KeyPart[], value: Value, now?: number): void;
|