diff --git a/assets/icons.js b/assets/icons.js new file mode 100644 index 00000000..b79c9e89 --- /dev/null +++ b/assets/icons.js @@ -0,0 +1,15 @@ +(function(svg) { + svg.innerHTML = ``; + svg.style.display = 'none'; + if (location.protocol === 'file:') { + if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', updateUseElements); + else updateUseElements() + function updateUseElements() { + document.querySelectorAll('use').forEach(el => { + if (el.getAttribute('href').includes('#icon-')) { + el.setAttribute('href', el.getAttribute('href').replace(/.*#/, '#')); + } + }); + } + } +})(document.body.appendChild(document.createElementNS('http://www.w3.org/2000/svg', 'svg'))) \ No newline at end of file diff --git a/assets/icons.svg b/assets/icons.svg new file mode 100644 index 00000000..7dead611 --- /dev/null +++ b/assets/icons.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/main.js b/assets/main.js index d0aa8d5f..1daeb690 100644 --- a/assets/main.js +++ b/assets/main.js @@ -1,8 +1,8 @@ "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(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){D||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!D&&this.active&&n.target.closest(".col-sidebar")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&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(n){super(n);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; } -`}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,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(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var Z=class extends C{constructor(n){super(n);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 r=Q.getItem(this.key);this.el.open=r?r==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let i=this.summary.querySelector("a");i&&i.addEventListener("click",()=>{location.assign(i.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();})(); +"use strict";(()=>{var Ce=Object.create;var ne=Object.defineProperty;var Pe=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=Pe(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Ce(_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),y=s.str.charAt(1),p;y in s.node.edges?p=s.node.edges[y]:(p=new t.TokenSet,s.node.edges[y]=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 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.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.scrollToHash(),this.updateIndexVisibility())}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()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.scrollToHash(),this.updateIndexVisibility())}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&&!e.checkVisibility()){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").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&&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 y=document.createElement("li");y.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,y.append(p),e.appendChild(y)}}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 He={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>He[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",fe="mousemove",H="mouseup",J={x:0,y:0},pe=!1,ee=!1,Be=!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&&(Be=!0,F="touchstart",fe="touchmove",H="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(fe,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(H,()=>{ee=!1});document.addEventListener("click",t=>{pe&&(t.preventDefault(),t.stopImmediatePropagation(),pe=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(H,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(H,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 ye=document.head.appendChild(document.createElement("style"));ye.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()),ye.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 ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ve(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ve(t.value)})}function ve(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.showPage(),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.pathname===r.pathname&&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();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/assets/style.css b/assets/style.css index 108428c3..98a43779 100644 --- a/assets/style.css +++ b/assets/style.css @@ -11,6 +11,7 @@ --light-color-text-aside: #6e6e6e; --light-color-link: #1f70c2; + --light-color-ts-keyword: #056bd6; --light-color-ts-project: #b111c9; --light-color-ts-module: var(--light-color-ts-project); --light-color-ts-namespace: var(--light-color-ts-project); @@ -28,7 +29,7 @@ --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: var(--light-color-ts-type-alias); + --light-color-ts-type-parameter: #a55c0e; --light-color-ts-accessor: var(--light-color-ts-property); --light-color-ts-get-signature: var(--light-color-ts-accessor); --light-color-ts-set-signature: var(--light-color-ts-accessor); @@ -50,6 +51,7 @@ --dark-color-text-aside: #dddddd; --dark-color-link: #00aff4; + --dark-color-ts-keyword: #3399ff; --dark-color-ts-project: #e358ff; --dark-color-ts-module: var(--dark-color-ts-project); --dark-color-ts-namespace: var(--dark-color-ts-project); @@ -67,7 +69,7 @@ --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: var(--dark-color-ts-type-alias); + --dark-color-ts-type-parameter: #e07d13; --dark-color-ts-accessor: var(--dark-color-ts-property); --dark-color-ts-get-signature: var(--dark-color-ts-accessor); --dark-color-ts-set-signature: var(--dark-color-ts-accessor); @@ -91,6 +93,7 @@ --color-text-aside: var(--light-color-text-aside); --color-link: var(--light-color-link); + --color-ts-keyword: var(--light-color-ts-keyword); --color-ts-module: var(--light-color-ts-module); --color-ts-namespace: var(--light-color-ts-namespace); --color-ts-enum: var(--light-color-ts-enum); @@ -132,6 +135,7 @@ --color-text-aside: var(--dark-color-text-aside); --color-link: var(--dark-color-link); + --color-ts-keyword: var(--dark-color-ts-keyword); --color-ts-module: var(--dark-color-ts-module); --color-ts-namespace: var(--dark-color-ts-namespace); --color-ts-enum: var(--dark-color-ts-enum); @@ -180,6 +184,7 @@ body { --color-text-aside: var(--light-color-text-aside); --color-link: var(--light-color-link); + --color-ts-keyword: var(--light-color-ts-keyword); --color-ts-module: var(--light-color-ts-module); --color-ts-namespace: var(--light-color-ts-namespace); --color-ts-enum: var(--light-color-ts-enum); @@ -219,6 +224,7 @@ body { --color-text-aside: var(--dark-color-text-aside); --color-link: var(--dark-color-link); + --color-ts-keyword: var(--dark-color-ts-keyword); --color-ts-module: var(--dark-color-ts-module); --color-ts-namespace: var(--dark-color-ts-namespace); --color-ts-enum: var(--dark-color-ts-enum); @@ -260,12 +266,12 @@ h6 { line-height: 1.2; } -h1 > a, -h2 > a, -h3 > a, -h4 > a, -h5 > a, -h6 > a { +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); } @@ -643,6 +649,28 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { font-weight: bold; } +.tsd-full-hierarchy:not(:last-child) { + margin-bottom: 1em; + padding-bottom: 1em; + border-bottom: 1px solid var(--color-accent); +} +.tsd-full-hierarchy, +.tsd-full-hierarchy ul { + list-style: none; + margin: 0; + padding: 0; +} +.tsd-full-hierarchy ul { + padding-left: 1.5rem; +} +.tsd-full-hierarchy a { + padding: 0.25rem 0 !important; + font-size: 1rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} + .tsd-panel-group.tsd-index-group { margin-bottom: 0; } @@ -708,12 +736,15 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { } .tsd-navigation > a, .tsd-navigation .tsd-accordion-summary { - width: calc(100% - 0.5rem); + width: calc(100% - 0.25rem); + display: flex; + align-items: center; } .tsd-navigation a, .tsd-navigation summary > span, .tsd-page-navigation a { - display: inline-flex; + display: flex; + width: calc(100% - 0.25rem); align-items: center; padding: 0.25rem; color: var(--color-text); @@ -753,11 +784,6 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { margin-left: -1.5rem; } -.tsd-nested-navigation > li > a, -.tsd-nested-navigation > li > span { - width: calc(100% - 1.75rem - 0.5rem); -} - .tsd-page-navigation ul { padding-left: 1.75rem; } @@ -984,6 +1010,11 @@ a.tsd-index-link { overflow-x: auto; } +.tsd-signature-keyword { + color: var(--color-ts-keyword); + font-weight: normal; +} + .tsd-signature-symbol { color: var(--color-text-aside); font-weight: normal; diff --git a/functions/asArray.html b/functions/asArray.html index 117ee3be..007ed969 100644 --- a/functions/asArray.html +++ b/functions/asArray.html @@ -1,6 +1,6 @@ -asArray | @salesforce/ts-types
  • Narrows an unknown value to an Array if it is type-compatible, or returns undefined otherwise.

    -

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      -

    Returns Optional<T[]>

  • Narrows an unknown value to an object if it is type-compatible, or returns the provided default otherwise.

    -

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      -
    • defaultValue: T[]

      The default to return if value was undefined or of the incorrect type.

      -

    Returns T[]

\ No newline at end of file +asArray | @salesforce/ts-types
  • Narrows an unknown value to an Array if it is type-compatible, or returns undefined otherwise.

    +

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      +

    Returns Optional<T[]>

  • Narrows an unknown value to an object if it is type-compatible, or returns the provided default otherwise.

    +

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      +
    • defaultValue: T[]

      The default to return if value was undefined or of the incorrect type.

      +

    Returns T[]

\ No newline at end of file diff --git a/functions/asBoolean.html b/functions/asBoolean.html index 18ed590f..8f1d5a66 100644 --- a/functions/asBoolean.html +++ b/functions/asBoolean.html @@ -1,6 +1,6 @@ -asBoolean | @salesforce/ts-types
  • Narrows an unknown value to a boolean if it is type-compatible, or returns undefined otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -

    Returns Optional<boolean>

  • Narrows an unknown value to a boolean if it is type-compatible, or returns the provided default otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -
    • defaultValue: boolean

      The default to return if value was undefined or of the incorrect type.

      -

    Returns boolean

\ No newline at end of file +asBoolean | @salesforce/ts-types
  • Narrows an unknown value to a boolean if it is type-compatible, or returns undefined otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +

    Returns Optional<boolean>

  • Narrows an unknown value to a boolean if it is type-compatible, or returns the provided default otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +
    • defaultValue: boolean

      The default to return if value was undefined or of the incorrect type.

      +

    Returns boolean

\ No newline at end of file diff --git a/functions/asDictionary.html b/functions/asDictionary.html index 1cd5cefe..1852baae 100644 --- a/functions/asDictionary.html +++ b/functions/asDictionary.html @@ -1,6 +1,6 @@ -asDictionary | @salesforce/ts-types
  • Narrows an unknown value to a Dictionary<T> if it is type-compatible, or returns undefined otherwise.

    -

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      -

    Returns Optional<Dictionary<T>>

  • Narrows an unknown value to an object if it is type-compatible, or returns the provided default otherwise.

    -

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      -
    • defaultValue: Dictionary<T>

      The default to return if value was undefined or of the incorrect type.

      -

    Returns Dictionary<T>

\ No newline at end of file +asDictionary | @salesforce/ts-types
  • Narrows an unknown value to a Dictionary<T> if it is type-compatible, or returns undefined otherwise.

    +

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      +

    Returns Optional<Dictionary<T>>

  • Narrows an unknown value to an object if it is type-compatible, or returns the provided default otherwise.

    +

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      +
    • defaultValue: Dictionary<T>

      The default to return if value was undefined or of the incorrect type.

      +

    Returns Dictionary<T>

\ No newline at end of file diff --git a/functions/asFunction.html b/functions/asFunction.html index b4e90eee..d63aa39d 100644 --- a/functions/asFunction.html +++ b/functions/asFunction.html @@ -1,6 +1,6 @@ -asFunction | @salesforce/ts-types
  • Narrows an unknown value to an AnyFunction if it is type-compatible, or returns undefined otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -

    Returns Optional<AnyFunction>

  • Narrows an unknown value to an object if it is type-compatible, or returns the provided default otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -
    • defaultValue: AnyFunction<unknown>

      The default to return if value was undefined or of the incorrect type.

      -

    Returns AnyFunction

\ No newline at end of file +asFunction | @salesforce/ts-types
  • Narrows an unknown value to an AnyFunction if it is type-compatible, or returns undefined otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +

    Returns Optional<AnyFunction>

  • Narrows an unknown value to an object if it is type-compatible, or returns the provided default otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +
    • defaultValue: AnyFunction<unknown>

      The default to return if value was undefined or of the incorrect type.

      +

    Returns AnyFunction

\ No newline at end of file diff --git a/functions/asInstance.html b/functions/asInstance.html index 66b04d53..3e493ba4 100644 --- a/functions/asInstance.html +++ b/functions/asInstance.html @@ -1,7 +1,7 @@ -asInstance | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/asJsonArray.html b/functions/asJsonArray.html index f2a24f9c..b7473b1a 100644 --- a/functions/asJsonArray.html +++ b/functions/asJsonArray.html @@ -1,6 +1,6 @@ -asJsonArray | @salesforce/ts-types
\ No newline at end of file +asJsonArray | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/asJsonMap.html b/functions/asJsonMap.html index 714da53d..a4799002 100644 --- a/functions/asJsonMap.html +++ b/functions/asJsonMap.html @@ -1,6 +1,6 @@ -asJsonMap | @salesforce/ts-types
\ No newline at end of file +asJsonMap | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/asNumber.html b/functions/asNumber.html index 2998f161..aa6e00b6 100644 --- a/functions/asNumber.html +++ b/functions/asNumber.html @@ -1,6 +1,6 @@ -asNumber | @salesforce/ts-types
  • Narrows an unknown value to a number if it is type-compatible, or returns undefined otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -

    Returns Optional<number>

  • Narrows an unknown value to a number if it is type-compatible, or returns the provided default otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -
    • defaultValue: number

      The default to return if value was undefined or of the incorrect type.

      -

    Returns number

\ No newline at end of file +asNumber | @salesforce/ts-types
  • Narrows an unknown value to a number if it is type-compatible, or returns undefined otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +

    Returns Optional<number>

  • Narrows an unknown value to a number if it is type-compatible, or returns the provided default otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +
    • defaultValue: number

      The default to return if value was undefined or of the incorrect type.

      +

    Returns number

\ No newline at end of file diff --git a/functions/asObject.html b/functions/asObject.html index c5365608..4440ab5d 100644 --- a/functions/asObject.html +++ b/functions/asObject.html @@ -1,6 +1,6 @@ -asObject | @salesforce/ts-types
  • Narrows an unknown value to an object if it is type-compatible, or returns undefined otherwise.

    -

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      -

    Returns Optional<T>

  • Narrows an unknown value to an object if it is type-compatible, or returns the provided default otherwise.

    -

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      -
    • defaultValue: T

      The default to return if value was undefined or of the incorrect type.

      -

    Returns T

\ No newline at end of file +asObject | @salesforce/ts-types
  • Narrows an unknown value to an object if it is type-compatible, or returns undefined otherwise.

    +

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      +

    Returns Optional<T>

  • Narrows an unknown value to an object if it is type-compatible, or returns the provided default otherwise.

    +

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      +
    • defaultValue: T

      The default to return if value was undefined or of the incorrect type.

      +

    Returns T

\ No newline at end of file diff --git a/functions/asPlainObject.html b/functions/asPlainObject.html index ed97c6f1..b1579bf6 100644 --- a/functions/asPlainObject.html +++ b/functions/asPlainObject.html @@ -1,6 +1,6 @@ -asPlainObject | @salesforce/ts-types

Function asPlainObject

  • Narrows an unknown value to a plain object if it is type-compatible, or returns undefined otherwise.

    -

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      -

    Returns Optional<T>

  • Narrows an unknown value to an object if it is type-compatible, or returns the provided default otherwise.

    -

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      -
    • defaultValue: T

      The default to return if value was undefined or of the incorrect type.

      -

    Returns T

\ No newline at end of file +asPlainObject | @salesforce/ts-types

Function asPlainObject

  • Narrows an unknown value to a plain object if it is type-compatible, or returns undefined otherwise.

    +

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      +

    Returns Optional<T>

  • Narrows an unknown value to an object if it is type-compatible, or returns the provided default otherwise.

    +

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      +
    • defaultValue: T

      The default to return if value was undefined or of the incorrect type.

      +

    Returns T

\ No newline at end of file diff --git a/functions/asString.html b/functions/asString.html index 572c83cd..b50bc293 100644 --- a/functions/asString.html +++ b/functions/asString.html @@ -1,6 +1,6 @@ -asString | @salesforce/ts-types
  • Narrows an unknown value to a string if it is type-compatible, or returns undefined otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -

    Returns Optional<string>

  • Narrows an unknown value to a string if it is type-compatible, or returns the provided default otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -
    • defaultValue: string

      The default to return if value was undefined or of the incorrect type.

      -

    Returns string

\ No newline at end of file +asString | @salesforce/ts-types
  • Narrows an unknown value to a string if it is type-compatible, or returns undefined otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +

    Returns Optional<string>

  • Narrows an unknown value to a string if it is type-compatible, or returns the provided default otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +
    • defaultValue: string

      The default to return if value was undefined or of the incorrect type.

      +

    Returns string

\ No newline at end of file diff --git a/functions/assert.html b/functions/assert.html index 1ab71088..6ca9475a 100644 --- a/functions/assert.html +++ b/functions/assert.html @@ -1,5 +1,5 @@ -assert | @salesforce/ts-types
  • Asserts that a given condition is true, or raises an error otherwise.

    -

    Parameters

    • condition: boolean

      The condition to test.

      -
    • Optional message: string

      The error message to use if the condition is false.

      -

    Returns asserts condition

    Throws

    AssertionFailedError If the assertion failed.

    -
\ No newline at end of file +assert | @salesforce/ts-types
  • Asserts that a given condition is true, or raises an error otherwise.

    +

    Parameters

    • condition: boolean

      The condition to test.

      +
    • Optional message: string

      The error message to use if the condition is false.

      +

    Returns asserts condition

    Throws

    AssertionFailedError If the assertion failed.

    +
\ No newline at end of file diff --git a/functions/assertAnyJson.html b/functions/assertAnyJson.html index 1d1b8cdc..549c4a83 100644 --- a/functions/assertAnyJson.html +++ b/functions/assertAnyJson.html @@ -1,6 +1,6 @@ -assertAnyJson | @salesforce/ts-types

Function assertAnyJson

\ No newline at end of file diff --git a/functions/assertArray.html b/functions/assertArray.html index dfbbb77d..74874a3f 100644 --- a/functions/assertArray.html +++ b/functions/assertArray.html @@ -1,5 +1,5 @@ -assertArray | @salesforce/ts-types
  • Narrows an unknown value to an Array if it is type-compatible, or raises an error otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -
    • Optional message: string

      The error message to use if value is not type-compatible.

      -

    Returns asserts value is AnyArray<unknown>

    Throws

    AssertionFailedError If the value was undefined.

    -
\ No newline at end of file +assertArray | @salesforce/ts-types
  • Narrows an unknown value to an Array if it is type-compatible, or raises an error otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +
    • Optional message: string

      The error message to use if value is not type-compatible.

      +

    Returns asserts value is AnyArray<unknown>

    Throws

    AssertionFailedError If the value was undefined.

    +
\ No newline at end of file diff --git a/functions/assertBoolean.html b/functions/assertBoolean.html index a3a8a70c..ba612786 100644 --- a/functions/assertBoolean.html +++ b/functions/assertBoolean.html @@ -1,5 +1,5 @@ -assertBoolean | @salesforce/ts-types

Function assertBoolean

  • Narrows an unknown value to a boolean if it is type-compatible, or raises an error otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -
    • Optional message: string

      The error message to use if value is not type-compatible.

      -

    Returns asserts value is boolean

    Throws

    AssertionFailedError If the value was undefined.

    -
\ No newline at end of file +assertBoolean | @salesforce/ts-types

Function assertBoolean

  • Narrows an unknown value to a boolean if it is type-compatible, or raises an error otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +
    • Optional message: string

      The error message to use if value is not type-compatible.

      +

    Returns asserts value is boolean

    Throws

    AssertionFailedError If the value was undefined.

    +
\ No newline at end of file diff --git a/functions/assertDictionary.html b/functions/assertDictionary.html index 1ccf3a9f..485b7b6d 100644 --- a/functions/assertDictionary.html +++ b/functions/assertDictionary.html @@ -1,6 +1,6 @@ -assertDictionary | @salesforce/ts-types

Function assertDictionary

\ No newline at end of file diff --git a/functions/assertFunction.html b/functions/assertFunction.html index 38caa49a..790b22d1 100644 --- a/functions/assertFunction.html +++ b/functions/assertFunction.html @@ -1,5 +1,5 @@ -assertFunction | @salesforce/ts-types

Function assertFunction

  • Narrows an unknown value to an AnyFunction if it is type-compatible, or raises an error otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -
    • Optional message: string

      The error message to use if value is not type-compatible.

      -

    Returns asserts value is AnyFunction<unknown>

    Throws

    AssertionFailedError If the value was undefined.

    -
\ No newline at end of file +assertFunction | @salesforce/ts-types

Function assertFunction

  • Narrows an unknown value to an AnyFunction if it is type-compatible, or raises an error otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +
    • Optional message: string

      The error message to use if value is not type-compatible.

      +

    Returns asserts value is AnyFunction<unknown>

    Throws

    AssertionFailedError If the value was undefined.

    +
\ No newline at end of file diff --git a/functions/assertInstance.html b/functions/assertInstance.html index 35dca505..4b13200b 100644 --- a/functions/assertInstance.html +++ b/functions/assertInstance.html @@ -1,6 +1,6 @@ -assertInstance | @salesforce/ts-types

Function assertInstance

\ No newline at end of file diff --git a/functions/assertJsonArray.html b/functions/assertJsonArray.html index c977b1e6..3b34f50c 100644 --- a/functions/assertJsonArray.html +++ b/functions/assertJsonArray.html @@ -1,5 +1,5 @@ -assertJsonArray | @salesforce/ts-types

Function assertJsonArray

  • Narrows an AnyJson value to a JsonArray if it is type-compatible, or raises an error otherwise.

    -

    Parameters

    • value: Optional<AnyJson>

      The value to test.

      -
    • Optional message: string

      The error message to use if value is not type-compatible.

      -

    Returns asserts value is JsonArray

    Throws

    AssertionFailedError If the value was undefined.

    -
\ No newline at end of file +assertJsonArray | @salesforce/ts-types

Function assertJsonArray

  • Narrows an AnyJson value to a JsonArray if it is type-compatible, or raises an error otherwise.

    +

    Parameters

    • value: Optional<AnyJson>

      The value to test.

      +
    • Optional message: string

      The error message to use if value is not type-compatible.

      +

    Returns asserts value is JsonArray

    Throws

    AssertionFailedError If the value was undefined.

    +
\ No newline at end of file diff --git a/functions/assertJsonMap.html b/functions/assertJsonMap.html index 76766d2f..0f381d98 100644 --- a/functions/assertJsonMap.html +++ b/functions/assertJsonMap.html @@ -1,5 +1,5 @@ -assertJsonMap | @salesforce/ts-types

Function assertJsonMap

  • Narrows an AnyJson value to a JsonMap if it is type-compatible, or raises an error otherwise.

    -

    Parameters

    • value: Optional<AnyJson>

      The value to test.

      -
    • Optional message: string

      The error message to use if value is not type-compatible.

      -

    Returns asserts value is JsonMap

    Throws

    AssertionFailedError If the value was undefined.

    -
\ No newline at end of file +assertJsonMap | @salesforce/ts-types

Function assertJsonMap

  • Narrows an AnyJson value to a JsonMap if it is type-compatible, or raises an error otherwise.

    +

    Parameters

    • value: Optional<AnyJson>

      The value to test.

      +
    • Optional message: string

      The error message to use if value is not type-compatible.

      +

    Returns asserts value is JsonMap

    Throws

    AssertionFailedError If the value was undefined.

    +
\ No newline at end of file diff --git a/functions/assertNonNull.html b/functions/assertNonNull.html index 20f0eb29..96a76b8f 100644 --- a/functions/assertNonNull.html +++ b/functions/assertNonNull.html @@ -1,4 +1,4 @@ -assertNonNull | @salesforce/ts-types

Function assertNonNull

  • Narrows a type Nullable<T> to a T or raises an error.

    +assertNonNull | @salesforce/ts-types

    Function assertNonNull

    • Narrows a type Nullable<T> to a T or raises an error.

      Use of the type parameter T to further narrow the type signature of the value being tested is strongly discouraged unless you are completely confident that the value is of the necessary shape to conform with T. This function does nothing at either compile time or runtime to prove the value is of @@ -6,7 +6,7 @@ bad practice unless you have performed some other due diligence in proving that the value must be of shape T. Use of the functions in the has co-library are useful for performing such full or partial proofs.

      -

      Type Parameters

      • T = unknown

      Parameters

      • value: Nullable<T>

        The value to test.

        -
      • Optional message: string

        The error message to use if value is undefined or null.

        -

      Returns asserts value is T

      Throws

      AssertionFailedError If the value was undefined.

      -
    \ No newline at end of file +

    Type Parameters

    • T = unknown

    Parameters

    • value: Nullable<T>

      The value to test.

      +
    • Optional message: string

      The error message to use if value is undefined or null.

      +

    Returns asserts value is T

    Throws

    AssertionFailedError If the value was undefined.

    +
\ No newline at end of file diff --git a/functions/assertNumber.html b/functions/assertNumber.html index 6f750a8c..b7a1b2a3 100644 --- a/functions/assertNumber.html +++ b/functions/assertNumber.html @@ -1,5 +1,5 @@ -assertNumber | @salesforce/ts-types
  • Narrows an unknown value to a number if it is type-compatible, or raises an error otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -
    • Optional message: string

      The error message to use if value is not type-compatible.

      -

    Returns asserts value is number

    Throws

    AssertionFailedError If the value was undefined.

    -
\ No newline at end of file +assertNumber | @salesforce/ts-types
  • Narrows an unknown value to a number if it is type-compatible, or raises an error otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +
    • Optional message: string

      The error message to use if value is not type-compatible.

      +

    Returns asserts value is number

    Throws

    AssertionFailedError If the value was undefined.

    +
\ No newline at end of file diff --git a/functions/assertObject.html b/functions/assertObject.html index addc69ff..2d12a53b 100644 --- a/functions/assertObject.html +++ b/functions/assertObject.html @@ -1,5 +1,5 @@ -assertObject | @salesforce/ts-types
  • Narrows an unknown value to an object if it is type-compatible, or raises an error otherwise.

    -

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      -
    • Optional message: string

      The error message to use if value is not type-compatible.

      -

    Returns asserts value is T

    Throws

    AssertionFailedError If the value was undefined.

    -
\ No newline at end of file +assertObject | @salesforce/ts-types
  • Narrows an unknown value to an object if it is type-compatible, or raises an error otherwise.

    +

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      +
    • Optional message: string

      The error message to use if value is not type-compatible.

      +

    Returns asserts value is T

    Throws

    AssertionFailedError If the value was undefined.

    +
\ No newline at end of file diff --git a/functions/assertPlainObject.html b/functions/assertPlainObject.html index cc5227d8..4b4c4ed5 100644 --- a/functions/assertPlainObject.html +++ b/functions/assertPlainObject.html @@ -1,6 +1,6 @@ -assertPlainObject | @salesforce/ts-types

Function assertPlainObject

\ No newline at end of file diff --git a/functions/assertString.html b/functions/assertString.html index e455e249..faab435e 100644 --- a/functions/assertString.html +++ b/functions/assertString.html @@ -1,5 +1,5 @@ -assertString | @salesforce/ts-types
  • Narrows an unknown value to a string if it is type-compatible, or raises an error otherwise.

    -

    Parameters

    • value: unknown

      The value to test.

      -
    • Optional message: string

      The error message to use if value is not type-compatible.

      -

    Returns asserts value is string

    Throws

    AssertionFailedError If the value was undefined.

    -
\ No newline at end of file +assertString | @salesforce/ts-types
  • Narrows an unknown value to a string if it is type-compatible, or raises an error otherwise.

    +

    Parameters

    • value: unknown

      The value to test.

      +
    • Optional message: string

      The error message to use if value is not type-compatible.

      +

    Returns asserts value is string

    Throws

    AssertionFailedError If the value was undefined.

    +
\ No newline at end of file diff --git a/functions/coerceAnyJson.html b/functions/coerceAnyJson.html index b4196a27..563ec9ab 100644 --- a/functions/coerceAnyJson.html +++ b/functions/coerceAnyJson.html @@ -1,10 +1,10 @@ -coerceAnyJson | @salesforce/ts-types

Function coerceAnyJson

\ No newline at end of file diff --git a/functions/coerceJsonArray.html b/functions/coerceJsonArray.html index 65176735..44a4cdcd 100644 --- a/functions/coerceJsonArray.html +++ b/functions/coerceJsonArray.html @@ -1,12 +1,12 @@ -coerceJsonArray | @salesforce/ts-types

Function coerceJsonArray

\ No newline at end of file diff --git a/functions/coerceJsonMap.html b/functions/coerceJsonMap.html index 80a91d11..c823791f 100644 --- a/functions/coerceJsonMap.html +++ b/functions/coerceJsonMap.html @@ -1,12 +1,12 @@ -coerceJsonMap | @salesforce/ts-types

Function coerceJsonMap

  • Narrows an object of type T to a JsonMap using a shallow type-compatibility check. Use this when the source of +coerceJsonMap | @salesforce/ts-types

    Function coerceJsonMap

    • Narrows an object of type T to a JsonMap using a shallow type-compatibility check. Use this when the source of the object is known to be JSON-compatible and you want simple type coercion to a JsonMap. Use toJsonMap instead when the value object cannot be guaranteed to be JSON-compatible and you want an assurance of runtime type safety. This is a shortcut for writing asJsonMap(coerceAnyJson(value)).

      -

      Type Parameters

      • T extends object

      Parameters

      • value: Nullable<T>

        The object to coerce.

        -

      Returns Optional<JsonMap>

    • Narrows an object of type T to a JsonMap using a shallow type-compatibility check. Use this when the source of +

      Type Parameters

      • T extends object

      Parameters

      Returns Optional<JsonMap>

    • Narrows an object of type T to a JsonMap using a shallow type-compatibility check. Use this when the source of the object is known to be JSON-compatible and you want simple type coercion to a JsonMap. Use toJsonMap instead when the value object cannot be guaranteed to be JSON-compatible and you want an assurance of runtime type safety. This is a shortcut for writing asJsonMap(coerceAnyJson(value)) ?? defaultValue.

      -

      Type Parameters

      • T extends object

      Parameters

      • value: Nullable<T>

        The object to coerce.

        -
      • defaultValue: JsonMap

        The default to return if value was not defined.

        -

      Returns JsonMap

    \ No newline at end of file +

    Type Parameters

    • T extends object

    Parameters

    • value: Nullable<T>

      The object to coerce.

      +
    • defaultValue: JsonMap

      The default to return if value was not defined.

      +

    Returns JsonMap

\ No newline at end of file diff --git a/functions/definiteEntriesOf.html b/functions/definiteEntriesOf.html index 9b55aa61..3a4caef1 100644 --- a/functions/definiteEntriesOf.html +++ b/functions/definiteEntriesOf.html @@ -1,7 +1,7 @@ -definiteEntriesOf | @salesforce/ts-types

Function definiteEntriesOf

\ No newline at end of file diff --git a/functions/definiteKeysOf.html b/functions/definiteKeysOf.html index 0a3058f1..ba3ff2a3 100644 --- a/functions/definiteKeysOf.html +++ b/functions/definiteKeysOf.html @@ -1,5 +1,5 @@ -definiteKeysOf | @salesforce/ts-types

Function definiteKeysOf

\ No newline at end of file diff --git a/functions/definiteValuesOf.html b/functions/definiteValuesOf.html index 2aeb5635..ab5dec20 100644 --- a/functions/definiteValuesOf.html +++ b/functions/definiteValuesOf.html @@ -1,5 +1,5 @@ -definiteValuesOf | @salesforce/ts-types

Function definiteValuesOf

\ No newline at end of file diff --git a/functions/ensure.html b/functions/ensure.html index ffd38292..926f1b5c 100644 --- a/functions/ensure.html +++ b/functions/ensure.html @@ -1,4 +1,4 @@ -ensure | @salesforce/ts-types
  • Narrows a type Nullable<T> to a T or raises an error.

    +ensure | @salesforce/ts-types
    • Narrows a type Nullable<T> to a T or raises an error.

      Use of the type parameter T to further narrow the type signature of the value being tested is strongly discouraged unless you are completely confident that the value is of the necessary shape to conform with T. This function does nothing at either compile time or runtime to prove the value is of @@ -6,7 +6,7 @@ bad practice unless you have performed some other due diligence in proving that the value must be of shape T. Use of the functions in the has co-library are useful for performing such full or partial proofs.

      -

      Type Parameters

      • T = unknown

      Parameters

      • value: Nullable<T>

        The value to test.

        -
      • Optional message: string

        The error message to use if value is undefined or null.

        -

      Returns T

      Throws

      UnexpectedValueTypeError If the value was undefined.

      -
    \ No newline at end of file +

    Type Parameters

    • T = unknown

    Parameters

    • value: Nullable<T>

      The value to test.

      +
    • Optional message: string

      The error message to use if value is undefined or null.

      +

    Returns T

    Throws

    UnexpectedValueTypeError If the value was undefined.

    +
\ No newline at end of file diff --git a/functions/ensureAnyJson.html b/functions/ensureAnyJson.html index 9b46579c..4fde8d63 100644 --- a/functions/ensureAnyJson.html +++ b/functions/ensureAnyJson.html @@ -1,6 +1,6 @@ -ensureAnyJson | @salesforce/ts-types

Function ensureAnyJson

\ No newline at end of file diff --git a/functions/ensureArray.html b/functions/ensureArray.html index 3d9b5d94..9065ebc5 100644 --- a/functions/ensureArray.html +++ b/functions/ensureArray.html @@ -1,5 +1,5 @@ -ensureArray | @salesforce/ts-types
  • Narrows an unknown value to an Array if it is type-compatible, or raises an error otherwise.

    -

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      -
    • Optional message: string

      The error message to use if value is not type-compatible.

      -

    Returns T[]

    Throws

    UnexpectedValueTypeError If the value was undefined.

    -
\ No newline at end of file +ensureArray | @salesforce/ts-types
  • Narrows an unknown value to an Array if it is type-compatible, or raises an error otherwise.

    +

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      +
    • Optional message: string

      The error message to use if value is not type-compatible.

      +

    Returns T[]

    Throws

    UnexpectedValueTypeError If the value was undefined.

    +
\ No newline at end of file diff --git a/functions/ensureBoolean.html b/functions/ensureBoolean.html index e8f0333d..c6581bc7 100644 --- a/functions/ensureBoolean.html +++ b/functions/ensureBoolean.html @@ -1,5 +1,5 @@ -ensureBoolean | @salesforce/ts-types

Function ensureBoolean

\ No newline at end of file diff --git a/functions/ensureDictionary.html b/functions/ensureDictionary.html index 95a72f19..a854cc46 100644 --- a/functions/ensureDictionary.html +++ b/functions/ensureDictionary.html @@ -1,6 +1,6 @@ -ensureDictionary | @salesforce/ts-types

Function ensureDictionary

\ No newline at end of file diff --git a/functions/ensureFunction.html b/functions/ensureFunction.html index 420e069c..90c89816 100644 --- a/functions/ensureFunction.html +++ b/functions/ensureFunction.html @@ -1,5 +1,5 @@ -ensureFunction | @salesforce/ts-types

Function ensureFunction

\ No newline at end of file diff --git a/functions/ensureInstance.html b/functions/ensureInstance.html index f4e66480..151bc1bb 100644 --- a/functions/ensureInstance.html +++ b/functions/ensureInstance.html @@ -1,6 +1,6 @@ -ensureInstance | @salesforce/ts-types

Function ensureInstance

\ No newline at end of file diff --git a/functions/ensureJsonArray.html b/functions/ensureJsonArray.html index 3ce068fa..4472e3a0 100644 --- a/functions/ensureJsonArray.html +++ b/functions/ensureJsonArray.html @@ -1,5 +1,5 @@ -ensureJsonArray | @salesforce/ts-types

Function ensureJsonArray

\ No newline at end of file diff --git a/functions/ensureJsonMap.html b/functions/ensureJsonMap.html index 04089d81..01ff3572 100644 --- a/functions/ensureJsonMap.html +++ b/functions/ensureJsonMap.html @@ -1,5 +1,5 @@ -ensureJsonMap | @salesforce/ts-types

Function ensureJsonMap

\ No newline at end of file diff --git a/functions/ensureNumber.html b/functions/ensureNumber.html index 7ac3dc4b..47feb02a 100644 --- a/functions/ensureNumber.html +++ b/functions/ensureNumber.html @@ -1,5 +1,5 @@ -ensureNumber | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/ensureObject.html b/functions/ensureObject.html index c291c7fe..12ab4785 100644 --- a/functions/ensureObject.html +++ b/functions/ensureObject.html @@ -1,5 +1,5 @@ -ensureObject | @salesforce/ts-types
  • Narrows an unknown value to an object if it is type-compatible, or raises an error otherwise.

    -

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      -
    • Optional message: string

      The error message to use if value is not type-compatible.

      -

    Returns T

    Throws

    UnexpectedValueTypeError If the value was undefined.

    -
\ No newline at end of file +ensureObject | @salesforce/ts-types
  • Narrows an unknown value to an object if it is type-compatible, or raises an error otherwise.

    +

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      +
    • Optional message: string

      The error message to use if value is not type-compatible.

      +

    Returns T

    Throws

    UnexpectedValueTypeError If the value was undefined.

    +
\ No newline at end of file diff --git a/functions/ensurePlainObject.html b/functions/ensurePlainObject.html index 06b41a2d..5b2f71ff 100644 --- a/functions/ensurePlainObject.html +++ b/functions/ensurePlainObject.html @@ -1,6 +1,6 @@ -ensurePlainObject | @salesforce/ts-types

Function ensurePlainObject

\ No newline at end of file diff --git a/functions/ensureString.html b/functions/ensureString.html index d48c5620..eb941ae4 100644 --- a/functions/ensureString.html +++ b/functions/ensureString.html @@ -1,5 +1,5 @@ -ensureString | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/entriesOf.html b/functions/entriesOf.html index 77bf55eb..aac2cea5 100644 --- a/functions/entriesOf.html +++ b/functions/entriesOf.html @@ -1,4 +1,4 @@ -entriesOf | @salesforce/ts-types
  • Returns the entries of an object of type T. This is like Object.entries except the return type +entriesOf | @salesforce/ts-types

    • Returns the entries of an object of type T. This is like Object.entries except the return type captures the known keys and value types of T.

      Note that it is the responsibility of the caller to use this wisely -- there are cases where the runtime set of entries returned may be broader than the type checked set at compile time, @@ -10,5 +10,5 @@ of simple data objects with known properties.

      interface Point { x: number; y: number; }
      const point: Point = { x: 1, y: 2 };
      // type of entries -> ['x' | 'y', number][]
      const entries = entriesOf(point);
      for (const entry of entries) {
      console.log(entry[0], entry[1]);
      }
      // x 1
      // y 2
      -

      Type Parameters

      • T extends object

      • K extends string

      Parameters

      • obj: Nullable<T>

        The object of interest.

        -

      Returns [K, T[K]][]

    \ No newline at end of file +

    Type Parameters

    • T extends object
    • K extends string

    Parameters

    Returns [K, T[K]][]

\ No newline at end of file diff --git a/functions/get.html b/functions/get.html index 895bd7f9..6cc80b6a 100644 --- a/functions/get.html +++ b/functions/get.html @@ -1,7 +1,7 @@ -get | @salesforce/ts-types
  • Given a deep-search query path, returns an object property or array value of an object or array.

    +get | @salesforce/ts-types
    • Given a deep-search query path, returns an object property or array value of an object or array.

      const obj = { foo: { bar: ['baz'] } };
      const value = get(obj, 'foo.bar[0]');
      // type of value -> unknown; value === 'baz'

      const value = get(obj, 'foo.bar.nothing', 'default');
      // type of value -> unknown; value === 'default'

      const value = get(obj, 'foo["bar"][0]');
      // type of value -> unknown; value === 'baz'

      const arr = [obj];
      const value = get(arr, '[0].foo.bar[0]');
      // type of value -> unknown; value === 'baz'
      -

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -
      • Optional defaultValue: unknown

        The default to return if the query result was not defined.

        -

      Returns unknown

    \ No newline at end of file +

    Parameters

    • from: unknown

      Any value to query.

      +
    • path: string

      The query path.

      +
    • Optional defaultValue: unknown

      The default to return if the query result was not defined.

      +

    Returns unknown

\ No newline at end of file diff --git a/functions/getAnyJson.html b/functions/getAnyJson.html index 4a69be2e..a3b9e3b2 100644 --- a/functions/getAnyJson.html +++ b/functions/getAnyJson.html @@ -1,15 +1,15 @@ -getAnyJson | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/getArray.html b/functions/getArray.html index ca84970f..960693d3 100644 --- a/functions/getArray.html +++ b/functions/getArray.html @@ -1,14 +1,14 @@ -getArray | @salesforce/ts-types
  • Given a deep-search query path, returns an object property or array value of an object or array as an +getArray | @salesforce/ts-types

    • Given a deep-search query path, returns an object property or array value of an object or array as an AnyArray, or undefined if a value was not found or was not type-compatible.

      const obj = { foo: { bar: [1, 2, 3] } };
      const value = getArray(obj, 'foo.bar');
      // type of value -> AnyArray; value -> [1, 2, 3]
      -

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -

      Returns Nullable<AnyArray>

    • Given a deep-search query path, returns an object property or array value of an object or array as an +

      Parameters

      • from: unknown

        Any value to query.

        +
      • path: string

        The query path.

        +

      Returns Nullable<AnyArray>

    • Given a deep-search query path, returns an object property or array value of an object or array as an AnyArray, or undefined if a value was not found or was not type-compatible.

      const obj = { foo: { bar: [1, 2, 3] } };
      const value = getArray(obj, 'foo.baz', [4, 5, 6]);
      // type of value -> AnyArray; value -> [4, 5, 6]
      -

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -
      • defaultValue: AnyArray<unknown>

        The default to return if the query result was not defined.

        -

      Returns AnyArray

    \ No newline at end of file +

    Parameters

    • from: unknown

      Any value to query.

      +
    • path: string

      The query path.

      +
    • defaultValue: AnyArray<unknown>

      The default to return if the query result was not defined.

      +

    Returns AnyArray

\ No newline at end of file diff --git a/functions/getBoolean.html b/functions/getBoolean.html index 31301c86..a293eba8 100644 --- a/functions/getBoolean.html +++ b/functions/getBoolean.html @@ -1,14 +1,14 @@ -getBoolean | @salesforce/ts-types
  • Given a deep-search query path, returns an object property or array value of an object or array as a boolean, or +getBoolean | @salesforce/ts-types

    • Given a deep-search query path, returns an object property or array value of an object or array as a boolean, or undefined if a value was not found or was not type-compatible.

      const obj = { foo: { bar: [true] } };
      const value = getBoolean(obj, 'foo.bar[0]');
      // type of value -> boolean; value -> true
      -

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -

      Returns Nullable<boolean>

    • Given a deep-search query path, returns an object property or array value of an object or array as a boolean, or +

      Parameters

      • from: unknown

        Any value to query.

        +
      • path: string

        The query path.

        +

      Returns Nullable<boolean>

    • Given a deep-search query path, returns an object property or array value of an object or array as a boolean, or undefined if a value was not found or was not type-compatible.

      const obj = { foo: { bar: [true] } };
      const value = getBoolean(obj, 'foo.bar[1]', false);
      // type of value -> boolean; value -> false
      -

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -
      • defaultValue: boolean

        The default to return if the query result was not defined.

        -

      Returns boolean

    \ No newline at end of file +

    Parameters

    • from: unknown

      Any value to query.

      +
    • path: string

      The query path.

      +
    • defaultValue: boolean

      The default to return if the query result was not defined.

      +

    Returns boolean

\ No newline at end of file diff --git a/functions/getDictionary.html b/functions/getDictionary.html index e8c91943..62705636 100644 --- a/functions/getDictionary.html +++ b/functions/getDictionary.html @@ -1,14 +1,14 @@ -getDictionary | @salesforce/ts-types

Function getDictionary

  • Given a deep-search query path, returns an object property or array value of an object or array as a Dictionary<T>, or +getDictionary | @salesforce/ts-types

    Function getDictionary

    • Given a deep-search query path, returns an object property or array value of an object or array as a Dictionary<T>, or undefined if a value was not found or was not type-compatible.

      const obj = { foo: { bar: [{ name: 'baz' }] } };
      const value = getDictionary<string>(obj, 'foo.bar[0]');
      // type of value -> Dictionary<string>; value -> { name: 'baz' }
      -

      Type Parameters

      • T = unknown

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -

      Returns Nullable<Dictionary<T>>

    • Given a deep-search query path, returns an object property or array value of an object or array as an Dictionary<T>, or +

      Type Parameters

      • T = unknown

      Parameters

      • from: unknown

        Any value to query.

        +
      • path: string

        The query path.

        +

      Returns Nullable<Dictionary<T>>

    • Given a deep-search query path, returns an object property or array value of an object or array as an Dictionary<T>, or undefined if a value was not found or was not type-compatible.

      const obj = { foo: { bar: [{ name: 'baz' }] } };
      const value = getDictionary<string>(obj, 'foo.bar[1]', { name: 'buzz' });
      // type of value -> Dictionary<string>; value -> { name: 'buzz' }
      -

      Type Parameters

      • T = unknown

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -
      • defaultValue: Dictionary<T>

        The default to return if the query result was not defined.

        -

      Returns Dictionary<T>

    \ No newline at end of file +

    Type Parameters

    • T = unknown

    Parameters

    • from: unknown

      Any value to query.

      +
    • path: string

      The query path.

      +
    • defaultValue: Dictionary<T>

      The default to return if the query result was not defined.

      +

    Returns Dictionary<T>

\ No newline at end of file diff --git a/functions/getFunction.html b/functions/getFunction.html index 29559061..a53a5ef4 100644 --- a/functions/getFunction.html +++ b/functions/getFunction.html @@ -1,14 +1,14 @@ -getFunction | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/getInstance.html b/functions/getInstance.html index 12fb19c5..14e3d955 100644 --- a/functions/getInstance.html +++ b/functions/getInstance.html @@ -1,14 +1,14 @@ -getInstance | @salesforce/ts-types
  • Given a deep-search query path, returns an object property or array value of an object or array as an instance of +getInstance | @salesforce/ts-types

    • Given a deep-search query path, returns an object property or array value of an object or array as an instance of class type C, or undefined if a value was not found or was not type-compatible.

      class Example { ... }
      const obj = { foo: { bar: [new Example()] } };
      const value = getInstance(obj, 'foo.bar[0]', Example);
      // type of value -> Example
      -

      Type Parameters

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -
      • ctor: C

      Returns Nullable<InstanceType<C>>

    • Given a deep-search query path, returns an object property or array value of an object or array as an instance of +

      Type Parameters

      Parameters

      • from: unknown

        Any value to query.

        +
      • path: string

        The query path.

        +
      • ctor: C

      Returns Nullable<InstanceType<C>>

    • Given a deep-search query path, returns an object property or array value of an object or array as an instance of class type C, or undefined if a value was not found or was not type-compatible.

      class Example { ... }
      const obj = { foo: { bar: [new Example()] } };
      const value = getInstance(obj, 'foo.bar[0]', Example);
      // type of value -> Example; value -> new Example()
      -

      Type Parameters

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -
      • ctor: C
      • defaultValue: InstanceType<C>

        The default to return if the query result was not defined.

        -

      Returns InstanceType<C>

    \ No newline at end of file +

    Type Parameters

    Parameters

    • from: unknown

      Any value to query.

      +
    • path: string

      The query path.

      +
    • ctor: C
    • defaultValue: InstanceType<C>

      The default to return if the query result was not defined.

      +

    Returns InstanceType<C>

\ No newline at end of file diff --git a/functions/getJsonArray.html b/functions/getJsonArray.html index bc8191d8..c2096f76 100644 --- a/functions/getJsonArray.html +++ b/functions/getJsonArray.html @@ -1,14 +1,14 @@ -getJsonArray | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/getJsonMap.html b/functions/getJsonMap.html index 695ee28f..9df7e94a 100644 --- a/functions/getJsonMap.html +++ b/functions/getJsonMap.html @@ -1,14 +1,14 @@ -getJsonMap | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/getNumber.html b/functions/getNumber.html index a2156aaa..cedf4ae0 100644 --- a/functions/getNumber.html +++ b/functions/getNumber.html @@ -1,14 +1,14 @@ -getNumber | @salesforce/ts-types
  • Given a deep-search query path, returns an object property or array value of an object or array as a number, or +getNumber | @salesforce/ts-types

    • Given a deep-search query path, returns an object property or array value of an object or array as a number, or undefined if a value was not found or was not type-compatible.

      const obj = { foo: { bar: [1] } };
      const value = getNumber(obj, 'foo.bar[0]');
      // type of value -> number; value -> 1
      -

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -

      Returns Nullable<number>

    • Given a deep-search query path, returns an object property or array value of an object or array as a number, or +

      Parameters

      • from: unknown

        Any value to query.

        +
      • path: string

        The query path.

        +

      Returns Nullable<number>

    • Given a deep-search query path, returns an object property or array value of an object or array as a number, or undefined if a value was not found or was not type-compatible.

      const obj = { foo: { bar: [1] } };
      const value = getNumber(obj, 'foo.bar[1]', 2);
      // type of value -> number; value -> 2
      -

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -
      • defaultValue: number

        The default to return if the query result was not defined.

        -

      Returns number

    \ No newline at end of file +

    Parameters

    • from: unknown

      Any value to query.

      +
    • path: string

      The query path.

      +
    • defaultValue: number

      The default to return if the query result was not defined.

      +

    Returns number

\ No newline at end of file diff --git a/functions/getObject.html b/functions/getObject.html index 5530eb43..c06acd81 100644 --- a/functions/getObject.html +++ b/functions/getObject.html @@ -1,14 +1,14 @@ -getObject | @salesforce/ts-types
  • Given a deep-search query path, returns an object property or array value of an object or array as an object, or +getObject | @salesforce/ts-types

    • Given a deep-search query path, returns an object property or array value of an object or array as an object, or undefined if a value was not found or was not type-compatible.

      const obj = { foo: { bar: [{ name: 'baz' }] } };
      const value = getObject(obj, 'foo.bar[0]');
      // type of value -> object; value -> { name: 'baz' }
      -

      Type Parameters

      • T extends object = object

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -

      Returns Nullable<T>

    • Given a deep-search query path, returns an object property or array value of an object or array as an object, or +

      Type Parameters

      • T extends object = object

      Parameters

      • from: unknown

        Any value to query.

        +
      • path: string

        The query path.

        +

      Returns Nullable<T>

    • Given a deep-search query path, returns an object property or array value of an object or array as an object, or undefined if a value was not found or was not type-compatible.

      const obj = { foo: { bar: [{ name: 'baz' }] } };
      const value = getObject(obj, 'foo.bar[1]', { name: 'buzz' });
      // type of value -> object; value -> { name: 'buzz' }
      -

      Type Parameters

      • T extends object = object

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -
      • defaultValue: T

        The default to return if the query result was not defined.

        -

      Returns T

    \ No newline at end of file +

    Type Parameters

    • T extends object = object

    Parameters

    • from: unknown

      Any value to query.

      +
    • path: string

      The query path.

      +
    • defaultValue: T

      The default to return if the query result was not defined.

      +

    Returns T

\ No newline at end of file diff --git a/functions/getPlainObject.html b/functions/getPlainObject.html index dcb151bd..47b80736 100644 --- a/functions/getPlainObject.html +++ b/functions/getPlainObject.html @@ -1,16 +1,16 @@ -getPlainObject | @salesforce/ts-types

Function getPlainObject

  • Given a deep-search query path, returns an object property or array value of an object or array as an object, or +getPlainObject | @salesforce/ts-types

    Function getPlainObject

    • Given a deep-search query path, returns an object property or array value of an object or array as an object, or undefined if a value was not found or was not type-compatible. This differs from getObject by way of testing for the property value type compatibility using isPlainObject instead of isObject.

      const obj = { foo: { bar: [{ name: 'baz' }] } };
      const value = getPlainObject(obj, 'foo.bar[0]');
      // type of value -> object; value -> { name: 'baz' }
      -

      Type Parameters

      • T extends object = object

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -

      Returns Nullable<T>

    • Given a deep-search query path, returns an object property or array value of an object or array as an object, or +

      Type Parameters

      • T extends object = object

      Parameters

      • from: unknown

        Any value to query.

        +
      • path: string

        The query path.

        +

      Returns Nullable<T>

    • Given a deep-search query path, returns an object property or array value of an object or array as an object, or undefined if a value was not found or was not type-compatible. This differs from getObject by way of testing for the property value type compatibility using isPlainObject instead of isObject.

      const obj = { foo: { bar: [{ name: 'baz' }] } };
      const value = getPlainObject(obj, 'foo.bar[1]', { name: 'buzz' });
      // type of value -> object; value -> { name: 'buzz' }
      -

      Type Parameters

      • T extends object = object

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -
      • defaultValue: T

        The default to return if the query result was not defined.

        -

      Returns T

    \ No newline at end of file +

    Type Parameters

    • T extends object = object

    Parameters

    • from: unknown

      Any value to query.

      +
    • path: string

      The query path.

      +
    • defaultValue: T

      The default to return if the query result was not defined.

      +

    Returns T

\ No newline at end of file diff --git a/functions/getString.html b/functions/getString.html index 8e353ab5..62747788 100644 --- a/functions/getString.html +++ b/functions/getString.html @@ -1,14 +1,14 @@ -getString | @salesforce/ts-types
  • Given a deep-search query path, returns an object property or array value of an object or array as a string, or +getString | @salesforce/ts-types

    • Given a deep-search query path, returns an object property or array value of an object or array as a string, or undefined if a value was not found or was not type-compatible.

      const obj = { foo: { bar: ['baz'] } };
      const value = getString(obj, 'foo.bar[0]');
      // type of value -> string; value -> 'baz'
      -

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -

      Returns Nullable<string>

    • Given a deep-search query path, returns an object property or array value of an object or array as a string, or +

      Parameters

      • from: unknown

        Any value to query.

        +
      • path: string

        The query path.

        +

      Returns Nullable<string>

    • Given a deep-search query path, returns an object property or array value of an object or array as a string, or undefined if a value was not found or was not type-compatible.

      const obj = { foo: { bar: ['baz'] } };
      const value = getString(obj, 'foo.bar[1]', 'default');
      // type of value -> string; value -> 'default'
      -

      Parameters

      • from: unknown

        Any value to query.

        -
      • path: string

        The query path.

        -
      • defaultValue: string

        The default to return if the query result was not defined.

        -

      Returns string

    \ No newline at end of file +

    Parameters

    • from: unknown

      Any value to query.

      +
    • path: string

      The query path.

      +
    • defaultValue: string

      The default to return if the query result was not defined.

      +

    Returns string

\ No newline at end of file diff --git a/functions/has.html b/functions/has.html index 352a9e7b..a8389574 100644 --- a/functions/has.html +++ b/functions/has.html @@ -1,9 +1,9 @@ -has | @salesforce/ts-types
  • Tests whether a value of type T contains one or more property keys. If so, the type of the tested value is +has | @salesforce/ts-types

    • Tests whether a value of type T contains one or more property keys. If so, the type of the tested value is narrowed to reflect the existence of those keys for convenient access in the same scope. Returns false if the property key does not exist on the target type, which must be an object. Returns true if the property key exists, even if the associated value is undefined or null.

      // type of obj -> unknown
      if (has(obj, 'name')) {
      // type of obj -> { name: unknown }
      if (has(obj, 'data')) {
      // type of obj -> { name: unknown } & { data: unknown }
      } else if (has(obj, ['error', 'status'])) {
      // type of obj -> { name: unknown } & { error: unknown, status: unknown }
      }
      }
      -

      Type Parameters

      • T

      • K extends string

      Parameters

      • value: T

        The value to test.

        -
      • keys: Many<K>

        One or more string keys to check for existence.

        -

      Returns value is T & object & View<K, unknown>

    \ No newline at end of file +

    Type Parameters

    • T
    • K extends string

    Parameters

    • value: T

      The value to test.

      +
    • keys: Many<K>

      One or more string keys to check for existence.

      +

    Returns value is T & object & View<K, unknown>

\ No newline at end of file diff --git a/functions/hasAnyJson.html b/functions/hasAnyJson.html index 9bfe608b..25402a59 100644 --- a/functions/hasAnyJson.html +++ b/functions/hasAnyJson.html @@ -1,9 +1,9 @@ -hasAnyJson | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/hasArray.html b/functions/hasArray.html index 0bf69e1d..a6ee37a5 100644 --- a/functions/hasArray.html +++ b/functions/hasArray.html @@ -1,7 +1,7 @@ -hasArray | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/hasBoolean.html b/functions/hasBoolean.html index 1832fbbf..6c4be103 100644 --- a/functions/hasBoolean.html +++ b/functions/hasBoolean.html @@ -1,7 +1,7 @@ -hasBoolean | @salesforce/ts-types
  • Tests whether a value of type T contains a property key of type boolean. If so, the type of the tested value is +hasBoolean | @salesforce/ts-types

    • Tests whether a value of type T contains a property key of type boolean. If so, the type of the tested value is narrowed to reflect the existence of that key for convenient access in the same scope. Returns false if the property key does not exist on the object or the value stored by that key is not of type boolean.

      // type of obj -> unknown
      if (hasBoolean(obj, 'enabled')) {
      // type of obj -> { enabled: boolean }
      if (hasBoolean(obj, 'hidden')) {
      // type of obj -> { enabled: boolean } & { hidden: boolean }
      }
      }
      -

      Type Parameters

      • T

      • K extends string

      Parameters

      • value: T

        The value to test.

        -
      • key: K

      Returns value is T & object & View<K, boolean>

    \ No newline at end of file +

    Type Parameters

    • T
    • K extends string

    Parameters

    • value: T

      The value to test.

      +
    • key: K

    Returns value is T & object & View<K, boolean>

\ No newline at end of file diff --git a/functions/hasDictionary.html b/functions/hasDictionary.html index 3bb64d7d..17cacd64 100644 --- a/functions/hasDictionary.html +++ b/functions/hasDictionary.html @@ -1,8 +1,8 @@ -hasDictionary | @salesforce/ts-types

Function hasDictionary

  • Tests whether a value of type T contains a property key whose type tests positively when tested with +hasDictionary | @salesforce/ts-types

    Function hasDictionary

    • Tests whether a value of type T contains a property key whose type tests positively when tested with isDictionary. If so, the type of the tested value is narrowed to reflect the existence of that key for convenient access in the same scope. Returns false if the property key does not exist on the object or the value stored by that key is not of type object.

      // type of obj -> unknown
      if (hasNumber(obj, 'status')) {
      // type of obj -> { status: number }
      if (hasDictionary(obj, 'data')) {
      // type of obj -> { status: number } & { data: Dictionary }
      } else if (hasString('error')) {
      // type of obj -> { status: number } & { error: string }
      }
      }
      -

      Type Parameters

      • V = unknown

      • T = unknown

      • K extends string = string

      Parameters

      • value: T

        The value to test.

        -
      • key: K

      Returns value is T & object & View<K, Dictionary<V>>

    \ No newline at end of file +

    Type Parameters

    • V = unknown
    • T = unknown
    • K extends string = string

    Parameters

    • value: T

      The value to test.

      +
    • key: K

    Returns value is T & object & View<K, Dictionary<V>>

\ No newline at end of file diff --git a/functions/hasFunction.html b/functions/hasFunction.html index 7ffd965f..c12becc0 100644 --- a/functions/hasFunction.html +++ b/functions/hasFunction.html @@ -1,8 +1,8 @@ -hasFunction | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/hasInstance.html b/functions/hasInstance.html index 6b49d07f..1f80546e 100644 --- a/functions/hasInstance.html +++ b/functions/hasInstance.html @@ -1,8 +1,8 @@ -hasInstance | @salesforce/ts-types
  • Tests whether a value of type T contains a property key whose type tests positively when tested with +hasInstance | @salesforce/ts-types

    • Tests whether a value of type T contains a property key whose type tests positively when tested with isInstance when compared with the given constructor type C. If so, the type of the tested value is narrowed to reflect the existence of that key for convenient access in the same scope. Returns false if the property key does not exist on the object or the value stored by that key is not an instance of C.

      class ServerResponse { ... }
      // type of obj -> unknown
      if (hasNumber(obj, 'status')) {
      // type of obj -> { status: number }
      if (hasInstance(obj, 'data', ServerResponse)) {
      // type of obj -> { status: number } & { data: ServerResponse }
      } else if (hasString('error')) {
      // type of obj -> { status: number } & { error: string }
      }
      }
      -

      Type Parameters

      Parameters

      • value: Optional<T>

        The value to test.

        -
      • key: K
      • ctor: C

      Returns value is T & View<K, InstanceType<C>>

    \ No newline at end of file +

    Type Parameters

    Parameters

    Returns value is T & View<K, InstanceType<C>>

\ No newline at end of file diff --git a/functions/hasJsonArray.html b/functions/hasJsonArray.html index 950f39da..e346b2b2 100644 --- a/functions/hasJsonArray.html +++ b/functions/hasJsonArray.html @@ -1,8 +1,8 @@ -hasJsonArray | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/hasJsonMap.html b/functions/hasJsonMap.html index 2145efdd..387af09f 100644 --- a/functions/hasJsonMap.html +++ b/functions/hasJsonMap.html @@ -1,8 +1,8 @@ -hasJsonMap | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/hasNumber.html b/functions/hasNumber.html index 911d9e36..4b4825a6 100644 --- a/functions/hasNumber.html +++ b/functions/hasNumber.html @@ -1,7 +1,7 @@ -hasNumber | @salesforce/ts-types
  • Tests whether a value of type T contains a property key of type number. If so, the type of the tested value is +hasNumber | @salesforce/ts-types

    • Tests whether a value of type T contains a property key of type number. If so, the type of the tested value is narrowed to reflect the existence of that key for convenient access in the same scope. Returns false if the property key does not exist on the object or the value stored by that key is not of type number.

      // type of obj -> unknown
      if (hasNumber(obj, 'offset')) {
      // type of obj -> { offset: number }
      if (hasNumber(obj, 'page') && hasArray(obj, 'items')) {
      // type of obj -> { offset: number } & { page: number } & { items: unknown[] }
      }
      }
      -

      Type Parameters

      • T

      • K extends string

      Parameters

      • value: T

        The value to test.

        -
      • key: K

      Returns value is T & object & View<K, number>

    \ No newline at end of file +

    Type Parameters

    • T
    • K extends string

    Parameters

    • value: T

      The value to test.

      +
    • key: K

    Returns value is T & object & View<K, number>

\ No newline at end of file diff --git a/functions/hasObject.html b/functions/hasObject.html index d3d00a2b..40b3c0fe 100644 --- a/functions/hasObject.html +++ b/functions/hasObject.html @@ -1,7 +1,7 @@ -hasObject | @salesforce/ts-types
  • Tests whether a value of type T contains a property key of type object. If so, the type of the tested value is +hasObject | @salesforce/ts-types

    • Tests whether a value of type T contains a property key of type object. If so, the type of the tested value is narrowed to reflect the existence of that key for convenient access in the same scope. Returns false if the property key does not exist on the object or the value stored by that key is not of type object.

      // type of obj -> unknown
      if (hasNumber(obj, 'status')) {
      // type of obj -> { status: number }
      if (hasObject(obj, 'data')) {
      // type of obj -> { status: number } & { data: object }
      } else if (hasString('error')) {
      // type of obj -> { status: number } & { error: string }
      }
      }
      -

      Type Parameters

      • V extends object = object

      • T = unknown

      • K extends string = string

      Parameters

      • value: T

        The value to test.

        -
      • key: K

      Returns value is T & object & View<K, V>

    \ No newline at end of file +

    Type Parameters

    • V extends object = object
    • T = unknown
    • K extends string = string

    Parameters

    • value: T

      The value to test.

      +
    • key: K

    Returns value is T & object & View<K, V>

\ No newline at end of file diff --git a/functions/hasPlainObject.html b/functions/hasPlainObject.html index c57d6500..43c42d92 100644 --- a/functions/hasPlainObject.html +++ b/functions/hasPlainObject.html @@ -1,8 +1,8 @@ -hasPlainObject | @salesforce/ts-types

Function hasPlainObject

  • Tests whether a value of type T contains a property key whose type tests positively when tested with +hasPlainObject | @salesforce/ts-types

    Function hasPlainObject

    • Tests whether a value of type T contains a property key whose type tests positively when tested with isPlainObject. If so, the type of the tested value is narrowed to reflect the existence of that key for convenient access in the same scope. Returns false if the property key does not exist on the object or the value stored by that key is not of type object.

      // type of obj -> unknown
      if (hasNumber(obj, 'status')) {
      // type of obj -> { status: number }
      if (hasPlainObject(obj, 'data')) {
      // type of obj -> { status: number } & { data: object }
      } else if (hasString('error')) {
      // type of obj -> { status: number } & { error: string }
      }
      }
      -

      Type Parameters

      • V extends object = object

      • T = unknown

      • K extends string = string

      Parameters

      • value: T

        The value to test.

        -
      • key: K

      Returns value is T & object & View<K, V>

    \ No newline at end of file +

    Type Parameters

    • V extends object = object
    • T = unknown
    • K extends string = string

    Parameters

    • value: T

      The value to test.

      +
    • key: K

    Returns value is T & object & View<K, V>

\ No newline at end of file diff --git a/functions/hasString.html b/functions/hasString.html index 7cce50b8..d99f29b7 100644 --- a/functions/hasString.html +++ b/functions/hasString.html @@ -1,7 +1,7 @@ -hasString | @salesforce/ts-types
  • Tests whether a value of type T contains a property key of type string. If so, the type of the tested value is +hasString | @salesforce/ts-types

    • Tests whether a value of type T contains a property key of type string. If so, the type of the tested value is narrowed to reflect the existence of that key for convenient access in the same scope. Returns false if the property key does not exist on the object or the value stored by that key is not of type string.

      // type of obj -> unknown
      if (hasString(obj, 'name')) {
      // type of obj -> { name: string }
      if (hasString(obj, 'message')) {
      // type of obj -> { name: string } & { message: string }
      }
      }
      -

      Type Parameters

      • T

      • K extends string

      Parameters

      • value: T

        The value to test.

        -
      • key: K

      Returns value is T & object & View<K, string>

    \ No newline at end of file +

    Type Parameters

    • T
    • K extends string

    Parameters

    • value: T

      The value to test.

      +
    • key: K

    Returns value is T & object & View<K, string>

\ No newline at end of file diff --git a/functions/isAnyJson.html b/functions/isAnyJson.html index 1c1e3f7d..d28437a4 100644 --- a/functions/isAnyJson.html +++ b/functions/isAnyJson.html @@ -1,4 +1,4 @@ -isAnyJson | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/isArray.html b/functions/isArray.html index 9f79ac7f..d011fce5 100644 --- a/functions/isArray.html +++ b/functions/isArray.html @@ -1,4 +1,4 @@ -isArray | @salesforce/ts-types
  • Tests whether an unknown value is an Array.

    +isArray | @salesforce/ts-types
    • Tests whether an unknown value is an Array.

      Use of the type parameter T to further narrow the type signature of the value being tested is strongly discouraged unless you are completely confident that the value is of the necessary shape to conform with T. This function does nothing at either compile time or runtime to prove the value is of @@ -6,5 +6,5 @@ bad practice unless you have performed some other due diligence in proving that the value must be of shape T. Use of the functions in the has co-library are useful for performing such full or partial proofs.

      -

      Type Parameters

      • T = unknown

      Parameters

      • value: unknown

        The value to test.

        -

      Returns value is T[]

    \ No newline at end of file +

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      +

    Returns value is T[]

\ No newline at end of file diff --git a/functions/isArrayLike.html b/functions/isArrayLike.html index f9378fc0..7437a55a 100644 --- a/functions/isArrayLike.html +++ b/functions/isArrayLike.html @@ -1,4 +1,4 @@ -isArrayLike | @salesforce/ts-types
  • Tests whether an unknown value conforms to AnyArrayLike.

    +isArrayLike | @salesforce/ts-types
    • Tests whether an unknown value conforms to AnyArrayLike.

      Use of the type parameter T to further narrow the type signature of the value being tested is strongly discouraged unless you are completely confident that the value is of the necessary shape to conform with T. This function does nothing at either compile time or runtime to prove the value is of @@ -6,5 +6,5 @@ bad practice unless you have performed some other due diligence in proving that the value must be of shape T. Use of the functions in the has co-library are useful for performing such full or partial proofs.

      -

      Type Parameters

      • T = unknown

      Parameters

      • value: unknown

        The value to test.

        -

      Returns value is ArrayLike<T>

    \ No newline at end of file +

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      +

    Returns value is ArrayLike<T>

\ No newline at end of file diff --git a/functions/isBoolean.html b/functions/isBoolean.html index 2480e2fa..1ce03637 100644 --- a/functions/isBoolean.html +++ b/functions/isBoolean.html @@ -1,3 +1,3 @@ -isBoolean | @salesforce/ts-types
  • Tests whether an unknown value is a boolean.

    -

    Parameters

    • value: unknown

      The value to test.

      -

    Returns value is boolean

\ No newline at end of file +isBoolean | @salesforce/ts-types
  • Tests whether an unknown value is a boolean.

    +

    Parameters

    • value: unknown

      The value to test.

      +

    Returns value is boolean

\ No newline at end of file diff --git a/functions/isClassAssignableTo.html b/functions/isClassAssignableTo.html index a5f38dd6..55275ede 100644 --- a/functions/isClassAssignableTo.html +++ b/functions/isClassAssignableTo.html @@ -1,5 +1,5 @@ -isClassAssignableTo | @salesforce/ts-types

Function isClassAssignableTo

\ No newline at end of file diff --git a/functions/isDictionary.html b/functions/isDictionary.html index 1551a06c..5d6eea06 100644 --- a/functions/isDictionary.html +++ b/functions/isDictionary.html @@ -1,4 +1,4 @@ -isDictionary | @salesforce/ts-types
  • A shortcut for testing the suitability of a value to be used as a Dictionary<T> type. Shorthand for +isDictionary | @salesforce/ts-types

    • A shortcut for testing the suitability of a value to be used as a Dictionary<T> type. Shorthand for writing isPlainObject<Dictionary<T>>(value). While some non-plain-object types are compatible with index signatures, they were less typically used as such, so this function focuses on the 80% case.

      Use of the type parameter T to further narrow the type signature of the value being tested is @@ -8,5 +8,5 @@ bad practice unless you have performed some other due diligence in proving that the value must be of shape T. Use of the functions in the has co-library are useful for performing such full or partial proofs.

      -

      Type Parameters

      • T = unknown

      Parameters

      • value: unknown

        The value to test.

        -

      Returns value is Dictionary<T>

    \ No newline at end of file +

    Type Parameters

    • T = unknown

    Parameters

    • value: unknown

      The value to test.

      +

    Returns value is Dictionary<T>

\ No newline at end of file diff --git a/functions/isFunction.html b/functions/isFunction.html index 23439516..db6f9a7b 100644 --- a/functions/isFunction.html +++ b/functions/isFunction.html @@ -1,3 +1,3 @@ -isFunction | @salesforce/ts-types
  • Tests whether an unknown value is a function.

    -

    Type Parameters

    Parameters

    • value: unknown

      The value to test.

      -

    Returns value is T

\ No newline at end of file +isFunction | @salesforce/ts-types
  • Tests whether an unknown value is a function.

    +

    Type Parameters

    Parameters

    • value: unknown

      The value to test.

      +

    Returns value is T

\ No newline at end of file diff --git a/functions/isInstance.html b/functions/isInstance.html index cd1afa42..062ff11d 100644 --- a/functions/isInstance.html +++ b/functions/isInstance.html @@ -1,3 +1,3 @@ -isInstance | @salesforce/ts-types
  • Tests whether an unknown value is a function.

    -

    Type Parameters

    Parameters

    • value: unknown

      The value to test.

      -
    • ctor: C

    Returns value is InstanceType<C>

\ No newline at end of file +isInstance | @salesforce/ts-types
  • Tests whether an unknown value is a function.

    +

    Type Parameters

    Parameters

    • value: unknown

      The value to test.

      +
    • ctor: C

    Returns value is InstanceType<C>

\ No newline at end of file diff --git a/functions/isJsonArray.html b/functions/isJsonArray.html index 44c8aa0d..bf90b726 100644 --- a/functions/isJsonArray.html +++ b/functions/isJsonArray.html @@ -1,3 +1,3 @@ -isJsonArray | @salesforce/ts-types
\ No newline at end of file +isJsonArray | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/isJsonMap.html b/functions/isJsonMap.html index 54f6aa05..de40de98 100644 --- a/functions/isJsonMap.html +++ b/functions/isJsonMap.html @@ -1,3 +1,3 @@ -isJsonMap | @salesforce/ts-types
\ No newline at end of file +isJsonMap | @salesforce/ts-types
\ No newline at end of file diff --git a/functions/isKeyOf.html b/functions/isKeyOf.html index b6b5f553..2ebe4841 100644 --- a/functions/isKeyOf.html +++ b/functions/isKeyOf.html @@ -1,4 +1,4 @@ -isKeyOf | @salesforce/ts-types
  • Tests whether or not a key string is a key of the given object type T.

    -

    Type Parameters

    • T extends object

    • K extends string

    Parameters

    • obj: T

      The target object to check the key in.

      -
    • key: string

      The string to test as a key of the target object.

      -

    Returns key is K

\ No newline at end of file +isKeyOf | @salesforce/ts-types
  • Tests whether or not a key string is a key of the given object type T.

    +

    Type Parameters

    • T extends object
    • K extends string

    Parameters

    • obj: T

      The target object to check the key in.

      +
    • key: string

      The string to test as a key of the target object.

      +

    Returns key is K

\ No newline at end of file diff --git a/functions/isNumber.html b/functions/isNumber.html index f0264bae..bc162f69 100644 --- a/functions/isNumber.html +++ b/functions/isNumber.html @@ -1,3 +1,3 @@ -isNumber | @salesforce/ts-types
  • Tests whether an unknown value is a number.

    -

    Parameters

    • value: unknown

      The value to test.

      -

    Returns value is number

\ No newline at end of file +isNumber | @salesforce/ts-types
  • Tests whether an unknown value is a number.

    +

    Parameters

    • value: unknown

      The value to test.

      +

    Returns value is number

\ No newline at end of file diff --git a/functions/isObject.html b/functions/isObject.html index d5562fa8..53aed85e 100644 --- a/functions/isObject.html +++ b/functions/isObject.html @@ -1,4 +1,4 @@ -isObject | @salesforce/ts-types
  • Tests whether an unknown value is an Object subtype (e.g., arrays, functions, objects, regexes, +isObject | @salesforce/ts-types

    • Tests whether an unknown value is an Object subtype (e.g., arrays, functions, objects, regexes, new Number(0), new String(''), and new Boolean(true)). Tests that wish to distinguish objects that were created from literals or that otherwise were not created via a non-Object constructor and do not have a prototype chain should instead use isPlainObject.

      @@ -9,5 +9,5 @@ bad practice unless you have performed some other due diligence in proving that the value must be of shape T. Use of the functions in the has co-library are useful for performing such full or partial proofs.

      -

      Type Parameters

      • T extends object = object

      Parameters

      • value: unknown

        The value to test.

        -

      Returns value is T

    \ No newline at end of file +

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      +

    Returns value is T

\ No newline at end of file diff --git a/functions/isPlainObject.html b/functions/isPlainObject.html index e2aa119a..5179abf2 100644 --- a/functions/isPlainObject.html +++ b/functions/isPlainObject.html @@ -1,4 +1,4 @@ -isPlainObject | @salesforce/ts-types

Function isPlainObject

  • Tests whether or not an unknown value is a plain JavaScript object. That is, if it is an object created +isPlainObject | @salesforce/ts-types

    Function isPlainObject

    • Tests whether or not an unknown value is a plain JavaScript object. That is, if it is an object created by the Object constructor or one with a null prototype.

      Use of the type parameter T to further narrow the type signature of the value being tested is strongly discouraged unless you are completely confident that the value is of the necessary shape to @@ -7,5 +7,5 @@ bad practice unless you have performed some other due diligence in proving that the value must be of shape T. Use of the functions in the has co-library are useful for performing such full or partial proofs.

      -

      Type Parameters

      • T extends object = object

      Parameters

      • value: unknown

        The value to test.

        -

      Returns value is T

    \ No newline at end of file +

    Type Parameters

    • T extends object = object

    Parameters

    • value: unknown

      The value to test.

      +

    Returns value is T

\ No newline at end of file diff --git a/functions/isString.html b/functions/isString.html index b9fb37a1..7efbeb1d 100644 --- a/functions/isString.html +++ b/functions/isString.html @@ -1,3 +1,3 @@ -isString | @salesforce/ts-types
  • Tests whether an unknown value is a string.

    -

    Parameters

    • value: unknown

      The value to test.

      -

    Returns value is string

\ No newline at end of file +isString | @salesforce/ts-types
  • Tests whether an unknown value is a string.

    +

    Parameters

    • value: unknown

      The value to test.

      +

    Returns value is string

\ No newline at end of file diff --git a/functions/keysOf.html b/functions/keysOf.html index 0c15b1e1..f60b463c 100644 --- a/functions/keysOf.html +++ b/functions/keysOf.html @@ -1,4 +1,4 @@ -keysOf | @salesforce/ts-types
  • Returns the keys of an object of type T. This is like Object.keys except the return type +keysOf | @salesforce/ts-types

    • Returns the keys of an object of type T. This is like Object.keys except the return type captures the known keys of T.

      Note that it is the responsibility of the caller to use this wisely -- there are cases where the runtime set of keys returned may be broader than the type checked set at compile time, @@ -10,5 +10,5 @@ of simple data objects with known properties.

      interface Point { x: number; y: number; }
      const point: Point = { x: 1, y: 2 };
      const keys = keysOf(point);
      // type of keys -> ('a' | 'b')[]
      for (const key of keys) {
      console.log(key, point[key]);
      }
      // x 1
      // y 2
      -

      Type Parameters

      • T extends object

      • K extends string

      Parameters

      • obj: Nullable<T>

        The object of interest.

        -

      Returns K[]

    \ No newline at end of file +

    Type Parameters

    • T extends object
    • K extends string

    Parameters

    Returns K[]

\ No newline at end of file diff --git a/functions/toAnyJson.html b/functions/toAnyJson.html index 09dd5a38..9183ee5c 100644 --- a/functions/toAnyJson.html +++ b/functions/toAnyJson.html @@ -1,20 +1,20 @@ -toAnyJson | @salesforce/ts-types
  • Narrows an object of type T to an AnyJson following a deep, brute-force conversion of the object's data to +toAnyJson | @salesforce/ts-types

    • Narrows an object of type T to an AnyJson following a deep, brute-force conversion of the object's data to only consist of JSON-compatible values by performing a basic JSON clone on the object. This is preferable to using the weaker coerceAnyJson(unknown) to type-narrow an arbitrary value to an AnyJson when the value's source is unknown, but it comes with the increased overhead of performing the deep JSON clone to ensure runtime type safety. The use of JSON cloning guarantees type safety by omitting non-JSON-compatible elements from the resulting JSON data structure. Use coerceAnyJson(unknown) when the value object can be guaranteed to be JSON-compatible and only needs type coercion.

      -

      Type Parameters

      • T

      Parameters

      • value: Nullable<T>

        The value to convert.

        +

        Type Parameters

        • T

        Parameters

        Returns Optional<AnyJson>

        Throws

        JsonCloneError If the value values contain circular references.

        -
      • Narrows an object of type T to an AnyJson following a deep, brute-force conversion of the object's data to +

      • Narrows an object of type T to an AnyJson following a deep, brute-force conversion of the object's data to only consist of JSON-compatible values by performing a basic JSON clone on the object. This is preferable to using the weaker coerceAnyJson(unknown) to type-narrow an arbitrary value to an AnyJson when the value's source is unknown, but it comes with the increased overhead of performing the deep JSON clone to ensure runtime type safety. The use of JSON cloning guarantees type safety by omitting non-JSON-compatible elements from the resulting JSON data structure. Use coerceAnyJson(unknown) when the value object can be guaranteed to be JSON-compatible and only needs type coercion.

        -

        Type Parameters

        • T

        Parameters

        • value: Nullable<T>

          The value to convert.

          -
        • defaultValue: AnyJson

          The default to return if value was not defined.

          +

          Type Parameters

          • T

          Parameters

          • value: Nullable<T>

            The value to convert.

            +
          • defaultValue: AnyJson

            The default to return if value was not defined.

          Returns AnyJson

          Throws

          JsonCloneError If the value values contain circular references.

          -
    \ No newline at end of file +
\ No newline at end of file diff --git a/functions/toJsonArray.html b/functions/toJsonArray.html index 1e78f4e6..2b00f23d 100644 --- a/functions/toJsonArray.html +++ b/functions/toJsonArray.html @@ -1,29 +1,29 @@ -toJsonArray | @salesforce/ts-types
  • Narrows an array of type T to a JsonArray following a deep, brute-force conversion of the array's data to +toJsonArray | @salesforce/ts-types

    • Narrows an array of type T to a JsonArray following a deep, brute-force conversion of the array's data to only consist of JSON-compatible values by performing a basic JSON clone on the array. This is preferable to using the weaker coerceJsonArray(array) to type-narrow an arbitrary array to a JsonArray when the array's source is unknown, but it comes with the increased overhead of performing the deep JSON clone to ensure runtime type safety. The use of JSON cloning guarantees type safety by omitting non-JSON-compatible elements from the resulting JSON data structure. Non-JSON entries will be converted to nulls. Use coerceJsonArray(array) when the value object can be guaranteed to be JSON-compatible and only needs type coercion.

      -

      Type Parameters

      • T

      Parameters

      • value: T[]

        The array to convert.

        +

        Type Parameters

        • T

        Parameters

        • value: T[]

          The array to convert.

        Returns JsonArray

        Throws

        JsonCloneError If the array values contain circular references.

        -
      • Narrows an array of type T to a JsonArray following a deep, brute-force conversion of the array's data to +

      • Narrows an array of type T to a JsonArray following a deep, brute-force conversion of the array's data to only consist of JSON-compatible values by performing a basic JSON clone on the array. This is preferable to using the weaker coerceJsonArray(array) to type-narrow an arbitrary array to a JsonArray when the array's source is unknown, but it comes with the increased overhead of performing the deep JSON clone to ensure runtime type safety. The use of JSON cloning guarantees type safety by omitting non-JSON-compatible elements from the resulting JSON data structure. Non-JSON entries will be converted to nulls. Use coerceJsonArray(array) when the value object can be guaranteed to be JSON-compatible and only needs type coercion.

        -

        Type Parameters

        • T

        Parameters

        • value: Optional<T[]>

          The array to convert.

          +

          Type Parameters

          • T

          Parameters

          Returns Optional<JsonArray>

          Throws

          JsonCloneError If the array values contain circular references.

          -
        • Narrows an object of type T to a JsonMap following a deep, brute-force conversion of the object's data to +

        • Narrows an object of type T to a JsonMap following a deep, brute-force conversion of the object's data to only consist of JSON-compatible values by performing a basic JSON clone on the object. This is preferable to using the weaker coerceJsonMap(object) to type-narrow an arbitrary array to a JsonMap when the object's source is unknown, but it comes with the increased overhead of performing the deep JSON clone to ensure runtime type safety. The use of JSON cloning guarantees type safety by omitting non-JSON-compatible elements from the resulting JSON data structure. Non-JSON entries will be converted to nulls. Use coerceJsonArray(array) when the value object can be guaranteed to be JSON-compatible and only needs type coercion.

          -

          Type Parameters

          • T

          Parameters

          • value: Optional<T[]>

            The array to convert.

            -
          • defaultValue: JsonArray

            The default to return if the value was undefined or of the incorrect type.

            +

            Type Parameters

            • T

            Parameters

            • value: Optional<T[]>

              The array to convert.

              +
            • defaultValue: JsonArray

              The default to return if the value was undefined or of the incorrect type.

            Returns JsonArray

            Throws

            JsonCloneError If the array values contain circular references.

            -
    \ No newline at end of file +
\ No newline at end of file diff --git a/functions/toJsonMap.html b/functions/toJsonMap.html index ab9d9343..535608b7 100644 --- a/functions/toJsonMap.html +++ b/functions/toJsonMap.html @@ -1,29 +1,29 @@ -toJsonMap | @salesforce/ts-types
  • Narrows an object of type T to a JsonMap following a deep, brute-force conversion of the object's data to +toJsonMap | @salesforce/ts-types

    • Narrows an object of type T to a JsonMap following a deep, brute-force conversion of the object's data to only consist of JSON-compatible values by performing a basic JSON clone on the object. This is preferable to using the weaker coerceJsonMap(object) to type-narrow an arbitrary object to a JsonMap when the object's source is unknown, but it comes with the increased overhead of performing the deep JSON clone to ensure runtime type safety. The use of JSON cloning guarantees type safety by omitting non-JSON-compatible elements from the resulting JSON data structure. Use coerceJsonMap(object) when the value object can be guaranteed to be JSON-compatible and only needs type coercion.

      -

      Type Parameters

      • T extends object

      Parameters

      • value: T

        The object to convert.

        +

        Type Parameters

        • T extends object

        Parameters

        • value: T

          The object to convert.

        Returns JsonMap

        Throws

        JsonCloneError If the object values contain circular references.

        -
      • Narrows an object of type T to a JsonMap following a deep, brute-force conversion of the object's data to +

      • Narrows an object of type T to a JsonMap following a deep, brute-force conversion of the object's data to only consist of JSON-compatible values by performing a basic JSON clone on the object. This is preferable to using the weaker coerceJsonMap(object) to type-narrow an arbitrary object to a JsonMap when the object's source is unknown, but it comes with the increased overhead of performing the deep JSON clone to ensure runtime type safety. The use of JSON cloning guarantees type safety by omitting non-JSON-compatible elements from the resulting JSON data structure. Use coerceJsonMap(object) when the value object can be guaranteed to be JSON-compatible and only needs type coercion.

        -

        Type Parameters

        • T extends object

        Parameters

        • value: Nullable<T>

          The object to convert.

          +

          Type Parameters

          • T extends object

          Parameters

          Returns Optional<JsonMap>

          Throws

          JsonCloneError If the object values contain circular references.

          -
        • Narrows an object of type T to a JsonMap following a deep, brute-force conversion of the object's data to +

        • Narrows an object of type T to a JsonMap following a deep, brute-force conversion of the object's data to only consist of JSON-compatible values by performing a basic JSON clone on the object. This is preferable to using the weaker coerceJsonMap(object) to type-narrow an arbitrary object to a JsonMap when the object's source is unknown, but it comes with the increased overhead of performing the deep JSON clone to ensure runtime type safety. The use of JSON cloning guarantees type safety by omitting non-JSON-compatible elements from the resulting JSON data structure. Use coerceJsonMap(object) when the value object can be guaranteed to be JSON-compatible and only needs type coercion.

          -

          Type Parameters

          • T extends object

          Parameters

          • value: Nullable<T>

            The object to convert.

            -
          • defaultValue: JsonMap

            The default to return if value was not defined.

            +

            Type Parameters

            • T extends object

            Parameters

            • value: Nullable<T>

              The object to convert.

              +
            • defaultValue: JsonMap

              The default to return if value was not defined.

            Returns JsonMap

            Throws

            JsonCloneError If the object values contain circular references.

            -
    \ No newline at end of file +
\ No newline at end of file diff --git a/functions/valuesOf.html b/functions/valuesOf.html index dca8c4ff..c9225f65 100644 --- a/functions/valuesOf.html +++ b/functions/valuesOf.html @@ -1,4 +1,4 @@ -valuesOf | @salesforce/ts-types
  • Returns the values of an object of type T. This is like Object.values except the return type +valuesOf | @salesforce/ts-types

    • Returns the values of an object of type T. This is like Object.values except the return type captures the possible value types of T.

      Note that it is the responsibility of the caller to use this wisely -- there are cases where the runtime set of values returned may be broader than the type checked set at compile time, @@ -10,5 +10,5 @@ of simple data objects with known properties.

      interface Point { x: number; y: number; }
      const point: Point = { x: 1, y: 2 };
      const values = valuesOf(point);
      // type of values -> number[]
      for (const value of values) {
      console.log(value);
      }
      // 1
      // 2
      -

      Type Parameters

      • T extends object

      • K extends string

      Parameters

      • obj: Nullable<T>

        The object of interest.

        -

      Returns T[K][]

    \ No newline at end of file +

    Type Parameters

    • T extends object
    • K extends string

    Parameters

    Returns T[K][]

\ No newline at end of file diff --git a/hierarchy.html b/hierarchy.html new file mode 100644 index 00000000..c19cc970 --- /dev/null +++ b/hierarchy.html @@ -0,0 +1 @@ +@salesforce/ts-types

@salesforce/ts-types

Class Hierarchy

\ No newline at end of file diff --git a/index.html b/index.html index 49e0cbfe..1f803fa7 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ -@salesforce/ts-types

@salesforce/ts-types

Types and tools for Salesforce TypeScript development

What is this?

This is a simple TypeScript-oriented library developed for use in Salesforce TypeScript libraries, applications, and plugins consisting of two parts:

+@salesforce/ts-types

@salesforce/ts-types

Types and tools for Salesforce TypeScript development

What is this?

This is a simple TypeScript-oriented library developed for use in Salesforce TypeScript libraries, applications, and plugins consisting of two parts:

  1. A collection of commonly desired types.
  2. A collection of type-narrowing convenience functions for writing concise type-guards.
  3. @@ -61,4 +61,4 @@
    const pets: Dictionary<string> = {
    fido: 'dog',
    bill: 'cat',
    fred: undefined
    };
    // note that the array is typed as [string, string] rather than [string, string | undefined]
    function logPet([name, type]: [string, string]) {
    console.log('%s is a %s', name, type);
    }
    definiteEntriesOf(pets).forEach(logPet);
    // fido is a dog
    // bill is a cat

    References

    Another Salesforce TypeScript library, @salesforce/kit, builds on this library to add additional utilities. It includes additional JSON support, a lightweight replacement for some lodash functions, and growing support for patterns used in other Salesforce CLI libraries and applications.

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/interfaces/AnyArray.html b/interfaces/AnyArray.html index f61b7ad7..9c25db66 100644 --- a/interfaces/AnyArray.html +++ b/interfaces/AnyArray.html @@ -1,2 +1,2 @@ -AnyArray | @salesforce/ts-types

Interface AnyArray<T>

An alias for an array of T elements, where T defaults to unknown.

-

Type Parameters

  • T = unknown

Hierarchy

  • Array<T>
    • AnyArray
\ No newline at end of file +AnyArray | @salesforce/ts-types

Interface AnyArray<T>

An alias for an array of T elements, where T defaults to unknown.

+
interface AnyArray<T> {}

Type Parameters

  • T = unknown

Hierarchy

  • Array<T>
    • AnyArray
\ No newline at end of file diff --git a/interfaces/AnyArrayLike.html b/interfaces/AnyArrayLike.html index 3b984cfa..6c1028a4 100644 --- a/interfaces/AnyArrayLike.html +++ b/interfaces/AnyArrayLike.html @@ -1,3 +1,3 @@ -AnyArrayLike | @salesforce/ts-types

Interface AnyArrayLike<T>

Any object with both a numeric index signature with values of type T and a numeric length +AnyArrayLike | @salesforce/ts-types

Interface AnyArrayLike<T>

Any object with both a numeric index signature with values of type T and a numeric length property. T defaults to unknown if unspecified.

-

Type Parameters

  • T = unknown

Hierarchy

  • ArrayLike<T>
    • AnyArrayLike
\ No newline at end of file +
interface AnyArrayLike<T> {}

Type Parameters

  • T = unknown

Hierarchy

  • ArrayLike<T>
    • AnyArrayLike
\ No newline at end of file diff --git a/interfaces/Dictionary.html b/interfaces/Dictionary.html index 1921eba7..d05c9050 100644 --- a/interfaces/Dictionary.html +++ b/interfaces/Dictionary.html @@ -1,5 +1,5 @@ -Dictionary | @salesforce/ts-types

Interface Dictionary<T>

An object with arbitrary string-indexed values of an optional generic type Optional<T>. T defaults to unknown +Dictionary | @salesforce/ts-types

Interface Dictionary<T>

An object with arbitrary string-indexed values of an optional generic type Optional<T>. T defaults to unknown when not explicitly supplied. For convenient iteration of definitely assigned (i.e. non-nullable) entries, keys, and values, see the following functions: definiteEntriesOf, definiteKeysOf, and definiteValuesOf.

-

Type Parameters

  • T = unknown

Hierarchy

Indexable

[key: string]: Optional<T>
\ No newline at end of file +
interface Dictionary<T> {
    [key: string]: Optional<T>;
}

Type Parameters

  • T = unknown

Hierarchy (view full)

Indexable

[key: string]: Optional<T>
\ No newline at end of file diff --git a/interfaces/JsonArray.html b/interfaces/JsonArray.html index 087df732..37babc6d 100644 --- a/interfaces/JsonArray.html +++ b/interfaces/JsonArray.html @@ -1,2 +1,2 @@ -JsonArray | @salesforce/ts-types
\ No newline at end of file +JsonArray | @salesforce/ts-types

Any JSON-compatible array.

+
interface JsonArray {}

Hierarchy

\ No newline at end of file diff --git a/interfaces/JsonMap.html b/interfaces/JsonMap.html index 14a24d05..5ba7b73b 100644 --- a/interfaces/JsonMap.html +++ b/interfaces/JsonMap.html @@ -1,2 +1,2 @@ -JsonMap | @salesforce/ts-types
\ No newline at end of file +JsonMap | @salesforce/ts-types

Any JSON-compatible object.

+
interface JsonMap {}

Hierarchy (view full)

\ No newline at end of file diff --git a/modules.html b/modules.html index 128fa665..7b303fd6 100644 --- a/modules.html +++ b/modules.html @@ -1,116 +1,116 @@ -@salesforce/ts-types

@salesforce/ts-types

Index

Interfaces

Type Aliases

Functions

\ No newline at end of file +@salesforce/ts-types

@salesforce/ts-types

Index

Interfaces

Type Aliases

Functions

\ No newline at end of file diff --git a/types/AnyConstructor.html b/types/AnyConstructor.html index 11ff1016..228bffb5 100644 --- a/types/AnyConstructor.html +++ b/types/AnyConstructor.html @@ -1,2 +1,2 @@ -AnyConstructor | @salesforce/ts-types

Type alias AnyConstructor<T>

AnyConstructor<T>: (new (...args) => T)

Type Parameters

  • T = object

Type declaration

    • new (...args): T
    • A constructor for any type T. T defaults to object when not explicitly supplied.

      -

      Parameters

      • Rest ...args: any[]

      Returns T

\ No newline at end of file +AnyConstructor | @salesforce/ts-types

Type alias AnyConstructor<T>

AnyConstructor<T>: (new (...args) => T)

A constructor for any type T. T defaults to object when not explicitly supplied.

+

Type Parameters

  • T = object

Type declaration

    • new (...args): T
    • Parameters

      • Rest ...args: any[]

      Returns T

\ No newline at end of file diff --git a/types/AnyFunction.html b/types/AnyFunction.html index 8e35146b..1fd0d2cf 100644 --- a/types/AnyFunction.html +++ b/types/AnyFunction.html @@ -1,2 +1,2 @@ -AnyFunction | @salesforce/ts-types

Type alias AnyFunction<T>

AnyFunction<T>: ((...args) => T)

Type Parameters

  • T = unknown

Type declaration

    • (...args): T
    • Any function returning type T. T defaults to unknown when not explicitly supplied.

      -

      Parameters

      • Rest ...args: any[]

      Returns T

\ No newline at end of file +AnyFunction | @salesforce/ts-types

Type alias AnyFunction<T>

AnyFunction<T>: ((...args) => T)

Any function returning type T. T defaults to unknown when not explicitly supplied.

+

Type Parameters

  • T = unknown

Type declaration

    • (...args): T
    • Parameters

      • Rest ...args: any[]

      Returns T

\ No newline at end of file diff --git a/types/AnyJson.html b/types/AnyJson.html index 90c6115c..7845fa97 100644 --- a/types/AnyJson.html +++ b/types/AnyJson.html @@ -1,2 +1,2 @@ -AnyJson | @salesforce/ts-types
\ No newline at end of file +AnyJson | @salesforce/ts-types

Type alias AnyJson

Any valid JSON value.

+
\ No newline at end of file diff --git a/types/JsonCollection.html b/types/JsonCollection.html index 25ab1e11..8fd8e1d1 100644 --- a/types/JsonCollection.html +++ b/types/JsonCollection.html @@ -1,2 +1,2 @@ -JsonCollection | @salesforce/ts-types
\ No newline at end of file +JsonCollection | @salesforce/ts-types

Type alias JsonCollection

JsonCollection: JsonMap | JsonArray

Any valid JSON collection value.

+
\ No newline at end of file diff --git a/types/JsonPrimitive.html b/types/JsonPrimitive.html index 1ff6ab7c..99307405 100644 --- a/types/JsonPrimitive.html +++ b/types/JsonPrimitive.html @@ -1,2 +1,2 @@ -JsonPrimitive | @salesforce/ts-types

Type alias JsonPrimitive

JsonPrimitive: null | boolean | number | string

Any valid JSON primitive value.

-
\ No newline at end of file +JsonPrimitive | @salesforce/ts-types

Type alias JsonPrimitive

JsonPrimitive: null | boolean | number | string

Any valid JSON primitive value.

+
\ No newline at end of file diff --git a/types/KeyOf.html b/types/KeyOf.html index 0156104c..8fa6fda8 100644 --- a/types/KeyOf.html +++ b/types/KeyOf.html @@ -1,2 +1,2 @@ -KeyOf | @salesforce/ts-types

Type alias KeyOf<T>

KeyOf<T>: Extract<keyof T, string>

An alias for the commonly needed Extract<keyof T, string>.

-

Type Parameters

  • T

\ No newline at end of file +KeyOf | @salesforce/ts-types

Type alias KeyOf<T>

KeyOf<T>: Extract<keyof T, string>

An alias for the commonly needed Extract<keyof T, string>.

+

Type Parameters

  • T
\ No newline at end of file diff --git a/types/KeyValue.html b/types/KeyValue.html index 65efc16b..f3a603ce 100644 --- a/types/KeyValue.html +++ b/types/KeyValue.html @@ -1,3 +1,3 @@ -KeyValue | @salesforce/ts-types

Type alias KeyValue<T>

KeyValue<T>: [string, T]

An alias for a tuple of type [string, T]' for a given generic type T. Tdefaults tounknown` if not otherwise +KeyValue | @salesforce/ts-types

Type alias KeyValue<T>

KeyValue<T>: [string, T]

An alias for a tuple of type [string, T]' for a given generic type T. Tdefaults tounknown` if not otherwise defined.

-

Type Parameters

  • T = unknown

\ No newline at end of file +

Type Parameters

  • T = unknown
\ No newline at end of file diff --git a/types/Literals.html b/types/Literals.html index 3e26c2ce..f94308f8 100644 --- a/types/Literals.html +++ b/types/Literals.html @@ -1,3 +1,3 @@ -Literals | @salesforce/ts-types

Type alias Literals<T>

Literals<T>: Extract<{
        [K in keyof T]: string extends K
            ? never
            : number extends K
                ? never
                : K
    } extends {
        [_ in keyof T]: infer U
    }
    ? U
    : never, string>

Extracts literally defined property names from a type T as a union of key name strings, minus +Literals | @salesforce/ts-types

Type alias Literals<T>

Literals<T>: Extract<{
        [K in keyof T]: string extends K
            ? never
            : number extends K
                ? never
                : K
    } extends {
        [_ in keyof T]: infer U
    }
    ? U
    : never, string>

Extracts literally defined property names from a type T as a union of key name strings, minus any index signatures.

-

Type Parameters

  • T

\ No newline at end of file +

Type Parameters

  • T
\ No newline at end of file diff --git a/types/LiteralsRecord.html b/types/LiteralsRecord.html index 7a0935e8..3d3c72ed 100644 --- a/types/LiteralsRecord.html +++ b/types/LiteralsRecord.html @@ -1,8 +1,8 @@ -LiteralsRecord | @salesforce/ts-types

Type alias LiteralsRecord<T, U>

LiteralsRecord<T, U>: Record<Literals<T>, U>

Creates a new Record type from the literal properties of a type T, assigning their values +LiteralsRecord | @salesforce/ts-types

Type alias LiteralsRecord<T, U>

LiteralsRecord<T, U>: Record<Literals<T>, U>

Creates a new Record type from the literal properties of a type T, assigning their values the to the type U.

This can be useful for creating interfaces from the keys of an enum so that the keys are available at runtime for meta-programming purposes, while both tying the properties of the generated type to the enum keys and remaining as DRY as possible.

enum QUERY_KEY { id, name, created, updated }
// type of QUERY_KEY -> {
// [x: number]: number;
// readonly id: number;
// readonly name: number;
// readonly created: number;
// readonly updated: number;
// }
interface QueryRecord extends LiteralsRecord<typeof QUERY_KEY, string> { }
// type of QueryRecord -> {
// readonly id: string;
// readonly name: string;
// readonly created: string;
// readonly updated: string;
// }
// And for an interface with writable properties, use the following:
interface QueryRecord extends ReadWrite<LiteralsRecord<typeof QUERY_KEY, string>> { }
// type of QueryRecord -> {
// id: string;
// name: string;
// created: string;
// updated: string;
// }
-

Type Parameters

  • T

  • U

\ No newline at end of file +

Type Parameters

  • T
  • U
\ No newline at end of file diff --git a/types/Many.html b/types/Many.html index 5716fd2c..d14ae776 100644 --- a/types/Many.html +++ b/types/Many.html @@ -1,2 +1,2 @@ -Many | @salesforce/ts-types

Type alias Many<T>

Many<T>: T | T[]

A union type for either the parameterized type T or an array of T.

-

Type Parameters

  • T

\ No newline at end of file +Many | @salesforce/ts-types

Type alias Many<T>

Many<T>: T | T[]

A union type for either the parameterized type T or an array of T.

+

Type Parameters

  • T
\ No newline at end of file diff --git a/types/NonOptional.html b/types/NonOptional.html index 10ad91d3..5276b18b 100644 --- a/types/NonOptional.html +++ b/types/NonOptional.html @@ -1,2 +1,2 @@ -NonOptional | @salesforce/ts-types

Type alias NonOptional<T>

NonOptional<T>: T extends undefined
    ? never
    : T

Subtracts undefined from any union type T. This is the opposite of Optional.

-

Type Parameters

  • T

\ No newline at end of file +NonOptional | @salesforce/ts-types

Type alias NonOptional<T>

NonOptional<T>: T extends undefined
    ? never
    : T

Subtracts undefined from any union type T. This is the opposite of Optional.

+

Type Parameters

  • T
\ No newline at end of file diff --git a/types/Nullable.html b/types/Nullable.html index 6e0beea9..3ae45d1c 100644 --- a/types/Nullable.html +++ b/types/Nullable.html @@ -1,3 +1,3 @@ -Nullable | @salesforce/ts-types

Type alias Nullable<T>

Nullable<T>: Optional<T | null>

A union type for either the parameterized type T, null, or undefined -- the opposite of +Nullable | @salesforce/ts-types

Type alias Nullable<T>

Nullable<T>: Optional<T | null>

A union type for either the parameterized type T, null, or undefined -- the opposite of the NonNullable builtin conditional type.

-

Type Parameters

  • T

\ No newline at end of file +

Type Parameters

  • T
\ No newline at end of file diff --git a/types/Omit.html b/types/Omit.html index 6c40c09e..774b9232 100644 --- a/types/Omit.html +++ b/types/Omit.html @@ -1,2 +1,2 @@ -Omit | @salesforce/ts-types

Type alias Omit<T, K>

Omit<T, K>: Pick<T, Exclude<keyof T, K>>

Creates a new type that omits keys in union type K of a target type T.

-

Type Parameters

  • T

  • K extends keyof T

\ No newline at end of file +Omit | @salesforce/ts-types

Type alias Omit<T, K>

Omit<T, K>: Pick<T, Exclude<keyof T, K>>

Creates a new type that omits keys in union type K of a target type T.

+

Type Parameters

  • T
  • K extends keyof T
\ No newline at end of file diff --git a/types/Optional.html b/types/Optional.html index d32f6477..42e3ec19 100644 --- a/types/Optional.html +++ b/types/Optional.html @@ -1,2 +1,2 @@ -Optional | @salesforce/ts-types

Type alias Optional<T>

Optional<T>: T | undefined

A union type for either the parameterized type T or undefined -- the opposite of NonOptional.

-

Type Parameters

  • T

\ No newline at end of file +Optional | @salesforce/ts-types

Type alias Optional<T>

Optional<T>: T | undefined

A union type for either the parameterized type T or undefined -- the opposite of NonOptional.

+

Type Parameters

  • T
\ No newline at end of file diff --git a/types/Overwrite.html b/types/Overwrite.html index eb525025..044be6df 100644 --- a/types/Overwrite.html +++ b/types/Overwrite.html @@ -1,7 +1,7 @@ -Overwrite | @salesforce/ts-types

Type alias Overwrite<T1, T2>

Overwrite<T1, T2>: {
    [P in Exclude<keyof T1, keyof T2>]: T1[P]
} & T2

Returns a new type consisting of all properties declared for an input type T2 overlaid on the +Overwrite | @salesforce/ts-types

Type alias Overwrite<T1, T2>

Overwrite<T1, T2>: {
    [P in Exclude<keyof T1, keyof T2>]: T1[P]
} & T2

Returns a new type consisting of all properties declared for an input type T2 overlaid on the properties of type T1. Any definitions in T2 replace those previously defined in T1. This can be useful for redefining the types of properties on T1 with values from an inline type T2, perhaps to change their type or to make them optional.

type NameAndStringValue = { name: string, value: string }
type NameAndOptionalNumericValue = Overwrite<NameAndValue, { value?: number }>
// type of NameAndOptionalNumericValue -> { name: string } & { value?: number | undefined }
-

Type Parameters

  • T1

  • T2

\ No newline at end of file +

Type Parameters

  • T1
  • T2
\ No newline at end of file diff --git a/types/ReadWrite.html b/types/ReadWrite.html index a81e980a..fbcac0bc 100644 --- a/types/ReadWrite.html +++ b/types/ReadWrite.html @@ -1,3 +1,3 @@ -ReadWrite | @salesforce/ts-types

Type alias ReadWrite<T>

ReadWrite<T>: {
    -readonly [K in keyof T]: T[K]
}

Converts readonly properties of a type T to writable properties. This is the opposite of the +ReadWrite | @salesforce/ts-types

Type alias ReadWrite<T>

ReadWrite<T>: {
    -readonly [K in keyof T]: T[K]
}

Converts readonly properties of a type T to writable properties. This is the opposite of the Readonly<T> builtin mapped type.

-

Type Parameters

  • T

\ No newline at end of file +

Type Parameters

  • T
\ No newline at end of file diff --git a/types/RequiredNonNullable.html b/types/RequiredNonNullable.html index f934a546..8116044a 100644 --- a/types/RequiredNonNullable.html +++ b/types/RequiredNonNullable.html @@ -1,5 +1,5 @@ -RequiredNonNullable | @salesforce/ts-types

Type alias RequiredNonNullable<T>

RequiredNonNullable<T>: T extends object
    ? Required<{
        [P in keyof T]: NonNullable<T[P]>
    }>
    : T

Converts a type T that may have optional, nullable properties into a new type with only required +RequiredNonNullable | @salesforce/ts-types

Type alias RequiredNonNullable<T>

RequiredNonNullable<T>: T extends object
    ? Required<{
        [P in keyof T]: NonNullable<T[P]>
    }>
    : T

Converts a type T that may have optional, nullable properties into a new type with only required properties, while also subtracting null from all possible property values.

type Foo = { bar?: string | undefined | null };
type RequiredNonNullableFoo = RequiredNonNullable<Foo>;
// RequiredNonNullableFoo -> { bar: string };
-

Type Parameters

  • T

\ No newline at end of file +

Type Parameters

  • T
\ No newline at end of file diff --git a/types/RequiredNonOptional.html b/types/RequiredNonOptional.html index 35dffa52..0b32bd46 100644 --- a/types/RequiredNonOptional.html +++ b/types/RequiredNonOptional.html @@ -1,7 +1,7 @@ -RequiredNonOptional | @salesforce/ts-types

Type alias RequiredNonOptional<T>

RequiredNonOptional<T>: T extends object
    ? {
        [P in keyof T]-?: NonOptional<T[P]>
    }
    : T

Converts a type T that may have optional properties into a type T with only required +RequiredNonOptional | @salesforce/ts-types

Type alias RequiredNonOptional<T>

RequiredNonOptional<T>: T extends object
    ? {
        [P in keyof T]-?: NonOptional<T[P]>
    }
    : T

Converts a type T that may have optional properties into a type T with only required properties (e.g. undefined values are not allowed). Explicit nulls in value unions will still be possible. This is similar to the Required builtin mapped type, but also subtracts undefined from value union types as well as the optional property declaration.

type Foo = { bar?: string | undefined | null };
type RequiredNonOptionalFoo = RequiredNonOptional<Foo>;
// RequiredNonOptionalFoo -> { bar: string | null };
-

Type Parameters

  • T

\ No newline at end of file +

Type Parameters

  • T
\ No newline at end of file diff --git a/types/View.html b/types/View.html index 744ad764..7a4d63eb 100644 --- a/types/View.html +++ b/types/View.html @@ -1,2 +1,2 @@ -View | @salesforce/ts-types

Type alias View<K, V>

View<K, V>: {
    [_ in K]: V
}

A view over an object with constrainable properties.

-

Type Parameters

  • K extends string

  • V = unknown

\ No newline at end of file +View | @salesforce/ts-types

Type alias View<K, V>

View<K, V>: {
    [_ in K]: V
}

A view over an object with constrainable properties.

+

Type Parameters

  • K extends string
  • V = unknown
\ No newline at end of file