@pluv/crdt-yjs 3.0.0 → 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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +7 -0
- package/dist/index.d.mts +8 -6
- package/dist/index.d.ts +8 -6
- package/package.json +5 -5
- package/src/awareness/PluvYjsAwareness.ts +1 -1
- package/src/awareness/awareness.ts +1 -1
- package/src/index.ts +4 -0
- package/src/provider/PluvYjsProvider.ts +2 -2
- package/src/provider/provider.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/crdt-yjs@3.
|
|
2
|
+
> @pluv/crdt-yjs@3.1.0 build /home/runner/work/pluv/pluv/packages/crdt-yjs
|
|
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[32m17.76 KB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in 85ms
|
|
13
11
|
[32mESM[39m [1mdist/index.mjs [22m[32m16.84 KB[39m
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 92ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m17.76 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 99ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m10.
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m10.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 4887ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m10.73 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m10.73 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -29,7 +29,7 @@ type AwarenessPresence<TPresence extends Record<string, any>, TField extends key
|
|
|
29
29
|
|
|
30
30
|
declare const array: <T extends unknown>(value?: T[] | readonly T[]) => YjsType<Array<T>, T[]>;
|
|
31
31
|
|
|
32
|
-
interface PluvYjsAwarenessParams<TIO extends IOLike<any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null> {
|
|
32
|
+
interface PluvYjsAwarenessParams<TIO extends IOLike<any, any, any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null> {
|
|
33
33
|
presenceField?: TField;
|
|
34
34
|
room: RoomLike<TIO, Doc, TPresence, TStorage, TEvents>;
|
|
35
35
|
}
|
|
@@ -72,7 +72,7 @@ declare class PluvYjsAwareness<TIO extends IOLike, TPresence extends Record<stri
|
|
|
72
72
|
readonly _checkInterval: number;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
declare const awareness: <TIO extends IOLike<any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null>(params: PluvYjsAwarenessParams<TIO, TPresence, TStorage, TEvents, TField>) => PluvYjsAwareness<TIO, TPresence, TStorage, TEvents, TField>;
|
|
75
|
+
declare const awareness: <TIO extends IOLike<any, any, any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null>(params: PluvYjsAwarenessParams<TIO, TPresence, TStorage, TEvents, TField>) => PluvYjsAwareness<TIO, TPresence, TStorage, TEvents, TField>;
|
|
76
76
|
|
|
77
77
|
type YjsBuilder = ReturnType<typeof builder>;
|
|
78
78
|
declare const builder: (doc: Doc) => {
|
|
@@ -122,7 +122,7 @@ declare const doc: <TStorage extends Record<string, YjsType<any, any>>>(value?:
|
|
|
122
122
|
|
|
123
123
|
declare const map: <T extends unknown>(value?: readonly (readonly [key: string, value: T])[]) => YjsType<Map$1<T>, Record<string, T>>;
|
|
124
124
|
|
|
125
|
-
interface PluvYjsProviderParams<TIO extends IOLike<any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null> {
|
|
125
|
+
interface PluvYjsProviderParams<TIO extends IOLike<any, any, any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null> {
|
|
126
126
|
presenceField?: TField;
|
|
127
127
|
room: RoomLike<TIO, Doc, TPresence, TStorage, TEvents>;
|
|
128
128
|
}
|
|
@@ -132,7 +132,7 @@ interface PluvYjsProviderParams<TIO extends IOLike<any>, TPresence extends Recor
|
|
|
132
132
|
* Connections and document syncing are handled by the PluvRoom already.
|
|
133
133
|
* @date May 13, 2025
|
|
134
134
|
*/
|
|
135
|
-
declare class PluvYjsProvider<TIO extends IOLike<any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null> extends ObservableV2<{
|
|
135
|
+
declare class PluvYjsProvider<TIO extends IOLike<any, any, any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null> extends ObservableV2<{
|
|
136
136
|
"connection-close": (event: CloseEvent | null, provider: PluvYjsProvider<TIO, TPresence, TStorage, TEvents, TField>) => void;
|
|
137
137
|
"connection-error": (event: Event, provider: PluvYjsProvider<TIO, TPresence, TStorage, TEvents, TField>) => void;
|
|
138
138
|
status: (event: {
|
|
@@ -162,7 +162,7 @@ declare class PluvYjsProvider<TIO extends IOLike<any>, TPresence extends Record<
|
|
|
162
162
|
disconnect(): void;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
declare const provider: <TIO extends IOLike<any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null>(params: PluvYjsProviderParams<TIO, TPresence, TStorage, TEvents, TField>) => PluvYjsProvider<TIO, TPresence, TStorage, TEvents, TField>;
|
|
165
|
+
declare const provider: <TIO extends IOLike<any, any, any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null>(params: PluvYjsProviderParams<TIO, TPresence, TStorage, TEvents, TField>) => PluvYjsProvider<TIO, TPresence, TStorage, TEvents, TField>;
|
|
166
166
|
|
|
167
167
|
declare const text: (value?: string) => YjsType<Text, string>;
|
|
168
168
|
|
|
@@ -202,4 +202,6 @@ declare namespace yjs {
|
|
|
202
202
|
export { type yjs_YjsBuilder as YjsBuilder, type yjs_YjsType as YjsType, yjs_array as array, yjs_awareness as awareness, yjs_doc as doc, yjs_kind as kind, yjs_map as map, yjs_provider as provider, yjs_text as text, yjs_xmlElement as xmlElement, yjs_xmlFragment as xmlFragment, yjs_xmlText as xmlText };
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
type YjsLibraryType = typeof yjs;
|
|
206
|
+
|
|
207
|
+
export { type YjsLibraryType, yjs };
|
package/dist/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ type AwarenessPresence<TPresence extends Record<string, any>, TField extends key
|
|
|
29
29
|
|
|
30
30
|
declare const array: <T extends unknown>(value?: T[] | readonly T[]) => YjsType<Array<T>, T[]>;
|
|
31
31
|
|
|
32
|
-
interface PluvYjsAwarenessParams<TIO extends IOLike<any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null> {
|
|
32
|
+
interface PluvYjsAwarenessParams<TIO extends IOLike<any, any, any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null> {
|
|
33
33
|
presenceField?: TField;
|
|
34
34
|
room: RoomLike<TIO, Doc, TPresence, TStorage, TEvents>;
|
|
35
35
|
}
|
|
@@ -72,7 +72,7 @@ declare class PluvYjsAwareness<TIO extends IOLike, TPresence extends Record<stri
|
|
|
72
72
|
readonly _checkInterval: number;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
declare const awareness: <TIO extends IOLike<any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null>(params: PluvYjsAwarenessParams<TIO, TPresence, TStorage, TEvents, TField>) => PluvYjsAwareness<TIO, TPresence, TStorage, TEvents, TField>;
|
|
75
|
+
declare const awareness: <TIO extends IOLike<any, any, any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null>(params: PluvYjsAwarenessParams<TIO, TPresence, TStorage, TEvents, TField>) => PluvYjsAwareness<TIO, TPresence, TStorage, TEvents, TField>;
|
|
76
76
|
|
|
77
77
|
type YjsBuilder = ReturnType<typeof builder>;
|
|
78
78
|
declare const builder: (doc: Doc) => {
|
|
@@ -122,7 +122,7 @@ declare const doc: <TStorage extends Record<string, YjsType<any, any>>>(value?:
|
|
|
122
122
|
|
|
123
123
|
declare const map: <T extends unknown>(value?: readonly (readonly [key: string, value: T])[]) => YjsType<Map$1<T>, Record<string, T>>;
|
|
124
124
|
|
|
125
|
-
interface PluvYjsProviderParams<TIO extends IOLike<any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null> {
|
|
125
|
+
interface PluvYjsProviderParams<TIO extends IOLike<any, any, any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null> {
|
|
126
126
|
presenceField?: TField;
|
|
127
127
|
room: RoomLike<TIO, Doc, TPresence, TStorage, TEvents>;
|
|
128
128
|
}
|
|
@@ -132,7 +132,7 @@ interface PluvYjsProviderParams<TIO extends IOLike<any>, TPresence extends Recor
|
|
|
132
132
|
* Connections and document syncing are handled by the PluvRoom already.
|
|
133
133
|
* @date May 13, 2025
|
|
134
134
|
*/
|
|
135
|
-
declare class PluvYjsProvider<TIO extends IOLike<any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null> extends ObservableV2<{
|
|
135
|
+
declare class PluvYjsProvider<TIO extends IOLike<any, any, any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null> extends ObservableV2<{
|
|
136
136
|
"connection-close": (event: CloseEvent | null, provider: PluvYjsProvider<TIO, TPresence, TStorage, TEvents, TField>) => void;
|
|
137
137
|
"connection-error": (event: Event, provider: PluvYjsProvider<TIO, TPresence, TStorage, TEvents, TField>) => void;
|
|
138
138
|
status: (event: {
|
|
@@ -162,7 +162,7 @@ declare class PluvYjsProvider<TIO extends IOLike<any>, TPresence extends Record<
|
|
|
162
162
|
disconnect(): void;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
declare const provider: <TIO extends IOLike<any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null>(params: PluvYjsProviderParams<TIO, TPresence, TStorage, TEvents, TField>) => PluvYjsProvider<TIO, TPresence, TStorage, TEvents, TField>;
|
|
165
|
+
declare const provider: <TIO extends IOLike<any, any, any>, TPresence extends Record<string, any>, TStorage extends Record<string, CrdtType$1<any, any>>, TEvents extends PluvRouterEventConfig, TField extends keyof TPresence | null = null>(params: PluvYjsProviderParams<TIO, TPresence, TStorage, TEvents, TField>) => PluvYjsProvider<TIO, TPresence, TStorage, TEvents, TField>;
|
|
166
166
|
|
|
167
167
|
declare const text: (value?: string) => YjsType<Text, string>;
|
|
168
168
|
|
|
@@ -202,4 +202,6 @@ declare namespace yjs {
|
|
|
202
202
|
export { type yjs_YjsBuilder as YjsBuilder, type yjs_YjsType as YjsType, yjs_array as array, yjs_awareness as awareness, yjs_doc as doc, yjs_kind as kind, yjs_map as map, yjs_provider as provider, yjs_text as text, yjs_xmlElement as xmlElement, yjs_xmlFragment as xmlFragment, yjs_xmlText as xmlText };
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
type YjsLibraryType = typeof yjs;
|
|
206
|
+
|
|
207
|
+
export { type YjsLibraryType, yjs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/crdt-yjs",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "yjs for @pluv/io",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"@types/node": "^22.15.21",
|
|
21
21
|
"js-base64": "^3.7.7",
|
|
22
22
|
"lib0": "^0.2.108",
|
|
23
|
-
"@pluv/crdt": "^3.
|
|
24
|
-
"@pluv/types": "^3.
|
|
23
|
+
"@pluv/crdt": "^3.1.0",
|
|
24
|
+
"@pluv/types": "^3.1.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"yjs": "^13.0.0"
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"tsup": "^8.5.0",
|
|
32
32
|
"typescript": "^5.8.3",
|
|
33
33
|
"yjs": "^13.6.27",
|
|
34
|
-
"@pluv/tsconfig": "^3.
|
|
35
|
-
"eslint-config-pluv": "^3.
|
|
34
|
+
"@pluv/tsconfig": "^3.1.0",
|
|
35
|
+
"eslint-config-pluv": "^3.1.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
@@ -12,7 +12,7 @@ import { PLUV_PRESENCE_META_KEY, PLUV_PRESENCE_Y_ID_KEY } from "../constants";
|
|
|
12
12
|
import type { AwarenessPresence, MetaClientState, YjsAwarenessUpdate } from "../types";
|
|
13
13
|
|
|
14
14
|
export interface PluvYjsAwarenessParams<
|
|
15
|
-
TIO extends IOLike<any>,
|
|
15
|
+
TIO extends IOLike<any, any, any>,
|
|
16
16
|
TPresence extends Record<string, any>,
|
|
17
17
|
TStorage extends Record<string, CrdtType<any, any>>,
|
|
18
18
|
TEvents extends PluvRouterEventConfig,
|
|
@@ -3,7 +3,7 @@ import type { PluvYjsAwarenessParams } from "./PluvYjsAwareness";
|
|
|
3
3
|
import { PluvYjsAwareness } from "./PluvYjsAwareness";
|
|
4
4
|
|
|
5
5
|
export const awareness = <
|
|
6
|
-
TIO extends IOLike<any>,
|
|
6
|
+
TIO extends IOLike<any, any, any>,
|
|
7
7
|
TPresence extends Record<string, any>,
|
|
8
8
|
TStorage extends Record<string, CrdtType<any, any>>,
|
|
9
9
|
TEvents extends PluvRouterEventConfig,
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { awareness } from "../awareness";
|
|
|
7
7
|
import type { YjsProviderStatus } from "../types";
|
|
8
8
|
|
|
9
9
|
export interface PluvYjsProviderParams<
|
|
10
|
-
TIO extends IOLike<any>,
|
|
10
|
+
TIO extends IOLike<any, any, any>,
|
|
11
11
|
TPresence extends Record<string, any>,
|
|
12
12
|
TStorage extends Record<string, CrdtType<any, any>>,
|
|
13
13
|
TEvents extends PluvRouterEventConfig,
|
|
@@ -24,7 +24,7 @@ export interface PluvYjsProviderParams<
|
|
|
24
24
|
* @date May 13, 2025
|
|
25
25
|
*/
|
|
26
26
|
export class PluvYjsProvider<
|
|
27
|
-
TIO extends IOLike<any>,
|
|
27
|
+
TIO extends IOLike<any, any, any>,
|
|
28
28
|
TPresence extends Record<string, any>,
|
|
29
29
|
TStorage extends Record<string, CrdtType<any, any>>,
|
|
30
30
|
TEvents extends PluvRouterEventConfig,
|
package/src/provider/provider.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { PluvYjsProviderParams } from "./PluvYjsProvider";
|
|
|
3
3
|
import { PluvYjsProvider } from "./PluvYjsProvider";
|
|
4
4
|
|
|
5
5
|
export const provider = <
|
|
6
|
-
TIO extends IOLike<any>,
|
|
6
|
+
TIO extends IOLike<any, any, any>,
|
|
7
7
|
TPresence extends Record<string, any>,
|
|
8
8
|
TStorage extends Record<string, CrdtType<any, any>>,
|
|
9
9
|
TEvents extends PluvRouterEventConfig,
|