diff --git a/.github/workflows/deno.yml b/.github/workflows/deno.yml index 00a0efe..40d1322 100644 --- a/.github/workflows/deno.yml +++ b/.github/workflows/deno.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - deno-version: [1.40.5] + deno-version: [1.44.0] steps: - name: checkout project diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 4345ca9..af0c799 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -16,8 +16,8 @@ jobs: strategy: matrix: - deno-version: [1.36.4] - node-version: [21.x] + deno-version: [1.44.0] + node-version: [22.x] steps: - name: checkout nkeys diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 16bdfff..a64d13a 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -8,8 +8,8 @@ jobs: test: strategy: matrix: - node-version: [20.x] - deno-version: [1.36.4] + node-version: [22.x] + deno-version: [1.44.0] runs-on: ubuntu-latest permissions: diff --git a/bin/check-bundle-version.ts b/bin/check-bundle-version.ts index 6464549..e0033a3 100644 --- a/bin/check-bundle-version.ts +++ b/bin/check-bundle-version.ts @@ -15,12 +15,14 @@ let tag = Deno.env.get("RELEASE_VERSION"); const pkg = await Deno.readTextFile("package.json"); const m = JSON.parse(pkg); -if(tag) { - if(tag.startsWith("v")) { +if (tag) { + if (tag.startsWith("v")) { tag = tag.substring(1); } - if(m.version !== tag) { - console.error(`[ERROR] expected RELEASE_VERSION and package versions to match ${tag} !== ${m.version}`); + if (m.version !== tag) { + console.error( + `[ERROR] expected RELEASE_VERSION and package versions to match ${tag} !== ${m.version}`, + ); Deno.exit(1); } console.log(`[OK] RELEASE_VERSION and package versions match ${tag}`); @@ -28,5 +30,4 @@ if(tag) { console.log(`[SKIP] tag check`); } - Deno.exit(0); diff --git a/bin/cjs-fix-imports.ts b/bin/cjs-fix-imports.ts index 5cc96db..5d31138 100644 --- a/bin/cjs-fix-imports.ts +++ b/bin/cjs-fix-imports.ts @@ -1,12 +1,7 @@ -import { parse } from "https://deno.land/std@0.75.0/flags/mod.ts"; -import { - basename, - extname, - join, - resolve, -} from "https://deno.land/std@0.75.0/path/mod.ts"; +import { parseArgs } from "jsr:@std/cli/parse-args"; +import { basename, extname, join, resolve } from "jsr:@std/path"; -const argv = parse( +const argv = parseArgs( Deno.args, { alias: { @@ -21,7 +16,7 @@ const argv = parse( ); // resolve the specified directories to fq -let dirs = (argv._ as string[]).map((n) => { +const dirs = (argv._ as string[]).map((n) => { return resolve(n); }); // resolve the out dir @@ -63,7 +58,7 @@ await Deno.lstat(out) // process each file - remove extensions from requires/import for (const fn of files) { const data = await Deno.readFile(fn); - let txt = new TextDecoder().decode(data); + const txt = new TextDecoder().decode(data); let mod = txt.replace(/from\s+"(\S+).[t|j]s"/gim, 'from "$1"'); mod = mod.replace(/require\("(\S+).[j|t]s"\)/gim, 'require("$1")'); const target = join(out, basename(fn)); diff --git a/bin/tweetnacl-esm.ts b/bin/tweetnacl-esm.ts index b972a46..bec8ef0 100644 --- a/bin/tweetnacl-esm.ts +++ b/bin/tweetnacl-esm.ts @@ -3,7 +3,7 @@ // while attribution of its origin, shims if necessary, // and reworking it to allow running it in different // runtimes -import data from "../package.json" assert { type: "json" }; +import data from "../package.json" with { type: "json" }; const version = data.dependencies["tweetnacl"]; async function copyFromModulesDir( diff --git a/docs/assets/icons.js b/docs/assets/icons.js new file mode 100644 index 0000000..b79c9e8 --- /dev/null +++ b/docs/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/docs/assets/icons.svg b/docs/assets/icons.svg new file mode 100644 index 0000000..7dead61 --- /dev/null +++ b/docs/assets/icons.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/assets/main.js b/docs/assets/main.js index d55df03..d6f1388 100644 --- a/docs/assets/main.js +++ b/docs/assets/main.js @@ -1,7 +1,8 @@ "use strict"; -"use strict";(()=>{var Qe=Object.create;var ae=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var _e=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Me=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ce(e))!Re.call(t,i)&&i!==n&&ae(t,i,{get:()=>e[i],enumerable:!(r=Pe(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Qe(Oe(t)):{},Me(e||!t||!t.__esModule?ae(n,"default",{value:t,enumerable:!0}):n,t));var de=_e((ce,he)=>{(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 h=t.utils.clone(n)||{};h.position=[a,l],h.index=s.length,s.push(new t.Token(r.slice(a,o),h))}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(ou?h+=2:a==u&&(n+=r[l+1]*i[h+1],l+=2,h+=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 u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}if(s.str.length==0&&(u.final=!0),i.push({node:u,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 l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}s.str.length==1&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var h=s.str.charAt(0),m=s.str.charAt(1),v;m in s.node.edges?v=s.node.edges[m]:(v=new t.TokenSet,s.node.edges[m]=v),s.str.length==1&&(v.final=!0),i.push({node:v,editsRemaining:s.editsRemaining-1,str:h+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),u=0;u1?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 ce=="object"?he.exports=n():e.lunr=n()}(this,function(){return t})})()});var le=[];function B(t,e){le.push({selector:e,constructor:t})}var Y=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){le.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()}ensureFocusedElementVisible(){this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null);let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n.tagName!=="SECTION";)n=n.parentElement;if(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)}}};var I=class{constructor(e){this.el=e.el,this.app=e.app}};var J=class{constructor(){this.listeners={}}addEventListener(e,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(n)}removeEventListener(e,n){if(!(e in this.listeners))return;let r=this.listeners[e];for(let i=0,s=r.length;i{let n=Date.now();return(...r)=>{n+e-Date.now()<0&&(t(...r),n=Date.now())}};var re=class extends J{constructor(){super();this.scrollTop=0;this.lastY=0;this.width=0;this.height=0;this.showToolbar=!0;this.toolbar=document.querySelector(".tsd-page-toolbar"),this.navigation=document.querySelector(".col-menu"),window.addEventListener("scroll",ne(()=>this.onScroll(),10)),window.addEventListener("resize",ne(()=>this.onResize(),10)),this.searchInput=document.querySelector("#tsd-search input"),this.searchInput&&this.searchInput.addEventListener("focus",()=>{this.hideShowToolbar()}),this.onResize(),this.onScroll()}triggerResize(){let n=new CustomEvent("resize",{detail:{width:this.width,height:this.height}});this.dispatchEvent(n)}onResize(){this.width=window.innerWidth||0,this.height=window.innerHeight||0;let n=new CustomEvent("resize",{detail:{width:this.width,height:this.height}});this.dispatchEvent(n)}onScroll(){this.scrollTop=window.scrollY||0;let n=new CustomEvent("scroll",{detail:{scrollTop:this.scrollTop}});this.dispatchEvent(n),this.hideShowToolbar()}hideShowToolbar(){let n=this.showToolbar;this.showToolbar=this.lastY>=this.scrollTop||this.scrollTop<=0||!!this.searchInput&&this.searchInput===document.activeElement,n!==this.showToolbar&&(this.toolbar.classList.toggle("tsd-page-toolbar--hide"),this.navigation?.classList.toggle("col-menu--hide")),this.lastY=this.scrollTop}},R=re;R.instance=new re;var X=class extends I{constructor(n){super(n);this.anchors=[];this.index=-1;R.instance.addEventListener("resize",()=>this.onResize()),R.instance.addEventListener("scroll",r=>this.onScroll(r)),this.createAnchors()}createAnchors(){let n=window.location.href;n.indexOf("#")!=-1&&(n=n.substring(0,n.indexOf("#"))),this.el.querySelectorAll("a").forEach(r=>{let i=r.href;if(i.indexOf("#")==-1||i.substring(0,n.length)!=n)return;let s=i.substring(i.indexOf("#")+1),o=document.querySelector("a.tsd-anchor[name="+s+"]"),a=r.parentNode;!o||!a||this.anchors.push({link:a,anchor:o,position:0})}),this.onResize()}onResize(){let n;for(let i=0,s=this.anchors.length;ii.position-s.position);let r=new CustomEvent("scroll",{detail:{scrollTop:R.instance.scrollTop}});this.onScroll(r)}onScroll(n){let r=n.detail.scrollTop+5,i=this.anchors,s=i.length-1,o=this.index;for(;o>-1&&i[o].position>r;)o-=1;for(;o-1&&this.anchors[this.index].link.classList.remove("focus"),this.index=o,this.index>-1&&this.anchors[this.index].link.classList.add("focus"))}};var ue=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var me=De(de());function ve(){let t=document.getElementById("tsd-search");if(!t)return;let e=document.getElementById("search-script");t.classList.add("loading"),e&&(e.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),e.addEventListener("load",()=>{t.classList.remove("loading"),t.classList.add("ready")}),window.searchData&&t.classList.remove("loading"));let n=document.querySelector("#tsd-search input"),r=document.querySelector("#tsd-search .results");if(!n||!r)throw new Error("The input field or the result list wrapper was not found");let i=!1;r.addEventListener("mousedown",()=>i=!0),r.addEventListener("mouseup",()=>{i=!1,t.classList.remove("has-focus")}),n.addEventListener("focus",()=>t.classList.add("has-focus")),n.addEventListener("blur",()=>{i||(i=!1,t.classList.remove("has-focus"))});let s={base:t.dataset.base+"/"};Fe(t,r,n,s)}function Fe(t,e,n,r){n.addEventListener("input",ue(()=>{He(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"?pe(e,-1):s.key==="ArrowDown"?pe(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 Ae(t,e){t.index||window.searchData&&(e.classList.remove("loading"),e.classList.add("ready"),t.data=window.searchData,t.index=me.Index.load(window.searchData.index))}function He(t,e,n,r){if(Ae(r,t),!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s=i?r.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o${fe(u.parent,i)}.${l}`);let h=document.createElement("li");h.classList.value=u.classes??"";let m=document.createElement("a");m.href=r.base+u.url,m.innerHTML=l,h.append(m),e.appendChild(h)}}function pe(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 fe(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(ie(t.substring(s,o)),`${ie(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(ie(t.substring(s))),i.join("")}var Ne={"&":"&","<":"<",">":">","'":"'",'"':"""};function ie(t){return t.replace(/[&<>"'"]/g,e=>Ne[e])}var F="mousedown",ye="mousemove",j="mouseup",Z={x:0,y:0},ge=!1,se=!1,Be=!1,A=!1,xe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(xe?"is-mobile":"not-mobile");xe&&"ontouchstart"in document.documentElement&&(Be=!0,F="touchstart",ye="touchmove",j="touchend");document.addEventListener(F,t=>{se=!0,A=!1;let e=F=="touchstart"?t.targetTouches[0]:t;Z.y=e.pageY||0,Z.x=e.pageX||0});document.addEventListener(ye,t=>{if(se&&!A){let e=F=="touchstart"?t.targetTouches[0]:t,n=Z.x-(e.pageX||0),r=Z.y-(e.pageY||0);A=Math.sqrt(n*n+r*r)>10}});document.addEventListener(j,()=>{se=!1});document.addEventListener("click",t=>{ge&&(t.preventDefault(),t.stopImmediatePropagation(),ge=!1)});var K=class extends I{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(j,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(j,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){A||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-menu, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!A&&this.active&&n.target.closest(".col-menu")){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 oe;try{oe=localStorage}catch{oe={getItem(){return null},setItem(){}}}var Q=oe;var Le=document.head.appendChild(document.createElement("style"));Le.dataset.for="filters";var ee=class extends I{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()),Le.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 te=class extends I{constructor(n){super(n);this.calculateHeights(),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.textContent.replace(/\s+/g,"-").toLowerCase()}`,this.setLocalStorage(this.fromLocalStorage(),!0),this.summary.addEventListener("click",r=>this.toggleVisibility(r)),this.icon.style.transform=this.getIconRotation()}getIconRotation(n=this.el.open){return`rotate(${n?0:-90}deg)`}calculateHeights(){let n=this.el.open,{position:r,left:i}=this.el.style;this.el.style.position="fixed",this.el.style.left="-9999px",this.el.open=!0,this.expandedHeight=this.el.offsetHeight+"px",this.el.open=!1,this.collapsedHeight=this.el.offsetHeight+"px",this.el.open=n,this.el.style.height=n?this.expandedHeight:this.collapsedHeight,this.el.style.position=r,this.el.style.left=i}toggleVisibility(n){n.preventDefault(),this.el.style.overflow="hidden",this.el.open?this.collapse():this.expand()}expand(n=!0){this.el.open=!0,this.animate(this.collapsedHeight,this.expandedHeight,{opening:!0,duration:n?300:0})}collapse(n=!0){this.animate(this.expandedHeight,this.collapsedHeight,{opening:!1,duration:n?300:0})}animate(n,r,{opening:i,duration:s=300}){if(this.animation)return;let o={duration:s,easing:"ease"};this.animation=this.el.animate({height:[n,r]},o),this.icon.animate({transform:[this.icon.style.transform||this.getIconRotation(!i),this.getIconRotation(i)]},o).addEventListener("finish",()=>{this.icon.style.transform=this.getIconRotation(i)}),this.animation.addEventListener("finish",()=>this.animationEnd(i))}animationEnd(n){this.el.open=n,this.animation=void 0,this.el.style.height="auto",this.el.style.overflow="visible",this.setLocalStorage(n)}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.open}setLocalStorage(n,r=!1){this.fromLocalStorage()===n&&!r||(Q.setItem(this.key,n.toString()),this.el.open=n,this.handleValueChange(r))}handleValueChange(n=!1){this.fromLocalStorage()===this.el.open&&!n||(this.fromLocalStorage()?this.expand(!1):this.collapse(!1))}};function be(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,Ee(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),Ee(t.value)})}function Ee(t){document.documentElement.dataset.theme=t}ve();B(X,".menu-highlight");B(K,"a[data-toggle]");B(te,".tsd-index-accordion");B(ee,".tsd-filter-item input[type=checkbox]");var we=document.getElementById("theme");we&&be(we);var je=new Y;Object.defineProperty(window,"app",{value:je});})(); +"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.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}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&&(console.log("Show page"),document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){console.log("Scorlling");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(()=>{Ve(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ne(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 Ve(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 Ne(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/docs/assets/navigation.js b/docs/assets/navigation.js new file mode 100644 index 0000000..1d1c79a --- /dev/null +++ b/docs/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAE4XRQQuCMBgG4P+ysyRJSXgL6RSUEJ2iw5qfNNJNtm9RRP89w8KtdF73vu/Dxg4PgnBDkpDNGu56pZRUqcyBBKSmeG7OQZhKh246OWNVNpULFzlJFs+gR+kEVlKtwTbc/TSyhaaUUW7NuUBQBWWN8MnceTSPrTlTQBGWjEkjsEMKIxhyKXToFFwpnv1B2xoURfs1v9K3MUrtNXiYd+ohcmDOr3TzNvFMQQxN28QzLZSsUqOusAPI+wSnMAJl5lRyNqS06Qjhu0bvDY4vGtqK0uACAAA=" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index 21a4134..3676d4f 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"kinds\":{\"8\":\"Enumeration\",\"16\":\"Enumeration Member\",\"64\":\"Function\",\"128\":\"Class\",\"256\":\"Interface\",\"512\":\"Constructor\",\"1024\":\"Property\",\"2048\":\"Method\"},\"rows\":[{\"kind\":256,\"name\":\"KeyPair\",\"url\":\"interfaces/KeyPair.html\",\"classes\":\"tsd-kind-interface\"},{\"kind\":2048,\"name\":\"getPublicKey\",\"url\":\"interfaces/KeyPair.html#getPublicKey\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"KeyPair\"},{\"kind\":2048,\"name\":\"getPrivateKey\",\"url\":\"interfaces/KeyPair.html#getPrivateKey\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"KeyPair\"},{\"kind\":2048,\"name\":\"getSeed\",\"url\":\"interfaces/KeyPair.html#getSeed\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"KeyPair\"},{\"kind\":2048,\"name\":\"sign\",\"url\":\"interfaces/KeyPair.html#sign\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"KeyPair\"},{\"kind\":2048,\"name\":\"verify\",\"url\":\"interfaces/KeyPair.html#verify\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"KeyPair\"},{\"kind\":2048,\"name\":\"clear\",\"url\":\"interfaces/KeyPair.html#clear\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"KeyPair\"},{\"kind\":64,\"name\":\"createAccount\",\"url\":\"functions/createAccount.html\",\"classes\":\"tsd-kind-function\"},{\"kind\":64,\"name\":\"createOperator\",\"url\":\"functions/createOperator.html\",\"classes\":\"tsd-kind-function\"},{\"kind\":64,\"name\":\"createUser\",\"url\":\"functions/createUser.html\",\"classes\":\"tsd-kind-function\"},{\"kind\":64,\"name\":\"fromPublic\",\"url\":\"functions/fromPublic.html\",\"classes\":\"tsd-kind-function\"},{\"kind\":64,\"name\":\"fromSeed\",\"url\":\"functions/fromSeed.html\",\"classes\":\"tsd-kind-function\"},{\"kind\":128,\"name\":\"NKeysError\",\"url\":\"classes/NKeysError.html\",\"classes\":\"tsd-kind-class\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/NKeysError.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"NKeysError\"},{\"kind\":1024,\"name\":\"name\",\"url\":\"classes/NKeysError.html#name\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"NKeysError\"},{\"kind\":1024,\"name\":\"code\",\"url\":\"classes/NKeysError.html#code\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"NKeysError\"},{\"kind\":1024,\"name\":\"chainedError\",\"url\":\"classes/NKeysError.html#chainedError\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"NKeysError\"},{\"kind\":8,\"name\":\"NKeysErrorCode\",\"url\":\"enums/NKeysErrorCode.html\",\"classes\":\"tsd-kind-enum\"},{\"kind\":16,\"name\":\"InvalidPrefixByte\",\"url\":\"enums/NKeysErrorCode.html#InvalidPrefixByte\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":16,\"name\":\"InvalidKey\",\"url\":\"enums/NKeysErrorCode.html#InvalidKey\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":16,\"name\":\"InvalidPublicKey\",\"url\":\"enums/NKeysErrorCode.html#InvalidPublicKey\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":16,\"name\":\"InvalidSeedLen\",\"url\":\"enums/NKeysErrorCode.html#InvalidSeedLen\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":16,\"name\":\"InvalidSeed\",\"url\":\"enums/NKeysErrorCode.html#InvalidSeed\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":16,\"name\":\"InvalidEncoding\",\"url\":\"enums/NKeysErrorCode.html#InvalidEncoding\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":16,\"name\":\"InvalidSignature\",\"url\":\"enums/NKeysErrorCode.html#InvalidSignature\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":16,\"name\":\"CannotSign\",\"url\":\"enums/NKeysErrorCode.html#CannotSign\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":16,\"name\":\"PublicKeyOnly\",\"url\":\"enums/NKeysErrorCode.html#PublicKeyOnly\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":16,\"name\":\"InvalidChecksum\",\"url\":\"enums/NKeysErrorCode.html#InvalidChecksum\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":16,\"name\":\"SerializationError\",\"url\":\"enums/NKeysErrorCode.html#SerializationError\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":16,\"name\":\"ApiError\",\"url\":\"enums/NKeysErrorCode.html#ApiError\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":16,\"name\":\"ClearedPair\",\"url\":\"enums/NKeysErrorCode.html#ClearedPair\",\"classes\":\"tsd-kind-enum-member tsd-parent-kind-enum\",\"parent\":\"NKeysErrorCode\"},{\"kind\":64,\"name\":\"decode\",\"url\":\"functions/decode.html\",\"classes\":\"tsd-kind-function\"},{\"kind\":64,\"name\":\"encode\",\"url\":\"functions/encode.html\",\"classes\":\"tsd-kind-function\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,31.209]],[\"comment/0\",[]],[\"name/1\",[1,31.209]],[\"comment/1\",[]],[\"name/2\",[2,31.209]],[\"comment/2\",[]],[\"name/3\",[3,31.209]],[\"comment/3\",[]],[\"name/4\",[4,31.209]],[\"comment/4\",[]],[\"name/5\",[5,31.209]],[\"comment/5\",[]],[\"name/6\",[6,31.209]],[\"comment/6\",[]],[\"name/7\",[7,31.209]],[\"comment/7\",[]],[\"name/8\",[8,31.209]],[\"comment/8\",[]],[\"name/9\",[9,31.209]],[\"comment/9\",[]],[\"name/10\",[10,31.209]],[\"comment/10\",[]],[\"name/11\",[11,31.209]],[\"comment/11\",[]],[\"name/12\",[12,31.209]],[\"comment/12\",[]],[\"name/13\",[13,31.209]],[\"comment/13\",[]],[\"name/14\",[14,31.209]],[\"comment/14\",[]],[\"name/15\",[15,31.209]],[\"comment/15\",[]],[\"name/16\",[16,31.209]],[\"comment/16\",[]],[\"name/17\",[17,31.209]],[\"comment/17\",[]],[\"name/18\",[18,31.209]],[\"comment/18\",[]],[\"name/19\",[19,31.209]],[\"comment/19\",[]],[\"name/20\",[20,31.209]],[\"comment/20\",[]],[\"name/21\",[21,31.209]],[\"comment/21\",[]],[\"name/22\",[22,31.209]],[\"comment/22\",[]],[\"name/23\",[23,31.209]],[\"comment/23\",[]],[\"name/24\",[24,31.209]],[\"comment/24\",[]],[\"name/25\",[25,31.209]],[\"comment/25\",[]],[\"name/26\",[26,31.209]],[\"comment/26\",[]],[\"name/27\",[27,31.209]],[\"comment/27\",[]],[\"name/28\",[28,31.209]],[\"comment/28\",[]],[\"name/29\",[29,31.209]],[\"comment/29\",[]],[\"name/30\",[30,31.209]],[\"comment/30\",[]],[\"name/31\",[31,31.209]],[\"comment/31\",[]],[\"name/32\",[32,31.209]],[\"comment/32\",[]]],\"invertedIndex\":[[\"apierror\",{\"_index\":29,\"name\":{\"29\":{}},\"comment\":{}}],[\"cannotsign\",{\"_index\":25,\"name\":{\"25\":{}},\"comment\":{}}],[\"chainederror\",{\"_index\":16,\"name\":{\"16\":{}},\"comment\":{}}],[\"clear\",{\"_index\":6,\"name\":{\"6\":{}},\"comment\":{}}],[\"clearedpair\",{\"_index\":30,\"name\":{\"30\":{}},\"comment\":{}}],[\"code\",{\"_index\":15,\"name\":{\"15\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":13,\"name\":{\"13\":{}},\"comment\":{}}],[\"createaccount\",{\"_index\":7,\"name\":{\"7\":{}},\"comment\":{}}],[\"createoperator\",{\"_index\":8,\"name\":{\"8\":{}},\"comment\":{}}],[\"createuser\",{\"_index\":9,\"name\":{\"9\":{}},\"comment\":{}}],[\"decode\",{\"_index\":31,\"name\":{\"31\":{}},\"comment\":{}}],[\"encode\",{\"_index\":32,\"name\":{\"32\":{}},\"comment\":{}}],[\"frompublic\",{\"_index\":10,\"name\":{\"10\":{}},\"comment\":{}}],[\"fromseed\",{\"_index\":11,\"name\":{\"11\":{}},\"comment\":{}}],[\"getprivatekey\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"getpublickey\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"getseed\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}],[\"invalidchecksum\",{\"_index\":27,\"name\":{\"27\":{}},\"comment\":{}}],[\"invalidencoding\",{\"_index\":23,\"name\":{\"23\":{}},\"comment\":{}}],[\"invalidkey\",{\"_index\":19,\"name\":{\"19\":{}},\"comment\":{}}],[\"invalidprefixbyte\",{\"_index\":18,\"name\":{\"18\":{}},\"comment\":{}}],[\"invalidpublickey\",{\"_index\":20,\"name\":{\"20\":{}},\"comment\":{}}],[\"invalidseed\",{\"_index\":22,\"name\":{\"22\":{}},\"comment\":{}}],[\"invalidseedlen\",{\"_index\":21,\"name\":{\"21\":{}},\"comment\":{}}],[\"invalidsignature\",{\"_index\":24,\"name\":{\"24\":{}},\"comment\":{}}],[\"keypair\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"name\",{\"_index\":14,\"name\":{\"14\":{}},\"comment\":{}}],[\"nkeyserror\",{\"_index\":12,\"name\":{\"12\":{}},\"comment\":{}}],[\"nkeyserrorcode\",{\"_index\":17,\"name\":{\"17\":{}},\"comment\":{}}],[\"publickeyonly\",{\"_index\":26,\"name\":{\"26\":{}},\"comment\":{}}],[\"serializationerror\",{\"_index\":28,\"name\":{\"28\":{}},\"comment\":{}}],[\"sign\",{\"_index\":4,\"name\":{\"4\":{}},\"comment\":{}}],[\"verify\",{\"_index\":5,\"name\":{\"5\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE62ZUW+jSAzHvwt9jdqMh6Rp3vaqfVjd6ba66u6lqlYsmbSoCSAgve1F/e43BhJs4oFA+1TR8d82/o1nhsney5J/c2/5sPdeonjlLWE2n3hxsDXe0vvdvN0FUeZNvF22sc9RXJhsHYQmv6qHLp+L7caOh5sgz43143nvk6Orqb84+noyxd3u5yYKrbLP4UXLmHifeGmQmbgg2XUEzKLXoDDnRqTWY0PeG7M6J1htNypMHj3FvTFqo1EBXk0WrftrdjQbFSTcmKB3al0crMYVygSb/kJVRqMCJKnpJ1EbnRtg7jclyoydkF/CMNlZ40Oc9S4OiyiJ8ys23tmKJ06/pyYLiiRzej0YDHP7d27cLnHwXHfrLNne7rJXwxqq8cjGhzit1hWHx2pwiLuO9HozU9DMpD/tRMi/ZhkhUmuumqFObzMFDQybQ5HtwqLf3QW3lWcpyY6kP4WmFuWfvlC10dgYYbLqj1EbjY7xHESxWZ1F4qJlPCCmBP6Wvp6Jd1saEAe7J1OzbX+LX4NNtLrLzDr69dtbcYbXC0nT9z5lwl0Z0I23N3TXvjsg5ukho/+le48aA+Jj1/9BdoXe6I3gU2IPC/wZUU+X6d7QVPI58QcBJ4rPiV5tlnblH5gD1X04EzQdkUhb9uE8vsZ2DY7ip/NTIIoPR//LhFEaGXJe6g1PJZ/x9tlbWgzpBioZH/82iOOkuKffBu7IzHh8zOPK+T3enNN/bfuPd9+zCV/y3XZA3zWK8dHv7ZePdfZf2TP8rOBOQBSNz+FLGp0bmZh+YH7hl5hZsQuBjgnGrAdGJWfslWGnvuaEXQ2ce1Q3scNNNSC5eZzYL7qV+eUt9/hBnOPquPTgUl/eWMt1ZDYrvDc5nHzDZLvF13qsx/4xeKJGi8rkaupNHqYTrS81wOPj5OGgKAfKf5Rmyj4pyUwxM7BPIJkBM9P2SUtmmpn59smXzHxmNrNPM8lsxszm9mkumc2Z2bV9upbMrpnZwj4tJLMFM7NQHm4ksxteXqy2EjmoFoiShIyCs1BYcyXSUByHwrIrEYjiRBRWXolMFIeisPhKxKI4F4X1VyIZxdEoRKBEOIrTUUhBiXwUB6QQhBIRKc4IEASIjIAzAgQBIiNo9UvZMHLHcEaAIEBkBJwRIAgQGQFnBAgCREbAGQGCAJERcEaAIEBkBJwRIAgQGQFnBAgCREbAGWkEoUVGmjPSCEKLjDRnpBGEFhnp1rJWrmvywsYZaQShRUaaM9IIQouMNGekEYQWGWnOSCMILTLSnJFGEFpkpDkjjSC0yEhzRj6C8EVGfsWo3OPs5mbPnt+qvc7uVoE9C1enhb33o94C7TvUW+nes5kv9+/vzZaHT6Xz8lBZXTwTqSZS7ZJWNyknce16cRTbVcIhru6IG9W8Ec27NGaVlucTkuyCJLtwacujBEmSiJRbRK7ZiJbkqpzJltenweEeuFGT6jiLU2qT43UvCT0loaed8l15rUukikiVQ3o4upHqkny1K+HDUa2R+SRR35Uo3riG+E2dl9cKJFcguUKHOq1vhomUTF3lmrooPYnpE6HvED6ZIq1+cnrBq4hGTRJ25YvaMt2WlHJxS9vp0g51qKLq6yk8fj0R9YzIZz16JNR+XbK2gGttofqkua0gXkgTgqsJqZd2EYB0Irg6sXZgjhcWpAxklmrXLG30hy9+4oBw1y7wtYN2CemU6ZHGVitXkHQnuLqzdpKW98Q/y3ti4oFMP3DNv4MHafoCmYnQMxWz5taG1JBkoHsyOJkAZB5DzzxG7cbw8pGeB1fP2/dtbzlk2rhmTfWJSbqcdIxydQxyzk83VPKSyvWSjbS9FAPJFlzpVj94NiLSma7GPM6GpLwYIkBJVbWrqtVPuI2IlMdVnZxexpwed8haoF1rQfugQzJ1JXr4xbwRERwiDXtCS6PUbOzpyB7OHt/f/wcTIdbFsSEAAA=="; \ No newline at end of file diff --git a/docs/assets/style.css b/docs/assets/style.css index 2d02570..778b949 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -6,17 +6,36 @@ --light-color-background-warning: #e6e600; --light-color-icon-background: var(--light-color-background); --light-color-accent: #c5c7c9; + --light-color-active-menu-item: var(--light-color-accent); --light-color-text: #222; - --light-color-text-aside: #707070; - --light-color-link: #4da6ff; - --light-color-ts: #db1373; - --light-color-ts-interface: #139d2c; - --light-color-ts-enum: #9c891a; - --light-color-ts-class: #2484e5; + --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); + --light-color-ts-enum: #7e6f15; + --light-color-ts-enum-member: var(--light-color-ts-enum); + --light-color-ts-variable: #4760ec; --light-color-ts-function: #572be7; - --light-color-ts-namespace: #b111c9; - --light-color-ts-private: #707070; - --light-color-ts-variable: #4d68ff; + --light-color-ts-class: #1f70c2; + --light-color-ts-interface: #108024; + --light-color-ts-constructor: var(--light-color-ts-class); + --light-color-ts-property: var(--light-color-ts-variable); + --light-color-ts-method: var(--light-color-ts-function); + --light-color-ts-call-signature: var(--light-color-ts-method); + --light-color-ts-index-signature: var(--light-color-ts-property); + --light-color-ts-constructor-signature: var(--light-color-ts-constructor); + --light-color-ts-parameter: var(--light-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --light-color-ts-type-parameter: #a55c0e; + --light-color-ts-accessor: var(--light-color-ts-property); + --light-color-ts-get-signature: var(--light-color-ts-accessor); + --light-color-ts-set-signature: var(--light-color-ts-accessor); + --light-color-ts-type-alias: #d51270; + /* reference not included as links will be colored with the kind that it points to */ + --light-external-icon: url("data:image/svg+xml;utf8,"); --light-color-scheme: light; @@ -27,17 +46,36 @@ --dark-color-warning-text: #222; --dark-color-icon-background: var(--dark-color-background-secondary); --dark-color-accent: #9096a2; + --dark-color-active-menu-item: #5d5d6a; --dark-color-text: #f5f5f5; --dark-color-text-aside: #dddddd; --dark-color-link: #00aff4; - --dark-color-ts: #ff6492; - --dark-color-ts-interface: #6cff87; + + --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); --dark-color-ts-enum: #f4d93e; - --dark-color-ts-class: #61b0ff; - --dark-color-ts-function: #9772ff; - --dark-color-ts-namespace: #e14dff; - --dark-color-ts-private: #e2e2e2; - --dark-color-ts-variable: #4d68ff; + --dark-color-ts-enum-member: var(--dark-color-ts-enum); + --dark-color-ts-variable: #798dff; + --dark-color-ts-function: #a280ff; + --dark-color-ts-class: #8ac4ff; + --dark-color-ts-interface: #6cff87; + --dark-color-ts-constructor: var(--dark-color-ts-class); + --dark-color-ts-property: var(--dark-color-ts-variable); + --dark-color-ts-method: var(--dark-color-ts-function); + --dark-color-ts-call-signature: var(--dark-color-ts-method); + --dark-color-ts-index-signature: var(--dark-color-ts-property); + --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor); + --dark-color-ts-parameter: var(--dark-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --dark-color-ts-type-parameter: #e07d13; + --dark-color-ts-accessor: var(--dark-color-ts-property); + --dark-color-ts-get-signature: var(--dark-color-ts-accessor); + --dark-color-ts-set-signature: var(--dark-color-ts-accessor); + --dark-color-ts-type-alias: #ff6492; + /* reference not included as links will be colored with the kind that it points to */ + --dark-external-icon: url("data:image/svg+xml;utf8,"); --dark-color-scheme: dark; } @@ -50,17 +88,35 @@ --color-warning-text: var(--light-color-warning-text); --color-icon-background: var(--light-color-icon-background); --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); --color-text: var(--light-color-text); --color-text-aside: var(--light-color-text-aside); --color-link: var(--light-color-link); - --color-ts: var(--light-color-ts); - --color-ts-interface: var(--light-color-ts-interface); - --color-ts-enum: var(--light-color-ts-enum); - --color-ts-class: var(--light-color-ts-class); - --color-ts-function: var(--light-color-ts-function); + + --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-private: var(--light-color-ts-private); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --external-icon: var(--light-external-icon); --color-scheme: var(--light-color-scheme); } @@ -74,17 +130,35 @@ --color-warning-text: var(--dark-color-warning-text); --color-icon-background: var(--dark-color-icon-background); --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); --color-text: var(--dark-color-text); --color-text-aside: var(--dark-color-text-aside); --color-link: var(--dark-color-link); - --color-ts: var(--dark-color-ts); - --color-ts-interface: var(--dark-color-ts-interface); - --color-ts-enum: var(--dark-color-ts-enum); - --color-ts-class: var(--dark-color-ts-class); - --color-ts-function: var(--dark-color-ts-function); + + --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-private: var(--dark-color-ts-private); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --external-icon: var(--dark-external-icon); --color-scheme: var(--dark-color-scheme); } @@ -105,17 +179,35 @@ body { --color-warning-text: var(--light-color-warning-text); --color-icon-background: var(--light-color-icon-background); --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); --color-text: var(--light-color-text); --color-text-aside: var(--light-color-text-aside); --color-link: var(--light-color-link); - --color-ts: var(--light-color-ts); - --color-ts-interface: var(--light-color-ts-interface); - --color-ts-enum: var(--light-color-ts-enum); - --color-ts-class: var(--light-color-ts-class); - --color-ts-function: var(--light-color-ts-function); + + --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-private: var(--light-color-ts-private); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --external-icon: var(--light-external-icon); --color-scheme: var(--light-color-scheme); } @@ -127,17 +219,35 @@ body { --color-warning-text: var(--dark-color-warning-text); --color-icon-background: var(--dark-color-icon-background); --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); --color-text: var(--dark-color-text); --color-text-aside: var(--dark-color-text-aside); --color-link: var(--dark-color-link); - --color-ts: var(--dark-color-ts); - --color-ts-interface: var(--dark-color-ts-interface); - --color-ts-enum: var(--dark-color-ts-enum); - --color-ts-class: var(--dark-color-ts-class); - --color-ts-function: var(--dark-color-ts-function); + + --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-private: var(--dark-color-ts-private); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --external-icon: var(--dark-external-icon); --color-scheme: var(--dark-color-scheme); } @@ -156,6 +266,16 @@ h6 { line-height: 1.2; } +h1 > a:not(.link), +h2 > a:not(.link), +h3 > a:not(.link), +h4 > a:not(.link), +h5 > a:not(.link), +h6 > a:not(.link) { + text-decoration: none; + color: var(--color-text); +} + h1 { font-size: 1.875rem; margin: 0.67rem 0; @@ -190,12 +310,6 @@ h6 { text-transform: uppercase; } -pre { - white-space: pre; - white-space: pre-wrap; - word-wrap: break-word; -} - dl, menu, ol, @@ -208,61 +322,25 @@ dd { } .container { - max-width: 1600px; + max-width: 1700px; padding: 0 2rem; } -@media (min-width: 640px) { - .container { - padding: 0 4rem; - } -} -@media (min-width: 1200px) { - .container { - padding: 0 8rem; - } -} -@media (min-width: 1600px) { - .container { - padding: 0 12rem; - } -} - /* Footer */ -.tsd-generator { +footer { border-top: 1px solid var(--color-accent); padding-top: 1rem; padding-bottom: 1rem; max-height: 3.5rem; } - -.tsd-generator > p { - margin-top: 0; - margin-bottom: 0; - padding: 0 1rem; +.tsd-generator { + margin: 0 1em; } .container-main { - display: flex; - justify-content: space-between; - position: relative; margin: 0 auto; -} - -.col-4, -.col-8 { - box-sizing: border-box; - float: left; - padding: 2rem 1rem; -} - -.col-4 { - flex: 0 0 25%; -} -.col-8 { - flex: 1 0; - flex-wrap: wrap; - padding-left: 0; + /* toolbar, footer, margin */ + min-height: calc(100vh - 41px - 56px - 4rem); } @keyframes fade-in { @@ -305,22 +383,6 @@ dd { opacity: 0; } } -@keyframes shift-to-left { - from { - transform: translate(0, 0); - } - to { - transform: translate(-25%, 0); - } -} -@keyframes unshift-to-left { - from { - transform: translate(-25%, 0); - } - to { - transform: translate(0, 0); - } -} @keyframes pop-in-from-right { from { transform: translate(100%, 0); @@ -340,7 +402,8 @@ dd { } body { background: var(--color-background); - font-family: "Segoe UI", sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", + Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; color: var(--color-text); } @@ -369,13 +432,29 @@ pre { } pre { + position: relative; + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; padding: 10px; - border: 0.1em solid var(--color-accent); + border: 1px solid var(--color-accent); } pre code { padding: 0; font-size: 100%; } +pre > button { + position: absolute; + top: 10px; + right: 10px; + opacity: 0; + transition: opacity 0.1s; + box-sizing: border-box; +} +pre:hover > button, +pre > button.visible { + opacity: 1; +} blockquote { margin: 1em 0; @@ -391,13 +470,12 @@ blockquote { padding: 0 0 0 20px; margin: 0; } -.tsd-typography h4, .tsd-typography .tsd-index-panel h3, .tsd-index-panel .tsd-typography h3, +.tsd-typography h4, .tsd-typography h5, .tsd-typography h6 { font-size: 1em; - margin: 0; } .tsd-typography h5, .tsd-typography h6 { @@ -408,91 +486,18 @@ blockquote { .tsd-typography ol { margin: 1em 0; } - -@media (max-width: 1024px) { - html .col-content { - float: none; - max-width: 100%; - width: 100%; - padding-top: 3rem; - } - html .col-menu { - position: fixed !important; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - z-index: 1024; - top: 0 !important; - bottom: 0 !important; - left: auto !important; - right: 0 !important; - padding: 1.5rem 1.5rem 0 0; - max-width: 25rem; - visibility: hidden; - background-color: var(--color-background); - transform: translate(100%, 0); - } - html .col-menu > *:last-child { - padding-bottom: 20px; - } - html .overlay { - content: ""; - display: block; - position: fixed; - z-index: 1023; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.75); - visibility: hidden; - } - - .to-has-menu .overlay { - animation: fade-in 0.4s; - } - - .to-has-menu :is(header, footer, .col-content) { - animation: shift-to-left 0.4s; - } - - .to-has-menu .col-menu { - animation: pop-in-from-right 0.4s; - } - - .from-has-menu .overlay { - animation: fade-out 0.4s; - } - - .from-has-menu :is(header, footer, .col-content) { - animation: unshift-to-left 0.4s; - } - - .from-has-menu .col-menu { - animation: pop-out-to-right 0.4s; - } - - .has-menu body { - overflow: hidden; - } - .has-menu .overlay { - visibility: visible; - } - .has-menu :is(header, footer, .col-content) { - transform: translate(-25%, 0); - } - .has-menu .col-menu { - visibility: visible; - transform: translate(0, 0); - display: grid; - align-items: center; - grid-template-rows: auto 1fr; - grid-gap: 1.5rem; - max-height: 100vh; - padding: 1rem 2rem; - } - .has-menu .tsd-navigation { - max-height: 100%; - } +.tsd-typography table { + border-collapse: collapse; + border: none; +} +.tsd-typography td, +.tsd-typography th { + padding: 6px 13px; + border: 1px solid var(--color-accent); +} +.tsd-typography thead, +.tsd-typography tr:nth-child(even) { + background-color: var(--color-background-secondary); } .tsd-breadcrumb { @@ -642,6 +647,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; } @@ -673,43 +700,6 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { -o-page-break-inside: avoid; page-break-inside: avoid; } -.tsd-index-panel a, -.tsd-index-panel a.tsd-parent-kind-module { - color: var(--color-ts); -} -.tsd-index-panel a.tsd-parent-kind-interface { - color: var(--color-ts-interface); -} -.tsd-index-panel a.tsd-parent-kind-enum { - color: var(--color-ts-enum); -} -.tsd-index-panel a.tsd-parent-kind-class { - color: var(--color-ts-class); -} -.tsd-index-panel a.tsd-kind-module { - color: var(--color-ts-namespace); -} -.tsd-index-panel a.tsd-kind-interface { - color: var(--color-ts-interface); -} -.tsd-index-panel a.tsd-kind-enum { - color: var(--color-ts-enum); -} -.tsd-index-panel a.tsd-kind-class { - color: var(--color-ts-class); -} -.tsd-index-panel a.tsd-kind-function { - color: var(--color-ts-function); -} -.tsd-index-panel a.tsd-kind-namespace { - color: var(--color-ts-namespace); -} -.tsd-index-panel a.tsd-kind-variable { - color: var(--color-ts-variable); -} -.tsd-index-panel a.tsd-is-private { - color: var(--color-ts-private); -} .tsd-flag { display: inline-block; @@ -724,7 +714,7 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { } .tsd-anchor { - position: absolute; + position: relative; top: -100px; } @@ -738,108 +728,62 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { margin-bottom: 0; border-bottom: none; } -.tsd-member [data-tsd-kind] { - color: var(--color-ts); -} -.tsd-member [data-tsd-kind="Interface"] { - color: var(--color-ts-interface); -} -.tsd-member [data-tsd-kind="Enum"] { - color: var(--color-ts-enum); -} -.tsd-member [data-tsd-kind="Class"] { - color: var(--color-ts-class); + +.tsd-navigation.settings { + margin: 1rem 0; } -.tsd-member [data-tsd-kind="Private"] { - color: var(--color-ts-private); +.tsd-navigation > a, +.tsd-navigation .tsd-accordion-summary { + width: calc(100% - 0.25rem); + display: flex; + align-items: center; } - -.tsd-navigation a { - display: block; - margin: 0.4rem 0; - border-left: 2px solid transparent; +.tsd-navigation a, +.tsd-navigation summary > span, +.tsd-page-navigation a { + display: flex; + width: calc(100% - 0.25rem); + align-items: center; + padding: 0.25rem; color: var(--color-text); text-decoration: none; - transition: border-left-color 0.1s; + box-sizing: border-box; +} +.tsd-navigation a.current, +.tsd-page-navigation a.current { + background: var(--color-active-menu-item); } -.tsd-navigation a:hover { +.tsd-navigation a:hover, +.tsd-page-navigation a:hover { text-decoration: underline; } -.tsd-navigation ul { - margin: 0; +.tsd-navigation ul, +.tsd-page-navigation ul { + margin-top: 0; + margin-bottom: 0; padding: 0; list-style: none; } -.tsd-navigation li { +.tsd-navigation li, +.tsd-page-navigation li { padding: 0; + max-width: 100%; } - -.tsd-navigation.primary .tsd-accordion-details > ul { - margin-top: 0.75rem; +.tsd-nested-navigation { + margin-left: 3rem; } -.tsd-navigation.primary a { - padding: 0.75rem 0.5rem; - margin: 0; +.tsd-nested-navigation > li > details { + margin-left: -1.5rem; } -.tsd-navigation.primary ul li a { - margin-left: 0.5rem; -} -.tsd-navigation.primary ul li li a { +.tsd-small-nested-navigation { margin-left: 1.5rem; } -.tsd-navigation.primary ul li li li a { - margin-left: 2.5rem; -} -.tsd-navigation.primary ul li li li li a { - margin-left: 3.5rem; -} -.tsd-navigation.primary ul li li li li li a { - margin-left: 4.5rem; -} -.tsd-navigation.primary ul li li li li li li a { - margin-left: 5.5rem; -} -.tsd-navigation.primary li.current > a { - border-left: 0.15rem var(--color-text) solid; -} -.tsd-navigation.primary li.selected > a { - font-weight: bold; - border-left: 0.2rem var(--color-text) solid; -} -.tsd-navigation.primary ul li a:hover { - border-left: 0.2rem var(--color-text-aside) solid; -} -.tsd-navigation.primary li.globals + li > span, -.tsd-navigation.primary li.globals + li > a { - padding-top: 20px; +.tsd-small-nested-navigation > li > details { + margin-left: -1.5rem; } -.tsd-navigation.secondary.tsd-navigation--toolbar-hide { - max-height: calc(100vh - 1rem); - top: 0.5rem; -} -.tsd-navigation.secondary > ul { - display: inline; - padding-right: 0.5rem; - transition: opacity 0.2s; -} -.tsd-navigation.secondary ul li a { - padding-left: 0; -} -.tsd-navigation.secondary ul li li a { - padding-left: 1.1rem; -} -.tsd-navigation.secondary ul li li li a { - padding-left: 2.2rem; -} -.tsd-navigation.secondary ul li li li li a { - padding-left: 3.3rem; -} -.tsd-navigation.secondary ul li li li li li a { - padding-left: 4.4rem; -} -.tsd-navigation.secondary ul li li li li li li a { - padding-left: 5.5rem; +.tsd-page-navigation ul { + padding-left: 1.75rem; } #tsd-sidebar-links a { @@ -852,41 +796,40 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { } a.tsd-index-link { - margin: 0.25rem 0; + padding: 0.25rem 0 !important; font-size: 1rem; line-height: 1.25rem; display: inline-flex; align-items: center; + color: var(--color-text); } -.tsd-accordion-summary > h1, -.tsd-accordion-summary > h2, -.tsd-accordion-summary > h3, -.tsd-accordion-summary > h4, -.tsd-accordion-summary > h5 { - display: inline-flex; - align-items: center; - vertical-align: middle; - margin-bottom: 0; +.tsd-accordion-summary { + list-style-type: none; /* hide marker on non-safari */ + outline: none; /* broken on safari, so just hide it */ +} +.tsd-accordion-summary::-webkit-details-marker { + display: none; /* hide marker on safari */ +} +.tsd-accordion-summary, +.tsd-accordion-summary a { user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -} -.tsd-accordion-summary { - display: block; + cursor: pointer; } +.tsd-accordion-summary a { + width: calc(100% - 1.5rem); +} .tsd-accordion-summary > * { margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; } -.tsd-accordion-summary::-webkit-details-marker { - display: none; -} -.tsd-index-accordion .tsd-accordion-summary svg { - margin-right: 0.25rem; +.tsd-index-accordion .tsd-accordion-summary > svg { + margin-left: 0.25rem; } .tsd-index-content > :not(:first-child) { margin-top: 0.75rem; @@ -911,34 +854,6 @@ a.tsd-index-link { margin-right: 0.8rem; } -@media (min-width: 1024px) { - .col-content { - margin: 2rem auto; - } - - .menu-sticky-wrap { - position: sticky; - height: calc(100vh - 2rem); - top: 4rem; - right: 0; - padding: 0 1.5rem; - padding-top: 1rem; - margin-top: 3rem; - transition: 0.3s ease-in-out; - transition-property: top, padding-top, padding, height; - overflow-y: auto; - } - .col-menu { - border-left: 1px solid var(--color-accent); - } - .col-menu--hide { - top: 1rem; - } - .col-menu .tsd-navigation:not(:last-child) { - padding-bottom: 1.75rem; - } -} - .tsd-panel { margin-bottom: 2.5rem; } @@ -1019,8 +934,9 @@ a.tsd-index-link { box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } #tsd-search .results li { - padding: 0 10px; background-color: var(--color-background); + line-height: initial; + padding: 4px; } #tsd-search .results li:nth-child(even) { background-color: var(--color-background-secondary); @@ -1028,12 +944,15 @@ a.tsd-index-link { #tsd-search .results li.state { display: none; } -#tsd-search .results li.current, -#tsd-search .results li:hover { +#tsd-search .results li.current:not(.no-results), +#tsd-search .results li:hover:not(.no-results) { background-color: var(--color-accent); } #tsd-search .results a { - display: block; + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; } #tsd-search .results a:before { top: 10px; @@ -1089,6 +1008,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; @@ -1144,7 +1068,7 @@ ul.tsd-type-parameter-list h5 { } .tsd-page-toolbar { - position: fixed; + position: sticky; z-index: 1; top: 0; left: 0; @@ -1184,16 +1108,14 @@ ul.tsd-type-parameter-list h5 { padding: 12px 0; } -.tsd-page-toolbar--hide { - transform: translateY(-100%); -} - .tsd-widget { display: inline-block; overflow: hidden; opacity: 0.8; height: 40px; - transition: opacity 0.1s, background-color 0.2s; + transition: + opacity 0.1s, + background-color 0.2s; vertical-align: bottom; cursor: pointer; } @@ -1215,12 +1137,6 @@ ul.tsd-type-parameter-list h5 { .tsd-widget.menu { display: none; } -@media (max-width: 1024px) { - .tsd-widget.options, - .tsd-widget.menu { - display: inline-block; - } -} input[type="checkbox"] + .tsd-widget:before { background-position: -120px 0; } @@ -1251,7 +1167,7 @@ img { } .deprecated { - text-decoration: line-through; + text-decoration: line-through !important; } .warning { @@ -1260,6 +1176,78 @@ img { background: var(--color-background-warning); } +.tsd-kind-project { + color: var(--color-ts-project); +} +.tsd-kind-module { + color: var(--color-ts-module); +} +.tsd-kind-namespace { + color: var(--color-ts-namespace); +} +.tsd-kind-enum { + color: var(--color-ts-enum); +} +.tsd-kind-enum-member { + color: var(--color-ts-enum-member); +} +.tsd-kind-variable { + color: var(--color-ts-variable); +} +.tsd-kind-function { + color: var(--color-ts-function); +} +.tsd-kind-class { + color: var(--color-ts-class); +} +.tsd-kind-interface { + color: var(--color-ts-interface); +} +.tsd-kind-constructor { + color: var(--color-ts-constructor); +} +.tsd-kind-property { + color: var(--color-ts-property); +} +.tsd-kind-method { + color: var(--color-ts-method); +} +.tsd-kind-call-signature { + color: var(--color-ts-call-signature); +} +.tsd-kind-index-signature { + color: var(--color-ts-index-signature); +} +.tsd-kind-constructor-signature { + color: var(--color-ts-constructor-signature); +} +.tsd-kind-parameter { + color: var(--color-ts-parameter); +} +.tsd-kind-type-literal { + color: var(--color-ts-type-literal); +} +.tsd-kind-type-parameter { + color: var(--color-ts-type-parameter); +} +.tsd-kind-accessor { + color: var(--color-ts-accessor); +} +.tsd-kind-get-signature { + color: var(--color-ts-get-signature); +} +.tsd-kind-set-signature { + color: var(--color-ts-set-signature); +} +.tsd-kind-type-alias { + color: var(--color-ts-type-alias); +} + +/* if we have a kind icon, don't color the text by kind */ +.tsd-kind-icon ~ span { + color: var(--color-text); +} + * { scrollbar-width: thin; scrollbar-color: var(--color-accent) var(--color-icon-background); @@ -1278,3 +1266,147 @@ img { border-radius: 999rem; border: 0.25rem solid var(--color-icon-background); } + +/* mobile */ +@media (max-width: 769px) { + .tsd-widget.options, + .tsd-widget.menu { + display: inline-block; + } + + .container-main { + display: flex; + } + html .col-content { + float: none; + max-width: 100%; + width: 100%; + } + html .col-sidebar { + position: fixed !important; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + z-index: 1024; + top: 0 !important; + bottom: 0 !important; + left: auto !important; + right: 0 !important; + padding: 1.5rem 1.5rem 0 0; + width: 75vw; + visibility: hidden; + background-color: var(--color-background); + transform: translate(100%, 0); + } + html .col-sidebar > *:last-child { + padding-bottom: 20px; + } + html .overlay { + content: ""; + display: block; + position: fixed; + z-index: 1023; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.75); + visibility: hidden; + } + + .to-has-menu .overlay { + animation: fade-in 0.4s; + } + + .to-has-menu .col-sidebar { + animation: pop-in-from-right 0.4s; + } + + .from-has-menu .overlay { + animation: fade-out 0.4s; + } + + .from-has-menu .col-sidebar { + animation: pop-out-to-right 0.4s; + } + + .has-menu body { + overflow: hidden; + } + .has-menu .overlay { + visibility: visible; + } + .has-menu .col-sidebar { + visibility: visible; + transform: translate(0, 0); + display: flex; + flex-direction: column; + gap: 1.5rem; + max-height: 100vh; + padding: 1rem 2rem; + } + .has-menu .tsd-navigation { + max-height: 100%; + } +} + +/* one sidebar */ +@media (min-width: 770px) { + .container-main { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); + grid-template-areas: "sidebar content"; + margin: 2rem auto; + } + + .col-sidebar { + grid-area: sidebar; + } + .col-content { + grid-area: content; + padding: 0 1rem; + } +} +@media (min-width: 770px) and (max-width: 1399px) { + .col-sidebar { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + padding-top: 1rem; + } + .site-menu { + margin-top: 1rem; + } +} + +/* two sidebars */ +@media (min-width: 1200px) { + .container-main { + grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr) minmax(0, 20rem); + grid-template-areas: "sidebar content toc"; + } + + .col-sidebar { + display: contents; + } + + .page-menu { + grid-area: toc; + padding-left: 1rem; + } + .site-menu { + grid-area: sidebar; + } + + .site-menu { + margin-top: 1rem 0; + } + + .page-menu, + .site-menu { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + } +} diff --git a/docs/classes/nkeyserror.html b/docs/classes/nkeyserror.html index d3bb067..edd2bdc 100644 --- a/docs/classes/nkeyserror.html +++ b/docs/classes/nkeyserror.html @@ -1,187 +1,15 @@ -NKeysError | nkeys.js
-
- -
-
-
-
- -

Class NKeysError

-
-

Hierarchy

-
    -
  • Error -
      -
    • NKeysError
-
-
-
- -
-
-

Constructors

-
-
-

Properties

-
-
-

Methods

-
-
-

Constructors

-
- -
    - -
  • -
    -

    Api

    private

    -
    -
    -

    Parameters

    -
    -

    Returns NKeysError

-
-

Properties

-
- -
chainedError?: Error
-
- -
code: string
-
- -
message: string
-
- -
name: string
-
- -
stack?: string
-
- -
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)
-
-

Type declaration

-
-
- -
stackTraceLimit: number
-
-

Methods

-
- -
    - -
  • -

    Create .stack property on a target object

    -
    -
    -

    Parameters

    -
      -
    • -
      targetObject: object
    • -
    • -
      Optional constructorOpt: Function
    -

    Returns void

-
-
-

Generated using TypeDoc

-
\ No newline at end of file +NKeysError | nkeys.js

Class NKeysError

Hierarchy

  • Error
    • NKeysError

Constructors

  • Parameters

    Returns NKeysError

    Api

    private

    +

Properties

cause?: unknown
chainedError?: Error
code: string
message: string
name: string
stack?: string
prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

+

Type declaration

    • (err, stackTraces): any
    • Parameters

      • err: Error
      • stackTraces: CallSite[]

      Returns any

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    +

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

\ No newline at end of file diff --git a/docs/enums/nkeyserrorcode.html b/docs/enums/nkeyserrorcode.html index dce57ba..88105b1 100644 --- a/docs/enums/nkeyserrorcode.html +++ b/docs/enums/nkeyserrorcode.html @@ -1,151 +1,20 @@ -NKeysErrorCode | nkeys.js
-
- -
-
-
-
- -

Enumeration NKeysErrorCode

-
-

Possible error codes on exceptions thrown by the library.

-
-
-
-
- -
-
-

Enumeration Members

-
- -
ApiError: "nkeys: api error"
-
- -
CannotSign: "nkeys: cannot sign, no private key available"
-
- -
ClearedPair: "nkeys: pair is cleared"
-
- -
InvalidChecksum: "nkeys: invalid checksum"
-
- -
InvalidEncoding: "nkeys: invalid encoded key"
-
- -
InvalidKey: "nkeys: invalid key"
-
- -
InvalidPrefixByte: "nkeys: invalid prefix byte"
-
- -
InvalidPublicKey: "nkeys: invalid public key"
-
- -
InvalidSeed: "nkeys: invalid seed"
-
- -
InvalidSeedLen: "nkeys: invalid seed length"
-
- -
InvalidSignature: "nkeys: signature verification failed"
-
- -
PublicKeyOnly: "nkeys: no seed or private key available"
-
- -
SerializationError: "nkeys: serialization error"
-
-
-

Generated using TypeDoc

-
\ No newline at end of file +NKeysErrorCode | nkeys.js

Enumeration NKeysErrorCode

Possible error codes on exceptions thrown by the library.

+

Enumeration Members

ApiError: "nkeys: api error"
CannotSign: "nkeys: cannot sign, no private key available"
ClearedPair: "nkeys: pair is cleared"
InvalidChecksum: "nkeys: invalid checksum"
InvalidCurveKey: "nkeys: not a valid curve key"
InvalidCurveOperation: "nkeys: curve key is not valid for sign/verify"
InvalidCurveSeed: "nkeys: invalid curve seed"
InvalidEncoding: "nkeys: invalid encoded key"
InvalidEncrypted: "nkeys: encrypted input is not valid"
InvalidKey: "nkeys: invalid key"
InvalidNKeyOperation: "keys: only curve key can seal/open"
InvalidPrefixByte: "nkeys: invalid prefix byte"
InvalidPublicKey: "nkeys: invalid public key"
InvalidRecipient: "nkeys: not a valid recipient public curve key"
InvalidSeed: "nkeys: invalid seed"
InvalidSeedLen: "nkeys: invalid seed length"
PublicKeyOnly: "nkeys: no seed or private key available"
SerializationError: "nkeys: serialization error"
\ No newline at end of file diff --git a/docs/functions/createAccount.html b/docs/functions/createAccount.html index b70e3f6..d62b584 100644 --- a/docs/functions/createAccount.html +++ b/docs/functions/createAccount.html @@ -1,64 +1,3 @@ -createAccount | nkeys.js
-
- -
-
-
-
- -

Function createAccount

-
-
    - -
  • -

    Creates a KeyPair with an account prefix

    - -

    Returns

    Returns the created KeyPair.

    -
    -

    Returns KeyPair

-
-
-

Generated using TypeDoc

-
\ No newline at end of file +createAccount | nkeys.js

Function createAccount

  • Creates a KeyPair with an account prefix

    +

    Returns KeyPair

    Returns the created KeyPair.

    +
\ No newline at end of file diff --git a/docs/functions/createOperator.html b/docs/functions/createOperator.html index 167498e..7abce1f 100644 --- a/docs/functions/createOperator.html +++ b/docs/functions/createOperator.html @@ -1,64 +1,3 @@ -createOperator | nkeys.js
-
- -
-
-
-
- -

Function createOperator

-
-
    - -
  • -

    Creates a KeyPair with an operator prefix

    - -

    Returns

    Returns the created KeyPair.

    -
    -

    Returns KeyPair

-
-
-

Generated using TypeDoc

-
\ No newline at end of file +createOperator | nkeys.js

Function createOperator

  • Creates a KeyPair with an operator prefix

    +

    Returns KeyPair

    Returns the created KeyPair.

    +
\ No newline at end of file diff --git a/docs/functions/createUser.html b/docs/functions/createUser.html index 7400b59..005908d 100644 --- a/docs/functions/createUser.html +++ b/docs/functions/createUser.html @@ -1,64 +1,3 @@ -createUser | nkeys.js
-
- -
-
-
-
- -

Function createUser

-
-
    - -
  • -

    Creates a KeyPair with a user prefix

    - -

    Returns

    Returns the created KeyPair.

    -
    -

    Returns KeyPair

-
-
-

Generated using TypeDoc

-
\ No newline at end of file +createUser | nkeys.js

Function createUser

  • Creates a KeyPair with a user prefix

    +

    Returns KeyPair

    Returns the created KeyPair.

    +
\ No newline at end of file diff --git a/docs/functions/decode.html b/docs/functions/decode.html index 74c28f3..3c59d39 100644 --- a/docs/functions/decode.html +++ b/docs/functions/decode.html @@ -1,69 +1,3 @@ -decode | nkeys.js
-
- -
-
-
-
- -

Function decode

-
-
    - -
  • -

    Decode a base64 encoded string to a binary Uint8Array

    -
    -
    -

    Parameters

    -
      -
    • -
      b64str: string
      -

      encoded string

      -
    -

    Returns Uint8Array

-
-
-

Generated using TypeDoc

-
\ No newline at end of file +decode | nkeys.js

Function decode

  • Decode a base64 encoded string to a binary Uint8Array

    +

    Parameters

    • b64str: string

      encoded string

      +

    Returns Uint8Array

\ No newline at end of file diff --git a/docs/functions/encode.html b/docs/functions/encode.html index 7dadbf1..81d8234 100644 --- a/docs/functions/encode.html +++ b/docs/functions/encode.html @@ -1,69 +1,3 @@ -encode | nkeys.js
-
- -
-
-
-
- -

Function encode

-
-
    - -
  • -

    Encode binary data to a base64 string

    -
    -
    -

    Parameters

    -
      -
    • -
      bytes: Uint8Array
      -

      to encode to base64

      -
    -

    Returns string

-
-
-

Generated using TypeDoc

-
\ No newline at end of file +encode | nkeys.js

Function encode

  • Encode binary data to a base64 string

    +

    Parameters

    • bytes: Uint8Array

      to encode to base64

      +

    Returns string

\ No newline at end of file diff --git a/docs/functions/fromCurveSeed.html b/docs/functions/fromCurveSeed.html new file mode 100644 index 0000000..6966ac7 --- /dev/null +++ b/docs/functions/fromCurveSeed.html @@ -0,0 +1 @@ +fromCurveSeed | nkeys.js

Function fromCurveSeed

  • Parameters

    • src: Uint8Array

    Returns KeyPair

\ No newline at end of file diff --git a/docs/functions/fromPublic.html b/docs/functions/fromPublic.html index 18ffdd7..37ae453 100644 --- a/docs/functions/fromPublic.html +++ b/docs/functions/fromPublic.html @@ -1,73 +1,5 @@ -fromPublic | nkeys.js
-
- -
-
-
-
- -

Function fromPublic

-
-
    - -
  • -

    Creates a KeyPair from a specified public key

    - -

    Returns

    Returns the created KeyPair.

    - -

    See

    KeyPair#getPublicKey

    -
    -
    -

    Parameters

    -
      -
    • -
      src: string
      -

      of the public key in string format.

      -
    -

    Returns KeyPair

-
-
-

Generated using TypeDoc

-
\ No newline at end of file +fromPublic | nkeys.js

Function fromPublic

  • Creates a KeyPair from a specified public key

    +

    Parameters

    • src: string

      of the public key in string format.

      +

    Returns KeyPair

    Returns the created KeyPair.

    +

    See

    KeyPair#getPublicKey

    +
\ No newline at end of file diff --git a/docs/functions/fromSeed.html b/docs/functions/fromSeed.html index 737f151..5932aa1 100644 --- a/docs/functions/fromSeed.html +++ b/docs/functions/fromSeed.html @@ -1,73 +1,5 @@ -fromSeed | nkeys.js
-
- -
-
-
-
- -

Function fromSeed

-
-
    - -
  • -

    Creates a KeyPair from a specified seed.

    - -

    Returns

    Returns the created KeyPair.

    - -

    See

    KeyPair#getSeed

    -
    -
    -

    Parameters

    -
      -
    • -
      src: Uint8Array
      -

      of the seed key as Uint8Array

      -
    -

    Returns KeyPair

-
-
-

Generated using TypeDoc

-
\ No newline at end of file +fromSeed | nkeys.js

Function fromSeed

  • Creates a KeyPair from a specified seed.

    +

    Parameters

    • src: Uint8Array

      of the seed key as Uint8Array

      +

    Returns KeyPair

    Returns the created KeyPair.

    +

    See

    KeyPair#getSeed

    +
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index e83a9a2..7db5d7e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,75 +1,12 @@ -nkeys.js
-
- -
-
-
-
-

nkeys.js

-
-
-

Index

-
-

Enumerations

-
-
-

Classes

-
-
-

Interfaces

-
-
-

Functions

-
-
-
-

Generated using TypeDoc

-
\ No newline at end of file +nkeys.js
\ No newline at end of file diff --git a/docs/interfaces/keypair.html b/docs/interfaces/keypair.html index a250173..111284e 100644 --- a/docs/interfaces/keypair.html +++ b/docs/interfaces/keypair.html @@ -1,165 +1,25 @@ -KeyPair | nkeys.js
-
- -
-
-
-
- -

Interface KeyPair

-
-

Hierarchy

-
    -
  • KeyPair
-
-
-
- -
-
-

Methods

-
- -
    - -
  • -

    Clears the secret stored in the keypair. After clearing +KeyPair | nkeys.js

    Interface KeyPair

    interface KeyPair {
        clear(): void;
        getPrivateKey(): Uint8Array;
        getPublicKey(): string;
        getSeed(): Uint8Array;
        open(message, sender): Uint8Array;
        seal(input, recipient, nonce?): Uint8Array;
        sign(input): Uint8Array;
        verify(input, sig): boolean;
    }

    Methods

    • Clears the secret stored in the keypair. After clearing a keypair cannot be used or recovered.

      -
      -

      Returns void

    -
    - -
      - -
    • -

      Returns the private key associated with the KeyPair

      - -

      Returns

      Uint8Array

      - -

      Throws

      NKeysError

      -
      -

      Returns Uint8Array

    -
    - -
      - -
    • -

      Returns the public key associated with the KeyPair

      - -

      Returns

      -

      Throws

      NKeysError

      -
      -

      Returns string

    -
    - -
      - -
    • -

      Returns the PrivateKey's seed.

      - -

      Returns

      Uint8Array

      - -

      Throws

      NKeysError

      -
      -

      Returns Uint8Array

    -
    - -
      - -
    • -

      Returns the digital signature of signing the input with the +

      Returns void

    • Returns the private key associated with the KeyPair

      +

      Returns Uint8Array

      Uint8Array

      +

      Throws

      NKeysError

      +
    • Returns the public key associated with the KeyPair

      +

      Returns string

      Throws

      NKeysError

      +
    • Returns the PrivateKey's seed.

      +

      Returns Uint8Array

      Uint8Array

      +

      Throws

      NKeysError

      +
    • Parameters

      • message: Uint8Array
      • sender: string

      Returns Uint8Array

    • Parameters

      • input: Uint8Array
      • recipient: string
      • Optional nonce: Uint8Array

      Returns Uint8Array

    • Returns the digital signature of signing the input with the the KeyPair's private key.

      - -

      Returns

      Uint8Array

      - -

      Throws

      NKeysError

      -
      -
      -

      Parameters

      -
        -
      • -
        input: Uint8Array
      -

      Returns Uint8Array

    -
    - -
      - -
    • -

      Returns true if the signature can be verified with the KeyPair

      - -

      Returns

      -

      Throws

      NKeysError

      -
      -
      -

      Parameters

      -
        -
      • -
        input: Uint8Array
      • -
      • -
        sig: Uint8Array
      -

      Returns boolean

    -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Parameters

    • input: Uint8Array

    Returns Uint8Array

    Uint8Array

    +

    Throws

    NKeysError

    +
  • Returns true if the signature can be verified with the KeyPair

    +

    Parameters

    • input: Uint8Array
    • sig: Uint8Array

    Returns boolean

    Throws

    NKeysError

    +
\ No newline at end of file diff --git a/jsr.json b/jsr.json new file mode 100644 index 0000000..2f8d882 --- /dev/null +++ b/jsr.json @@ -0,0 +1,18 @@ +{ + "name": "@nats-io/nkeys", + "version": "1.2.0-1", + "exports": { + ".": "./modules/esm/mod.ts" + }, + "publish": { + "include": [ + "LICENSE", + "CODE-OF-CONDUCT.md", + "MANTAINERS.md", + "README.md", + "./modules/esm/*", + "./src/**/*", + "jsr.json" + ] + } +} diff --git a/modules/cjs/index.ts b/modules/cjs/index.ts index 97da766..920117c 100644 --- a/modules/cjs/index.ts +++ b/modules/cjs/index.ts @@ -1,12 +1,12 @@ /** * @ignore */ -//@ts-ignore +//@ts-ignore: building in node const nacl = require("tweetnacl"); /** * @ignore */ -//@ts-ignore +//@ts-ignore: injection of configuration const helper = { randomBytes: nacl.randomBytes, verify: nacl.sign.detached.verify, @@ -17,34 +17,15 @@ const helper = { open: nacl.box.open, }; -// This here to support node 10. -if (typeof TextEncoder === "undefined") { - //@ts-ignore - const util = require("util"); - //@ts-ignore - global.TextEncoder = util.TextEncoder; - //@ts-ignore - global.TextDecoder = util.TextDecoder; -} - -if (typeof atob === "undefined") { - global.atob = (a) => { - return Buffer.from(a, "base64").toString("binary"); - }; - global.btoa = (b) => { - return Buffer.from(b, "binary").toString("base64"); - }; -} - /** * @ignore */ -//@ts-ignore +//@ts-ignore: building in node const { setEd25519Helper } = require("./helper.ts"); setEd25519Helper(helper); /** * @ignore */ -//@ts-ignore +//@ts-ignore: building in node export * from "./mod.ts"; diff --git a/node_test/basics_test.js b/node_test/basics_test.js index 7fb4be5..7a5e33e 100644 --- a/node_test/basics_test.js +++ b/node_test/basics_test.js @@ -13,7 +13,9 @@ * limitations under the License. */ // -const test = require("ava"); +const test = require("node:test"); +const assert = require("node:assert"); + const { createAccount, createOperator, @@ -32,90 +34,99 @@ const { const { Codec } = require("../lib/codec"); -function testClear(t, kp) { +function throws(fn, errCode) { + try { + fn(); + } catch (err) { + const { code } = err; + assert.strictEqual(code, errCode); + } +} + +function testClear(kp) { kp.clear(); - t.throws(() => { + throws(() => { kp.getPublicKey(); - }, { code: NKeysErrorCode.ClearedPair }); + }, NKeysErrorCode.ClearedPair); - t.throws(() => { + throws(() => { kp.getPrivateKey(); - }, { code: NKeysErrorCode.ClearedPair }); + }, NKeysErrorCode.ClearedPair); - t.throws(() => { + throws(() => { kp.getSeed(); - }, { code: NKeysErrorCode.ClearedPair }); + }, NKeysErrorCode.ClearedPair); - t.throws(() => { + throws(() => { const data = new TextEncoder().encode("hello"); kp.sign(data); - }, { code: NKeysErrorCode.ClearedPair }); + }, NKeysErrorCode.ClearedPair); - t.throws(() => { + throws(() => { const data = new TextEncoder().encode("hello"); const sig = kp.sign(data); kp.verify(data, sig); - }, { code: NKeysErrorCode.ClearedPair }); + }, NKeysErrorCode.ClearedPair); } -function doTest(t, kp, kind) { - t.truthy(kp); +function doTest(kp, kind) { + assert.ok(kp); const seed = kp.getSeed(); - t.is(seed[0], "S".charCodeAt(0)); - t.is(seed[1], kind.charCodeAt(0)); + assert.strictEqual(seed[0], "S".charCodeAt(0)); + assert.strictEqual(seed[1], kind.charCodeAt(0)); const publicKey = kp.getPublicKey(); - t.is(publicKey[0], kind.charAt(0)); + assert.strictEqual(publicKey[0], kind.charAt(0)); const data = new TextEncoder().encode("HelloWorld"); const sig = kp.sign(data); - t.is(sig.length, 64); - t.true(kp.verify(data, sig)); + assert.strictEqual(sig.length, 64); + assert.strictEqual(kp.verify(data, sig), true); const sk = fromSeed(seed); - t.true(sk.verify(data, sig)); + assert.strictEqual(sk.verify(data, sig), true); const pub = fromPublic(publicKey); - t.is(pub.getPublicKey(), publicKey); - t.true(pub.verify(data, sig)); + assert.strictEqual(pub.getPublicKey(), publicKey); + assert.strictEqual(pub.verify(data, sig), true); - t.throws(() => { + throws(() => { pub.getPrivateKey(); - }, { code: NKeysErrorCode.PublicKeyOnly }); - t.true(pub.verify(data, sig)); + }, NKeysErrorCode.PublicKeyOnly); + assert.strictEqual(pub.verify(data, sig), true); - t.throws(() => { + throws(() => { pub.getSeed(); - }, { code: NKeysErrorCode.PublicKeyOnly }); + }, NKeysErrorCode.PublicKeyOnly); - testClear(t, kp); - testClear(t, pub); + testClear(kp); + testClear(pub); } -test("basics - operator", (t) => { - doTest(t, createOperator(), "O"); +test("basics - operator", () => { + doTest(createOperator(), "O"); }); -test("basics - account", (t) => { - doTest(t, createAccount(), "A"); +test("basics - account", () => { + doTest(createAccount(), "A"); }); -test("basics - user", (t) => { - doTest(t, createUser(), "U"); +test("basics - user", () => { + doTest(createUser(), "U"); }); -test("basics - cluster", (t) => { - doTest(t, createCluster(), "C"); +test("basics - cluster", () => { + doTest(createCluster(), "C"); }); -test("basics - server", (t) => { - doTest(t, createServer(), "N"); +test("basics - server", () => { + doTest(createServer(), "N"); }); -test("integration - verify", (t) => { - let data = { +test("integration - verify", () => { + const data = { "seed": "SAAFYOZ5U4UBAJMHPITLSKDWAFBJNWH53K7LPZDQKOC5TXAGBIP4DY4WCA", "public_key": "AAASUT7FDZDS6UCTBE7JQS2G6KUZBJC5YW7VFVK45JLUK3UDVA6NXJWD", "private_key": @@ -127,19 +138,19 @@ test("integration - verify", (t) => { const te = new TextEncoder(); const pk = fromPublic(data.public_key); - let nonce = te.encode(data.nonce); - let sig = decode(data.sig); - t.true(pk.verify(nonce, sig)); + const nonce = te.encode(data.nonce); + const sig = decode(data.sig); + assert.strictEqual(pk.verify(nonce, sig), true); const seed = fromSeed(te.encode(data.seed)); - t.true(seed.verify(nonce, sig)); + assert.strictEqual(seed.verify(nonce, sig), true); const sig2 = seed.sign(nonce); const encsig = encode(sig2); - t.is(encsig, data.sig); + assert.strictEqual(encsig, data.sig); }); -test("integration - encoded seed returns stable values albertor", (t) => { - let data = { +test("integration - encoded seed returns stable values albertor", () => { + const data = { "seed": "SUAGC3DCMVZHI33SMFWGEZLSORXXEYLMMJSXE5DPOJQWYYTFOJ2G64VAPY", "public_key": "UAHJLSMYZDJCBHQ2SARL37IEALR3TI7VVPZ2MJ7F4SZKNOG7HJJIYW5T", "private_key": @@ -154,15 +165,19 @@ test("integration - encoded seed returns stable values albertor", (t) => { Prefix.User, new TextEncoder().encode("albertoralbertoralbertoralbertor"), ); - t.is(td.decode(v), data.seed); + assert.strictEqual(td.decode(v), data.seed); const kp = fromSeed(v); - t.is(td.decode(kp.getSeed()), data.seed, "seed"); - t.is(kp.getPublicKey(), data.public_key, "public key"); - t.is(td.decode(kp.getPrivateKey()), data.private_key, "private key"); + assert.strictEqual(td.decode(kp.getSeed()), data.seed, "seed"); + assert.strictEqual(kp.getPublicKey(), data.public_key, "public key"); + assert.strictEqual( + td.decode(kp.getPrivateKey()), + data.private_key, + "private key", + ); }); -test("integration - curve encrypt", (t) => { +test("integration - curve encrypt", () => { // this is actual data generated by the nkeys go library const expected = [ 120, @@ -235,10 +250,10 @@ test("integration - curve encrypt", (t) => { const data = new TextEncoder().encode("hello world"); const enc = kp.seal(data, pub2, nonce); - t.deepEqual(enc, new Uint8Array(expected)); + assert.deepEqual(enc, new Uint8Array(expected)); }); -test("integration - curve decrypt", (t) => { +test("integration - curve decrypt", () => { // this is actual data generated by the nkeys go library const message = [ 120, @@ -306,5 +321,5 @@ test("integration - curve decrypt", (t) => { const senderPK = kp2.getPublicKey(); const enc = kp.open(new Uint8Array(message), senderPK) ?? new Uint8Array(); - t.is(new TextDecoder().decode(enc), "hello world"); + assert.strictEqual(new TextDecoder().decode(enc), "hello world"); }); diff --git a/package-lock.json b/package-lock.json index 7e5626f..e9b7c3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,21 +1,21 @@ { "name": "nkeys.js", - "version": "1.1.0", + "version": "1.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nkeys.js", - "version": "1.1.0", + "version": "1.2.0", "license": "Apache-2.0", "dependencies": { "tweetnacl": "1.0.3" }, "devDependencies": { - "@types/node": "^20.11.x", - "ava": "^6.1.x", - "typedoc": "^0.25.8", - "typescript": "^5.3.3" + "@types/node": "^20.12.10", + "ava": "^6.1.3", + "typedoc": "^0.25.13", + "typescript": "^5.4.5" }, "engines": { "node": ">=10.0.0" @@ -114,9 +114,9 @@ } }, "node_modules/@types/node": { - "version": "20.11.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", - "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", + "version": "20.12.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.10.tgz", + "integrity": "sha512-Eem5pH9pmWBHoGAT8Dr5fdc5rYA+4NAovdM4EktRPVAAiJhmWWfQrA0cFhAbOsQdSfIHjAud6YdkbL69+zSKjw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -167,9 +167,9 @@ } }, "node_modules/acorn-import-attributes": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.2.tgz", - "integrity": "sha512-O+nfJwNolEA771IYJaiLWK1UAwjNsQmZbTRqqwBYxCgVQTmpFEMvBw6LOIQV0Me339L5UMVYFyRohGnGlQDdIQ==", + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peerDependencies": { "acorn": "^8" @@ -291,9 +291,9 @@ "dev": true }, "node_modules/ava": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/ava/-/ava-6.1.1.tgz", - "integrity": "sha512-A+DG0Ag0e5zvt262Ze0pG5QH7EBmhn+DB9uK7WkUtJVAtGjZFeKTpUOKx339DMGn53+FB24pCJC5klX2WU4VOw==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/ava/-/ava-6.1.3.tgz", + "integrity": "sha512-tkKbpF1pIiC+q09wNU9OfyTDYZa8yuWvU2up3+lFJ3lr1RmnYh2GBpPwzYUEB0wvTPIUysGjcZLNZr7STDviRA==", "dev": true, "dependencies": { "@vercel/nft": "^0.26.2", @@ -341,7 +341,7 @@ "ava": "entrypoints/cli.mjs" }, "engines": { - "node": "^18.18 || ^20.8 || ^21" + "node": "^18.18 || ^20.8 || ^21 || ^22" }, "peerDependencies": { "@ava/typescript": "*" @@ -374,12 +374,13 @@ "dev": true }, "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "node_modules/braces": { @@ -685,18 +686,18 @@ "dev": true }, "node_modules/detect-libc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/emittery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-1.0.1.tgz", - "integrity": "sha512-2ID6FdrMD9KDLldGesP6317G78K7km/kMcwItRtVFva7I/cSEOIaLpewaUb+YLXVwdAp3Ctfxh/V5zIl1sj7dQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-1.0.3.tgz", + "integrity": "sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==", "dev": true, "engines": { "node": ">=14.16" @@ -712,9 +713,9 @@ "dev": true }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true, "engines": { "node": ">=6" @@ -792,9 +793,9 @@ } }, "node_modules/figures": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/figures/-/figures-6.0.1.tgz", - "integrity": "sha512-0oY/olScYD4IhQ8u//gCPA4F3mlTn2dacYmiDm/mbDQvpmLjV4uH+zhsQ5IyXRyvqkvtUkXkNdGvg5OFJTCsuQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", + "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==", "dev": true, "dependencies": { "is-unicode-supported": "^2.0.0" @@ -910,12 +911,6 @@ "node": ">=8" } }, - "node_modules/gauge/node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, "node_modules/gauge/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -995,28 +990,6 @@ "node": ">= 6" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/globby": { "version": "14.0.1", "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", @@ -1241,18 +1214,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/lunr": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", @@ -1372,9 +1333,9 @@ } }, "node_modules/mimic-function": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.0.tgz", - "integrity": "sha512-RBfQ+9X9DpXdEoK7Bu+KeEU6vFhumEIiXKWECPzRBmDserEq4uR2b/VCm0LwpMSosoq2k+Zuxj/GzOr0Fn6h/g==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", "dev": true, "engines": { "node": ">=18" @@ -1384,18 +1345,15 @@ } }, "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "*" } }, "node_modules/minipass": { @@ -1471,9 +1429,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.0.tgz", - "integrity": "sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", + "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", "dev": true, "bin": { "node-gyp-build": "bin.js", @@ -1536,9 +1494,9 @@ } }, "node_modules/p-map": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.1.tgz", - "integrity": "sha512-2wnaR0XL/FDOj+TgpDuRb2KTjLnu3Fma6b1ZUwGY7LcqenMcvP/YFpjpbPKY6WVGsbuJZRuoUz8iPrt8ORnAFw==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.2.tgz", + "integrity": "sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==", "dev": true, "engines": { "node": ">=18" @@ -1771,13 +1729,10 @@ ] }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", + "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -1819,16 +1774,10 @@ } }, "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true }, "node_modules/slash": { "version": "5.1.0", @@ -1942,9 +1891,9 @@ } }, "node_modules/tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", "dev": true, "dependencies": { "chownr": "^2.0.0", @@ -2012,9 +1961,9 @@ } }, "node_modules/typedoc": { - "version": "0.25.8", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.8.tgz", - "integrity": "sha512-mh8oLW66nwmeB9uTa0Bdcjfis+48bAjSH3uqdzSuSawfduROQLlXw//WSNZLYDdhmMVB7YcYZicq6e8T0d271A==", + "version": "0.25.13", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.13.tgz", + "integrity": "sha512-pQqiwiJ+Z4pigfOnnysObszLiU3mVLWAExSPf+Mu06G/qsc3wzbuM56SZQvONhHLncLUhYzOVkjFFpFfL5AzhQ==", "dev": true, "dependencies": { "lunr": "^2.3.9", @@ -2029,13 +1978,37 @@ "node": ">= 16" }, "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x" + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x" + } + }, + "node_modules/typedoc/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/typedoc/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -2266,6 +2239,18 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 75dc7d0..2487e8c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nkeys.js", - "version": "1.1.0", + "version": "1.2.0-1", "description": "A public-key signature system based on Ed25519 for the NATS ecosystem in javascript", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -11,8 +11,8 @@ "cjs": "deno run --allow-all bin/cjs-fix-imports.ts -o build/ src/ modules/cjs/ node_test/", "generate": "deno run -A ./bin/tweetnacl-esm.ts", "stage": "npm run init && npm run cjs && npm run generate && tsc", - "prepare": "npm run stage && npm run generate && deno bundle modules/esm/mod.ts nkeys.mjs && tsc", - "test": "npm run prepare && ava --verbose && deno test -A test/", + "prepare": "npm run stage && npm run generate && deno bundle modules/esm/mod.ts nkeys.mjs", + "test": "npm run clean && npm run prepare && node --test && deno test -A test/", "cover": "npm run clean && npm run prepare && deno test --coverage=coverage -A test/ && deno coverage ./coverage --lcov > ./coverage/out.lcov && genhtml -o ./coverage/html ./coverage/out.lcov && open ./coverage/html/index.html", "doc": "npm run clean && rm -Rf docs && npm run stage && node_modules/.bin/typedoc --out docs/ && touch ./docs/.nojekyll", "bump-qualifier": "npm version prerelease --no-commit-hooks --no-git-tag-version", @@ -20,7 +20,7 @@ "check-package": "deno run --allow-all bin/check-bundle-version.ts" }, "engines": { - "node": ">=10.0.0" + "node": ">=18.0.0" }, "repository": { "type": "git", @@ -37,16 +37,8 @@ "tweetnacl": "1.0.3" }, "devDependencies": { - "@types/node": "^20.11.x", - "ava": "^6.1.x", - "typedoc": "^0.25.8", - "typescript": "^5.3.3" - }, - "ava": { - "failFast": true, - "require": [], - "files": [ - "./node_test/*.js" - ] + "@types/node": "^20.12.10", + "typedoc": "^0.25.13", + "typescript": "^5.4.5" } } diff --git a/src/base32.ts b/src/base32.ts index 7d05c8a..c6edbc0 100644 --- a/src/base32.ts +++ b/src/base32.ts @@ -28,20 +28,20 @@ export class base32 { static encode(src: Uint8Array): Uint8Array { let bits = 0; let value = 0; - let a = new Uint8Array(src); - let buf = new Uint8Array(src.byteLength * 2); + const a = new Uint8Array(src); + const buf = new Uint8Array(src.byteLength * 2); let j = 0; for (let i = 0; i < a.byteLength; i++) { value = (value << 8) | a[i]; bits += 8; while (bits >= 5) { - let index = (value >>> (bits - 5)) & 31; + const index = (value >>> (bits - 5)) & 31; buf[j++] = b32Alphabet.charAt(index).charCodeAt(0); bits -= 5; } } if (bits > 0) { - let index = (value << (5 - bits)) & 31; + const index = (value << (5 - bits)) & 31; buf[j++] = b32Alphabet.charAt(index).charCodeAt(0); } return buf.slice(0, j); @@ -51,11 +51,11 @@ export class base32 { let bits = 0; let byte = 0; let j = 0; - let a = new Uint8Array(src); - let out = new Uint8Array(a.byteLength * 5 / 8 | 0); + const a = new Uint8Array(src); + const out = new Uint8Array(a.byteLength * 5 / 8 | 0); for (let i = 0; i < a.byteLength; i++) { - let v = String.fromCharCode(a[i]); - let vv = b32Alphabet.indexOf(v); + const v = String.fromCharCode(a[i]); + const vv = b32Alphabet.indexOf(v); if (vv === -1) { throw new Error("Illegal Base32 character: " + a[i]); } diff --git a/src/crc16.ts b/src/crc16.ts index 3b53ae3..faa54e5 100644 --- a/src/crc16.ts +++ b/src/crc16.ts @@ -284,7 +284,7 @@ export class crc16 { static checksum(data: Uint8Array): number { let crc: number = 0; for (let i = 0; i < data.byteLength; i++) { - let b = data[i]; + const b = data[i]; crc = ((crc << 8) & 0xffff) ^ crc16tab[((crc >> 8) ^ b) & 0x00FF]; } return crc; @@ -292,7 +292,7 @@ export class crc16 { // validate will check the calculated crc16 checksum for data against the expected. static validate(data: Uint8Array, expected: number): boolean { - let ba = crc16.checksum(data); + const ba = crc16.checksum(data); return ba == expected; } } diff --git a/src/curve.ts b/src/curve.ts index 414eece..f57d8a3 100644 --- a/src/curve.ts +++ b/src/curve.ts @@ -103,7 +103,7 @@ export class CurveKP implements KeyPair { if (!nonce) { nonce = getEd25519Helper().randomBytes(curveNonceLen); } - let pub = this.decodePubCurveKey(recipient); + const pub = this.decodePubCurveKey(recipient); // prefix a header to the nonce const out = new Uint8Array(XKeyVersionV1.length + curveNonceLen); diff --git a/src/kp.ts b/src/kp.ts index 0ebdc02..82f264f 100644 --- a/src/kp.ts +++ b/src/kp.ts @@ -30,7 +30,7 @@ export class KP implements KeyPair { if (!this.seed) { throw new NKeysError(NKeysErrorCode.ClearedPair); } - let sd = Codec.decodeSeed(this.seed); + const sd = Codec.decodeSeed(this.seed); return sd.buf; } @@ -83,11 +83,11 @@ export class KP implements KeyPair { this.seed = undefined; } - seal(input: Uint8Array, recipient: string, nonce?: Uint8Array): Uint8Array { + seal(_: Uint8Array, _recipient: string, _nonce?: Uint8Array): Uint8Array { throw new NKeysError(NKeysErrorCode.InvalidNKeyOperation); } - open(message: Uint8Array, sender: string): Uint8Array | null { + open(_: Uint8Array, _sender: string): Uint8Array | null { throw new NKeysError(NKeysErrorCode.InvalidNKeyOperation); } } diff --git a/src/nkeys.ts b/src/nkeys.ts index d00aca9..f7a2b88 100644 --- a/src/nkeys.ts +++ b/src/nkeys.ts @@ -24,7 +24,7 @@ import { curveKeyLen, CurveKP } from "./curve.ts"; export function createPair(prefix: Prefix): KeyPair { const len = prefix === Prefix.Curve ? curveKeyLen : 32; const rawSeed = getEd25519Helper().randomBytes(len); - let str = Codec.encodeSeed(prefix, new Uint8Array(rawSeed)); + const str = Codec.encodeSeed(prefix, new Uint8Array(rawSeed)); return prefix === Prefix.Curve ? new CurveKP(new Uint8Array(rawSeed)) : new KP(str); @@ -212,13 +212,13 @@ export class Prefixes { } static startsWithValidPrefix(s: string) { - let c = s[0]; + const c = s[0]; return c == "S" || c == "P" || c == "O" || c == "N" || c == "C" || c == "A" || c == "U" || c == "X"; } static isValidPrefix(prefix: Prefix): boolean { - let v = this.parsePrefix(prefix); + const v = this.parsePrefix(prefix); return v !== Prefix.Unknown; } diff --git a/src/public.ts b/src/public.ts index a3bb1f7..38d8b21 100644 --- a/src/public.ts +++ b/src/public.ts @@ -59,7 +59,7 @@ export class PublicKey implements KeyPair { if (!this.publicKey) { throw new NKeysError(NKeysErrorCode.ClearedPair); } - let buf = Codec._decode(this.publicKey); + const buf = Codec._decode(this.publicKey); return getEd25519Helper().verify(input, sig, buf.slice(1)); } @@ -71,11 +71,11 @@ export class PublicKey implements KeyPair { this.publicKey = undefined; } - seal(input: Uint8Array, recipient: string, nonce?: Uint8Array): Uint8Array { + seal(_: Uint8Array, _recipient: string, _nonce?: Uint8Array): Uint8Array { throw new NKeysError(NKeysErrorCode.InvalidNKeyOperation); } - open(message: Uint8Array, sender: string): Uint8Array | null { + open(_: Uint8Array, _sender: string): Uint8Array | null { throw new NKeysError(NKeysErrorCode.InvalidNKeyOperation); } } diff --git a/src/util.ts b/src/util.ts index 7755b87..de49a99 100644 --- a/src/util.ts +++ b/src/util.ts @@ -40,7 +40,7 @@ export function dump(buf: Uint8Array, msg?: string): void { if (msg) { console.log(msg); } - let a: string[] = []; + const a: string[] = []; for (let i = 0; i < buf.byteLength; i++) { if (i % 8 === 0) { a.push("\n"); diff --git a/tsconfig.json b/tsconfig.json index 0ad4f1a..1abe723 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,13 @@ { "compilerOptions": { - "target": "ES6", - "module": "CommonJS", + "target": "esnext", + "module": "nodenext", "outDir": "lib", - "moduleResolution": "node", - "declaration": true + "moduleResolution": "nodenext", + "sourceMap": true, + "declaration": true, + "allowJs": true, + "removeComments": false }, "include": [ "build"