From fa23cddfdc7e39aab76c9b8b1a1be065aa2d6d77 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 08:23:10 +0000 Subject: [PATCH] Deploy to GitHub pages --- .nojekyll | 1 + CNAME | 1 + assets/highlight.css | 85 + assets/icons.js | 15 + assets/icons.svg | 1 + assets/main.js | 59 + assets/navigation.js | 1 + assets/search.js | 1 + assets/style.css | 1415 +++++++++++++++++ ...maphore_protocol_data.SemaphoreEthers.html | 37 + ...phore_protocol_data.SemaphoreSubgraph.html | 33 + classes/_semaphore_protocol_group.Group.html | 58 + ..._semaphore_protocol_heyauthn.HeyAuthn.html | 17 + ..._semaphore_protocol_heyauthn.Identity.html | 55 + ..._semaphore_protocol_identity.Identity.html | 55 + ...emaphore_protocol_proof.generateProof.html | 19 + ...phore_protocol_proof.packGroth16Proof.html | 4 + ...ore_protocol_proof.unpackGroth16Proof.html | 4 + ..._semaphore_protocol_proof.verifyProof.html | 5 + ...emaphore_protocol_utils.decodeMessage.html | 9 + ...re_protocol_utils.getDeployedContract.html | 4 + ...ore_protocol_utils.getHardhatNetworks.html | 5 + ...ore_protocol_utils.isSupportedNetwork.html | 3 + index.html | 333 ++++ modules/_semaphore_protocol_core.html | 64 + modules/_semaphore_protocol_data.html | 117 ++ modules/_semaphore_protocol_group.html | 95 ++ modules/_semaphore_protocol_heyauthn.html | 79 + modules/_semaphore_protocol_identity.html | 76 + modules/_semaphore_protocol_proof.html | 85 + .../_semaphore_protocol_utils.constants.html | 3 + modules/_semaphore_protocol_utils.html | 70 + ...semaphore_protocol_data.EthersNetwork.html | 1 + ...semaphore_protocol_data.EthersOptions.html | 1 + ..._semaphore_protocol_data.GroupOptions.html | 1 + ...semaphore_protocol_data.GroupResponse.html | 1 + ..._semaphore_protocol_group.MerkleProof.html | 9 + ...otocol_heyauthn.AuthenticationOptions.html | 1 + ...protocol_heyauthn.RegistrationOptions.html | 1 + ...maphore_protocol_proof.SemaphoreProof.html | 1 + ...maphore_protocol_proof.SnarkArtifacts.html | 1 + ...phore_protocol_utils.SupportedNetwork.html | 1 + ...re_protocol_utils.constants.MAX_DEPTH.html | 1 + ...re_protocol_utils.constants.MIN_DEPTH.html | 1 + ...maphore_protocol_utils.defaultNetwork.html | 1 + ...hore_protocol_utils.deployedContracts.html | 1 + ...hore_protocol_utils.supportedNetworks.html | 1 + 47 files changed, 2832 insertions(+) create mode 100644 .nojekyll create mode 100644 CNAME create mode 100644 assets/highlight.css create mode 100644 assets/icons.js create mode 100644 assets/icons.svg create mode 100644 assets/main.js create mode 100644 assets/navigation.js create mode 100644 assets/search.js create mode 100644 assets/style.css create mode 100644 classes/_semaphore_protocol_data.SemaphoreEthers.html create mode 100644 classes/_semaphore_protocol_data.SemaphoreSubgraph.html create mode 100644 classes/_semaphore_protocol_group.Group.html create mode 100644 classes/_semaphore_protocol_heyauthn.HeyAuthn.html create mode 100644 classes/_semaphore_protocol_heyauthn.Identity.html create mode 100644 classes/_semaphore_protocol_identity.Identity.html create mode 100644 functions/_semaphore_protocol_proof.generateProof.html create mode 100644 functions/_semaphore_protocol_proof.packGroth16Proof.html create mode 100644 functions/_semaphore_protocol_proof.unpackGroth16Proof.html create mode 100644 functions/_semaphore_protocol_proof.verifyProof.html create mode 100644 functions/_semaphore_protocol_utils.decodeMessage.html create mode 100644 functions/_semaphore_protocol_utils.getDeployedContract.html create mode 100644 functions/_semaphore_protocol_utils.getHardhatNetworks.html create mode 100644 functions/_semaphore_protocol_utils.isSupportedNetwork.html create mode 100644 index.html create mode 100644 modules/_semaphore_protocol_core.html create mode 100644 modules/_semaphore_protocol_data.html create mode 100644 modules/_semaphore_protocol_group.html create mode 100644 modules/_semaphore_protocol_heyauthn.html create mode 100644 modules/_semaphore_protocol_identity.html create mode 100644 modules/_semaphore_protocol_proof.html create mode 100644 modules/_semaphore_protocol_utils.constants.html create mode 100644 modules/_semaphore_protocol_utils.html create mode 100644 types/_semaphore_protocol_data.EthersNetwork.html create mode 100644 types/_semaphore_protocol_data.EthersOptions.html create mode 100644 types/_semaphore_protocol_data.GroupOptions.html create mode 100644 types/_semaphore_protocol_data.GroupResponse.html create mode 100644 types/_semaphore_protocol_group.MerkleProof.html create mode 100644 types/_semaphore_protocol_heyauthn.AuthenticationOptions.html create mode 100644 types/_semaphore_protocol_heyauthn.RegistrationOptions.html create mode 100644 types/_semaphore_protocol_proof.SemaphoreProof.html create mode 100644 types/_semaphore_protocol_proof.SnarkArtifacts.html create mode 100644 types/_semaphore_protocol_utils.SupportedNetwork.html create mode 100644 variables/_semaphore_protocol_utils.constants.MAX_DEPTH.html create mode 100644 variables/_semaphore_protocol_utils.constants.MIN_DEPTH.html create mode 100644 variables/_semaphore_protocol_utils.defaultNetwork.html create mode 100644 variables/_semaphore_protocol_utils.deployedContracts.html create mode 100644 variables/_semaphore_protocol_utils.supportedNetworks.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e2ac6616a --- /dev/null +++ b/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..5c50c2ca6 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +js.semaphore.pse.dev \ No newline at end of file diff --git a/assets/highlight.css b/assets/highlight.css new file mode 100644 index 000000000..2da8aaf91 --- /dev/null +++ b/assets/highlight.css @@ -0,0 +1,85 @@ +:root { + --light-hl-0: #795E26; + --dark-hl-0: #DCDCAA; + --light-hl-1: #000000; + --dark-hl-1: #D4D4D4; + --light-hl-2: #A31515; + --dark-hl-2: #CE9178; + --light-hl-3: #008000; + --dark-hl-3: #6A9955; + --light-hl-4: #AF00DB; + --dark-hl-4: #C586C0; + --light-hl-5: #001080; + --dark-hl-5: #9CDCFE; + --light-hl-6: #0000FF; + --dark-hl-6: #569CD6; + --light-hl-7: #0070C1; + --dark-hl-7: #4FC1FF; + --light-hl-8: #098658; + --dark-hl-8: #B5CEA8; + --light-code-background: #FFFFFF; + --dark-code-background: #1E1E1E; +} + +@media (prefers-color-scheme: light) { :root { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --code-background: var(--light-code-background); +} } + +@media (prefers-color-scheme: dark) { :root { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --code-background: var(--dark-code-background); +} } + +:root[data-theme='light'] { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --code-background: var(--light-code-background); +} + +:root[data-theme='dark'] { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --code-background: var(--dark-code-background); +} + +.hl-0 { color: var(--hl-0); } +.hl-1 { color: var(--hl-1); } +.hl-2 { color: var(--hl-2); } +.hl-3 { color: var(--hl-3); } +.hl-4 { color: var(--hl-4); } +.hl-5 { color: var(--hl-5); } +.hl-6 { color: var(--hl-6); } +.hl-7 { color: var(--hl-7); } +.hl-8 { color: var(--hl-8); } +pre, code { background: var(--code-background); } diff --git a/assets/icons.js b/assets/icons.js new file mode 100644 index 000000000..b79c9e89f --- /dev/null +++ b/assets/icons.js @@ -0,0 +1,15 @@ +(function(svg) { + svg.innerHTML = ``; + svg.style.display = 'none'; + if (location.protocol === 'file:') { + if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', updateUseElements); + else updateUseElements() + function updateUseElements() { + document.querySelectorAll('use').forEach(el => { + if (el.getAttribute('href').includes('#icon-')) { + el.setAttribute('href', el.getAttribute('href').replace(/.*#/, '#')); + } + }); + } + } +})(document.body.appendChild(document.createElementNS('http://www.w3.org/2000/svg', 'svg'))) \ No newline at end of file diff --git a/assets/icons.svg b/assets/icons.svg new file mode 100644 index 000000000..7dead6118 --- /dev/null +++ b/assets/icons.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/main.js b/assets/main.js new file mode 100644 index 000000000..1daeb6900 --- /dev/null +++ b/assets/main.js @@ -0,0 +1,59 @@ +"use strict"; +"use strict";(()=>{var Ce=Object.create;var ne=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Pe(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Ce(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),y=s.str.charAt(1),p;y in s.node.edges?p=s.node.edges[y]:(p=new t.TokenSet,s.node.edges[y]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.scrollToHash(),this.updateIndexVisibility())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.scrollToHash(),this.updateIndexVisibility())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!e.checkVisibility()){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${ce(l.parent,i)}.${d}`);let y=document.createElement("li");y.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,y.append(p),e.appendChild(y)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var He={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>He[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",fe="mousemove",H="mouseup",J={x:0,y:0},pe=!1,ee=!1,Be=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(Be=!0,F="touchstart",fe="touchmove",H="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(H,()=>{ee=!1});document.addEventListener("click",t=>{pe&&(t.preventDefault(),t.stopImmediatePropagation(),pe=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(H,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(H,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ye=document.head.appendChild(document.createElement("style"));ye.dataset.for="filters";var Y=class extends I{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ye.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ve(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ve(t.value)})}function ve(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.pathname===r.pathname&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); +/*! Bundled license information: + +lunr/lunr.js: + (** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + *) + (*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + *) + (*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + *) +*/ diff --git a/assets/navigation.js b/assets/navigation.js new file mode 100644 index 000000000..668049034 --- /dev/null +++ b/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA6WWUW/aMBSF/4ufYRus6zaehtYK+kBXlT1MqhBy40tiEWzLvukaTf3vU0gTYicYB97vOd/19blOnv4RhFckE/LDwI6qRGoYKi1RRjIlAxIlPGUaBJk81ZWR1EAGRFFMyITsJMtSMB/XtX5d6ddF5YcEd4XTlgtGJuO3Qe3DKNIwn6LS8elubVlpbzEBbQ7uUUqN8bk7Sps2Gn9r9F2XLrPnWFOVnIOptD5Q2co94F+ptwcI5sqHsFTO1D59/zr6Mm4hfinkUpieiHfVKcRMy0z1JTRFQYBHMEoKA/0IlaobsWpA4qI8LK370qC4zmxTX3pK01nb2o7MAvQ2hQct5SZkEqVrQ9Q5iEHZWeFk2JCbIbwiaEFTYo0ogZxmmIiwKVXVQYOaQz61rX2zqq0rmW9idwwEcsx7Wlcyn3XBLqoiWuS4xwrUlE6Hvnd0aOgRYm5Qn91Oh/6SwPDW6H2B4Z0TPxKYfrdaWx+/1Wbfyl4vX9OqY6lOfLqCl7f0tnWn3sqloHo71cg3NMKgy3+nWLpTlBgEaIruUTaZiPah8YAsqc25vmreAY22My0xGV2fQXHVLihomzJxWRNt/VltvIDmm/wMfkPYGnQz7hny1ITFfV8aFPdICoNUYC/jWmQjrroRi+mf9c3tw+/5AfFCNafPoZDawMZ9bkZ9cXd/IaQyaEGad7DMlJIagfX4GyxJrvLU7jLY0CzFFifkVLbWMzUGKpU5sJ9SoLZfojCOI/egjHP+nqiW3HuqSDJYgDE0htBdrE7UkHqevRjwxjl8P1CHgR83p5olFNvTC6Q5eg+Mm+MpD4G19R3P2upt9R9labsa9A4AAA==" \ No newline at end of file diff --git a/assets/search.js b/assets/search.js new file mode 100644 index 000000000..1ca2654e9 --- /dev/null +++ b/assets/search.js @@ -0,0 +1 @@ +window.searchData = "data:application/octet-stream;base64,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"; \ No newline at end of file diff --git a/assets/style.css b/assets/style.css new file mode 100644 index 000000000..072daed85 --- /dev/null +++ b/assets/style.css @@ -0,0 +1,1415 @@ +:root { + /* Light */ + --light-color-background: #f2f4f8; + --light-color-background-secondary: #eff0f1; + --light-color-warning-text: #222; + --light-color-background-warning: #e6e600; + --light-color-icon-background: var(--light-color-background); + --light-color-accent: #c5c7c9; + --light-color-active-menu-item: var(--light-color-accent); + --light-color-text: #222; + --light-color-text-aside: #6e6e6e; + --light-color-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-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; + + /* Dark */ + --dark-color-background: #2b2e33; + --dark-color-background-secondary: #1e2024; + --dark-color-background-warning: #bebe00; + --dark-color-warning-text: #222; + --dark-color-icon-background: var(--dark-color-background-secondary); + --dark-color-accent: #9096a2; + --dark-color-active-menu-item: #5d5d6a; + --dark-color-text: #f5f5f5; + --dark-color-text-aside: #dddddd; + --dark-color-link: #00aff4; + + --dark-color-ts-keyword: #3399ff; + --dark-color-ts-project: #e358ff; + --dark-color-ts-module: var(--dark-color-ts-project); + --dark-color-ts-namespace: var(--dark-color-ts-project); + --dark-color-ts-enum: #f4d93e; + --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; +} + +@media (prefers-color-scheme: light) { + :root { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-link: var(--light-color-link); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --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); + } +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-link: var(--dark-color-link); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --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); + } +} + +html { + color-scheme: var(--color-scheme); +} + +body { + margin: 0; +} + +:root[data-theme="light"] { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-link: var(--light-color-link); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --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); +} + +:root[data-theme="dark"] { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-link: var(--dark-color-link); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --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); +} + +.always-visible, +.always-visible .tsd-signatures { + display: inherit !important; +} + +h1, +h2, +h3, +h4, +h5, +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; +} + +h2 { + font-size: 1.5rem; + margin: 0.83rem 0; +} + +h3 { + font-size: 1.25rem; + margin: 1rem 0; +} + +h4 { + font-size: 1.05rem; + margin: 1.33rem 0; +} + +h5 { + font-size: 1rem; + margin: 1.5rem 0; +} + +h6 { + font-size: 0.875rem; + margin: 2.33rem 0; +} + +.uppercase { + text-transform: uppercase; +} + +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +.container { + max-width: 1700px; + padding: 0 2rem; +} + +/* Footer */ +.tsd-generator { + 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; +} + +.container-main { + margin: 0 auto; + /* toolbar, footer, margin */ + min-height: calc(100vh - 41px - 56px - 4rem); +} + +@keyframes fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +@keyframes fade-out { + from { + opacity: 1; + visibility: visible; + } + to { + opacity: 0; + } +} +@keyframes fade-in-delayed { + 0% { + opacity: 0; + } + 33% { + opacity: 0; + } + 100% { + opacity: 1; + } +} +@keyframes fade-out-delayed { + 0% { + opacity: 1; + visibility: visible; + } + 66% { + opacity: 0; + } + 100% { + opacity: 0; + } +} +@keyframes pop-in-from-right { + from { + transform: translate(100%, 0); + } + to { + transform: translate(0, 0); + } +} +@keyframes pop-out-to-right { + from { + transform: translate(0, 0); + visibility: visible; + } + to { + transform: translate(100%, 0); + } +} +body { + background: var(--color-background); + 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); +} + +a { + color: var(--color-link); + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +a.external[target="_blank"] { + background-image: var(--external-icon); + background-position: top 3px right; + background-repeat: no-repeat; + padding-right: 13px; +} + +code, +pre { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + padding: 0.2em; + margin: 0; + font-size: 0.875rem; + border-radius: 0.8em; +} + +pre { + position: relative; + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; + padding: 10px; + 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; + padding-left: 1em; + border-left: 4px solid gray; +} + +.tsd-typography { + line-height: 1.333em; +} +.tsd-typography ul { + list-style: square; + padding: 0 0 0 20px; + margin: 0; +} +.tsd-typography .tsd-index-panel h3, +.tsd-index-panel .tsd-typography h3, +.tsd-typography h4, +.tsd-typography h5, +.tsd-typography h6 { + font-size: 1em; +} +.tsd-typography h5, +.tsd-typography h6 { + font-weight: normal; +} +.tsd-typography p, +.tsd-typography ul, +.tsd-typography ol { + margin: 1em 0; +} +.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 { + margin: 0; + padding: 0; + color: var(--color-text-aside); +} +.tsd-breadcrumb a { + color: var(--color-text-aside); + text-decoration: none; +} +.tsd-breadcrumb a:hover { + text-decoration: underline; +} +.tsd-breadcrumb li { + display: inline; +} +.tsd-breadcrumb li:after { + content: " / "; +} + +.tsd-comment-tags { + display: flex; + flex-direction: column; +} +dl.tsd-comment-tag-group { + display: flex; + align-items: center; + overflow: hidden; + margin: 0.5em 0; +} +dl.tsd-comment-tag-group dt { + display: flex; + margin-right: 0.5em; + font-size: 0.875em; + font-weight: normal; +} +dl.tsd-comment-tag-group dd { + margin: 0; +} +code.tsd-tag { + padding: 0.25em 0.4em; + border: 0.1em solid var(--color-accent); + margin-right: 0.25em; + font-size: 70%; +} +h1 code.tsd-tag:first-of-type { + margin-left: 0.25em; +} + +dl.tsd-comment-tag-group dd:before, +dl.tsd-comment-tag-group dd:after { + content: " "; +} +dl.tsd-comment-tag-group dd pre, +dl.tsd-comment-tag-group dd:after { + clear: both; +} +dl.tsd-comment-tag-group p { + margin: 0; +} + +.tsd-panel.tsd-comment .lead { + font-size: 1.1em; + line-height: 1.333em; + margin-bottom: 2em; +} +.tsd-panel.tsd-comment .lead:last-child { + margin-bottom: 0; +} + +.tsd-filter-visibility h4 { + font-size: 1rem; + padding-top: 0.75rem; + padding-bottom: 0.5rem; + margin: 0; +} +.tsd-filter-item:not(:last-child) { + margin-bottom: 0.5rem; +} +.tsd-filter-input { + display: flex; + width: fit-content; + width: -moz-fit-content; + align-items: center; + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + cursor: pointer; +} +.tsd-filter-input input[type="checkbox"] { + cursor: pointer; + position: absolute; + width: 1.5em; + height: 1.5em; + opacity: 0; +} +.tsd-filter-input input[type="checkbox"]:disabled { + pointer-events: none; +} +.tsd-filter-input svg { + cursor: pointer; + width: 1.5em; + height: 1.5em; + margin-right: 0.5em; + border-radius: 0.33em; + /* Leaving this at full opacity breaks event listeners on Firefox. + Don't remove unless you know what you're doing. */ + opacity: 0.99; +} +.tsd-filter-input input[type="checkbox"]:focus + svg { + transform: scale(0.95); +} +.tsd-filter-input input[type="checkbox"]:focus:not(:focus-visible) + svg { + transform: scale(1); +} +.tsd-checkbox-background { + fill: var(--color-accent); +} +input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { + stroke: var(--color-text); +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-background { + fill: var(--color-background); + stroke: var(--color-accent); + stroke-width: 0.25rem; +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-checkmark { + stroke: var(--color-accent); +} + +.tsd-theme-toggle { + padding-top: 0.75rem; +} +.tsd-theme-toggle > h4 { + display: inline; + vertical-align: middle; + margin-right: 0.75rem; +} + +.tsd-hierarchy { + list-style: square; + margin: 0; +} +.tsd-hierarchy .target { + 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; +} +.tsd-index-panel .tsd-index-list { + list-style: none; + line-height: 1.333em; + margin: 0; + padding: 0.25rem 0 0 0; + overflow: hidden; + display: grid; + grid-template-columns: repeat(3, 1fr); + column-gap: 1rem; + grid-template-rows: auto; +} +@media (max-width: 1024px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(2, 1fr); + } +} +@media (max-width: 768px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(1, 1fr); + } +} +.tsd-index-panel .tsd-index-list li { + -webkit-page-break-inside: avoid; + -moz-page-break-inside: avoid; + -ms-page-break-inside: avoid; + -o-page-break-inside: avoid; + page-break-inside: avoid; +} + +.tsd-flag { + display: inline-block; + padding: 0.25em 0.4em; + border-radius: 4px; + color: var(--color-comment-tag-text); + background-color: var(--color-comment-tag); + text-indent: 0; + font-size: 75%; + line-height: 1; + font-weight: normal; +} + +.tsd-anchor { + position: relative; + top: -100px; +} + +.tsd-member { + position: relative; +} +.tsd-member .tsd-anchor + h3 { + display: flex; + align-items: center; + margin-top: 0; + margin-bottom: 0; + border-bottom: none; +} + +.tsd-navigation.settings { + margin: 1rem 0; +} +.tsd-navigation > a, +.tsd-navigation .tsd-accordion-summary { + width: calc(100% - 0.25rem); + display: flex; + align-items: center; +} +.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; + box-sizing: border-box; +} +.tsd-navigation a.current, +.tsd-page-navigation a.current { + background: var(--color-active-menu-item); +} +.tsd-navigation a:hover, +.tsd-page-navigation a:hover { + text-decoration: underline; +} +.tsd-navigation ul, +.tsd-page-navigation ul { + margin-top: 0; + margin-bottom: 0; + padding: 0; + list-style: none; +} +.tsd-navigation li, +.tsd-page-navigation li { + padding: 0; + max-width: 100%; +} +.tsd-nested-navigation { + margin-left: 3rem; +} +.tsd-nested-navigation > li > details { + margin-left: -1.5rem; +} +.tsd-small-nested-navigation { + margin-left: 1.5rem; +} +.tsd-small-nested-navigation > li > details { + margin-left: -1.5rem; +} + +.tsd-page-navigation ul { + padding-left: 1.75rem; +} + +#tsd-sidebar-links a { + margin-top: 0; + margin-bottom: 0.5rem; + line-height: 1.25rem; +} +#tsd-sidebar-links a:last-of-type { + margin-bottom: 0; +} + +a.tsd-index-link { + 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 { + 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; + + 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-index-accordion .tsd-accordion-summary > svg { + margin-left: 0.25rem; +} +.tsd-index-content > :not(:first-child) { + margin-top: 0.75rem; +} +.tsd-index-heading { + margin-top: 1.5rem; + margin-bottom: 0.75rem; +} + +.tsd-kind-icon { + margin-right: 0.5rem; + width: 1.25rem; + height: 1.25rem; + min-width: 1.25rem; + min-height: 1.25rem; +} +.tsd-kind-icon path { + transform-origin: center; + transform: scale(1.1); +} +.tsd-signature > .tsd-kind-icon { + margin-right: 0.8rem; +} + +.tsd-panel { + margin-bottom: 2.5rem; +} +.tsd-panel.tsd-member { + margin-bottom: 4rem; +} +.tsd-panel:empty { + display: none; +} +.tsd-panel > h1, +.tsd-panel > h2, +.tsd-panel > h3 { + margin: 1.5rem -1.5rem 0.75rem -1.5rem; + padding: 0 1.5rem 0.75rem 1.5rem; +} +.tsd-panel > h1.tsd-before-signature, +.tsd-panel > h2.tsd-before-signature, +.tsd-panel > h3.tsd-before-signature { + margin-bottom: 0; + border-bottom: none; +} + +.tsd-panel-group { + margin: 4rem 0; +} +.tsd-panel-group.tsd-index-group { + margin: 2rem 0; +} +.tsd-panel-group.tsd-index-group details { + margin: 2rem 0; +} + +#tsd-search { + transition: background-color 0.2s; +} +#tsd-search .title { + position: relative; + z-index: 2; +} +#tsd-search .field { + position: absolute; + left: 0; + top: 0; + right: 2.5rem; + height: 100%; +} +#tsd-search .field input { + box-sizing: border-box; + position: relative; + top: -50px; + z-index: 1; + width: 100%; + padding: 0 10px; + opacity: 0; + outline: 0; + border: 0; + background: transparent; + color: var(--color-text); +} +#tsd-search .field label { + position: absolute; + overflow: hidden; + right: -40px; +} +#tsd-search .field input, +#tsd-search .title, +#tsd-toolbar-links a { + transition: opacity 0.2s; +} +#tsd-search .results { + position: absolute; + visibility: hidden; + top: 40px; + width: 100%; + margin: 0; + padding: 0; + list-style: none; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); +} +#tsd-search .results li { + background-color: var(--color-background); + line-height: initial; + padding: 4px; +} +#tsd-search .results li:nth-child(even) { + background-color: var(--color-background-secondary); +} +#tsd-search .results li.state { + display: none; +} +#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: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; +} +#tsd-search .results a:before { + top: 10px; +} +#tsd-search .results span.parent { + color: var(--color-text-aside); + font-weight: normal; +} +#tsd-search.has-focus { + background-color: var(--color-accent); +} +#tsd-search.has-focus .field input { + top: 0; + opacity: 1; +} +#tsd-search.has-focus .title, +#tsd-search.has-focus #tsd-toolbar-links a { + z-index: 0; + opacity: 0; +} +#tsd-search.has-focus .results { + visibility: visible; +} +#tsd-search.loading .results li.state.loading { + display: block; +} +#tsd-search.failure .results li.state.failure { + display: block; +} + +#tsd-toolbar-links { + position: absolute; + top: 0; + right: 2rem; + height: 100%; + display: flex; + align-items: center; + justify-content: flex-end; +} +#tsd-toolbar-links a { + margin-left: 1.5rem; +} +#tsd-toolbar-links a:hover { + text-decoration: underline; +} + +.tsd-signature { + margin: 0 0 1rem 0; + padding: 1rem 0.5rem; + border: 1px solid var(--color-accent); + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 14px; + 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; +} + +.tsd-signature-type { + font-style: italic; + font-weight: normal; +} + +.tsd-signatures { + padding: 0; + margin: 0 0 1em 0; + list-style-type: none; +} +.tsd-signatures .tsd-signature { + margin: 0; + border-color: var(--color-accent); + border-width: 1px 0; + transition: background-color 0.1s; +} +.tsd-description .tsd-signatures .tsd-signature { + border-width: 1px; +} + +ul.tsd-parameter-list, +ul.tsd-type-parameter-list { + list-style: square; + margin: 0; + padding-left: 20px; +} +ul.tsd-parameter-list > li.tsd-parameter-signature, +ul.tsd-type-parameter-list > li.tsd-parameter-signature { + list-style: none; + margin-left: -20px; +} +ul.tsd-parameter-list h5, +ul.tsd-type-parameter-list h5 { + font-size: 16px; + margin: 1em 0 0.5em 0; +} +.tsd-sources { + margin-top: 1rem; + font-size: 0.875em; +} +.tsd-sources a { + color: var(--color-text-aside); + text-decoration: underline; +} +.tsd-sources ul { + list-style: none; + padding: 0; +} + +.tsd-page-toolbar { + position: sticky; + z-index: 1; + top: 0; + left: 0; + width: 100%; + color: var(--color-text); + background: var(--color-background-secondary); + border-bottom: 1px var(--color-accent) solid; + transition: transform 0.3s ease-in-out; +} +.tsd-page-toolbar a { + color: var(--color-text); + text-decoration: none; +} +.tsd-page-toolbar a.title { + font-weight: bold; +} +.tsd-page-toolbar a.title:hover { + text-decoration: underline; +} +.tsd-page-toolbar .tsd-toolbar-contents { + display: flex; + justify-content: space-between; + height: 2.5rem; + margin: 0 auto; +} +.tsd-page-toolbar .table-cell { + position: relative; + white-space: nowrap; + line-height: 40px; +} +.tsd-page-toolbar .table-cell:first-child { + width: 100%; +} +.tsd-page-toolbar .tsd-toolbar-icon { + box-sizing: border-box; + line-height: 0; + padding: 12px 0; +} + +.tsd-widget { + display: inline-block; + overflow: hidden; + opacity: 0.8; + height: 40px; + transition: + opacity 0.1s, + background-color 0.2s; + vertical-align: bottom; + cursor: pointer; +} +.tsd-widget:hover { + opacity: 0.9; +} +.tsd-widget.active { + opacity: 1; + background-color: var(--color-accent); +} +.tsd-widget.no-caption { + width: 40px; +} +.tsd-widget.no-caption:before { + margin: 0; +} + +.tsd-widget.options, +.tsd-widget.menu { + display: none; +} +input[type="checkbox"] + .tsd-widget:before { + background-position: -120px 0; +} +input[type="checkbox"]:checked + .tsd-widget:before { + background-position: -160px 0; +} + +img { + max-width: 100%; +} + +.tsd-anchor-icon { + display: inline-flex; + align-items: center; + margin-left: 0.5rem; + vertical-align: middle; + color: var(--color-text); +} + +.tsd-anchor-icon svg { + width: 1em; + height: 1em; + visibility: hidden; +} + +.tsd-anchor-link:hover > .tsd-anchor-icon svg { + visibility: visible; +} + +.deprecated { + text-decoration: line-through !important; +} + +.warning { + padding: 1rem; + color: var(--color-warning-text); + 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); +} + +*::-webkit-scrollbar { + width: 0.75rem; +} + +*::-webkit-scrollbar-track { + background: var(--color-icon-background); +} + +*::-webkit-scrollbar-thumb { + background-color: var(--color-accent); + 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/classes/_semaphore_protocol_data.SemaphoreEthers.html b/classes/_semaphore_protocol_data.SemaphoreEthers.html new file mode 100644 index 000000000..2c0b26a30 --- /dev/null +++ b/classes/_semaphore_protocol_data.SemaphoreEthers.html @@ -0,0 +1,37 @@ +SemaphoreEthers | Semaphore SDK

Constructors

  • Initializes the Ethers object with an Ethereum network or custom URL.

    +

    Parameters

    • networkOrEthereumURL: string = defaultNetwork

      Ethereum network or custom URL.

      +
    • options: EthersOptions = {}

      Ethers options.

      +

    Returns SemaphoreEthers

Properties

_contract: Contract
_network: string
_options: EthersOptions

Accessors

  • get contract(): Contract
  • Returns the contract object.

    +

    Returns Contract

    Contract object.

    +
  • get network(): string
  • Returns the Ethereum network or custom URL.

    +

    Returns string

    Ethereum network or custom URL.

    +

Methods

  • Returns the list of group ids.

    +

    Returns Promise<string[]>

    List of group ids.

    +
  • Returns a list of group members.

    +

    Parameters

    • groupId: string

      Group id.

      +

    Returns Promise<string[]>

    Group members.

    +
  • Returns a list of group validated proofs.

    +

    Parameters

    • groupId: string

      Group id.

      +

    Returns Promise<any>

    Group validated proofs.

    +
  • Returns true if a member is part of group, and false otherwise.

    +

    Parameters

    • groupId: string

      Group id

      +
    • member: string

      Group member.

      +

    Returns Promise<boolean>

    True if the member is part of the group, false otherwise.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/classes/_semaphore_protocol_data.SemaphoreSubgraph.html b/classes/_semaphore_protocol_data.SemaphoreSubgraph.html new file mode 100644 index 000000000..d1c2128be --- /dev/null +++ b/classes/_semaphore_protocol_data.SemaphoreSubgraph.html @@ -0,0 +1,33 @@ +SemaphoreSubgraph | Semaphore SDK

Constructors

  • Initializes the subgraph object with one of the supported networks or a custom URL.

    +

    Parameters

    • networkOrSubgraphURL: string = defaultNetwork

      Supported Semaphore network or custom Subgraph URL.

      +

    Returns SemaphoreSubgraph

Properties

_url: string

Accessors

  • get url(): string
  • Returns the subgraph URL.

    +

    Returns string

    Subgraph URL.

    +

Methods

  • Returns a specific group.

    +

    Parameters

    • groupId: string

      Group id.

      +
    • options: Omit<GroupOptions, "filters"> = {}

      Options to select the group parameters.

      +

    Returns Promise<GroupResponse>

    Specific group.

    +
  • Returns the list of group ids.

    +

    Returns Promise<string[]>

    List of group ids.

    +
  • Returns a list of group members.

    +

    Parameters

    • groupId: string

      Group id.

      +

    Returns Promise<string[]>

    Group members.

    +
  • Returns a list of validated proofs.

    +

    Parameters

    • groupId: string

      Group id.

      +

    Returns Promise<any[]>

    Validated proofs.

    +
  • Returns true if a member is part of group, and false otherwise.

    +

    Parameters

    • groupId: string

      Group id

      +
    • member: string

      Group member.

      +

    Returns Promise<boolean>

    True if the member is part of the group, false otherwise.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/classes/_semaphore_protocol_group.Group.html b/classes/_semaphore_protocol_group.Group.html new file mode 100644 index 000000000..6e744a901 --- /dev/null +++ b/classes/_semaphore_protocol_group.Group.html @@ -0,0 +1,58 @@ +Group | Semaphore SDK

The Semaphore group is a LeanIMT +(Lean Incremental Merkle Tree), i.e. an optimized version of the incremental binary Merkle tree +used by Semaphore V3. The new tree does not use zero hashes, and its depth is dynamic. +The members of a Semaphore group, or the leaves of a tree, are the identity commitments. +Thanks to the properties of Merkle trees, it can be efficiently demonstrated that a group +member belongs to the group. +This class supports operations such as member addition, update, removal and Merkle proof +generation and verification. Groups can also be exported or imported.

+

Constructors

  • Creates a new instance of the Group. Optionally, a list of identity commitments can +be passed as a parameter. Adding members in chunks is more efficient than adding +them one by one with the addMember function.

    +

    Parameters

    • members: BigNumber[] = []

      A list of identity commitments.

      +

    Returns Group

Properties

leanIMT: default<bigint>

Accessors

  • get depth(): number
  • Returns the depth of the tree.

    +

    Returns number

    The tree depth as a number.

    +
  • get members(): bigint[]
  • Returns the members (i.e. identity commitments) of the group.

    +

    Returns bigint[]

    The list of members of the group.

    +
  • get root(): bigint
  • Returns the root hash of the tree.

    +

    Returns bigint

    The root hash as a string.

    +
  • get size(): number
  • Returns the size of the tree (i.e. number of leaves).

    +

    Returns number

    The tree size as a number.

    +

Methods

  • Adds a new member to the group.

    +

    Parameters

    • member: BigNumber

      The new member to be added.

      +

    Returns void

  • Adds new members to the group.

    +

    Parameters

    • members: BigNumber[]

      New members.

      +

    Returns void

  • Enables the conversion of the group into a JSON string that +can be re-used for future imports. This approach is beneficial for +large groups, as it avoids re-calculating the tree hashes.

    +

    Returns string

    The stringified JSON of the group.

    +
  • Returns the index of a member. If the member does not exist it returns -1.

    +

    Parameters

    • member: BigNumber

      A member of the group.

      +

    Returns number

    The index of the member, or -1 if it does not exist.

    +
  • Removes a member from the group.

    +

    Parameters

    • index: number

      The index of the member to be removed.

      +

    Returns void

  • Updates a member in the group.

    +

    Parameters

    • index: number

      Index of the member to be updated.

      +
    • member: BigNumber

      New member value.

      +

    Returns void

  • Imports an entire group by initializing the tree without calculating +any hashes. Note that it is crucial to ensure the integrity of the +exported group.

    +

    Parameters

    • exportedGroup: string

    Returns Group

    The Group instance.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/classes/_semaphore_protocol_heyauthn.HeyAuthn.html b/classes/_semaphore_protocol_heyauthn.HeyAuthn.html new file mode 100644 index 000000000..d452e0743 --- /dev/null +++ b/classes/_semaphore_protocol_heyauthn.HeyAuthn.html @@ -0,0 +1,17 @@ +HeyAuthn | Semaphore SDK

Constructors

Properties

Accessors

Methods

Constructors

Properties

_identity: Identity

Accessors

Methods

Generated using TypeDoc

\ No newline at end of file diff --git a/classes/_semaphore_protocol_heyauthn.Identity.html b/classes/_semaphore_protocol_heyauthn.Identity.html new file mode 100644 index 000000000..33d67ae7a --- /dev/null +++ b/classes/_semaphore_protocol_heyauthn.Identity.html @@ -0,0 +1,55 @@ +Identity | Semaphore SDK

The Semaphore identity is essentially an EdDSA +public/private key pair. The EdDSA implementation +in this library uses Baby Jubjub for public key generation +and Poseidon for signatures. +In addition, the commitment, i.e. the hash of the public key, is used to represent +Semaphore identities in groups, adding an additional layer of privacy and security. +The private key of the identity is stored as a hexadecimal string or text. +The other attributes are stored as stringified bigint.

+

Constructors

  • Initializes the class attributes based on a given private key, which must be a hexadecimal string or a text. +Hexadecimal strings must not start with '0x' or '0X'. +If the private key is not passed as a parameter, a random hexadecimal key will be generated. +The EdDSAPoseidon class is used to generate the secret scalar and the public key. +Additionally, the constructor computes a commitment of the public key using a hash function (Poseidon).

    +

    Parameters

    • Optional privateKey: string

      The private key used to derive the public key (hexadecimal or string).

      +

    Returns Identity

    Example

    // Generates an identity.
    const { privateKey, publicKey, commitment } = new Identity("private-key") +
    +

    Example

    // Generates an identity with a random private key.
    const { privateKey, publicKey, commitment } = new Identity() +
    +

Properties

_commitment: bigint
_privateKey: string
_publicKey: Point<bigint>
_secretScalar: bigint

Accessors

Methods

  • Generates a signature for a given message using the private key. +This method demonstrates how to sign a message and could be used +for authentication or data integrity.

    +

    Parameters

    • message: BigNumberish

      The message to be signed.

      +

    Returns Signature<bigint>

    A Signature object containing the signature components.

    +

    Example

    const identity = new Identity()
    const signature = identity.signMessage("message") +
    +
  • Verifies a signature against a given message and public key. +This static method allows for the verification of signatures without needing +an instance of the Identity class. It's useful for cases where you only have +the public key, the message and a signature, and need to verify if they match.

    +

    Parameters

    • message: BigNumberish

      The message that was signed.

      +
    • signature: Signature

      The signature to verify.

      +
    • publicKey: Point

      The public key to use for verification.

      +

    Returns boolean

    A boolean indicating whether the signature is valid.

    +

    Example

    const identity = new Identity()
    const signature = identity.signMessage("message")
    Identity.verifySignature("message", signature, identity.publicKey) +
    +

Generated using TypeDoc

\ No newline at end of file diff --git a/classes/_semaphore_protocol_identity.Identity.html b/classes/_semaphore_protocol_identity.Identity.html new file mode 100644 index 000000000..73555833d --- /dev/null +++ b/classes/_semaphore_protocol_identity.Identity.html @@ -0,0 +1,55 @@ +Identity | Semaphore SDK

The Semaphore identity is essentially an EdDSA +public/private key pair. The EdDSA implementation +in this library uses Baby Jubjub for public key generation +and Poseidon for signatures. +In addition, the commitment, i.e. the hash of the public key, is used to represent +Semaphore identities in groups, adding an additional layer of privacy and security. +The private key of the identity is stored as a hexadecimal string or text. +The other attributes are stored as stringified bigint.

+

Constructors

  • Initializes the class attributes based on a given private key, which must be a hexadecimal string or a text. +Hexadecimal strings must not start with '0x' or '0X'. +If the private key is not passed as a parameter, a random hexadecimal key will be generated. +The EdDSAPoseidon class is used to generate the secret scalar and the public key. +Additionally, the constructor computes a commitment of the public key using a hash function (Poseidon).

    +

    Parameters

    • Optional privateKey: string

      The private key used to derive the public key (hexadecimal or string).

      +

    Returns Identity

    Example

    // Generates an identity.
    const { privateKey, publicKey, commitment } = new Identity("private-key") +
    +

    Example

    // Generates an identity with a random private key.
    const { privateKey, publicKey, commitment } = new Identity() +
    +

Properties

_commitment: bigint
_privateKey: string
_publicKey: Point<bigint>
_secretScalar: bigint

Accessors

  • get commitment(): bigint
  • Returns the commitment hash of the public key.

    +

    Returns bigint

    The commitment as a string.

    +
  • get privateKey(): string
  • Returns the private key.

    +

    Returns string

    The private key as a string (hexadecimal or text).

    +
  • get publicKey(): Point<bigint>
  • Returns the public key as a Baby Jubjub Point.

    +

    Returns Point<bigint>

    The public key as a point.

    +
  • get secretScalar(): bigint
  • Returns the secret scalar.

    +

    Returns bigint

    The secret scalar as a string.

    +

Methods

  • Generates a signature for a given message using the private key. +This method demonstrates how to sign a message and could be used +for authentication or data integrity.

    +

    Parameters

    • message: BigNumberish

      The message to be signed.

      +

    Returns Signature<bigint>

    A Signature object containing the signature components.

    +

    Example

    const identity = new Identity()
    const signature = identity.signMessage("message") +
    +
  • Verifies a signature against a given message and public key. +This static method allows for the verification of signatures without needing +an instance of the Identity class. It's useful for cases where you only have +the public key, the message and a signature, and need to verify if they match.

    +

    Parameters

    • message: BigNumberish

      The message that was signed.

      +
    • signature: Signature

      The signature to verify.

      +
    • publicKey: Point

      The public key to use for verification.

      +

    Returns boolean

    A boolean indicating whether the signature is valid.

    +

    Example

    const identity = new Identity()
    const signature = identity.signMessage("message")
    Identity.verifySignature("message", signature, identity.publicKey) +
    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_semaphore_protocol_proof.generateProof.html b/functions/_semaphore_protocol_proof.generateProof.html new file mode 100644 index 000000000..783333d30 --- /dev/null +++ b/functions/_semaphore_protocol_proof.generateProof.html @@ -0,0 +1,19 @@ +generateProof | Semaphore SDK
  • It generates a Semaphore proof, i.e. a zero-knowledge proof that an identity that +is part of a group has shared an anonymous message. +The message may be any arbitrary user-defined value (e.g. a vote), or the hash of that value. +The scope is a value used like a topic on which users can generate a valid proof only once, +for example the id of an election in which voters can only vote once. +The hash of the identity's scope and secret scalar is called a nullifier and can be +used to verify whether that identity has already generated a valid proof in that scope. +The depth of the tree determines which zero-knowledge artifacts to use to generate the proof. +If it is not defined, it will be inferred from the group or Merkle proof passed as the second parameter. +Finally, the artifacts themselves can be passed manually with file paths, +or they will be automatically fetched.

    +

    Parameters

    • identity: Identity

      The Semaphore identity.

      +
    • groupOrMerkleProof: Group | MerkleProof

      The Semaphore group or its Merkle proof.

      +
    • message: Uint8Array | BigNumberish

      The Semaphore message.

      +
    • scope: Uint8Array | BigNumberish

      The Semaphore scope.

      +
    • Optional merkleTreeDepth: number

      The depth of the tree with which the circuit was compiled.

      +
    • Optional snarkArtifacts: SnarkArtifacts

      The SNARK artifacts.

      +

    Returns Promise<SemaphoreProof>

    The Semaphore proof ready to be verified.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_semaphore_protocol_proof.packGroth16Proof.html b/functions/_semaphore_protocol_proof.packGroth16Proof.html new file mode 100644 index 000000000..53abb7246 --- /dev/null +++ b/functions/_semaphore_protocol_proof.packGroth16Proof.html @@ -0,0 +1,4 @@ +packGroth16Proof | Semaphore SDK
  • Packs a Snarkjs Groth16 proof into a single list usable as calldata in Solidity (public signals are not included).

    +

    Parameters

    • proof: Groth16Proof

      The Groth16 proof generated with SnarkJS.

      +

    Returns PackedGroth16Proof

    Solidity calldata.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_semaphore_protocol_proof.unpackGroth16Proof.html b/functions/_semaphore_protocol_proof.unpackGroth16Proof.html new file mode 100644 index 000000000..8e6b98756 --- /dev/null +++ b/functions/_semaphore_protocol_proof.unpackGroth16Proof.html @@ -0,0 +1,4 @@ +unpackGroth16Proof | Semaphore SDK
  • Unpacks a PackedGroth16Proof Solidity calldata into its original form which is a SnarkJS Groth16 proof.

    +

    Parameters

    • proof: PackedGroth16Proof

      Solidity calldata.

      +

    Returns Groth16Proof

    The Groth16 proof compatible with SnarkJS.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_semaphore_protocol_proof.verifyProof.html b/functions/_semaphore_protocol_proof.verifyProof.html new file mode 100644 index 000000000..5552658d8 --- /dev/null +++ b/functions/_semaphore_protocol_proof.verifyProof.html @@ -0,0 +1,5 @@ +verifyProof | Semaphore SDK
  • Verifies whether a Semaphore proof is valid. Depending on the depth of the tree used to +generate the proof, a different verification key will be used.

    +

    Parameters

    Returns Promise<boolean>

    True if the proof is valid, false otherwise.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_semaphore_protocol_utils.decodeMessage.html b/functions/_semaphore_protocol_utils.decodeMessage.html new file mode 100644 index 000000000..d558a38c3 --- /dev/null +++ b/functions/_semaphore_protocol_utils.decodeMessage.html @@ -0,0 +1,9 @@ +decodeMessage | Semaphore SDK
  • Typically used for decoding on-chain Semaphore messages. +When Semaphore messages are text they are converted to bigints before +the proof is generated (and eventually sent on-chain). +This function help devs converting bigint messages to text again. +If the original message was not text the output of this +function won't probably be human-readable text.

    +

    Parameters

    • message: BigNumberish

      The Semaphore message as a bigint.

      +

    Returns string

    The Semaphore message as a text.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_semaphore_protocol_utils.getDeployedContract.html b/functions/_semaphore_protocol_utils.getDeployedContract.html new file mode 100644 index 000000000..5052e57db --- /dev/null +++ b/functions/_semaphore_protocol_utils.getDeployedContract.html @@ -0,0 +1,4 @@ +getDeployedContract | Semaphore SDK
  • Returns name, address and start block of a Semaphore contract deployed +on a specific supported network.

    +

    Parameters

    • supportedNetwork: "sepolia" | "arbitrum-sepolia" | "optimism-sepolia" | "matic-mumbai"

    Returns {
        address: string;
        name: string;
        startBlock: number;
    }

    An object with name, address and start block of the deployed contract.

    +
    • address: string
    • name: string
    • startBlock: number

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_semaphore_protocol_utils.getHardhatNetworks.html b/functions/_semaphore_protocol_utils.getHardhatNetworks.html new file mode 100644 index 000000000..d05935d7e --- /dev/null +++ b/functions/_semaphore_protocol_utils.getHardhatNetworks.html @@ -0,0 +1,5 @@ +getHardhatNetworks | Semaphore SDK
  • Utility function to get an object compatible with the Hardhat 'networks' option. +If the private key is not defined it returns an empty object.

    +

    Parameters

    • Optional privateKey: string

      Private key to be used with networks.

      +

    Returns any

    An object compatible with the Hardhat 'networks' option.

    +

Generated using TypeDoc

\ No newline at end of file diff --git a/functions/_semaphore_protocol_utils.isSupportedNetwork.html b/functions/_semaphore_protocol_utils.isSupportedNetwork.html new file mode 100644 index 000000000..de21ac7fb --- /dev/null +++ b/functions/_semaphore_protocol_utils.isSupportedNetwork.html @@ -0,0 +1,3 @@ +isSupportedNetwork | Semaphore SDK
  • Returns true if a network is supported by Semaphore, false otherwise.

    +

    Parameters

    • supportedNetwork: string

      The network to be checked.

      +

    Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 000000000..b287a4e60 --- /dev/null +++ b/index.html @@ -0,0 +1,333 @@ +Semaphore SDK

Semaphore SDK

+

+ + + + Semaphore icon + +

+

+ +

+ + + + + Github license + + + GitHub Workflow test + + + Coveralls + + + DeepScan grade + + + Linter eslint + + + Code style prettier + + Repository top language + + + + + Commitizen friendly + +

+ + + + + + + + + +
Semaphore is a generic privacy layer. Leveraging zero-knowledge technology, users can prove their membership in groups and send messages (extending from votes to endorsements) off-chain or across EVM-compatible blockchains, all without revealing their personal identity.
+

The core of the Semaphore protocol is in the circuit logic. However, Semaphore also provides Solidity contracts and JavaScript libraries to make the steps for offchain proof creation and onchain/offchain verification easier. To learn more about Semaphore visit semaphore.pse.dev.

+

📦 Packages

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageVersionDownloads
+ + @semaphore-protocol/core + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/contracts + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/identity + + + (docs) + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/group + + + (docs) + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/proof + + + (docs) + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/data + + + (docs) + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/hardhat + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/cli + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/utils + + + (docs) + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/heyauthn + + + (docs) + + + + + NPM version + + + + + Downloads + +
+ +

🛠 Install

Clone this repository:

+
git clone https://github.com/semaphore-protocol/semaphore.git
+
+

And install the dependencies:

+
cd semaphore && yarn
+
+

📜 Usage

Copy the .env.example file as .env:

+
cp .env.example .env
+
+

And add your environment variables.

+

Code quality and formatting

Run ESLint to analyze the code and catch bugs:

+
yarn lint
+
+

Run Prettier to check formatting rules:

+
yarn prettier
+
+

Or to automatically format the code:

+
yarn prettier:write
+
+

Conventional commits

Semaphore uses conventional commits. A command line utility to commit using the correct syntax can be used by running:

+
yarn commit
+
+

It will also automatically check that the modified files comply with ESLint and Prettier rules.

+

Testing

Run Jest to test the JS libraries:

+
yarn test:libraries
+
+

Run Mocha to test the contracts:

+
yarn test:contracts
+
+

Or test everything with:

+
yarn test
+
+

Build libraries & compile contracts

Run Rollup and TheGraph to build all the packages and the subgraph:

+
yarn build
+
+

Compile the smart contracts with Hardhat:

+
yarn compile:contracts
+
+

Documentation (JS libraries)

Run TypeDoc to generate a documentation website for each package:

+
yarn docs
+
+

The output will be placed on the docs folder.

+

Releases

Bump a new version with:

+
yarn version:bump <version>
# e.g. yarn version:bump 2.0.0 +
+

It will create a commit and a git tag that will need to pushed on the main branch. A workflow will be triggered and will +publish the Semaphore packages on npm and release a new version on Github with its changelogs automatically.

+

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_semaphore_protocol_core.html b/modules/_semaphore_protocol_core.html new file mode 100644 index 000000000..b364cb8b1 --- /dev/null +++ b/modules/_semaphore_protocol_core.html @@ -0,0 +1,64 @@ +@semaphore-protocol/core | Semaphore SDK

Module @semaphore-protocol/core

+

+ Semaphore core +

+

Core library for the essential Semaphore features.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This library is a simple re-export of the Semaphore core libraries: @semaphore-protocol/identity, @semaphore-protocol/group, @semaphore-protocol/proof. So that developers can install a single package to use all the core functionalities of the protocol.
+

🛠 Install

npm or yarn

Install the @semaphore-protocol/core package with npm:

+
npm i @semaphore-protocol/core
+
+

or yarn:

+
yarn add @semaphore-protocol/core
+
+

📜 Usage

import { Identity, Group, generateProof, verifyProof } from "@semaphore-protocol/core"

const identity1 = new Identity()
const identity2 = new Identity()
const identity3 = new Identity()

const group = new Group([identity1.commitment, identity2.commitment, identity3.commitment])

const message = "Hello world"
const scope = "Semaphore"

const proof = await generateProof(identity1, group, message, scope)

await verifyProof(proof) +
+

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_semaphore_protocol_data.html b/modules/_semaphore_protocol_data.html new file mode 100644 index 000000000..53865812a --- /dev/null +++ b/modules/_semaphore_protocol_data.html @@ -0,0 +1,117 @@ +@semaphore-protocol/data | Semaphore SDK

Module @semaphore-protocol/data

+

+ Semaphore data +

+

A library to query Semaphore contracts.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + Documentation typedoc + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This library allows you to query the Semaphore.sol contract data (i.e. groups) using the Semaphore subgraph or Ethers. It can be used on Node.js and browsers.
+

🛠 Install

npm or yarn

Install the @semaphore-protocol/data package with npm:

+
npm i @semaphore-protocol/data
+
+

or yarn:

+
yarn add @semaphore-protocol/data
+
+

📜 Usage

For more information on the functions provided by @semaphore-protocol/data, please refer to the TypeDoc documentation.

+

# getSupportedNetworks(): string[]

+
const supportedNetworks = getSupportedNetworks()
+
+

# new SemaphoreSubgraph(networkOrSubgraphURL: SupportedNetwork | ValueOf<SupportedNetwork> | string = "sepolia"): SemaphoreSubgraph

+
import { SemaphoreSubgraph } from "@semaphore-protocol/data"

const semaphoreSubgraph = new SemaphoreSubgraph()

// or:
const semaphoreSubgraph = new SemaphoreSubgraph("arbitrum")

// or:
const semaphoreSubgraph = new SemaphoreSubgraph(
"https://api.studio.thegraph.com/query/14377/<your-subgraph>/<your-version>"
) +
+

# getGroupIds(): Promise<string[]>

+
const groupIds = await semaphoreSubgraph.getGroupIds()
+
+

# getGroups(options?: GroupOptions): Promise<GroupResponse[]>

+
const groups = await semaphoreSubgraph.getGroups()

// or

const groups = await semaphoreSubgraph.getGroups({ members: true, verifiedProofs: true }) +
+

# getGroup(groupId: string, options?: GroupOptions): Promise<GroupResponse>

+
const group = await semaphoreSubgraph.getGroup("42")

// or

const { members, verifiedProofs } = semaphoreSubgraph.getGroup("42", { members: true, verifiedProofs: true }) +
+

# getGroupMembers(groupId: string): Promise<string[]>

+
const members = await semaphoreSubgraph.getGroupMembers("42")
+
+

# getGroupVerifiedProofs(groupId: string): Promise<any[]>

+
const verifiedProofs = await semaphoreSubgraph.getGroupVerifiedProofs("42")
+
+

# isGroupMember(groupId: string, member: string): Promise<boolean>

+
await semaphoreSubgraph.isGroupMember(
"42",
"16948514235341957898454876473214737047419402240398321289450170535251226167324"
) +
+

# new Ethers(networkOrEthereumURL: Network | string = "sepolia", options: EthersOptions = {}): SemaphoreEthers

+
import { SemaphoreEthers } from "@semaphore-protocol/data"

const semaphoreEthers = new SemaphoreEthers()

// or:
const semaphoreEthers = new SemaphoreEthers("homestead", {
address: "semaphore-address",
startBlock: 0
})

// or:
const semaphoreEthers = new SemaphoreEthers("http://localhost:8545", {
address: "semaphore-address"
}) +
+

# getGroupIds(): Promise<string[]>

+
const groupIds = await semaphoreEthers.getGroupIds()
+
+

# getGroup(groupId: string): Promise<GroupResponse>

+
const group = await semaphoreEthers.getGroup("42")
+
+

# getGroupAdmin(groupId: string): Promise<string>

+
const admin = await semaphoreEthers.getGroupAdmin("42")
+
+

# getGroupMembers(groupId: string): Promise<string[]>

+
const members = await semaphoreEthers.getGroupMembers("42")
+
+

# getGroupVerifiedProofs(groupId: string): Promise<any[]>

+
const verifiedProofs = await semaphoreEthers.getGroupVerifiedProofs("42")
+
+

# isGroupMember(groupId: string, member: string): Promise<boolean>

+
await semaphoreEthers.isGroupMember(
"42",
"16948514235341957898454876473214737047419402240398321289450170535251226167324"
) +
+

Index

Classes

Type Aliases

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_semaphore_protocol_group.html b/modules/_semaphore_protocol_group.html new file mode 100644 index 000000000..76d0f819d --- /dev/null +++ b/modules/_semaphore_protocol_group.html @@ -0,0 +1,95 @@ +@semaphore-protocol/group | Semaphore SDK

Module @semaphore-protocol/group

+

+ Semaphore group +

+

A library to create and manage Semaphore groups.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + Documentation typedoc + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This library is an abstraction of the LeanIMT data structure (part of @zk-kit/imt). The main goal is to make it easier to create offchain groups, which are also used to generate Semaphore proofs. Semaphore groups are actually Merkle trees, and the group members are tree leaves.
+

🛠 Install

npm or yarn

Install the @semaphore-protocol/group package with npm:

+
npm i @semaphore-protocol/group
+
+

or yarn:

+
yarn add @semaphore-protocol/group
+
+

📜 Usage

For more information on the functions provided by @semaphore-protocol/group, please refer to the TypeDoc documentation.

+

# new Group(members: BigNumberish[] = []): Group

+
import { Group } from "@semaphore-protocol/group"
import { Identity } from "@semaphore-protocol/identity"

const group1 = new Group()

const identity1 = new Identity()
const identity2 = new Identity()

const group2 = new Group([identity1.commitment, identity2.commitment]) +
+

# addMember(member: BigNumberish)

+
import { Group } from "@semaphore-protocol/group"
import { Identity } from "@semaphore-protocol/identity"

const group = new Group()

const { commitment } = new Identity()

group.addMember(commitment)

// 12989101133047504182892154686643420754368236204022364847543591045056549053997n
console.log(group.members[0]) +
+

# addMembers(members: BigNumberish[])

+
import { Group } from "@semaphore-protocol/group"
import { Identity } from "@semaphore-protocol/identity"

const group = new Group()

const identity1 = new Identity()
const identity2 = new Identity()

group.addMembers([identity1.commitment, identity2.commitment]) +
+

# updateMember(index: number, member: BigNumberish)

+
import { Group } from "@semaphore-protocol/group"

const group = new Group([1n, 3n])

group.updateMember(0, 2)

console.log(group.members[0]) // "2n" +
+

# removeMember(index: number)

+
import { Group } from "@semaphore-protocol/group"

const group = new Group([1n, 3n])

group.removeMember(0)

console.log(group.members[0]) // 0n +
+

# indexOf(member: BigNumberish): number

+
import { Group } from "@semaphore-protocol/group"

const group = new Group([1n])

const index = group.indexOf(1)

console.log(index) // 0 +
+

# generateMerkleProof(index: number): MerkleProof

+
import { Group } from "@semaphore-protocol/group"

const group = new Group([1n, 3n])

const proof = group.generateMerkleProof(0)

console.log(proof)
/*
{
index: 0,
leaf: '1',
root: '21106761926285267690763443010820487107972411248208546226053195422384279971821',
siblings: [ '3' ]
}
*/ +
+

# export(): string

+
import { Group } from "@semaphore-protocol/group"

const group = new Group([1n, 2n, 3n])

const exportedGroup = group.export()

console.log(exportedGroup)
/*
[["1","2","3"],["7853200120776062878684798364095072458815029376092732009249414926327459813530","3"],["13816780880028945690020260331303642730075999758909899334839547418969502592169"]]
*/ +
+

# import(exportedGroup: string): Group

+
import { Group } from "@semaphore-protocol/group"

const group1 = new Group([1n, 2n, 3n])

const exportedGroup = group.export()

const group2 = Group.import(exportedGroup)

assert(group1.root === group2.root) +
+

Index

Classes

Type Aliases

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_semaphore_protocol_heyauthn.html b/modules/_semaphore_protocol_heyauthn.html new file mode 100644 index 000000000..3a1190f34 --- /dev/null +++ b/modules/_semaphore_protocol_heyauthn.html @@ -0,0 +1,79 @@ +@semaphore-protocol/heyauthn | Semaphore SDK

Module @semaphore-protocol/heyauthn

+

+ HeyAuthn +

+

A library to allow developers to create and manage Semaphore identities using WebAuthn.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + Documentation typedoc + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This library allows developers to create and manage Semaphore identities using WebAuthn as a cross-device biometric authentication in a way that is more convenient, smoother and secure than localStorage, Chrome extensions, or password manager based solutions.
+

🛠 Install

npm or yarn

Install the @semaphore-protocol/heyauthn package with npm:

+
npm i @semaphore-protocol/heyauthn
+
+

or yarn:

+
yarn add @semaphore-protocol/heyauthn
+
+

📜 Usage

For more information on the functions provided by @semaphore-protocol/heyauthn, please refer to the TypeDoc documentation.

+
import { HeyAuthn } from "@semaphore-protocol/heyauthn"

// STEP 1: Configure WebAuthn options.

const options = {
rpName: "my-app",
rpID: window.location.hostname,
userID: "my-id",
userName: "my-name"
}

// STEP 2: Register a new WebAuthn credential and get its Semaphore identity.

const { identity } = await HeyAuthn.fromRegister(options)

// Now you could also save the identity commitment in your DB (pseudocode).
fetch("/api/register" /* Replace this with your endpoint */, {
identity.commitment
// ...
})

// STEP 3: Authenticate existing WebAuthn credential and signal.

const { identity } = await HeyAuthn.fromRegister(options)

// Get existing group and signal anonymously (pseudocode).
import { Group } from "@semaphore-protocol/group"
import { generateProof } from "@semaphore-protocol/proof"
import { utils } from "ethers"

const group = new Group()

group.addMembers(memberList)

const message = utils.formatBytes32String("Hey anon!")

generateProof(identity, group, message, group.root) +
+

Authors

+

Index

Classes

Type Aliases

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_semaphore_protocol_identity.html b/modules/_semaphore_protocol_identity.html new file mode 100644 index 000000000..c6755acd0 --- /dev/null +++ b/modules/_semaphore_protocol_identity.html @@ -0,0 +1,76 @@ +@semaphore-protocol/identity | Semaphore SDK

Module @semaphore-protocol/identity

+

+ Semaphore identity +

+

A library to create Semaphore identities.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + Documentation typedoc + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This library provides a class that can be used to create identities compatible with the Semaphore circuits. Each identity contains an EdDSA private key, its public key, and the identity commitment, which is the Poseidon hash of the public key.
+

🛠 Install

npm or yarn

Install the @semaphore-protocol/identity package with npm:

+
npm i @semaphore-protocol/identity
+
+

or yarn:

+
yarn add @semaphore-protocol/identity
+
+

📜 Usage

For more information on the functions provided by @semaphore-protocol/identity, please refer to the TypeDoc documentation.

+

# new Identity(privateKey?: BigNumberish): Identity

+
import { Identity } from "@semaphore-protocol/identity"

// The identity will be generated randomly.
const { privateKey, publicKey, commitment } = new Identity()

// Alternatively, you can pass your private key.
const identity = new Identity("your-private-key") +
+

# identity.signMessage(message: BigNumberish): Signature<string>

+
import { Identity } from "@semaphore-protocol/identity"

const message = "message"
const identity = new Identity()

const signature = identity.signMessage(message) +
+

# Identity.verifySignature(message: BigNumberish, signature: Signature, publicKey: Point): boolean

+
import { Identity } from "@semaphore-protocol/identity"

const message = "message"
const identity = new Identity()

const signature = identity.signMessage("message", signature)

Identity.verifySignature(message, signature, identity.publicKey) +
+

Index

Classes

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_semaphore_protocol_proof.html b/modules/_semaphore_protocol_proof.html new file mode 100644 index 000000000..aaaf96149 --- /dev/null +++ b/modules/_semaphore_protocol_proof.html @@ -0,0 +1,85 @@ +@semaphore-protocol/proof | Semaphore SDK

Module @semaphore-protocol/proof

+

+ Semaphore proof +

+

A library to generate and verify Semaphore proofs.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + Documentation typedoc + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This library provides utility functions to generate and verify Semaphore proofs compatible with the Semaphore circuits. Generating valid zero-knowledge proofs requires files that can only be obtained in an attested trusted-setup ceremony.
+

🛠 Install

npm or yarn

Install the @semaphore-protocol/proof package and its peer dependencies with npm:

+
npm i @semaphore-protocol/identity @semaphore-protocol/group @semaphore-protocol/proof
+
+

or yarn:

+
yarn add @semaphore-protocol/identity @semaphore-protocol/group @semaphore-protocol/proof
+
+

📜 Usage

For more information on the functions provided by @semaphore-protocol/proof, please refer to the TypeDoc documentation.

+

# generateProof( +identity: Identity, +group: Group, +message: BigNumberish | Uint8Array | string, +scope: BigNumberish | Uint8Array | string, +merkleTreeDepth: number, +snarkArtifacts?: SnarkArtifacts +): Promise<_SemaphoreProof_>

+
import { Identity } from "@semaphore-protocol/identity"
import { Group } from "@semaphore-protocol/group"
import { generateProof } from "@semaphore-protocol/proof"

const identity1 = new Identity()
const identity2 = new Identity()
const identity3 = new Identity()

const group = new Group([identity1.commitment, identity2.commitment, identity3.commitment])

const message = "Hello world"
const scope = "Semaphore"

const proof1 = await generateProof(identity1, group, message, scope)

// You can also specify the maximum tree depth supported by the proof.
const proof2 = await generateProof(identity2, group, message, scope, 20)

// You can also specify the default zkey/wasm files.
const proof3 = await generateProof(identity3, group, message, scope, 20, {
wasmFilePath: "./semaphore.wasm",
zkeyFilePath: "./semaphore.zkey"
}) +
+

# verifyProof(semaphoreProof: SemaphoreProof): Promise<_boolean_>

+
import { verifyProof } from "@semaphore-protocol/proof"

await verifyProof(proof1) +
+

Index

Type Aliases

Functions

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_semaphore_protocol_utils.constants.html b/modules/_semaphore_protocol_utils.constants.html new file mode 100644 index 000000000..2f82f13c8 --- /dev/null +++ b/modules/_semaphore_protocol_utils.constants.html @@ -0,0 +1,3 @@ +constants | Semaphore SDK

Generated using TypeDoc

\ No newline at end of file diff --git a/modules/_semaphore_protocol_utils.html b/modules/_semaphore_protocol_utils.html new file mode 100644 index 000000000..9f74f9f5d --- /dev/null +++ b/modules/_semaphore_protocol_utils.html @@ -0,0 +1,70 @@ +@semaphore-protocol/utils | Semaphore SDK

Module @semaphore-protocol/utils

+

+ Semaphore utils +

+

A library to provide utility functions to the other Semaphore packages.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + Documentation typedoc + + + Linter eslint + + + Code style prettier + +

+ + + +

🛠 Install

npm or yarn

Install the @semaphore-protocol/utils package with npm:

+
npm i @semaphore-protocol/utils
+
+

or yarn:

+
yarn add @semaphore-protocol/utils
+
+

📜 Usage

For more information on the functions and modules provided by @semaphore-protocol/utils, please refer to the TypeDoc documentation.

+
// You can import functions/parameters from the main bundle.
import { supportedNetworks, decodeMessage } from "@semaphore-protocol/utils"

// Or by using conditional exports.
import supportedNetworks from "@semaphore-protocol/utils/supported-networks"
import decodeMessage from "@semaphore-protocol/utils/decode-message" +
+

Index

Namespaces

Type Aliases

Variables

Functions

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_semaphore_protocol_data.EthersNetwork.html b/types/_semaphore_protocol_data.EthersNetwork.html new file mode 100644 index 000000000..ebd99855e --- /dev/null +++ b/types/_semaphore_protocol_data.EthersNetwork.html @@ -0,0 +1 @@ +EthersNetwork | Semaphore SDK
EthersNetwork: "mainnet" | "sepolia" | "matic" | "matic-mumbai" | "arbitrum" | "arbitrum-sepolia" | "optimism" | "optimism-sepolia"

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_semaphore_protocol_data.EthersOptions.html b/types/_semaphore_protocol_data.EthersOptions.html new file mode 100644 index 000000000..be3e76300 --- /dev/null +++ b/types/_semaphore_protocol_data.EthersOptions.html @@ -0,0 +1 @@ +EthersOptions | Semaphore SDK
EthersOptions: {
    address?: string;
    apiKey?: string;
    applicationId?: string;
    applicationSecret?: string;
    projectId?: string;
    projectSecret?: string;
    provider?: "etherscan" | "infura" | "alchemy" | "cloudflare" | "pocket" | "ankr";
    startBlock?: number;
}

Type declaration

  • Optional address?: string
  • Optional apiKey?: string
  • Optional applicationId?: string
  • Optional applicationSecret?: string
  • Optional projectId?: string
  • Optional projectSecret?: string
  • Optional provider?: "etherscan" | "infura" | "alchemy" | "cloudflare" | "pocket" | "ankr"
  • Optional startBlock?: number

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_semaphore_protocol_data.GroupOptions.html b/types/_semaphore_protocol_data.GroupOptions.html new file mode 100644 index 000000000..324970971 --- /dev/null +++ b/types/_semaphore_protocol_data.GroupOptions.html @@ -0,0 +1 @@ +GroupOptions | Semaphore SDK
GroupOptions: {
    filters?: {
        admin?: string;
        identityCommitment?: string;
        timestamp?: Date;
        timestampGte?: Date;
        timestampLte?: Date;
    };
    members?: boolean;
    validatedProofs?: boolean;
}

Type declaration

  • Optional filters?: {
        admin?: string;
        identityCommitment?: string;
        timestamp?: Date;
        timestampGte?: Date;
        timestampLte?: Date;
    }
    • Optional admin?: string
    • Optional identityCommitment?: string
    • Optional timestamp?: Date
    • Optional timestampGte?: Date
    • Optional timestampLte?: Date
  • Optional members?: boolean
  • Optional validatedProofs?: boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_semaphore_protocol_data.GroupResponse.html b/types/_semaphore_protocol_data.GroupResponse.html new file mode 100644 index 000000000..e5b896afe --- /dev/null +++ b/types/_semaphore_protocol_data.GroupResponse.html @@ -0,0 +1 @@ +GroupResponse | Semaphore SDK
GroupResponse: {
    admin?: string;
    id: string;
    members?: string[];
    merkleTree: {
        depth: number;
        root: string;
        size: number;
    };
    validatedProofs?: {
        merkleTreeDepth: number;
        merkleTreeRoot: string;
        message: string;
        nullifier: string;
        points: string[];
        scope: string;
        timestamp?: string;
    }[];
}

Type declaration

  • Optional admin?: string
  • id: string
  • Optional members?: string[]
  • merkleTree: {
        depth: number;
        root: string;
        size: number;
    }
    • depth: number
    • root: string
    • size: number
  • Optional validatedProofs?: {
        merkleTreeDepth: number;
        merkleTreeRoot: string;
        message: string;
        nullifier: string;
        points: string[];
        scope: string;
        timestamp?: string;
    }[]

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_semaphore_protocol_group.MerkleProof.html b/types/_semaphore_protocol_group.MerkleProof.html new file mode 100644 index 000000000..2ae9060da --- /dev/null +++ b/types/_semaphore_protocol_group.MerkleProof.html @@ -0,0 +1,9 @@ +MerkleProof | Semaphore SDK
MerkleProof<N>: {
    index: number;
    leaf: N;
    root: N;
    siblings: N[];
}

The Merkle Proof contains the necessary parameters to enable the +verifier to be certain that a leaf belongs to the tree. Given the value +of the leaf and its index, it is possible to traverse the tree by +recalculating the hashes up to the root and using the node siblings. +If the calculated root matches the root in the proof, then the leaf +belongs to the tree. It's important to note that the function used +to generate the proof and the one used to verify it must use the +same hash function.

+

Type Parameters

  • N = bigint

Type declaration

  • index: number
  • leaf: N
  • root: N
  • siblings: N[]

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_semaphore_protocol_heyauthn.AuthenticationOptions.html b/types/_semaphore_protocol_heyauthn.AuthenticationOptions.html new file mode 100644 index 000000000..8b2ebb350 --- /dev/null +++ b/types/_semaphore_protocol_heyauthn.AuthenticationOptions.html @@ -0,0 +1 @@ +AuthenticationOptions | Semaphore SDK
AuthenticationOptions: {
    allowCredentials?: PublicKeyCredentialDescriptorFuture[];
    challenge?: string | Uint8Array;
    extensions?: AuthenticationExtensionsClientInputs;
    rpID?: string;
    timeout?: number;
    userVerification?: UserVerificationRequirement;
}

Type declaration

  • Optional allowCredentials?: PublicKeyCredentialDescriptorFuture[]
  • Optional challenge?: string | Uint8Array
  • Optional extensions?: AuthenticationExtensionsClientInputs
  • Optional rpID?: string
  • Optional timeout?: number
  • Optional userVerification?: UserVerificationRequirement

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_semaphore_protocol_heyauthn.RegistrationOptions.html b/types/_semaphore_protocol_heyauthn.RegistrationOptions.html new file mode 100644 index 000000000..b0c4dba21 --- /dev/null +++ b/types/_semaphore_protocol_heyauthn.RegistrationOptions.html @@ -0,0 +1 @@ +RegistrationOptions | Semaphore SDK
RegistrationOptions: {
    attestationType?: AttestationConveyancePreference;
    authenticatorSelection?: AuthenticatorSelectionCriteria;
    challenge?: string | Uint8Array;
    excludeCredentials?: PublicKeyCredentialDescriptorFuture[];
    extensions?: AuthenticationExtensionsClientInputs;
    rpID: string;
    rpName: string;
    supportedAlgorithmIDs?: COSEAlgorithmIdentifier[];
    timeout?: number;
    userDisplayName?: string;
    userID: string;
    userName: string;
}

Type declaration

  • Optional attestationType?: AttestationConveyancePreference
  • Optional authenticatorSelection?: AuthenticatorSelectionCriteria
  • Optional challenge?: string | Uint8Array
  • Optional excludeCredentials?: PublicKeyCredentialDescriptorFuture[]
  • Optional extensions?: AuthenticationExtensionsClientInputs
  • rpID: string
  • rpName: string
  • Optional supportedAlgorithmIDs?: COSEAlgorithmIdentifier[]
  • Optional timeout?: number
  • Optional userDisplayName?: string
  • userID: string
  • userName: string

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_semaphore_protocol_proof.SemaphoreProof.html b/types/_semaphore_protocol_proof.SemaphoreProof.html new file mode 100644 index 000000000..c999ccf57 --- /dev/null +++ b/types/_semaphore_protocol_proof.SemaphoreProof.html @@ -0,0 +1 @@ +SemaphoreProof | Semaphore SDK
SemaphoreProof: {
    merkleTreeDepth: number;
    merkleTreeRoot: NumericString;
    message: NumericString;
    nullifier: NumericString;
    points: PackedGroth16Proof;
    scope: NumericString;
}

Type declaration

  • merkleTreeDepth: number
  • merkleTreeRoot: NumericString
  • message: NumericString
  • nullifier: NumericString
  • points: PackedGroth16Proof
  • scope: NumericString

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_semaphore_protocol_proof.SnarkArtifacts.html b/types/_semaphore_protocol_proof.SnarkArtifacts.html new file mode 100644 index 000000000..be60d7edd --- /dev/null +++ b/types/_semaphore_protocol_proof.SnarkArtifacts.html @@ -0,0 +1 @@ +SnarkArtifacts | Semaphore SDK
SnarkArtifacts: {
    wasmFilePath: string;
    zkeyFilePath: string;
}

Type declaration

  • wasmFilePath: string
  • zkeyFilePath: string

Generated using TypeDoc

\ No newline at end of file diff --git a/types/_semaphore_protocol_utils.SupportedNetwork.html b/types/_semaphore_protocol_utils.SupportedNetwork.html new file mode 100644 index 000000000..7a8b62623 --- /dev/null +++ b/types/_semaphore_protocol_utils.SupportedNetwork.html @@ -0,0 +1 @@ +SupportedNetwork | Semaphore SDK
SupportedNetwork: keyof typeof supportedNetworks

Generated using TypeDoc

\ No newline at end of file diff --git a/variables/_semaphore_protocol_utils.constants.MAX_DEPTH.html b/variables/_semaphore_protocol_utils.constants.MAX_DEPTH.html new file mode 100644 index 000000000..37bc684a3 --- /dev/null +++ b/variables/_semaphore_protocol_utils.constants.MAX_DEPTH.html @@ -0,0 +1 @@ +MAX_DEPTH | Semaphore SDK
MAX_DEPTH: 12 = 12

Generated using TypeDoc

\ No newline at end of file diff --git a/variables/_semaphore_protocol_utils.constants.MIN_DEPTH.html b/variables/_semaphore_protocol_utils.constants.MIN_DEPTH.html new file mode 100644 index 000000000..199b6b41f --- /dev/null +++ b/variables/_semaphore_protocol_utils.constants.MIN_DEPTH.html @@ -0,0 +1 @@ +MIN_DEPTH | Semaphore SDK
MIN_DEPTH: 1 = 1

Generated using TypeDoc

\ No newline at end of file diff --git a/variables/_semaphore_protocol_utils.defaultNetwork.html b/variables/_semaphore_protocol_utils.defaultNetwork.html new file mode 100644 index 000000000..928d84cb8 --- /dev/null +++ b/variables/_semaphore_protocol_utils.defaultNetwork.html @@ -0,0 +1 @@ +defaultNetwork | Semaphore SDK
defaultNetwork: SupportedNetwork = "sepolia"

Generated using TypeDoc

\ No newline at end of file diff --git a/variables/_semaphore_protocol_utils.deployedContracts.html b/variables/_semaphore_protocol_utils.deployedContracts.html new file mode 100644 index 000000000..1787c820a --- /dev/null +++ b/variables/_semaphore_protocol_utils.deployedContracts.html @@ -0,0 +1 @@ +deployedContracts | Semaphore SDK
deployedContracts: {
    contracts: {
        address: string;
        name: string;
        startBlock: number;
    }[];
    network: string;
}[]

Type declaration

  • contracts: {
        address: string;
        name: string;
        startBlock: number;
    }[]
  • network: string

Generated using TypeDoc

\ No newline at end of file diff --git a/variables/_semaphore_protocol_utils.supportedNetworks.html b/variables/_semaphore_protocol_utils.supportedNetworks.html new file mode 100644 index 000000000..b76db7653 --- /dev/null +++ b/variables/_semaphore_protocol_utils.supportedNetworks.html @@ -0,0 +1 @@ +supportedNetworks | Semaphore SDK
supportedNetworks: {
    arbitrum-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    matic-mumbai: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    optimism-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
}

Type declaration

  • arbitrum-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • matic-mumbai: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • optimism-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string

Generated using TypeDoc

\ No newline at end of file