@estjs/signals 0.0.17-beta.7 → 0.0.17
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/dist/signals.cjs +3 -3
- package/dist/signals.d.cts +93 -4
- package/dist/signals.d.ts +93 -4
- package/dist/signals.dev.cjs +408 -85
- package/dist/signals.dev.js +405 -87
- package/dist/signals.js +3 -3
- package/package.json +2 -2
package/dist/signals.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var shared=require('@estjs/shared');var S={SET:"SET",ADD:"ADD",DELETE:"DELETE",CLEAR:"CLEAR"};var G=Symbol(""),g=Symbol(""),V=Symbol(""),J=Symbol("");var L=Symbol("");var z=0,v,j=false,fe=class{constructor(t,n){this.map=t;this.key=n;this.isDep=true;this.flag=0;}get subLink(){return this._subLink}set subLink(t){this._subLink=t,t===void 0&&this.map.delete(this.key);}};function le(e){e.notify();}function C(e,t){if(j)return;let n=t.depLinkTail;if(n&&n.depNode===e)return n;let i=n?n.nextDepLink:t.depLink;if(i&&i.depNode===e)return i.version=z,t.depLinkTail=i,i;let r=e.subLinkTail;if(r&&r.version===z&&r.subNode===t)return t.depLinkTail=r,r;let o={version:z,depNode:e,subNode:t,prevSubLink:r,nextSubLink:void 0,prevDepLink:n,nextDepLink:i};return i&&(i.prevDepLink=o),n?n.nextDepLink=o:t.depLink=o,r?r.nextSubLink=o:e.subLink=o,e.subLinkTail=o,t.depLinkTail=o,o}function D(e,t=e.subNode){let n=e.depNode,i=e.prevSubLink,r=e.nextSubLink,o=e.prevDepLink,s=e.nextDepLink;if(s?s.prevDepLink=o:t.depLinkTail=o,o?o.nextDepLink=s:t.depLink=s,r?r.prevSubLink=i:n.subLinkTail=i,i)i.nextSubLink=r;else if(n.subLink=r,r===void 0){let c=n.depLink;for(;c;)c=D(c,n);n.depLinkTail=void 0,n.isDep||(n.flag|=16);}return s}function Q(e,t){let n,i=0,r=false;e:do{let o=false;if(t.flag&16)o=true;else {let s=e.depNode,c=s.flag;if((c&17)===17){let f=s.subLink;f&&f.nextSubLink&&K(f),o=true;}else if((c&33)===33)if(s.depLink){n={link:e,prev:n},e=s.depLink,t=s,++i;continue e}else s.flag&=-33;else c&32&&(s.flag&=-33);}if(!o&&e.nextDepLink!==void 0){e=e.nextDepLink;continue e}for(r=o;i--;){e=n.link,n=n.prev,t=e.subNode;let s=e.depNode;if(r?s.flag=s.flag&-33|16:s.flag&=-33,s.flag&16&&(r=true),!r&&e.nextDepLink!==void 0){e=e.nextDepLink;continue e}}return r?t.flag=t.flag&-33|16:t.flag&=-33,r}while(true)}function K(e){for(;e;){let t=e.subNode,n=t.flag;(n&48)===32&&(t.flag=n|16,(n&6)===2&&le(t)),e=e.nextSubLink;}}function M(e){let t=e.nextSubLink,n;e:do{let i=e.subNode,r=i.flag&2,o=i.flag;if(o&60?o&12?o&4?!(o&48)&&at(e,i)?(i.flag=o|40,r&&le(i),o&=1):o=0:i.flag=o&-9|32:o=0:(i.flag=o|32,r&&le(i)),o&1){let s=i.subLink;if(s!==void 0){let c=s.nextSubLink;c!==void 0&&(n={value:t,prev:n},t=c),e=s;continue}}if((e=t)!==void 0){t=e.nextSubLink;continue}for(;n!==void 0;)if(e=n.value,n=n.prev,e!==void 0){t=e.nextSubLink;continue e}break}while(true)}function pe(e){let t=v;return v=e,t}function X(e){return z++,e.depLinkTail=void 0,e.flag=e.flag&-57|4,pe(e)}function Z(e,t){v=t;let n=e.depLinkTail,i=n?n.nextDepLink:e.depLink;for(;i;)i=D(i,e);e.flag&=-5;}function st(e){let t=pe(void 0),n=j;j=true;try{return e()}finally{j=n,pe(t);}}function at(e,t){let n=t.depLinkTail;for(;n;){if(n===e)return true;n=n.prevDepLink;}return false}var de=new WeakMap,ct=0;function ue(e,t,n){if(e)for(let i=e.subLink;i;i=i.nextSubLink){let r=i.subNode;r._triggerVersion!==n&&(r._triggerVersion=n,t.push(r));}}function l(e,t){if(!v||j)return;let n=de.get(e);n||(n=new Map,de.set(e,n));let i=n.get(t);i||(i=new fe(n,t),n.set(t,i)),C(i,v);}function E(e,t,n,i){var c;let r=de.get(e);if(!r)return;let o=[],s=++ct;if(n!==void 0)if(Array.isArray(n))for(let f of n)ue(r.get(f),o,s);else ue(r.get(n),o,s);if(t==="ADD"||t==="DELETE"||t==="CLEAR"){let f=Array.isArray(e)?L:J;ue(r.get(f),o,s);}for(let f of o)f.flag&2?(c=f.notify)==null||c.call(f):f.flag&1&&(f.flag|=16,f.subLink&&M(f.subLink));}var ht=new WeakMap,Tt=new WeakMap;function a(e){if(!e||!shared.isObject(e))return e;let t=e._RAW;return t?a(t):h(e)?a(e.peek()):e}var xe=St();function St(){let e={};return ["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){let i=a(this);l(i,L);let r=i[t](...n);if((r===-1||r===false)&&n.length>0){let o=n.map(s=>a(s));r=i[t](...o);}return r};}),["find","findIndex","findLast","findLastIndex"].forEach(t=>{e[t]=function(...n){let i=a(this),r=k(this);l(i,L);let o=i[t](...n);return (t==="find"||t==="findLast")&&shared.isObject(o)&&!r?d(o):o};}),["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"].forEach(t=>{e[t]=function(...n){let i=a(this),r=Array.prototype[t].apply(i,n);return E(i,S.SET,[G,L]),r};}),["toReversed","toSorted","toSpliced"].forEach(t=>{e[t]=function(...n){let i=a(this),r=k(this);l(i,L);let o=Array.prototype[t].apply(i,n);return Array.isArray(o)?o.map(s=>shared.isObject(s)?d(s,r):s):o};}),["concat","slice","filter","map","flatMap","flat"].forEach(t=>{e[t]=function(...n){let i=a(this);return l(i,L),Array.prototype[t].apply(this,n)};}),["join","toString","toLocaleString"].forEach(t=>{e[t]=function(...n){let i=a(this);return l(i,L),Array.prototype[t].apply(i,n)};}),["values","keys","entries",Symbol.iterator].forEach(t=>{e[t]=function(){let n=a(this),i=k(this);l(n,G);let r=t===Symbol.iterator?n[Symbol.iterator]():n[t]();return {next(){let{value:o,done:s}=r.next();return s?{value:o,done:s}:Array.isArray(o)?{value:o.map(c=>shared.isObject(c)?d(c,i):c),done:s}:{value:shared.isObject(o)?d(o,i):o,done:s}},[Symbol.iterator](){return this}}};}),e}function Ne(e,t){let n=h(t)?t:a(t);return shared.hasChanged(e,n)}var Ve=e=>({get:(t,n,i)=>{if(n==="_RAW")return t;if(n==="_IS_REACTIVE")return true;if(n==="_IS_SHALLOW")return e;if(shared.hasOwn(xe,n))return xe[n];let r=Reflect.get(t,n,i);return shared.isStringNumber(n)&&l(t,n),l(t,G),shared.isObject(r)&&!e?d(r):r},set:(t,n,i,r)=>{let o=Reflect.get(t,n,r),s=a(i),c=Reflect.set(t,n,s,r);return Ne(s,o)&&(shared.isStringNumber(n)?E(t,S.SET,[n,L,G]):E(t,S.SET,n)),c}}),Et=Ve(true),gt=Ve(false),Pe=e=>({get(t,n){return n==="_IS_REACTIVE"?true:n==="_RAW"?t:n==="_IS_SHALLOW"?e:Reflect.get(shared.hasOwn(Ce,n)?Ce:t,n,t)}}),Oe=e=>({get(t,n){return n==="_IS_REACTIVE"?true:n==="_RAW"?t:n==="_IS_SHALLOW"?e:Reflect.get(shared.hasOwn(Ie,n)&&n in t?Ie:t,n,t)}}),_t=Pe(true),bt=Pe(false),vt=Oe(true),mt=Oe(false),Ce={get(e){let t=a(this);l(t,g);let n=t.get(e);return shared.isUndefined(n)&&!t.has(e)&&_(e)&&(n=t.get(a(e))),shared.isObject(n)&&!k(this)?d(n):n},set(e,t){let n=a(this),i=a(e),r=n.has(i),o=n.get(i),s=a(t);return n.set(i,s),(!r||shared.hasChanged(o,s))&&E(n,S.SET,g),this},add(e){let t=a(this),n=a(e),i=t.has(n);return t.add(n),i||E(t,S.ADD,g),this},has(e){let t=a(this);l(t,g);let n=t.has(e);return !n&&shared.isObject(e)?t.has(a(e)):n},delete(e){let t=a(this),n=t.has(e),i=t.delete(e);return !i&&shared.isObject(e)&&(i=t.delete(a(e))),(n||i)&&E(t,S.DELETE,g),i},clear(){let e=a(this),t=e.size>0,n=e.clear();return t&&E(e,S.CLEAR,g),n},forEach(e,t){let n=a(this),i=k(this);l(n,g),n.forEach((r,o)=>{let s=i||!shared.isObject(r)?r:d(r),c=i||!shared.isObject(o)?o:d(o);e.call(t,s,c,this);});},[Symbol.iterator](){let e=a(this),t=k(this);l(e,g);let n=e[Symbol.iterator]();return {next(){let{value:i,done:r}=n.next();return r?{value:i,done:r}:t?{value:i,done:r}:Array.isArray(i)?{value:i.map(o=>shared.isObject(o)?d(o):o),done:r}:{value:shared.isObject(i)?d(i):i,done:r}},[Symbol.iterator](){return this}}},get size(){let e=a(this);return l(e,g),e.size},keys(){let e=a(this),t=k(this);l(e,g);let n=e.keys();return {next(){let{value:i,done:r}=n.next();return r?{value:i,done:r}:{value:t||!shared.isObject(i)?i:d(i),done:r}},[Symbol.iterator](){return this}}},values(){let e=a(this),t=k(this);l(e,g);let n=e.values();return {next(){let{value:i,done:r}=n.next();return r?{value:i,done:r}:{value:t||!shared.isObject(i)?i:d(i),done:r}},[Symbol.iterator](){return this}}},entries(){let e=a(this),t=k(this);l(e,g);let n=e.entries();return {next(){let{value:i,done:r}=n.next();return r?{value:i,done:r}:t?{value:i,done:r}:{value:i.map(o=>shared.isObject(o)?d(o):o),done:r}},[Symbol.iterator](){return this}}}},Ie={get(e){let t=a(this);l(t,V);let n=t.get(e);return shared.isUndefined(n)&&!t.has(e)&&_(e)&&(n=t.get(a(e))),shared.isObject(n)&&!k(this)?d(n):n},set(e,t){let n=a(this),i=a(e),r=n.has(i),o=n.get(i),s=a(t);return n.set(i,s),(!r||shared.hasChanged(o,s))&&E(n,S.SET,V),this},add(e){let t=a(this),n=a(e),i=t.has(n);return t.add(n),i||E(t,S.ADD,V),this},has(e){let t=a(this);l(t,V);let n=t.has(e);return !n&&_(e)&&(n=t.has(a(e))),n},delete(e){let t=a(this),n=a(e),i=t.has(n),r=t.delete(n);return (i||r)&&E(t,S.DELETE,V),r}},Ge=e=>({get(t,n,i){if(n==="_RAW")return t;if(n==="_IS_REACTIVE")return true;if(n==="_IS_SHALLOW")return e;let r=Reflect.get(t,n,i),o=h(r)?r.value:r;return l(t,n),shared.isObject(o)&&!e?d(o):o},set:(t,n,i,r)=>{let o=shared.hasOwn(t,n),s=Reflect.get(t,n,r),c=a(i),f=Reflect.set(t,n,c,r);return Ne(c,s)&&E(t,o?S.SET:S.ADD,n),f},deleteProperty:(t,n)=>{let i=shared.hasOwn(t,n),r=Reflect.deleteProperty(t,n);return i&&r&&E(t,S.DELETE,n),r},ownKeys:t=>(l(t,J),Reflect.ownKeys(t))}),yt=Ge(true),kt=Ge(false);function d(e,t=false){if(!shared.isObject(e)||_(e))return e;let n=t?Tt:ht,i=n.get(e);if(i)return i;let r;shared.isArray(e)?r=t?Et:gt:shared.isSet(e)||shared.isMap(e)?r=t?_t:bt:shared.isWeakMap(e)||shared.isWeakSet(e)?r=t?vt:mt:r=t?yt:kt;let o=new Proxy(e,r);return n.set(e,o),o}function _(e){return !!(e&&e._IS_REACTIVE)}function I(e){return _(e)||h(e)?e:d(e)}function ee(e){return _(e)||h(e)?e:d(e,true)}function k(e){return !!(e&&e._IS_SHALLOW)}var wt=e=>shared.isObject(e)?I(e):e;var Me;Me="_IS_SIGNAL";var P=class{constructor(t,n=false){this.flag=1;this[Me]=true;let i=a(t);this._rawValue=i,this._IS_SHALLOW=n,Ke(i)?_(t)?this._value=t:this._value=n?ee(i):I(i):this._value=i;}get dep(){return this}get value(){let t=v;if(t&&C(this,t),this.flag&16&&this.shouldUpdate()){let i=this.subLink;i&&K(i);}return this._value}set value(t){h(t)&&(t=t.peek());let n=t,i=a(t);if(!shared.hasChanged(this._rawValue,i))return;if(this._oldValue=this._rawValue,this._rawValue=i,this.flag|=16,!Ke(i))this._value=i;else if(_(n))this._value=n;else {let o=this._IS_SHALLOW;this._value=o?ee(i):I(i);}let r=this.subLink;r&&M(r);}shouldUpdate(){if(this.flag&=-17,!("_oldValue"in this))return true;let t=shared.hasChanged(this._oldValue,this._rawValue);return this._oldValue=this._rawValue,t}peek(){return this._value}set(t){this.value=t;}update(t){let n=t(this.peek());h(n)?this.value=n.peek():this.value=n;}};function Ke(e){return shared.isObject(e)?shared.isArray(e)||shared.isMap(e)||shared.isSet(e)||shared.isWeakMap(e)||shared.isWeakSet(e)||shared.isPlainObject(e):false}function Nt(e){return h(e)?e:new P(e)}function Vt(e){return h(e)&&(e=e.peek()),new P(e,true)}function h(e){return !!e&&!!e._IS_SIGNAL}var U=new Set,Te=new Set,Ye=Promise.resolve(),Se=false,Pt=100;function Ue(e){return e?Ye.then(e):Ye}function W(e){U.add(e),We();}function We(){Se||(Se=true,Ue(Ee));}function He(e){Te.add(e),We();}function Ee(){Se=false,Ot();let e=0;for(;U.size>0;){if(++e>Pt){U.clear();return}let t=[...U];U.clear();for(let n of t)try{n();}catch(i){}}}function Ot(){let e=Array.from(Te);Te.clear();for(let t of e)try{t();}catch(n){}}function te(e,t){switch(t){case "sync":return ()=>e();case "pre":return ()=>He(e);case "post":return ()=>W(e);default:return ()=>W(e)}}var H=0;function ge(e){Fe();try{return e()}finally{qe();}}function Fe(){H++;}function qe(){H--,H===0&&Ee();}function _e(){return H>0}function Gt(){return H}var m,ne=class{constructor(t=false,n=void 0){this.detached=t;this.parent=n;this._active=true;this.effects=new Set;this.scopes=new Set;this.cleanups=[];!t&&m&&(this.parent=m,m.scopes.add(this));}get active(){return this._active}pause(){var t;if(this._active){for(let n of this.scopes)n.pause();for(let n of this.effects)(t=n.pause)==null||t.call(n);}}resume(){var t;if(this._active){for(let n of this.scopes)n.resume();for(let n of this.effects)(t=n.resume)==null||t.call(n);}}run(t){if(!this._active)return;let n=m;m=this;try{return t()}finally{m=n;}}stop(t=false){if(!this._active)return;this._active=false;for(let i of this.scopes)i.stop(true);this.scopes.clear();let n=Array.from(this.effects);this.effects.clear();for(let i of n)i.stop();for(let i=0;i<this.cleanups.length;i++)this.cleanups[i]();this.cleanups.length=0,!t&&this.parent&&this.parent.scopes.delete(this),this.parent=void 0;}_record(t){this.effects.add(t),t.scope=this;}_remove(t){this.effects.delete(t);}_pushCleanup(t){this.cleanups.push(t);}};function jt(e=false){return new ne(e)}function Kt(){return m}function Mt(e){let t=m;return m=e,t}function Yt(e,t=false){m&&m._pushCleanup(e);}function ie(e,t=m){t&&t.active&&t._record(e);}function re(e){let t=e.scope;t&&(e.scope=void 0,t._remove(e));}var $e;$e="_IS_EFFECT";var be=class{constructor(t,n){this.flag=18;this[$e]=true;this._active=true;if(this.fn=t,n){this.options=n;let i=n.flush||n.scheduler;i&&!shared.isFunction(i)&&(this._flushScheduler=te(()=>this.run(),i));}ie(this);}get active(){return this._active}get dirty(){let t=this.flag;if(t&16)return true;if(t&32){if(this.depLink&&Q(this.depLink,this))return this.flag=t&-33|16,true;this.flag=t&-33;}return false}pause(){this.flag|=256;}resume(){let n=this.flag&-257;this.flag=n;let i=(n&16)!==0,r=(n&32)!==0;(i||r)&&this.notify();}run(){if(!this._active)return this.fn();let t=this.flag;this.flag=t&-49|512;let n=X(this);try{return this.fn()}catch(i){throw this.flag|=16,i}finally{this.flag&=-513,Z(this,n);}}getJob(){return this._job||(this._job=()=>this.run()),this._job}notify(){var r,o,s;let t=this.flag;if(!this._active||t&784)return;this.flag=t|16;let n=((r=this.options)==null?void 0:r.flush)||((o=this.options)==null?void 0:o.scheduler);n?shared.isFunction(n)?n(this):(s=this._flushScheduler)==null||s.call(this):_e()?W(this.getJob()):this.run();}stop(){var i;if(!this._active)return;this._active=false,re(this);let t=this.depLink;for(;t;)t=D(t,this);let n=this.subLink;for(;n;)n=D(n);this._job=void 0,this._flushScheduler=void 0,this.depLinkTail=void 0,this.subLinkTail=void 0,(i=this.options)!=null&&i.onStop&&this.options.onStop();}};function oe(e,t){let n=new be(e,t);try{n.run();}catch(r){throw n.stop(),r}let i=()=>n.run();return i.effect=n,i.stop=()=>n.stop(),i}function Ut(e){e.effect.stop();}function Wt(e){return !!(e&&e._IS_EFFECT)}function Ht(e,t,n){let i=t;return oe(()=>{i=e(i);},n)}var R=Symbol("computed-no-value"),Qe;Qe="_IS_COMPUTED";var se=class{constructor(t,n,i,r){this.flag=17;this[Qe]=true;this._value=R;this._active=true;this.getter=t,this.setter=n,this.onTrack=i,this.onTrigger=r,ie(this);}get value(){if(!this.active)return this._value===R?this.getter():this._value;v&&C(this,v);let t=this.flag,n=this._value!==R;return n&&!(t&48)?this._value:!n||t&16?(this.recompute(),this._value):(t&32&&(this.depLink&&Q(this.depLink,this)?this.recompute():this.flag=t&-33),this._value)}set value(t){this.setter&&this.setter(t);}peek(){return this.active?(this._value===R&&this.recompute(),this._value):this._value===R?this.getter():this._value}get active(){return this._active}recompute(){if(!this._active){this._value===R&&(this._value=this.getter());return}let t=this._value,n=t!==R,i=X(this);try{let r=this.getter(),o=this.flag,s=this.subLink,c=-49;!n||shared.hasChanged(t,r)?(this._value=r,this.flag=o&c,s&&K(s)):this.flag=o&c;}catch(r){let o=-49;throw this.flag&=o,this._value=R,r}finally{Z(this,i);}}shouldUpdate(){let t=this._value!==R,n=this._value;return this.recompute(),t?shared.hasChanged(this._value,n):true}stop(){if(!this._active)return;this._active=false,re(this);let t=this.depLink;for(;t;)t=D(t,this);let n=this.subLink;for(;n;)n=D(n);this.depLinkTail=void 0,this.subLinkTail=void 0,this.flag&=-49;}};function ve(e){if(F(e))return e;if(!e)throw new Error("[Computed] Invalid argument: computed() requires a getter function or options object.");if(shared.isFunction(e))return new se(e);if(shared.isPlainObject(e)){let{get:t,set:n,onTrack:i,onTrigger:r}=e;if(!t)throw new Error(`[Computed] Invalid options: getter function is required.
|
|
1
|
+
'use strict';var shared=require('@estjs/shared');var S={SET:"SET",ADD:"ADD",DELETE:"DELETE",CLEAR:"CLEAR"};var P=Symbol(""),_=Symbol(""),W=Symbol(""),te=Symbol("");var y=Symbol("");var ne=0,g,F=false,be=class{constructor(t,n){this.map=t;this.key=n;this.isDep=true;this.flag=0;}get subLink(){return this._subLink}set subLink(t){this._subLink=t,t===void 0&&this.map.delete(this.key);}};function Ee(e){e.notify();}function A(e,t){if(F)return;let n=t.depLinkTail;if(n&&n.depNode===e)return n;let o=n?n.nextDepLink:t.depLink;if(o&&o.depNode===e)return o.version=ne,t.depLinkTail=o,o;let r=e.subLinkTail;if(r&&r.version===ne&&r.subNode===t)return t.depLinkTail=r,r;let i={version:ne,depNode:e,subNode:t,prevSubLink:r,nextSubLink:void 0,prevDepLink:n,nextDepLink:o};return o&&(o.prevDepLink=i),n?n.nextDepLink=i:t.depLink=i,r?r.nextSubLink=i:e.subLink=i,e.subLinkTail=i,t.depLinkTail=i,i}function V(e,t=e.subNode){let n=e.depNode,o=e.prevSubLink,r=e.nextSubLink,i=e.prevDepLink,s=e.nextDepLink;if(s?s.prevDepLink=i:t.depLinkTail=i,i?i.nextDepLink=s:t.depLink=s,r?r.prevSubLink=o:n.subLinkTail=o,o)o.nextSubLink=r;else if(n.subLink=r,r===void 0){let a=n.depLink;for(;a;)a=V(a,n);n.depLinkTail=void 0,n.isDep||(n.flag|=16);}return s}function oe(e,t){let n,o=0,r=false;e:do{let i=false;if(t.flag&16)i=true;else {let s=e.depNode,a=s.flag;if((a&17)===17){let l=s.subLink;l&&l.nextSubLink&&j(l),i=true;}else if((a&33)===33)if(s.depLink){n={link:e,prev:n},e=s.depLink,t=s,++o;continue e}else s.flag&=-33;else a&32&&(s.flag&=-33);}if(!i&&e.nextDepLink!==void 0){e=e.nextDepLink;continue e}for(r=i;o--;){e=n.link,n=n.prev,t=e.subNode;let s=e.depNode;if(r?s.flag=s.flag&-33|16:s.flag&=-33,s.flag&16&&(r=true),!r&&e.nextDepLink!==void 0){e=e.nextDepLink;continue e}}return r?t.flag=t.flag&-33|16:t.flag&=-33,r}while(true)}function j(e){for(;e;){let t=e.subNode,n=t.flag;(n&48)===32&&(t.flag=n|16,(n&6)===2&&Ee(t)),e=e.nextSubLink;}}function H(e){let t=e.nextSubLink,n;e:do{let o=e.subNode,r=o.flag&2,i=o.flag;if(i&60?i&12?i&4?!(i&48)&&yt(e,o)?(o.flag=i|40,r&&Ee(o),i&=1):i=0:o.flag=i&-9|32:i=0:(o.flag=i|32,r&&Ee(o)),i&1){let s=o.subLink;if(s!==void 0){let a=s.nextSubLink;a!==void 0&&(n={value:t,prev:n},t=a),e=s;continue}}if((e=t)!==void 0){t=e.nextSubLink;continue}for(;n!==void 0;)if(e=n.value,n=n.prev,e!==void 0){t=e.nextSubLink;continue e}break}while(true)}function _e(e){let t=g;return g=e,t}function re(e){return ne++,e.depLinkTail=void 0,e.flag=e.flag&-57|4,_e(e)}function ie(e,t){g=t;let n=e.depLinkTail,o=n?n.nextDepLink:e.depLink;for(;o;)o=V(o,e);e.flag&=-5;}function ye(e){let t=_e(void 0),n=F;F=true;try{return e()}finally{F=n,_e(t);}}function yt(e,t){let n=t.depLinkTail;for(;n;){if(n===e)return true;n=n.prevDepLink;}return false}var me=new WeakMap,Ye=0,kt=[],ve=0;function Ue(){let e=ve===0?kt:[];return ve++,e}function We(e){e.length=0,ve--;}function ge(e,t,n){if(e)for(let o=e.subLink;o;o=o.nextSubLink){let r=o.subNode;r._triggerVersion!==n&&(r._triggerVersion=n,t.push(r));}}function p(e,t){if(!g||F)return;let n=me.get(e);n||(n=new Map,me.set(e,n));let o=n.get(t);o||(o=new be(n,t),n.set(t,o)),A(o,g);}function b(e,t,n,o){var a;let r=me.get(e);if(!r)return;let i=Ue(),s=++Ye;try{if(n!==void 0)if(shared.isArray(n))for(let l of n)ge(r.get(l),i,s);else ge(r.get(n),i,s);if(t==="ADD"||t==="DELETE"||t==="CLEAR"){let l=shared.isArray(e)?y:te;ge(r.get(l),i,s);}for(let l of i)l.flag&2?(a=l.notify)==null||a.call(l):l.flag&1&&(l.flag|=16,l.subLink&&H(l.subLink));}finally{We(i);}}function Fe(e){!g||F||A(e,g);}function ke(e){var r;let t=e.subLink;if(!t)return;let n=Ue(),o=++Ye;try{for(let i=t;i;i=i.nextSubLink){let s=i.subNode;s._triggerVersion!==o&&(s._triggerVersion=o,n.push(s));}for(let i of n)i.flag&2?(r=i.notify)==null||r.call(i):i.flag&1&&(i.flag|=16,i.subLink&&H(i.subLink));}finally{We(n);}}var we=class{constructor(t,n){this._target=t;this._key=n;this.flag=1;}getValue(){return Fe(this),this._target[this._key]}setValue(t,n){Object.is(n,t)||ke(this);}invalidate(){ke(this);}},xt=new WeakMap,Ct=new WeakMap;function c(e){if(!e||!shared.isObject(e))return e;let t=e._RAW;return t?c(t):h(e)?c(e.peek()):e}var He=It();function It(){let e={};return ["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){let o=c(this);p(o,y);let r=o[t](...n);if((r===-1||r===false)&&n.length>0){let i=n.map(s=>c(s));r=o[t](...i);}return r};}),["find","findIndex","findLast","findLastIndex"].forEach(t=>{e[t]=function(...n){let o=c(this),r=L(this);p(o,y);let i=o[t](...n);return (t==="find"||t==="findLast")&&shared.isObject(i)&&!r?T(i):i};}),["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"].forEach(t=>{e[t]=function(...n){let o=c(this),r=Array.prototype[t].apply(o,n);return b(o,S.SET,[P,y]),r};}),["toReversed","toSorted","toSpliced"].forEach(t=>{e[t]=function(...n){let o=c(this),r=L(this);p(o,y);let i=Array.prototype[t].apply(o,n);return shared.isArray(i)?i.map(s=>shared.isObject(s)?T(s,r):s):i};}),["concat","slice","filter","map","flatMap","flat"].forEach(t=>{e[t]=function(...n){let o=c(this);return p(o,y),Array.prototype[t].apply(this,n)};}),["join","toString","toLocaleString"].forEach(t=>{e[t]=function(...n){let o=c(this);return p(o,y),Array.prototype[t].apply(o,n)};}),["values","keys","entries",Symbol.iterator].forEach(t=>{e[t]=function(){let n=c(this),o=L(this);p(n,P);let r=t===Symbol.iterator?n[Symbol.iterator]():n[t]();return {next(){let{value:i,done:s}=r.next();return s?{value:i,done:s}:shared.isArray(i)?{value:i.map(a=>shared.isObject(a)?T(a,o):a),done:s}:{value:shared.isObject(i)?T(i,o):i,done:s}},[Symbol.iterator](){return this}}};}),e}function Je(e,t){let n=h(t)?t:c(t);return shared.hasChanged(e,n)}var ze=e=>({get:(t,n,o)=>{if(n==="_RAW")return t;if(n==="_IS_REACTIVE")return true;if(n==="_IS_SHALLOW")return e;if(shared.hasOwn(He,n))return He[n];let r=Reflect.get(t,n,o);return shared.isStringNumber(n)&&p(t,n),p(t,P),shared.isObject(r)&&!e?T(r):r},set:(t,n,o,r)=>{let i=Reflect.get(t,n,r),s=c(o),a=Reflect.set(t,n,s,r);return Je(s,i)&&(shared.isStringNumber(n)?b(t,S.SET,[n,y,P]):b(t,S.SET,n)),a},has:(t,n)=>{let o=Reflect.has(t,n);return typeof n!="symbol"&&(shared.isStringNumber(n)&&p(t,n),p(t,P)),o},deleteProperty:(t,n)=>{let o=shared.hasOwn(t,n),r=Reflect.deleteProperty(t,n);return o&&r&&(shared.isStringNumber(n)?b(t,S.DELETE,[n,y,P]):b(t,S.DELETE,n)),r},ownKeys:t=>(p(t,y),Reflect.ownKeys(t))}),Nt=ze(true),At=ze(false),Qe=e=>({get(t,n){return n==="_IS_REACTIVE"?true:n==="_RAW"?t:n==="_IS_SHALLOW"?e:Reflect.get(shared.hasOwn(qe,n)?qe:t,n,t)}}),Xe=e=>({get(t,n){return n==="_IS_REACTIVE"?true:n==="_RAW"?t:n==="_IS_SHALLOW"?e:Reflect.get(shared.hasOwn(Be,n)&&n in t?Be:t,n,t)}}),Vt=Qe(true),Pt=Qe(false),jt=Xe(true),Ot=Xe(false),qe={get(e){let t=c(this);p(t,_);let n=t.get(e);return shared.isUndefined(n)&&!t.has(e)&&m(e)&&(n=t.get(c(e))),shared.isObject(n)&&!L(this)?T(n):n},set(e,t){let n=c(this),o=c(e),r=n.has(o),i=n.get(o),s=c(t);return n.set(o,s),(!r||shared.hasChanged(i,s))&&b(n,S.SET,_),this},add(e){let t=c(this),n=c(e),o=t.has(n);return t.add(n),o||b(t,S.ADD,_),this},has(e){let t=c(this);p(t,_);let n=t.has(e);return !n&&shared.isObject(e)?t.has(c(e)):n},delete(e){let t=c(this),n=t.has(e),o=t.delete(e);return !o&&shared.isObject(e)&&(o=t.delete(c(e))),(n||o)&&b(t,S.DELETE,_),o},clear(){let e=c(this),t=e.size>0,n=e.clear();return t&&b(e,S.CLEAR,_),n},forEach(e,t){let n=c(this),o=L(this);p(n,_),n.forEach((r,i)=>{let s=o||!shared.isObject(r)?r:T(r),a=o||!shared.isObject(i)?i:T(i);e.call(t,s,a,this);});},[Symbol.iterator](){let e=c(this),t=L(this);p(e,_);let n=e[Symbol.iterator]();return {next(){let{value:o,done:r}=n.next();return r?{value:o,done:r}:t?{value:o,done:r}:shared.isArray(o)?{value:o.map(i=>shared.isObject(i)?T(i):i),done:r}:{value:shared.isObject(o)?T(o):o,done:r}},[Symbol.iterator](){return this}}},get size(){let e=c(this);return p(e,_),e.size},keys(){let e=c(this),t=L(this);p(e,_);let n=e.keys();return {next(){let{value:o,done:r}=n.next();return r?{value:o,done:r}:{value:t||!shared.isObject(o)?o:T(o),done:r}},[Symbol.iterator](){return this}}},values(){let e=c(this),t=L(this);p(e,_);let n=e.values();return {next(){let{value:o,done:r}=n.next();return r?{value:o,done:r}:{value:t||!shared.isObject(o)?o:T(o),done:r}},[Symbol.iterator](){return this}}},entries(){let e=c(this),t=L(this);p(e,_);let n=e.entries();return {next(){let{value:o,done:r}=n.next();return r?{value:o,done:r}:t?{value:o,done:r}:{value:o.map(i=>shared.isObject(i)?T(i):i),done:r}},[Symbol.iterator](){return this}}}},Be={get(e){let t=c(this);p(t,W);let n=t.get(e);return shared.isUndefined(n)&&!t.has(e)&&m(e)&&(n=t.get(c(e))),shared.isObject(n)&&!L(this)?T(n):n},set(e,t){let n=c(this),o=c(e),r=n.has(o),i=n.get(o),s=c(t);return n.set(o,s),(!r||shared.hasChanged(i,s))&&b(n,S.SET,W),this},add(e){let t=c(this),n=c(e),o=t.has(n);return t.add(n),o||b(t,S.ADD,W),this},has(e){let t=c(this);p(t,W);let n=t.has(e);return !n&&m(e)&&(n=t.has(c(e))),n},delete(e){let t=c(this),n=c(e),o=t.has(n),r=t.delete(n);return (o||r)&&b(t,S.DELETE,W),r}},J=new WeakMap;function Kt(e,t){var i,s;let n=(i=e._RAW)!=null?i:e,o=(s=J.get(n))==null?void 0:s.get(t);if(!(o!=null&&o.subLink))return 0;let r=0;for(let a=o.subLink;a;a=a.nextSubLink)r++;return r}function Gt(e){let t=J.get(e);return t||(t=new Map,J.set(e,t)),t}function Mt(e,t){if(!g)return e[t];let n=Gt(e),o=n.get(t);return o||(o=new we(e,t),n.set(t,o)),o.getValue()}var Ze=e=>({get(t,n,o){if(n==="_RAW")return t;if(n==="_IS_REACTIVE")return true;if(n==="_IS_SHALLOW")return e;if(g&&shared.hasOwn(t,n)){let s=Mt(t,n),a=h(s)?s.value:s;return shared.isObject(a)&&!e?T(a):a}let r=Reflect.get(t,n,o),i=h(r)?r.value:r;return p(t,n),shared.isObject(i)&&!e?T(i):i},set:(t,n,o,r)=>{let i=shared.hasOwn(t,n),s=Reflect.get(t,n,r),a=c(o),l=Reflect.set(t,n,a,r);if(i){let R=J.get(t),v=R==null?void 0:R.get(n);if(v)return v.setValue(a,s),l}return Je(a,s)&&b(t,i?S.SET:S.ADD,n),l},deleteProperty:(t,n)=>{let o=shared.hasOwn(t,n),r=Reflect.deleteProperty(t,n);if(o&&r){let i=J.get(t),s=i==null?void 0:i.get(n);s&&(i.delete(n),s.invalidate()),b(t,S.DELETE,n);}return r},ownKeys:t=>(p(t,te),Reflect.ownKeys(t))}),Yt=Ze(true),Ut=Ze(false);function T(e,t=false){if(!shared.isObject(e)||m(e))return e;let n=t?Ct:xt,o=n.get(e);if(o)return o;let r;shared.isArray(e)?r=t?Nt:At:shared.isSet(e)||shared.isMap(e)?r=t?Vt:Pt:shared.isWeakMap(e)||shared.isWeakSet(e)?r=t?jt:Ot:r=t?Yt:Ut;let i=new Proxy(e,r);return n.set(e,i),i}function m(e){return !!(e&&e._IS_REACTIVE)}function K(e){return m(e)||h(e)?e:T(e)}function ce(e){return m(e)||h(e)?e:T(e,true)}function L(e){return !!(e&&e._IS_SHALLOW)}var Wt=e=>shared.isObject(e)?K(e):e;var nt;nt="_IS_SIGNAL";var q=class{constructor(t,n=false){this.flag=1;this[nt]=true;let o=c(t);this._rawValue=o,this._IS_SHALLOW=n,tt(o)?m(t)?this._value=t:this._value=n?ce(o):K(o):this._value=o;}get dep(){return this}get value(){let t=g;if(t&&A(this,t),this.flag&16&&this.shouldUpdate()){let o=this.subLink;o&&j(o);}return this._value}set value(t){h(t)&&(t=t.peek());let n=t,o=c(t);if(!shared.hasChanged(this._rawValue,o))return;if(this._oldValue=this._rawValue,this._rawValue=o,this.flag|=16,!tt(o))this._value=o;else if(m(n))this._value=n;else {let i=this._IS_SHALLOW;this._value=i?ce(o):K(o);}let r=this.subLink;r&&H(r);}shouldUpdate(){if(this.flag&=-17,!("_oldValue"in this))return true;let t=shared.hasChanged(this._oldValue,this._rawValue);return this._oldValue=this._rawValue,t}peek(){return this._value}set(t){this.value=t;}update(t){let n=t(this.peek());h(n)?this.value=n.peek():this.value=n;}};function tt(e){return shared.isObject(e)?shared.isArray(e)||shared.isMap(e)||shared.isSet(e)||shared.isWeakMap(e)||shared.isWeakSet(e)||shared.isPlainObject(e):false}function Qt(e){return h(e)?e:new q(e)}function Xt(e){return h(e)&&(e=e.peek()),new q(e,true)}function h(e){return !!e&&!!e._IS_SIGNAL}var z=new Set,Re=new Set,ue=new Set,ot=Promise.resolve(),De=false,Zt=100;function rt(e){return e?ot.then(e):ot}function Q(e){z.add(e),xe();}function xe(){De||(De=true,rt(Ce));}function it(e){Re.add(e),xe();}function en(e){ue.add(e),xe();}function Ce(){De=false,tn();let e=0;for(;z.size>0;){if(++e>Zt){z.clear();break}let t=[...z];z.clear();for(let n of t)try{n();}catch(o){}}nn();}function tn(){let e=Array.from(Re);Re.clear();for(let t of e)try{t();}catch(n){}}function nn(){if(ue.size===0)return;let e=Array.from(ue);ue.clear();for(let t of e)try{t();}catch(n){}}function fe(e,t){switch(t){case "sync":return ()=>e();case "pre":return ()=>it(e);case "post":return ()=>Q(e);default:return ()=>Q(e)}}var X=0;function Ie(e){st();try{return e()}finally{at();}}function st(){X++;}function at(){X--,X===0&&Ce();}function Ne(){return X>0}function on(){return X}var k,le=class{constructor(t=false,n=void 0){this.detached=t;this.parent=n;this._state=0;this.effects=new Set;this.scopes=new Set;this.cleanups=[];!t&&k&&(this.parent=k,k.scopes.add(this));}get active(){return this._state!==2}get isPaused(){return this._state===1}get isDisposed(){return this._state===2}pause(){var t;if(this._state===0){this._state=1;for(let n of this.scopes)n.pause();for(let n of this.effects)(t=n.pause)==null||t.call(n);}}resume(){var t;if(this._state===1){this._state=0;for(let n of this.scopes)n.resume();for(let n of this.effects)(t=n.resume)==null||t.call(n);}}run(t){if(this._state===2)return;let n=k;k=this;try{return t()}finally{k=n;}}stop(t=false){if(this._state!==2){this._state=2;try{for(let o of this.scopes)try{o.stop(!0);}catch(r){}this.scopes.clear();let n=Array.from(this.effects);this.effects.clear();for(let o of n)try{o.stop();}catch(r){}for(let o=0;o<this.cleanups.length;o++)try{this.cleanups[o]();}catch(r){}this.cleanups.length=0;}finally{!t&&this.parent&&this.parent.scopes.delete(this),this.parent=void 0;}}}_record(t){this.effects.add(t),t.scope=this;}_remove(t){this.effects.delete(t);}_pushCleanup(t){this.cleanups.push(t);}};function rn(e=false){return new le(e)}function sn(){return k}function an(e){let t=k;return k=e,t}function Ae(e,t=false){k&&k._pushCleanup(e);}function pe(e,t=k){t&&t.active&&t._record(e);}function de(e){let t=e.scope;t&&(e.scope=void 0,t._remove(e));}var ut;ut="_IS_EFFECT";var Ve=class{constructor(t,n){this.flag=18;this[ut]=true;this._active=true;if(this.fn=t,n){this.options=n;let o=n.flush||n.scheduler;o&&!shared.isFunction(o)&&(this._flushScheduler=fe(()=>this.run(),o));}pe(this);}get active(){return this._active}get dirty(){let t=this.flag;if(t&16)return true;if(t&32){if(this.depLink&&oe(this.depLink,this))return this.flag=t&-33|16,true;this.flag=t&-33;}return false}pause(){this.flag|=256;}resume(){let n=this.flag&-257;this.flag=n;let o=(n&16)!==0,r=(n&32)!==0;(o||r)&&this.notify();}run(){if(!this._active)return this.fn();let t=this.flag;this.flag=t&-49|512;let n=re(this);try{return this.fn()}catch(o){throw this.flag|=16,o}finally{this.flag&=-513,ie(this,n);}}getJob(){return this._job||(this._job=()=>this.run()),this._job}notify(){var r,i,s;let t=this.flag;if(!this._active||t&784)return;this.flag=t|16;let n=((r=this.options)==null?void 0:r.flush)||((i=this.options)==null?void 0:i.scheduler);n?shared.isFunction(n)?n(this):(s=this._flushScheduler)==null||s.call(this):Ne()?Q(this.getJob()):this.run();}stop(){var o;if(!this._active)return;this._active=false,de(this);let t=this.depLink;for(;t;)t=V(t,this);let n=this.subLink;for(;n;)n=V(n);this._job=void 0,this._flushScheduler=void 0,this.depLinkTail=void 0,this.subLinkTail=void 0,(o=this.options)!=null&&o.onStop&&this.options.onStop();}};function he(e,t){let n=new Ve(e,t);try{n.run();}catch(r){throw n.stop(),r}let o=()=>n.run();return o.effect=n,o.stop=()=>n.stop(),o}function cn(e){e.effect.stop();}function un(e){return !!(e&&e._IS_EFFECT)}function fn(e,t,n){let o=t;return he(()=>{o=e(o);},n)}var C=Symbol("computed-no-value"),pt;pt="_IS_COMPUTED";var Te=class{constructor(t,n,o,r){this.flag=17;this[pt]=true;this._value=C;this._active=true;this.getter=t,this.setter=n,this.onTrack=o,this.onTrigger=r,pe(this);}get value(){if(!this.active)return this._value===C?this.getter():this._value;g&&A(this,g);let t=this.flag,n=this._value!==C;return n&&!(t&48)?this._value:!n||t&16?(this.recompute(),this._value):(t&32&&(this.depLink&&oe(this.depLink,this)?this.recompute():this.flag=t&-33),this._value)}set value(t){this.setter&&this.setter(t);}peek(){return this.active?(this._value===C&&this.recompute(),this._value):this._value===C?this.getter():this._value}get active(){return this._active}recompute(){if(!this._active){this._value===C&&(this._value=this.getter());return}let t=this._value,n=t!==C,o=re(this);try{let r=this.getter(n?t:void 0),i=this.flag,s=this.subLink,a=-49;!n||shared.hasChanged(t,r)?(this._value=r,this.flag=i&a,s&&j(s)):this.flag=i&a;}catch(r){let i=-49;throw this.flag&=i,this._value=C,r}finally{ie(this,o);}}shouldUpdate(){let t=this._value!==C,n=this._value;return this.recompute(),t?shared.hasChanged(this._value,n):true}stop(){if(!this._active)return;this._active=false,de(this);let t=this.depLink;for(;t;)t=V(t,this);let n=this.subLink;for(;n;)n=V(n);this.depLinkTail=void 0,this.subLinkTail=void 0,this.flag&=-49;}};function Pe(e){if(G(e))return e;if(!e)throw new Error("[Computed] Invalid argument: computed() requires a getter function or options object.");if(shared.isFunction(e))return new Te(e);if(shared.isPlainObject(e)){let{get:t,set:n,onTrack:o,onTrigger:r}=e;if(!t)throw new Error(`[Computed] Invalid options: getter function is required.
|
|
2
2
|
Usage: computed({ get: () => value, set: (v) => { ... } })`);if(!shared.isFunction(t))throw new TypeError(`[Computed] Invalid options: getter must be a function.
|
|
3
|
-
Received: ${typeof t}`);return new
|
|
4
|
-
Received: ${typeof e}`)}function
|
|
3
|
+
Received: ${typeof t}`);return new Te(t,n,o,r)}throw new Error(`[Computed] Invalid argument: expected a function or options object.
|
|
4
|
+
Received: ${typeof e}`)}function G(e){return !!e&&!!e._IS_COMPUTED}function M(e,t=new WeakMap){if(!shared.isObject(e))return e;if(t.has(e))return t.get(e);if(shared.isDate(e))return new Date(e.getTime());if(shared.isRegExp(e))return new RegExp(e.source,e.flags);if(shared.isMap(e)){let r=new Map;return t.set(e,r),e.forEach((i,s)=>{r.set(M(s,t),M(i,t));}),r}if(shared.isSet(e)){let r=new Set;return t.set(e,r),e.forEach(i=>{r.add(M(i,t));}),r}if(shared.isArray(e)){let r=[];return t.set(e,r),e.forEach((i,s)=>{r[s]=M(i,t);}),r}let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&!shared.isNull(n))return e;let o=Object.create(n);t.set(e,o);for(let r of Reflect.ownKeys(e))o[r]=M(e[r],t);return o}function _n(e){let{state:t,getters:n,actions:o}=e,r=M(t),i=K(t),s=new Set,a=new Set,l=u=>{s.forEach(f=>f(u)),a.forEach(f=>f(u));},R=(u,f,I)=>{u.add(f);let x=()=>u.delete(f);return Ae(x,true),x},v=null,B=u=>{u.depth===0&&u.pending===0&&!u.notified&&(u.notified=true,l(i));},$=u=>{let f=v!=null?v:{depth:0,pending:0,notified:false},I=v;f.depth++;let x;try{v=f,x=Ie(u);}catch(N){throw f.depth--,v=I,N}return v=I,shared.isPromise(x)?(f.pending++,f.depth--,x.then(N=>(f.pending--,B(f),N),N=>{throw f.pending--,B(f),N})):(f.depth--,B(f),x)},U={$patch(u){$(()=>Object.assign(i,u));},$subscribe(u){return R(s,u)},$unsubscribe(u){s.delete(u);},$onAction(u){return R(a,u)},$offAction(u){a.delete(u);},$reset(){$(()=>{let u=M(r);for(let f of Object.keys(i))Object.prototype.hasOwnProperty.call(u,f)||delete i[f];Object.assign(i,u);});}},D={};for(let u of Object.keys(r))Object.defineProperty(D,u,{get:()=>i[u],set:f=>{i[u]=f;},enumerable:true,configurable:true});if(Object.defineProperty(D,"state",{value:i,enumerable:true,configurable:true,writable:false}),Object.assign(D,U),n)for(let u in n){let f=n[u];if(!f)continue;let I=Pe(()=>f.call(D,i));Object.defineProperty(D,u,{get:()=>I.value,enumerable:true,configurable:true});}if(o)for(let u in o){let f=o[u];f&&(D[u]=(...I)=>$(()=>f.apply(D,I)));}return D}function mn(e){let t=new e,n=Object.create(null),o={},r={};return Object.getOwnPropertyNames(t).forEach(i=>{n[i]=t[i];}),Object.getOwnPropertyNames(e.prototype).forEach(i=>{let s=Object.getOwnPropertyDescriptor(e.prototype,i);s&&(shared.isFunction(s.get)?o[i]=function(){return s.get.call(this)}:shared.isFunction(s.value)&&i!=="constructor"&&(r[i]=function(...a){return s.value.apply(this,a)}));}),{state:n,getters:o,actions:r}}function vn(e){return ()=>{let t;return shared.isFunction(e)?t=mn(e):t=e,_n(t)}}var dt,ht,Se=class extends(ht=q,dt="_IS_REF",ht){constructor(n){super(n,true);this[dt]=true;}get value(){let n=g;if(n&&A(this,n),this.flag&16&&this.shouldUpdate()){let o=this.subLink;o&&j(o);}return this._value}set value(n){h(n)&&(n=n.peek()),Z(n)&&(n=n.value),shared.hasChanged(this._value,n)&&(this._oldValue=this._rawValue,this._rawValue=n,this._value=n,this.flag|=16,this.subLink&&H(this.subLink));}};function kn(e=void 0){return Z(e)?e:h(e)?new Se(e.peek()):new Se(e)}function Z(e){return !!e&&!!e._IS_REF}var Tt;Tt="_IS_COMPUTED";var Oe=class{constructor(t,n,o){this.obj=t;this.key=n;this.defaultValue=o;this[Tt]=true;}get value(){let t=this.obj[this.key];return t!==void 0?t:this.defaultValue}set value(t){this.obj[this.key]=t;}peek(){return ye(()=>this.value)}};function Ln(e){return h(e)||Z(e)||G(e)?e.value:shared.isFunction(e)?e():e}function St(e,t,n){return new Oe(e,t,n)}function Rn(e){let t={};for(let n of Object.keys(e))t[n]=St(e,n);return t}var gt={},bt=new Set,Ke=false;function Y(e,t){if(!shared.isObject(e)||t.has(e))return e;if(t.add(e),h(e)||G(e))Y(e.value,t);else if(shared.isArray(e))for(let n of e)Y(n,t);else if(shared.isMap(e))e.forEach(n=>{Y(n,t);}),e.keys(),e.values();else if(shared.isSet(e))e.forEach(n=>{Y(n,t);}),e.values();else for(let n of Object.keys(e))Y(e[n],t);return e}function mt(e){if(Ke)return Y(e,new Set);Ke=true,bt.clear();try{return Y(e,bt)}finally{Ke=false;}}function Et(e){return shared.isFunction(e)?e:h(e)||G(e)?()=>e.value:m(e)?()=>mt(e):()=>e}function Nn(e){if(shared.isArray(e)){let t=e.map(n=>Et(n));return ()=>t.map(n=>n())}return Et(e)}function An(e,t,n={}){let{immediate:o=false,deep:r=false,flush:i="post",once:s=false}=n,a=gt,l,R=true,v=!shared.isArray(e)&&m(e),B=r&&!v,$=Nn(e),U,D=w=>{U=()=>{U=void 0;try{w();}catch(ee){}};},u=()=>{U&&U();},f=w=>{u(),t(w,a===gt?void 0:a,D),a=w,s&&N();},x=he(()=>{let w=$();return B&&mt(w),l=w,w},{scheduler:fe(()=>{if(!R)return;let w=x.effect;if(!w.active)return;let ee=w.run();(r||shared.isObject(ee)||shared.hasChanged(ee,a))&&f(ee);},i)});function N(){R&&(R=false,u(),x.stop());}return o?f(l):a=l,N}exports.EffectScope=le;exports.TriggerOpTypes=S;exports.batch=Ie;exports.computed=Pe;exports.createStore=vn;exports.effect=he;exports.effectScope=rn;exports.endBatch=at;exports.getBatchDepth=on;exports.getCurrentScope=sn;exports.getTargetDepSize=Kt;exports.isBatching=Ne;exports.isComputed=G;exports.isEffect=un;exports.isReactive=m;exports.isRef=Z;exports.isShallow=L;exports.isSignal=h;exports.memoEffect=fn;exports.nextTick=rt;exports.onScopeDispose=Ae;exports.queueJob=Q;exports.queuePostFlushJob=en;exports.queuePreFlushCb=it;exports.reactive=K;exports.ref=kn;exports.setCurrentScope=an;exports.shallowReactive=ce;exports.shallowSignal=Xt;exports.signal=Qt;exports.startBatch=st;exports.stop=cn;exports.toRaw=c;exports.toReactive=Wt;exports.toRef=St;exports.toRefs=Rn;exports.trigger=b;exports.unref=Ln;exports.untrack=ye;exports.watch=An;
|
package/dist/signals.d.cts
CHANGED
|
@@ -219,12 +219,16 @@ interface ScopedReactiveEffect {
|
|
|
219
219
|
declare class EffectScope {
|
|
220
220
|
detached: boolean;
|
|
221
221
|
parent: EffectScope | undefined;
|
|
222
|
-
private
|
|
222
|
+
private _state;
|
|
223
223
|
private effects;
|
|
224
224
|
private scopes;
|
|
225
225
|
private cleanups;
|
|
226
226
|
constructor(detached?: boolean, parent?: EffectScope | undefined);
|
|
227
227
|
get active(): boolean;
|
|
228
|
+
/** Whether the scope is paused. */
|
|
229
|
+
get isPaused(): boolean;
|
|
230
|
+
/** Whether the scope has been stopped / disposed. */
|
|
231
|
+
get isDisposed(): boolean;
|
|
228
232
|
pause(): void;
|
|
229
233
|
resume(): void;
|
|
230
234
|
run<T>(fn: () => T): T | undefined;
|
|
@@ -241,7 +245,7 @@ declare function onScopeDispose(fn: () => void, failSilently?: boolean): void;
|
|
|
241
245
|
/**
|
|
242
246
|
* Computed getter function type
|
|
243
247
|
*/
|
|
244
|
-
type ComputedGetter<T> = () => T;
|
|
248
|
+
type ComputedGetter<T> = (oldValue?: T) => T;
|
|
245
249
|
/**
|
|
246
250
|
* Computed setter function type
|
|
247
251
|
*/
|
|
@@ -416,6 +420,17 @@ declare function isComputed<T>(value: unknown): value is Computed<T>;
|
|
|
416
420
|
* @returns {T} Raw value without any reactive wrapping.
|
|
417
421
|
*/
|
|
418
422
|
declare function toRaw<T>(value: T): T;
|
|
423
|
+
/**
|
|
424
|
+
* Count the number of active effect subscribers on a reactive object property.
|
|
425
|
+
*
|
|
426
|
+
* Own-key deps live on their {@link ReactiveProperty} node inside
|
|
427
|
+
* `targetPropertyMaps`; prototype / collection deps are still in the
|
|
428
|
+
* standard `targetMap` (via `system.ts`), but plain-object own keys
|
|
429
|
+
* always use the fast path, so checking the property map is sufficient.
|
|
430
|
+
*
|
|
431
|
+
* Used by tests to assert that effects are properly cleaned up.
|
|
432
|
+
*/
|
|
433
|
+
declare function getTargetDepSize(target: object, key: string | symbol): number;
|
|
419
434
|
/**
|
|
420
435
|
* Check if the target object is reactive.
|
|
421
436
|
*
|
|
@@ -481,11 +496,15 @@ type Job = () => void;
|
|
|
481
496
|
* Represents a callback function that should be executed before the main task queue
|
|
482
497
|
*/
|
|
483
498
|
type PreFlushCallback = () => void;
|
|
499
|
+
/**
|
|
500
|
+
* Represents a callback function that should be executed after the main task queue
|
|
501
|
+
*/
|
|
502
|
+
type PostFlushCallback = () => void;
|
|
484
503
|
/**
|
|
485
504
|
* Represents the possible flush timing strategies for effects
|
|
486
505
|
*
|
|
487
506
|
* - 'pre': Execute before the main queue (useful for component updates)
|
|
488
|
-
* - 'post': Execute
|
|
507
|
+
* - 'post': Execute on the main queue (default behavior)
|
|
489
508
|
* - 'sync': Execute immediately and synchronously (use sparingly)
|
|
490
509
|
*/
|
|
491
510
|
type FlushTiming = 'pre' | 'post' | 'sync';
|
|
@@ -508,6 +527,15 @@ declare function queueJob(job: Job): void;
|
|
|
508
527
|
* @param cb - The callback to execute before the main queue.
|
|
509
528
|
*/
|
|
510
529
|
declare function queuePreFlushCb(cb: PreFlushCallback): void;
|
|
530
|
+
/**
|
|
531
|
+
* Adds a callback to be executed after the main queue has been fully drained.
|
|
532
|
+
*
|
|
533
|
+
* Useful for Suspense onResolved handlers and DOM-measurement callbacks that
|
|
534
|
+
* must fire after all reactive effects have settled.
|
|
535
|
+
*
|
|
536
|
+
* @param cb - The callback to execute after the main queue.
|
|
537
|
+
*/
|
|
538
|
+
declare function queuePostFlushJob(cb: PostFlushCallback): void;
|
|
511
539
|
|
|
512
540
|
/**
|
|
513
541
|
* Unwrap a Signal, Computed, or Reactive type to get the underlying value type
|
|
@@ -1041,6 +1069,67 @@ declare function ref<T>(value?: T): Ref<T>;
|
|
|
1041
1069
|
*/
|
|
1042
1070
|
declare function isRef<T>(value: unknown): value is Ref<T>;
|
|
1043
1071
|
|
|
1072
|
+
/**
|
|
1073
|
+
* Unwrap a signal, computed, ref, or getter function to its raw value.
|
|
1074
|
+
*
|
|
1075
|
+
* - Signal / Computed / Ref → returns `.value`
|
|
1076
|
+
* - Getter function → calls and returns the result
|
|
1077
|
+
* - Plain value → returns as-is
|
|
1078
|
+
*
|
|
1079
|
+
* @example
|
|
1080
|
+
* ```ts
|
|
1081
|
+
* const count = signal(5)
|
|
1082
|
+
* unref(count) // 5
|
|
1083
|
+
* unref(5) // 5
|
|
1084
|
+
* unref(() => count.value) // 5
|
|
1085
|
+
* ```
|
|
1086
|
+
*/
|
|
1087
|
+
declare function unref<T>(value: T): T extends {
|
|
1088
|
+
value: infer V;
|
|
1089
|
+
} ? V : T extends (...args: any[]) => infer R ? R : T;
|
|
1090
|
+
/**
|
|
1091
|
+
* Create a writable computed that proxies a single property of a reactive object.
|
|
1092
|
+
* Changes propagate both ways — reading the ref reads from the object,
|
|
1093
|
+
* writing to the ref writes back to the object.
|
|
1094
|
+
*
|
|
1095
|
+
* Useful for destructuring reactive state while maintaining reactivity.
|
|
1096
|
+
*
|
|
1097
|
+
* @param obj - A reactive object (created by `reactive()`)
|
|
1098
|
+
* @param key - The property key to extract
|
|
1099
|
+
* @param defaultValue - Optional default value when the property is undefined
|
|
1100
|
+
* @returns A writable Computed bound to that property
|
|
1101
|
+
*
|
|
1102
|
+
* @example
|
|
1103
|
+
* ```ts
|
|
1104
|
+
* const state = reactive({ count: 0, name: 'Alice' })
|
|
1105
|
+
* const countRef = toRef(state, 'count')
|
|
1106
|
+
* countRef.value // 0
|
|
1107
|
+
* countRef.value = 5 // state.count === 5
|
|
1108
|
+
* ```
|
|
1109
|
+
*/
|
|
1110
|
+
declare function toRef<T extends object, K extends keyof T>(obj: T, key: K, defaultValue?: T[K]): Computed<T[K]>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Convert a reactive object into a plain object where every property
|
|
1113
|
+
* is wrapped in a writable computed ref.
|
|
1114
|
+
*
|
|
1115
|
+
* Enables `const { x, y } = toRefs(state)` — destructuring while
|
|
1116
|
+
* keeping reactivity.
|
|
1117
|
+
*
|
|
1118
|
+
* @param obj - A reactive object (created by `reactive()`)
|
|
1119
|
+
* @returns A plain object with each property wrapped as a writable Computed
|
|
1120
|
+
*
|
|
1121
|
+
* @example
|
|
1122
|
+
* ```ts
|
|
1123
|
+
* const state = reactive({ x: 1, y: 2 })
|
|
1124
|
+
* const { x, y } = toRefs(state)
|
|
1125
|
+
* x.value // 1
|
|
1126
|
+
* x.value = 10 // state.x === 10
|
|
1127
|
+
* ```
|
|
1128
|
+
*/
|
|
1129
|
+
declare function toRefs<T extends object>(obj: T): {
|
|
1130
|
+
[K in keyof T]: Computed<T[K]>;
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1044
1133
|
interface WatchOptions {
|
|
1045
1134
|
/** Whether to execute the callback immediately once on setup. */
|
|
1046
1135
|
immediate?: boolean;
|
|
@@ -1112,4 +1201,4 @@ type WatchCallback<T = any> = (newValue: T, oldValue: T | undefined, onCleanup:
|
|
|
1112
1201
|
*/
|
|
1113
1202
|
declare function watch<T = any>(source: WatchSource<T>, callback: WatchCallback<T>, options?: WatchOptions): () => void;
|
|
1114
1203
|
|
|
1115
|
-
export { type Computed, type ComputedGetter, type ComputedOptions, type ComputedSetter, type ComputedType, type DebuggerEvent, type DebuggerEventType, type EffectFunction, type EffectOptions, type EffectRunner, type EffectScheduler, EffectScope, type FlushTiming, type Job, type MemoEffectFn, type PreFlushCallback, type Reactive, type Ref, type Signal, type SignalType, type SignalValue, type StoreActions, type StoreOptions, TriggerOpTypes, type Unwrap, batch, computed, createStore, effect, effectScope, endBatch, getBatchDepth, getCurrentScope, isBatching, isComputed, isEffect, isReactive, isRef, isShallow, isSignal, memoEffect, nextTick, onScopeDispose, queueJob, queuePreFlushCb, reactive, ref, setCurrentScope, shallowReactive, shallowSignal, signal, startBatch, stop, toRaw, toReactive, trigger, untrack, watch };
|
|
1204
|
+
export { type Computed, type ComputedGetter, type ComputedOptions, type ComputedSetter, type ComputedType, type DebuggerEvent, type DebuggerEventType, type EffectFunction, type EffectOptions, type EffectRunner, type EffectScheduler, EffectScope, type FlushTiming, type Job, type MemoEffectFn, type PostFlushCallback, type PreFlushCallback, type Reactive, type Ref, type Signal, type SignalType, type SignalValue, type StoreActions, type StoreOptions, TriggerOpTypes, type Unwrap, batch, computed, createStore, effect, effectScope, endBatch, getBatchDepth, getCurrentScope, getTargetDepSize, isBatching, isComputed, isEffect, isReactive, isRef, isShallow, isSignal, memoEffect, nextTick, onScopeDispose, queueJob, queuePostFlushJob, queuePreFlushCb, reactive, ref, setCurrentScope, shallowReactive, shallowSignal, signal, startBatch, stop, toRaw, toReactive, toRef, toRefs, trigger, unref, untrack, watch };
|
package/dist/signals.d.ts
CHANGED
|
@@ -219,12 +219,16 @@ interface ScopedReactiveEffect {
|
|
|
219
219
|
declare class EffectScope {
|
|
220
220
|
detached: boolean;
|
|
221
221
|
parent: EffectScope | undefined;
|
|
222
|
-
private
|
|
222
|
+
private _state;
|
|
223
223
|
private effects;
|
|
224
224
|
private scopes;
|
|
225
225
|
private cleanups;
|
|
226
226
|
constructor(detached?: boolean, parent?: EffectScope | undefined);
|
|
227
227
|
get active(): boolean;
|
|
228
|
+
/** Whether the scope is paused. */
|
|
229
|
+
get isPaused(): boolean;
|
|
230
|
+
/** Whether the scope has been stopped / disposed. */
|
|
231
|
+
get isDisposed(): boolean;
|
|
228
232
|
pause(): void;
|
|
229
233
|
resume(): void;
|
|
230
234
|
run<T>(fn: () => T): T | undefined;
|
|
@@ -241,7 +245,7 @@ declare function onScopeDispose(fn: () => void, failSilently?: boolean): void;
|
|
|
241
245
|
/**
|
|
242
246
|
* Computed getter function type
|
|
243
247
|
*/
|
|
244
|
-
type ComputedGetter<T> = () => T;
|
|
248
|
+
type ComputedGetter<T> = (oldValue?: T) => T;
|
|
245
249
|
/**
|
|
246
250
|
* Computed setter function type
|
|
247
251
|
*/
|
|
@@ -416,6 +420,17 @@ declare function isComputed<T>(value: unknown): value is Computed<T>;
|
|
|
416
420
|
* @returns {T} Raw value without any reactive wrapping.
|
|
417
421
|
*/
|
|
418
422
|
declare function toRaw<T>(value: T): T;
|
|
423
|
+
/**
|
|
424
|
+
* Count the number of active effect subscribers on a reactive object property.
|
|
425
|
+
*
|
|
426
|
+
* Own-key deps live on their {@link ReactiveProperty} node inside
|
|
427
|
+
* `targetPropertyMaps`; prototype / collection deps are still in the
|
|
428
|
+
* standard `targetMap` (via `system.ts`), but plain-object own keys
|
|
429
|
+
* always use the fast path, so checking the property map is sufficient.
|
|
430
|
+
*
|
|
431
|
+
* Used by tests to assert that effects are properly cleaned up.
|
|
432
|
+
*/
|
|
433
|
+
declare function getTargetDepSize(target: object, key: string | symbol): number;
|
|
419
434
|
/**
|
|
420
435
|
* Check if the target object is reactive.
|
|
421
436
|
*
|
|
@@ -481,11 +496,15 @@ type Job = () => void;
|
|
|
481
496
|
* Represents a callback function that should be executed before the main task queue
|
|
482
497
|
*/
|
|
483
498
|
type PreFlushCallback = () => void;
|
|
499
|
+
/**
|
|
500
|
+
* Represents a callback function that should be executed after the main task queue
|
|
501
|
+
*/
|
|
502
|
+
type PostFlushCallback = () => void;
|
|
484
503
|
/**
|
|
485
504
|
* Represents the possible flush timing strategies for effects
|
|
486
505
|
*
|
|
487
506
|
* - 'pre': Execute before the main queue (useful for component updates)
|
|
488
|
-
* - 'post': Execute
|
|
507
|
+
* - 'post': Execute on the main queue (default behavior)
|
|
489
508
|
* - 'sync': Execute immediately and synchronously (use sparingly)
|
|
490
509
|
*/
|
|
491
510
|
type FlushTiming = 'pre' | 'post' | 'sync';
|
|
@@ -508,6 +527,15 @@ declare function queueJob(job: Job): void;
|
|
|
508
527
|
* @param cb - The callback to execute before the main queue.
|
|
509
528
|
*/
|
|
510
529
|
declare function queuePreFlushCb(cb: PreFlushCallback): void;
|
|
530
|
+
/**
|
|
531
|
+
* Adds a callback to be executed after the main queue has been fully drained.
|
|
532
|
+
*
|
|
533
|
+
* Useful for Suspense onResolved handlers and DOM-measurement callbacks that
|
|
534
|
+
* must fire after all reactive effects have settled.
|
|
535
|
+
*
|
|
536
|
+
* @param cb - The callback to execute after the main queue.
|
|
537
|
+
*/
|
|
538
|
+
declare function queuePostFlushJob(cb: PostFlushCallback): void;
|
|
511
539
|
|
|
512
540
|
/**
|
|
513
541
|
* Unwrap a Signal, Computed, or Reactive type to get the underlying value type
|
|
@@ -1041,6 +1069,67 @@ declare function ref<T>(value?: T): Ref<T>;
|
|
|
1041
1069
|
*/
|
|
1042
1070
|
declare function isRef<T>(value: unknown): value is Ref<T>;
|
|
1043
1071
|
|
|
1072
|
+
/**
|
|
1073
|
+
* Unwrap a signal, computed, ref, or getter function to its raw value.
|
|
1074
|
+
*
|
|
1075
|
+
* - Signal / Computed / Ref → returns `.value`
|
|
1076
|
+
* - Getter function → calls and returns the result
|
|
1077
|
+
* - Plain value → returns as-is
|
|
1078
|
+
*
|
|
1079
|
+
* @example
|
|
1080
|
+
* ```ts
|
|
1081
|
+
* const count = signal(5)
|
|
1082
|
+
* unref(count) // 5
|
|
1083
|
+
* unref(5) // 5
|
|
1084
|
+
* unref(() => count.value) // 5
|
|
1085
|
+
* ```
|
|
1086
|
+
*/
|
|
1087
|
+
declare function unref<T>(value: T): T extends {
|
|
1088
|
+
value: infer V;
|
|
1089
|
+
} ? V : T extends (...args: any[]) => infer R ? R : T;
|
|
1090
|
+
/**
|
|
1091
|
+
* Create a writable computed that proxies a single property of a reactive object.
|
|
1092
|
+
* Changes propagate both ways — reading the ref reads from the object,
|
|
1093
|
+
* writing to the ref writes back to the object.
|
|
1094
|
+
*
|
|
1095
|
+
* Useful for destructuring reactive state while maintaining reactivity.
|
|
1096
|
+
*
|
|
1097
|
+
* @param obj - A reactive object (created by `reactive()`)
|
|
1098
|
+
* @param key - The property key to extract
|
|
1099
|
+
* @param defaultValue - Optional default value when the property is undefined
|
|
1100
|
+
* @returns A writable Computed bound to that property
|
|
1101
|
+
*
|
|
1102
|
+
* @example
|
|
1103
|
+
* ```ts
|
|
1104
|
+
* const state = reactive({ count: 0, name: 'Alice' })
|
|
1105
|
+
* const countRef = toRef(state, 'count')
|
|
1106
|
+
* countRef.value // 0
|
|
1107
|
+
* countRef.value = 5 // state.count === 5
|
|
1108
|
+
* ```
|
|
1109
|
+
*/
|
|
1110
|
+
declare function toRef<T extends object, K extends keyof T>(obj: T, key: K, defaultValue?: T[K]): Computed<T[K]>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Convert a reactive object into a plain object where every property
|
|
1113
|
+
* is wrapped in a writable computed ref.
|
|
1114
|
+
*
|
|
1115
|
+
* Enables `const { x, y } = toRefs(state)` — destructuring while
|
|
1116
|
+
* keeping reactivity.
|
|
1117
|
+
*
|
|
1118
|
+
* @param obj - A reactive object (created by `reactive()`)
|
|
1119
|
+
* @returns A plain object with each property wrapped as a writable Computed
|
|
1120
|
+
*
|
|
1121
|
+
* @example
|
|
1122
|
+
* ```ts
|
|
1123
|
+
* const state = reactive({ x: 1, y: 2 })
|
|
1124
|
+
* const { x, y } = toRefs(state)
|
|
1125
|
+
* x.value // 1
|
|
1126
|
+
* x.value = 10 // state.x === 10
|
|
1127
|
+
* ```
|
|
1128
|
+
*/
|
|
1129
|
+
declare function toRefs<T extends object>(obj: T): {
|
|
1130
|
+
[K in keyof T]: Computed<T[K]>;
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1044
1133
|
interface WatchOptions {
|
|
1045
1134
|
/** Whether to execute the callback immediately once on setup. */
|
|
1046
1135
|
immediate?: boolean;
|
|
@@ -1112,4 +1201,4 @@ type WatchCallback<T = any> = (newValue: T, oldValue: T | undefined, onCleanup:
|
|
|
1112
1201
|
*/
|
|
1113
1202
|
declare function watch<T = any>(source: WatchSource<T>, callback: WatchCallback<T>, options?: WatchOptions): () => void;
|
|
1114
1203
|
|
|
1115
|
-
export { type Computed, type ComputedGetter, type ComputedOptions, type ComputedSetter, type ComputedType, type DebuggerEvent, type DebuggerEventType, type EffectFunction, type EffectOptions, type EffectRunner, type EffectScheduler, EffectScope, type FlushTiming, type Job, type MemoEffectFn, type PreFlushCallback, type Reactive, type Ref, type Signal, type SignalType, type SignalValue, type StoreActions, type StoreOptions, TriggerOpTypes, type Unwrap, batch, computed, createStore, effect, effectScope, endBatch, getBatchDepth, getCurrentScope, isBatching, isComputed, isEffect, isReactive, isRef, isShallow, isSignal, memoEffect, nextTick, onScopeDispose, queueJob, queuePreFlushCb, reactive, ref, setCurrentScope, shallowReactive, shallowSignal, signal, startBatch, stop, toRaw, toReactive, trigger, untrack, watch };
|
|
1204
|
+
export { type Computed, type ComputedGetter, type ComputedOptions, type ComputedSetter, type ComputedType, type DebuggerEvent, type DebuggerEventType, type EffectFunction, type EffectOptions, type EffectRunner, type EffectScheduler, EffectScope, type FlushTiming, type Job, type MemoEffectFn, type PostFlushCallback, type PreFlushCallback, type Reactive, type Ref, type Signal, type SignalType, type SignalValue, type StoreActions, type StoreOptions, TriggerOpTypes, type Unwrap, batch, computed, createStore, effect, effectScope, endBatch, getBatchDepth, getCurrentScope, getTargetDepSize, isBatching, isComputed, isEffect, isReactive, isRef, isShallow, isSignal, memoEffect, nextTick, onScopeDispose, queueJob, queuePostFlushJob, queuePreFlushCb, reactive, ref, setCurrentScope, shallowReactive, shallowSignal, signal, startBatch, stop, toRaw, toReactive, toRef, toRefs, trigger, unref, untrack, watch };
|