@pluv/crdt 0.43.0 → 0.44.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @pluv/crdt@0.43.0 build /home/runner/work/pluv/pluv/packages/crdt
2
+ > @pluv/crdt@0.44.0 build /home/runner/work/pluv/pluv/packages/crdt
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -9,10 +9,10 @@
9
9
  ESM Build start
10
10
  CJS Build start
11
11
  CJS dist/index.js 2.43 KB
12
- CJS ⚡️ Build success in 25ms
12
+ CJS ⚡️ Build success in 57ms
13
13
  ESM dist/index.mjs 1.26 KB
14
- ESM ⚡️ Build success in 26ms
14
+ ESM ⚡️ Build success in 59ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 528ms
17
- DTS dist/index.d.mts 3.22 KB
18
- DTS dist/index.d.ts 3.22 KB
16
+ DTS ⚡️ Build success in 525ms
17
+ DTS dist/index.d.mts 3.32 KB
18
+ DTS dist/index.d.ts 3.32 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @pluv/crdt
2
2
 
3
+ ## 0.44.0
4
+
5
+ ### Patch Changes
6
+
7
+ - @pluv/types@0.44.0
8
+
3
9
  ## 0.43.0
4
10
 
5
11
  ### Patch Changes
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(updates: readonly (DocApplyEncodedStateParams | string | null | undefined)[]): this;
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(updates: readonly (string | DocApplyEncodedStateParams | null | undefined)[]): this;
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(updates: readonly (DocApplyEncodedStateParams | string | null | undefined)[]): this;
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(updates: readonly (string | DocApplyEncodedStateParams | null | undefined)[]): this;
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
@@ -41,7 +41,7 @@ var NoopCrdtDoc = class extends AbstractCrdtDoc {
41
41
  applyEncodedState(params) {
42
42
  return this;
43
43
  }
44
- batchApplyEncodedState(updates) {
44
+ batchApplyEncodedState(params) {
45
45
  return this;
46
46
  }
47
47
  canRedo() {
package/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ var NoopCrdtDoc = class extends AbstractCrdtDoc {
11
11
  applyEncodedState(params) {
12
12
  return this;
13
13
  }
14
- batchApplyEncodedState(updates) {
14
+ batchApplyEncodedState(params) {
15
15
  return this;
16
16
  }
17
17
  canRedo() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/crdt",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
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.43.0"
20
+ "@pluv/types": "^0.44.0"
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.43.0",
27
- "eslint-config-pluv": "^0.43.0"
26
+ "@pluv/tsconfig": "^0.44.0",
27
+ "eslint-config-pluv": "^0.44.0"
28
28
  },
29
29
  "scripts": {
30
30
  "build": "tsup src/index.ts --format esm,cjs --dts",
@@ -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;
@@ -1,4 +1,8 @@
1
- import type { DocApplyEncodedStateParams, DocSubscribeCallbackParams } from "./AbstractCrdtDoc";
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(updates: readonly (string | DocApplyEncodedStateParams | null | undefined)[]): this {
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 { DocApplyEncodedStateParams, DocSubscribeCallbackParams } from "./AbstractCrdtDoc";
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";