@pluv/crdt 0.43.0 → 0.44.1
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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +9 -5
- package/dist/index.d.ts +9 -5
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/src/AbstractCrdtDoc.ts +8 -4
- package/src/NoopCrdtDoc.ts +6 -2
- package/src/index.ts +6 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/crdt@0.
|
|
2
|
+
> @pluv/crdt@0.44.1 build /home/runner/work/pluv/pluv/packages/crdt
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mCJS[39m [1mdist/index.js [22m[32m2.43 KB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in 25ms
|
|
13
11
|
[32mESM[39m [1mdist/index.mjs [22m[32m1.26 KB[39m
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 35ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m2.43 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 36ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m3.
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 501ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m3.32 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.32 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Json } from '@pluv/types';
|
|
1
|
+
import { Json, Maybe } from '@pluv/types';
|
|
2
2
|
|
|
3
3
|
type CrdtType<TValue extends unknown, TJson extends unknown = any> = Omit<TValue, "__pluvType"> & {
|
|
4
4
|
__pluvType: () => TJson;
|
|
@@ -9,7 +9,11 @@ type InferCrdtJson<T extends unknown> = T extends CrdtType<any, infer IJson> ? I
|
|
|
9
9
|
|
|
10
10
|
interface DocApplyEncodedStateParams {
|
|
11
11
|
origin?: string;
|
|
12
|
-
update?: string | Uint8Array
|
|
12
|
+
update?: Maybe<string | Uint8Array>;
|
|
13
|
+
}
|
|
14
|
+
interface DocBatchApplyEncodedStateParams {
|
|
15
|
+
origin?: string;
|
|
16
|
+
updates?: Maybe<readonly Maybe<string | Uint8Array>[]>;
|
|
13
17
|
}
|
|
14
18
|
interface DocSubscribeCallbackParams<T extends Record<string, CrdtType<any, any>>> {
|
|
15
19
|
doc: AbstractCrdtDoc<T>;
|
|
@@ -19,7 +23,7 @@ interface DocSubscribeCallbackParams<T extends Record<string, CrdtType<any, any>
|
|
|
19
23
|
}
|
|
20
24
|
declare abstract class AbstractCrdtDoc<T extends Record<string, CrdtType<any, any>>> {
|
|
21
25
|
abstract applyEncodedState(params: DocApplyEncodedStateParams): this;
|
|
22
|
-
abstract batchApplyEncodedState(
|
|
26
|
+
abstract batchApplyEncodedState(params: DocBatchApplyEncodedStateParams): this;
|
|
23
27
|
abstract canRedo(): boolean;
|
|
24
28
|
abstract canUndo(): boolean;
|
|
25
29
|
abstract destroy(): void;
|
|
@@ -45,7 +49,7 @@ declare abstract class AbstractCrdtDocFactory<TStorage extends Record<string, Cr
|
|
|
45
49
|
|
|
46
50
|
declare class NoopCrdtDoc extends AbstractCrdtDoc<any> {
|
|
47
51
|
applyEncodedState(params: DocApplyEncodedStateParams): this;
|
|
48
|
-
batchApplyEncodedState(
|
|
52
|
+
batchApplyEncodedState(params: DocBatchApplyEncodedStateParams): this;
|
|
49
53
|
canRedo(): boolean;
|
|
50
54
|
canUndo(): boolean;
|
|
51
55
|
destroy(): void;
|
|
@@ -72,4 +76,4 @@ declare const noop: {
|
|
|
72
76
|
doc: (args?: any) => NoopCrdtDocFactory;
|
|
73
77
|
};
|
|
74
78
|
|
|
75
|
-
export { AbstractCrdtDoc, AbstractCrdtDocFactory, type CrdtType, type DocApplyEncodedStateParams, type DocSubscribeCallbackParams, type InferCrdtJson, NoopCrdtDoc, NoopCrdtDocFactory, noop };
|
|
79
|
+
export { AbstractCrdtDoc, AbstractCrdtDocFactory, type CrdtType, type DocApplyEncodedStateParams, type DocBatchApplyEncodedStateParams, type DocSubscribeCallbackParams, type InferCrdtJson, NoopCrdtDoc, NoopCrdtDocFactory, noop };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Json } from '@pluv/types';
|
|
1
|
+
import { Json, Maybe } from '@pluv/types';
|
|
2
2
|
|
|
3
3
|
type CrdtType<TValue extends unknown, TJson extends unknown = any> = Omit<TValue, "__pluvType"> & {
|
|
4
4
|
__pluvType: () => TJson;
|
|
@@ -9,7 +9,11 @@ type InferCrdtJson<T extends unknown> = T extends CrdtType<any, infer IJson> ? I
|
|
|
9
9
|
|
|
10
10
|
interface DocApplyEncodedStateParams {
|
|
11
11
|
origin?: string;
|
|
12
|
-
update?: string | Uint8Array
|
|
12
|
+
update?: Maybe<string | Uint8Array>;
|
|
13
|
+
}
|
|
14
|
+
interface DocBatchApplyEncodedStateParams {
|
|
15
|
+
origin?: string;
|
|
16
|
+
updates?: Maybe<readonly Maybe<string | Uint8Array>[]>;
|
|
13
17
|
}
|
|
14
18
|
interface DocSubscribeCallbackParams<T extends Record<string, CrdtType<any, any>>> {
|
|
15
19
|
doc: AbstractCrdtDoc<T>;
|
|
@@ -19,7 +23,7 @@ interface DocSubscribeCallbackParams<T extends Record<string, CrdtType<any, any>
|
|
|
19
23
|
}
|
|
20
24
|
declare abstract class AbstractCrdtDoc<T extends Record<string, CrdtType<any, any>>> {
|
|
21
25
|
abstract applyEncodedState(params: DocApplyEncodedStateParams): this;
|
|
22
|
-
abstract batchApplyEncodedState(
|
|
26
|
+
abstract batchApplyEncodedState(params: DocBatchApplyEncodedStateParams): this;
|
|
23
27
|
abstract canRedo(): boolean;
|
|
24
28
|
abstract canUndo(): boolean;
|
|
25
29
|
abstract destroy(): void;
|
|
@@ -45,7 +49,7 @@ declare abstract class AbstractCrdtDocFactory<TStorage extends Record<string, Cr
|
|
|
45
49
|
|
|
46
50
|
declare class NoopCrdtDoc extends AbstractCrdtDoc<any> {
|
|
47
51
|
applyEncodedState(params: DocApplyEncodedStateParams): this;
|
|
48
|
-
batchApplyEncodedState(
|
|
52
|
+
batchApplyEncodedState(params: DocBatchApplyEncodedStateParams): this;
|
|
49
53
|
canRedo(): boolean;
|
|
50
54
|
canUndo(): boolean;
|
|
51
55
|
destroy(): void;
|
|
@@ -72,4 +76,4 @@ declare const noop: {
|
|
|
72
76
|
doc: (args?: any) => NoopCrdtDocFactory;
|
|
73
77
|
};
|
|
74
78
|
|
|
75
|
-
export { AbstractCrdtDoc, AbstractCrdtDocFactory, type CrdtType, type DocApplyEncodedStateParams, type DocSubscribeCallbackParams, type InferCrdtJson, NoopCrdtDoc, NoopCrdtDocFactory, noop };
|
|
79
|
+
export { AbstractCrdtDoc, AbstractCrdtDocFactory, type CrdtType, type DocApplyEncodedStateParams, type DocBatchApplyEncodedStateParams, type DocSubscribeCallbackParams, type InferCrdtJson, NoopCrdtDoc, NoopCrdtDocFactory, noop };
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/crdt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.1",
|
|
4
4
|
"description": "crdt base for @pluv/io",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@pluv/types": "^0.
|
|
20
|
+
"@pluv/types": "^0.44.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"eslint": "^9.25.1",
|
|
24
24
|
"tsup": "^8.4.0",
|
|
25
25
|
"typescript": "^5.8.3",
|
|
26
|
-
"@pluv/tsconfig": "^0.
|
|
27
|
-
"eslint-config-pluv": "^0.
|
|
26
|
+
"@pluv/tsconfig": "^0.44.1",
|
|
27
|
+
"eslint-config-pluv": "^0.44.1"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/AbstractCrdtDoc.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import type { Maybe } from "@pluv/types";
|
|
1
2
|
import type { CrdtType, InferCrdtJson } from "./types";
|
|
2
3
|
|
|
3
4
|
export interface DocApplyEncodedStateParams {
|
|
4
5
|
origin?: string;
|
|
5
|
-
update?: string | Uint8Array
|
|
6
|
+
update?: Maybe<string | Uint8Array>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface DocBatchApplyEncodedStateParams {
|
|
10
|
+
origin?: string;
|
|
11
|
+
updates?: Maybe<readonly Maybe<string | Uint8Array>[]>;
|
|
6
12
|
}
|
|
7
13
|
|
|
8
14
|
export interface DocSubscribeCallbackParams<T extends Record<string, CrdtType<any, any>>> {
|
|
@@ -14,9 +20,7 @@ export interface DocSubscribeCallbackParams<T extends Record<string, CrdtType<an
|
|
|
14
20
|
|
|
15
21
|
export abstract class AbstractCrdtDoc<T extends Record<string, CrdtType<any, any>>> {
|
|
16
22
|
public abstract applyEncodedState(params: DocApplyEncodedStateParams): this;
|
|
17
|
-
public abstract batchApplyEncodedState(
|
|
18
|
-
updates: readonly (DocApplyEncodedStateParams | string | null | undefined)[],
|
|
19
|
-
): this;
|
|
23
|
+
public abstract batchApplyEncodedState(params: DocBatchApplyEncodedStateParams): this;
|
|
20
24
|
public abstract canRedo(): boolean;
|
|
21
25
|
public abstract canUndo(): boolean;
|
|
22
26
|
public abstract destroy(): void;
|
package/src/NoopCrdtDoc.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
DocApplyEncodedStateParams,
|
|
3
|
+
DocBatchApplyEncodedStateParams,
|
|
4
|
+
DocSubscribeCallbackParams,
|
|
5
|
+
} from "./AbstractCrdtDoc";
|
|
2
6
|
import { AbstractCrdtDoc } from "./AbstractCrdtDoc";
|
|
3
7
|
|
|
4
8
|
export class NoopCrdtDoc extends AbstractCrdtDoc<any> {
|
|
@@ -6,7 +10,7 @@ export class NoopCrdtDoc extends AbstractCrdtDoc<any> {
|
|
|
6
10
|
return this;
|
|
7
11
|
}
|
|
8
12
|
|
|
9
|
-
public batchApplyEncodedState(
|
|
13
|
+
public batchApplyEncodedState(params: DocBatchApplyEncodedStateParams): this {
|
|
10
14
|
return this;
|
|
11
15
|
}
|
|
12
16
|
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export { AbstractCrdtDoc } from "./AbstractCrdtDoc";
|
|
2
|
-
export type {
|
|
2
|
+
export type {
|
|
3
|
+
DocApplyEncodedStateParams,
|
|
4
|
+
DocBatchApplyEncodedStateParams,
|
|
5
|
+
DocSubscribeCallbackParams,
|
|
6
|
+
} from "./AbstractCrdtDoc";
|
|
3
7
|
export { AbstractCrdtDocFactory } from "./AbstractCrdtDocFactory";
|
|
8
|
+
export { noop } from "./noop";
|
|
4
9
|
export { NoopCrdtDoc } from "./NoopCrdtDoc";
|
|
5
10
|
export { NoopCrdtDocFactory } from "./NoopCrdtDocFactory";
|
|
6
|
-
export { noop } from "./noop";
|
|
7
11
|
export type { CrdtType, InferCrdtJson } from "./types";
|