@lytjs/reactivity 4.1.0 → 5.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 +202 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/signal.cjs +1 -1
- package/dist/signal.mjs +1 -1
- package/dist/types/effect.d.ts +10 -5
- package/dist/types/effect.d.ts.map +1 -1
- package/dist/types/ref.d.ts.map +1 -1
- package/dist/types/scheduler.d.ts.map +1 -1
- package/dist/types/signal.d.ts +23 -1
- package/dist/types/signal.d.ts.map +1 -1
- package/dist/types/watch.d.ts.map +1 -1
- package/package.json +4 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# @lytjs/reactivity
|
|
2
|
+
|
|
3
|
+
Lyt.js 响应式系统 - 提供响应式数据、计算属性、侦听器等核心响应式能力。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @lytjs/reactivity
|
|
9
|
+
|
|
10
|
+
# 或使用 pnpm
|
|
11
|
+
pnpm add @lytjs/reactivity
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 特性
|
|
15
|
+
|
|
16
|
+
- 🚀 Proxy 代理实现,性能优异
|
|
17
|
+
- 🔄 Signal 细粒度响应式 API
|
|
18
|
+
- 📦 完全兼容 Vue 3 响应式 API
|
|
19
|
+
- 🎯 零运行时依赖,体积仅 2.86KB (gzip)
|
|
20
|
+
|
|
21
|
+
## 快速开始
|
|
22
|
+
|
|
23
|
+
### ref - 响应式引用
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
import { ref } from '@lytjs/reactivity';
|
|
27
|
+
|
|
28
|
+
const count = ref(0);
|
|
29
|
+
console.log(count.value); // 0
|
|
30
|
+
|
|
31
|
+
count.value++;
|
|
32
|
+
console.log(count.value); // 1
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### reactive - 响应式对象
|
|
36
|
+
|
|
37
|
+
```javascript
|
|
38
|
+
import { reactive } from '@lytjs/reactivity';
|
|
39
|
+
|
|
40
|
+
const state = reactive({
|
|
41
|
+
count: 0,
|
|
42
|
+
name: 'Lyt.js'
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
console.log(state.count); // 0
|
|
46
|
+
state.count++;
|
|
47
|
+
console.log(state.count); // 1
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### computed - 计算属性
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
import { ref, computed } from '@lytjs/reactivity';
|
|
54
|
+
|
|
55
|
+
const count = ref(0);
|
|
56
|
+
const doubled = computed(() => count.value * 2);
|
|
57
|
+
|
|
58
|
+
console.log(doubled.value); // 0
|
|
59
|
+
|
|
60
|
+
count.value++;
|
|
61
|
+
console.log(doubled.value); // 2
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### watch - 数据侦听
|
|
65
|
+
|
|
66
|
+
```javascript
|
|
67
|
+
import { ref, watch } from '@lytjs/reactivity';
|
|
68
|
+
|
|
69
|
+
const count = ref(0);
|
|
70
|
+
|
|
71
|
+
watch(count, (newValue, oldValue) => {
|
|
72
|
+
console.log(`count 变化: ${oldValue} -> ${newValue}`);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
count.value++; // count 变化: 0 -> 1
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### effect - 副作用
|
|
79
|
+
|
|
80
|
+
```javascript
|
|
81
|
+
import { ref, effect } from '@lytjs/reactivity';
|
|
82
|
+
|
|
83
|
+
const count = ref(0);
|
|
84
|
+
|
|
85
|
+
effect(() => {
|
|
86
|
+
console.log(`count 当前值: ${count.value}`);
|
|
87
|
+
});
|
|
88
|
+
// count 当前值: 0
|
|
89
|
+
|
|
90
|
+
count.value++; // count 当前值: 1
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Signal API
|
|
94
|
+
|
|
95
|
+
Signal 提供细粒度响应式能力,性能更优:
|
|
96
|
+
|
|
97
|
+
```javascript
|
|
98
|
+
import { signal, computed } from '@lytjs/reactivity/signal';
|
|
99
|
+
|
|
100
|
+
const count = signal(0);
|
|
101
|
+
const doubled = computed(() => count() * 2);
|
|
102
|
+
|
|
103
|
+
console.log(count()); // 0
|
|
104
|
+
console.log(doubled()); // 0
|
|
105
|
+
|
|
106
|
+
count.set(1);
|
|
107
|
+
console.log(count()); // 1
|
|
108
|
+
console.log(doubled()); // 2
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## API 参考
|
|
112
|
+
|
|
113
|
+
### 响应式 API
|
|
114
|
+
|
|
115
|
+
| API | 说明 |
|
|
116
|
+
|------|------|
|
|
117
|
+
| `ref(value)` | 创建响应式引用 |
|
|
118
|
+
| `reactive(obj)` | 创建响应式对象 |
|
|
119
|
+
| `shallowRef(value)` | 创建浅层响应式引用 |
|
|
120
|
+
| `readonly(obj)` | 创建只读响应式对象 |
|
|
121
|
+
| `toRef(obj, key)` | 将对象属性转为 ref |
|
|
122
|
+
| `toRefs(obj)` | 将对象所有属性转为 ref |
|
|
123
|
+
|
|
124
|
+
### 计算与侦听
|
|
125
|
+
|
|
126
|
+
| API | 说明 |
|
|
127
|
+
|------|------|
|
|
128
|
+
| `computed(fn)` | 创建计算属性 |
|
|
129
|
+
| `watch(source, fn, options)` | 数据变化时执行回调 |
|
|
130
|
+
| `watchEffect(fn)` | 立即执行并追踪响应式依赖 |
|
|
131
|
+
| `effect(fn, options)` | 创建副作用 |
|
|
132
|
+
| `stop(effect)` | 停止副作用 |
|
|
133
|
+
|
|
134
|
+
### 工具函数
|
|
135
|
+
|
|
136
|
+
| API | 说明 |
|
|
137
|
+
|------|------|
|
|
138
|
+
| `isRef(v)` | 判断是否为 ref |
|
|
139
|
+
| `isReactive(v)` | 判断是否为 reactive |
|
|
140
|
+
| `isReadonly(v)` | 判断是否为 readonly |
|
|
141
|
+
| `unref(v)` | 解包 ref |
|
|
142
|
+
| `nextTick(fn)` | 在下一次 DOM 更新后执行 |
|
|
143
|
+
|
|
144
|
+
## 示例
|
|
145
|
+
|
|
146
|
+
### 表单验证
|
|
147
|
+
|
|
148
|
+
```javascript
|
|
149
|
+
import { reactive, computed } from '@lytjs/reactivity';
|
|
150
|
+
|
|
151
|
+
const form = reactive({
|
|
152
|
+
email: '',
|
|
153
|
+
password: ''
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
const isValidEmail = computed(() => {
|
|
157
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(form.email);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
const isValidPassword = computed(() => {
|
|
161
|
+
return form.password.length >= 6;
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
const isFormValid = computed(() => {
|
|
165
|
+
return isValidEmail.value && isValidPassword.value;
|
|
166
|
+
});
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### 计数器
|
|
170
|
+
|
|
171
|
+
```javascript
|
|
172
|
+
import { ref, computed } from '@lytjs/reactivity';
|
|
173
|
+
|
|
174
|
+
const count = ref(0);
|
|
175
|
+
const doubled = computed(() => count.value * 2);
|
|
176
|
+
|
|
177
|
+
function increment() {
|
|
178
|
+
count.value++;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function decrement() {
|
|
182
|
+
count.value--;
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## 性能
|
|
187
|
+
|
|
188
|
+
- 体积:2.86 KB (ESM gzip)
|
|
189
|
+
- 零运行时依赖
|
|
190
|
+
- 原生 Proxy 实现,性能优异
|
|
191
|
+
|
|
192
|
+
## 兼容性
|
|
193
|
+
|
|
194
|
+
- Node.js >= 18.0.0
|
|
195
|
+
- Chrome 64+
|
|
196
|
+
- Firefox 63+
|
|
197
|
+
- Safari 12+
|
|
198
|
+
- Edge 79+
|
|
199
|
+
|
|
200
|
+
## License
|
|
201
|
+
|
|
202
|
+
MIT
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var G=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var Ke=Object.prototype.hasOwnProperty;var ke=(e,t)=>{for(var n in t)G(e,n,{get:t[n],enumerable:!0})},Ae=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ve(t))!Ke.call(e,o)&&o!==n&&G(e,o,{get:()=>t[o],enumerable:!(r=Pe(t,o))||r.enumerable});return e};var Me=e=>Ae(G({},"__esModule",{value:!0}),e);var Ue={};ke(Ue,{ITERATE_KEY:()=>R,ReactiveEffect:()=>d,activeEffect:()=>c,batch:()=>ve,clearQueue:()=>x.clearQueue,computed:()=>be,computedSignal:()=>Re,effect:()=>X,enterSignalComponentContext:()=>Oe,hasPendingJob:()=>x.hasPendingJob,isReactive:()=>v,isReadonly:()=>J,isRef:()=>T,markReadOnly:()=>ae,markSkip:()=>fe,nextTick:()=>_.nextTick,onSignalCleanup:()=>We,pauseTracking:()=>A,queueJob:()=>x.queueJob,queuePostFlushCb:()=>x.queuePostFlushCb,rawSymbol:()=>h,reactive:()=>F,reactiveFlag:()=>S,readonly:()=>D,readonlyFlag:()=>b,ref:()=>ce,refSymbol:()=>w,resetTracking:()=>M,shallowReactive:()=>se,shallowRef:()=>le,shallowRefSymbol:()=>q,signal:()=>I,signalEffect:()=>Se,stop:()=>Z,toRaw:()=>m,toRef:()=>Y,toRefs:()=>de,track:()=>f,trigger:()=>u,triggerRef:()=>ye,unref:()=>pe,untrack:()=>_e,useSignal:()=>Ce,useSignalState:()=>Ee,watch:()=>me,watchEffect:()=>xe});module.exports=Me(Ue);var c=null,O=[],He=0,N=new WeakMap,d=class{constructor(t,n={}){this.active=!0;this.deps=new Set;this.fn=t,this.scheduler=n.scheduler,this.beforeRun=n.beforeRun,this.afterRun=n.afterRun,this.lazy=n.lazy,this.id=He++}run(){var t,n;if(!this.active)return this.fn();if(O.includes(this))return this.fn();try{return(t=this.beforeRun)==null||t.call(this),O.push(this),c=this,B(this),this.fn()}finally{(n=this.afterRun)==null||n.call(this),O.pop(),c=O[O.length-1]||null}}stop(){this.active&&(B(this),this.onStop&&this.onStop(),this.active=!1)}},k=!0,L=[];function A(){L.push(k),k=!1}function M(){let e=L.pop();k=e===void 0?!0:e}function B(e){let{deps:t}=e;for(let n of t)n.delete(e);t.clear()}function f(e,t){if(!k||!c)return;let n=N.get(e);n||(n=new Map,N.set(e,n));let r=n.get(t);r||(r=new Set,n.set(t,r)),r.has(c)||(r.add(c),c.deps.add(r))}function u(e,t,n,r){let o=N.get(e);if(!o)return;let i=new Set,s=a=>{if(a)for(let p of a)(p!==c||p.allowRecurse)&&i.add(p)};if(s(o.get(t)),(n==="add"||n==="delete")&&s(o.get(R)),n==="set"&&Array.isArray(e)){let a=o.get("length");a&&typeof t=="number"&&t<e.length&&s(a)}for(let a of i)a.scheduler?a.scheduler(a):a.run()}var R=Symbol("iterate");function X(e,t={}){let n=new d(e,t);t.lazy||n.run();let r=n.run.bind(n);return r.effect=n,r.stop=()=>n.stop(),r}function Z(e){var t;(t=e==null?void 0:e.effect)==null||t.stop()}var b=Symbol("readonly"),h=Symbol("raw"),S=Symbol("reactive"),re=Symbol("skip"),ee=new WeakMap,te=new WeakMap,ne=new WeakMap;function W(e){return e!==null&&typeof e=="object"}function oe(e,t){return!Object.is(e,t)}function H(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var z={};["includes","indexOf","lastIndexOf"].forEach(e=>{z[e]=function(...t){let n=m(this);for(let r=0;r<n.length;r++)f(n,String(r));return f(n,"length"),n[e](...t)}});["push","pop","shift","unshift","splice","sort","reverse"].forEach(e=>{z[e]=function(...t){A();let n=Array.prototype[e].apply(this,t);return M(),u(m(this),"length","set",m(this).length),n}});var ze={get(e,t,n){if(t===h)return e;if(t===S)return!0;if(Array.isArray(e)&&z.hasOwnProperty(t))return z[t];f(e,t);let r=Reflect.get(e,t,n);return t===b?e[b]===!0:!W(r)||e[re]?r:F(r)},set(e,t,n,r){let o=e[t],i=Array.isArray(e)&&ie(t)?Number(t)<e.length:H(e,t),s=Reflect.set(e,t,n,r);return(e===(r==null?void 0:r[h])||e===m(r))&&(i?oe(n,o)&&u(e,t,"set",n):u(e,t,"add",n)),s},deleteProperty(e,t){let n=H(e,t),r=Reflect.deleteProperty(e,t);return r&&n&&u(e,t,"delete"),r},has(e,t){return f(e,t),Reflect.has(e,t)},ownKeys(e){return f(e,R),Reflect.ownKeys(e)}},De={get(e,t,n){if(t===h)return e;if(t===S||t===b)return!0;f(e,t);let r=Reflect.get(e,t,n);return W(r)?D(r):r},set(e,t,n,r){return!1},deleteProperty(e,t){return!1},has(e,t){return f(e,t),Reflect.has(e,t)},ownKeys(e){return f(e,R),Reflect.ownKeys(e)}},Ie={get(e,t,n){return t===h?e:t===S?!0:(f(e,t),Reflect.get(e,t,n))},set(e,t,n,r){let o=e[t],i=Array.isArray(e)&&ie(t)?Number(t)<e.length:H(e,t),s=Reflect.set(e,t,n,r);return(e===(r==null?void 0:r[h])||e===m(r))&&(i?oe(n,o)&&u(e,t,"set",n):u(e,t,"add",n)),s},deleteProperty(e,t){let n=H(e,t),r=Reflect.deleteProperty(e,t);return r&&n&&u(e,t,"delete"),r},has(e,t){return f(e,t),Reflect.has(e,t)},ownKeys(e){return f(e,R),Reflect.ownKeys(e)}};function ie(e){return typeof e=="string"&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e}function F(e,t={}){if(!W(e)||e[S])return e;if(e[b])return D(e);let n=ee.get(e);if(n)return n;let r=new Proxy(e,ze);return ee.set(e,r),r}function D(e){if(!W(e))return e;let t=te.get(e);if(t)return t;e[b]=!0;let n=new Proxy(e,De);return te.set(e,n),n}function se(e){if(!W(e))return e;let t=ne.get(e);if(t)return t;let n=new Proxy(e,Ie);return ne.set(e,n),n}function m(e){let t=e&&e[h];return t?m(t):e}function v(e){return J(e)?v(e[h]):!!(e&&e[S])}function J(e){return!!(e&&e[b])}function ae(e){return e[b]=!0,e}function fe(e){return e[re]=!0,e}var w=Symbol("ref"),q=Symbol("shallowRef");function Ge(e){return e!==null&&typeof e=="object"}var U=new WeakMap;function Ne(e){return U.get(e)||e}function ce(e){if(T(e))return e;let t={_value:ue(e),_rawValue:e,__v_isRef:!0,[w]:!0},n=new Proxy(t,Je);return U.set(n,t),n}function ue(e){return Ge(e)?F(e):e}var Je={get(e,t,n){return t==="value"?(f(e,"value"),e._value):t===w||t==="__v_isRef"?!0:t==="_rawValue"?e._rawValue:Reflect.get(e,t,n)},set(e,t,n,r){if(t==="value"){let o=e._rawValue;return Object.is(o,n)||(e._rawValue=n,e._value=ue(n),u(e,"value","set",n)),!0}return Reflect.set(e,t,n,r)}};function le(e){if(T(e))return e;let t={_value:e,_rawValue:e,__v_isRef:!0,__v_isShallow:!0,[w]:!0,[q]:!0},n=new Proxy(t,qe);return U.set(n,t),n}var qe={get(e,t,n){return t==="value"?(f(e,"value"),e._value):t===w||t==="__v_isRef"||t==="__v_isShallow"?!0:t==="_rawValue"?e._rawValue:Reflect.get(e,t,n)},set(e,t,n,r){if(t==="value"){let o=e._rawValue;return Object.is(o,n)||(e._rawValue=n,e._value=n,u(e,"value","set",n)),!0}return Reflect.set(e,t,n,r)}};function T(e){return!!(e&&e.__v_isRef===!0)}function pe(e){return T(e)?e.value:e}function Y(e,t){let n=e[t];return T(n)?n:new Proxy({_obj:e,_key:t,__v_isRef:!0},{get(r,o,i){return o==="value"?r._obj[r._key]:o==="__v_isRef"?!0:Reflect.get(r,o,i)},set(r,o,i,s){return o==="value"?(r._obj[r._key]=i,!0):Reflect.set(r,o,i,s)}})}function de(e){let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=Y(e,n));return t}function ye(e){let t=Ne(e);u(t,"value","set",t._rawValue)}var $=class{constructor(t,n){this._dirty=!0;this.__v_isRef=!0;this.deps=new Set;this._setter=n,this._effect=new d(t,{scheduler:()=>{this._dirty||(this._dirty=!0,this.triggerDep())},lazy:!0}),this._value=void 0}get value(){return f(this,"value"),c&&!this.deps.has(c)&&(this.deps.add(c),c.deps.add(this.deps)),this._dirty&&(this._value=this._effect.run(),this._dirty=!1),this._value}set value(t){this._setter&&this._setter(t)}triggerDep(){for(let t of this.deps)t.scheduler?t.scheduler(t):t.run()}};function be(e){let t,n;return typeof e=="function"?(t=e,n=void 0):(t=e.get,n=e.set),new $(t,n)}var _=require("@lytjs/common");function Te(e){return e!==null&&typeof e=="object"}function P(e,t=1/0,n){if(!Te(e)||t<=0||(n||(n=new Set),n.has(e)))return e;if(n.add(e),T(e))P(e.value,t-1,n);else if(Array.isArray(e))for(let r=0;r<e.length;r++)P(e[r],t-1,n);else for(let r of Object.keys(e))P(e[r],t-1,n);return e}function he(e){return T(e)?()=>e.value:v(e)?()=>P(e):typeof e=="function"?e:()=>P(e)}function me(e,t,n={}){let r,o=!1;if(Array.isArray(e)){o=!0;let l=e.map(E=>he(E));r=()=>l.map(E=>E())}else r=he(e);v(e)&&n.deep!==!1&&(n.deep=!0);let i=o?[]:void 0,s,a=l=>{s=l},p=()=>{s&&(s(),s=void 0);let l=C.run();(o?l.some((E,Fe)=>!Object.is(E,i[Fe])):!Object.is(l,i)||n.deep&&Te(l))&&(t(l,o?[...i]:i,a),i=o?[...l]:l)},C=new d(r,{lazy:!0,scheduler:()=>{n.flush==="sync"?p():(0,_.queueJob)(p)}});return n.immediate?p():i=C.run(),()=>{C.stop()}}function xe(e,t={}){let n,r=()=>{n&&(n(),n=void 0),e(i=>{n=i})},o=new d(r,{scheduler:()=>{t.flush==="sync"?r():(0,_.queueJob)(r)}});return o.run(),()=>{o.stop(),n&&(n(),n=void 0)}}var x=require("@lytjs/common");var y=null,V=!1,K=0,g=new Set,Q=!1;function I(e){let t=e,n=new Set,r=function(){return y&&!V&&n.add(y),t};return r.set=function(o){Object.is(t,o)||(t=o,ge(n))},r.update=function(o){r.set(o(t))},r._subscribe=function(o){n.add(o)},r._unsubscribe=function(o){n.delete(o)},r}function Re(e){let t,n=!0,r=!1,o=new Set,i=new Set,s=function(){if(y&&!V&&i.add(y),n){if(r)throw new Error("[lyt:signal] \u68C0\u6D4B\u5230\u5FAA\u73AF\u4F9D\u8D56: computed \u5728\u5176\u81EA\u8EAB\u7684\u8BA1\u7B97\u56FE\u4E2D");r=!0;for(let l of o)l._unsubscribe(s);o.clear();let C=y;y=s;try{t=e()}finally{y=C,r=!1}n=!1}return t},a={_dirty:!1,notify(){n=!0,ge(i)}};return s.notify=a.notify.bind(a),s._dirty=!1,s._subscribe=function(p){i.add(p)},s._unsubscribe=function(p){i.delete(p)},s}function Se(e){let t=null,n=!1,r=new Set,o=()=>{if(n)return;t&&(t(),t=null);for(let a of r)a._unsubscribe(i);r.clear();let s=y;y=i;try{e(a=>{t=a})}finally{y=s}},i={_dirty:!1,notify(){K>0?g.add(i):o()}};return o(),()=>{n=!0,t&&(t(),t=null);for(let s of r)s._unsubscribe(i);r.clear(),g.delete(i)}}function ve(e){K++;try{e()}finally{K--,K===0&&we()}}function we(){if(!Q){Q=!0;try{let e=new Set(g);g.clear();for(let t of e)t.notify();g.size>0&&we()}finally{Q=!1}}}function _e(e){let t=V;V=!0;try{return e()}finally{V=t}}function ge(e){if(K>0)for(let t of e)g.add(t);else for(let t of e)t.notify()}var j=[];function je(){return j.length>0?j[j.length-1]:null}function Ce(e){return e()}function Ee(e){let t=I(e),n=o=>t.set(o),r=je();return[t,n]}function Oe(){let e={_cleanupFns:[]};return j.push(e),()=>{for(let n of e._cleanupFns)n();e._cleanupFns.length=0;let t=j.indexOf(e);t!==-1&&j.splice(t,1)}}function We(e){let t=je();t&&t._cleanupFns.push(e)}
|
|
1
|
+
"use strict";var G=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var Fe=Object.getOwnPropertyNames;var Ie=Object.prototype.hasOwnProperty;var Ke=(e,t)=>{for(var n in t)G(e,n,{get:t[n],enumerable:!0})},Ae=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fe(t))!Ie.call(e,o)&&o!==n&&G(e,o,{get:()=>t[o],enumerable:!(r=Ve(t,o))||r.enumerable});return e};var Me=e=>Ae(G({},"__esModule",{value:!0}),e);var Ue={};Ke(Ue,{ITERATE_KEY:()=>S,ReactiveEffect:()=>d,activeEffect:()=>a,batch:()=>we,clearQueue:()=>x.clearQueue,computed:()=>Re,computedSignal:()=>Se,effect:()=>X,enterSignalComponentContext:()=>We,hasPendingJob:()=>x.hasPendingJob,isReactive:()=>w,isReadonly:()=>Y,isRef:()=>T,markReadOnly:()=>fe,markSkip:()=>ce,nextTick:()=>h.nextTick,onSignalCleanup:()=>ke,pauseTracking:()=>K,queueJob:()=>x.queueJob,queuePostFlushCb:()=>x.queuePostFlushCb,rawSymbol:()=>R,reactive:()=>k,reactiveFlag:()=>v,readonly:()=>H,readonlyFlag:()=>y,ref:()=>ue,refSymbol:()=>_,resetTracking:()=>A,shallowReactive:()=>se,shallowRef:()=>pe,shallowRefSymbol:()=>J,signal:()=>z,signalEffect:()=>ve,stop:()=>Z,toRaw:()=>m,toRef:()=>q,toRefs:()=>be,track:()=>c,trigger:()=>u,triggerRef:()=>ye,unref:()=>de,untrack:()=>ge,useSignal:()=>je,useSignalState:()=>Oe,watch:()=>he,watchEffect:()=>me});module.exports=Me(Ue);var a=null,O=[],De=0,N=new WeakMap,d=class{constructor(t,n={}){this.active=!0;this.deps=new Set;this.fn=t,this.scheduler=n.scheduler,this.beforeRun=n.beforeRun,this.afterRun=n.afterRun,this.lazy=n.lazy,this.id=De++}run(){var t,n;if(!this.active)return this.fn();if(O.includes(this))return this.fn();try{return(t=this.beforeRun)==null||t.call(this),O.push(this),a=this,Q(this),this.fn()}finally{(n=this.afterRun)==null||n.call(this),O.pop(),a=O[O.length-1]||null}}stop(){this.active&&(Q(this),this.onStop&&this.onStop(),this.active=!1)}},I=!0,B=[];function K(){B.push(I),I=!1}function A(){let e=B.pop();I=e===void 0?!0:e}function Q(e){let{deps:t}=e;for(let n of t)n.delete(e);t.clear()}function c(e,t){if(!I||!a)return;let n=N.get(e);n||(n=new Map,N.set(e,n));let r=n.get(t);r||(r=new Set,n.set(t,r)),r.has(a)||(r.add(a),a.deps.add(r))}function u(e,t,n,r){let o=N.get(e);if(!o)return;let i=new Set,s=f=>{if(f)for(let p of f)(p!==a||p.allowRecurse)&&i.add(p)};if(s(o.get(t)),(n==="add"||n==="delete")&&s(o.get(S)),n==="set"&&Array.isArray(e)){let f=o.get("length");f&&typeof t=="number"&&t<e.length&&s(f)}for(let f of i)f.scheduler?f.scheduler(f):f.run()}var S=Symbol("iterate");function X(e,t={}){let n=new d(e,t);t.lazy||n.run();let r=n.run.bind(n);return r.effect=n,r.stop=()=>n.stop(),r}function Z(e){var t;(t=e==null?void 0:e.effect)==null||t.stop()}var y=Symbol("readonly"),R=Symbol("raw"),v=Symbol("reactive"),re=Symbol("skip"),ee=new WeakMap,te=new WeakMap,ne=new WeakMap;function W(e){return e!==null&&typeof e=="object"}function oe(e,t){return!Object.is(e,t)}function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var D={};["includes","indexOf","lastIndexOf"].forEach(e=>{D[e]=function(...t){let n=m(this);for(let r=0;r<n.length;r++)c(n,String(r));return c(n,"length"),n[e](...t)}});["push","pop","shift","unshift","splice","sort","reverse"].forEach(e=>{D[e]=function(...t){K();let n=Array.prototype[e].apply(this,t);return A(),u(m(this),"length","set",m(this).length),n}});var He={get(e,t,n){if(t===R)return e;if(t===v)return!0;if(Array.isArray(e)&&D.hasOwnProperty(t))return D[t];c(e,t);let r=Reflect.get(e,t,n);return t===y?e[y]===!0:!W(r)||e[re]?r:k(r)},set(e,t,n,r){let o=e[t],i=Array.isArray(e)&&ie(t)?Number(t)<e.length:M(e,t),s=Reflect.set(e,t,n,r);return(e===(r==null?void 0:r[R])||e===m(r))&&(i?oe(n,o)&&u(e,t,"set",n):u(e,t,"add",n)),s},deleteProperty(e,t){let n=M(e,t),r=Reflect.deleteProperty(e,t);return r&&n&&u(e,t,"delete"),r},has(e,t){return c(e,t),Reflect.has(e,t)},ownKeys(e){return c(e,S),Reflect.ownKeys(e)}},ze={get(e,t,n){if(t===R)return e;if(t===v||t===y)return!0;c(e,t);let r=Reflect.get(e,t,n);return W(r)?H(r):r},set(e,t,n,r){return!1},deleteProperty(e,t){return!1},has(e,t){return c(e,t),Reflect.has(e,t)},ownKeys(e){return c(e,S),Reflect.ownKeys(e)}},Ge={get(e,t,n){return t===R?e:t===v?!0:(c(e,t),Reflect.get(e,t,n))},set(e,t,n,r){let o=e[t],i=Array.isArray(e)&&ie(t)?Number(t)<e.length:M(e,t),s=Reflect.set(e,t,n,r);return(e===(r==null?void 0:r[R])||e===m(r))&&(i?oe(n,o)&&u(e,t,"set",n):u(e,t,"add",n)),s},deleteProperty(e,t){let n=M(e,t),r=Reflect.deleteProperty(e,t);return r&&n&&u(e,t,"delete"),r},has(e,t){return c(e,t),Reflect.has(e,t)},ownKeys(e){return c(e,S),Reflect.ownKeys(e)}};function ie(e){return typeof e=="string"&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e}function k(e,t={}){if(!W(e)||e[v])return e;if(e[y])return H(e);let n=ee.get(e);if(n)return n;let r=new Proxy(e,He);return ee.set(e,r),r}function H(e){if(!W(e))return e;let t=te.get(e);if(t)return t;e[y]=!0;let n=new Proxy(e,ze);return te.set(e,n),n}function se(e){if(!W(e))return e;let t=ne.get(e);if(t)return t;let n=new Proxy(e,Ge);return ne.set(e,n),n}function m(e){let t=e&&e[R];return t?m(t):e}function w(e){return Y(e)?w(e[R]):!!(e&&e[v])}function Y(e){return!!(e&&e[y])}function fe(e){return e[y]=!0,e}function ce(e){return e[re]=!0,e}var ae=require("@lytjs/common"),_=Symbol("ref"),J=Symbol("shallowRef"),U=new WeakMap;function Ne(e){return U.get(e)||e}function ue(e){if(T(e))return e;let t={_value:le(e),_rawValue:e,__v_isRef:!0,[_]:!0},n=new Proxy(t,Ye);return U.set(n,t),n}function le(e){return(0,ae.isObject)(e)?k(e):e}var Ye={get(e,t,n){return t==="value"?(c(e,"value"),e._value):t===_||t==="__v_isRef"?!0:t==="_rawValue"?e._rawValue:Reflect.get(e,t,n)},set(e,t,n,r){if(t==="value"){let o=e._rawValue;return Object.is(o,n)||(e._rawValue=n,e._value=le(n),u(e,"value","set",n)),!0}return Reflect.set(e,t,n,r)}};function pe(e){if(T(e))return e;let t={_value:e,_rawValue:e,__v_isRef:!0,__v_isShallow:!0,[_]:!0,[J]:!0},n=new Proxy(t,Je);return U.set(n,t),n}var Je={get(e,t,n){return t==="value"?(c(e,"value"),e._value):t===_||t==="__v_isRef"||t==="__v_isShallow"?!0:t==="_rawValue"?e._rawValue:Reflect.get(e,t,n)},set(e,t,n,r){if(t==="value"){let o=e._rawValue;return Object.is(o,n)||(e._rawValue=n,e._value=n,u(e,"value","set",n)),!0}return Reflect.set(e,t,n,r)}};function T(e){return!!(e&&e.__v_isRef===!0)}function de(e){return T(e)?e.value:e}function q(e,t){let n=e[t];return T(n)?n:new Proxy({_obj:e,_key:t,__v_isRef:!0},{get(r,o,i){return o==="value"?r._obj[r._key]:o==="__v_isRef"?!0:Reflect.get(r,o,i)},set(r,o,i,s){return o==="value"?(r._obj[r._key]=i,!0):Reflect.set(r,o,i,s)}})}function be(e){let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=q(e,n));return t}function ye(e){let t=Ne(e);u(t,"value","set",t._rawValue)}var L=class{constructor(t,n){this._dirty=!0;this.__v_isRef=!0;this.deps=new Set;this._setter=n,this._effect=new d(t,{scheduler:()=>{this._dirty||(this._dirty=!0,this.triggerDep())},lazy:!0}),this._value=void 0}get value(){return c(this,"value"),a&&!this.deps.has(a)&&(this.deps.add(a),a.deps.add(this.deps)),this._dirty&&(this._value=this._effect.run(),this._dirty=!1),this._value}set value(t){this._setter&&this._setter(t)}triggerDep(){for(let t of this.deps)t.scheduler?t.scheduler(t):t.run()}};function Re(e){let t,n;return typeof e=="function"?(t=e,n=void 0):(t=e.get,n=e.set),new L(t,n)}var h=require("@lytjs/common");function P(e,t=1/0,n){if(!(0,h.isObject)(e)||t<=0||(n||(n=new Set),n.has(e)))return e;if(n.add(e),T(e))P(e.value,t-1,n);else if(Array.isArray(e))for(let r=0;r<e.length;r++)P(e[r],t-1,n);else for(let r of Object.keys(e))P(e[r],t-1,n);return e}function Te(e){return T(e)?()=>e.value:w(e)?()=>P(e):typeof e=="function"?e:()=>P(e)}function he(e,t,n={}){let r,o=!1;if(Array.isArray(e)){o=!0;let l=e.map(j=>Te(j));r=()=>l.map(j=>j())}else r=Te(e);w(e)&&n.deep!==!1&&(n.deep=!0);let i=o?[]:void 0,s,f=l=>{s=l},p=()=>{s&&(s(),s=void 0);let l=E.run();(o?l.some((j,Pe)=>!Object.is(j,i[Pe])):!Object.is(l,i)||n.deep&&(0,h.isObject)(l))&&(t(l,o?[...i]:i,f),i=o?[...l]:l)},E=new d(r,{lazy:!0,scheduler:()=>{n.flush==="sync"?p():(0,h.queueJob)(p)}});return n.immediate?p():i=E.run(),()=>{E.stop()}}function me(e,t={}){let n,r=()=>{n&&(n(),n=void 0),e(i=>{n=i})},o=new d(r,{scheduler:()=>{t.flush==="sync"?r():(0,h.queueJob)(r)}});return o.run(),()=>{o.stop(),n&&(n(),n=void 0)}}var x=require("@lytjs/common");var xe=require("@lytjs/common"),b=null,V=!1,F=0,g=new Set,$=!1;function z(e){let t=e,n=new Set,r=function(){return b&&!V&&n.add(b),t};return r.set=function(o){Object.is(t,o)||(t=o,Ce(n))},r.update=function(o){r.set(o(t))},r._subscribe=function(o){n.add(o)},r._unsubscribe=function(o){n.delete(o)},r.dispose=function(){n.clear()},r}function Se(e){let t,n=!0,r=!1,o=new Set,i=new Set,s=function(){if(b&&!V&&i.add(b),n){if(r)throw new xe.LytError("LYT_REACTIVITY_CIRCULAR_DEPENDENCY","computed \u5728\u5176\u81EA\u8EAB\u7684\u8BA1\u7B97\u56FE\u4E2D");r=!0;for(let l of o)l._unsubscribe(s);o.clear();let E=b;b=s;try{t=e()}finally{b=E,r=!1}n=!1}return t},f={_dirty:!1,notify(){n=!0,Ce(i)}};return s.notify=f.notify.bind(f),s._dirty=!1,s._subscribe=function(p){i.add(p)},s._unsubscribe=function(p){i.delete(p)},s}function ve(e){let t=null,n=!1,r=new Set,o=()=>{if(n)return;t&&(t(),t=null);for(let f of r)f._unsubscribe(i);r.clear();let s=b;b=i;try{e(f=>{t=f})}finally{b=s}},i={_dirty:!1,notify(){F>0?g.add(i):o()}};return o(),()=>{n=!0,t&&(t(),t=null);for(let s of r)s._unsubscribe(i);r.clear(),g.delete(i)}}function we(e){F++;try{e()}finally{F--,F===0&&_e()}}function _e(){if(!$){$=!0;try{let e=new Set(g);g.clear();for(let t of e)t.notify();g.size>0&&_e()}finally{$=!1}}}function ge(e){let t=V;V=!0;try{return e()}finally{V=t}}function Ce(e){if(F>0)for(let t of e)g.add(t);else for(let t of e)t.notify()}var C=[];function Ee(){return C.length>0?C[C.length-1]:null}function je(e){return e()}function Oe(e){let t=z(e),n=o=>t.set(o),r=Ee();return[t,n]}function We(){let e={_cleanupFns:[]};return C.push(e),()=>{for(let n of e._cleanupFns)n();e._cleanupFns.length=0;let t=C.indexOf(e);t!==-1&&C.splice(t,1)}}function ke(e){let t=Ee();t&&t._cleanupFns.push(e)}
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=null,g=[],
|
|
1
|
+
var u=null,g=[],ae=0,K=new WeakMap,b=class{constructor(t,n={}){this.active=!0;this.deps=new Set;this.fn=t,this.scheduler=n.scheduler,this.beforeRun=n.beforeRun,this.afterRun=n.afterRun,this.lazy=n.lazy,this.id=ae++}run(){var t,n;if(!this.active)return this.fn();if(g.includes(this))return this.fn();try{return(t=this.beforeRun)==null||t.call(this),g.push(this),u=this,Y(this),this.fn()}finally{(n=this.afterRun)==null||n.call(this),g.pop(),u=g[g.length-1]||null}}stop(){this.active&&(Y(this),this.onStop&&this.onStop(),this.active=!1)}},P=!0,J=[];function A(){J.push(P),P=!1}function M(){let e=J.pop();P=e===void 0?!0:e}function Y(e){let{deps:t}=e;for(let n of t)n.delete(e);t.clear()}function c(e,t){if(!P||!u)return;let n=K.get(e);n||(n=new Map,K.set(e,n));let r=n.get(t);r||(r=new Set,n.set(t,r)),r.has(u)||(r.add(u),u.deps.add(r))}function l(e,t,n,r){let o=K.get(e);if(!o)return;let i=new Set,s=f=>{if(f)for(let p of f)(p!==u||p.allowRecurse)&&i.add(p)};if(s(o.get(t)),(n==="add"||n==="delete")&&s(o.get(m)),n==="set"&&Array.isArray(e)){let f=o.get("length");f&&typeof t=="number"&&t<e.length&&s(f)}for(let f of i)f.scheduler?f.scheduler(f):f.run()}var m=Symbol("iterate");function ue(e,t={}){let n=new b(e,t);t.lazy||n.run();let r=n.run.bind(n);return r.effect=n,r.stop=()=>n.stop(),r}function le(e){var t;(t=e==null?void 0:e.effect)==null||t.stop()}var y=Symbol("readonly"),R=Symbol("raw"),x=Symbol("reactive"),$=Symbol("skip"),U=new WeakMap,q=new WeakMap,L=new WeakMap;function C(e){return e!==null&&typeof e=="object"}function Q(e,t){return!Object.is(e,t)}function V(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var F={};["includes","indexOf","lastIndexOf"].forEach(e=>{F[e]=function(...t){let n=h(this);for(let r=0;r<n.length;r++)c(n,String(r));return c(n,"length"),n[e](...t)}});["push","pop","shift","unshift","splice","sort","reverse"].forEach(e=>{F[e]=function(...t){A();let n=Array.prototype[e].apply(this,t);return M(),l(h(this),"length","set",h(this).length),n}});var pe={get(e,t,n){if(t===R)return e;if(t===x)return!0;if(Array.isArray(e)&&F.hasOwnProperty(t))return F[t];c(e,t);let r=Reflect.get(e,t,n);return t===y?e[y]===!0:!C(r)||e[$]?r:I(r)},set(e,t,n,r){let o=e[t],i=Array.isArray(e)&&B(t)?Number(t)<e.length:V(e,t),s=Reflect.set(e,t,n,r);return(e===(r==null?void 0:r[R])||e===h(r))&&(i?Q(n,o)&&l(e,t,"set",n):l(e,t,"add",n)),s},deleteProperty(e,t){let n=V(e,t),r=Reflect.deleteProperty(e,t);return r&&n&&l(e,t,"delete"),r},has(e,t){return c(e,t),Reflect.has(e,t)},ownKeys(e){return c(e,m),Reflect.ownKeys(e)}},de={get(e,t,n){if(t===R)return e;if(t===x||t===y)return!0;c(e,t);let r=Reflect.get(e,t,n);return C(r)?D(r):r},set(e,t,n,r){return!1},deleteProperty(e,t){return!1},has(e,t){return c(e,t),Reflect.has(e,t)},ownKeys(e){return c(e,m),Reflect.ownKeys(e)}},be={get(e,t,n){return t===R?e:t===x?!0:(c(e,t),Reflect.get(e,t,n))},set(e,t,n,r){let o=e[t],i=Array.isArray(e)&&B(t)?Number(t)<e.length:V(e,t),s=Reflect.set(e,t,n,r);return(e===(r==null?void 0:r[R])||e===h(r))&&(i?Q(n,o)&&l(e,t,"set",n):l(e,t,"add",n)),s},deleteProperty(e,t){let n=V(e,t),r=Reflect.deleteProperty(e,t);return r&&n&&l(e,t,"delete"),r},has(e,t){return c(e,t),Reflect.has(e,t)},ownKeys(e){return c(e,m),Reflect.ownKeys(e)}};function B(e){return typeof e=="string"&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e}function I(e,t={}){if(!C(e)||e[x])return e;if(e[y])return D(e);let n=U.get(e);if(n)return n;let r=new Proxy(e,pe);return U.set(e,r),r}function D(e){if(!C(e))return e;let t=q.get(e);if(t)return t;e[y]=!0;let n=new Proxy(e,de);return q.set(e,n),n}function ye(e){if(!C(e))return e;let t=L.get(e);if(t)return t;let n=new Proxy(e,be);return L.set(e,n),n}function h(e){let t=e&&e[R];return t?h(t):e}function E(e){return X(e)?E(e[R]):!!(e&&e[x])}function X(e){return!!(e&&e[y])}function Re(e){return e[y]=!0,e}function Te(e){return e[$]=!0,e}import{isObject as he}from"@lytjs/common";var j=Symbol("ref"),Z=Symbol("shallowRef"),H=new WeakMap;function me(e){return H.get(e)||e}function xe(e){if(T(e))return e;let t={_value:ee(e),_rawValue:e,__v_isRef:!0,[j]:!0},n=new Proxy(t,Se);return H.set(n,t),n}function ee(e){return he(e)?I(e):e}var Se={get(e,t,n){return t==="value"?(c(e,"value"),e._value):t===j||t==="__v_isRef"?!0:t==="_rawValue"?e._rawValue:Reflect.get(e,t,n)},set(e,t,n,r){if(t==="value"){let o=e._rawValue;return Object.is(o,n)||(e._rawValue=n,e._value=ee(n),l(e,"value","set",n)),!0}return Reflect.set(e,t,n,r)}};function ve(e){if(T(e))return e;let t={_value:e,_rawValue:e,__v_isRef:!0,__v_isShallow:!0,[j]:!0,[Z]:!0},n=new Proxy(t,we);return H.set(n,t),n}var we={get(e,t,n){return t==="value"?(c(e,"value"),e._value):t===j||t==="__v_isRef"||t==="__v_isShallow"?!0:t==="_rawValue"?e._rawValue:Reflect.get(e,t,n)},set(e,t,n,r){if(t==="value"){let o=e._rawValue;return Object.is(o,n)||(e._rawValue=n,e._value=n,l(e,"value","set",n)),!0}return Reflect.set(e,t,n,r)}};function T(e){return!!(e&&e.__v_isRef===!0)}function _e(e){return T(e)?e.value:e}function te(e,t){let n=e[t];return T(n)?n:new Proxy({_obj:e,_key:t,__v_isRef:!0},{get(r,o,i){return o==="value"?r._obj[r._key]:o==="__v_isRef"?!0:Reflect.get(r,o,i)},set(r,o,i,s){return o==="value"?(r._obj[r._key]=i,!0):Reflect.set(r,o,i,s)}})}function ge(e){let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=te(e,n));return t}function Ce(e){let t=me(e);l(t,"value","set",t._rawValue)}var z=class{constructor(t,n){this._dirty=!0;this.__v_isRef=!0;this.deps=new Set;this._setter=n,this._effect=new b(t,{scheduler:()=>{this._dirty||(this._dirty=!0,this.triggerDep())},lazy:!0}),this._value=void 0}get value(){return c(this,"value"),u&&!this.deps.has(u)&&(this.deps.add(u),u.deps.add(this.deps)),this._dirty&&(this._value=this._effect.run(),this._dirty=!1),this._value}set value(t){this._setter&&this._setter(t)}triggerDep(){for(let t of this.deps)t.scheduler?t.scheduler(t):t.run()}};function Ee(e){let t,n;return typeof e=="function"?(t=e,n=void 0):(t=e.get,n=e.set),new z(t,n)}import{queueJob as re,nextTick as je,isObject as oe}from"@lytjs/common";function O(e,t=1/0,n){if(!oe(e)||t<=0||(n||(n=new Set),n.has(e)))return e;if(n.add(e),T(e))O(e.value,t-1,n);else if(Array.isArray(e))for(let r=0;r<e.length;r++)O(e[r],t-1,n);else for(let r of Object.keys(e))O(e[r],t-1,n);return e}function ne(e){return T(e)?()=>e.value:E(e)?()=>O(e):typeof e=="function"?e:()=>O(e)}function Oe(e,t,n={}){let r,o=!1;if(Array.isArray(e)){o=!0;let a=e.map(_=>ne(_));r=()=>a.map(_=>_())}else r=ne(e);E(e)&&n.deep!==!1&&(n.deep=!0);let i=o?[]:void 0,s,f=a=>{s=a},p=()=>{s&&(s(),s=void 0);let a=w.run();(o?a.some((_,ce)=>!Object.is(_,i[ce])):!Object.is(a,i)||n.deep&&oe(a))&&(t(a,o?[...i]:i,f),i=o?[...a]:a)},w=new b(r,{lazy:!0,scheduler:()=>{n.flush==="sync"?p():re(p)}});return n.immediate?p():i=w.run(),()=>{w.stop()}}function We(e,t={}){let n,r=()=>{n&&(n(),n=void 0),e(i=>{n=i})},o=new b(r,{scheduler:()=>{t.flush==="sync"?r():re(r)}});return o.run(),()=>{o.stop(),n&&(n(),n=void 0)}}import{queueJob as vt,queuePostFlushCb as wt,hasPendingJob as _t,clearQueue as gt}from"@lytjs/common";import{LytError as ke}from"@lytjs/common";var d=null,W=!1,k=0,S=new Set,G=!1;function N(e){let t=e,n=new Set,r=function(){return d&&!W&&n.add(d),t};return r.set=function(o){Object.is(t,o)||(t=o,se(n))},r.update=function(o){r.set(o(t))},r._subscribe=function(o){n.add(o)},r._unsubscribe=function(o){n.delete(o)},r.dispose=function(){n.clear()},r}function Pe(e){let t,n=!0,r=!1,o=new Set,i=new Set,s=function(){if(d&&!W&&i.add(d),n){if(r)throw new ke("LYT_REACTIVITY_CIRCULAR_DEPENDENCY","computed \u5728\u5176\u81EA\u8EAB\u7684\u8BA1\u7B97\u56FE\u4E2D");r=!0;for(let a of o)a._unsubscribe(s);o.clear();let w=d;d=s;try{t=e()}finally{d=w,r=!1}n=!1}return t},f={_dirty:!1,notify(){n=!0,se(i)}};return s.notify=f.notify.bind(f),s._dirty=!1,s._subscribe=function(p){i.add(p)},s._unsubscribe=function(p){i.delete(p)},s}function Ve(e){let t=null,n=!1,r=new Set,o=()=>{if(n)return;t&&(t(),t=null);for(let f of r)f._unsubscribe(i);r.clear();let s=d;d=i;try{e(f=>{t=f})}finally{d=s}},i={_dirty:!1,notify(){k>0?S.add(i):o()}};return o(),()=>{n=!0,t&&(t(),t=null);for(let s of r)s._unsubscribe(i);r.clear(),S.delete(i)}}function Fe(e){k++;try{e()}finally{k--,k===0&&ie()}}function ie(){if(!G){G=!0;try{let e=new Set(S);S.clear();for(let t of e)t.notify();S.size>0&&ie()}finally{G=!1}}}function Ie(e){let t=W;W=!0;try{return e()}finally{W=t}}function se(e){if(k>0)for(let t of e)S.add(t);else for(let t of e)t.notify()}var v=[];function fe(){return v.length>0?v[v.length-1]:null}function Ke(e){return e()}function Ae(e){let t=N(e),n=o=>t.set(o),r=fe();return[t,n]}function Me(){let e={_cleanupFns:[]};return v.push(e),()=>{for(let n of e._cleanupFns)n();e._cleanupFns.length=0;let t=v.indexOf(e);t!==-1&&v.splice(t,1)}}function De(e){let t=fe();t&&t._cleanupFns.push(e)}export{m as ITERATE_KEY,b as ReactiveEffect,u as activeEffect,Fe as batch,gt as clearQueue,Ee as computed,Pe as computedSignal,ue as effect,Me as enterSignalComponentContext,_t as hasPendingJob,E as isReactive,X as isReadonly,T as isRef,Re as markReadOnly,Te as markSkip,je as nextTick,De as onSignalCleanup,A as pauseTracking,vt as queueJob,wt as queuePostFlushCb,R as rawSymbol,I as reactive,x as reactiveFlag,D as readonly,y as readonlyFlag,xe as ref,j as refSymbol,M as resetTracking,ye as shallowReactive,ve as shallowRef,Z as shallowRefSymbol,N as signal,Ve as signalEffect,le as stop,h as toRaw,te as toRef,ge as toRefs,c as track,l as trigger,Ce as triggerRef,_e as unref,Ie as untrack,Ke as useSignal,Ae as useSignalState,Oe as watch,We as watchEffect};
|
package/dist/signal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var x=(i,e)=>{for(var t in e)a(i,t,{get:e[t],enumerable:!0})},w=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of C(e))!m.call(i,r)&&r!==t&&a(i,r,{get:()=>e[r],enumerable:!(n=g(e,r))||n.enumerable});return i};var E=i=>w(a({},"__esModule",{value:!0}),i);var N={};x(N,{batch:()=>I,computed:()=>D,effect:()=>k,signal:()=>h,untrack:()=>L});module.exports=E(N);var S=require("@lytjs/common"),c=null,f=!1,l=0,b=new Set,p=!1;function h(i){let e=i,t=new Set,n=function(){return c&&!f&&t.add(c),e};return n.set=function(r){Object.is(e,r)||(e=r,y(t))},n.update=function(r){n.set(r(e))},n._subscribe=function(r){t.add(r)},n._unsubscribe=function(r){t.delete(r)},n.dispose=function(){t.clear()},n}function D(i){let e,t=!0,n=!1,r=new Set,o=new Set,s=function(){if(c&&!f&&o.add(c),t){if(n)throw new S.LytError("LYT_REACTIVITY_CIRCULAR_DEPENDENCY","computed \u5728\u5176\u81EA\u8EAB\u7684\u8BA1\u7B97\u56FE\u4E2D");n=!0;for(let _ of r)_._unsubscribe(s);r.clear();let T=c;c=s;try{e=i()}finally{c=T,n=!1}t=!1}return e},u={_dirty:!1,notify(){t=!0,y(o)}};return s.notify=u.notify.bind(u),s._dirty=!1,s._subscribe=function(d){o.add(d)},s._unsubscribe=function(d){o.delete(d)},s}function k(i){let e=null,t=!1,n=new Set,r=()=>{if(t)return;e&&(e(),e=null);for(let u of n)u._unsubscribe(o);n.clear();let s=c;c=o;try{i(u=>{e=u})}finally{c=s}},o={_dirty:!1,notify(){l>0?b.add(o):r()}};return r(),()=>{t=!0,e&&(e(),e=null);for(let s of n)s._unsubscribe(o);n.clear(),b.delete(o)}}function I(i){l++;try{i()}finally{l--,l===0&&v()}}function v(){if(!p){p=!0;try{let i=new Set(b);b.clear();for(let e of i)e.notify();b.size>0&&v()}finally{p=!1}}}function L(i){let e=f;f=!0;try{return i()}finally{f=e}}function y(i){if(l>0)for(let e of i)b.add(e);else for(let e of i)e.notify()}
|
package/dist/signal.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=null,f=!1,
|
|
1
|
+
import{LytError as T}from"@lytjs/common";var c=null,f=!1,l=0,b=new Set,a=!1;function g(n){let e=n,t=new Set,i=function(){return c&&!f&&t.add(c),e};return i.set=function(r){Object.is(e,r)||(e=r,S(t))},i.update=function(r){i.set(r(e))},i._subscribe=function(r){t.add(r)},i._unsubscribe=function(r){t.delete(r)},i.dispose=function(){t.clear()},i}function C(n){let e,t=!0,i=!1,r=new Set,o=new Set,s=function(){if(c&&!f&&o.add(c),t){if(i)throw new T("LYT_REACTIVITY_CIRCULAR_DEPENDENCY","computed \u5728\u5176\u81EA\u8EAB\u7684\u8BA1\u7B97\u56FE\u4E2D");i=!0;for(let y of r)y._unsubscribe(s);r.clear();let v=c;c=s;try{e=n()}finally{c=v,i=!1}t=!1}return e},u={_dirty:!1,notify(){t=!0,S(o)}};return s.notify=u.notify.bind(u),s._dirty=!1,s._subscribe=function(d){o.add(d)},s._unsubscribe=function(d){o.delete(d)},s}function m(n){let e=null,t=!1,i=new Set,r=()=>{if(t)return;e&&(e(),e=null);for(let u of i)u._unsubscribe(o);i.clear();let s=c;c=o;try{n(u=>{e=u})}finally{c=s}},o={_dirty:!1,notify(){l>0?b.add(o):r()}};return r(),()=>{t=!0,e&&(e(),e=null);for(let s of i)s._unsubscribe(o);i.clear(),b.delete(o)}}function x(n){l++;try{n()}finally{l--,l===0&&p()}}function p(){if(!a){a=!0;try{let n=new Set(b);b.clear();for(let e of n)e.notify();b.size>0&&p()}finally{a=!1}}}function w(n){let e=f;f=!0;try{return n()}finally{f=e}}function S(n){if(l>0)for(let e of n)b.add(e);else for(let e of n)e.notify()}export{x as batch,C as computed,m as effect,g as signal,w as untrack};
|
package/dist/types/effect.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export interface ReactiveEffectOptions {
|
|
|
35
35
|
* 在依赖收集时使用,用于将副作用与响应式属性关联
|
|
36
36
|
*/
|
|
37
37
|
export declare let activeEffect: ReactiveEffect | null;
|
|
38
|
+
/** 依赖映射表类型:属性名 → 依赖该属性的副作用集合 */
|
|
39
|
+
export type DepsMap = Map<unknown, Set<ReactiveEffect>>;
|
|
38
40
|
/**
|
|
39
41
|
* 响应式副作用类
|
|
40
42
|
* 封装一个副作用函数,管理其依赖关系和执行生命周期
|
|
@@ -134,19 +136,22 @@ export declare const ITERATE_KEY: unique symbol;
|
|
|
134
136
|
* runner.effect.stop() // 停止副作用
|
|
135
137
|
* ```
|
|
136
138
|
*/
|
|
137
|
-
|
|
139
|
+
/** effect() 返回的 runner 类型 */
|
|
140
|
+
export interface EffectRunner {
|
|
141
|
+
(): unknown;
|
|
138
142
|
effect: ReactiveEffect;
|
|
139
|
-
():
|
|
140
|
-
}
|
|
143
|
+
stop(): void;
|
|
144
|
+
}
|
|
145
|
+
export declare function effect(fn: EffectFn, options?: ReactiveEffectOptions): EffectRunner;
|
|
141
146
|
/**
|
|
142
147
|
* 停止一个副作用
|
|
143
148
|
*
|
|
144
149
|
* @param runner - effect() 返回的 runner 对象
|
|
145
150
|
*/
|
|
146
|
-
export declare function stop(runner:
|
|
151
|
+
export declare function stop(runner: EffectRunner): void;
|
|
147
152
|
/**
|
|
148
153
|
* 获取当前 targetMap 的引用(用于调试)
|
|
149
154
|
* @internal
|
|
150
155
|
*/
|
|
151
|
-
export declare function getTargetMap(): WeakMap<object,
|
|
156
|
+
export declare function getTargetMap(): WeakMap<object, DepsMap>;
|
|
152
157
|
//# sourceMappingURL=effect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../../src/effect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,cAAc;AACd,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC;AAEjC,mBAAmB;AACnB,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEtD,gBAAgB;AAChB,MAAM,WAAW,qBAAqB;IACpC,wBAAwB;IACxB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,gBAAgB;IAChB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uBAAuB;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uBAAuB;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAID;;;GAGG;AACH,eAAO,IAAI,YAAY,EAAE,cAAc,GAAG,IAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../../src/effect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,cAAc;AACd,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC;AAEjC,mBAAmB;AACnB,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEtD,gBAAgB;AAChB,MAAM,WAAW,qBAAqB;IACpC,wBAAwB;IACxB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,gBAAgB;IAChB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uBAAuB;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uBAAuB;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAID;;;GAGG;AACH,eAAO,IAAI,YAAY,EAAE,cAAc,GAAG,IAAW,CAAC;AAgBtD,gCAAgC;AAChC,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;AAUxD;;;GAGG;AACH,qBAAa,cAAc;IACzB,YAAY;IACZ,EAAE,EAAE,QAAQ,CAAC;IAEb,cAAc;IACd,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAE7C,gBAAgB;IAChB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAEvB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB,sBAAsB;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,aAAa;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,eAAe;IACf,EAAE,EAAE,MAAM,CAAC;IAEX,eAAe;IACf,MAAM,EAAE,OAAO,CAAQ;IAEvB;;;;OAIG;IACH,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAa;gBAE/B,EAAE,EAAE,QAAQ,EAAE,OAAO,GAAE,qBAA0B;IAS7D;;;;;;;OAOG;IACH,GAAG,IAAI,GAAG;IAkCV;;;;OAIG;IACH,IAAI,IAAI,IAAI;IAYZ,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAgBD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAqBD;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CA2BxD;AAID;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,cAAc,EACpB,QAAQ,CAAC,EAAE,GAAG,GACb,IAAI,CAiDN;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,eAAoB,CAAC;AAI7C;;;;;;;;;;;;;;;;GAgBG;AACH,6BAA6B;AAC7B,MAAM,WAAW,YAAY;IAC3B,IAAI,OAAO,CAAC;IACZ,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,IAAI,IAAI,CAAC;CACd;AAED,wBAAgB,MAAM,CACpB,EAAE,EAAE,QAAQ,EACZ,OAAO,GAAE,qBAA0B,GAClC,YAAY,CAed;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAE/C;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAEvD"}
|
package/dist/types/ref.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref.d.ts","sourceRoot":"","sources":["../../src/ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"ref.d.ts","sourceRoot":"","sources":["../../src/ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,oBAAoB;AACpB,eAAO,MAAM,SAAS,eAAgB,CAAC;AAEvC,2BAA2B;AAC3B,eAAO,MAAM,gBAAgB,eAAuB,CAAC;AAErD,aAAa;AACb,MAAM,WAAW,GAAG,CAAC,CAAC,GAAG,GAAG;IAC1B,WAAW;IACX,KAAK,EAAE,CAAC,CAAC;IACT,aAAa;IACb,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;CACnB;AAED,eAAe;AACf,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAqB1D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAkB7C;AAsED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAkBpD;AAuDD;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,GAAG,CAElD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAE7C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EACvD,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,CAAC,GACL,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAyBX;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG;KAClD,CAAC,IAAI,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC1B,CAUA;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAIzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../src/scheduler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,oBAAoB;AACpB,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../src/scheduler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,oBAAoB;AACpB,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;AA2BpD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAgBhD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAWvD;AA4DD;;;;;GAKG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAGxC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAQjC"}
|
package/dist/types/signal.d.ts
CHANGED
|
@@ -15,16 +15,37 @@
|
|
|
15
15
|
export interface Signal<T> {
|
|
16
16
|
(): T;
|
|
17
17
|
}
|
|
18
|
-
/** WritableSignal — 可写信号,支持 set / update */
|
|
18
|
+
/** WritableSignal — 可写信号,支持 set / update / dispose */
|
|
19
19
|
export interface WritableSignal<T> extends Signal<T> {
|
|
20
20
|
set(value: T): void;
|
|
21
21
|
update(fn: (prev: T) => T): void;
|
|
22
|
+
/** 销毁信号,释放所有订阅者 */
|
|
23
|
+
dispose(): void;
|
|
24
|
+
/** 内部订阅方法(由 Dependency 接口使用) */
|
|
25
|
+
_subscribe(subscriber: Subscriber): void;
|
|
26
|
+
/** 内部取消订阅方法(由 Dependency 接口使用) */
|
|
27
|
+
_unsubscribe(subscriber: Subscriber): void;
|
|
22
28
|
}
|
|
23
29
|
/** ComputedSignal — 只读计算信号 */
|
|
24
30
|
export interface ComputedSignal<T> extends Signal<T> {
|
|
31
|
+
/** 内部订阅方法(由 Dependency 接口使用) */
|
|
32
|
+
_subscribe(subscriber: Subscriber): void;
|
|
33
|
+
/** 内部取消订阅方法(由 Dependency 接口使用) */
|
|
34
|
+
_unsubscribe(subscriber: Subscriber): void;
|
|
35
|
+
/** 通知订阅者其依赖已变化 */
|
|
36
|
+
notify(): void;
|
|
37
|
+
/** 标记订阅者需要重新计算/执行 */
|
|
38
|
+
_dirty: boolean;
|
|
25
39
|
}
|
|
26
40
|
/** Effect 清理回调 */
|
|
27
41
|
export type EffectCleanup = () => void;
|
|
42
|
+
/** 订阅者接口(effect 或 computed) */
|
|
43
|
+
interface Subscriber {
|
|
44
|
+
/** 通知订阅者其依赖已变化 */
|
|
45
|
+
notify(): void;
|
|
46
|
+
/** 标记订阅者需要重新计算/执行 */
|
|
47
|
+
_dirty: boolean;
|
|
48
|
+
}
|
|
28
49
|
/**
|
|
29
50
|
* 创建一个可写信号
|
|
30
51
|
*
|
|
@@ -62,4 +83,5 @@ export declare function batch(fn: () => void): void;
|
|
|
62
83
|
* @returns 函数返回值
|
|
63
84
|
*/
|
|
64
85
|
export declare function untrack<T>(fn: () => T): T;
|
|
86
|
+
export {};
|
|
65
87
|
//# sourceMappingURL=signal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../src/signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../src/signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAQH,2BAA2B;AAC3B,MAAM,WAAW,MAAM,CAAC,CAAC;IACvB,IAAI,CAAC,CAAA;CACN;AAED,sDAAsD;AACtD,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,MAAM,CAAC,CAAC,CAAC;IAClD,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAA;IACnB,MAAM,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,CAAA;IAChC,mBAAmB;IACnB,OAAO,IAAI,IAAI,CAAA;IACf,gCAAgC;IAChC,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAA;IACxC,kCAAkC;IAClC,YAAY,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAA;CAC3C;AAED,8BAA8B;AAC9B,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,MAAM,CAAC,CAAC,CAAC;IAClD,gCAAgC;IAChC,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAA;IACxC,kCAAkC;IAClC,YAAY,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAA;IAC1C,kBAAkB;IAClB,MAAM,IAAI,IAAI,CAAA;IACd,qBAAqB;IACrB,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,kBAAkB;AAClB,MAAM,MAAM,aAAa,GAAG,MAAM,IAAI,CAAA;AAEtC,+BAA+B;AAC/B,UAAU,UAAU;IAClB,kBAAkB;IAClB,MAAM,IAAI,IAAI,CAAA;IACd,qBAAqB;IACrB,MAAM,EAAE,OAAO,CAAA;CAChB;AAiCD;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAsC5D;AAMD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAgE1D;AAMD;;;;;GAKG;AACH,wBAAgB,MAAM,CACpB,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,KAAK,IAAI,GACxD,MAAM,IAAI,CA6DZ;AAMD;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAU1C;AA4BD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAQzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/watch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,OAAO,EAAS,GAAG,EAAS,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAY,QAAQ,IAAI,iBAAiB,
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/watch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,OAAO,EAAS,GAAG,EAAS,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAY,QAAQ,IAAI,iBAAiB,EAAY,MAAM,eAAe,CAAC;AAIlF,mBAAmB;AACnB,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAC1C,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,IAAI,KAAK,IAAI,KACvC,IAAI,CAAC;AAEV,oDAAoD;AACpD,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,GAAG,IAC3B,GAAG,CAAC,CAAC,CAAC,GACN,CAAC,MAAM,CAAC,CAAC,GACT;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEN,eAAe;AACf,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wCAAwC;IACxC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uBAAuB;IACvB,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;CACjC;AAED,qBAAqB;AACrB,MAAM,WAAW,kBAAkB;IACjC,gBAAgB;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,gBAAgB;IAChB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,WAAW;IACX,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;CACjC;AAED,iBAAiB;AACjB,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC;AAuEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,KAAK,CAAC,CAAC,GAAG,GAAG,EAC3B,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,EACzC,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,EACpB,OAAO,GAAE,YAAiB,GACzB,eAAe,CAqFjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,WAAW,CACzB,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,IAAI,KAAK,IAAI,KAAK,IAAI,EACxD,OAAO,GAAE,kBAAuB,GAC/B,eAAe,CAuCjB;AAED;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,iBAAiB,IAAI,QAAQ,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lytjs/reactivity",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Lyt.js 响应式系统 - 提供响应式数据、计算属性、侦听器等核心响应式能力",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -49,5 +49,8 @@
|
|
|
49
49
|
],
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@lytjs/common": "^5.0.0"
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"fileNames":["../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.full.d.ts","../src/effect.ts","../src/reactive.ts","../src/ref.ts","../src/computed.ts","../src/watch.ts","../src/signal.ts","../src/signal-component.ts","../src/index.ts","../src/scheduler.ts"],"fileIdsList":[[64,66],[64,65,66,67,68,69,70],[64],[64,65],[69],[64,65,66]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"2a2de5b9459b3fc44decd9ce6100b72f1b002ef523126c1d3d8b2a4a63d74d78","affectsGlobalScope":true,"impliedFormat":1},{"version":"f13f4b465c99041e912db5c44129a94588e1aafee35a50eab51044833f50b4ee","affectsGlobalScope":true,"impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"01a30f9e8582b369075c0808df71121e6855cb06fd8d3d39511d9ebb66405205","impliedFormat":1},{"version":"42493898ab400c7c56982cca0cb2339dbfc232f2086c5401c636c4fa34477aff","signature":"a931971a0aed3a04be8ef1ef78e4bdd05af6d408bec44f846d3a0794dda5d708"},{"version":"060398dc966f0c7571ce70dd89a8bbb639208e3c0be05364eb833e83b3713657","signature":"f39120ae19c79ceffa561da071bbf53b5cf418f3ad9c186e895fa55c3c42ae31"},{"version":"74eaa329174cc8a68326a38ac59e806808edf1c4e05e3701fbf14c14203f285f","signature":"5fe944eec62fa00578c1b68dd15a46847218f15c35eca212f86caed1469108e9"},{"version":"c56441aa81cc25c253ae00bc120f02f40a170cc2911f5654537a89175311c1f0","signature":"1bb4fc70e4d98ca7ef67079adde1ee3bfa3b3829ae948cf2ce5b7a332430ee65"},{"version":"f94b8d4a9f2a3f2e840d1d73e5bd51195161ac991797e92df5b5c8d7a447c8f3","signature":"132b0d4b346da8f6d6004dc9eb4bfc09c0d292e9325aff621b2332a12973199f"},{"version":"0d9bbe431aaae996ac7b4e67a36a737edb382ef3db48d85ac85dd75525966d7d","signature":"ecd41394ecea0650d670ed4cdba72fac8f219fdfa1cdcbfdcdeb79413d712d15"},{"version":"2518606f6a3df4af92cf0bf1f088a6ddddee0644e64cd763dc03b0e79d31454d","signature":"fe965a8da8781e4e6cef466ccccd5430dc040ae5f17615301f4203434701237c"},{"version":"08780903e4a1cd6e95b70695aac31714aa42cd936f83fe7fce3d748f63894123","signature":"5142c441d5148e0b3d8aaa232af01166540bc049913ded34fe2065e0ebe2cf16"},{"version":"4c608f7cc03bd567f0f9ccf247f45af4def51fc7bb0b8deaee0c0b4a1ee4687a","signature":"c196e1b48475ddb78f5e1f87e882eb0c73fc7b8885fb6ab4d46b7c10c341f8f3"}],"root":[[64,72]],"options":{"allowImportingTsExtensions":true,"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"exactOptionalPropertyTypes":true,"module":99,"noEmitOnError":false,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./types","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"useDefineForClassFields":true,"verbatimModuleSyntax":true},"referencedMap":[[67,1],[71,2],[65,3],[66,4],[70,5],[68,6]],"semanticDiagnosticsPerFile":[[64,[{"start":358,"length":41,"messageText":"'queueJob' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":383,"length":15,"messageText":"Cannot find module '@lytjs/common' or its corresponding type declarations.","category":1,"code":2307},{"start":2221,"length":14,"code":2412,"category":1,"messageText":{"messageText":"Type '((effect: ReactiveEffect) => void) | undefined' is not assignable to type '(effect: ReactiveEffect) => void' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target.","category":1,"code":2412,"next":[{"messageText":"Type 'undefined' is not assignable to type '(effect: ReactiveEffect) => void'.","category":1,"code":2322}]}},{"start":2261,"length":14,"code":2412,"category":1,"messageText":{"messageText":"Type '(() => void) | undefined' is not assignable to type '() => void' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target.","category":1,"code":2412,"next":[{"messageText":"Type 'undefined' is not assignable to type '() => void'.","category":1,"code":2322}]}},{"start":2301,"length":13,"code":2412,"category":1,"messageText":{"messageText":"Type '(() => void) | undefined' is not assignable to type '() => void' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target.","category":1,"code":2412,"next":[{"messageText":"Type 'undefined' is not assignable to type '() => void'.","category":1,"code":2322}]}},{"start":2339,"length":9,"code":2412,"category":1,"messageText":{"messageText":"Type 'boolean | undefined' is not assignable to type 'boolean' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target.","category":1,"code":2412,"next":[{"messageText":"Type 'undefined' is not assignable to type 'boolean'.","category":1,"code":2322}]}},{"start":5488,"length":8,"messageText":"'newValue' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true}]],[65,[{"start":225,"length":14,"messageText":"'ReactiveEffect' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":6662,"length":5,"messageText":"'value' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":6678,"length":8,"messageText":"'receiver' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":9488,"length":7,"messageText":"'options' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true}]],[66,[{"start":263,"length":14,"messageText":"'ReactiveEffect' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":316,"length":8,"messageText":"'isObject' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true}]],[67,[{"start":407,"length":7,"messageText":"'trigger' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":434,"length":8,"messageText":"'EffectFn' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.","category":1,"code":1484},{"start":434,"length":8,"messageText":"'EffectFn' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":472,"length":3,"messageText":"'Ref' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.","category":1,"code":1484},{"start":477,"length":5,"messageText":"'isRef' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":484,"length":9,"messageText":"'refSymbol' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":1693,"length":12,"code":2412,"category":1,"messageText":{"messageText":"Type 'ComputedSetter<T> | undefined' is not assignable to type 'ComputedSetter<T>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target.","category":1,"code":2412,"next":[{"messageText":"Type 'undefined' is not assignable to type 'ComputedSetter<T>'.","category":1,"code":2322}]}}]],[68,[{"start":333,"length":8,"messageText":"'EffectFn' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.","category":1,"code":1484},{"start":333,"length":8,"messageText":"'EffectFn' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":345,"length":12,"messageText":"'activeEffect' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":394,"length":3,"messageText":"'Ref' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.","category":1,"code":1484},{"start":399,"length":5,"messageText":"'unref' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":442,"length":5,"messageText":"'toRaw' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":525,"length":15,"messageText":"Cannot find module '@lytjs/common' or its corresponding type declarations.","category":1,"code":2307}]],[70,[{"start":116,"length":6,"messageText":"'effect' is declared but its value is never read.","category":1,"code":6133,"reportsUnnecessary":true},{"start":680,"length":55,"code":2322,"category":1,"messageText":{"messageText":"Type 'SignalComponentContext | undefined' is not assignable to type 'SignalComponentContext | null'.","category":1,"code":2322,"next":[{"messageText":"Type 'undefined' is not assignable to type 'SignalComponentContext | null'.","category":1,"code":2322}]}}]],[71,[{"start":1557,"length":15,"messageText":"Cannot find module '@lytjs/common' or its corresponding type declarations.","category":1,"code":2307}]],[72,[{"start":2491,"length":3,"messageText":"Cannot invoke an object which is possibly 'undefined'.","category":1,"code":2722},{"start":2923,"length":12,"messageText":"Cannot invoke an object which is possibly 'undefined'.","category":1,"code":2722}]]],"latestChangedDtsFile":"./types/scheduler.d.ts","version":"6.0.2"}
|