From f3fe3db719d5012b81725add0afcf5476ae943ba Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 4 Dec 2024 15:46:21 +0000 Subject: [PATCH] Updating from b5aebe9fae8924a12bc4e2c37074462102c8a797 --- assets/icons.js | 18 +++ assets/icons.svg | 1 + assets/main.js | 9 +- assets/navigation.js | 2 +- assets/search.js | 2 +- assets/style.css | 195 +++++++++++++++++++--------- classes/DerivedStore.html | 79 +++++------- classes/Store.html | 79 +++++------- functions/asReadable.html | 12 +- functions/asWritable.html | 18 +-- functions/batch.html | 17 +-- functions/computed.html | 10 +- functions/derived.html | 18 +-- functions/equal.html | 8 +- functions/get.html | 11 +- functions/readable.html | 13 +- functions/untrack.html | 6 +- functions/writable.html | 13 +- hierarchy.html | 2 +- index.html | 198 +++++++++++++++++------------ interfaces/AsyncDeriveOptions.html | 51 ++------ interfaces/InteropObservable.html | 6 +- interfaces/OnUseArgument.html | 6 +- interfaces/Readable-1.html | 16 ++- interfaces/ReadableSignal.html | 18 +-- interfaces/SignalStore.html | 4 + interfaces/StoreOptions.html | 55 +++----- interfaces/SubscribableStore.html | 12 +- interfaces/SubscriberObject.html | 28 ++-- interfaces/SyncDeriveOptions.html | 51 ++------ interfaces/UnsubscribeObject.html | 8 +- interfaces/Writable-1.html | 33 ++--- interfaces/WritableSignal.html | 30 +++-- media/DEVELOPER.md | 9 ++ modules.html | 77 +++++------ types/AsyncDeriveFn.html | 2 +- types/OnUseFn.html | 4 +- types/StoreInput.html | 4 +- types/StoresInput.html | 4 +- types/StoresInputValues.html | 6 +- types/Subscriber.html | 4 +- types/SubscriberFunction.html | 4 +- types/SyncDeriveFn.html | 2 +- types/UnsubscribeFunction.html | 4 +- types/Unsubscriber.html | 2 +- types/Updater.html | 4 +- variables/symbolObservable.html | 4 +- 47 files changed, 610 insertions(+), 549 deletions(-) create mode 100644 assets/icons.js create mode 100644 assets/icons.svg create mode 100644 interfaces/SignalStore.html create mode 100644 media/DEVELOPER.md diff --git a/assets/icons.js b/assets/icons.js new file mode 100644 index 0000000..3dfbd32 --- /dev/null +++ b/assets/icons.js @@ -0,0 +1,18 @@ +(function() { + addIcons(); + function addIcons() { + if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons); + const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg")); + svg.innerHTML = `MMNEPVFCICPMFPCPTTAAATR`; + svg.style.display = "none"; + if (location.protocol === "file:") updateUseElements(); + } + + function updateUseElements() { + document.querySelectorAll("use").forEach(el => { + if (el.getAttribute("href").includes("#icon-")) { + el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#")); + } + }); + } +})() \ No newline at end of file diff --git a/assets/icons.svg b/assets/icons.svg new file mode 100644 index 0000000..a19417d --- /dev/null +++ b/assets/icons.svg @@ -0,0 +1 @@ +MMNEPVFCICPMFPCPTTAAATR \ No newline at end of file diff --git a/assets/main.js b/assets/main.js index 7270cff..99097a0 100644 --- a/assets/main.js +++ b/assets/main.js @@ -1,8 +1,9 @@ "use strict"; -"use strict";(()=>{var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Ie(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Pe(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),v=s.str.charAt(1),f;v in s.node.edges?f=s.node.edges[v]:(f=new t.TokenSet,s.node.edges[v]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` - ${ce(l.parent,i)}.${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(B,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`,this.handleValueChange()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(e=>{e.style.display="block";let n=Array.from(e.querySelectorAll(".tsd-index-link")).every(r=>r.offsetParent==null);e.style.display=n?"none":"block"})}};var Z=class extends C{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); +window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings."}; +"use strict";(()=>{var Pe=Object.create;var ie=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty;var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var De=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _e(e))!Me.call(t,i)&&i!==n&&ie(t,i,{get:()=>e[i],enumerable:!(r=Oe(e,i))||r.enumerable});return t};var Ae=(t,e,n)=>(n=t!=null?Pe(Re(t)):{},De(e||!t||!t.__esModule?ie(n,"default",{value:t,enumerable:!0}):n,t));var ue=Fe((ae,le)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),p;m in s.node.edges?p=s.node.edges[m]:(p=new t.TokenSet,s.node.edges[m]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof ae=="object"?le.exports=n():e.lunr=n()}(this,function(){return t})})()});var se=[];function G(t,e){se.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){se.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!Ve(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function Ve(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var oe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var pe=Ae(ue());async function ce(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=pe.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function fe(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{ce(e,t)}),ce(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");i.addEventListener("mouseup",()=>{te(t)}),r.addEventListener("focus",()=>t.classList.add("has-focus")),He(t,i,r,e)}function He(t,e,n,r){n.addEventListener("input",oe(()=>{Ne(t,e,n,r)},200)),n.addEventListener("keydown",i=>{i.key=="Enter"?Be(e,t):i.key=="ArrowUp"?(de(e,n,-1),i.preventDefault()):i.key==="ArrowDown"&&(de(e,n,1),i.preventDefault())}),document.body.addEventListener("keypress",i=>{i.altKey||i.ctrlKey||i.metaKey||!n.matches(":focus")&&i.key==="/"&&(i.preventDefault(),n.focus())}),document.body.addEventListener("keyup",i=>{t.classList.contains("has-focus")&&(i.key==="Escape"||!e.matches(":focus-within")&&!n.matches(":focus"))&&(n.blur(),te(t))})}function te(t){t.classList.remove("has-focus")}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=he(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${he(l.parent,i)}.${d}`);let m=document.createElement("li");m.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,m.append(p),p.addEventListener("focus",()=>{e.querySelector(".current")?.classList.remove("current"),m.classList.add("current")}),e.appendChild(m)}}function de(t,e,n){let r=t.querySelector(".current");if(!r)r=t.querySelector(n==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let i=r;if(n===1)do i=i.nextElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);else do i=i.previousElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);i?(r.classList.remove("current"),i.classList.add("current")):n===-1&&(r.classList.remove("current"),e.focus())}}function Be(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),te(e)}}function he(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(ee(t.substring(s,o)),`${ee(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(ee(t.substring(s))),i.join("")}var je={"&":"&","<":"<",">":">","'":"'",'"':"""};function ee(t){return t.replace(/[&<>"'"]/g,e=>je[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",ye="mousemove",N="mouseup",J={x:0,y:0},me=!1,ne=!1,qe=!1,D=!1,ve=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(ve?"is-mobile":"not-mobile");ve&&"ontouchstart"in document.documentElement&&(qe=!0,F="touchstart",ye="touchmove",N="touchend");document.addEventListener(F,t=>{ne=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(ye,t=>{if(ne&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(N,()=>{ne=!1});document.addEventListener("click",t=>{me&&(t.preventDefault(),t.stopImmediatePropagation(),me=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var re;try{re=localStorage}catch{re={getItem(){return null},setItem(){}}}var Q=re;var ge=document.head.appendChild(document.createElement("style"));ge.dataset.for="filters";var Y=class extends I{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ge.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function Ee(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,xe(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),xe(t.value)})}function xe(t){document.documentElement.dataset.theme=t}var K;function we(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Le),Le())}async function Le(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();K=t.dataset.base,K.endsWith("/")||(K+="/"),t.innerHTML="";for(let s of i)Se(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Se(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-accordion`:"tsd-accordion";let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.dataset.key=i.join("$"),o.innerHTML='',be(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)Se(u,l,i)}else be(t,r,t.class)}function be(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=K+t.path,n&&(r.className=n),location.pathname===r.pathname&&!r.href.includes("#")&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else{let r=e.appendChild(document.createElement("span"));r.innerHTML='',r.appendChild(document.createElement("span")).textContent=t.text}}G(X,"a[data-toggle]");G(Z,".tsd-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Te=document.getElementById("tsd-theme");Te&&Ee(Te);var $e=new U;Object.defineProperty(window,"app",{value:$e});fe();we();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/assets/navigation.js b/assets/navigation.js index 5ee0f16..0589503 100644 --- a/assets/navigation.js +++ b/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA5WVX0/CMBTFv0ufUQQFlTcSQ8LTEgn6YHzougtMtm62dyAxfHfDxqRbu7vx2nPOr839s338MoQfZBPG9SvwgPsRsB5LOW7YhK0yKTBMpO5f1NsNxhHrsW0oAzYZPxx7BuJdhdiMKFUC4XMUG1c6F4igSOI0Qwhc2VIj4gGocOdOnyUiDN8Zj1zRXCCCa0BXbA1IhBTRJtXepEyi4mLrSp8lIrwn+rtv7+5LUcoFJspAiIhrDbpvqlXIYPhkUBrirbmpPkhRXOKl+ZsvkFAiqBUXoPu2rQodjsYGdH4KJqnna1C7amkMpuWikJ5capiqdRaDRCeu4qBQ9koblFK8GXRBLMK1NKfcASosFCzvEVV800CCMl8LFfr5tdV5MGl1VxckKM//AuGufN1EAjuNm+WikEupywcQj7RcFNL+ZBukUqRHpHQRI1K1UDBj/WbywsJDWt3NmaxR7p4fB6NhfY9sxvm4LZ3Py1ymGdYBF6UTQzdD9LWUNx5loAlWYWgl/k+xhfpXujNm519AM6t0tDKJ1i+u6LyxAE2Pc1iuoFp1M7VWThpwdCCK47a0PsR+Ern+NzuuwtOJ7tc9Veb98Pj5B+/VnPH4CQAA" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA5WVQU/CQBCF/8ueUQQFlRuJIeHURIIejIftdoBKu627U5AY/ruhpbLtbqfluu+9r5Odme7HL0P4QTZhXL8CD7gfAeuxlOOGTdgqkwLDROr+Rb3dYByxHtuGMmCT8cOxZyDeVYjNiFIlED5HsXGlc4EIiiROM4TAlS01Ih6ACnfu9FkiwvCd8cgVzQUiuAZ0xdaAREgRbVLtTcokKi62rvRZIsJ7or/79u6+FFe5wEQZCBFxrUH3TbUKGQyfDEpDvDU31Qcpio94aV7zBRJKBLXiAnTftlWhw9HYgM5PwST1fA1qV70ag2m5KKQnlxqmap3FINGJqzgolL3SBqUUbwZdEItwLc0pd4AKCwUrHLUGGiRDJzEnA9VD00CCMl8LFfp59c1V1V1dkKA8/wuEu4F1EwnsNLWWi0IupS4LIIq0XBTS/vMbpFKkJ610EZNWtVAwY4tn8sLCQ1pd8ZmsUe6eHwejYX0dbcb5uC2dz8tcphnWARelE0M3Q/S1lDceZaAJVmFoJf5PsYX6V7ozZueXpJlVOlqZROsXV3TeWICm4hyWK6jWvZlaKycNODoQxXFbWh9iP4lcz9aOq/B0ovt1T5V5Pzx+/gFDusL9PwoAAA==" \ No newline at end of file diff --git a/assets/search.js b/assets/search.js index 3d2d725..828101a 100644 --- a/assets/search.js +++ b/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,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"; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,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"; \ No newline at end of file diff --git a/assets/style.css b/assets/style.css index 98a4377..178bfb0 100644 --- a/assets/style.css +++ b/assets/style.css @@ -4,12 +4,19 @@ --light-color-background-secondary: #eff0f1; --light-color-warning-text: #222; --light-color-background-warning: #e6e600; - --light-color-icon-background: var(--light-color-background); --light-color-accent: #c5c7c9; --light-color-active-menu-item: var(--light-color-accent); --light-color-text: #222; --light-color-text-aside: #6e6e6e; + + --light-color-icon-background: var(--light-color-background); + --light-color-icon-text: var(--light-color-text); + + --light-color-comment-tag-text: var(--light-color-text); + --light-color-comment-tag: var(--light-color-background); + --light-color-link: #1f70c2; + --light-color-focus-outline: #3584e4; --light-color-ts-keyword: #056bd6; --light-color-ts-project: #b111c9; @@ -21,20 +28,22 @@ --light-color-ts-function: #572be7; --light-color-ts-class: #1f70c2; --light-color-ts-interface: #108024; - --light-color-ts-constructor: var(--light-color-ts-class); - --light-color-ts-property: var(--light-color-ts-variable); - --light-color-ts-method: var(--light-color-ts-function); + --light-color-ts-constructor: #4d7fff; + --light-color-ts-property: #ff984d; + --light-color-ts-method: #ff4db8; + --light-color-ts-reference: #ff4d82; --light-color-ts-call-signature: var(--light-color-ts-method); --light-color-ts-index-signature: var(--light-color-ts-property); --light-color-ts-constructor-signature: var(--light-color-ts-constructor); --light-color-ts-parameter: var(--light-color-ts-variable); /* type literal not included as links will never be generated to it */ --light-color-ts-type-parameter: #a55c0e; - --light-color-ts-accessor: var(--light-color-ts-property); + --light-color-ts-accessor: #ff4d4d; --light-color-ts-get-signature: var(--light-color-ts-accessor); --light-color-ts-set-signature: var(--light-color-ts-accessor); --light-color-ts-type-alias: #d51270; /* reference not included as links will be colored with the kind that it points to */ + --light-color-document: #000000; --light-external-icon: url("data:image/svg+xml;utf8,"); --light-color-scheme: light; @@ -44,12 +53,19 @@ --dark-color-background-secondary: #1e2024; --dark-color-background-warning: #bebe00; --dark-color-warning-text: #222; - --dark-color-icon-background: var(--dark-color-background-secondary); --dark-color-accent: #9096a2; --dark-color-active-menu-item: #5d5d6a; --dark-color-text: #f5f5f5; --dark-color-text-aside: #dddddd; + + --dark-color-icon-background: var(--dark-color-background-secondary); + --dark-color-icon-text: var(--dark-color-text); + + --dark-color-comment-tag-text: var(--dark-color-text); + --dark-color-comment-tag: var(--dark-color-background); + --dark-color-link: #00aff4; + --dark-color-focus-outline: #4c97f2; --dark-color-ts-keyword: #3399ff; --dark-color-ts-project: #e358ff; @@ -61,20 +77,22 @@ --dark-color-ts-function: #a280ff; --dark-color-ts-class: #8ac4ff; --dark-color-ts-interface: #6cff87; - --dark-color-ts-constructor: var(--dark-color-ts-class); - --dark-color-ts-property: var(--dark-color-ts-variable); - --dark-color-ts-method: var(--dark-color-ts-function); + --dark-color-ts-constructor: #4d7fff; + --dark-color-ts-property: #ff984d; + --dark-color-ts-method: #ff4db8; + --dark-color-ts-reference: #ff4d82; --dark-color-ts-call-signature: var(--dark-color-ts-method); --dark-color-ts-index-signature: var(--dark-color-ts-property); --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor); --dark-color-ts-parameter: var(--dark-color-ts-variable); /* type literal not included as links will never be generated to it */ --dark-color-ts-type-parameter: #e07d13; - --dark-color-ts-accessor: var(--dark-color-ts-property); + --dark-color-ts-accessor: #ff4d4d; --dark-color-ts-get-signature: var(--dark-color-ts-accessor); --dark-color-ts-set-signature: var(--dark-color-ts-accessor); --dark-color-ts-type-alias: #ff6492; /* reference not included as links will be colored with the kind that it points to */ + --dark-color-document: #ffffff; --dark-external-icon: url("data:image/svg+xml;utf8,"); --dark-color-scheme: dark; @@ -86,14 +104,22 @@ --color-background-secondary: var(--light-color-background-secondary); --color-background-warning: var(--light-color-background-warning); --color-warning-text: var(--light-color-warning-text); - --color-icon-background: var(--light-color-icon-background); --color-accent: var(--light-color-accent); --color-active-menu-item: var(--light-color-active-menu-item); --color-text: var(--light-color-text); --color-text-aside: var(--light-color-text-aside); + + --color-icon-background: var(--light-color-icon-background); + --color-icon-text: var(--light-color-icon-text); + + --color-comment-tag-text: var(--light-color-text); + --color-comment-tag: var(--light-color-background); + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-project: var(--light-color-ts-project); --color-ts-module: var(--light-color-ts-module); --color-ts-namespace: var(--light-color-ts-namespace); --color-ts-enum: var(--light-color-ts-enum); @@ -105,6 +131,7 @@ --color-ts-constructor: var(--light-color-ts-constructor); --color-ts-property: var(--light-color-ts-property); --color-ts-method: var(--light-color-ts-method); + --color-ts-reference: var(--light-color-ts-reference); --color-ts-call-signature: var(--light-color-ts-call-signature); --color-ts-index-signature: var(--light-color-ts-index-signature); --color-ts-constructor-signature: var( @@ -116,6 +143,7 @@ --color-ts-get-signature: var(--light-color-ts-get-signature); --color-ts-set-signature: var(--light-color-ts-set-signature); --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); --external-icon: var(--light-external-icon); --color-scheme: var(--light-color-scheme); @@ -128,14 +156,22 @@ --color-background-secondary: var(--dark-color-background-secondary); --color-background-warning: var(--dark-color-background-warning); --color-warning-text: var(--dark-color-warning-text); - --color-icon-background: var(--dark-color-icon-background); --color-accent: var(--dark-color-accent); --color-active-menu-item: var(--dark-color-active-menu-item); --color-text: var(--dark-color-text); --color-text-aside: var(--dark-color-text-aside); + + --color-icon-background: var(--dark-color-icon-background); + --color-icon-text: var(--dark-color-icon-text); + + --color-comment-tag-text: var(--dark-color-text); + --color-comment-tag: var(--dark-color-background); + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-project: var(--dark-color-ts-project); --color-ts-module: var(--dark-color-ts-module); --color-ts-namespace: var(--dark-color-ts-namespace); --color-ts-enum: var(--dark-color-ts-enum); @@ -147,6 +183,7 @@ --color-ts-constructor: var(--dark-color-ts-constructor); --color-ts-property: var(--dark-color-ts-property); --color-ts-method: var(--dark-color-ts-method); + --color-ts-reference: var(--dark-color-ts-reference); --color-ts-call-signature: var(--dark-color-ts-call-signature); --color-ts-index-signature: var(--dark-color-ts-index-signature); --color-ts-constructor-signature: var( @@ -158,6 +195,7 @@ --color-ts-get-signature: var(--dark-color-ts-get-signature); --color-ts-set-signature: var(--dark-color-ts-set-signature); --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); --external-icon: var(--dark-external-icon); --color-scheme: var(--dark-color-scheme); @@ -182,9 +220,16 @@ body { --color-active-menu-item: var(--light-color-active-menu-item); --color-text: var(--light-color-text); --color-text-aside: var(--light-color-text-aside); + --color-icon-text: var(--light-color-icon-text); + + --color-comment-tag-text: var(--light-color-text); + --color-comment-tag: var(--light-color-background); + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-project: var(--light-color-ts-project); --color-ts-module: var(--light-color-ts-module); --color-ts-namespace: var(--light-color-ts-namespace); --color-ts-enum: var(--light-color-ts-enum); @@ -196,6 +241,7 @@ body { --color-ts-constructor: var(--light-color-ts-constructor); --color-ts-property: var(--light-color-ts-property); --color-ts-method: var(--light-color-ts-method); + --color-ts-reference: var(--light-color-ts-reference); --color-ts-call-signature: var(--light-color-ts-call-signature); --color-ts-index-signature: var(--light-color-ts-index-signature); --color-ts-constructor-signature: var( @@ -207,6 +253,7 @@ body { --color-ts-get-signature: var(--light-color-ts-get-signature); --color-ts-set-signature: var(--light-color-ts-set-signature); --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); --external-icon: var(--light-external-icon); --color-scheme: var(--light-color-scheme); @@ -222,9 +269,16 @@ body { --color-active-menu-item: var(--dark-color-active-menu-item); --color-text: var(--dark-color-text); --color-text-aside: var(--dark-color-text-aside); + --color-icon-text: var(--dark-color-icon-text); + + --color-comment-tag-text: var(--dark-color-text); + --color-comment-tag: var(--dark-color-background); + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-project: var(--dark-color-ts-project); --color-ts-module: var(--dark-color-ts-module); --color-ts-namespace: var(--dark-color-ts-namespace); --color-ts-enum: var(--dark-color-ts-enum); @@ -236,6 +290,7 @@ body { --color-ts-constructor: var(--dark-color-ts-constructor); --color-ts-property: var(--dark-color-ts-property); --color-ts-method: var(--dark-color-ts-method); + --color-ts-reference: var(--dark-color-ts-reference); --color-ts-call-signature: var(--dark-color-ts-call-signature); --color-ts-index-signature: var(--dark-color-ts-index-signature); --color-ts-constructor-signature: var( @@ -247,11 +302,17 @@ body { --color-ts-get-signature: var(--dark-color-ts-get-signature); --color-ts-set-signature: var(--dark-color-ts-set-signature); --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); --external-icon: var(--dark-external-icon); --color-scheme: var(--dark-color-scheme); } +*:focus-visible, +.tsd-accordion-summary:focus-visible svg { + outline: 2px solid var(--color-focus-outline); +} + .always-visible, .always-visible .tsd-signatures { display: inherit !important; @@ -266,16 +327,6 @@ h6 { line-height: 1.2; } -h1 > a:not(.link), -h2 > a:not(.link), -h3 > a:not(.link), -h4 > a:not(.link), -h5 > a:not(.link), -h6 > a:not(.link) { - text-decoration: none; - color: var(--color-text); -} - h1 { font-size: 1.875rem; margin: 0.67rem 0; @@ -306,10 +357,6 @@ h6 { margin: 2.33rem 0; } -.uppercase { - text-transform: uppercase; -} - dl, menu, ol, @@ -327,17 +374,14 @@ dd { } /* Footer */ -.tsd-generator { +footer { border-top: 1px solid var(--color-accent); padding-top: 1rem; padding-bottom: 1rem; max-height: 3.5rem; } - -.tsd-generator > p { - margin-top: 0; - margin-bottom: 0; - padding: 0 1rem; +footer > p { + margin: 0 1em; } .container-main { @@ -405,7 +449,8 @@ dd { } body { background: var(--color-background); - font-family: "Segoe UI", sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", + Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; color: var(--color-text); } @@ -423,6 +468,9 @@ a.external[target="_blank"] { background-repeat: no-repeat; padding-right: 13px; } +a.tsd-anchor-link { + color: var(--color-text); +} code, pre { @@ -435,7 +483,6 @@ pre { pre { position: relative; - white-space: pre; white-space: pre-wrap; word-wrap: break-word; padding: 10px; @@ -582,13 +629,13 @@ dl.tsd-comment-tag-group p { } .tsd-filter-input { display: flex; - width: fit-content; width: -moz-fit-content; + width: fit-content; align-items: center; - user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; + user-select: none; cursor: pointer; } .tsd-filter-input input[type="checkbox"] { @@ -611,11 +658,8 @@ dl.tsd-comment-tag-group p { Don't remove unless you know what you're doing. */ opacity: 0.99; } -.tsd-filter-input input[type="checkbox"]:focus + svg { - transform: scale(0.95); -} -.tsd-filter-input input[type="checkbox"]:focus:not(:focus-visible) + svg { - transform: scale(1); +.tsd-filter-input input[type="checkbox"]:focus-visible + svg { + outline: 2px solid var(--color-focus-outline); } .tsd-checkbox-background { fill: var(--color-accent); @@ -632,13 +676,18 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { stroke: var(--color-accent); } -.tsd-theme-toggle { - padding-top: 0.75rem; +.settings-label { + font-weight: bold; + text-transform: uppercase; + display: inline-block; } -.tsd-theme-toggle > h4 { - display: inline; - vertical-align: middle; - margin-right: 0.75rem; + +.tsd-filter-visibility .settings-label { + margin: 0.75rem 0 0.5rem 0; +} + +.tsd-theme-toggle .settings-label { + margin: 0.75rem 0.75rem 0 0; } .tsd-hierarchy { @@ -771,6 +820,9 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { padding: 0; max-width: 100%; } +.tsd-navigation .tsd-nav-link { + display: none; +} .tsd-nested-navigation { margin-left: 3rem; } @@ -784,6 +836,15 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { margin-left: -1.5rem; } +.tsd-page-navigation-section { + margin-left: 10px; +} +.tsd-page-navigation-section > summary { + padding: 0.25rem; +} +.tsd-page-navigation-section > div { + margin-left: 20px; +} .tsd-page-navigation ul { padding-left: 1.75rem; } @@ -814,10 +875,10 @@ a.tsd-index-link { } .tsd-accordion-summary, .tsd-accordion-summary a { - user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; + user-select: none; cursor: pointer; } @@ -830,8 +891,9 @@ a.tsd-index-link { padding-top: 0; padding-bottom: 0; } -.tsd-index-accordion .tsd-accordion-summary > svg { +.tsd-accordion .tsd-accordion-summary > svg { margin-left: 0.25rem; + vertical-align: text-top; } .tsd-index-content > :not(:first-child) { margin-top: 0.75rem; @@ -841,6 +903,12 @@ a.tsd-index-link { margin-bottom: 0.75rem; } +.tsd-no-select { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} .tsd-kind-icon { margin-right: 0.5rem; width: 1.25rem; @@ -848,10 +916,6 @@ a.tsd-index-link { min-width: 1.25rem; min-height: 1.25rem; } -.tsd-kind-icon path { - transform-origin: center; - transform: scale(1.1); -} .tsd-signature > .tsd-kind-icon { margin-right: 0.8rem; } @@ -879,7 +943,7 @@ a.tsd-index-link { } .tsd-panel-group { - margin: 4rem 0; + margin: 2rem 0; } .tsd-panel-group.tsd-index-group { margin: 2rem 0; @@ -887,6 +951,9 @@ a.tsd-index-link { .tsd-panel-group.tsd-index-group details { margin: 2rem 0; } +.tsd-panel-group > .tsd-accordion-summary { + margin-bottom: 1rem; +} #tsd-search { transition: background-color 0.2s; @@ -1036,6 +1103,12 @@ a.tsd-index-link { border-width: 1px 0; transition: background-color 0.1s; } +.tsd-signatures .tsd-index-signature:not(:last-child) { + margin-bottom: 1em; +} +.tsd-signatures .tsd-index-signature .tsd-signature { + border-width: 1px; +} .tsd-description .tsd-signatures .tsd-signature { border-width: 1px; } @@ -1214,6 +1287,9 @@ img { .tsd-kind-method { color: var(--color-ts-method); } +.tsd-kind-reference { + color: var(--color-ts-reference); +} .tsd-kind-call-signature { color: var(--color-ts-call-signature); } @@ -1226,9 +1302,6 @@ img { .tsd-kind-parameter { color: var(--color-ts-parameter); } -.tsd-kind-type-literal { - color: var(--color-ts-type-literal); -} .tsd-kind-type-parameter { color: var(--color-ts-type-parameter); } @@ -1349,6 +1422,12 @@ img { .has-menu .tsd-navigation { max-height: 100%; } + #tsd-toolbar-links { + display: none; + } + .tsd-navigation .tsd-nav-link { + display: flex; + } } /* one sidebar */ @@ -1401,7 +1480,7 @@ img { } .site-menu { - margin-top: 1rem 0; + margin-top: 1rem; } .page-menu, diff --git a/classes/DerivedStore.html b/classes/DerivedStore.html index 5335c81..490b50d 100644 --- a/classes/DerivedStore.html +++ b/classes/DerivedStore.html @@ -1,64 +1,55 @@ -DerivedStore | @amadeus-it-group/tansu

Class DerivedStore<T, S>Abstract

Base class that can be extended to easily create a custom Readable store.

-

Example

class CounterStore extends Store {
constructor() {
super(1); // initial value
}

reset() {
this.set(0);
}

increment() {
this.update(value => value + 1);
}
}

const store = new CounterStore(1);

// logs 1 (initial value) upon subscription
const unsubscribe = store.subscribe((value) => {
console.log(value);
});
store.increment(); // logs 2
store.reset(); // logs 0

unsubscribe(); // stops notifications and corresponding logging -
-

Type Parameters

Hierarchy (view full)

Constructors

Methods

  • Compares two values and returns true if they are equal. +DerivedStore | @amadeus-it-group/tansu

    Class DerivedStore<T, S>Abstract

    Base class that can be extended to easily create a custom Readable store.

    +
    class CounterStore extends Store {
    constructor() {
    super(1); // initial value
    }

    reset() {
    this.set(0);
    }

    increment() {
    this.update(value => value + 1);
    }
    }

    const store = new CounterStore(1);

    // logs 1 (initial value) upon subscription
    const unsubscribe = store.subscribe((value) => {
    console.log(value);
    });
    store.increment(); // logs 2
    store.reset(); // logs 0

    unsubscribe(); // stops notifications and corresponding logging +
    + +

    Type Parameters

    Hierarchy (view full)

    Constructors

    Methods

    • Compares two values and returns true if they are equal. It is called when setting a new value to avoid doing anything (such as notifying subscribers) if the value did not change. The default logic is to return false if a is a function or an object, or if a and b are different according to Object.is. This method can be overridden by subclasses to change the logic.

      -

      Parameters

      • a: T

        First value to compare.

        -
      • b: T

        Second value to compare.

        +

        Parameters

        • a: T

          First value to compare.

          +
        • b: T

          Second value to compare.

        Returns boolean

        true if a and b are considered equal.

        -

        Remarks

        For backward compatibility, the default implementation calls the +

        For backward compatibility, the default implementation calls the deprecated Store.notEqual method and returns the negation of its return value.

        -
    • Compares two values and returns true if they are different. +

  • Compares two values and returns true if they are different. It is called when setting a new value to avoid doing anything (such as notifying subscribers) if the value did not change. The default logic is to return true if a is a function or an object, or if a and b are different according to Object.is. This method can be overridden by subclasses to change the logic.

    -

    Parameters

    • a: T

      First value to compare.

      -
    • b: T

      Second value to compare.

      +

      Parameters

      • a: T

        First value to compare.

        +
      • b: T

        Second value to compare.

      Returns boolean

      true if a and b are considered different.

      -

      Remarks

      This method is only called by the default implementation of +

      This method is only called by the default implementation of Store.equal, so overriding Store.equal takes precedence over overriding notEqual.

      -

      Deprecated

      Use Store.equal instead

      -
  • Function called when the number of subscribers changes from 0 to 1 +

    Use Store.equal instead

    +
  • Function called when the number of subscribers changes from 0 to 1 (but not called when the number of subscribers changes from 1 to 2, ...). If a function is returned, it will be called when the number of subscribers changes from 1 to 0.

    -

    Returns void | Unsubscriber

    Example

    class CustomStore extends Store {
    onUse() {
    console.log('Got the fist subscriber!');
    return () => {
    console.log('All subscribers are gone...');
    };
    }
    }

    const store = new CustomStore();
    const unsubscribe1 = store.subscribe(() => {}); // logs 'Got the fist subscriber!'
    const unsubscribe2 = store.subscribe(() => {}); // nothing is logged as we've got one subscriber already
    unsubscribe1(); // nothing is logged as we still have one subscriber
    unsubscribe2(); // logs 'All subscribers are gone...' -
    -
  • Puts the store in the paused state, which means it will soon update its value.

    -

    Returns void

    Remarks

    The paused state prevents derived or computed stores (both direct and transitive) from recomputing their value -using the current value of this store.

    -

    There are two ways to put a store back into its normal state: calling set to set a new -value or calling resumeSubscribers to declare that finally the value does not need to be -changed.

    -

    Note that a store should not stay in the paused state for a long time, and most of the time -it is not needed to call pauseSubscribers or resumeSubscribers manually.

    -
  • Puts the store back to the normal state without changing its value, if it was in the paused state -(cf pauseSubscribers).

    -

    Returns void

    Remarks

    Does nothing if the store was not in the paused state.

    -
  • Replaces store's state with the provided value. +

    Returns void | Unsubscriber

    class CustomStore extends Store {
    onUse() {
    console.log('Got the fist subscriber!');
    return () => {
    console.log('All subscribers are gone...');
    };
    }
    }

    const store = new CustomStore();
    const unsubscribe1 = store.subscribe(() => {}); // logs 'Got the fist subscriber!'
    const unsubscribe2 = store.subscribe(() => {}); // nothing is logged as we've got one subscriber already
    unsubscribe1(); // nothing is logged as we still have one subscriber
    unsubscribe2(); // logs 'All subscribers are gone...' +
    + +
  • Replaces store's state with the provided value. Equivalent of Writable.set, but internal to the store.

    -

    Parameters

    • value: T

      value to be used as the new state of a store.

      -

    Returns void

  • Updates store's state by using an Updater function. +

    Parameters

    • value: T

      value to be used as the new state of a store.

      +

    Returns void

  • Updates store's state by using an Updater function. Equivalent of Writable.update, but internal to the store.

    -

    Parameters

    • updater: Updater<T, T>

      a function that takes the current state as an argument and returns the new state.

      -

    Returns void

Generated using TypeDoc

\ No newline at end of file +

Parameters

  • updater: Updater<T>

    a function that takes the current state as an argument and returns the new state.

    +

Returns void

diff --git a/classes/Store.html b/classes/Store.html index 2ca3ebb..d37b933 100644 --- a/classes/Store.html +++ b/classes/Store.html @@ -1,64 +1,55 @@ -Store | @amadeus-it-group/tansu

Class Store<T>Abstract

Base class that can be extended to easily create a custom Readable store.

-

Example

class CounterStore extends Store {
constructor() {
super(1); // initial value
}

reset() {
this.set(0);
}

increment() {
this.update(value => value + 1);
}
}

const store = new CounterStore(1);

// logs 1 (initial value) upon subscription
const unsubscribe = store.subscribe((value) => {
console.log(value);
});
store.increment(); // logs 2
store.reset(); // logs 0

unsubscribe(); // stops notifications and corresponding logging -
-

Type Parameters

  • T

Hierarchy (view full)

Implements

Constructors

  • Type Parameters

    • T

    Parameters

    • value: T

      Initial value of the store

      -

    Returns Store<T>

Methods

  • Compares two values and returns true if they are equal. +Store | @amadeus-it-group/tansu

    Class Store<T>Abstract

    Base class that can be extended to easily create a custom Readable store.

    +
    class CounterStore extends Store {
    constructor() {
    super(1); // initial value
    }

    reset() {
    this.set(0);
    }

    increment() {
    this.update(value => value + 1);
    }
    }

    const store = new CounterStore(1);

    // logs 1 (initial value) upon subscription
    const unsubscribe = store.subscribe((value) => {
    console.log(value);
    });
    store.increment(); // logs 2
    store.reset(); // logs 0

    unsubscribe(); // stops notifications and corresponding logging +
    + +

    Type Parameters

    • T

    Hierarchy (view full)

    Implements

    Constructors

    • Type Parameters

      • T

      Parameters

      • value: T

        Initial value of the store

        +

      Returns Store<T>

    Methods

    • Compares two values and returns true if they are equal. It is called when setting a new value to avoid doing anything (such as notifying subscribers) if the value did not change. The default logic is to return false if a is a function or an object, or if a and b are different according to Object.is. This method can be overridden by subclasses to change the logic.

      -

      Parameters

      • a: T

        First value to compare.

        -
      • b: T

        Second value to compare.

        +

        Parameters

        • a: T

          First value to compare.

          +
        • b: T

          Second value to compare.

        Returns boolean

        true if a and b are considered equal.

        -

        Remarks

        For backward compatibility, the default implementation calls the +

        For backward compatibility, the default implementation calls the deprecated Store.notEqual method and returns the negation of its return value.

        -
    • Compares two values and returns true if they are different. +

  • Compares two values and returns true if they are different. It is called when setting a new value to avoid doing anything (such as notifying subscribers) if the value did not change. The default logic is to return true if a is a function or an object, or if a and b are different according to Object.is. This method can be overridden by subclasses to change the logic.

    -

    Parameters

    • a: T

      First value to compare.

      -
    • b: T

      Second value to compare.

      +

      Parameters

      • a: T

        First value to compare.

        +
      • b: T

        Second value to compare.

      Returns boolean

      true if a and b are considered different.

      -

      Remarks

      This method is only called by the default implementation of +

      This method is only called by the default implementation of Store.equal, so overriding Store.equal takes precedence over overriding notEqual.

      -

      Deprecated

      Use Store.equal instead

      -
  • Function called when the number of subscribers changes from 0 to 1 +

    Use Store.equal instead

    +
  • Function called when the number of subscribers changes from 0 to 1 (but not called when the number of subscribers changes from 1 to 2, ...). If a function is returned, it will be called when the number of subscribers changes from 1 to 0.

    -

    Returns void | Unsubscriber

    Example

    class CustomStore extends Store {
    onUse() {
    console.log('Got the fist subscriber!');
    return () => {
    console.log('All subscribers are gone...');
    };
    }
    }

    const store = new CustomStore();
    const unsubscribe1 = store.subscribe(() => {}); // logs 'Got the fist subscriber!'
    const unsubscribe2 = store.subscribe(() => {}); // nothing is logged as we've got one subscriber already
    unsubscribe1(); // nothing is logged as we still have one subscriber
    unsubscribe2(); // logs 'All subscribers are gone...' -
    -
  • Puts the store in the paused state, which means it will soon update its value.

    -

    Returns void

    Remarks

    The paused state prevents derived or computed stores (both direct and transitive) from recomputing their value -using the current value of this store.

    -

    There are two ways to put a store back into its normal state: calling set to set a new -value or calling resumeSubscribers to declare that finally the value does not need to be -changed.

    -

    Note that a store should not stay in the paused state for a long time, and most of the time -it is not needed to call pauseSubscribers or resumeSubscribers manually.

    -
  • Puts the store back to the normal state without changing its value, if it was in the paused state -(cf pauseSubscribers).

    -

    Returns void

    Remarks

    Does nothing if the store was not in the paused state.

    -
  • Replaces store's state with the provided value. +

    Returns void | Unsubscriber

    class CustomStore extends Store {
    onUse() {
    console.log('Got the fist subscriber!');
    return () => {
    console.log('All subscribers are gone...');
    };
    }
    }

    const store = new CustomStore();
    const unsubscribe1 = store.subscribe(() => {}); // logs 'Got the fist subscriber!'
    const unsubscribe2 = store.subscribe(() => {}); // nothing is logged as we've got one subscriber already
    unsubscribe1(); // nothing is logged as we still have one subscriber
    unsubscribe2(); // logs 'All subscribers are gone...' +
    + +
  • Replaces store's state with the provided value. Equivalent of Writable.set, but internal to the store.

    -

    Parameters

    • value: T

      value to be used as the new state of a store.

      -

    Returns void

  • Updates store's state by using an Updater function. +

    Parameters

    • value: T

      value to be used as the new state of a store.

      +

    Returns void

  • Updates store's state by using an Updater function. Equivalent of Writable.update, but internal to the store.

    -

    Parameters

    • updater: Updater<T, T>

      a function that takes the current state as an argument and returns the new state.

      -

    Returns void

Generated using TypeDoc

\ No newline at end of file +

Parameters

  • updater: Updater<T>

    a function that takes the current state as an argument and returns the new state.

    +

Returns void

diff --git a/functions/asReadable.html b/functions/asReadable.html index 6f86acc..967ce28 100644 --- a/functions/asReadable.html +++ b/functions/asReadable.html @@ -1,10 +1,10 @@ -asReadable | @amadeus-it-group/tansu
diff --git a/functions/asWritable.html b/functions/asWritable.html index f2bcd1e..8750c5c 100644 --- a/functions/asWritable.html +++ b/functions/asWritable.html @@ -1,20 +1,20 @@ -asWritable | @amadeus-it-group/tansu
diff --git a/functions/batch.html b/functions/batch.html index b3e682c..c82601c 100644 --- a/functions/batch.html +++ b/functions/batch.html @@ -1,9 +1,7 @@ -batch | @amadeus-it-group/tansu
  • Batches multiple changes to stores while calling the provided function, +batch | @amadeus-it-group/tansu

    Batches multiple changes to stores while calling the provided function, preventing derived stores from updating until the function returns, to avoid unnecessary recomputations.

    -

    Type Parameters

    • T

    Parameters

    • fn: (() => T)

      a function that can update stores. Its returned value is -returned by the batch function.

      -
        • (): T
        • Returns T

    Returns T

    Remarks

    If a store is updated multiple times in the provided function, existing +

    If a store is updated multiple times in the provided function, existing subscribers of that store will only be called once when the provided function returns.

    Note that even though the computation of derived stores is delayed in most @@ -16,7 +14,10 @@ intermediate computations, even inside batch.

    It is possible to have nested calls of batch, in which case only the first (outer) call has an effect, inner calls only call the provided function.

    -

    Example

    Using batch in the following example prevents logging the intermediate "Sherlock Lupin" value.

    -
    const firstName = writable('Arsène');
    const lastName = writable('Lupin');
    const fullName = derived([firstName, lastName], ([a, b]) => `${a} ${b}`);
    fullName.subscribe((name) => console.log(name)); // logs any change to fullName
    batch(() => {
    firstName.set('Sherlock');
    lastName.set('Holmes');
    }); -
    -

Generated using TypeDoc

\ No newline at end of file +

Using batch in the following example prevents logging the intermediate "Sherlock Lupin" value.

+
const firstName = writable('Arsène');
const lastName = writable('Lupin');
const fullName = derived([firstName, lastName], ([a, b]) => `${a} ${b}`);
fullName.subscribe((name) => console.log(name)); // logs any change to fullName
batch(() => {
firstName.set('Sherlock');
lastName.set('Holmes');
}); +
+ +
  • Type Parameters

    • T

    Parameters

    • fn: (() => T)

      a function that can update stores. Its returned value is +returned by the batch function.

      +
        • (): T
        • Returns T

    Returns T

diff --git a/functions/computed.html b/functions/computed.html index ff8dc57..555bc6f 100644 --- a/functions/computed.html +++ b/functions/computed.html @@ -1,8 +1,8 @@ -computed | @amadeus-it-group/tansu
  • Creates a store whose value is computed by the provided function.

    -

    Type Parameters

    • T

    Parameters

    • fn: (() => T)

      computation function that returns the value of the store

      -
        • (): T
        • Returns T

    • options: Omit<StoreOptions<T>, "onUse"> = {}

      store option. Allows to define the equal function, if needed

      +computed | @amadeus-it-group/tansu
      • Creates a store whose value is computed by the provided function.

        +

        Type Parameters

        • T

        Parameters

        • fn: (() => T)

          computation function that returns the value of the store

          +
            • (): T
            • Returns T

        • Optionaloptions: Omit<StoreOptions<T>, "onUse">

          store option. Allows to define the equal function, if needed

        Returns ReadableSignal<T>

        store containing the value returned by the computation function

        -

        Remarks

        The computation function is first called the first time the store is used.

        +

        The computation function is first called the first time the store is used.

        It can use the value of other stores or observables and the computation function is called again if the value of those dependencies changed, as long as the store is still used.

        Dependencies are detected automatically as the computation function gets their value either by calling the stores @@ -11,4 +11,4 @@ to wrap them in a call to untrack.

        Note that dependencies can change between calls of the computation function. Internally, tansu will subscribe to new dependencies when they are used and unsubscribe from dependencies that are no longer used after the call of the computation function.

        -

      Generated using TypeDoc

      \ No newline at end of file +
diff --git a/functions/derived.html b/functions/derived.html index 935a1eb..7429d44 100644 --- a/functions/derived.html +++ b/functions/derived.html @@ -1,12 +1,14 @@ -derived | @amadeus-it-group/tansu
  • A convenience function to create a new store with a state computed from the latest values of dependent stores. +derived | @amadeus-it-group/tansu

    • A convenience function to create a new store with a state computed from the latest values of dependent stores. Each time the state of one of the dependent stores changes, a provided derive function is called to compute a new, derived state.

      -

      Type Parameters

      Parameters

      • stores: S

        a single store or an array of dependent stores

        -
      • options: AsyncDeriveFn<T, S> | AsyncDeriveOptions<T, S>

        either an object with store options, including a derive function, or the derive function itself directly. +

        Type Parameters

        Parameters

        • stores: S

          a single store or an array of dependent stores

          +
        • options: AsyncDeriveFn<T, S> | AsyncDeriveOptions<T, S>

          either an object with store options, including a derive function, or the derive function itself directly. The derive function is used to compute a new state based on the latest values of dependent stores.

          Alternatively, this function can accept a second argument, set, to manage asynchronous values. If you return a function from the callback, it will be called when the callback runs again, or the last subscriber unsubscribes.

          -
        • initialValue: T

        Returns ReadableSignal<T>

        Example: synchronous

        const x$ = writable(2);
        const y$ = writable(3);
        const sum$ = derived([x$, $y], ([x, y]) => x + y);

        // will log 5 upon subscription
        sum$.subscribe((value) => {
        console.log(value)
        });

        x$.set(3); // will re-evaluate the `([x, y]) => x + y` function and log 6 as this is the new state of the derived store
        -
        -

        Example: asynchronous

        const x$ = writable(2);
        const y$ = writable(3);

        const sum$ = derived([x$, $y], ([x, y], set) => {
        const timeoutId = setTimeout(() => set(x + y)));
        return () => clearTimeout(timeoutId);
        }, <number>undefined);

        // will log undefined (the default value), then 5 asynchronously
        sum$.subscribe((value) => {
        console.log(value)
        });
        -
        -
      • Type Parameters

        Parameters

        Returns ReadableSignal<T>

    Generated using TypeDoc

    \ No newline at end of file +
  • initialValue: T

Returns ReadableSignal<T>

const x$ = writable(2);
const y$ = writable(3);
const sum$ = derived([x$, y$], ([x, y]) => x + y);

// will log 5 upon subscription
sum$.subscribe((value) => {
console.log(value)
});

x$.set(3); // will re-evaluate the `([x, y]) => x + y` function and log 6 as this is the new state of the derived store
+
+ +
const x$ = writable(2);
const y$ = writable(3);

const sum$ = derived([x$, $y], ([x, y], set) => {
const timeoutId = setTimeout(() => set(x + y)));
return () => clearTimeout(timeoutId);
}, <number>undefined);

// will log undefined (the default value), then 5 asynchronously
sum$.subscribe((value) => {
console.log(value)
});
+
+ +
  • Type Parameters

    Parameters

    Returns ReadableSignal<T>

  • diff --git a/functions/equal.html b/functions/equal.html index eae31b1..bc2f4b2 100644 --- a/functions/equal.html +++ b/functions/equal.html @@ -1,8 +1,8 @@ -equal | @amadeus-it-group/tansu
    diff --git a/functions/get.html b/functions/get.html index 4f378a2..b14fd56 100644 --- a/functions/get.html +++ b/functions/get.html @@ -1,6 +1,7 @@ -get | @amadeus-it-group/tansu
    • A utility function to get the current value from a given store. +get | @amadeus-it-group/tansu

      A utility function to get the current value from a given store. It works by subscribing to a store, capturing the value (synchronously) and unsubscribing just after.

      -

      Type Parameters

      • T

      Parameters

      • store: StoreInput<T>

        a store from which the current value is retrieved.

        -

      Returns T

      Example

      const myStore = writable(1);
      console.log(get(myStore)); // logs 1 -
      -

    Generated using TypeDoc

    \ No newline at end of file +
    const myStore = writable(1);
    console.log(get(myStore)); // logs 1 +
    + +
    • Type Parameters

      • T

      Parameters

      • store: StoreInput<T>

        a store from which the current value is retrieved.

        +

      Returns T

    diff --git a/functions/readable.html b/functions/readable.html index 313b998..3f35ff3 100644 --- a/functions/readable.html +++ b/functions/readable.html @@ -1,9 +1,10 @@ -readable | @amadeus-it-group/tansu
    diff --git a/functions/untrack.html b/functions/untrack.html index ee27d1f..e779fdc 100644 --- a/functions/untrack.html +++ b/functions/untrack.html @@ -1,5 +1,5 @@ -untrack | @amadeus-it-group/tansu
    diff --git a/functions/writable.html b/functions/writable.html index 7fa5383..e0b7f62 100644 --- a/functions/writable.html +++ b/functions/writable.html @@ -1,9 +1,10 @@ -writable | @amadeus-it-group/tansu
    diff --git a/hierarchy.html b/hierarchy.html index e03cae0..4a4fdf5 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -1 +1 @@ -@amadeus-it-group/tansu

    Generated using TypeDoc

    \ No newline at end of file +@amadeus-it-group/tansu
    diff --git a/index.html b/index.html index db78e2b..d64a929 100644 --- a/index.html +++ b/index.html @@ -1,8 +1,8 @@ -@amadeus-it-group/tansu

    @amadeus-it-group/tansu

    Tansu

    npm +@amadeus-it-group/tansu

    @amadeus-it-group/tansu

    Tansu

    npm build -codecov

    +codecov

    Tansu is a lightweight, push-based framework-agnostic state management library. -It borrows the ideas and APIs originally designed and implemented by Svelte stores +It borrows the ideas and APIs originally designed and implemented by Svelte stores and extends them with computed and batch.

    Main characteristics:

      @@ -12,76 +12,89 @@
    • results in compact code with the absolute minimum of boilerplate.

    Implementation wise, it is a tiny (1300 LOC) library without any external dependencies.

    -

    Installation

    You can add Tansu to your project by installing the @amadeus-it-group/tansu package using your favorite package manager, ex.:

    +

    You can add Tansu to your project by installing the @amadeus-it-group/tansu package using your favorite package manager, ex.:

    • yarn add @amadeus-it-group/tansu
    • npm install @amadeus-it-group/tansu
    -

    Usage

    Check out the Tansu API documentation.

    +

    Check out the Tansu API documentation.

    The functional part of the API to manage your reactive state can be categorized into three distinct groups:

    • Base store: writable
    • Computed stores: derived, computed, readable
    • Utilities: batch, asReadable, asWritable
    -

    writable

    api documentation

    +

    api documentation

    Writable: A Fundamental Building Block

    A writable serves as the foundational element of a "store" – a container designed to encapsulate a value, enabling observation and modification of its state. You can change the internal value using the set or update methods.

    To receive notifications whenever the value undergoes a change, the subscribe() method, paired with a callback function, can be employed.

    -

    Basic usage

    import {writable} from "@amadeus-it-group/tansu";
    const value$ = writable(0);

    const unsubscribe = values$.subscribe((value) => {
    console.log(`value = ${value}`);
    });

    value$.set(1);
    value$.update((value) => value + 1); -
    +
    import {writable} from "@amadeus-it-group/tansu";
    const value$ = writable(0);

    const unsubscribe = values$.subscribe((value) => {
    console.log(`value = ${value}`);
    });

    value$.set(1);
    value$.update((value) => value + 1); +
    +

    output:

    -
      value = 0
    +
      value = 0
       value = 1
       value = 2
    -
    -

    Setup and teardown

    The writable's second parameter allows for receiving notifications when at least one subscriber subscribes or when there are no more subscribers.

    -
    import {writable} from "@amadeus-it-group/tansu";

    const value$ = writable(0, () => {
    console.log('At least one subscriber');

    return () => {
    console.log('No more subscriber');
    }
    });

    const unsubscribe = values$.subscribe((value) => {
    console.log(`value = ${value}`);
    });

    value$.set(1);
    unsubscribe(); -
    +
    + +

    The writable's second parameter allows for receiving notifications when at least one subscriber subscribes or when there are no more subscribers.

    +
    import {writable} from "@amadeus-it-group/tansu";

    const value$ = writable(0, () => {
    console.log('At least one subscriber');

    return () => {
    console.log('No more subscriber');
    }
    });

    const unsubscribe = values$.subscribe((value) => {
    console.log(`value = ${value}`);
    });

    value$.set(1);
    unsubscribe(); +
    +

    output:

    -
      At least one subscriber
    +
      At least one subscriber
       value = 0
       value = 1
       No more subscriber
    -
    -

    derived

    api documentation

    +
    + +

    api documentation

    A derived store calculates its value based on one or more other stores provided as parameters. Since its value is derived from other stores, it is a read-only store and does not have any set or update methods.

    -

    Single store

    import {writable, derived} from "@amadeus-it-group/tansu";

    const value$ = writable(1);
    const double$ = derived(value$, (value) => value * 2);

    double$.subscribe((double) => console.log('Double value', double));
    value$.set(2); -
    +
    import {writable, derived} from "@amadeus-it-group/tansu";

    const value$ = writable(1);
    const double$ = derived(value$, (value) => value * 2);

    double$.subscribe((double) => console.log('Double value', double));
    value$.set(2); +
    +

    output:

    -
    Double value 2
    +
    Double value 2
     Double value 4
    -
    -

    Multiple stores

    import {writable, derived} from "@amadeus-it-group/tansu";

    const a$ = writable(1);
    const b$ = writable(1);
    const sum$ = derived([a$, b$], ([a, b]) => a + b);

    sum$.subscribe((sum) => console.log('Sum', sum));
    a$.set(2); -
    +
    + +
    import {writable, derived} from "@amadeus-it-group/tansu";

    const a$ = writable(1);
    const b$ = writable(1);
    const sum$ = derived([a$, b$], ([a, b]) => a + b);

    sum$.subscribe((sum) => console.log('Sum', sum));
    a$.set(2); +
    +

    output:

    -
    Sum 2
    +
    Sum 2
     Sum 3
    -
    -

    Asynchronous set

    A derived can directly manipulate its value using the set method instead of relying on the returned value of the provided function. -This flexibility allows you to manage asynchronous operations or apply filtering logic before updating the observable's value.

    -
    import {writable, derived} from "@amadeus-it-group/tansu";

    const a$ = writable(0);
    const asynchronousDouble$ = derived(a$, (a, set) => {
    const plannedLater = setTimeout(() => set(a * 2));
    return () => {
    // This clean-up function is called if there is no listener anymore,
    // or if the value of a$ changed
    // In this case, the function passed to setTimeout should not be called
    // (if it was not called already)
    clearTimeout(plannedLater);
    };
    }, -1);

    const evenOnly$ = derived(a$, (a, set) => {
    if (a % 2 === 0) {
    set(a);
    }
    }, <number | undefined>undefined);

    asynchronousDouble$.subscribe((double) => console.log('Double (asynchronous)', double));
    evenOnly$.subscribe((value) => console.log('Even', value));

    a$.set(1);
    a$.set(2); -
    +
    + +

    A derived can directly manipulate its value using the set method instead of relying on the returned value of the provided function. +This flexibility allows you to manage asynchronous operations or apply filtering logic before updating the observable's value.

    +
    import {writable, derived} from "@amadeus-it-group/tansu";

    const a$ = writable(0);
    const asynchronousDouble$ = derived(a$, (a, set) => {
    const plannedLater = setTimeout(() => set(a * 2));
    return () => {
    // This clean-up function is called if there is no listener anymore,
    // or if the value of a$ changed
    // In this case, the function passed to setTimeout should not be called
    // (if it was not called already)
    clearTimeout(plannedLater);
    };
    }, -1);

    const evenOnly$ = derived(a$, (a, set) => {
    if (a % 2 === 0) {
    set(a);
    }
    }, <number | undefined>undefined);

    asynchronousDouble$.subscribe((double) => console.log('Double (asynchronous)', double));
    evenOnly$.subscribe((value) => console.log('Even', value));

    a$.set(1);
    a$.set(2); +
    +

    output:

    -
    Double (asynchronous) -1
    +
    Double (asynchronous) -1
     Even 0
     Even 2
     Double (asynchronous) 4
    -
    -

    computed

    api documentation

    +
    + +

    api documentation

    A computed store is another variant of a derived store, with the following characteristics:

      -
    • Implicit Dependencies: Unlike in a derived store, there is no requirement to explicitly declare dependencies.

      +
    • +

      Implicit Dependencies: Unlike in a derived store, there is no requirement to explicitly declare dependencies.

    • -
    • Dynamic Dependency Listening: Dependencies are determined based on their usage. This implies that a dependency not actively used is not automatically "listened" to, optimizing resource utilization.

      +
    • +

      Dynamic Dependency Listening: Dependencies are determined based on their usage. This implies that a dependency not actively used is not automatically "listened" to, optimizing resource utilization.

    -

    Switch map

    This capability to subscribe/unsubscribe to the dependency allows to create switch maps in a natural way.

    -
    import {writable, computed} from "@amadeus-it-group/tansu";

    const switchToA$ = writable(true);
    const a$ = writable(1);
    const b$ = writable(0);

    const computedValue$ = computed(() => {
    if (switchToA$()) {
    console.log('Return a$');
    return a$();
    } else {
    console.log('Return b$');
    return b$();
    }
    });

    computedValue$.subscribe((value) => console.log('Computed value:', value));
    a$.set(2);
    switchToA$.set(false);
    a$.set(3);
    a$.set(4);
    switchToA$.set(true);
    -
    +

    This capability to subscribe/unsubscribe to the dependency allows to create switch maps in a natural way.

    +
    import {writable, computed} from "@amadeus-it-group/tansu";

    const switchToA$ = writable(true);
    const a$ = writable(1);
    const b$ = writable(0);

    const computedValue$ = computed(() => {
    if (switchToA$()) {
    console.log('Return a$');
    return a$();
    } else {
    console.log('Return b$');
    return b$();
    }
    });

    computedValue$.subscribe((value) => console.log('Computed value:', value));
    a$.set(2);
    switchToA$.set(false);
    a$.set(3);
    a$.set(4);
    switchToA$.set(true);
    +
    +

    output:

    -
    Return a$
    +
    Return a$
     Computed value: 1
     Return a$
     Computed value: 2
    @@ -89,51 +102,59 @@
     Computed value: 0
     Return a$
     Computed value: 4
    -
    +
    +

    When switchToA$.set(false) is called, the subscription to a$ is canceled, which means that subsequent changes to a$ will no longer trigger the calculation., which is only performed again when switchToA$ is set back to true.

    -

    readable

    api documentation

    +

    api documentation

    Similar to Svelte stores, this function generates a store where the value cannot be externally modified.

    -
    import {readable} from '@amadeus-it-group/tansu';

    const time = readable(new Date(), (set) => {
    const interval = setInterval(() => {
    set(new Date());
    }, 1000);

    return () => clearInterval(interval);
    }); -
    -

    derived vs computed

    While derived and computed may appear similar, they exhibit distinct characteristics that can significantly impact effectiveness based on use-cases:

    +
    import {readable} from '@amadeus-it-group/tansu';

    const time = readable(new Date(), (set) => {
    const interval = setInterval(() => {
    set(new Date());
    }, 1000);

    return () => clearInterval(interval);
    }); +
    + +

    While derived and computed may appear similar, they exhibit distinct characteristics that can significantly impact effectiveness based on use-cases:

      -
    • Declaration of Dependencies:

      +
    • +

      Declaration of Dependencies:

      • computed: No explicit declaration of dependencies is required, providing more flexibility in code composition.
      • derived: Requires explicit declaration of dependencies.
    • -
    • Performance:

      +
    • +

      Performance:

      • computed: Better performance by re-running the function only based on changes in the stores involved in the last run.
      • derived: Re-run the function each time a dependent store changes.
    • -
    • Asynchronous State:

      +
    • +

      Asynchronous State:

      • computed: Unable to manage asynchronous state.
      • derived: Can handle asynchronous state with the set method.
    • -
    • Skipping Value Emission:

      +
    • +

      Skipping Value Emission:

      • computed: Does not provide a mechanism to skip emitting values.
      • derived: Allows skipping the emission of values by choosing not to call the provided set method.
    • -
    • Setup and Teardown:

      +
    • +

      Setup and Teardown:

      • computed: Lacks explicit setup and teardown methods.
      • derived: Supports setup and teardown methods, allowing actions such as adding or removing DOM listeners.
      • -
      • When the last listener unsubscribes and then subscribes again, the derived function is rerun due to its setup-teardown functionality. In contrast, a computed provides the last value without recomputing if dependencies haven't changed in the meantime.
      • +
      • When the last listener unsubscribes and then subscribes again, the derived function is rerun due to its setup-teardown functionality. In contrast, a computed provides the last value without recomputing if dependencies haven't changed in the meantime.

    While computed feels more intuitive in many use-cases, derived excels in scenarios where computed falls short, particularly in managing asynchronous state and providing more granular control over value emissions.

    Carefully choosing between them based on specific requirements enhances the effectiveness of state management in your application.

    -

    Getting the value

    There are three ways for getting the value of a store:

    -
    import {writable, get} from "@amadeus-it-group/tansu";

    const count$ = writable(1);
    const unsubscribe = count$.subscribe((count) => {
    // Will be called with the updated value synchronously first, then each time count$ changes.
    // `unsubscribe` must be called to prevent future calls.
    console.log(count);
    });

    // A store is also a function that you can call to get the instant value.
    console.log(count$());

    // Equivalent to
    console.log(get(count$)); -
    +

    There are three ways for getting the value of a store:

    +
    import {writable, get} from "@amadeus-it-group/tansu";

    const count$ = writable(1);
    const unsubscribe = count$.subscribe((count) => {
    // Will be called with the updated value synchronously first, then each time count$ changes.
    // `unsubscribe` must be called to prevent future calls.
    console.log(count);
    });

    // A store is also a function that you can call to get the instant value.
    console.log(count$());

    // Equivalent to
    console.log(get(count$)); +
    +

    [!NOTE] Getting the instant value implies the subscription and unsubription on the store:

    @@ -143,68 +164,77 @@

    When called inside a reactive context (i.e. inside a computed), getting the value serves to know and "listen" the dependent stores.

    -

    batch

    api documentation

    +

    api documentation

    Contrary to other libraries like Angular with signals or Svelte with runes, where the callback of a subscription is executed asynchronously (usually referenced as an "effect"), we have maintained the constraint of synchronicity between the store changes and their subscriptions in Tansu.

    While it is acceptable for these frameworks to defer these calls since their goals are well-known in advance (to optimize their final rendering), this is not the case for Tansu, where the goal is to be adaptable to any situation.

    The problem with synchronous subscriptions is that it can create "glitches". Subscribers and computed store callbacks that are run too many times can create incorrect intermediate values.

    -

    Svelte stores resolved the diamond dependency issue, but it does not match all the use-cases.

    -

    Let's have a look at the following example:

    -
    import {writable, derived} from '@amadeus-it-group/tansu';

    const firstName = writable('Arsène');
    const lastName = writable('Lupin');
    const fullName = derived([firstName, lastName], ([a, b]) => `${a} ${b}`);
    fullName.subscribe((name) => console.log(name)); // logs any change to fullName
    firstName.set('Sherlock');
    lastName.set('Holmes');
    console.log('Process end'); -
    +

    Svelte stores resolved the diamond dependency issue, but it does not match all the use-cases.

    +

    Let's have a look at the following example:

    +
    import {writable, derived} from '@amadeus-it-group/tansu';

    const firstName = writable('Arsène');
    const lastName = writable('Lupin');
    const fullName = derived([firstName, lastName], ([a, b]) => `${a} ${b}`);
    fullName.subscribe((name) => console.log(name)); // logs any change to fullName
    firstName.set('Sherlock');
    lastName.set('Holmes');
    console.log('Process end'); +
    +

    output:

    -
    Arsène Lupin
    +
    Arsène Lupin
     Sherlock Lupin
     Sherlock Holmes
     Process end
    -
    +
    +

    The fullName store successively went through different states, including an inconsistent one, as Sherlock Lupin does not exist! Even if it can be seen as just an intermediate state, it is fundamental for a state management to only manage consistent data in order to prevent issues and optimize the code.

    In Tansu, the batch is available to defer synchronously the subscribers calls, and de facto the dependent derived or computed calculation to solve all kind of multiple dependencies issues.

    The previous example is resolved this way:

    -
    import {writable, derived, computed, batch} from '@amadeus-it-group/tansu';

    const firstName = writable('Arsène');
    const lastName = writable('Lupin');
    const fullName = derived([firstName, lastName], ([a, b]) => `${a} ${b}`);
    // note that the fullName store could alternatively be create with computed:
    // const fullName = computed(() => `${firstName()} ${lastName()}`);
    fullName.subscribe((name) => console.log(name)); // logs any change to fullName
    batch(() => {
    firstName.set('Sherlock');
    lastName.set('Holmes');
    });
    console.log('Process end'); -
    +
    import {writable, derived, computed, batch} from '@amadeus-it-group/tansu';

    const firstName = writable('Arsène');
    const lastName = writable('Lupin');
    const fullName = derived([firstName, lastName], ([a, b]) => `${a} ${b}`);
    // note that the fullName store could alternatively be create with computed:
    // const fullName = computed(() => `${firstName()} ${lastName()}`);
    fullName.subscribe((name) => console.log(name)); // logs any change to fullName
    batch(() => {
    firstName.set('Sherlock');
    lastName.set('Holmes');
    });
    console.log('Process end'); +
    +

    output:

    -
    Arsène Lupin
    +
    Arsène Lupin
     Sherlock Holmes
     Process end
    -
    +
    +

    [!NOTE]

    • Retrieving the immediate value of a store (using any of the three methods mentioned earlier: calling subscribe with a subscriber that will be called with the value synchronously, using get or calling the store as a function) always provides the value based on the up-to-date values of all dependent stores (even if this requires re-computations of a computed or a derived inside the batch)
    • all calls to subscribers (excluding the first synchronous call during the subscribe process) are deferred until the end of the batch
    • -
    • if a subscriber has already been notified of a new value inside the batch (for example, when it is a new subscriber registered within the batch), it won't be notified again at the end of the batch if the value remains unchanged. Subscribers are invoked only when the store's value has changed since their last call.
    • +
    • if a subscriber has already been notified of a new value inside the batch (for example, when it is a new subscriber registered within the batch), it won't be notified again at the end of the batch if the value remains unchanged. Subscribers are invoked only when the store's value has changed since their last call.
    • batch can be called inside batch. The subscriber calls are performed at the end of the first batch, synchronously.
    -

    asReadable

    api documentation

    +

    api documentation

    asReadable returns a new store that exposes only the essential elements needed for subscribing to the store. It also includes any extra methods passed as parameters.

    This is useful and widely used to compose a custom store:

    • The first parameter is the writable store,
    • The second parameter is an object to extend the readable store returned.
    -
    import {writable, asReadable} from "@amadeus-it-group/tansu";

    function createCounter(initialValue: number) {
    const store$ = writable(initialValue);

    return asReadable(store$, {
    increment: () => store$.update((value) => value + 1),
    decrement: () => store$.update((value) => value - 1),
    reset: () => store$.set(initialValue)
    });
    }

    const counter$ = createCounter(0);

    counter$.subscribe((value) => console.log('Value: ', value));

    counter$.increment();
    counter$.reset();
    counter$.set(2); // Error, set does not exist -
    +
    import {writable, asReadable} from "@amadeus-it-group/tansu";

    function createCounter(initialValue: number) {
    const store$ = writable(initialValue);

    return asReadable(store$, {
    increment: () => store$.update((value) => value + 1),
    decrement: () => store$.update((value) => value - 1),
    reset: () => store$.set(initialValue)
    });
    }

    const counter$ = createCounter(0);

    counter$.subscribe((value) => console.log('Value: ', value));

    counter$.increment();
    counter$.reset();
    counter$.set(2); // Error, set does not exist +
    +

    output:

    -
    Value: 0
    +
    Value: 0
     Value: 1
     Value: 0
     (Error thrown !)
    -
    -

    asWritable

    api documentation

    -

    asWritable is almost the same as an asReadable, with the key difference being its implementation of the WritableSignal interface.

    -

    It's useful when you want to connect your computed store to the original one, or implement a custom set method. The set method can be passed directly in the second parameter or within an object, similar to the usage in asReadable.

    +
    + +

    api documentation

    +

    asWritable is almost the same as an asReadable, with the key difference being its implementation of the WritableSignal interface.

    +

    It's useful when you want to connect your computed store to the original one, or implement a custom set method. The set method can be passed directly in the second parameter or within an object, similar to the usage in asReadable.

    For example:

    -
    import {writable, asWritable} from "@amadeus-it-group/tansu";

    const number$ = writable(1);
    const double$ = computed(() => number$() * 2);
    const writableDouble$ = asWritable(double$, (doubleNumber) => {
    number$.set(doubleNumber / 2);
    });
    /* equivalent to:
    const writableDouble$ = asWritable(double$, {
    set: (doubleNumber) => number$.set(doubleNumber / 2)
    });
    */

    writableDouble$.subscribe((value) => console.log('Value: ', value));

    writableDouble$.set(2); // Nothing is triggered here, as number$ is already set with 1
    writableDouble$.set(4);
    -
    +
    import {writable, asWritable} from "@amadeus-it-group/tansu";

    const number$ = writable(1);
    const double$ = computed(() => number$() * 2);
    const writableDouble$ = asWritable(double$, (doubleNumber) => {
    number$.set(doubleNumber / 2);
    });
    /* equivalent to:
    const writableDouble$ = asWritable(double$, {
    set: (doubleNumber) => number$.set(doubleNumber / 2)
    });
    */

    writableDouble$.subscribe((value) => console.log('Value: ', value));

    writableDouble$.set(2); // Nothing is triggered here, as number$ is already set with 1
    writableDouble$.set(4);
    +
    +

    output:

    -
    Value: 2
    +
    Value: 2
     Value: 4
    -
    -

    Integration in frameworks

    Tansu works well with the Svelte framework

    Tansu is designed to be and to remain fully compatible with Svelte.

    -

    Tansu works well with the Angular ecosystem

    Here is an example of an Angular component using a Tansu store:

    -
    import { Component } from "@angular/core";
    import { AsyncPipe } from '@angular/common';
    import { Store, computed, get } from "@amadeus-it-group/tansu";

    // A store is a class extending Store from Tansu
    class CounterStore extends Store<number> {
    constructor() {
    super(0); // initialize store's value (state)
    }

    // implement state manipulation logic as regular methods
    increment() {
    // create new state based on the current state
    this.update(value => value + 1);
    }

    reset() {
    // replace the entire state with a new value
    this.set(0);
    }
    }

    @Component({
    selector: "my-app",
    template: `
    <button (click)="counter$.increment()">+</button> <br />

    <!-- store values can be displayed in a template with the standard async pipe -->
    Counter: {{ counter$ | async }} <br />
    Double counter: {{ doubleCounter$ | async }} <br />
    `,
    standalone: true,
    imports: [AsyncPipe]
    })
    export class App {
    // A store can be instantiated directly or registered in the DI container
    counter$ = new CounterStore();

    // One can easily create computed values by specifying a transformation function
    doubleCounter$ = computed(() => 2 * get(this.counter$));
    } -
    +
    + +

    Tansu is designed to be and to remain fully compatible with Svelte.

    +

    Here is an example of an Angular component using a Tansu store:

    +
    import { Component } from "@angular/core";
    import { AsyncPipe } from '@angular/common';
    import { Store, computed, get } from "@amadeus-it-group/tansu";

    // A store is a class extending Store from Tansu
    class CounterStore extends Store<number> {
    constructor() {
    super(0); // initialize store's value (state)
    }

    // implement state manipulation logic as regular methods
    increment() {
    // create new state based on the current state
    this.update(value => value + 1);
    }

    reset() {
    // replace the entire state with a new value
    this.set(0);
    }
    }

    @Component({
    selector: "my-app",
    template: `
    <button (click)="counter$.increment()">+</button> <br />

    <!-- store values can be displayed in a template with the standard async pipe -->
    Counter: {{ counter$ | async }} <br />
    Double counter: {{ doubleCounter$ | async }} <br />
    `,
    standalone: true,
    imports: [AsyncPipe]
    })
    export class App {
    // A store can be instantiated directly or registered in the DI container
    counter$ = new CounterStore();

    // One can easily create computed values by specifying a transformation function
    doubleCounter$ = computed(() => 2 * get(this.counter$));
    } +
    +

    While being fairly minimal, this example demonstrates most of the Tansu APIs with Angular.

    • works with the standard async pipe out of the box
    • @@ -212,9 +242,9 @@
    • stores can be used easily with rxjs because they implement the InteropObservable interface
    • conversely, rxjs observables (or any object implementing the InteropObservable interface) can easily be used with Tansu (e.g. in Tansu computed or derived).
    -

    Contributing to the project

    Please check the DEVELOPER.md for documentation on building and testing the project on your local development machine.

    -

    Credits and the prior art

      -
    • Svelte gets all the credit for the initial idea and the API design.
    • -
    • NgRx component stores solve a similar problem with a different approach.
    • +

      Please check the DEVELOPER.md for documentation on building and testing the project on your local development machine.

      +
        +
      • Svelte gets all the credit for the initial idea and the API design.
      • +
      • NgRx component stores solve a similar problem with a different approach.
      -

    Generated using TypeDoc

    \ No newline at end of file +
    diff --git a/interfaces/AsyncDeriveOptions.html b/interfaces/AsyncDeriveOptions.html index e2ee071..857abaf 100644 --- a/interfaces/AsyncDeriveOptions.html +++ b/interfaces/AsyncDeriveOptions.html @@ -1,54 +1,29 @@ -AsyncDeriveOptions | @amadeus-it-group/tansu

    Interface AsyncDeriveOptions<T, S>

    interface AsyncDeriveOptions<T, S> {
        derive: AsyncDeriveFn<T, S>;
        equal?: ((a, b) => boolean);
        notEqual?: ((a, b) => boolean);
    }

    Type Parameters

    • T

    • S

    Hierarchy

    Properties

    Properties

    derive: AsyncDeriveFn<T, S>
    equal?: ((a, b) => boolean)

    Custom function to compare two values, that should return true if they +AsyncDeriveOptions | @amadeus-it-group/tansu

    Interface AsyncDeriveOptions<T, S>

    interface AsyncDeriveOptions<T, S> {
        derive: AsyncDeriveFn<T, S>;
        equal?: ((a: T, b: T) => boolean);
        notEqual?: ((a: T, b: T) => boolean);
    }

    Type Parameters

    • T
    • S

    Hierarchy

    Properties

    Properties

    derive: AsyncDeriveFn<T, S>
    equal?: ((a: T, b: T) => boolean)

    Custom function to compare two values, that should return true if they are equal.

    It is called when setting a new value to avoid doing anything (such as notifying subscribers) if the value did not change.

    -

    Type declaration

      • (a, b): boolean
      • Custom function to compare two values, that should return true if they -are equal.

        -

        It is called when setting a new value to avoid doing anything -(such as notifying subscribers) if the value did not change.

        -

        Parameters

        • a: T

          First value to compare.

          -
        • b: T

          Second value to compare.

          +

          Type declaration

            • (a, b): boolean
            • Parameters

              • a: T

                First value to compare.

                +
              • b: T

                Second value to compare.

              Returns boolean

              true if a and b are considered equal.

              -

              Remarks

              The default logic (when this option is not present) is to return false -if a is a function or an object, or if a and b are different -according to Object.is.

              -

              equal takes precedence over notEqual if both -are defined.

              -

          Remarks

          The default logic (when this option is not present) is to return false +

    The default logic (when this option is not present) is to return false if a is a function or an object, or if a and b are different according to Object.is.

    equal takes precedence over notEqual if both are defined.

    -

    Param: a

    First value to compare.

    -

    Param: b

    Second value to compare.

    -

    Returns

    true if a and b are considered equal.

    -
    notEqual?: ((a, b) => boolean)

    Custom function to compare two values, that should return true if they +

    notEqual?: ((a: T, b: T) => boolean)

    Custom function to compare two values, that should return true if they are different.

    It is called when setting a new value to avoid doing anything (such as notifying subscribers) if the value did not change.

    -

    Type declaration

      • (a, b): boolean
      • Custom function to compare two values, that should return true if they -are different.

        -

        It is called when setting a new value to avoid doing anything -(such as notifying subscribers) if the value did not change.

        -

        Parameters

        • a: T

          First value to compare.

          -
        • b: T

          Second value to compare.

          +

          Type declaration

            • (a, b): boolean
            • Parameters

              • a: T

                First value to compare.

                +
              • b: T

                Second value to compare.

              Returns boolean

              true if a and b are considered different.

              -

              Remarks

              The default logic (when this option is not present) is to return true -if a is a function or an object, or if a and b are different -according to Object.is.

              -

              StoreOptions.equal takes precedence over notEqual if both -are defined.

              -

              Deprecated

              Use StoreOptions.equal instead

              -

          Remarks

          The default logic (when this option is not present) is to return true +

    The default logic (when this option is not present) is to return true if a is a function or an object, or if a and b are different according to Object.is.

    StoreOptions.equal takes precedence over notEqual if both are defined.

    -

    Deprecated

    Use StoreOptions.equal instead

    -

    Param: a

    First value to compare.

    -

    Param: b

    Second value to compare.

    -

    Returns

    true if a and b are considered different.

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Use StoreOptions.equal instead

    +
    diff --git a/interfaces/InteropObservable.html b/interfaces/InteropObservable.html index 4676c4c..5cfe365 100644 --- a/interfaces/InteropObservable.html +++ b/interfaces/InteropObservable.html @@ -1,3 +1,3 @@ -InteropObservable | @amadeus-it-group/tansu

    Interface InteropObservable<T>

    An interface for interoperability between observable implementations. It only has to expose the [Symbol.observable] method that is supposed to return a subscribable store.

    -
    interface InteropObservable<T> {
        [observable]: (() => SubscribableStore<T>);
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Properties

    Properties

    [observable]: (() => SubscribableStore<T>)

    Type declaration

    Generated using TypeDoc

    \ No newline at end of file +InteropObservable | @amadeus-it-group/tansu

    Interface InteropObservable<T>

    An interface for interoperability between observable implementations. It only has to expose the [Symbol.observable] method that is supposed to return a subscribable store.

    +
    interface InteropObservable<T> {
        [observable]: (() => SubscribableStore<T>);
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Properties

    Properties

    [observable]: (() => SubscribableStore<T>)
    diff --git a/interfaces/OnUseArgument.html b/interfaces/OnUseArgument.html index f7387b8..b4ebd43 100644 --- a/interfaces/OnUseArgument.html +++ b/interfaces/OnUseArgument.html @@ -1,3 +1,3 @@ -OnUseArgument | @amadeus-it-group/tansu

    Interface OnUseArgument<T>

    interface OnUseArgument<T> {
        set: ((value) => void);
        update: ((updater) => void);
        (value): void;
    }

    Type Parameters

    • T

    • Parameters

      • value: T

      Returns void

    Properties

    Properties

    set: ((value) => void)

    Type declaration

      • (value): void
      • Parameters

        • value: T

        Returns void

    update: ((updater) => void)

    Type declaration

      • (updater): void
      • Parameters

        Returns void

    Generated using TypeDoc

    \ No newline at end of file +OnUseArgument | @amadeus-it-group/tansu

    Interface OnUseArgument<T>

    interface OnUseArgument<T> {
        set: ((value: T) => void);
        update: ((updater: Updater<T, T>) => void);
        (value: T): void;
    }

    Type Parameters

    • T
    • Parameters

      • value: T

      Returns void

    Properties

    Properties

    set: ((value: T) => void)
    update: ((updater: Updater<T, T>) => void)
    diff --git a/interfaces/Readable-1.html b/interfaces/Readable-1.html index 0886922..1debd99 100644 --- a/interfaces/Readable-1.html +++ b/interfaces/Readable-1.html @@ -1,10 +1,12 @@ -Readable | @amadeus-it-group/tansu

    Interface Readable<T>

    This interface augments the base SubscribableStore interface by requiring the return value of the subscribe method to be both a function and an object with the unsubscribe method.

    +Readable | @amadeus-it-group/tansu

    Interface Readable<T>

    This interface augments the base SubscribableStore interface by requiring the return value of the subscribe method to be both a function and an object with the unsubscribe method.

    For interoperability with rxjs, it also implements the [Symbol.observable] method.

    -
    interface Readable<T> {
        [observable](): Readable<T>;
        subscribe(subscriber): UnsubscribeFunction & UnsubscribeObject;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Implemented by

    Methods

    • A method that makes it possible to register "interest" in store value changes over time. -It is called each and every time the store's value changes.

      +
    interface Readable<T> {
        [observable](): Readable<T>;
        get(): T;
        subscribe(subscriber: Subscriber<T>): UnsubscribeFunction & UnsubscribeObject;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Implemented by

    Methods

    Generated using TypeDoc

    \ No newline at end of file +
    diff --git a/interfaces/ReadableSignal.html b/interfaces/ReadableSignal.html index 39d7194..d7035fa 100644 --- a/interfaces/ReadableSignal.html +++ b/interfaces/ReadableSignal.html @@ -1,10 +1,12 @@ -ReadableSignal | @amadeus-it-group/tansu

    Interface ReadableSignal<T>

    This interface augments the base Readable interface by adding the ability to call the store as a function to get its value.

    -
    interface ReadableSignal<T> {
        [observable](): Readable<T>;
        subscribe(subscriber): UnsubscribeFunction & UnsubscribeObject;
        (): T;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    • Returns the value of the store. This is a shortcut for calling get with the store.

      -

      Returns T

    Methods

    diff --git a/interfaces/SignalStore.html b/interfaces/SignalStore.html new file mode 100644 index 0000000..f3f97c2 --- /dev/null +++ b/interfaces/SignalStore.html @@ -0,0 +1,4 @@ +SignalStore | @amadeus-it-group/tansu

    Interface SignalStore<T>

    Represents a store that can return its value with a get method.

    +
    interface SignalStore<T> {
        get(): T;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Methods

    get +

    Methods

    • Returns the value of the store.

      +

      Returns T

    diff --git a/interfaces/StoreOptions.html b/interfaces/StoreOptions.html index f3c563a..6cff134 100644 --- a/interfaces/StoreOptions.html +++ b/interfaces/StoreOptions.html @@ -1,58 +1,33 @@ -StoreOptions | @amadeus-it-group/tansu

    Interface StoreOptions<T>

    Store options that can be passed to readable or writable.

    -
    interface StoreOptions<T> {
        equal?: ((a, b) => boolean);
        notEqual?: ((a, b) => boolean);
        onUse?: OnUseFn<T>;
    }

    Type Parameters

    • T

    Properties

    Properties

    equal?: ((a, b) => boolean)

    Custom function to compare two values, that should return true if they +StoreOptions | @amadeus-it-group/tansu

    Interface StoreOptions<T>

    Store options that can be passed to readable or writable.

    +
    interface StoreOptions<T> {
        equal?: ((a: T, b: T) => boolean);
        notEqual?: ((a: T, b: T) => boolean);
        onUse?: OnUseFn<T>;
    }

    Type Parameters

    • T

    Properties

    Properties

    equal?: ((a: T, b: T) => boolean)

    Custom function to compare two values, that should return true if they are equal.

    It is called when setting a new value to avoid doing anything (such as notifying subscribers) if the value did not change.

    -

    Type declaration

      • (a, b): boolean
      • Custom function to compare two values, that should return true if they -are equal.

        -

        It is called when setting a new value to avoid doing anything -(such as notifying subscribers) if the value did not change.

        -

        Parameters

        • a: T

          First value to compare.

          -
        • b: T

          Second value to compare.

          +

          Type declaration

            • (a, b): boolean
            • Parameters

              • a: T

                First value to compare.

                +
              • b: T

                Second value to compare.

              Returns boolean

              true if a and b are considered equal.

              -

              Remarks

              The default logic (when this option is not present) is to return false -if a is a function or an object, or if a and b are different -according to Object.is.

              -

              equal takes precedence over notEqual if both -are defined.

              -

          Remarks

          The default logic (when this option is not present) is to return false +

    The default logic (when this option is not present) is to return false if a is a function or an object, or if a and b are different according to Object.is.

    equal takes precedence over notEqual if both are defined.

    -

    Param: a

    First value to compare.

    -

    Param: b

    Second value to compare.

    -

    Returns

    true if a and b are considered equal.

    -
    notEqual?: ((a, b) => boolean)

    Custom function to compare two values, that should return true if they +

    notEqual?: ((a: T, b: T) => boolean)

    Custom function to compare two values, that should return true if they are different.

    It is called when setting a new value to avoid doing anything (such as notifying subscribers) if the value did not change.

    -

    Type declaration

      • (a, b): boolean
      • Custom function to compare two values, that should return true if they -are different.

        -

        It is called when setting a new value to avoid doing anything -(such as notifying subscribers) if the value did not change.

        -

        Parameters

        • a: T

          First value to compare.

          -
        • b: T

          Second value to compare.

          +

          Type declaration

            • (a, b): boolean
            • Parameters

              • a: T

                First value to compare.

                +
              • b: T

                Second value to compare.

              Returns boolean

              true if a and b are considered different.

              -

              Remarks

              The default logic (when this option is not present) is to return true -if a is a function or an object, or if a and b are different -according to Object.is.

              -

              StoreOptions.equal takes precedence over notEqual if both -are defined.

              -

              Deprecated

              Use StoreOptions.equal instead

              -

          Remarks

          The default logic (when this option is not present) is to return true +

    The default logic (when this option is not present) is to return true if a is a function or an object, or if a and b are different according to Object.is.

    StoreOptions.equal takes precedence over notEqual if both are defined.

    -

    Deprecated

    Use StoreOptions.equal instead

    -

    Param: a

    First value to compare.

    -

    Param: b

    Second value to compare.

    -

    Returns

    true if a and b are considered different.

    -
    onUse?: OnUseFn<T>

    A function that is called when the number of subscribers changes from 0 to 1 +

    Use StoreOptions.equal instead

    +
    onUse?: OnUseFn<T>

    A function that is called when the number of subscribers changes from 0 to 1 (but not called when the number of subscribers changes from 1 to 2, ...). If it returns a function, that function will be called when the number of subscribers changes from 1 to 0.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    diff --git a/interfaces/SubscribableStore.html b/interfaces/SubscribableStore.html index 67bda92..db2e38f 100644 --- a/interfaces/SubscribableStore.html +++ b/interfaces/SubscribableStore.html @@ -1,8 +1,8 @@ -SubscribableStore | @amadeus-it-group/tansu

    Interface SubscribableStore<T>

    Represents a store accepting registrations (subscribers) and "pushing" notifications on each and every store value change.

    -
    interface SubscribableStore<T> {
        subscribe(subscriber): Unsubscriber;
    }

    Type Parameters

    • T

    Hierarchy (view full)

    Methods

    Methods

    diff --git a/interfaces/SubscriberObject.html b/interfaces/SubscriberObject.html index 1de025f..fbd7e80 100644 --- a/interfaces/SubscriberObject.html +++ b/interfaces/SubscriberObject.html @@ -1,18 +1,14 @@ -SubscriberObject | @amadeus-it-group/tansu

    Interface SubscriberObject<T>

    A partial observer notified when a store value changes. A store will call the next method every time the store's state is changing.

    -
    interface SubscriberObject<T> {
        complete?: any;
        error?: any;
        next: SubscriberFunction<T>;
        pause: (() => void);
        resume: (() => void);
    }

    Type Parameters

    • T

    Properties

    Properties

    complete?: any

    Unused, only declared for compatibility with rxjs.

    -
    error?: any

    Unused, only declared for compatibility with rxjs.

    -

    A store will call this method every time the store's state is changing.

    -
    pause: (() => void)

    A store will call this method when it knows that the value will be changed. +SubscriberObject | @amadeus-it-group/tansu

    Interface SubscriberObject<T>

    A partial observer notified when a store value changes. A store will call the next method every time the store's state is changing.

    +
    interface SubscriberObject<T> {
        complete?: any;
        error?: any;
        next: SubscriberFunction<T>;
        pause: (() => void);
        resume: (() => void);
    }

    Type Parameters

    • T

    Properties

    Properties

    complete?: any

    Unused, only declared for compatibility with rxjs.

    +
    error?: any

    Unused, only declared for compatibility with rxjs.

    +

    A store will call this method every time the store's state is changing.

    +
    pause: (() => void)

    A store will call this method when it knows that the value will be changed. A call to this method will be followed by a call to next or to resume.

    -

    Type declaration

      • (): void
      • A store will call this method when it knows that the value will be changed. -A call to this method will be followed by a call to next or to resume.

        -

        Returns void

    resume: (() => void)

    A store will call this method if pause was called previously -and the value finally did not need to change.

    -

    Type declaration

      • (): void
      • A store will call this method if pause was called previously +

    resume: (() => void)

    A store will call this method if pause was called previously and the value finally did not need to change.

    -

    Returns void

    Generated using TypeDoc

    \ No newline at end of file +
    diff --git a/interfaces/SyncDeriveOptions.html b/interfaces/SyncDeriveOptions.html index 8faca8f..f084f82 100644 --- a/interfaces/SyncDeriveOptions.html +++ b/interfaces/SyncDeriveOptions.html @@ -1,54 +1,29 @@ -SyncDeriveOptions | @amadeus-it-group/tansu

    Interface SyncDeriveOptions<T, S>

    interface SyncDeriveOptions<T, S> {
        derive: SyncDeriveFn<T, S>;
        equal?: ((a, b) => boolean);
        notEqual?: ((a, b) => boolean);
    }

    Type Parameters

    • T

    • S

    Hierarchy

    Properties

    Properties

    derive: SyncDeriveFn<T, S>
    equal?: ((a, b) => boolean)

    Custom function to compare two values, that should return true if they +SyncDeriveOptions | @amadeus-it-group/tansu

    Interface SyncDeriveOptions<T, S>

    interface SyncDeriveOptions<T, S> {
        derive: SyncDeriveFn<T, S>;
        equal?: ((a: T, b: T) => boolean);
        notEqual?: ((a: T, b: T) => boolean);
    }

    Type Parameters

    • T
    • S

    Hierarchy

    Properties

    Properties

    derive: SyncDeriveFn<T, S>
    equal?: ((a: T, b: T) => boolean)

    Custom function to compare two values, that should return true if they are equal.

    It is called when setting a new value to avoid doing anything (such as notifying subscribers) if the value did not change.

    -

    Type declaration

      • (a, b): boolean
      • Custom function to compare two values, that should return true if they -are equal.

        -

        It is called when setting a new value to avoid doing anything -(such as notifying subscribers) if the value did not change.

        -

        Parameters

        • a: T

          First value to compare.

          -
        • b: T

          Second value to compare.

          +

          Type declaration

            • (a, b): boolean
            • Parameters

              • a: T

                First value to compare.

                +
              • b: T

                Second value to compare.

              Returns boolean

              true if a and b are considered equal.

              -

              Remarks

              The default logic (when this option is not present) is to return false -if a is a function or an object, or if a and b are different -according to Object.is.

              -

              equal takes precedence over notEqual if both -are defined.

              -

          Remarks

          The default logic (when this option is not present) is to return false +

    The default logic (when this option is not present) is to return false if a is a function or an object, or if a and b are different according to Object.is.

    equal takes precedence over notEqual if both are defined.

    -

    Param: a

    First value to compare.

    -

    Param: b

    Second value to compare.

    -

    Returns

    true if a and b are considered equal.

    -
    notEqual?: ((a, b) => boolean)

    Custom function to compare two values, that should return true if they +

    notEqual?: ((a: T, b: T) => boolean)

    Custom function to compare two values, that should return true if they are different.

    It is called when setting a new value to avoid doing anything (such as notifying subscribers) if the value did not change.

    -

    Type declaration

      • (a, b): boolean
      • Custom function to compare two values, that should return true if they -are different.

        -

        It is called when setting a new value to avoid doing anything -(such as notifying subscribers) if the value did not change.

        -

        Parameters

        • a: T

          First value to compare.

          -
        • b: T

          Second value to compare.

          +

          Type declaration

            • (a, b): boolean
            • Parameters

              • a: T

                First value to compare.

                +
              • b: T

                Second value to compare.

              Returns boolean

              true if a and b are considered different.

              -

              Remarks

              The default logic (when this option is not present) is to return true -if a is a function or an object, or if a and b are different -according to Object.is.

              -

              StoreOptions.equal takes precedence over notEqual if both -are defined.

              -

              Deprecated

              Use StoreOptions.equal instead

              -

          Remarks

          The default logic (when this option is not present) is to return true +

    The default logic (when this option is not present) is to return true if a is a function or an object, or if a and b are different according to Object.is.

    StoreOptions.equal takes precedence over notEqual if both are defined.

    -

    Deprecated

    Use StoreOptions.equal instead

    -

    Param: a

    First value to compare.

    -

    Param: b

    Second value to compare.

    -

    Returns

    true if a and b are considered different.

    -

    Generated using TypeDoc

    \ No newline at end of file +

    Use StoreOptions.equal instead

    +
    diff --git a/interfaces/UnsubscribeObject.html b/interfaces/UnsubscribeObject.html index c2d8dab..3fcfbd9 100644 --- a/interfaces/UnsubscribeObject.html +++ b/interfaces/UnsubscribeObject.html @@ -1,5 +1,5 @@ -UnsubscribeObject | @amadeus-it-group/tansu

    Interface UnsubscribeObject

    An object with the unsubscribe method. +UnsubscribeObject | @amadeus-it-group/tansu

    Interface UnsubscribeObject

    An object with the unsubscribe method. Subscribable stores might choose to return such object instead of directly returning UnsubscribeFunction from a subscription call.

    -
    interface UnsubscribeObject {
        unsubscribe: UnsubscribeFunction;
    }

    Properties

    Properties

    unsubscribe: UnsubscribeFunction

    A method that acts as the UnsubscribeFunction.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    interface UnsubscribeObject {
        unsubscribe: UnsubscribeFunction;
    }

    Properties

    Properties

    unsubscribe: UnsubscribeFunction

    A method that acts as the UnsubscribeFunction.

    +
    diff --git a/interfaces/Writable-1.html b/interfaces/Writable-1.html index 29b7e51..eac12cc 100644 --- a/interfaces/Writable-1.html +++ b/interfaces/Writable-1.html @@ -1,17 +1,20 @@ -Writable | @amadeus-it-group/tansu

    Interface Writable<T, U>

    Builds on top of Readable and represents a store that can be manipulated from "outside": anyone with a reference to writable store can either update or completely replace state of a given store.

    -

    Example

    // reset counter's store value to 0 by using the {@link Writable.set} method
    counterStore.set(0);

    // increment counter's store value by using the {@link Writable.update} method
    counterStore.update(currentValue => currentValue + 1); -
    -
    interface Writable<T, U> {
        [observable](): Readable<T>;
        set(value): void;
        subscribe(subscriber): UnsubscribeFunction & UnsubscribeObject;
        update(updater): void;
    }

    Type Parameters

    • T

    • U = T

    Hierarchy (view full)

    Methods

    • Replaces store's state with the provided value.

      -

      Parameters

      • value: U

        value to be used as the new state of a store.

        -

      Returns void

    • Updates store's state by using an Updater function.

      +

      Parameters

      • updater: Updater<T, U>

        a function that takes the current state as an argument and returns the new state.

        +

      Returns void

    diff --git a/interfaces/WritableSignal.html b/interfaces/WritableSignal.html index a430c08..6e1269d 100644 --- a/interfaces/WritableSignal.html +++ b/interfaces/WritableSignal.html @@ -1,17 +1,19 @@ -WritableSignal | @amadeus-it-group/tansu

    Interface WritableSignal<T, U>

    Represents a store that implements both ReadableSignal and Writable. +WritableSignal | @amadeus-it-group/tansu

    Interface WritableSignal<T, U>

    Represents a store that implements both ReadableSignal and Writable. This is the type of objects returned by writable.

    -
    interface WritableSignal<T, U> {
        [observable](): Readable<T>;
        set(value): void;
        subscribe(subscriber): UnsubscribeFunction & UnsubscribeObject;
        update(updater): void;
        (): T;
    }

    Type Parameters

    • T

    • U = T

    Hierarchy (view full)

    • Returns the value of the store. This is a shortcut for calling get with the store.

      -

      Returns T

    Methods

    • Replaces store's state with the provided value.

      -

      Parameters

      • value: U

        value to be used as the new state of a store.

        -

      Returns void

    • A method that makes it possible to register "interest" in store value changes over time. -It is called each and every time the store's value changes.

      +
    interface WritableSignal<T, U> {
        [observable](): Readable<T>;
        get(): T;
        set(value: U): void;
        subscribe(subscriber: Subscriber<T>): UnsubscribeFunction & UnsubscribeObject;
        update(updater: Updater<T, U>): void;
        (): T;
    }

    Type Parameters

    • T
    • U = T

    Hierarchy (view full)

    • Returns the value of the store.

      +

      Returns T

    Methods

    • Replaces store's state with the provided value.

      +

      Parameters

      • value: U

        value to be used as the new state of a store.

        +

      Returns void

    • Updates store's state by using an Updater function.

      -

      Parameters

      • updater: Updater<T, U>

        a function that takes the current state as an argument and returns the new state.

        -

      Returns void

    Generated using TypeDoc

    \ No newline at end of file +
    • Updates store's state by using an Updater function.

      +

      Parameters

      • updater: Updater<T, U>

        a function that takes the current state as an argument and returns the new state.

        +

      Returns void

    diff --git a/media/DEVELOPER.md b/media/DEVELOPER.md new file mode 100644 index 0000000..dadf677 --- /dev/null +++ b/media/DEVELOPER.md @@ -0,0 +1,9 @@ +Run: + + - `npm test` to execute unit tests. + - `npm run tdd` or `npm run tdd:ui` to execute unit tests in the TDD mode (tests are re-run on each change). + - `npm run build` to build the lib + - `npm run format:check` to check that files are correctly formatted + - `npm run format:fix` to reformat files + - `npm run api` to run the api-extractor + - `npm run docs` to run api-documenter based on the api-extractor result. It will generate the tsdoc markdown files. diff --git a/modules.html b/modules.html index 7b08b90..f693b7c 100644 --- a/modules.html +++ b/modules.html @@ -1,39 +1,40 @@ -@amadeus-it-group/tansu

    @amadeus-it-group/tansu

    tansu is a lightweight, push-based state management library. +@amadeus-it-group/tansu

    Generated using TypeDoc

    \ No newline at end of file +

    Index

    Classes

    Interfaces

    Type Aliases

    Variables

    Functions

    diff --git a/types/AsyncDeriveFn.html b/types/AsyncDeriveFn.html index dec40a9..ef7c585 100644 --- a/types/AsyncDeriveFn.html +++ b/types/AsyncDeriveFn.html @@ -1 +1 @@ -AsyncDeriveFn | @amadeus-it-group/tansu

    Generated using TypeDoc

    \ No newline at end of file +AsyncDeriveFn | @amadeus-it-group/tansu

    Type Alias AsyncDeriveFn<T, S>

    AsyncDeriveFn<T, S>: ((values: StoresInputValues<S>, set: OnUseArgument<T>) => Unsubscriber | void)

    Type Parameters

    • T
    • S
    diff --git a/types/OnUseFn.html b/types/OnUseFn.html index b344350..6da5857 100644 --- a/types/OnUseFn.html +++ b/types/OnUseFn.html @@ -1,4 +1,4 @@ -OnUseFn | @amadeus-it-group/tansu

    Type alias OnUseFn<T>

    OnUseFn<T>: ((arg) => void | Unsubscriber)

    Type of a function that is called when the number of subscribers changes from 0 to 1 +OnUseFn | @amadeus-it-group/tansu

    Type Alias OnUseFn<T>

    OnUseFn<T>: ((arg: OnUseArgument<T>) => void | Unsubscriber)

    Type of a function that is called when the number of subscribers changes from 0 to 1 (but not called when the number of subscribers changes from 1 to 2, ...).

    If it returns a function, that function will be called when the number of subscribers changes from 1 to 0.

    -

    Type Parameters

    • T

    Type declaration

    Generated using TypeDoc

    \ No newline at end of file +

    Type Parameters

    • T
    diff --git a/types/StoreInput.html b/types/StoreInput.html index 1c50e53..11ea2ab 100644 --- a/types/StoreInput.html +++ b/types/StoreInput.html @@ -1,2 +1,2 @@ -StoreInput | @amadeus-it-group/tansu

    Generated using TypeDoc

    \ No newline at end of file +StoreInput | @amadeus-it-group/tansu

    Type Alias StoreInput<T>

    Valid types that can be considered as a store.

    +

    Type Parameters

    • T
    diff --git a/types/StoresInput.html b/types/StoresInput.html index c3c011c..5c49264 100644 --- a/types/StoresInput.html +++ b/types/StoresInput.html @@ -1,2 +1,2 @@ -StoresInput | @amadeus-it-group/tansu

    Generated using TypeDoc

    \ No newline at end of file +StoresInput | @amadeus-it-group/tansu
    StoresInput: StoreInput<any> | readonly [StoreInput<any>, ...StoreInput<any>[]]

    Either a single StoreInput or a read-only array of at least one StoreInput.

    +
    diff --git a/types/StoresInputValues.html b/types/StoresInputValues.html index e6d3a0d..54e8bc7 100644 --- a/types/StoresInputValues.html +++ b/types/StoresInputValues.html @@ -1,6 +1,6 @@ -StoresInputValues | @amadeus-it-group/tansu

    Type alias StoresInputValues<S>

    StoresInputValues<S>: S extends StoreInput<infer T>
        ? T
        : {
            [K in keyof S]: S[K] extends StoreInput<infer T>
                ? T
                : never
        }

    Extracts the types of the values of the stores from a type extending StoresInput.

    -

    Type Parameters

    • S

    Remarks

    If the type given as a parameter is a single StoreInput, the type of the value +StoresInputValues | @amadeus-it-group/tansu

    Type Alias StoresInputValues<S>

    StoresInputValues<S>: S extends StoreInput<infer T>
        ? T
        : {
            [K in keyof S]: S[K] extends StoreInput<infer T>
                ? T
                : never
        }

    Extracts the types of the values of the stores from a type extending StoresInput.

    +

    Type Parameters

    • S

    If the type given as a parameter is a single StoreInput, the type of the value of that StoreInput is returned.

    If the type given as a parameter is one of an array of StoreInput, the returned type is the type of an array containing the value of each store in the same order.

    -

    Generated using TypeDoc

    \ No newline at end of file +
    diff --git a/types/Subscriber.html b/types/Subscriber.html index 6f5d7aa..9799854 100644 --- a/types/Subscriber.html +++ b/types/Subscriber.html @@ -1,6 +1,6 @@ -Subscriber | @amadeus-it-group/tansu

    Type alias Subscriber<T>

    Subscriber<T>: SubscriberFunction<T> | Partial<SubscriberObject<T>> | null | undefined

    Expresses interest in store value changes over time. It can be either:

    +Subscriber | @amadeus-it-group/tansu

    Type Alias Subscriber<T>

    Subscriber<T>:
        | SubscriberFunction<T>
        | Partial<SubscriberObject<T>>
        | null
        | undefined

    Expresses interest in store value changes over time. It can be either:

    -

    Type Parameters

    • T

    Generated using TypeDoc

    \ No newline at end of file +

    Type Parameters

    • T
    diff --git a/types/SubscriberFunction.html b/types/SubscriberFunction.html index e2f0e0a..5063e3b 100644 --- a/types/SubscriberFunction.html +++ b/types/SubscriberFunction.html @@ -1,2 +1,2 @@ -SubscriberFunction | @amadeus-it-group/tansu

    Type alias SubscriberFunction<T>

    SubscriberFunction<T>: ((value) => void) & Partial<Omit<SubscriberObject<T>, "next">>

    A callback invoked when a store value changes. It is called with the latest value of a given store.

    -

    Type Parameters

    • T

    Type declaration

      • (value): void
      • Parameters

        • value: T

        Returns void

    Generated using TypeDoc

    \ No newline at end of file +SubscriberFunction | @amadeus-it-group/tansu

    Type Alias SubscriberFunction<T>

    SubscriberFunction<T>: ((value: T) => void) & Partial<Omit<SubscriberObject<T>, "next">>

    A callback invoked when a store value changes. It is called with the latest value of a given store.

    +

    Type Parameters

    • T
    diff --git a/types/SyncDeriveFn.html b/types/SyncDeriveFn.html index 5976411..1495dc4 100644 --- a/types/SyncDeriveFn.html +++ b/types/SyncDeriveFn.html @@ -1 +1 @@ -SyncDeriveFn | @amadeus-it-group/tansu

    Generated using TypeDoc

    \ No newline at end of file +SyncDeriveFn | @amadeus-it-group/tansu

    Type Alias SyncDeriveFn<T, S>

    SyncDeriveFn<T, S>: ((values: StoresInputValues<S>) => T)

    Type Parameters

    • T
    • S
    diff --git a/types/UnsubscribeFunction.html b/types/UnsubscribeFunction.html index 0101a8a..7866694 100644 --- a/types/UnsubscribeFunction.html +++ b/types/UnsubscribeFunction.html @@ -1,2 +1,2 @@ -UnsubscribeFunction | @amadeus-it-group/tansu

    Type alias UnsubscribeFunction

    UnsubscribeFunction: (() => void)

    A function to unsubscribe from value change notifications.

    -

    Type declaration

      • (): void
      • Returns void

    Generated using TypeDoc

    \ No newline at end of file +UnsubscribeFunction | @amadeus-it-group/tansu

    Type Alias UnsubscribeFunction

    UnsubscribeFunction: (() => void)

    A function to unsubscribe from value change notifications.

    +
    diff --git a/types/Unsubscriber.html b/types/Unsubscriber.html index 31f3e47..be34bb4 100644 --- a/types/Unsubscriber.html +++ b/types/Unsubscriber.html @@ -1 +1 @@ -Unsubscriber | @amadeus-it-group/tansu

    Generated using TypeDoc

    \ No newline at end of file +Unsubscriber | @amadeus-it-group/tansu
    diff --git a/types/Updater.html b/types/Updater.html index 49c0a1d..e22a7e6 100644 --- a/types/Updater.html +++ b/types/Updater.html @@ -1,2 +1,2 @@ -Updater | @amadeus-it-group/tansu

    Type alias Updater<T, U>

    Updater<T, U>: ((value) => U)

    A function that can be used to update store's value. This function is called with the current value and should return new store value.

    -

    Type Parameters

    • T

    • U = T

    Type declaration

      • (value): U
      • Parameters

        • value: T

        Returns U

    Generated using TypeDoc

    \ No newline at end of file +Updater | @amadeus-it-group/tansu

    Type Alias Updater<T, U>

    Updater<T, U>: ((value: T) => U)

    A function that can be used to update store's value. This function is called with the current value and should return new store value.

    +

    Type Parameters

    • T
    • U = T
    diff --git a/variables/symbolObservable.html b/variables/symbolObservable.html index a0c586e..a4ad656 100644 --- a/variables/symbolObservable.html +++ b/variables/symbolObservable.html @@ -1,2 +1,2 @@ -symbolObservable | @amadeus-it-group/tansu

    Generated using TypeDoc

    \ No newline at end of file +symbolObservable | @amadeus-it-group/tansu

    Variable symbolObservableConst

    symbolObservable: typeof Symbol.observable = ...

    Symbol used in InteropObservable allowing any object to expose an observable.

    +