rhine-var 0.3.2 → 0.4.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 +149 -139
- package/README_zh.md +14 -8
- package/dist/core/class/array/RhineVarArray.d.ts +2 -2
- package/dist/core/class/array/RhineVarArray.d.ts.map +1 -1
- package/dist/core/event/Callback.d.ts +4 -1
- package/dist/core/event/Callback.d.ts.map +1 -1
- package/dist/core/event/ChangeType.d.ts +3 -3
- package/dist/core/event/ChangeType.d.ts.map +1 -1
- package/dist/core/native/Native.d.ts +2 -0
- package/dist/core/native/Native.d.ts.map +1 -1
- package/dist/core/proxy/ProxiedRhineVar.d.ts +7 -1
- package/dist/core/proxy/ProxiedRhineVar.d.ts.map +1 -1
- package/dist/core/proxy/ProxiedRhineVarItem.d.ts +7 -0
- package/dist/core/proxy/ProxiedRhineVarItem.d.ts.map +1 -0
- package/dist/core/proxy/ProxiedRhineVarItem.js +2 -0
- package/dist/core/proxy/Proxy.d.ts +5 -3
- package/dist/core/proxy/Proxy.d.ts.map +1 -1
- package/dist/core/proxy/Proxy.js +50 -19
- package/dist/core/proxy/RhineVar.d.ts +4 -26
- package/dist/core/proxy/RhineVar.d.ts.map +1 -1
- package/dist/core/proxy/RhineVar.js +11 -116
- package/dist/core/proxy/RhineVarItem.d.ts +38 -0
- package/dist/core/proxy/RhineVarItem.d.ts.map +1 -0
- package/dist/core/proxy/RhineVarItem.js +259 -0
- package/dist/core/proxy/RhineVarRoot.d.ts +8 -0
- package/dist/core/proxy/RhineVarRoot.d.ts.map +1 -0
- package/dist/core/proxy/RhineVarRoot.js +19 -0
- package/dist/core/utils/ConvertProperty.d.ts +2 -2
- package/dist/core/utils/ConvertProperty.d.ts.map +1 -1
- package/dist/core/utils/DataUtils.d.ts +4 -4
- package/dist/core/utils/DataUtils.d.ts.map +1 -1
- package/dist/core/utils/DataUtils.js +9 -6
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,139 +1,149 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
# RHINE-VAR: Simplest and
|
|
4
|
-
|
|
5
|
-
Rhine Variable — A self-synchronizing variable for collaboration.
|
|
6
|
-
Developing collaborative applications has never been this easy.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[English](README.md) | [中文](README_zh.md)
|
|
10
|
-
|
|
11
|
-
<img src='./assets/images/example1.png' style="border-radius: 10px
|
|
12
|
-
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
<br/>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<br/>
|
|
67
|
-
|
|
68
|
-
##
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
###
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
yarn
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# RHINE-VAR: Simplest and Powerful CRDT Library
|
|
4
|
+
|
|
5
|
+
Rhine Variable — A self-synchronizing variable for collaboration.
|
|
6
|
+
Developing collaborative applications has never been this easy.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
[English](README.md) | [中文](README_zh.md)
|
|
10
|
+
|
|
11
|
+
<img src='./assets/images/example1.png' style="border-radius: 10px"/>
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<br/>
|
|
16
|
+
|
|
17
|
+
<br/>
|
|
18
|
+
|
|
19
|
+
## Why Choose RHINE-VAR ?
|
|
20
|
+
|
|
21
|
+
### Concise and Efficient Syntax Design
|
|
22
|
+
RhineVar draws inspiration from the design philosophy of the Valtio state management library, `significantly reducing the learning curve`. Allowing developers to handle data seamlessly, as if `working with standard variables`.
|
|
23
|
+
|
|
24
|
+
### Almost No Size Limit
|
|
25
|
+
There is almost no upper limit. It can be an `Extremely Complex and Large Data Structure` to accommodate all the data for a large project. But at the very least, it is `a JavaScript Object`.
|
|
26
|
+
|
|
27
|
+
### Comprehensive Type Support
|
|
28
|
+
RhineVar offers full type hints and checks, ensuring `Precise Code Completion` and `Static Analysis` during development. This not only improves the development experience but also reduces potential errors, making it especially `suitable for TypeScript projects`, enhancing code safety and reliability.
|
|
29
|
+
|
|
30
|
+
### Distributed Real-time Collaboration Algorithm
|
|
31
|
+
The underlying collaboration algorithm of RhineVar is `Powered By the Robust Yjs Library`. Using the CRDT (Conflict-free Replicated Data Type) algorithm, it ensures eventual consistency even in multi-user and offline environments.
|
|
32
|
+
|
|
33
|
+
### High Performance with Low Bandwidth Requirements
|
|
34
|
+
The data synchronization and conflict resolution mechanism is highly efficient. Leveraging Yjs's `Incremental Update Mechanism`, only necessary data changes are transmitted rather than the entire document, making it ideal for bandwidth-constrained environments and reducing unnecessary data transfers.
|
|
35
|
+
|
|
36
|
+
### Strong Offline Support
|
|
37
|
+
Users can continue to work even while offline. Once reconnected, all changes are automatically synchronized, ensuring `no data is lost or conflicted`. This is crucial for building offline-first applications.
|
|
38
|
+
|
|
39
|
+
### Cross-platform and Framework Agnostic
|
|
40
|
+
RhineVar can be used in `All JavaScript Environments`, including browsers, Node.js, and other JavaScript platforms. It integrates with multiple frontend frameworks and libraries such as Next.js, React, Vue.js, ProseMirror, and more.
|
|
41
|
+
|
|
42
|
+
### Lightweight and Extensible
|
|
43
|
+
RhineVar is a highly lightweight library, with its core package `only a few KB` in size, making it suitable for various frontend applications. Its modular architecture supports feature extensions, allowing developers to import or develop custom modules as needed.
|
|
44
|
+
|
|
45
|
+
### Decentralized Architecture
|
|
46
|
+
With a decentralized architecture, collaborative editing becomes more scalable, efficient, and fault-tolerant. Peer-to-peer data transfer is supported without relying on a central server (currently under development).
|
|
47
|
+
|
|
48
|
+
### Native Yjs Support
|
|
49
|
+
RhineVar offers full support for native Yjs object operations, providing lower-level, richer API support. `Direct operations on Yjs objects automatically trigger updates in RhineVar`.
|
|
50
|
+
|
|
51
|
+
### More Friendly and Complete Event System
|
|
52
|
+
RhineVar offers an extensive event subscription and listening system with `Intuitive Data Change Events`. It also supports deep data change monitoring within objects, catering to a wide range of use cases.
|
|
53
|
+
|
|
54
|
+
### Fully Open Source
|
|
55
|
+
This is a fully open-source project, licensed under the `Apache-2.0 license` on GitHub. You are `Free to use it for both Commercial and Non-commercial Projects`, and it allows modification and distribution, as long as the original copyright notice is retained.
|
|
56
|
+
|
|
57
|
+
<br/>
|
|
58
|
+
|
|
59
|
+
## Contact Us
|
|
60
|
+
Welcome to join our WeChat group for communication. We look forward to having more community members participate in the creation of rhine-var.
|
|
61
|
+
|
|
62
|
+
WeChat: [FNA-04]()
|
|
63
|
+
|
|
64
|
+
Email: [RhineAILab@gmail.com](rhineailab@gmail.com) & [RhineAI@163.com](RhineAI@163.com)
|
|
65
|
+
|
|
66
|
+
<br/>
|
|
67
|
+
|
|
68
|
+
## Install
|
|
69
|
+
```bash
|
|
70
|
+
yarn add rhine-var
|
|
71
|
+
```
|
|
72
|
+
If you don't have `yarn`, you can install it via `npm i rhine-var`, or install `yarn` first using `npm i -g yarn` and then use the command above to install.
|
|
73
|
+
|
|
74
|
+
<br/>
|
|
75
|
+
|
|
76
|
+
## Usage
|
|
77
|
+
|
|
78
|
+
```typescript jsx
|
|
79
|
+
const defaultValue = {value: 0}
|
|
80
|
+
const count = rhineProxy(defaultValue, 'localhost:6600/room-0')
|
|
81
|
+
|
|
82
|
+
function Counter() {
|
|
83
|
+
|
|
84
|
+
const countSnap = useRhine(count)
|
|
85
|
+
|
|
86
|
+
return <div>
|
|
87
|
+
<button onClick={() => count.value-- }> - 1 </button>
|
|
88
|
+
<span>{countSnap.value}</span>
|
|
89
|
+
<button onClick={() => count.value++ }> + 1 </button>
|
|
90
|
+
</div>
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
### Default Value
|
|
94
|
+
|
|
95
|
+
When the room does not exist on the server, a default value will be used to create the room. If not connected to the server, data from the default value will also be returned.
|
|
96
|
+
|
|
97
|
+
### Room ID
|
|
98
|
+
|
|
99
|
+
<room-id> can be any text, with each Room ID corresponding to a RhineVariable, and users who join with the same Room ID will experience real-time multi-user collaboration.
|
|
100
|
+
|
|
101
|
+
Regarding the server-side, it will be mentioned below.
|
|
102
|
+
|
|
103
|
+
### rhineProxy
|
|
104
|
+
|
|
105
|
+
Create a `RhineVariable` that anyone in the room can directly modify, and the value will be synchronized to everyone real-time.
|
|
106
|
+
|
|
107
|
+
Its data structure `can be quite complex`, but `at least`, it is `an object` in JavaScript.
|
|
108
|
+
|
|
109
|
+
### useRhine
|
|
110
|
+
|
|
111
|
+
A hook for use with React. It creates a snapshot of a `RhineVariable`, and whenever someone modifies this value, the information will be `updated on everyone's screen` in real-time.
|
|
112
|
+
|
|
113
|
+
Use snapshot only when data needs to be displayed on the React page. For other operations, such as modifying values, please use RhineVariable itself.
|
|
114
|
+
|
|
115
|
+
<br/>
|
|
116
|
+
|
|
117
|
+
## Server
|
|
118
|
+
We provide a simple server as a reference, located at `/test/server` in this project. The server is fully compatible with all Yjs websocket servers.
|
|
119
|
+
```
|
|
120
|
+
git clone https://github.com/RhineAI-Lab/rhine-var.git
|
|
121
|
+
cd test/server
|
|
122
|
+
yarn install
|
|
123
|
+
yarn start
|
|
124
|
+
```
|
|
125
|
+
It will run on `Port 6600`, and you can connect to it via `ws://localhost:6600/<room-id>`. `<room-id>` can be any text, with each room ID corresponding to a `RhineVariable`.
|
|
126
|
+
|
|
127
|
+
More information about server develop: [https://docs.yjs.dev/ecosystem/connection-provider/y-websocket](https://docs.yjs.dev/ecosystem/connection-provider/y-websocket)
|
|
128
|
+
|
|
129
|
+
<br/>
|
|
130
|
+
|
|
131
|
+
## Develop
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# start watch and build by typescript
|
|
135
|
+
yarn run watch
|
|
136
|
+
|
|
137
|
+
# start a easy websocket server
|
|
138
|
+
cd test/server
|
|
139
|
+
yarn install
|
|
140
|
+
yarn start
|
|
141
|
+
|
|
142
|
+
# start a nextjs playground for develop debug
|
|
143
|
+
cd test/debug/next-app
|
|
144
|
+
yarn install
|
|
145
|
+
yarn start
|
|
146
|
+
# Open http://localhost:3000 in browser
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
<br/>
|
package/README_zh.md
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
**简洁高效的语法设计:** RhineVar 借鉴了 Valtio 状态管理库的设计理念,极大地降低了学习成本。开发者可以像操作普通变量一样轻松操控协同数据。
|
|
18
18
|
|
|
19
|
+
**几乎没有体积上限:** 它几乎没有体积限制,可以是一个极其复杂且庞大的数据结构,以容纳一个大型项目所需的所有数据。但至少是一个 JavaScript 对象。
|
|
20
|
+
|
|
19
21
|
**完备的类型支持:** RhineVar 提供全面的类型提示和类型检查,确保在开发过程中能够获得精确的代码补全和静态分析。这不仅改善了开发体验,还有效降低了潜在的错误风险,特别适用于 TypeScript 项目,提升了代码的安全性和可靠性。
|
|
20
22
|
|
|
21
23
|
**分布式实时协作算法:** RhineVar 的底层协同算法基于强大的 Yjs 库。通过 CRDT (Conflict-free Replicated Data Type,无冲突复制数据类型) 算法,确保多用户同时使用,甚至离线下使用的最终一致性。
|
|
@@ -24,7 +26,7 @@
|
|
|
24
26
|
|
|
25
27
|
**强大的离线支持:** 即使在离线状态下,用户仍然可以继续使用应用。当重新联机时,所有更改将自动同步,确保数据不会出现丢失或冲突。这对于构建离线优先的应用至关重要。
|
|
26
28
|
|
|
27
|
-
**跨平台和框架无关:** RhineVar 支持在多种环境中使用,包括浏览器、Node.js
|
|
29
|
+
**跨平台和框架无关:** RhineVar 支持在多种环境中使用,包括浏览器、Node.js 和其它 JavaScript 环境。此外,它可以与多个前端框架和库 (如 NextJs、React、Vue.js、ProseMirror 等) 集成。
|
|
28
30
|
|
|
29
31
|
**轻量级且可扩展:** RhineVar 是一个非常轻量的库,核心包仅几 KB,适合各种前端应用。其模块化架构也支持扩展特性,开发者可以根据需要引入或开发自定义模块。
|
|
30
32
|
|
|
@@ -34,11 +36,13 @@
|
|
|
34
36
|
|
|
35
37
|
**更友好且完善的事件体系:** RhineVar 提供了丰富的事件订阅监听方式,直观的数据变更事件,更好的支持数据变更的监听和处理。以及提供了对内部深层数据变化的监听,以适用更多场景。
|
|
36
38
|
|
|
39
|
+
**完全开源:** 这是个完全开源的项目,本库在 Github 上以 Apache-2.0 许可证发布。您可以自由将其用于商业和非商业项目,并且允许对其进行修改和分发,只需要保留原作者的版权声明。
|
|
40
|
+
|
|
37
41
|
<br/>
|
|
38
42
|
|
|
39
43
|
## Contact Us
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
欢迎加入我们的微信群一起讨论交流,我们期待更多的社区开发者能加入到 RHINE-VAR 的创造中!
|
|
42
46
|
|
|
43
47
|
微信: [FNA-04]() (请备注来源)
|
|
44
48
|
|
|
@@ -79,19 +83,21 @@ function Counter() {
|
|
|
79
83
|
|
|
80
84
|
一个房间号对应一个状态变量, 加入到一个房间中的用户会参与到多人协同中。
|
|
81
85
|
|
|
86
|
+
关于服务端,下方将会提及。
|
|
87
|
+
|
|
82
88
|
### rhineProxy
|
|
83
89
|
|
|
84
|
-
用于创建一个 `RhineVariable`
|
|
90
|
+
用于创建一个 `RhineVariable` 它的值会和房间中的其他人共享并同步。
|
|
85
91
|
|
|
86
|
-
你可以像操作 JavaScript
|
|
92
|
+
你可以像操作 JavaScript 中的普通变量一样直接随意操作它。
|
|
87
93
|
|
|
88
|
-
|
|
94
|
+
它内部的数据结构可以很复杂,但至少是 JavaScript 中的一个 object。
|
|
89
95
|
|
|
90
96
|
### useRhine
|
|
91
97
|
|
|
92
|
-
一个 `React` 的 `Hook` 函数.
|
|
98
|
+
一个 `React` 的 `Hook` 函数. 它将为 `RhineVariable` 创建一个快照, 用于自动热重载更新页面。当任何人对值做出修改时,它会把最新的值立刻更新到所有人的屏幕上。
|
|
93
99
|
|
|
94
|
-
只有页面需要数据的时候使用 `useRhine`
|
|
100
|
+
只有页面需要数据的时候使用 `useRhine` 创造的快照。在其它操作,例如赋值时,请操作原来的 `RhineVariable`。
|
|
95
101
|
|
|
96
102
|
<br/>
|
|
97
103
|
|
|
@@ -103,7 +109,7 @@ cd test/server
|
|
|
103
109
|
yarn install
|
|
104
110
|
yarn start
|
|
105
111
|
```
|
|
106
|
-
默认运行在 `端口 6600`, 你可以通过连接 `ws://localhost:6600/<room-id>`
|
|
112
|
+
默认运行在 `端口 6600`, 你可以通过连接 `ws://localhost:6600/<room-id>` 连接它,`<room-id>` 可以是任意文本,一个房间号对应一个 `RhineVariable`。
|
|
107
113
|
|
|
108
114
|
更多服务端开发信息请参考: [https://docs.yjs.dev/ecosystem/connection-provider/y-websocket](https://docs.yjs.dev/ecosystem/connection-provider/y-websocket)
|
|
109
115
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class RhineVarArray<T> extends Array<T |
|
|
1
|
+
import RhineVarItem from "../../proxy/RhineVarItem";
|
|
2
|
+
export default class RhineVarArray<T> extends Array<T | RhineVarItem<T[]>> {
|
|
3
3
|
}
|
|
4
4
|
//# sourceMappingURL=RhineVarArray.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RhineVarArray.d.ts","sourceRoot":"","sources":["../../../../src/core/class/array/RhineVarArray.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"RhineVarArray.d.ts","sourceRoot":"","sources":["../../../../src/core/class/array/RhineVarArray.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,iCAAkC;AAErD,MAAM,CAAC,OAAO,OAAO,aAAa,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC;CAEzE"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ChangeType } from "./ChangeType";
|
|
2
2
|
import { Transaction, YArrayEvent, YMapEvent } from "yjs";
|
|
3
|
-
|
|
3
|
+
import { YPath } from "../native/Native";
|
|
4
|
+
import { ProxiedRhineVarItem } from "../proxy/ProxiedRhineVar";
|
|
5
|
+
export type Callback<T> = (key: keyof T, value: T[keyof T] | ProxiedRhineVarItem<T[keyof T]>, oldValue: T[keyof T], type: ChangeType, nativeEvent: YMapEvent<any> | YArrayEvent<any>, nativeTransaction: Transaction) => void;
|
|
6
|
+
export type DeepCallback<T> = (path: YPath, value: any | ProxiedRhineVarItem<any>, oldValue: any, type: ChangeType, nativeEvent: YMapEvent<any> | YArrayEvent<any>, nativeTransaction: Transaction) => void;
|
|
4
7
|
//# sourceMappingURL=Callback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callback.d.ts","sourceRoot":"","sources":["../../../src/core/event/Callback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,qBAAgC;AACnD,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"Callback.d.ts","sourceRoot":"","sources":["../../../src/core/event/Callback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,qBAAgC;AACnD,OAAO,EAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,KAAK,CAAC;AACxD,OAAO,EAAS,KAAK,EAAC,yBAA6B;AACnD,OAAO,EAAC,mBAAmB,EAAC,iCAAqC;AAGjE,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CACxB,GAAG,EAAE,MAAM,CAAC,EACZ,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EACnD,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EACpB,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,EAC9C,iBAAiB,EAAE,WAAW,KAC3B,IAAI,CAAA;AAET,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAC5B,IAAI,EAAE,KAAK,EACX,KAAK,EAAE,GAAG,GAAG,mBAAmB,CAAC,GAAG,CAAC,EACrC,QAAQ,EAAE,GAAG,EACb,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,EAC9C,iBAAiB,EAAE,WAAW,KAC3B,IAAI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChangeType.d.ts","sourceRoot":"","sources":["../../../src/core/event/ChangeType.ts"],"names":[],"mappings":"AACA,oBAAY,UAAU;IACpB,GAAG,QAAQ;
|
|
1
|
+
{"version":3,"file":"ChangeType.d.ts","sourceRoot":"","sources":["../../../src/core/event/ChangeType.ts"],"names":[],"mappings":"AACA,oBAAY,UAAU;IACpB,GAAG,QAAQ,CAAG,oBAAoB;IAClC,MAAM,WAAW,CAAG,WAAW;IAC/B,MAAM,WAAW,CAAG,oBAAoB;IACxC,IAAI,SAAS;CACd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Native.d.ts","sourceRoot":"","sources":["../../../src/core/native/Native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,IAAI,MAAM,EAAE,GAAG,IAAI,IAAI,EAAC,MAAM,KAAK,CAAC;AAEjD,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"Native.d.ts","sourceRoot":"","sources":["../../../src/core/native/Native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,IAAI,MAAM,EAAE,GAAG,IAAI,IAAI,EAAC,MAAM,KAAK,CAAC;AAEjD,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;AAE5C,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;AAElC,MAAM,MAAM,KAAK,GAAG,IAAI,EAAE,CAAA"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import RhineVarItem from "./RhineVarItem";
|
|
1
2
|
import RhineVar from "./RhineVar";
|
|
3
|
+
export type RecursiveCrossRhineVarItem<T> = {
|
|
4
|
+
[K in keyof T]: T[K] extends object ? RecursiveCrossRhineVarItem<T[K]> & RhineVarItem<T[K]> : T[K];
|
|
5
|
+
};
|
|
6
|
+
export type StoredRhineVarItem<T> = T & RecursiveCrossRhineVarItem<T> & RhineVarItem<T>;
|
|
7
|
+
export type ProxiedRhineVarItem<T> = StoredRhineVarItem<T>;
|
|
2
8
|
export type RecursiveCrossRhineVar<T> = {
|
|
3
|
-
[K in keyof T]: T[K] extends object ?
|
|
9
|
+
[K in keyof T]: T[K] extends object ? RecursiveCrossRhineVarItem<T[K]> & RhineVarItem<T[K]> : T[K];
|
|
4
10
|
};
|
|
5
11
|
export type StoredRhineVar<T> = T & RecursiveCrossRhineVar<T> & RhineVar<T>;
|
|
6
12
|
export type ProxiedRhineVar<T> = StoredRhineVar<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProxiedRhineVar.d.ts","sourceRoot":"","sources":["../../../src/core/proxy/ProxiedRhineVar.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,mBAA8B;AAE7C,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI;KACrC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"ProxiedRhineVar.d.ts","sourceRoot":"","sources":["../../../src/core/proxy/ProxiedRhineVar.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,uBAAkC;AACrD,OAAO,QAAQ,mBAA8B;AAE7C,MAAM,MAAM,0BAA0B,CAAC,CAAC,IAAI;KACzC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACnG,CAAA;AAED,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,0BAA0B,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAA;AAEvF,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAAA;AAG1D,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI;KACrC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACnG,CAAA;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;AAE3E,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import RhineVarItem from "./RhineVarItem";
|
|
2
|
+
export type RecursiveCrossRhineVar<T> = {
|
|
3
|
+
[K in keyof T]: T[K] extends object ? RecursiveCrossRhineVar<T[K]> & RhineVarItem<T[K]> : T[K];
|
|
4
|
+
};
|
|
5
|
+
export type StoredRhineVar<T> = T & RecursiveCrossRhineVar<T> & RhineVarItem<T>;
|
|
6
|
+
export type ProxiedRhineVar<T> = StoredRhineVar<T>;
|
|
7
|
+
//# sourceMappingURL=ProxiedRhineVarItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProxiedRhineVarItem.d.ts","sourceRoot":"","sources":["../../../src/core/proxy/ProxiedRhineVarItem.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,uBAAkC;AAErD,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI;KACrC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC/F,CAAA;AAED,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAA;AAE/E,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import WebsocketRhineConnector from "../connector/WebsocketRhineConnector";
|
|
2
|
-
import
|
|
2
|
+
import RhineVarItem from "./RhineVarItem";
|
|
3
|
+
import { ProxiedRhineVar, ProxiedRhineVarItem } from "./ProxiedRhineVar";
|
|
3
4
|
import { Native } from "../native/Native";
|
|
5
|
+
import RhineVar from "./RhineVar";
|
|
4
6
|
export declare const PROTOCOL_LIST: string[];
|
|
5
7
|
export declare const DEFAULT_PROTOCOL_LIST: string;
|
|
6
|
-
export declare function rhineProxy<T extends object>(data: T, connector
|
|
7
|
-
export declare function
|
|
8
|
+
export declare function rhineProxy<T extends object>(data: T | Native, connector: WebsocketRhineConnector | string, overwrite?: boolean | number): ProxiedRhineVar<T>;
|
|
9
|
+
export declare function rhineProxyItem<T extends object>(data: T | Native, parent?: RhineVar<any> | RhineVarItem<any> | null): ProxiedRhineVarItem<T> | ProxiedRhineVar<T>;
|
|
8
10
|
//# sourceMappingURL=Proxy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Proxy.d.ts","sourceRoot":"","sources":["../../../src/core/proxy/Proxy.ts"],"names":[],"mappings":"AACA,OAAO,uBAAgD,6CAAiD;
|
|
1
|
+
{"version":3,"file":"Proxy.d.ts","sourceRoot":"","sources":["../../../src/core/proxy/Proxy.ts"],"names":[],"mappings":"AACA,OAAO,uBAAgD,6CAAiD;AACxG,OAAO,YAA+C,uBAAkC;AAIxF,OAAO,EAAC,eAAe,EAAE,mBAAmB,EAAC,0BAAqC;AAClF,OAAO,EAAC,MAAM,EAAC,yBAA6B;AAS5C,OAAO,QAAQ,mBAA8B;AAG7C,eAAO,MAAM,aAAa,UAAsB,CAAA;AAChD,eAAO,MAAM,qBAAqB,QAAmB,CAAA;AAGrD,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EACzC,IAAI,EAAE,CAAC,GAAG,MAAM,EAChB,SAAS,EAAE,uBAAuB,GAAG,MAAM,EAC3C,SAAS,GAAE,OAAO,GAAG,MAAc,GAClC,eAAe,CAAC,CAAC,CAAC,CA6CpB;AAGD,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAC7C,IAAI,EAAE,CAAC,GAAG,MAAM,EAChB,MAAM,GAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,IAAW,GACtD,mBAAmB,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAgG7C"}
|