@coaction/yjs 1.5.0 → 2.0.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 +2 -2
- package/dist/index.d.mts +28 -22
- package/dist/index.d.ts +28 -22
- package/dist/index.js +709 -554
- package/dist/index.mjs +684 -548
- package/package.json +31 -39
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @coaction/yjs
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|
[](https://www.npmjs.com/package/@coaction/yjs)
|
|
5
5
|

|
|
6
6
|
|
|
@@ -138,4 +138,4 @@ Middleware wrapper around `bindYjs`. It also wires cleanup into `store.destroy()
|
|
|
138
138
|
|
|
139
139
|
## Documentation
|
|
140
140
|
|
|
141
|
-
You can find the project documentation [here](https://github.com/
|
|
141
|
+
You can find the project documentation [here](https://github.com/coactionjs/coaction).
|
package/dist/index.d.mts
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as Y from
|
|
3
|
-
export * from
|
|
1
|
+
import { Middleware, Store } from "coaction";
|
|
2
|
+
import * as Y from "yjs";
|
|
3
|
+
export * from "yjs";
|
|
4
4
|
|
|
5
|
+
//#region \0rolldown/runtime.js
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region packages/coaction-yjs/src/index.d.ts
|
|
5
8
|
type YjsBindingOptions = {
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
doc?: Y.Doc;
|
|
10
|
+
key?: string;
|
|
8
11
|
};
|
|
9
|
-
type YjsBinding<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
type YjsBinding<_T extends object> = {
|
|
13
|
+
doc: Y.Doc;
|
|
14
|
+
map: Y.Map<any>;
|
|
15
|
+
syncNow: () => void;
|
|
16
|
+
destroy: () => void;
|
|
17
|
+
__unsafeTestOnly__?: {
|
|
18
|
+
applyRemoteOperations: (operations: Array<{
|
|
19
|
+
type: 'set' | 'delete';
|
|
20
|
+
path: Array<string | number>;
|
|
21
|
+
value?: unknown;
|
|
22
|
+
}>) => void;
|
|
23
|
+
};
|
|
21
24
|
};
|
|
22
25
|
declare const __unsafeTestOnly__: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
getYValueAtPath: (root: Y.Map<unknown>, path: Array<string | number>) => unknown;
|
|
27
|
+
setAtPath: (target: any, path: Array<string | number>, value: unknown) => void;
|
|
28
|
+
deleteAtPath: (target: any, path: Array<string | number>) => void;
|
|
26
29
|
};
|
|
27
30
|
declare const bindYjs: <T extends object>(store: Store<T>, options?: YjsBindingOptions) => YjsBinding<T>;
|
|
28
31
|
declare const yjs: <T extends object>(options?: YjsBindingOptions) => Middleware<T>;
|
|
29
|
-
|
|
30
|
-
export {
|
|
32
|
+
declare namespace index_d_exports {
|
|
33
|
+
export { YjsBinding, YjsBindingOptions, __unsafeTestOnly__, bindYjs, yjs };
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { YjsBinding, YjsBindingOptions, __unsafeTestOnly__, bindYjs, yjs };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as Y from
|
|
3
|
-
export * from
|
|
1
|
+
import { Middleware, Store } from "coaction";
|
|
2
|
+
import * as Y from "yjs";
|
|
3
|
+
export * from "yjs";
|
|
4
4
|
|
|
5
|
+
//#region \0rolldown/runtime.js
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region packages/coaction-yjs/src/index.d.ts
|
|
5
8
|
type YjsBindingOptions = {
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
doc?: Y.Doc;
|
|
10
|
+
key?: string;
|
|
8
11
|
};
|
|
9
|
-
type YjsBinding<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
type YjsBinding<_T extends object> = {
|
|
13
|
+
doc: Y.Doc;
|
|
14
|
+
map: Y.Map<any>;
|
|
15
|
+
syncNow: () => void;
|
|
16
|
+
destroy: () => void;
|
|
17
|
+
__unsafeTestOnly__?: {
|
|
18
|
+
applyRemoteOperations: (operations: Array<{
|
|
19
|
+
type: 'set' | 'delete';
|
|
20
|
+
path: Array<string | number>;
|
|
21
|
+
value?: unknown;
|
|
22
|
+
}>) => void;
|
|
23
|
+
};
|
|
21
24
|
};
|
|
22
25
|
declare const __unsafeTestOnly__: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
getYValueAtPath: (root: Y.Map<unknown>, path: Array<string | number>) => unknown;
|
|
27
|
+
setAtPath: (target: any, path: Array<string | number>, value: unknown) => void;
|
|
28
|
+
deleteAtPath: (target: any, path: Array<string | number>) => void;
|
|
26
29
|
};
|
|
27
30
|
declare const bindYjs: <T extends object>(store: Store<T>, options?: YjsBindingOptions) => YjsBinding<T>;
|
|
28
31
|
declare const yjs: <T extends object>(options?: YjsBindingOptions) => Middleware<T>;
|
|
29
|
-
|
|
30
|
-
export {
|
|
32
|
+
declare namespace index_d_exports {
|
|
33
|
+
export { YjsBinding, YjsBindingOptions, __unsafeTestOnly__, bindYjs, yjs };
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { YjsBinding, YjsBindingOptions, __unsafeTestOnly__, bindYjs, yjs };
|