diff --git a/CHANGELOG.md b/CHANGELOG.md index 42858f5..c5f43c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # booru Changelog +## v2.7.7 + +- feat: support cors proxy using global method +- fix: update api endpoint of rule34.paheal + ## v2.7.6 - feat: support atfbooru diff --git a/dist/index.d.ts b/dist/index.d.ts index 7b07a0c..3fa5f6d 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -33,7 +33,7 @@ interface InternalSearchParameters extends SearchParameters { /** If `order:random` should be faked */ fakeLimit?: number; /** The tags used in the search */ - tags?: string[] | string; + tags?: string[]; } /** @@ -369,6 +369,7 @@ declare class Booru { * @param credentials Credentials for the API (Currently not used) */ constructor(site: Site, credentials?: BooruCredentials); + protected normalizeTags(tags: string | string[]): string[]; /** * Search for images on this booru * @param {String|String[]} tags The tag(s) to search for @@ -387,11 +388,11 @@ declare class Booru { * The internal & common searching logic, pls dont use this use .search instead * * @protected - * @param {String[]|String} tags The tags to search with + * @param {String[]} tags The tags to search with * @param {InternalSearchParameters} searchArgs The arguments for the search * @return {Promise} */ - protected doSearchRequest(tags: string[] | string, { uri, limit, random, page, credentials }?: InternalSearchParameters): Promise; + protected doSearchRequest(tags: string[], { uri, limit, random, page, credentials }?: InternalSearchParameters): Promise; /** * Generates a URL to search the booru with, mostly for debugging purposes * @param opt diff --git a/dist/index.js b/dist/index.js index ccade7a..d8364c6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -233,7 +233,7 @@ var sites_default = { ], nsfw: true, api: { - search: "/api/danbooru/find_posts/index.xml?", + search: "/api/danbooru/find_posts?", postView: "/post/view/" }, random: false @@ -357,12 +357,16 @@ function searchURI(site, tags = [], limit = 100, page = 1, credentials) { const q = credentials.query; credentialsQuery = q.startsWith("&") ? q : "&" + q; } - return `http${site.insecure ? "" : "s"}://${site.domain}${site.api.search}${site.tagQuery}=${expandTags(tags).join(site.tagJoin)}&limit=${limit}&${site.paginate}=${page}${credentialsQuery}`; + let uri = `http${site.insecure ? "" : "s"}://${site.domain}${site.api.search}${site.tagQuery}=${expandTags(tags).join(site.tagJoin)}&limit=${limit}&${site.paginate}=${page}${credentialsQuery}`; + if (typeof BOORU_FETCH_PROXY === "function") { + uri = BOORU_FETCH_PROXY(uri) || uri; + } + return uri; } var defaultOptions = { headers: { Accept: "application/json, application/xml;q=0.9, */*;q=0.8", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.52" + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0" } }; @@ -749,6 +753,13 @@ var Booru = class { this.site = site; this.credentials = credentials; } + normalizeTags(tags) { + if (!Array.isArray(tags)) { + return [tags]; + } else { + return tags.slice(); + } + } async search(tags, { limit = 1, random = false, @@ -757,8 +768,9 @@ var Booru = class { credentials } = {}) { const fakeLimit = random && !this.site.random ? 100 : 0; + const tagArray = this.normalizeTags(tags); try { - const searchResult = await this.doSearchRequest(tags, { + const searchResult = await this.doSearchRequest(tagArray, { limit, random, page, @@ -767,7 +779,7 @@ var Booru = class { }); return this.parseSearchResult(searchResult, { fakeLimit, - tags, + tags: tagArray, limit, random, page, @@ -794,8 +806,6 @@ var Booru = class { page = 1, credentials } = {}) { - if (!Array.isArray(tags)) - tags = [tags]; let fakeLimit; if (random) { if (this.site.random) { @@ -884,9 +894,6 @@ var Booru = class { if (tags === void 0) { tags = []; } - if (!Array.isArray(tags)) { - tags = [tags]; - } if (!showUnavailable) { posts = posts.filter((p) => p.available); } @@ -901,16 +908,14 @@ var Derpibooru = class extends Booru_default { super(site, credentials); } search(tags, { limit = 1, random = false, page = 0 } = {}) { - if (!Array.isArray(tags)) { - tags = [tags]; - } + const tagArray = this.normalizeTags(tags); if (tags[0] === void 0) { - tags[0] = "*"; + tagArray[0] = "*"; } page += 1; - const uri = this.getSearchUrl({ tags, limit, page }) + (random && this.site.random === "string" ? `&${this.site.random}` : "") + (this.credentials ? `&key=${this.credentials.token}` : ""); - return super.doSearchRequest(tags, { limit, random, page, uri }).then( - (r) => super.parseSearchResult(r, { fakeLimit: 0, tags, limit, random, page }) + const uri = this.getSearchUrl({ tags: tagArray, limit, page }) + (random && this.site.random === "string" ? `&${this.site.random}` : "") + (this.credentials ? `&key=${this.credentials.token}` : ""); + return super.doSearchRequest(tagArray, { limit, random, page, uri }).then( + (r) => super.parseSearchResult(r, { fakeLimit: 0, tags: tagArray, limit, random, page }) ).catch((e) => Promise.reject(new BooruError(e))); } }; diff --git a/dist/index.mjs b/dist/index.mjs index 4e3722e..adeae45 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -196,7 +196,7 @@ var sites_default = { ], nsfw: true, api: { - search: "/api/danbooru/find_posts/index.xml?", + search: "/api/danbooru/find_posts?", postView: "/post/view/" }, random: false @@ -320,12 +320,16 @@ function searchURI(site, tags = [], limit = 100, page = 1, credentials) { const q = credentials.query; credentialsQuery = q.startsWith("&") ? q : "&" + q; } - return `http${site.insecure ? "" : "s"}://${site.domain}${site.api.search}${site.tagQuery}=${expandTags(tags).join(site.tagJoin)}&limit=${limit}&${site.paginate}=${page}${credentialsQuery}`; + let uri = `http${site.insecure ? "" : "s"}://${site.domain}${site.api.search}${site.tagQuery}=${expandTags(tags).join(site.tagJoin)}&limit=${limit}&${site.paginate}=${page}${credentialsQuery}`; + if (typeof BOORU_FETCH_PROXY === "function") { + uri = BOORU_FETCH_PROXY(uri) || uri; + } + return uri; } var defaultOptions = { headers: { Accept: "application/json, application/xml;q=0.9, */*;q=0.8", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.52" + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0" } }; @@ -712,6 +716,13 @@ var Booru = class { this.site = site; this.credentials = credentials; } + normalizeTags(tags) { + if (!Array.isArray(tags)) { + return [tags]; + } else { + return tags.slice(); + } + } async search(tags, { limit = 1, random = false, @@ -720,8 +731,9 @@ var Booru = class { credentials } = {}) { const fakeLimit = random && !this.site.random ? 100 : 0; + const tagArray = this.normalizeTags(tags); try { - const searchResult = await this.doSearchRequest(tags, { + const searchResult = await this.doSearchRequest(tagArray, { limit, random, page, @@ -730,7 +742,7 @@ var Booru = class { }); return this.parseSearchResult(searchResult, { fakeLimit, - tags, + tags: tagArray, limit, random, page, @@ -757,8 +769,6 @@ var Booru = class { page = 1, credentials } = {}) { - if (!Array.isArray(tags)) - tags = [tags]; let fakeLimit; if (random) { if (this.site.random) { @@ -847,9 +857,6 @@ var Booru = class { if (tags === void 0) { tags = []; } - if (!Array.isArray(tags)) { - tags = [tags]; - } if (!showUnavailable) { posts = posts.filter((p) => p.available); } @@ -864,16 +871,14 @@ var Derpibooru = class extends Booru_default { super(site, credentials); } search(tags, { limit = 1, random = false, page = 0 } = {}) { - if (!Array.isArray(tags)) { - tags = [tags]; - } + const tagArray = this.normalizeTags(tags); if (tags[0] === void 0) { - tags[0] = "*"; + tagArray[0] = "*"; } page += 1; - const uri = this.getSearchUrl({ tags, limit, page }) + (random && this.site.random === "string" ? `&${this.site.random}` : "") + (this.credentials ? `&key=${this.credentials.token}` : ""); - return super.doSearchRequest(tags, { limit, random, page, uri }).then( - (r) => super.parseSearchResult(r, { fakeLimit: 0, tags, limit, random, page }) + const uri = this.getSearchUrl({ tags: tagArray, limit, page }) + (random && this.site.random === "string" ? `&${this.site.random}` : "") + (this.credentials ? `&key=${this.credentials.token}` : ""); + return super.doSearchRequest(tagArray, { limit, random, page, uri }).then( + (r) => super.parseSearchResult(r, { fakeLimit: 0, tags: tagArray, limit, random, page }) ).catch((e) => Promise.reject(new BooruError(e))); } }; diff --git a/docs/assets/highlight.css b/docs/assets/highlight.css index db8b030..212b41b 100644 --- a/docs/assets/highlight.css +++ b/docs/assets/highlight.css @@ -1,16 +1,16 @@ :root { - --light-hl-0: #000000; - --dark-hl-0: #D4D4D4; - --light-hl-1: #008000; - --dark-hl-1: #6A9955; - --light-hl-2: #0000FF; - --dark-hl-2: #569CD6; - --light-hl-3: #0070C1; - --dark-hl-3: #4FC1FF; - --light-hl-4: #795E26; - --dark-hl-4: #DCDCAA; - --light-hl-5: #A31515; - --dark-hl-5: #CE9178; + --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: #0000FF; + --dark-hl-4: #569CD6; + --light-hl-5: #0070C1; + --dark-hl-5: #4FC1FF; --light-hl-6: #001080; --dark-hl-6: #9CDCFE; --light-hl-7: #098658; diff --git a/docs/assets/icons.js b/docs/assets/icons.js new file mode 100644 index 0000000..b79c9e8 --- /dev/null +++ b/docs/assets/icons.js @@ -0,0 +1,15 @@ +(function(svg) { + svg.innerHTML = ``; + svg.style.display = 'none'; + if (location.protocol === 'file:') { + if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', updateUseElements); + else updateUseElements() + function updateUseElements() { + document.querySelectorAll('use').forEach(el => { + if (el.getAttribute('href').includes('#icon-')) { + el.setAttribute('href', el.getAttribute('href').replace(/.*#/, '#')); + } + }); + } + } +})(document.body.appendChild(document.createElementNS('http://www.w3.org/2000/svg', 'svg'))) \ No newline at end of file diff --git a/docs/assets/icons.svg b/docs/assets/icons.svg new file mode 100644 index 0000000..7dead61 --- /dev/null +++ b/docs/assets/icons.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/assets/main.js b/docs/assets/main.js index b949086..d6f1388 100644 --- a/docs/assets/main.js +++ b/docs/assets/main.js @@ -1,54 +1,59 @@ "use strict"; -"use strict";(()=>{var Qe=Object.create;var ae=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var _e=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Me=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ce(e))!Re.call(t,i)&&i!==n&&ae(t,i,{get:()=>e[i],enumerable:!(r=Pe(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Qe(Oe(t)):{},Me(e||!t||!t.__esModule?ae(n,"default",{value:t,enumerable:!0}):n,t));var de=_e((ce,he)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var h=t.utils.clone(n)||{};h.position=[a,l],h.index=s.length,s.push(new t.Token(r.slice(a,o),h))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ou?h+=2:a==u&&(n+=r[l+1]*i[h+1],l+=2,h+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}if(s.str.length==0&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}s.str.length==1&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var h=s.str.charAt(0),m=s.str.charAt(1),v;m in s.node.edges?v=s.node.edges[m]:(v=new t.TokenSet,s.node.edges[m]=v),s.str.length==1&&(v.final=!0),i.push({node:v,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof ce=="object"?he.exports=n():e.lunr=n()}(this,function(){return t})})()});var le=[];function j(t,e){le.push({selector:e,constructor:t})}var Y=class{constructor(){this.createComponents(document.body)}createComponents(e){le.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r}),r.dataset.hasInstance=String(!0))})})}};var k=class{constructor(e){this.el=e.el}};var J=class{constructor(){this.listeners={}}addEventListener(e,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(n)}removeEventListener(e,n){if(!(e in this.listeners))return;let r=this.listeners[e];for(let i=0,s=r.length;i{let n=Date.now();return(...r)=>{n+e-Date.now()<0&&(t(...r),n=Date.now())}};var re=class extends J{constructor(){super();this.scrollTop=0;this.lastY=0;this.width=0;this.height=0;this.showToolbar=!0;this.toolbar=document.querySelector(".tsd-page-toolbar"),this.navigation=document.querySelector(".col-menu"),window.addEventListener("scroll",ne(()=>this.onScroll(),10)),window.addEventListener("resize",ne(()=>this.onResize(),10)),this.searchInput=document.querySelector("#tsd-search input"),this.searchInput&&this.searchInput.addEventListener("focus",()=>{this.hideShowToolbar()}),this.onResize(),this.onScroll()}triggerResize(){let n=new CustomEvent("resize",{detail:{width:this.width,height:this.height}});this.dispatchEvent(n)}onResize(){this.width=window.innerWidth||0,this.height=window.innerHeight||0;let n=new CustomEvent("resize",{detail:{width:this.width,height:this.height}});this.dispatchEvent(n)}onScroll(){this.scrollTop=window.scrollY||0;let n=new CustomEvent("scroll",{detail:{scrollTop:this.scrollTop}});this.dispatchEvent(n),this.hideShowToolbar()}hideShowToolbar(){let n=this.showToolbar;this.showToolbar=this.lastY>=this.scrollTop||this.scrollTop<=0||!!this.searchInput&&this.searchInput===document.activeElement,n!==this.showToolbar&&(this.toolbar.classList.toggle("tsd-page-toolbar--hide"),this.navigation?.classList.toggle("col-menu--hide")),this.lastY=this.scrollTop}},R=re;R.instance=new re;var X=class extends k{constructor(n){super(n);this.anchors=[];this.index=-1;R.instance.addEventListener("resize",()=>this.onResize()),R.instance.addEventListener("scroll",r=>this.onScroll(r)),this.createAnchors()}createAnchors(){let n=window.location.href;n.indexOf("#")!=-1&&(n=n.substring(0,n.indexOf("#"))),this.el.querySelectorAll("a").forEach(r=>{let i=r.href;if(i.indexOf("#")==-1||i.substring(0,n.length)!=n)return;let s=i.substring(i.indexOf("#")+1),o=document.querySelector("a.tsd-anchor[name="+s+"]"),a=r.parentNode;!o||!a||this.anchors.push({link:a,anchor:o,position:0})}),this.onResize()}onResize(){let n;for(let i=0,s=this.anchors.length;ii.position-s.position);let r=new CustomEvent("scroll",{detail:{scrollTop:R.instance.scrollTop}});this.onScroll(r)}onScroll(n){let r=n.detail.scrollTop+5,i=this.anchors,s=i.length-1,o=this.index;for(;o>-1&&i[o].position>r;)o-=1;for(;o-1&&this.anchors[this.index].link.classList.remove("focus"),this.index=o,this.index>-1&&this.anchors[this.index].link.classList.add("focus"))}};var ue=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var me=De(de());function ve(){let t=document.getElementById("tsd-search");if(!t)return;let e=document.getElementById("search-script");t.classList.add("loading"),e&&(e.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),e.addEventListener("load",()=>{t.classList.remove("loading"),t.classList.add("ready")}),window.searchData&&t.classList.remove("loading"));let n=document.querySelector("#tsd-search input"),r=document.querySelector("#tsd-search .results");if(!n||!r)throw new Error("The input field or the result list wrapper was not found");let i=!1;r.addEventListener("mousedown",()=>i=!0),r.addEventListener("mouseup",()=>{i=!1,t.classList.remove("has-focus")}),n.addEventListener("focus",()=>t.classList.add("has-focus")),n.addEventListener("blur",()=>{i||(i=!1,t.classList.remove("has-focus"))});let s={base:t.dataset.base+"/"};Fe(t,r,n,s)}function Fe(t,e,n,r){n.addEventListener("input",ue(()=>{Ae(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"?fe(e,-1):s.key==="ArrowDown"?fe(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 He(t,e){t.index||window.searchData&&(e.classList.remove("loading"),e.classList.add("ready"),t.data=window.searchData,t.index=me.Index.load(window.searchData.index))}function Ae(t,e,n,r){if(He(r,t),!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s=i?r.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o${pe(u.parent,i)}.${l}`);let h=document.createElement("li");h.classList.value=u.classes??"";let m=document.createElement("a");m.href=r.base+u.url,m.innerHTML=l,h.append(m),e.appendChild(h)}}function fe(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 pe(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(ie(t.substring(s,o)),`${ie(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(ie(t.substring(s))),i.join("")}var Ne={"&":"&","<":"<",">":">","'":"'",'"':"""};function ie(t){return t.replace(/[&<>"'"]/g,e=>Ne[e])}var F="mousedown",ye="mousemove",B="mouseup",Z={x:0,y:0},ge=!1,se=!1,je=!1,H=!1,xe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(xe?"is-mobile":"not-mobile");xe&&"ontouchstart"in document.documentElement&&(je=!0,F="touchstart",ye="touchmove",B="touchend");document.addEventListener(F,t=>{se=!0,H=!1;let e=F=="touchstart"?t.targetTouches[0]:t;Z.y=e.pageY||0,Z.x=e.pageX||0});document.addEventListener(ye,t=>{if(!!se&&!H){let e=F=="touchstart"?t.targetTouches[0]:t,n=Z.x-(e.pageX||0),r=Z.y-(e.pageY||0);H=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{se=!1});document.addEventListener("click",t=>{ge&&(t.preventDefault(),t.stopImmediatePropagation(),ge=!1)});var K=class extends k{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){H||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-menu, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!H&&this.active&&n.target.closest(".col-menu")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var oe;try{oe=localStorage}catch{oe={getItem(){return null},setItem(){}}}var Q=oe;var Le=document.head.appendChild(document.createElement("style"));Le.dataset.for="filters";var ee=class extends k{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),Le.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var te=class extends k{constructor(n){super(n);this.calculateHeights(),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.textContent.replace(/\s+/g,"-").toLowerCase()}`,this.setLocalStorage(this.fromLocalStorage(),!0),this.summary.addEventListener("click",r=>this.toggleVisibility(r)),this.icon.style.transform=this.getIconRotation()}getIconRotation(n=this.el.open){return`rotate(${n?0:-90}deg)`}calculateHeights(){let n=this.el.open,{position:r,left:i}=this.el.style;this.el.style.position="fixed",this.el.style.left="-9999px",this.el.open=!0,this.expandedHeight=this.el.offsetHeight+"px",this.el.open=!1,this.collapsedHeight=this.el.offsetHeight+"px",this.el.open=n,this.el.style.height=n?this.expandedHeight:this.collapsedHeight,this.el.style.position=r,this.el.style.left=i}toggleVisibility(n){n.preventDefault(),this.el.style.overflow="hidden",this.el.open?this.collapse():this.expand()}expand(n=!0){this.el.open=!0,this.animate(this.collapsedHeight,this.expandedHeight,{opening:!0,duration:n?300:0})}collapse(n=!0){this.animate(this.expandedHeight,this.collapsedHeight,{opening:!1,duration:n?300:0})}animate(n,r,{opening:i,duration:s=300}){if(this.animation)return;let o={duration:s,easing:"ease"};this.animation=this.el.animate({height:[n,r]},o),this.icon.animate({transform:[this.icon.style.transform||this.getIconRotation(!i),this.getIconRotation(i)]},o).addEventListener("finish",()=>{this.icon.style.transform=this.getIconRotation(i)}),this.animation.addEventListener("finish",()=>this.animationEnd(i))}animationEnd(n){this.el.open=n,this.animation=void 0,this.el.style.height="auto",this.el.style.overflow="visible",this.setLocalStorage(n)}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.open}setLocalStorage(n,r=!1){this.fromLocalStorage()===n&&!r||(Q.setItem(this.key,n.toString()),this.el.open=n,this.handleValueChange(r))}handleValueChange(n=!1){this.fromLocalStorage()===this.el.open&&!n||(this.fromLocalStorage()?this.expand(!1):this.collapse(!1))}};function be(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,Ee(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),Ee(t.value)})}function Ee(t){document.documentElement.dataset.theme=t}ve();j(X,".menu-highlight");j(K,"a[data-toggle]");j(te,".tsd-index-accordion");j(ee,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("theme");Se&&be(Se);var Be=new Y;Object.defineProperty(window,"app",{value:Be});})(); -/*! - * lunr.Builder - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.Index - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.Pipeline - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.Set - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.TokenSet - * 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.tokenizer - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.trimmer - * Copyright (C) 2020 Oliver Nightingale - */ -/*! - * lunr.utils - * Copyright (C) 2020 Oliver Nightingale - */ -/** - * 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 - */ +"use strict";(()=>{var Ce=Object.create;var ne=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Pe(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Ce(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),y=s.str.charAt(1),p;y in s.node.edges?p=s.node.edges[y]:(p=new t.TokenSet,s.node.edges[y]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(console.log("Show page"),document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){console.log("Scorlling");let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!e.checkVisibility()){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ve(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ne(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ve(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${ce(l.parent,i)}.${d}`);let y=document.createElement("li");y.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,y.append(p),e.appendChild(y)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ne(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var He={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>He[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",fe="mousemove",H="mouseup",J={x:0,y:0},pe=!1,ee=!1,Be=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(Be=!0,F="touchstart",fe="touchmove",H="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(H,()=>{ee=!1});document.addEventListener("click",t=>{pe&&(t.preventDefault(),t.stopImmediatePropagation(),pe=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(H,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(H,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ye=document.head.appendChild(document.createElement("style"));ye.dataset.for="filters";var Y=class extends I{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ye.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ve(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ve(t.value)})}function ve(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.pathname===r.pathname&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); +/*! Bundled license information: + +lunr/lunr.js: + (** + * 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/docs/assets/navigation.js b/docs/assets/navigation.js new file mode 100644 index 0000000..4bf7e21 --- /dev/null +++ b/docs/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACoWSwU6DQBCG32W8UrEUG+XY6r3Ri4nxsIUhbFxYMjMQE+O7G6jCUuj2uPvN/2V2Zt+/QfBLIIEMc9UYgQBqJQUkUNqsMci3hZTmZqSfusogideP8eYu/gmG/M5aavZGMY+KtDsihyPrbYNlHT2cG56JLF0w9MxneEKq9bErnRtGNjMEpyJIQDhbaV7VpFslCI76YFnm0u7W19ArKkqLF+TGyMJcJtjr0YILcS3oS72VZrc8jH9ydR17wgwr0co47etKkHKVDpsdi6bC6H47G8ZBkSpRkJaF50U+IWtBx9Iq0upokMMeTJObyAnmlqYTzZsqFW0rDv/QNLx1PzohW9PiJYGDPRLun7mUP5FZ9OMX+MeWEaoDAAA=" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js index 8609bfa..6d9a9c2 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"kinds\":{\"32\":\"Variable\",\"64\":\"Function\",\"128\":\"Class\",\"256\":\"Interface\",\"512\":\"Constructor\",\"1024\":\"Property\",\"2048\":\"Method\",\"65536\":\"Type literal\",\"262144\":\"Accessor\",\"8388608\":\"Reference\"},\"rows\":[{\"kind\":64,\"name\":\"search\",\"url\":\"functions/search.html\",\"classes\":\"tsd-kind-function\"},{\"kind\":64,\"name\":\"forSite\",\"url\":\"functions/forSite.html\",\"classes\":\"tsd-kind-function\"},{\"kind\":8388608,\"name\":\"default\",\"url\":\"modules.html#default\",\"classes\":\"tsd-kind-reference\"},{\"kind\":128,\"name\":\"BooruClass\",\"url\":\"classes/BooruClass.html\",\"classes\":\"tsd-kind-class\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/BooruClass.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class tsd-is-private\",\"parent\":\"BooruClass\"},{\"kind\":1024,\"name\":\"domain\",\"url\":\"classes/BooruClass.html#domain\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"BooruClass\"},{\"kind\":1024,\"name\":\"site\",\"url\":\"classes/BooruClass.html#site\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"BooruClass\"},{\"kind\":1024,\"name\":\"credentials\",\"url\":\"classes/BooruClass.html#credentials\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"BooruClass\"},{\"kind\":2048,\"name\":\"search\",\"url\":\"classes/BooruClass.html#search\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"BooruClass\"},{\"kind\":2048,\"name\":\"postView\",\"url\":\"classes/BooruClass.html#postView\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"BooruClass\"},{\"kind\":2048,\"name\":\"doSearchRequest\",\"url\":\"classes/BooruClass.html#doSearchRequest\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-protected\",\"parent\":\"BooruClass\"},{\"kind\":2048,\"name\":\"getSearchUrl\",\"url\":\"classes/BooruClass.html#getSearchUrl\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"BooruClass\"},{\"kind\":2048,\"name\":\"parseSearchResult\",\"url\":\"classes/BooruClass.html#parseSearchResult\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-protected\",\"parent\":\"BooruClass\"},{\"kind\":32,\"name\":\"sites\",\"url\":\"variables/sites.html\",\"classes\":\"tsd-kind-variable\"},{\"kind\":64,\"name\":\"resolveSite\",\"url\":\"functions/resolveSite.html\",\"classes\":\"tsd-kind-function\"},{\"kind\":128,\"name\":\"BooruError\",\"url\":\"classes/BooruError.html\",\"classes\":\"tsd-kind-class\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"classes/BooruError.html#__type\",\"classes\":\"tsd-kind-type-literal tsd-parent-kind-class\",\"parent\":\"BooruError\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/BooruError.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"BooruError\"},{\"kind\":128,\"name\":\"Derpibooru\",\"url\":\"classes/Derpibooru.html\",\"classes\":\"tsd-kind-class tsd-is-private\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/Derpibooru.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"Derpibooru\"},{\"kind\":2048,\"name\":\"search\",\"url\":\"classes/Derpibooru.html#search\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"Derpibooru\"},{\"kind\":1024,\"name\":\"domain\",\"url\":\"classes/Derpibooru.html#domain\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-inherited\",\"parent\":\"Derpibooru\"},{\"kind\":1024,\"name\":\"site\",\"url\":\"classes/Derpibooru.html#site\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-inherited\",\"parent\":\"Derpibooru\"},{\"kind\":1024,\"name\":\"credentials\",\"url\":\"classes/Derpibooru.html#credentials\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-inherited\",\"parent\":\"Derpibooru\"},{\"kind\":2048,\"name\":\"postView\",\"url\":\"classes/Derpibooru.html#postView\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-inherited\",\"parent\":\"Derpibooru\"},{\"kind\":2048,\"name\":\"doSearchRequest\",\"url\":\"classes/Derpibooru.html#doSearchRequest\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-inherited\",\"parent\":\"Derpibooru\"},{\"kind\":2048,\"name\":\"getSearchUrl\",\"url\":\"classes/Derpibooru.html#getSearchUrl\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-inherited\",\"parent\":\"Derpibooru\"},{\"kind\":2048,\"name\":\"parseSearchResult\",\"url\":\"classes/Derpibooru.html#parseSearchResult\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-inherited\",\"parent\":\"Derpibooru\"},{\"kind\":128,\"name\":\"XmlBooru\",\"url\":\"classes/XmlBooru.html\",\"classes\":\"tsd-kind-class\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/XmlBooru.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"XmlBooru\"},{\"kind\":1024,\"name\":\"domain\",\"url\":\"classes/XmlBooru.html#domain\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-inherited\",\"parent\":\"XmlBooru\"},{\"kind\":1024,\"name\":\"site\",\"url\":\"classes/XmlBooru.html#site\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-inherited\",\"parent\":\"XmlBooru\"},{\"kind\":1024,\"name\":\"credentials\",\"url\":\"classes/XmlBooru.html#credentials\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-inherited\",\"parent\":\"XmlBooru\"},{\"kind\":2048,\"name\":\"search\",\"url\":\"classes/XmlBooru.html#search\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-inherited\",\"parent\":\"XmlBooru\"},{\"kind\":2048,\"name\":\"postView\",\"url\":\"classes/XmlBooru.html#postView\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-inherited\",\"parent\":\"XmlBooru\"},{\"kind\":2048,\"name\":\"doSearchRequest\",\"url\":\"classes/XmlBooru.html#doSearchRequest\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-inherited\",\"parent\":\"XmlBooru\"},{\"kind\":2048,\"name\":\"getSearchUrl\",\"url\":\"classes/XmlBooru.html#getSearchUrl\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-inherited\",\"parent\":\"XmlBooru\"},{\"kind\":2048,\"name\":\"parseSearchResult\",\"url\":\"classes/XmlBooru.html#parseSearchResult\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-inherited\",\"parent\":\"XmlBooru\"},{\"kind\":128,\"name\":\"Post\",\"url\":\"classes/Post.html\",\"classes\":\"tsd-kind-class\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/Post.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"booru\",\"url\":\"classes/Post.html#booru\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"fileUrl\",\"url\":\"classes/Post.html#fileUrl\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"height\",\"url\":\"classes/Post.html#height\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"width\",\"url\":\"classes/Post.html#width\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"sampleUrl\",\"url\":\"classes/Post.html#sampleUrl\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"sampleHeight\",\"url\":\"classes/Post.html#sampleHeight\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"sampleWidth\",\"url\":\"classes/Post.html#sampleWidth\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"previewUrl\",\"url\":\"classes/Post.html#previewUrl\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"previewHeight\",\"url\":\"classes/Post.html#previewHeight\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"previewWidth\",\"url\":\"classes/Post.html#previewWidth\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"id\",\"url\":\"classes/Post.html#id\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"available\",\"url\":\"classes/Post.html#available\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"tags\",\"url\":\"classes/Post.html#tags\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"score\",\"url\":\"classes/Post.html#score\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"source\",\"url\":\"classes/Post.html#source\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"rating\",\"url\":\"classes/Post.html#rating\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"createdAt\",\"url\":\"classes/Post.html#createdAt\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":1024,\"name\":\"data\",\"url\":\"classes/Post.html#data\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-private\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"isRatingS\",\"url\":\"classes/Post.html#isRatingS\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"isRatingQ\",\"url\":\"classes/Post.html#isRatingQ\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"isRatingE\",\"url\":\"classes/Post.html#isRatingE\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"aspectRatio\",\"url\":\"classes/Post.html#aspectRatio\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"jpegUrl\",\"url\":\"classes/Post.html#jpegUrl\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"jpegWidth\",\"url\":\"classes/Post.html#jpegWidth\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"jpegHeight\",\"url\":\"classes/Post.html#jpegHeight\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"fileExt\",\"url\":\"classes/Post.html#fileExt\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"sampleSize\",\"url\":\"classes/Post.html#sampleSize\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"jpegSize\",\"url\":\"classes/Post.html#jpegSize\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"fileSize\",\"url\":\"classes/Post.html#fileSize\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"sampleSizeText\",\"url\":\"classes/Post.html#sampleSizeText\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"sampleDownloadText\",\"url\":\"classes/Post.html#sampleDownloadText\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"sampleDownloadName\",\"url\":\"classes/Post.html#sampleDownloadName\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"jpegSizeText\",\"url\":\"classes/Post.html#jpegSizeText\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"jpegDownloadText\",\"url\":\"classes/Post.html#jpegDownloadText\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"jpegDownloadName\",\"url\":\"classes/Post.html#jpegDownloadName\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"fileSizeText\",\"url\":\"classes/Post.html#fileSizeText\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"fileDownloadText\",\"url\":\"classes/Post.html#fileDownloadText\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"fileDownloadName\",\"url\":\"classes/Post.html#fileDownloadName\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"createdTime\",\"url\":\"classes/Post.html#createdTime\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"sourceUrl\",\"url\":\"classes/Post.html#sourceUrl\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":262144,\"name\":\"postView\",\"url\":\"classes/Post.html#postView\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"Post\"},{\"kind\":128,\"name\":\"SearchResults\",\"url\":\"classes/SearchResults.html\",\"classes\":\"tsd-kind-class\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/SearchResults.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class tsd-is-private\",\"parent\":\"SearchResults\"},{\"kind\":1024,\"name\":\"booru\",\"url\":\"classes/SearchResults.html#booru\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"SearchResults\"},{\"kind\":1024,\"name\":\"page\",\"url\":\"classes/SearchResults.html#page\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"SearchResults\"},{\"kind\":1024,\"name\":\"tags\",\"url\":\"classes/SearchResults.html#tags\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"SearchResults\"},{\"kind\":1024,\"name\":\"options\",\"url\":\"classes/SearchResults.html#options\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"SearchResults\"},{\"kind\":1024,\"name\":\"posts\",\"url\":\"classes/SearchResults.html#posts\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"SearchResults\"},{\"kind\":262144,\"name\":\"first\",\"url\":\"classes/SearchResults.html#first\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"SearchResults\"},{\"kind\":262144,\"name\":\"last\",\"url\":\"classes/SearchResults.html#last\",\"classes\":\"tsd-kind-accessor tsd-parent-kind-class\",\"parent\":\"SearchResults\"},{\"kind\":2048,\"name\":\"nextPage\",\"url\":\"classes/SearchResults.html#nextPage\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"SearchResults\"},{\"kind\":2048,\"name\":\"tagged\",\"url\":\"classes/SearchResults.html#tagged\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"SearchResults\"},{\"kind\":2048,\"name\":\"blacklist\",\"url\":\"classes/SearchResults.html#blacklist\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"SearchResults\"},{\"kind\":128,\"name\":\"Site\",\"url\":\"classes/Site.html\",\"classes\":\"tsd-kind-class\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/Site.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"Site\"},{\"kind\":1024,\"name\":\"domain\",\"url\":\"classes/Site.html#domain\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Site\"},{\"kind\":1024,\"name\":\"type\",\"url\":\"classes/Site.html#type\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Site\"},{\"kind\":1024,\"name\":\"aliases\",\"url\":\"classes/Site.html#aliases\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Site\"},{\"kind\":1024,\"name\":\"nsfw\",\"url\":\"classes/Site.html#nsfw\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Site\"},{\"kind\":1024,\"name\":\"api\",\"url\":\"classes/Site.html#api\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Site\"},{\"kind\":1024,\"name\":\"paginate\",\"url\":\"classes/Site.html#paginate\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Site\"},{\"kind\":1024,\"name\":\"random\",\"url\":\"classes/Site.html#random\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Site\"},{\"kind\":1024,\"name\":\"tagQuery\",\"url\":\"classes/Site.html#tagQuery\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Site\"},{\"kind\":1024,\"name\":\"tagJoin\",\"url\":\"classes/Site.html#tagJoin\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Site\"},{\"kind\":1024,\"name\":\"insecure\",\"url\":\"classes/Site.html#insecure\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Site\"},{\"kind\":1024,\"name\":\"defaultTags\",\"url\":\"classes/Site.html#defaultTags\",\"classes\":\"tsd-kind-property tsd-parent-kind-class\",\"parent\":\"Site\"},{\"kind\":256,\"name\":\"BooruCredentials\",\"url\":\"interfaces/BooruCredentials.html\",\"classes\":\"tsd-kind-interface\"},{\"kind\":1024,\"name\":\"token\",\"url\":\"interfaces/BooruCredentials.html#token\",\"classes\":\"tsd-kind-property tsd-parent-kind-interface\",\"parent\":\"BooruCredentials\"},{\"kind\":1024,\"name\":\"query\",\"url\":\"interfaces/BooruCredentials.html#query\",\"classes\":\"tsd-kind-property tsd-parent-kind-interface\",\"parent\":\"BooruCredentials\"},{\"kind\":256,\"name\":\"SearchParameters\",\"url\":\"interfaces/SearchParameters.html\",\"classes\":\"tsd-kind-interface\"},{\"kind\":1024,\"name\":\"limit\",\"url\":\"interfaces/SearchParameters.html#limit\",\"classes\":\"tsd-kind-property tsd-parent-kind-interface\",\"parent\":\"SearchParameters\"},{\"kind\":1024,\"name\":\"random\",\"url\":\"interfaces/SearchParameters.html#random\",\"classes\":\"tsd-kind-property tsd-parent-kind-interface\",\"parent\":\"SearchParameters\"},{\"kind\":1024,\"name\":\"page\",\"url\":\"interfaces/SearchParameters.html#page\",\"classes\":\"tsd-kind-property tsd-parent-kind-interface\",\"parent\":\"SearchParameters\"},{\"kind\":1024,\"name\":\"credentials\",\"url\":\"interfaces/SearchParameters.html#credentials\",\"classes\":\"tsd-kind-property tsd-parent-kind-interface\",\"parent\":\"SearchParameters\"},{\"kind\":1024,\"name\":\"showUnavailable\",\"url\":\"interfaces/SearchParameters.html#showUnavailable\",\"classes\":\"tsd-kind-property tsd-parent-kind-interface\",\"parent\":\"SearchParameters\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,32.495]],[\"comment/0\",[]],[\"name/1\",[1,43.481]],[\"comment/1\",[]],[\"name/2\",[2,43.481]],[\"comment/2\",[]],[\"name/3\",[3,43.481]],[\"comment/3\",[]],[\"name/4\",[4,27.387]],[\"comment/4\",[]],[\"name/5\",[5,32.495]],[\"comment/5\",[]],[\"name/6\",[6,32.495]],[\"comment/6\",[]],[\"name/7\",[7,32.495]],[\"comment/7\",[]],[\"name/8\",[0,32.495]],[\"comment/8\",[]],[\"name/9\",[8,32.495]],[\"comment/9\",[]],[\"name/10\",[9,35.008]],[\"comment/10\",[]],[\"name/11\",[10,35.008]],[\"comment/11\",[]],[\"name/12\",[11,35.008]],[\"comment/12\",[]],[\"name/13\",[12,43.481]],[\"comment/13\",[]],[\"name/14\",[13,43.481]],[\"comment/14\",[]],[\"name/15\",[14,43.481]],[\"comment/15\",[]],[\"name/16\",[15,43.481]],[\"comment/16\",[]],[\"name/17\",[4,27.387]],[\"comment/17\",[]],[\"name/18\",[16,43.481]],[\"comment/18\",[]],[\"name/19\",[4,27.387]],[\"comment/19\",[]],[\"name/20\",[0,32.495]],[\"comment/20\",[]],[\"name/21\",[5,32.495]],[\"comment/21\",[]],[\"name/22\",[6,32.495]],[\"comment/22\",[]],[\"name/23\",[7,32.495]],[\"comment/23\",[]],[\"name/24\",[8,32.495]],[\"comment/24\",[]],[\"name/25\",[9,35.008]],[\"comment/25\",[]],[\"name/26\",[10,35.008]],[\"comment/26\",[]],[\"name/27\",[11,35.008]],[\"comment/27\",[]],[\"name/28\",[17,43.481]],[\"comment/28\",[]],[\"name/29\",[4,27.387]],[\"comment/29\",[]],[\"name/30\",[5,32.495]],[\"comment/30\",[]],[\"name/31\",[6,32.495]],[\"comment/31\",[]],[\"name/32\",[7,32.495]],[\"comment/32\",[]],[\"name/33\",[0,32.495]],[\"comment/33\",[]],[\"name/34\",[8,32.495]],[\"comment/34\",[]],[\"name/35\",[9,35.008]],[\"comment/35\",[]],[\"name/36\",[10,35.008]],[\"comment/36\",[]],[\"name/37\",[11,35.008]],[\"comment/37\",[]],[\"name/38\",[18,43.481]],[\"comment/38\",[]],[\"name/39\",[4,27.387]],[\"comment/39\",[]],[\"name/40\",[19,38.373]],[\"comment/40\",[]],[\"name/41\",[20,43.481]],[\"comment/41\",[]],[\"name/42\",[21,43.481]],[\"comment/42\",[]],[\"name/43\",[22,43.481]],[\"comment/43\",[]],[\"name/44\",[23,43.481]],[\"comment/44\",[]],[\"name/45\",[24,43.481]],[\"comment/45\",[]],[\"name/46\",[25,43.481]],[\"comment/46\",[]],[\"name/47\",[26,43.481]],[\"comment/47\",[]],[\"name/48\",[27,43.481]],[\"comment/48\",[]],[\"name/49\",[28,43.481]],[\"comment/49\",[]],[\"name/50\",[29,43.481]],[\"comment/50\",[]],[\"name/51\",[30,43.481]],[\"comment/51\",[]],[\"name/52\",[31,38.373]],[\"comment/52\",[]],[\"name/53\",[32,43.481]],[\"comment/53\",[]],[\"name/54\",[33,43.481]],[\"comment/54\",[]],[\"name/55\",[34,43.481]],[\"comment/55\",[]],[\"name/56\",[35,43.481]],[\"comment/56\",[]],[\"name/57\",[36,43.481]],[\"comment/57\",[]],[\"name/58\",[37,43.481]],[\"comment/58\",[]],[\"name/59\",[38,43.481]],[\"comment/59\",[]],[\"name/60\",[39,43.481]],[\"comment/60\",[]],[\"name/61\",[40,43.481]],[\"comment/61\",[]],[\"name/62\",[41,43.481]],[\"comment/62\",[]],[\"name/63\",[42,43.481]],[\"comment/63\",[]],[\"name/64\",[43,43.481]],[\"comment/64\",[]],[\"name/65\",[44,43.481]],[\"comment/65\",[]],[\"name/66\",[45,43.481]],[\"comment/66\",[]],[\"name/67\",[46,43.481]],[\"comment/67\",[]],[\"name/68\",[47,43.481]],[\"comment/68\",[]],[\"name/69\",[48,43.481]],[\"comment/69\",[]],[\"name/70\",[49,43.481]],[\"comment/70\",[]],[\"name/71\",[50,43.481]],[\"comment/71\",[]],[\"name/72\",[51,43.481]],[\"comment/72\",[]],[\"name/73\",[52,43.481]],[\"comment/73\",[]],[\"name/74\",[53,43.481]],[\"comment/74\",[]],[\"name/75\",[54,43.481]],[\"comment/75\",[]],[\"name/76\",[55,43.481]],[\"comment/76\",[]],[\"name/77\",[56,43.481]],[\"comment/77\",[]],[\"name/78\",[57,43.481]],[\"comment/78\",[]],[\"name/79\",[58,43.481]],[\"comment/79\",[]],[\"name/80\",[8,32.495]],[\"comment/80\",[]],[\"name/81\",[59,43.481]],[\"comment/81\",[]],[\"name/82\",[4,27.387]],[\"comment/82\",[]],[\"name/83\",[19,38.373]],[\"comment/83\",[]],[\"name/84\",[60,38.373]],[\"comment/84\",[]],[\"name/85\",[31,38.373]],[\"comment/85\",[]],[\"name/86\",[61,43.481]],[\"comment/86\",[]],[\"name/87\",[62,43.481]],[\"comment/87\",[]],[\"name/88\",[63,43.481]],[\"comment/88\",[]],[\"name/89\",[64,43.481]],[\"comment/89\",[]],[\"name/90\",[65,43.481]],[\"comment/90\",[]],[\"name/91\",[66,43.481]],[\"comment/91\",[]],[\"name/92\",[67,43.481]],[\"comment/92\",[]],[\"name/93\",[6,32.495]],[\"comment/93\",[]],[\"name/94\",[4,27.387]],[\"comment/94\",[]],[\"name/95\",[5,32.495]],[\"comment/95\",[]],[\"name/96\",[68,43.481]],[\"comment/96\",[]],[\"name/97\",[69,43.481]],[\"comment/97\",[]],[\"name/98\",[70,43.481]],[\"comment/98\",[]],[\"name/99\",[71,43.481]],[\"comment/99\",[]],[\"name/100\",[72,43.481]],[\"comment/100\",[]],[\"name/101\",[73,38.373]],[\"comment/101\",[]],[\"name/102\",[74,43.481]],[\"comment/102\",[]],[\"name/103\",[75,43.481]],[\"comment/103\",[]],[\"name/104\",[76,43.481]],[\"comment/104\",[]],[\"name/105\",[77,43.481]],[\"comment/105\",[]],[\"name/106\",[78,43.481]],[\"comment/106\",[]],[\"name/107\",[79,43.481]],[\"comment/107\",[]],[\"name/108\",[80,43.481]],[\"comment/108\",[]],[\"name/109\",[81,43.481]],[\"comment/109\",[]],[\"name/110\",[82,43.481]],[\"comment/110\",[]],[\"name/111\",[73,38.373]],[\"comment/111\",[]],[\"name/112\",[60,38.373]],[\"comment/112\",[]],[\"name/113\",[7,32.495]],[\"comment/113\",[]],[\"name/114\",[83,43.481]],[\"comment/114\",[]]],\"invertedIndex\":[[\"__type\",{\"_index\":15,\"name\":{\"16\":{}},\"comment\":{}}],[\"aliases\",{\"_index\":69,\"name\":{\"97\":{}},\"comment\":{}}],[\"api\",{\"_index\":71,\"name\":{\"99\":{}},\"comment\":{}}],[\"aspectratio\",{\"_index\":40,\"name\":{\"61\":{}},\"comment\":{}}],[\"available\",{\"_index\":30,\"name\":{\"51\":{}},\"comment\":{}}],[\"blacklist\",{\"_index\":67,\"name\":{\"92\":{}},\"comment\":{}}],[\"booru\",{\"_index\":19,\"name\":{\"40\":{},\"83\":{}},\"comment\":{}}],[\"booruclass\",{\"_index\":3,\"name\":{\"3\":{}},\"comment\":{}}],[\"boorucredentials\",{\"_index\":78,\"name\":{\"106\":{}},\"comment\":{}}],[\"booruerror\",{\"_index\":14,\"name\":{\"15\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":4,\"name\":{\"4\":{},\"17\":{},\"19\":{},\"29\":{},\"39\":{},\"82\":{},\"94\":{}},\"comment\":{}}],[\"createdat\",{\"_index\":35,\"name\":{\"56\":{}},\"comment\":{}}],[\"createdtime\",{\"_index\":57,\"name\":{\"78\":{}},\"comment\":{}}],[\"credentials\",{\"_index\":7,\"name\":{\"7\":{},\"23\":{},\"32\":{},\"113\":{}},\"comment\":{}}],[\"data\",{\"_index\":36,\"name\":{\"57\":{}},\"comment\":{}}],[\"default\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"defaulttags\",{\"_index\":77,\"name\":{\"105\":{}},\"comment\":{}}],[\"derpibooru\",{\"_index\":16,\"name\":{\"18\":{}},\"comment\":{}}],[\"domain\",{\"_index\":5,\"name\":{\"5\":{},\"21\":{},\"30\":{},\"95\":{}},\"comment\":{}}],[\"dosearchrequest\",{\"_index\":9,\"name\":{\"10\":{},\"25\":{},\"35\":{}},\"comment\":{}}],[\"filedownloadname\",{\"_index\":56,\"name\":{\"77\":{}},\"comment\":{}}],[\"filedownloadtext\",{\"_index\":55,\"name\":{\"76\":{}},\"comment\":{}}],[\"fileext\",{\"_index\":44,\"name\":{\"65\":{}},\"comment\":{}}],[\"filesize\",{\"_index\":47,\"name\":{\"68\":{}},\"comment\":{}}],[\"filesizetext\",{\"_index\":54,\"name\":{\"75\":{}},\"comment\":{}}],[\"fileurl\",{\"_index\":20,\"name\":{\"41\":{}},\"comment\":{}}],[\"first\",{\"_index\":63,\"name\":{\"88\":{}},\"comment\":{}}],[\"forsite\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"getsearchurl\",{\"_index\":10,\"name\":{\"11\":{},\"26\":{},\"36\":{}},\"comment\":{}}],[\"height\",{\"_index\":21,\"name\":{\"42\":{}},\"comment\":{}}],[\"id\",{\"_index\":29,\"name\":{\"50\":{}},\"comment\":{}}],[\"insecure\",{\"_index\":76,\"name\":{\"104\":{}},\"comment\":{}}],[\"isratinge\",{\"_index\":39,\"name\":{\"60\":{}},\"comment\":{}}],[\"isratingq\",{\"_index\":38,\"name\":{\"59\":{}},\"comment\":{}}],[\"isratings\",{\"_index\":37,\"name\":{\"58\":{}},\"comment\":{}}],[\"jpegdownloadname\",{\"_index\":53,\"name\":{\"74\":{}},\"comment\":{}}],[\"jpegdownloadtext\",{\"_index\":52,\"name\":{\"73\":{}},\"comment\":{}}],[\"jpegheight\",{\"_index\":43,\"name\":{\"64\":{}},\"comment\":{}}],[\"jpegsize\",{\"_index\":46,\"name\":{\"67\":{}},\"comment\":{}}],[\"jpegsizetext\",{\"_index\":51,\"name\":{\"72\":{}},\"comment\":{}}],[\"jpegurl\",{\"_index\":41,\"name\":{\"62\":{}},\"comment\":{}}],[\"jpegwidth\",{\"_index\":42,\"name\":{\"63\":{}},\"comment\":{}}],[\"last\",{\"_index\":64,\"name\":{\"89\":{}},\"comment\":{}}],[\"limit\",{\"_index\":82,\"name\":{\"110\":{}},\"comment\":{}}],[\"nextpage\",{\"_index\":65,\"name\":{\"90\":{}},\"comment\":{}}],[\"nsfw\",{\"_index\":70,\"name\":{\"98\":{}},\"comment\":{}}],[\"options\",{\"_index\":61,\"name\":{\"86\":{}},\"comment\":{}}],[\"page\",{\"_index\":60,\"name\":{\"84\":{},\"112\":{}},\"comment\":{}}],[\"paginate\",{\"_index\":72,\"name\":{\"100\":{}},\"comment\":{}}],[\"parsesearchresult\",{\"_index\":11,\"name\":{\"12\":{},\"27\":{},\"37\":{}},\"comment\":{}}],[\"post\",{\"_index\":18,\"name\":{\"38\":{}},\"comment\":{}}],[\"posts\",{\"_index\":62,\"name\":{\"87\":{}},\"comment\":{}}],[\"postview\",{\"_index\":8,\"name\":{\"9\":{},\"24\":{},\"34\":{},\"80\":{}},\"comment\":{}}],[\"previewheight\",{\"_index\":27,\"name\":{\"48\":{}},\"comment\":{}}],[\"previewurl\",{\"_index\":26,\"name\":{\"47\":{}},\"comment\":{}}],[\"previewwidth\",{\"_index\":28,\"name\":{\"49\":{}},\"comment\":{}}],[\"query\",{\"_index\":80,\"name\":{\"108\":{}},\"comment\":{}}],[\"random\",{\"_index\":73,\"name\":{\"101\":{},\"111\":{}},\"comment\":{}}],[\"rating\",{\"_index\":34,\"name\":{\"55\":{}},\"comment\":{}}],[\"resolvesite\",{\"_index\":13,\"name\":{\"14\":{}},\"comment\":{}}],[\"sampledownloadname\",{\"_index\":50,\"name\":{\"71\":{}},\"comment\":{}}],[\"sampledownloadtext\",{\"_index\":49,\"name\":{\"70\":{}},\"comment\":{}}],[\"sampleheight\",{\"_index\":24,\"name\":{\"45\":{}},\"comment\":{}}],[\"samplesize\",{\"_index\":45,\"name\":{\"66\":{}},\"comment\":{}}],[\"samplesizetext\",{\"_index\":48,\"name\":{\"69\":{}},\"comment\":{}}],[\"sampleurl\",{\"_index\":23,\"name\":{\"44\":{}},\"comment\":{}}],[\"samplewidth\",{\"_index\":25,\"name\":{\"46\":{}},\"comment\":{}}],[\"score\",{\"_index\":32,\"name\":{\"53\":{}},\"comment\":{}}],[\"search\",{\"_index\":0,\"name\":{\"0\":{},\"8\":{},\"20\":{},\"33\":{}},\"comment\":{}}],[\"searchparameters\",{\"_index\":81,\"name\":{\"109\":{}},\"comment\":{}}],[\"searchresults\",{\"_index\":59,\"name\":{\"81\":{}},\"comment\":{}}],[\"showunavailable\",{\"_index\":83,\"name\":{\"114\":{}},\"comment\":{}}],[\"site\",{\"_index\":6,\"name\":{\"6\":{},\"22\":{},\"31\":{},\"93\":{}},\"comment\":{}}],[\"sites\",{\"_index\":12,\"name\":{\"13\":{}},\"comment\":{}}],[\"source\",{\"_index\":33,\"name\":{\"54\":{}},\"comment\":{}}],[\"sourceurl\",{\"_index\":58,\"name\":{\"79\":{}},\"comment\":{}}],[\"tagged\",{\"_index\":66,\"name\":{\"91\":{}},\"comment\":{}}],[\"tagjoin\",{\"_index\":75,\"name\":{\"103\":{}},\"comment\":{}}],[\"tagquery\",{\"_index\":74,\"name\":{\"102\":{}},\"comment\":{}}],[\"tags\",{\"_index\":31,\"name\":{\"52\":{},\"85\":{}},\"comment\":{}}],[\"token\",{\"_index\":79,\"name\":{\"107\":{}},\"comment\":{}}],[\"type\",{\"_index\":68,\"name\":{\"96\":{}},\"comment\":{}}],[\"width\",{\"_index\":22,\"name\":{\"43\":{}},\"comment\":{}}],[\"xmlbooru\",{\"_index\":17,\"name\":{\"28\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAACq2cX2/kNg7Av8rBeZ1mx5Il2Xm7Xhe4u4dD2217BwwWB3fGSdxOxrO2k2y72O9eyJbHpEz63+QpSESRFH8UJctyvgRl8VoFd7svwe/56RDc6WgTnNKnLLgLqiwt94/BJnguj8FdcP982td5caretQ23j/XTMdgE+2NaVVkV3AXB1w2h5r4oP+R1RuhxLaOKojCJ5LbXdsju0+djfdH2VByej1nV6LjpG0ldoYgver4tivL5H1bqosr1edc3jXqmQnHRti9OVV0+7+uinFJ3g2V71XV1+CavvjmX+UvahOucltmpxr6CwWwFiErxlOanSdMXMTCgRXYqCJKz4oTW2tiX2SE71Xl6nERzg2UXWBTbqM+FU1E+pcf8z+yn9GHapi9NECzqbF9nh2VeeNONjW4ntna056Kqf8mz10lLQHCtrUPxoXH3x+zTc1bVMxLUl3+r6D5kdav65/I46YYnvDrSaVll3YAqWLXYkBM9roiAFGjm9rn9kpZ5+usxq941f59bysusKo4vGVPOQeuowkEZfl+WXN1smt6uDPfq2DI8CGrrHe3+d1l5zn+1UgN7fdPQfa/ULx+Mp3zWYICvyyqQb2yiApF25qxWvh1itXKBy0+PWZl7M2DaLrl6DUbnr17X2RxbzQYUmdVssQcLVjffh/mr29+uc4tdhnyPyGXoOttTy9IwE+cvS1eGZXSd8v1i16kr0UyuWwNGi9at5SGCNfd/T8dvyYrbNbzJcoGUzaqvF7+WVT1saGHNm7JJVjxscVG9m7I3Vu28iK6odYT1BZUO23+jOjflErOkegiGC+o1NtnKiq0urqtTdqeqqp/pb1RTp9warajYp1X1dBLHZDX1uLxdLaWmK6ik3xcEJfvHN6mgF0WzqmfjC1NV6A12r79rX675Pj9mVFr0unuJ5dofs/zhcSTCNxeB5bpf80M9rCu96q59ueYqfTpPRQXKrLXwz6noeGJr7fx3IlJYarmVc5m95NnreMCQ0GobkyHz5VZbmgqaJ7bcTn4Y0d40LteZvqT50R5rjKiGMsst1NTGolde+3uJ2Zm6L8oxr7v2FZqL53I/qroTWK67TOv89DCi+yKwXPe+zNI6O/x9LNuhzHILh7ROR5S75jnn854VoUUYgUyvfmzC8GEs4YHMrJEwNn6YYeOHK228n2Hj/UobaXXO9rXVUYzNYSS1xs5v5+xhvGD3Emv1T5VQKLPWxuSCgITWWLH7n/efx0z0Emv0t6vvh/zP0RoFhdbGasIGEFkbpwkLQOS6SP2UjQIZCK639l3xejoW6WGWRU/4eqv/sX+ca9UJX5MdE6P0xNZamhlTQvRaixPxJESvmQkT4/PE1lqaGU1C9FqLE9EkRNdYdHucn/JRY1hq1cxrtoETT31AZo0N9mAKPFdMvXP2d3TgOAOemQx36aj1TQ44hhpX3O3ATi86ACHsj5+EzLJ1Th+GmUaYcnJXWCIfpghLo09VsywV5+YN9Rxjveg1MSyqWRl40wkuszUoSiVxjkdY6wSvsnZM5xlzcgttoeP87HP9/cxsBLJXWKzTh4dseDBB52QreYW1X4/p/vdjPi+cUHhhZsISSb0PmrywMbsgdopmnfg2vix7V9YbmLjJNqa7/uM8EoMb17xcb3rM0yojpv1FdS+xXPupuh+um71q17zC63M+5nHTulzrOX3IT+lYrt0AkeX6y/R0KJ5GtF8EVuRH+vDDc1b+MZYjvcgq/f8uRpO7l1iuPT9V2f6ZOEzs1QORFTOzvWJLvmEF0xNJzbIilPYu5xLvkvNTnZX36f5yda6XGb9yhgAUv2en2SpvOnF6FANXGaOfUEpNGv00ml4jRmEY2xXh+7RMn7I6K8kw+jLzw3jMn/J6tsqbTnxs8QKuzpv4k1an6sBMs2hTPGl0xtZ42iR1lWLS8pz70HMdqB6L159Pw3cqk04MO8515OMmyE+H7HNw9yV4ycoqL07BXSBu5W0SbIL7PDse7LcKrYebYF88PVlVH13bL5ndcFiJVuTdNtjsthspbrXWHz9udl2PpqH5QyMWBptduInkrVYCiYVITASbnaDEBBKTwWYnKTGJxKJgs4s2wtwqFSOxCImpYLNT1BAUEtPBZqcpMY3ETLDZGUrMILE42OzijVS3oUmQWIzEEi68CQ6vjXZCyYUehwbEljIcYhShDXkYkpKYRmijHgpSEgMJbeBDklyImYQ29mFESmIsoQ1/qEhJTCY0XD6EmE1oGYSaVInxhAmrEgMS7DwRGJAIuWwU3lQRXD4KjEdILiMFpiMiLicFhiMUl20CsxGazTaB2QjDZpvAcETMZpvAcIRFEBqynGA6csthlJiOZOlITEeydKRXylg6EtORLB2J6UjFpZrEdKTmMEoMRxoWo8RwZMxilBiOTFiMEsOJLIIwpjBGmE4UsgUf04ma2pZsZHyroghLYjyRhSC2pHFvsbEUBLnGRRhQZDEIcpmLMKHIchBkvYwwoshyEGS9jDCiyHIQZL2MMKLIchBkGYwwImU5CHKmKYxIWRCChKkwI9XsBRJSEjNSzXaAZKQwI2VByJDirrw9gQUhSUYKM1IWhCQZKcxIWRCSZKQwI2VBSJKRwoyUBSFJRgoz0haEJBlpzEhbEJJkpDEjbUFIkpHGjLQFEZGMNGakm10bOY80ZqQtiIhkpL2tmwURkYw0ZqSbPQLJSGNG2oKISEYaM9LNJoFkpDEj06xDJCODGZmm1JGMDGZkLIiIZGQwI2NBKJKRwYyMBaFIRgYzMs3mmmRkMCNjQSiSkfF22BaEIhkZzMhYEIpkZDAjY0EokpHBjGILQpGMYswobjYLJKMYM4oFtxLHGFHcICJhxhhRzD78xJhQrNi1MMaE4uYJaEtKYkKxYets7D0GWQyazKQYE4otBk1mUowJJRaDJjMpwYQSi0GTmZRgQkmznyMzKcGIEstBk5mUYESJBaHJTEowo0Rxu8kEI0o0Rz3BhBLDbWQTDChpAJFJnHiPqg0gMjcT/2nVYjBkpWnboKwFYeizg633yLq1KAyZI20blG023pLK0bYNylochn4a3XoPrltLxNDPo1vv0XVroRj6QXPrPbxum4MFMlvaNihryRgSWtsGZS0bQ2Jr24Bsc5gQ09wGBw2WTUxz848amgOFmObmHzaEI9z844bmUIGuWKF/4NAcK5APYqF/4tCcK8T0MYY7c2iO2V6yss4O/2qP23a7/vXVl+D/7hBOJ91h4JcgSYK7L1+/9odu9jervHlF1PcxYd/HTgGmU3ODs2xvcPado23fWUuub3+w2PeUoKfieoJ3qGCQBgwy4nq29yr6XiEITSSs3CaI1Vjv5gwUudxrYB1uOsIzXRDoGAY6HtOQtd/XA+8V6KuZrugdLmAEBt6OOzTuZ9L+lNv2ZxS6uDi5hLXU3l5KERcJfFTc8FzPurn31PdVgGm85fuSce27unEJ6cblftopR6ts74yDMWgwBm4CXf5pTd9P9N3EeK/2bgzw3sCsMGzn/t8WgKwA3oZcxLsX7yDYYIwuYA68dD8T1o+i/fSx7L4BBM6ACR06PUI7vZw+e+fu4O7cNZ2hm2B0hmMBFdTNNUGgAAzUcOGxCrx+EZgxeszzqrkbDDrCVOSyuOs48BZYNWNW7UsdmHog7hFXl9xFIlBEQTFLWFeLsv3YGFAGkJleD1ndJonnaAj7ugos3IyVHJ7ugzswXqAm4sq//R4JdAG1X3Hzs3/JDiYnnGBbrhrmVfvZDF7fgE3N2nQ9P6GeYJ3QXJC7nniBAvmnOaj20jA75UBWGG64UMEgiUEhNFzRtQqGXCNgW4/ZHsw6AElzdaLrOHAYZJPhssl29pI5Av30WD/3WSfoCUKkuRC1d/HAdAXFIeFywr2w73vFApZkLgntTbz2BTiwB0pnwnbsvsj31zSQwLGb525HIblQtdehwMyDq8mWy+XL3U/gOQATc1VlMFxgLdbdpoHztb8IBfyFod5yEWu+FO9W0MrbQ4RQhdu5CBc/yeX1ufBWYRD7iAubu8QKxg9Mx2OmXpqb3n3HBI7auez2FNLFMWaD0X6RSlR4UMYUO4a2t78YgloQsQNpuw5mpgCxU9wkc/d8QLKjfQ/nbnetBWSMhLG77FS5Fbz7MhNUe1ATFLdhcP/ia7CMg77s5rj9XIddK8C4Dec1VuEX3wikj+HSpFVBZAl8ruGG33YerBigummuRvRdB26DPDFcnrTd/fQEzCNujWt7DrMTOB2xTrefHYMkATNbsaDdvzPpuwG2blq7R0XhfpXjus7gChuYKnAHGLKRA/URdVcgXWI24x6L1+cTeeQQwxnHPkX7UwXuLlwM3OZVup8JG4v2X/iBaQc94JaX7vtuABF0U6zfTTcv4RRcirmAd1fjwZjBoBMu0nX68FuBnywNPKbYcmGp04dBFTWwIG250PgbDQkSSrktRszVAnctFNhEqxe3WrTXy0FsQEgTbh4OZy+YhxEXmM9Px+EzPlgMBenjx01wzs/ZMT9lwd3u49evfwHNhHLzI1gAAA=="; \ No newline at end of file diff --git a/docs/assets/style.css b/docs/assets/style.css index e509385..778b949 100644 --- a/docs/assets/style.css +++ b/docs/assets/style.css @@ -2,38 +2,80 @@ /* 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: #707070; - --light-color-link: #4da6ff; - --light-color-ts: #db1373; - --light-color-ts-interface: #139d2c; - --light-color-ts-enum: #9c891a; - --light-color-ts-class: #2484e5; + --light-color-text-aside: #6e6e6e; + --light-color-link: #1f70c2; + + --light-color-ts-keyword: #056bd6; + --light-color-ts-project: #b111c9; + --light-color-ts-module: var(--light-color-ts-project); + --light-color-ts-namespace: var(--light-color-ts-project); + --light-color-ts-enum: #7e6f15; + --light-color-ts-enum-member: var(--light-color-ts-enum); + --light-color-ts-variable: #4760ec; --light-color-ts-function: #572be7; - --light-color-ts-namespace: #b111c9; - --light-color-ts-private: #707070; - --light-color-ts-variable: #4d68ff; + --light-color-ts-class: #1f70c2; + --light-color-ts-interface: #108024; + --light-color-ts-constructor: var(--light-color-ts-class); + --light-color-ts-property: var(--light-color-ts-variable); + --light-color-ts-method: var(--light-color-ts-function); + --light-color-ts-call-signature: var(--light-color-ts-method); + --light-color-ts-index-signature: var(--light-color-ts-property); + --light-color-ts-constructor-signature: var(--light-color-ts-constructor); + --light-color-ts-parameter: var(--light-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --light-color-ts-type-parameter: #a55c0e; + --light-color-ts-accessor: var(--light-color-ts-property); + --light-color-ts-get-signature: var(--light-color-ts-accessor); + --light-color-ts-set-signature: var(--light-color-ts-accessor); + --light-color-ts-type-alias: #d51270; + /* reference not included as links will be colored with the kind that it points to */ + --light-external-icon: url("data:image/svg+xml;utf8,"); --light-color-scheme: light; /* 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: #ff6492; - --dark-color-ts-interface: #6cff87; + + --dark-color-ts-keyword: #3399ff; + --dark-color-ts-project: #e358ff; + --dark-color-ts-module: var(--dark-color-ts-project); + --dark-color-ts-namespace: var(--dark-color-ts-project); --dark-color-ts-enum: #f4d93e; - --dark-color-ts-class: #61b0ff; - --dark-color-ts-function: #9772ff; - --dark-color-ts-namespace: #e14dff; - --dark-color-ts-private: #e2e2e2; - --dark-color-ts-variable: #4d68ff; + --dark-color-ts-enum-member: var(--dark-color-ts-enum); + --dark-color-ts-variable: #798dff; + --dark-color-ts-function: #a280ff; + --dark-color-ts-class: #8ac4ff; + --dark-color-ts-interface: #6cff87; + --dark-color-ts-constructor: var(--dark-color-ts-class); + --dark-color-ts-property: var(--dark-color-ts-variable); + --dark-color-ts-method: var(--dark-color-ts-function); + --dark-color-ts-call-signature: var(--dark-color-ts-method); + --dark-color-ts-index-signature: var(--dark-color-ts-property); + --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor); + --dark-color-ts-parameter: var(--dark-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --dark-color-ts-type-parameter: #e07d13; + --dark-color-ts-accessor: var(--dark-color-ts-property); + --dark-color-ts-get-signature: var(--dark-color-ts-accessor); + --dark-color-ts-set-signature: var(--dark-color-ts-accessor); + --dark-color-ts-type-alias: #ff6492; + /* reference not included as links will be colored with the kind that it points to */ + --dark-external-icon: url("data:image/svg+xml;utf8,"); --dark-color-scheme: dark; } @@ -42,19 +84,39 @@ :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: var(--light-color-ts); - --color-ts-interface: var(--light-color-ts-interface); - --color-ts-enum: var(--light-color-ts-enum); - --color-ts-class: var(--light-color-ts-class); - --color-ts-function: var(--light-color-ts-function); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-module: var(--light-color-ts-module); --color-ts-namespace: var(--light-color-ts-namespace); - --color-ts-private: var(--light-color-ts-private); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --external-icon: var(--light-external-icon); --color-scheme: var(--light-color-scheme); } @@ -64,19 +126,39 @@ :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: var(--dark-color-ts); - --color-ts-interface: var(--dark-color-ts-interface); - --color-ts-enum: var(--dark-color-ts-enum); - --color-ts-class: var(--dark-color-ts-class); - --color-ts-function: var(--dark-color-ts-function); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-module: var(--dark-color-ts-module); --color-ts-namespace: var(--dark-color-ts-namespace); - --color-ts-private: var(--dark-color-ts-private); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --external-icon: var(--dark-external-icon); --color-scheme: var(--dark-color-scheme); } @@ -93,19 +175,39 @@ body { :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: var(--light-color-ts); - --color-ts-interface: var(--light-color-ts-interface); - --color-ts-enum: var(--light-color-ts-enum); - --color-ts-class: var(--light-color-ts-class); - --color-ts-function: var(--light-color-ts-function); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-module: var(--light-color-ts-module); --color-ts-namespace: var(--light-color-ts-namespace); - --color-ts-private: var(--light-color-ts-private); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --external-icon: var(--light-external-icon); --color-scheme: var(--light-color-scheme); } @@ -113,23 +215,48 @@ body { :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: var(--dark-color-ts); - --color-ts-interface: var(--dark-color-ts-interface); - --color-ts-enum: var(--dark-color-ts-enum); - --color-ts-class: var(--dark-color-ts-class); - --color-ts-function: var(--dark-color-ts-function); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-module: var(--dark-color-ts-module); --color-ts-namespace: var(--dark-color-ts-namespace); - --color-ts-private: var(--dark-color-ts-private); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --external-icon: var(--dark-external-icon); --color-scheme: var(--dark-color-scheme); } +.always-visible, +.always-visible .tsd-signatures { + display: inherit !important; +} + h1, h2, h3, @@ -139,6 +266,16 @@ h6 { line-height: 1.2; } +h1 > a:not(.link), +h2 > a:not(.link), +h3 > a:not(.link), +h4 > a:not(.link), +h5 > a:not(.link), +h6 > a:not(.link) { + text-decoration: none; + color: var(--color-text); +} + h1 { font-size: 1.875rem; margin: 0.67rem 0; @@ -173,12 +310,6 @@ h6 { text-transform: uppercase; } -pre { - white-space: pre; - white-space: pre-wrap; - word-wrap: break-word; -} - dl, menu, ol, @@ -191,61 +322,25 @@ dd { } .container { - max-width: 1600px; + max-width: 1700px; padding: 0 2rem; } -@media (min-width: 640px) { - .container { - padding: 0 4rem; - } -} -@media (min-width: 1200px) { - .container { - padding: 0 8rem; - } -} -@media (min-width: 1600px) { - .container { - padding: 0 12rem; - } -} - /* Footer */ -.tsd-generator { +footer { border-top: 1px solid var(--color-accent); padding-top: 1rem; padding-bottom: 1rem; max-height: 3.5rem; } - -.tsd-generator > p { - margin-top: 0; - margin-bottom: 0; - padding: 0 1rem; +.tsd-generator { + margin: 0 1em; } .container-main { - display: flex; - justify-content: space-between; - position: relative; margin: 0 auto; -} - -.col-4, -.col-8 { - box-sizing: border-box; - float: left; - padding: 2rem 1rem; -} - -.col-4 { - flex: 0 0 25%; -} -.col-8 { - flex: 1 0; - flex-wrap: wrap; - padding-left: 0; + /* toolbar, footer, margin */ + min-height: calc(100vh - 41px - 56px - 4rem); } @keyframes fade-in { @@ -288,22 +383,6 @@ dd { opacity: 0; } } -@keyframes shift-to-left { - from { - transform: translate(0, 0); - } - to { - transform: translate(-25%, 0); - } -} -@keyframes unshift-to-left { - from { - transform: translate(-25%, 0); - } - to { - transform: translate(0, 0); - } -} @keyframes pop-in-from-right { from { transform: translate(100%, 0); @@ -323,7 +402,8 @@ dd { } body { background: var(--color-background); - font-family: "Segoe UI", sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", + Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; color: var(--color-text); } @@ -352,13 +432,29 @@ pre { } pre { + position: relative; + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; padding: 10px; - border: 0.1em solid var(--color-accent); + border: 1px solid var(--color-accent); } pre code { padding: 0; font-size: 100%; } +pre > button { + position: absolute; + top: 10px; + right: 10px; + opacity: 0; + transition: opacity 0.1s; + box-sizing: border-box; +} +pre:hover > button, +pre > button.visible { + opacity: 1; +} blockquote { margin: 1em 0; @@ -374,13 +470,12 @@ blockquote { padding: 0 0 0 20px; margin: 0; } -.tsd-typography h4, .tsd-typography .tsd-index-panel h3, .tsd-index-panel .tsd-typography h3, +.tsd-typography h4, .tsd-typography h5, .tsd-typography h6 { font-size: 1em; - margin: 0; } .tsd-typography h5, .tsd-typography h6 { @@ -391,91 +486,18 @@ blockquote { .tsd-typography ol { margin: 1em 0; } - -@media (max-width: 1024px) { - html .col-content { - float: none; - max-width: 100%; - width: 100%; - padding-top: 3rem; - } - html .col-menu { - position: fixed !important; - overflow-y: auto; - -webkit-overflow-scrolling: touch; - z-index: 1024; - top: 0 !important; - bottom: 0 !important; - left: auto !important; - right: 0 !important; - padding: 1.5rem 1.5rem 0 0; - max-width: 25rem; - visibility: hidden; - background-color: var(--color-background); - transform: translate(100%, 0); - } - html .col-menu > *:last-child { - padding-bottom: 20px; - } - html .overlay { - content: ""; - display: block; - position: fixed; - z-index: 1023; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.75); - visibility: hidden; - } - - .to-has-menu .overlay { - animation: fade-in 0.4s; - } - - .to-has-menu :is(header, footer, .col-content) { - animation: shift-to-left 0.4s; - } - - .to-has-menu .col-menu { - animation: pop-in-from-right 0.4s; - } - - .from-has-menu .overlay { - animation: fade-out 0.4s; - } - - .from-has-menu :is(header, footer, .col-content) { - animation: unshift-to-left 0.4s; - } - - .from-has-menu .col-menu { - animation: pop-out-to-right 0.4s; - } - - .has-menu body { - overflow: hidden; - } - .has-menu .overlay { - visibility: visible; - } - .has-menu :is(header, footer, .col-content) { - transform: translate(-25%, 0); - } - .has-menu .col-menu { - visibility: visible; - transform: translate(0, 0); - display: grid; - align-items: center; - grid-template-rows: auto 1fr; - grid-gap: 1.5rem; - max-height: 100vh; - padding: 1rem 2rem; - } - .has-menu .tsd-navigation { - max-height: 100%; - } +.tsd-typography table { + border-collapse: collapse; + border: none; +} +.tsd-typography td, +.tsd-typography th { + padding: 6px 13px; + border: 1px solid var(--color-accent); +} +.tsd-typography thead, +.tsd-typography tr:nth-child(even) { + background-color: var(--color-background-secondary); } .tsd-breadcrumb { @@ -625,6 +647,28 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { font-weight: bold; } +.tsd-full-hierarchy:not(:last-child) { + margin-bottom: 1em; + padding-bottom: 1em; + border-bottom: 1px solid var(--color-accent); +} +.tsd-full-hierarchy, +.tsd-full-hierarchy ul { + list-style: none; + margin: 0; + padding: 0; +} +.tsd-full-hierarchy ul { + padding-left: 1.5rem; +} +.tsd-full-hierarchy a { + padding: 0.25rem 0 !important; + font-size: 1rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} + .tsd-panel-group.tsd-index-group { margin-bottom: 0; } @@ -656,43 +700,6 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { -o-page-break-inside: avoid; page-break-inside: avoid; } -.tsd-index-panel a, -.tsd-index-panel a.tsd-parent-kind-module { - color: var(--color-ts); -} -.tsd-index-panel a.tsd-parent-kind-interface { - color: var(--color-ts-interface); -} -.tsd-index-panel a.tsd-parent-kind-enum { - color: var(--color-ts-enum); -} -.tsd-index-panel a.tsd-parent-kind-class { - color: var(--color-ts-class); -} -.tsd-index-panel a.tsd-kind-module { - color: var(--color-ts-namespace); -} -.tsd-index-panel a.tsd-kind-interface { - color: var(--color-ts-interface); -} -.tsd-index-panel a.tsd-kind-enum { - color: var(--color-ts-enum); -} -.tsd-index-panel a.tsd-kind-class { - color: var(--color-ts-class); -} -.tsd-index-panel a.tsd-kind-function { - color: var(--color-ts-function); -} -.tsd-index-panel a.tsd-kind-namespace { - color: var(--color-ts-namespace); -} -.tsd-index-panel a.tsd-kind-variable { - color: var(--color-ts-variable); -} -.tsd-index-panel a.tsd-is-private { - color: var(--color-ts-private); -} .tsd-flag { display: inline-block; @@ -707,7 +714,7 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { } .tsd-anchor { - position: absolute; + position: relative; top: -100px; } @@ -721,108 +728,62 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { margin-bottom: 0; border-bottom: none; } -.tsd-member [data-tsd-kind] { - color: var(--color-ts); -} -.tsd-member [data-tsd-kind="Interface"] { - color: var(--color-ts-interface); -} -.tsd-member [data-tsd-kind="Enum"] { - color: var(--color-ts-enum); -} -.tsd-member [data-tsd-kind="Class"] { - color: var(--color-ts-class); + +.tsd-navigation.settings { + margin: 1rem 0; } -.tsd-member [data-tsd-kind="Private"] { - color: var(--color-ts-private); +.tsd-navigation > a, +.tsd-navigation .tsd-accordion-summary { + width: calc(100% - 0.25rem); + display: flex; + align-items: center; } - -.tsd-navigation a { - display: block; - margin: 0.4rem 0; - border-left: 2px solid transparent; +.tsd-navigation a, +.tsd-navigation summary > span, +.tsd-page-navigation a { + display: flex; + width: calc(100% - 0.25rem); + align-items: center; + padding: 0.25rem; color: var(--color-text); text-decoration: none; - transition: border-left-color 0.1s; + box-sizing: border-box; +} +.tsd-navigation a.current, +.tsd-page-navigation a.current { + background: var(--color-active-menu-item); } -.tsd-navigation a:hover { +.tsd-navigation a:hover, +.tsd-page-navigation a:hover { text-decoration: underline; } -.tsd-navigation ul { - margin: 0; +.tsd-navigation ul, +.tsd-page-navigation ul { + margin-top: 0; + margin-bottom: 0; padding: 0; list-style: none; } -.tsd-navigation li { +.tsd-navigation li, +.tsd-page-navigation li { padding: 0; + max-width: 100%; } - -.tsd-navigation.primary .tsd-accordion-details > ul { - margin-top: 0.75rem; -} -.tsd-navigation.primary a { - padding: 0.75rem 0.5rem; - margin: 0; +.tsd-nested-navigation { + margin-left: 3rem; } -.tsd-navigation.primary ul li a { - margin-left: 0.5rem; +.tsd-nested-navigation > li > details { + margin-left: -1.5rem; } -.tsd-navigation.primary ul li li a { +.tsd-small-nested-navigation { margin-left: 1.5rem; } -.tsd-navigation.primary ul li li li a { - margin-left: 2.5rem; -} -.tsd-navigation.primary ul li li li li a { - margin-left: 3.5rem; -} -.tsd-navigation.primary ul li li li li li a { - margin-left: 4.5rem; -} -.tsd-navigation.primary ul li li li li li li a { - margin-left: 5.5rem; -} -.tsd-navigation.primary li.current > a { - border-left: 0.15rem var(--color-text) solid; -} -.tsd-navigation.primary li.selected > a { - font-weight: bold; - border-left: 0.2rem var(--color-text) solid; -} -.tsd-navigation.primary ul li a:hover { - border-left: 0.2rem var(--color-text-aside) solid; -} -.tsd-navigation.primary li.globals + li > span, -.tsd-navigation.primary li.globals + li > a { - padding-top: 20px; +.tsd-small-nested-navigation > li > details { + margin-left: -1.5rem; } -.tsd-navigation.secondary.tsd-navigation--toolbar-hide { - max-height: calc(100vh - 1rem); - top: 0.5rem; -} -.tsd-navigation.secondary > ul { - display: inline; - padding-right: 0.5rem; - transition: opacity 0.2s; -} -.tsd-navigation.secondary ul li a { - padding-left: 0; -} -.tsd-navigation.secondary ul li li a { - padding-left: 1.1rem; -} -.tsd-navigation.secondary ul li li li a { - padding-left: 2.2rem; -} -.tsd-navigation.secondary ul li li li li a { - padding-left: 3.3rem; -} -.tsd-navigation.secondary ul li li li li li a { - padding-left: 4.4rem; -} -.tsd-navigation.secondary ul li li li li li li a { - padding-left: 5.5rem; +.tsd-page-navigation ul { + padding-left: 1.75rem; } #tsd-sidebar-links a { @@ -835,41 +796,40 @@ input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { } a.tsd-index-link { - margin: 0.25rem 0; + padding: 0.25rem 0 !important; font-size: 1rem; line-height: 1.25rem; display: inline-flex; align-items: center; + color: var(--color-text); } -.tsd-accordion-summary > h1, -.tsd-accordion-summary > h2, -.tsd-accordion-summary > h3, -.tsd-accordion-summary > h4, -.tsd-accordion-summary > h5 { - display: inline-flex; - align-items: center; - vertical-align: middle; - margin-bottom: 0; +.tsd-accordion-summary { + list-style-type: none; /* hide marker on non-safari */ + outline: none; /* broken on safari, so just hide it */ +} +.tsd-accordion-summary::-webkit-details-marker { + display: none; /* hide marker on safari */ +} +.tsd-accordion-summary, +.tsd-accordion-summary a { user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -} -.tsd-accordion-summary { - display: block; + cursor: pointer; } +.tsd-accordion-summary a { + width: calc(100% - 1.5rem); +} .tsd-accordion-summary > * { margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; } -.tsd-accordion-summary::-webkit-details-marker { - display: none; -} -.tsd-index-accordion .tsd-accordion-summary svg { - margin-right: 0.25rem; +.tsd-index-accordion .tsd-accordion-summary > svg { + margin-left: 0.25rem; } .tsd-index-content > :not(:first-child) { margin-top: 0.75rem; @@ -894,34 +854,6 @@ a.tsd-index-link { margin-right: 0.8rem; } -@media (min-width: 1024px) { - .col-content { - margin: 2rem auto; - } - - .menu-sticky-wrap { - position: sticky; - height: calc(100vh - 2rem); - top: 4rem; - right: 0; - padding: 0 1.5rem; - padding-top: 1rem; - margin-top: 3rem; - transition: 0.3s ease-in-out; - transition-property: top, padding-top, padding, height; - overflow-y: auto; - } - .col-menu { - border-left: 1px solid var(--color-accent); - } - .col-menu--hide { - top: 1rem; - } - .col-menu .tsd-navigation:not(:last-child) { - padding-bottom: 1.75rem; - } -} - .tsd-panel { margin-bottom: 2.5rem; } @@ -1002,8 +934,9 @@ a.tsd-index-link { box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); } #tsd-search .results li { - padding: 0 10px; background-color: var(--color-background); + line-height: initial; + padding: 4px; } #tsd-search .results li:nth-child(even) { background-color: var(--color-background-secondary); @@ -1011,12 +944,15 @@ a.tsd-index-link { #tsd-search .results li.state { display: none; } -#tsd-search .results li.current, -#tsd-search .results li:hover { +#tsd-search .results li.current:not(.no-results), +#tsd-search .results li:hover:not(.no-results) { background-color: var(--color-accent); } #tsd-search .results a { - display: block; + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; } #tsd-search .results a:before { top: 10px; @@ -1072,6 +1008,11 @@ a.tsd-index-link { overflow-x: auto; } +.tsd-signature-keyword { + color: var(--color-ts-keyword); + font-weight: normal; +} + .tsd-signature-symbol { color: var(--color-text-aside); font-weight: normal; @@ -1127,7 +1068,7 @@ ul.tsd-type-parameter-list h5 { } .tsd-page-toolbar { - position: fixed; + position: sticky; z-index: 1; top: 0; left: 0; @@ -1167,16 +1108,14 @@ ul.tsd-type-parameter-list h5 { padding: 12px 0; } -.tsd-page-toolbar--hide { - transform: translateY(-100%); -} - .tsd-widget { display: inline-block; overflow: hidden; opacity: 0.8; height: 40px; - transition: opacity 0.1s, background-color 0.2s; + transition: + opacity 0.1s, + background-color 0.2s; vertical-align: bottom; cursor: pointer; } @@ -1198,12 +1137,6 @@ ul.tsd-type-parameter-list h5 { .tsd-widget.menu { display: none; } -@media (max-width: 1024px) { - .tsd-widget.options, - .tsd-widget.menu { - display: inline-block; - } -} input[type="checkbox"] + .tsd-widget:before { background-position: -120px 0; } @@ -1234,7 +1167,85 @@ img { } .deprecated { - text-decoration: line-through; + 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); } * { @@ -1255,3 +1266,147 @@ img { border-radius: 999rem; border: 0.25rem solid var(--color-icon-background); } + +/* mobile */ +@media (max-width: 769px) { + .tsd-widget.options, + .tsd-widget.menu { + display: inline-block; + } + + .container-main { + display: flex; + } + html .col-content { + float: none; + max-width: 100%; + width: 100%; + } + html .col-sidebar { + position: fixed !important; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + z-index: 1024; + top: 0 !important; + bottom: 0 !important; + left: auto !important; + right: 0 !important; + padding: 1.5rem 1.5rem 0 0; + width: 75vw; + visibility: hidden; + background-color: var(--color-background); + transform: translate(100%, 0); + } + html .col-sidebar > *:last-child { + padding-bottom: 20px; + } + html .overlay { + content: ""; + display: block; + position: fixed; + z-index: 1023; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.75); + visibility: hidden; + } + + .to-has-menu .overlay { + animation: fade-in 0.4s; + } + + .to-has-menu .col-sidebar { + animation: pop-in-from-right 0.4s; + } + + .from-has-menu .overlay { + animation: fade-out 0.4s; + } + + .from-has-menu .col-sidebar { + animation: pop-out-to-right 0.4s; + } + + .has-menu body { + overflow: hidden; + } + .has-menu .overlay { + visibility: visible; + } + .has-menu .col-sidebar { + visibility: visible; + transform: translate(0, 0); + display: flex; + flex-direction: column; + gap: 1.5rem; + max-height: 100vh; + padding: 1rem 2rem; + } + .has-menu .tsd-navigation { + max-height: 100%; + } +} + +/* one sidebar */ +@media (min-width: 770px) { + .container-main { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); + grid-template-areas: "sidebar content"; + margin: 2rem auto; + } + + .col-sidebar { + grid-area: sidebar; + } + .col-content { + grid-area: content; + padding: 0 1rem; + } +} +@media (min-width: 770px) and (max-width: 1399px) { + .col-sidebar { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + padding-top: 1rem; + } + .site-menu { + margin-top: 1rem; + } +} + +/* two sidebars */ +@media (min-width: 1200px) { + .container-main { + grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr) minmax(0, 20rem); + grid-template-areas: "sidebar content toc"; + } + + .col-sidebar { + display: contents; + } + + .page-menu { + grid-area: toc; + padding-left: 1rem; + } + .site-menu { + grid-area: sidebar; + } + + .site-menu { + margin-top: 1rem 0; + } + + .page-menu, + .site-menu { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + } +} diff --git a/docs/classes/BooruClass.html b/docs/classes/BooruClass.html index 9dab05c..c22ea62 100644 --- a/docs/classes/BooruClass.html +++ b/docs/classes/BooruClass.html @@ -1,244 +1,36 @@ -BooruClass | @himeka/booru - v2.7.6
-
- -
-
-
-
- -

Class BooruClass

-
-

A basic, JSON booru

- -

Example

const Booru = require('booru')
// Aliases are supported
const e9 = Booru('e9')

// You can then search the site
const imgs = await e9.search(['cat', 'cute'], {limit: 3})

// And use the images
imgs.forEach(i => console.log(i.fileUrl))

// Or access other methods on the Booru
e9.postView(imgs[0].id) -
-
-
-

Hierarchy

-
-
-
-
- -
-
-

Constructors

-
-
-

Properties

-
-
-

Methods

-
-
-

Constructors

-
- -
-
-

Properties

-
- -
credentials?: BooruCredentials
-

The credentials to use for this booru

-
-
- -
domain: string
-

The domain of the booru

-
-
- -
site: Site
-

The site object representing this booru

-
-
-

Methods

-
- -
    - -
  • Protected -

    The internal & common searching logic, pls dont use this use .search instead

    - -

    Returns

    -
    -

    Parameters

    -
      -
    • -
      tags: string | string[]
      -

      The tags to search with

      -
    • -
    • -
      searchArgs: default = {}
      -

      The arguments for the search

      -
    -

    Returns Promise<any>

-
- -
    - -
  • -

    Generates a URL to search the booru with, mostly for debugging purposes

    - -

    Returns

    A URL to search the booru

    -
    -
    -

    Parameters

    -
      -
    • -
      opt: Partial<SearchUrlParams>
    -

    Returns string

-
- -
    - -
  • Protected -

    Parse the response from the booru

    - -

    Returns

    The results of this search

    -
    -
    -

    Parameters

    -
      -
    • -
      result: any
      -

      The response of the booru

      -
    • -
    • -
      searchArgs: default
      -

      The arguments used for the search

      -
    -

    Returns SearchResults

-
- -
    - -
  • -

    Gets the url you'd see in your browser from a post id for this booru

    - -

    Returns

    The url to the post

    -
    -
    -

    Parameters

    -
      -
    • -
      id: string | number
      -

      The id to get the postView for

      -
    -

    Returns string

-
- -
-
-
-

Generated using TypeDoc

-
\ No newline at end of file +BooruClass | @himeka/booru - v2.7.7

Class BooruClass

A basic, JSON booru

+

Example

const Booru = require('booru')
// Aliases are supported
const e9 = Booru('e9')

// You can then search the site
const imgs = await e9.search(['cat', 'cute'], {limit: 3})

// And use the images
imgs.forEach(i => console.log(i.fileUrl))

// Or access other methods on the Booru
e9.postView(imgs[0].id) +
+

Hierarchy (view full)

Constructors

Properties

credentials?: BooruCredentials

The credentials to use for this booru

+
domain: string

The domain of the booru

+
site: Site

The site object representing this booru

+

Methods

  • Protected

    The internal & common searching logic, pls dont use this use .search instead

    +

    Parameters

    • tags: string[]

      The tags to search with

      +
    • searchArgs: default = {}

      The arguments for the search

      +

    Returns Promise<any>

  • Generates a URL to search the booru with, mostly for debugging purposes

    +

    Parameters

    • opt: Partial<SearchUrlParams>

    Returns string

    A URL to search the booru

    +
  • Parameters

    • tags: string | string[]

    Returns string[]

  • Protected

    Parse the response from the booru

    +

    Parameters

    • result: any

      The response of the booru

      +
    • searchArgs: default

      The arguments used for the search

      +

    Returns SearchResults

    The results of this search

    +
  • Gets the url you'd see in your browser from a post id for this booru

    +

    Parameters

    • id: string | number

      The id to get the postView for

      +

    Returns string

    The url to the post

    +
\ No newline at end of file diff --git a/docs/classes/BooruError.html b/docs/classes/BooruError.html index bc855ba..4891c34 100644 --- a/docs/classes/BooruError.html +++ b/docs/classes/BooruError.html @@ -1,179 +1,13 @@ -BooruError | @himeka/booru - v2.7.6
-
- -
-
-
-
- -

Class BooruError

-
-

Custom error type for when the boorus error or for user-side error, not my code (probably)

-

The name of the error is 'BooruError'

-
-

Hierarchy

-
    -
  • Error -
      -
    • BooruError
-
-
-
- -
-
-

Constructors

-
-
-

Properties

-
-
-

Methods

-
-
-

Constructors

-
- -
-
-

Properties

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

Type declaration

-
-
- -
stackTraceLimit: number
-
-

Methods

-
- -
    - -
  • -

    Create .stack property on a target object

    -
    -
    -

    Parameters

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

    Returns void

-
-
-

Generated using TypeDoc

-
\ No newline at end of file +BooruError | @himeka/booru - v2.7.7

Class BooruError

Custom error type for when the boorus error or for user-side error, not my code (probably)

+

The name of the error is 'BooruError'

Hierarchy

  • Error
    • BooruError

Constructors

Properties

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

Optional override for formatting stack traces

+

Type declaration

    • (err, stackTraces): any
    • Parameters

      • err: Error
      • stackTraces: CallSite[]

      Returns any

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    +

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

\ No newline at end of file diff --git a/docs/classes/Derpibooru.html b/docs/classes/Derpibooru.html index 563e5fc..e10146e 100644 --- a/docs/classes/Derpibooru.html +++ b/docs/classes/Derpibooru.html @@ -1,252 +1,36 @@ -Derpibooru | @himeka/booru - v2.7.6
-
- -
-
-
-
- -

Class DerpibooruPrivate

-
-

A basic, JSON booru

- -

Example

const Booru = require('booru')
// Aliases are supported
const e9 = Booru('e9')

// You can then search the site
const imgs = await e9.search(['cat', 'cute'], {limit: 3})

// And use the images
imgs.forEach(i => console.log(i.fileUrl))

// Or access other methods on the Booru
e9.postView(imgs[0].id) -
-
-
-

Hierarchy

-
-
-
-
- -
-
-

Constructors

-
-
-

Properties

-
-
-

Methods

-
-
-

Constructors

-
- -
-
-

Properties

-
- -
credentials?: BooruCredentials
-

The credentials to use for this booru

-
-
- -
domain: string
-

The domain of the booru

-
-
- -
site: Site
-

The site object representing this booru

-
-
-

Methods

-
- -
    - -
  • Protected -

    The internal & common searching logic, pls dont use this use .search instead

    - -

    Returns

    -
    -

    Parameters

    -
      -
    • -
      tags: string | string[]
      -

      The tags to search with

      -
    • -
    • -
      searchArgs: default = {}
      -

      The arguments for the search

      -
    -

    Returns Promise<any>

-
- -
    - -
  • -

    Generates a URL to search the booru with, mostly for debugging purposes

    - -

    Returns

    A URL to search the booru

    -
    -
    -

    Parameters

    -
      -
    • -
      opt: Partial<SearchUrlParams>
    -

    Returns string

-
- -
-
- -
    - -
  • -

    Gets the url you'd see in your browser from a post id for this booru

    - -

    Returns

    The url to the post

    -
    -
    -

    Parameters

    -
      -
    • -
      id: string | number
      -

      The id to get the postView for

      -
    -

    Returns string

-
- -
-
-
-

Generated using TypeDoc

-
\ No newline at end of file +Derpibooru | @himeka/booru - v2.7.7

Class DerpibooruPrivate

A basic, JSON booru

+

Example

const Booru = require('booru')
// Aliases are supported
const e9 = Booru('e9')

// You can then search the site
const imgs = await e9.search(['cat', 'cute'], {limit: 3})

// And use the images
imgs.forEach(i => console.log(i.fileUrl))

// Or access other methods on the Booru
e9.postView(imgs[0].id) +
+

Hierarchy (view full)

Constructors

Properties

credentials?: BooruCredentials

The credentials to use for this booru

+
domain: string

The domain of the booru

+
site: Site

The site object representing this booru

+

Methods

  • Protected

    The internal & common searching logic, pls dont use this use .search instead

    +

    Parameters

    • tags: string[]

      The tags to search with

      +
    • searchArgs: default = {}

      The arguments for the search

      +

    Returns Promise<any>

  • Generates a URL to search the booru with, mostly for debugging purposes

    +

    Parameters

    • opt: Partial<SearchUrlParams>

    Returns string

    A URL to search the booru

    +
  • Gets the url you'd see in your browser from a post id for this booru

    +

    Parameters

    • id: string | number

      The id to get the postView for

      +

    Returns string

    The url to the post

    +
\ No newline at end of file diff --git a/docs/classes/Post.html b/docs/classes/Post.html index 305e200..832a693 100644 --- a/docs/classes/Post.html +++ b/docs/classes/Post.html @@ -1,540 +1,92 @@ -Post | @himeka/booru - v2.7.6
-
- -
-
-
-
- -

Class Post

-
-

An image from a booru with a few common props

- -

Example

Post {
fileUrl: 'https://aaaa.com/image.jpg',
id: '124125',
tags: ['cat', 'cute'],
score: 5,
source: 'https://giraffeduck.com/aaaa.png',
rating: 's'
} -
-
-
-

Hierarchy

-
    -
  • Post
-
-
-
- -
-
-

Constructors

-
- -
-
-

Properties

-
- -
available: boolean
-

If this post is available (ie. not deleted, not banned, has file url)

-
-
- -
booru: BooruClass
-

The Booru it came from

-
-
- -
createdAt?: null | Date
-

The Date this post was created at

-
-
- -
data: any
-

All the data given by the booru

-
-
- -
fileUrl: null | string
-

The direct link to the file

-
-
- -
height: number
-

The height of the file

-
-
- -
id: string
-

The id of this post

-
-
- -
previewHeight: null | number
-

The height of the smallest image (if available)

-
-
- -
previewUrl: null | string
-

The url to the smallest image (if available)

-
-
- -
previewWidth: null | number
-

The width of the smallest image (if available)

-
-
- -
rating: string
-

The rating of the image, as just the first letter +Post | @himeka/booru - v2.7.7

An image from a booru with a few common props

+

Example

Post {
fileUrl: 'https://aaaa.com/image.jpg',
id: '124125',
tags: ['cat', 'cute'],
score: 5,
source: 'https://giraffeduck.com/aaaa.png',
rating: 's'
} +
+

Constructors

Properties

available: boolean

If this post is available (ie. not deleted, not banned, has file url)

+
booru: BooruClass

The Booru it came from

+
createdAt?: null | Date

The Date this post was created at

+
data: any

All the data given by the booru

+
fileUrl: null | string

The direct link to the file

+
height: number

The height of the file

+
id: string

The id of this post

+
previewHeight: null | number

The height of the smallest image (if available)

+
previewUrl: null | string

The url to the smallest image (if available)

+
previewWidth: null | number

The width of the smallest image (if available)

+
rating: string

The rating of the image, as just the first letter (s/q/e/u) => safe/questionable/explicit/unrated

-
-
- -
sampleHeight: null | number
-

The height of the medium-sized image (if available)

-
-
- -
sampleUrl: null | string
-

The url to the medium-sized image (if available)

-
-
- -
sampleWidth: null | number
-

The width of the medium-sized image (if available)

-
-
- -
score: number
-

The score of this post

-
-
- -
source?: string | string[]
-

The source of this post, if available

-
-
- -
tags: string[]
-

The tags of this post

-
-
- -
width: number
-

The width of the file

-
-
-

Accessors

-
- -
    -
  • get aspectRatio(): number
  • -
  • -

    The aspect ratio of this post: width / height

    -
    -

    Returns number

-
- -
-
- -
    -
  • get fileDownloadName(): string
  • -
  • -

    The original file download name of this post

    -
    -

    Returns string

-
- -
    -
  • get fileDownloadText(): string
  • -
  • -

    The original file download text of this post

    -
    -

    Returns string

-
- -
-
- -
-
- -
    -
  • get fileSizeText(): string
  • -
  • -

    The original image file size of this post

    -
    -

    Returns string

-
- -
-
- -
-
- -
-
- -
    -
  • get jpegDownloadName(): string
  • -
  • -

    The jpeg download name of this post

    -
    -

    Returns string

-
- -
    -
  • get jpegDownloadText(): string
  • -
  • -

    The jpeg download text of this post

    -
    -

    Returns string

-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
    -
  • get postView(): string
  • -
  • -

    Get the post view (url to the post) of this image

    - -

    Example

    const e9 = Booru('e9')
    const imgs = e9.search(['cat', 'dog'])

    // Log the post url of the first image
    console.log(imgs[0].postView) -
    -
    -

    Returns string

-
- -
    -
  • get sampleDownloadName(): string
  • -
  • -

    The sample download name of this post

    -
    -

    Returns string

-
- -
    -
  • get sampleDownloadText(): string
  • -
  • -

    The sample download text of this post

    -
    -

    Returns string

-
- -
-
- -
    -
  • get sampleSizeText(): string
  • -
  • -

    The sample image file size of this post

    -
    -

    Returns string

-
- -
-
-
-

Generated using TypeDoc

-
\ No newline at end of file +
sampleHeight: null | number

The height of the medium-sized image (if available)

+
sampleUrl: null | string

The url to the medium-sized image (if available)

+
sampleWidth: null | number

The width of the medium-sized image (if available)

+
score: number

The score of this post

+
source?: string | string[]

The source of this post, if available

+
tags: string[]

The tags of this post

+
width: number

The width of the file

+

Accessors

  • get postView(): string
  • Get the post view (url to the post) of this image

    +

    Returns string

    Example

    const e9 = Booru('e9')
    const imgs = e9.search(['cat', 'dog'])

    // Log the post url of the first image
    console.log(imgs[0].postView) +
    +
\ No newline at end of file diff --git a/docs/classes/SearchResults.html b/docs/classes/SearchResults.html index b512d2a..1844363 100644 --- a/docs/classes/SearchResults.html +++ b/docs/classes/SearchResults.html @@ -1,1653 +1,268 @@ -SearchResults | @himeka/booru - v2.7.6
-
- -
-
-
-
- -

Class SearchResults

-
-

Represents a page of search results, works like an array of Post

-

Usable like an array and allows to easily get the next page -

Example

const Booru = require('booru')
// Safebooru
const sb = new Booru('sb')

const imgs = await sb.search('cat')

// Log the images from the first page, then from the second
imgs.forEach(i => console.log(i.postView))
const imgs2 = await imgs.nextPage()
imgs2.forEach(i => console.log(i.postView)) -
-
-
-

Hierarchy

-
    -
  • Array<Post> -
      -
    • SearchResults
-
-
-
- -
-
-

Constructors

-
- -
-
-

Properties

-
- -
booru: BooruClass
-

The booru used for this search

-
-
- -
length: number
-

Gets or sets the length of the array. This is a number one higher than the highest index in the array.

-
-
- - -

The options used for this search

-
-
- -
page: number
-

The page of this search

-
-
- -
posts: Post[]
-

The posts from this search result

-
-
- -
tags: string[]
-

The tags used for this search

-
-
- -
[species]: ArrayConstructor
-
-

Accessors

-
- -
-
- -
-
-

Methods

-
- -
    - -
  • -

    Iterator

    -
    -

    Returns IterableIterator<Post>

-
- -
    - -
  • -

    Returns an object whose properties have the value 'true' +SearchResults | @himeka/booru - v2.7.7

    Class SearchResults

    Represents a page of search results, works like an array of Post

    +

    Usable like an array and allows to easily get the next page

    Example

    const Booru = require('booru')
    // Safebooru
    const sb = new Booru('sb')

    const imgs = await sb.search('cat')

    // Log the images from the first page, then from the second
    imgs.forEach(i => console.log(i.postView))
    const imgs2 = await imgs.nextPage()
    imgs2.forEach(i => console.log(i.postView)) +
    +

    Hierarchy

    • Array<Post>
      • SearchResults

    Constructors

    Properties

    [unscopables]: {
        [unscopables]?: boolean;
        length?: boolean;
        [iterator]?: any;
        at?: any;
        concat?: any;
        copyWithin?: any;
        entries?: any;
        every?: any;
        fill?: any;
        filter?: any;
        find?: any;
        findIndex?: any;
        findLast?: any;
        findLastIndex?: any;
        flat?: any;
        flatMap?: any;
        forEach?: any;
        includes?: any;
        indexOf?: any;
        join?: any;
        keys?: any;
        lastIndexOf?: any;
        map?: any;
        pop?: any;
        push?: any;
        reduce?: any;
        reduceRight?: any;
        reverse?: any;
        shift?: any;
        slice?: any;
        some?: any;
        sort?: any;
        splice?: any;
        toLocaleString?: any;
        toReversed?: any;
        toSorted?: any;
        toSpliced?: any;
        toString?: any;
        unshift?: any;
        values?: any;
        with?: any;
    }

    Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement.

    -
    -

    Returns {
        copyWithin: boolean;
        entries: boolean;
        fill: boolean;
        find: boolean;
        findIndex: boolean;
        keys: boolean;
        values: boolean;
    }

    -
      -
    • -
      copyWithin: boolean
    • -
    • -
      entries: boolean
    • -
    • -
      fill: boolean
    • -
    • -
      find: boolean
    • -
    • -
      findIndex: boolean
    • -
    • -
      keys: boolean
    • -
    • -
      values: boolean
-
- -
    - -
  • -

    Returns the item located at the specified index.

    -
    -
    -

    Parameters

    -
      -
    • -
      index: number
      -

      The zero-based index of the desired code unit. A negative index will count back from the last item.

      -
    -

    Returns undefined | Post

-
- -
    - -
  • -

    Returns a SearchResults with images not tagged with any of the specified tags (or tag)

    - -

    Returns

    The results without any images with the specified tags

    -
    -
    -

    Parameters

    -
      -
    • -
      tags: string | string[]
      -

      The tags (or tag) to blacklist

      -
    -

    Returns SearchResults

-
- -
    - -
  • -

    Combines two or more arrays. +

    Type declaration

    • Optional Readonly [unscopables]?: boolean

      Is an object whose properties have the value 'true' +when they will be absent when used in a 'with' statement.

      +
    • Optional length?: boolean

      Gets or sets the length of the array. This is a number one higher than the highest index in the array.

      +
booru: BooruClass

The booru used for this search

+
length: number

Gets or sets the length of the array. This is a number one higher than the highest index in the array.

+

The options used for this search

+
page: number

The page of this search

+
posts: Post[]

The posts from this search result

+
tags: string[]

The tags used for this search

+
[species]: ArrayConstructor

Accessors

Methods

  • Iterator

    +

    Returns IterableIterator<Post>

  • Returns the item located at the specified index.

    +

    Parameters

    • index: number

      The zero-based index of the desired code unit. A negative index will count back from the last item.

      +

    Returns undefined | Post

  • Returns a SearchResults with images not tagged with any of the specified tags (or tag)

    +

    Parameters

    • tags: string | string[]

      The tags (or tag) to blacklist

      +

    Returns SearchResults

    The results without any images with the specified tags

    +
  • Combines two or more arrays. This method returns a new array without modifying any existing arrays.

    -
    -
    -

    Parameters

    -
      -
    • -
      Rest ...items: ConcatArray<Post>[]
      -

      Additional arrays and/or items to add to the end of the array.

      -
    -

    Returns Post[]

  • - -
  • -

    Combines two or more arrays. +

    Parameters

    • Rest ...items: ConcatArray<Post>[]

      Additional arrays and/or items to add to the end of the array.

      +

    Returns Post[]

  • Combines two or more arrays. This method returns a new array without modifying any existing arrays.

    -
    -
    -

    Parameters

    -
      -
    • -
      Rest ...items: (Post | ConcatArray<Post>)[]
      -

      Additional arrays and/or items to add to the end of the array.

      -
    -

    Returns Post[]

-
- -
    - -
  • -

    Returns the this object after copying a section of the array identified by start and end +

    Parameters

    • Rest ...items: (Post | ConcatArray<Post>)[]

      Additional arrays and/or items to add to the end of the array.

      +

    Returns Post[]

  • Returns the this object after copying a section of the array identified by start and end to the same array starting at position target

    -
    -
    -

    Parameters

    -
      -
    • -
      target: number
      -

      If target is negative, it is treated as length+target where length is the +

      Parameters

      • target: number

        If target is negative, it is treated as length+target where length is the length of the array.

        -
      • -
      • -
        start: number
        -

        If start is negative, it is treated as length+start. If end is negative, it +

      • start: number

        If start is negative, it is treated as length+start. If end is negative, it is treated as length+end.

        -
      • -
      • -
        Optional end: number
        -

        If not specified, length of the this object is used as its default value.

        -
      -

      Returns SearchResults

-
- -
    - -
  • -

    Returns an iterable of key, value pairs for every entry in the array

    -
    -

    Returns IterableIterator<[number, Post]>

-
- -
    - -
  • -

    Determines whether all the members of an array satisfy the specified test.

    -
    -
    -

    Type Parameters

    -
      -
    • -

      S extends Post<S>

    -
    -

    Parameters

    -
      -
    • -
      predicate: ((value: Post, index: number, array: Post[]) => value is S)
      -

      A function that accepts up to three arguments. The every method calls +

    • Optional end: number

      If not specified, length of the this object is used as its default value.

      +

    Returns this

  • Returns an iterable of key, value pairs for every entry in the array

    +

    Returns IterableIterator<[number, Post]>

  • Determines whether all the members of an array satisfy the specified test.

    +

    Type Parameters

    Parameters

    • predicate: ((value, index, array) => value is S)

      A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.

      -
      -
        -
      • -
          -
        • (value: Post, index: number, array: Post[]): value is S
        • -
        • -
          -

          Parameters

          -
            -
          • -
            value: Post
          • -
          • -
            index: number
          • -
          • -
            array: Post[]
          -

          Returns value is S

    • -
    • -
      Optional thisArg: any
      -

      An object to which the this keyword can refer in the predicate function. +

        • (value, index, array): value is S
        • Parameters

          Returns value is S

    • Optional thisArg: any

      An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      -
    -

    Returns this is S[]

  • - -
  • -

    Determines whether all the members of an array satisfy the specified test.

    -
    -
    -

    Parameters

    -
      -
    • -
      predicate: ((value: Post, index: number, array: Post[]) => unknown)
      -

      A function that accepts up to three arguments. The every method calls +

    Returns this is S[]

  • Determines whether all the members of an array satisfy the specified test.

    +

    Parameters

    • predicate: ((value, index, array) => unknown)

      A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.

      -
      -
        -
      • -
          -
        • (value: Post, index: number, array: Post[]): unknown
        • -
        • -
          -

          Parameters

          -
            -
          • -
            value: Post
          • -
          • -
            index: number
          • -
          • -
            array: Post[]
          -

          Returns unknown

    • -
    • -
      Optional thisArg: any
      -

      An object to which the this keyword can refer in the predicate function. +

        • (value, index, array): unknown
        • Parameters

          Returns unknown

    • Optional thisArg: any

      An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      -
    -

    Returns boolean

-
- -
    - -
  • -

    Changes all array elements from start to end index to a static value and returns the modified array

    -
    -
    -

    Parameters

    -
      -
    • -
      value: Post
      -

      value to fill array section with

      -
    • -
    • -
      Optional start: number
      -

      index to start filling the array at. If start is negative, it is treated as +

    Returns boolean

  • Changes all array elements from start to end index to a static value and returns the modified array

    +

    Parameters

    • value: Post

      value to fill array section with

      +
    • Optional start: number

      index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.

      -
    • -
    • -
      Optional end: number
      -

      index to stop filling the array at. If end is negative, it is treated as +

    • Optional end: number

      index to stop filling the array at. If end is negative, it is treated as length+end.

      -
    -

    Returns SearchResults

-
- -
    - -
  • -

    Returns the elements of an array that meet the condition specified in a callback function.

    -
    -
    -

    Type Parameters

    -
      -
    • -

      S extends Post<S>

    -
    -

    Parameters

    -
      -
    • -
      predicate: ((value: Post, index: number, array: Post[]) => value is S)
      -

      A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.

      -
      -
        -
      • -
          -
        • (value: Post, index: number, array: Post[]): value is S
        • -
        • -
          -

          Parameters

          -
            -
          • -
            value: Post
          • -
          • -
            index: number
          • -
          • -
            array: Post[]
          -

          Returns value is S

    • -
    • -
      Optional thisArg: any
      -

      An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      -
    -

    Returns S[]

  • - -
  • -

    Returns the elements of an array that meet the condition specified in a callback function.

    -
    -
    -

    Parameters

    -
      -
    • -
      predicate: ((value: Post, index: number, array: Post[]) => unknown)
      -

      A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.

      -
      -
        -
      • -
          -
        • (value: Post, index: number, array: Post[]): unknown
        • -
        • -
          -

          Parameters

          -
            -
          • -
            value: Post
          • -
          • -
            index: number
          • -
          • -
            array: Post[]
          -

          Returns unknown

    • -
    • -
      Optional thisArg: any
      -

      An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      -
    -

    Returns Post[]

-
- -
    - -
  • -

    Returns the value of the first element in the array where predicate is true, and undefined +

Returns this

  • Returns the elements of an array that meet the condition specified in a callback function.

    +

    Type Parameters

    Parameters

    • predicate: ((value, index, array) => value is S)

      A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.

      +
        • (value, index, array): value is S
        • Parameters

          Returns value is S

    • Optional thisArg: any

      An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      +

    Returns S[]

  • Returns the elements of an array that meet the condition specified in a callback function.

    +

    Parameters

    • predicate: ((value, index, array) => unknown)

      A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.

      +
        • (value, index, array): unknown
        • Parameters

          Returns unknown

    • Optional thisArg: any

      An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

      +

    Returns Post[]

  • Returns the value of the first element in the array where predicate is true, and undefined otherwise.

    -
    -
    -

    Type Parameters

    -
      -
    • -

      S extends Post<S>

    -
    -

    Parameters

    -
      -
    • -
      predicate: ((this: void, value: Post, index: number, obj: Post[]) => value is S)
      -

      find calls predicate once for each element of the array, in ascending +

      Type Parameters

      Parameters

      • predicate: ((value, index, obj) => value is S)

        find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined.

        -
        -
          -
        • -
            -
          • (this: void, value: Post, index: number, obj: Post[]): value is S
          • -
          • -
            -

            Parameters

            -
              -
            • -
              this: void
            • -
            • -
              value: Post
            • -
            • -
              index: number
            • -
            • -
              obj: Post[]
            -

            Returns value is S

      • -
      • -
        Optional thisArg: any
        -

        If provided, it will be used as the this value for each invocation of +

          • (value, index, obj): value is S
          • Parameters

            Returns value is S

      • Optional thisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

        -
      -

      Returns undefined | S

    • - -
    • -
      -

      Parameters

      -
        -
      • -
        predicate: ((value: Post, index: number, obj: Post[]) => unknown)
        -
          -
        • -
            -
          • (value: Post, index: number, obj: Post[]): unknown
          • -
          • -
            -

            Parameters

            -
              -
            • -
              value: Post
            • -
            • -
              index: number
            • -
            • -
              obj: Post[]
            -

            Returns unknown

      • -
      • -
        Optional thisArg: any
      -

      Returns undefined | Post

-
- -
    - -
  • -

    Returns the index of the first element in the array where predicate is true, and -1 +

Returns undefined | S

  • Parameters

    • predicate: ((value, index, obj) => unknown)
        • (value, index, obj): unknown
        • Parameters

          Returns unknown

    • Optional thisArg: any

    Returns undefined | Post

    • Returns the index of the first element in the array where predicate is true, and -1 otherwise.

      -
      -
      -

      Parameters

      -
        -
      • -
        predicate: ((value: Post, index: number, obj: Post[]) => unknown)
        -

        find calls predicate once for each element of the array, in ascending +

        Parameters

        • predicate: ((value, index, obj) => unknown)

          find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1.

          -
          -
            -
          • -
              -
            • (value: Post, index: number, obj: Post[]): unknown
            • -
            • -
              -

              Parameters

              -
                -
              • -
                value: Post
              • -
              • -
                index: number
              • -
              • -
                obj: Post[]
              -

              Returns unknown

        • -
        • -
          Optional thisArg: any
          -

          If provided, it will be used as the this value for each invocation of +

            • (value, index, obj): unknown
            • Parameters

              Returns unknown

        • Optional thisArg: any

          If provided, it will be used as the this value for each invocation of +predicate. If it is not provided, undefined is used instead.

          +

        Returns number

    • Returns the value of the last element in the array where predicate is true, and undefined +otherwise.

      +

      Type Parameters

      Parameters

      • predicate: ((value, index, array) => value is S)

        findLast calls predicate once for each element of the array, in descending +order, until it finds one where predicate returns true. If such an element is found, findLast +immediately returns that element value. Otherwise, findLast returns undefined.

        +
          • (value, index, array): value is S
          • Parameters

            Returns value is S

      • Optional thisArg: any

        If provided, it will be used as the this value for each invocation of +predicate. If it is not provided, undefined is used instead.

        +

      Returns undefined | S

    • Parameters

      • predicate: ((value, index, array) => unknown)
          • (value, index, array): unknown
          • Parameters

            Returns unknown

      • Optional thisArg: any

      Returns undefined | Post

    • Returns the index of the last element in the array where predicate is true, and -1 +otherwise.

      +

      Parameters

      • predicate: ((value, index, array) => unknown)

        findLastIndex calls predicate once for each element of the array, in descending +order, until it finds one where predicate returns true. If such an element is found, +findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.

        +
          • (value, index, array): unknown
          • Parameters

            Returns unknown

      • Optional thisArg: any

        If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

        -
      -

      Returns number

    -
    - -
      - -
    • -

      Returns a new array with all sub-array elements concatenated into it recursively up to the +

    Returns number

    • Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.

      -
      -
      -

      Type Parameters

      -
        -
      • -

        A

      • -
      • -

        D extends number = 1

      -
      -

      Parameters

      -
        -
      • -
        this: A
      • -
      • -
        Optional depth: D
        -

        The maximum recursion depth

        -
      -

      Returns FlatArray<A, D>[]

    -
    - -
      - -
    • -

      Calls a defined callback function on each element of an array. Then, flattens the result into +

      Type Parameters

      • A
      • D extends number = 1

      Parameters

      • this: A
      • Optional depth: D

        The maximum recursion depth

        +

      Returns FlatArray<A, D>[]

    • Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1.

      -
      -
      -

      Type Parameters

      -
        -
      • -

        U

      • -
      • -

        This = undefined

      -
      -

      Parameters

      -
        -
      • -
        callback: ((this: This, value: Post, index: number, array: Post[]) => U | readonly U[])
        -

        A function that accepts up to three arguments. The flatMap method calls the +

        Type Parameters

        • U
        • This = undefined

        Parameters

        • callback: ((this, value, index, array) => U | readonly U[])

          A function that accepts up to three arguments. The flatMap method calls the callback function one time for each element in the array.

          -
          -
            -
          • -
              -
            • (this: This, value: Post, index: number, array: Post[]): U | readonly U[]
            • -
            • -
              -

              Parameters

              -
                -
              • -
                this: This
              • -
              • -
                value: Post
              • -
              • -
                index: number
              • -
              • -
                array: Post[]
              -

              Returns U | readonly U[]

        • -
        • -
          Optional thisArg: This
          -

          An object to which the this keyword can refer in the callback function. If +

            • (this, value, index, array): U | readonly U[]
            • Parameters

              Returns U | readonly U[]

        • Optional thisArg: This

          An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used as the this value.

          -
        -

        Returns U[]

    -
    - -
      - -
    • -

      Performs the specified action for each element in an array.

      -
      -
      -

      Parameters

      -
        -
      • -
        callbackfn: ((value: Post, index: number, array: Post[]) => void)
        -

        A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

        -
        -
          -
        • -
            -
          • (value: Post, index: number, array: Post[]): void
          • -
          • -
            -

            Parameters

            -
              -
            • -
              value: Post
            • -
            • -
              index: number
            • -
            • -
              array: Post[]
            -

            Returns void

      • -
      • -
        Optional thisArg: any
        -

        An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

        -
      -

      Returns void

    -
    - -
      - -
    • -

      Determines whether an array includes a certain element, returning true or false as appropriate.

      -
      -
      -

      Parameters

      -
        -
      • -
        searchElement: Post
        -

        The element to search for.

        -
      • -
      • -
        Optional fromIndex: number
        -

        The position in this array at which to begin searching for searchElement.

        -
      -

      Returns boolean

    -
    - -
      - -
    • -

      Returns the index of the first occurrence of a value in an array, or -1 if it is not present.

      -
      -
      -

      Parameters

      -
        -
      • -
        searchElement: Post
        -

        The value to locate in the array.

        -
      • -
      • -
        Optional fromIndex: number
        -

        The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

        -
      -

      Returns number

    -
    - -
      - -
    • -

      Adds all the elements of an array into a string, separated by the specified separator string.

      -
      -
      -

      Parameters

      -
        -
      • -
        Optional separator: string
        -

        A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.

        -
      -

      Returns string

    -
    - -
      - -
    • -

      Returns an iterable of keys in the array

      -
      -

      Returns IterableIterator<number>

    -
    - -
      - -
    • -

      Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.

      -
      -
      -

      Parameters

      -
        -
      • -
        searchElement: Post
        -

        The value to locate in the array.

        -
      • -
      • -
        Optional fromIndex: number
        -

        The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.

        -
      -

      Returns number

    -
    - -
      - -
    • -

      Calls a defined callback function on each element of an array, and returns an array that contains the results.

      -
      -
      -

      Type Parameters

      -
        -
      • -

        U

      -
      -

      Parameters

      -
        -
      • -
        callbackfn: ((value: Post, index: number, array: Post[]) => U)
        -

        A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

        -
        -
          -
        • -
            -
          • (value: Post, index: number, array: Post[]): U
          • -
          • -
            -

            Parameters

            -
              -
            • -
              value: Post
            • -
            • -
              index: number
            • -
            • -
              array: Post[]
            -

            Returns U

      • -
      • -
        Optional thisArg: any
        -

        An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

        -
      -

      Returns U[]

    -
    - -
    -
    - -
      - -
    • -

      Removes the last element from an array and returns it. +

    Returns U[]

    • Performs the specified action for each element in an array.

      +

      Parameters

      • callbackfn: ((value, index, array) => void)

        A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

        +
          • (value, index, array): void
          • Parameters

            Returns void

      • Optional thisArg: any

        An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

        +

      Returns void

    • Determines whether an array includes a certain element, returning true or false as appropriate.

      +

      Parameters

      • searchElement: Post

        The element to search for.

        +
      • Optional fromIndex: number

        The position in this array at which to begin searching for searchElement.

        +

      Returns boolean

    • Returns the index of the first occurrence of a value in an array, or -1 if it is not present.

      +

      Parameters

      • searchElement: Post

        The value to locate in the array.

        +
      • Optional fromIndex: number

        The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

        +

      Returns number

    • Adds all the elements of an array into a string, separated by the specified separator string.

      +

      Parameters

      • Optional separator: string

        A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.

        +

      Returns string

    • Returns an iterable of keys in the array

      +

      Returns IterableIterator<number>

    • Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.

      +

      Parameters

      • searchElement: Post

        The value to locate in the array.

        +
      • Optional fromIndex: number

        The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.

        +

      Returns number

    • Calls a defined callback function on each element of an array, and returns an array that contains the results.

      +

      Type Parameters

      • U

      Parameters

      • callbackfn: ((value, index, array) => U)

        A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

        +
          • (value, index, array): U
          • Parameters

            Returns U

      • Optional thisArg: any

        An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

        +

      Returns U[]

    • Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.

      -
      -

      Returns undefined | Post

    -
    - -
      - -
    • -

      Appends new elements to the end of an array, and returns the new length of the array.

      -
      -
      -

      Parameters

      -
        -
      • -
        Rest ...items: Post[]
        -

        New elements to add to the array.

        -
      -

      Returns number

    -
    - -
      - -
    • -

      Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      -
      -
      -

      Parameters

      -
        -
      • -
        callbackfn: ((previousValue: Post, currentValue: Post, currentIndex: number, array: Post[]) => Post)
        -

        A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

        -
        -
          -
        • -
            -
          • (previousValue: Post, currentValue: Post, currentIndex: number, array: Post[]): Post
          • -
          • -
            -

            Parameters

            -
              -
            • -
              previousValue: Post
            • -
            • -
              currentValue: Post
            • -
            • -
              currentIndex: number
            • -
            • -
              array: Post[]
            -

            Returns Post

      -

      Returns Post

    • - -
    • -
      -

      Parameters

      -
        -
      • -
        callbackfn: ((previousValue: Post, currentValue: Post, currentIndex: number, array: Post[]) => Post)
        -
          -
        • -
            -
          • (previousValue: Post, currentValue: Post, currentIndex: number, array: Post[]): Post
          • -
          • -
            -

            Parameters

            -
              -
            • -
              previousValue: Post
            • -
            • -
              currentValue: Post
            • -
            • -
              currentIndex: number
            • -
            • -
              array: Post[]
            -

            Returns Post

      • -
      • -
        initialValue: Post
      -

      Returns Post

    • - -
    • -

      Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      -
      -
      -

      Type Parameters

      -
        -
      • -

        U

      -
      -

      Parameters

      -
        -
      • -
        callbackfn: ((previousValue: U, currentValue: Post, currentIndex: number, array: Post[]) => U)
        -

        A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

        -
        -
          -
        • -
            -
          • (previousValue: U, currentValue: Post, currentIndex: number, array: Post[]): U
          • -
          • -
            -

            Parameters

            -
              -
            • -
              previousValue: U
            • -
            • -
              currentValue: Post
            • -
            • -
              currentIndex: number
            • -
            • -
              array: Post[]
            -

            Returns U

      • -
      • -
        initialValue: U
        -

        If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

        -
      -

      Returns U

    -
    - -
      - -
    • -

      Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      -
      -
      -

      Parameters

      -
        -
      • -
        callbackfn: ((previousValue: Post, currentValue: Post, currentIndex: number, array: Post[]) => Post)
        -

        A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

        -
        -
          -
        • -
            -
          • (previousValue: Post, currentValue: Post, currentIndex: number, array: Post[]): Post
          • -
          • -
            -

            Parameters

            -
              -
            • -
              previousValue: Post
            • -
            • -
              currentValue: Post
            • -
            • -
              currentIndex: number
            • -
            • -
              array: Post[]
            -

            Returns Post

      -

      Returns Post

    • - -
    • -
      -

      Parameters

      -
        -
      • -
        callbackfn: ((previousValue: Post, currentValue: Post, currentIndex: number, array: Post[]) => Post)
        -
          -
        • -
            -
          • (previousValue: Post, currentValue: Post, currentIndex: number, array: Post[]): Post
          • -
          • -
            -

            Parameters

            -
              -
            • -
              previousValue: Post
            • -
            • -
              currentValue: Post
            • -
            • -
              currentIndex: number
            • -
            • -
              array: Post[]
            -

            Returns Post

      • -
      • -
        initialValue: Post
      -

      Returns Post

    • - -
    • -

      Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      -
      -
      -

      Type Parameters

      -
        -
      • -

        U

      -
      -

      Parameters

      -
        -
      • -
        callbackfn: ((previousValue: U, currentValue: Post, currentIndex: number, array: Post[]) => U)
        -

        A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

        -
        -
          -
        • -
            -
          • (previousValue: U, currentValue: Post, currentIndex: number, array: Post[]): U
          • -
          • -
            -

            Parameters

            -
              -
            • -
              previousValue: U
            • -
            • -
              currentValue: Post
            • -
            • -
              currentIndex: number
            • -
            • -
              array: Post[]
            -

            Returns U

      • -
      • -
        initialValue: U
        -

        If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

        -
      -

      Returns U

    -
    - -
      - -
    • -

      Reverses the elements in an array in place. +

      Returns undefined | Post

    • Appends new elements to the end of an array, and returns the new length of the array.

      +

      Parameters

      • Rest ...items: Post[]

        New elements to add to the array.

        +

      Returns number

    • Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      +

      Parameters

      • callbackfn: ((previousValue, currentValue, currentIndex, array) => Post)

        A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

        +
          • (previousValue, currentValue, currentIndex, array): Post
          • Parameters

            • previousValue: Post
            • currentValue: Post
            • currentIndex: number
            • array: Post[]

            Returns Post

      Returns Post

    • Parameters

      • callbackfn: ((previousValue, currentValue, currentIndex, array) => Post)
          • (previousValue, currentValue, currentIndex, array): Post
          • Parameters

            • previousValue: Post
            • currentValue: Post
            • currentIndex: number
            • array: Post[]

            Returns Post

      • initialValue: Post

      Returns Post

    • Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      +

      Type Parameters

      • U

      Parameters

      • callbackfn: ((previousValue, currentValue, currentIndex, array) => U)

        A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

        +
          • (previousValue, currentValue, currentIndex, array): U
          • Parameters

            • previousValue: U
            • currentValue: Post
            • currentIndex: number
            • array: Post[]

            Returns U

      • initialValue: U

        If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

        +

      Returns U

    • Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      +

      Parameters

      • callbackfn: ((previousValue, currentValue, currentIndex, array) => Post)

        A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

        +
          • (previousValue, currentValue, currentIndex, array): Post
          • Parameters

            • previousValue: Post
            • currentValue: Post
            • currentIndex: number
            • array: Post[]

            Returns Post

      Returns Post

    • Parameters

      • callbackfn: ((previousValue, currentValue, currentIndex, array) => Post)
          • (previousValue, currentValue, currentIndex, array): Post
          • Parameters

            • previousValue: Post
            • currentValue: Post
            • currentIndex: number
            • array: Post[]

            Returns Post

      • initialValue: Post

      Returns Post

    • Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

      +

      Type Parameters

      • U

      Parameters

      • callbackfn: ((previousValue, currentValue, currentIndex, array) => U)

        A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

        +
          • (previousValue, currentValue, currentIndex, array): U
          • Parameters

            • previousValue: U
            • currentValue: Post
            • currentIndex: number
            • array: Post[]

            Returns U

      • initialValue: U

        If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

        +

      Returns U

    • Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array.

      -
      -

      Returns Post[]

    -
    - -
      - -
    • -

      Removes the first element from an array and returns it. +

      Returns Post[]

    • Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.

      -
      -

      Returns undefined | Post

    -
    - -
      - -
    • -

      Returns a copy of a section of an array. +

      Returns undefined | Post

    • Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array.

      -
      -
      -

      Parameters

      -
        -
      • -
        Optional start: number
        -

        The beginning index of the specified portion of the array. +

        Parameters

        • Optional start: number

          The beginning index of the specified portion of the array. If start is undefined, then the slice begins at index 0.

          -
        • -
        • -
          Optional end: number
          -

          The end index of the specified portion of the array. This is exclusive of the element at the index 'end'. +

        • Optional end: number

          The end index of the specified portion of the array. This is exclusive of the element at the index 'end'. If end is undefined, then the slice extends to the end of the array.

          -
        -

        Returns Post[]

    -
    - -
      - -
    • -

      Determines whether the specified callback function returns true for any element of an array.

      -
      -
      -

      Parameters

      -
        -
      • -
        predicate: ((value: Post, index: number, array: Post[]) => unknown)
        -

        A function that accepts up to three arguments. The some method calls +

      Returns Post[]

    • Determines whether the specified callback function returns true for any element of an array.

      +

      Parameters

      • predicate: ((value, index, array) => unknown)

        A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array.

        -
        -
          -
        • -
            -
          • (value: Post, index: number, array: Post[]): unknown
          • -
          • -
            -

            Parameters

            -
              -
            • -
              value: Post
            • -
            • -
              index: number
            • -
            • -
              array: Post[]
            -

            Returns unknown

      • -
      • -
        Optional thisArg: any
        -

        An object to which the this keyword can refer in the predicate function. +

          • (value, index, array): unknown
          • Parameters

            Returns unknown

      • Optional thisArg: any

        An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

        -
      -

      Returns boolean

    -
    - -

    Returns boolean

    • Sorts an array in place. This method mutates the array and returns a reference to the same array.

      -
      -
      -

      Parameters

      -
        -
      • -
        Optional compareFn: ((a: Post, b: Post) => number)
        -

        Function used to determine the order of the elements. It is expected to return +

        Parameters

        • Optional compareFn: ((a, b) => number)

          Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they're equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.

          -
          [11,2,22,1].sort((a, b) => a - b)
          -
          -
          -
            -
          • -
              -
            • (a: Post, b: Post): number
            • -
            • -
              -

              Parameters

              -
              -

              Returns number

        -

        Returns SearchResults

    -
    - -
      - -
    • -

      Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

      - -

      Returns

      An array containing the elements that were deleted.

      -
      -
      -

      Parameters

      -
        -
      • -
        start: number
        -

        The zero-based location in the array from which to start removing elements.

        -
      • -
      • -
        Optional deleteCount: number
        -

        The number of elements to remove.

        -
      -

      Returns Post[]

    • - -
    • -

      Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

      - -

      Returns

      An array containing the elements that were deleted.

      -
      -
      -

      Parameters

      -
        -
      • -
        start: number
        -

        The zero-based location in the array from which to start removing elements.

        -
      • -
      • -
        deleteCount: number
        -

        The number of elements to remove.

        -
      • -
      • -
        Rest ...items: Post[]
        -

        Elements to insert into the array in place of the deleted elements.

        -
      -

      Returns Post[]

    -
    - -
      - -
    • -

      Create a new SearchResults with just images with the matching tags

      - -

      Returns

      -
      -

      Parameters

      -
        -
      • -
        tags: string | string[]
        -

        The tags (or tag) to search for

        -
      • -
      • -
        options: {
            invert: undefined | boolean;
        } = {}
        -

        The extra options for the search

        -
        -
          -
        • -
          invert: undefined | boolean
          -

          If the results should be inverted and +

          [11,2,22,1].sort((a, b) => a - b)
          +
          +
            • (a, b): number
            • Parameters

              Returns number

      Returns this

    • Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

      +

      Parameters

      • start: number

        The zero-based location in the array from which to start removing elements.

        +
      • Optional deleteCount: number

        The number of elements to remove.

        +

      Returns Post[]

      An array containing the elements that were deleted.

      +
    • Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

      +

      Parameters

      • start: number

        The zero-based location in the array from which to start removing elements.

        +
      • deleteCount: number

        The number of elements to remove.

        +
      • Rest ...items: Post[]

        Elements to insert into the array in place of the deleted elements.

        +

      Returns Post[]

      An array containing the elements that were deleted.

      +
    • Create a new SearchResults with just images with the matching tags

      +

      Parameters

      • tags: string | string[]

        The tags (or tag) to search for

        +
      • options: {
            invert: undefined | boolean;
        } = {}

        The extra options for the search

        +
        • invert: undefined | boolean

          If the results should be inverted and return images not tagged

          -
      -

      Returns SearchResults

    -
    - -
      - -
    • -

      Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.

      -
      -

      Returns string

    -
    - -
      - -
    • -

      Returns a string representation of an array.

      -
      -

      Returns string

    -
    - -
      - -
    • -

      Inserts new elements at the start of an array, and returns the new length of the array.

      -
      -
      -

      Parameters

      -
        -
      • -
        Rest ...items: Post[]
        -

        Elements to insert at the start of the array.

        -
      -

      Returns number

    -
    - -
      - -
    • -

      Returns an iterable of values in the array

      -
      -

      Returns IterableIterator<Post>

    -
    - -
      - -
    • -

      Creates an array from an array-like object.

      -
      -
      -

      Type Parameters

      -
        -
      • -

        T

      -
      -

      Parameters

      -
        -
      • -
        arrayLike: ArrayLike<T>
        -

        An array-like object to convert to an array.

        -
      -

      Returns T[]

    • - -
    • -

      Creates an array from an iterable object.

      -
      -
      -

      Type Parameters

      -
        -
      • -

        T

      • -
      • -

        U

      -
      -

      Parameters

      -
        -
      • -
        arrayLike: ArrayLike<T>
        -

        An array-like object to convert to an array.

        -
      • -
      • -
        mapfn: ((v: T, k: number) => U)
        -

        A mapping function to call on every element of the array.

        -
        -
          -
        • -
            -
          • (v: T, k: number): U
          • -
          • -
            -

            Parameters

            -
              -
            • -
              v: T
            • -
            • -
              k: number
            -

            Returns U

      • -
      • -
        Optional thisArg: any
        -

        Value of 'this' used to invoke the mapfn.

        -
      -

      Returns U[]

    • - -
    • -

      Creates an array from an iterable object.

      -
      -
      -

      Type Parameters

      -
        -
      • -

        T

      -
      -

      Parameters

      -
        -
      • -
        iterable: Iterable<T> | ArrayLike<T>
        -

        An iterable object to convert to an array.

        -
      -

      Returns T[]

    • - -
    • -

      Creates an array from an iterable object.

      -
      -
      -

      Type Parameters

      -
        -
      • -

        T

      • -
      • -

        U

      -
      -

      Parameters

      -
        -
      • -
        iterable: Iterable<T> | ArrayLike<T>
        -

        An iterable object to convert to an array.

        -
      • -
      • -
        mapfn: ((v: T, k: number) => U)
        -

        A mapping function to call on every element of the array.

        -
        -
          -
        • -
            -
          • (v: T, k: number): U
          • -
          • -
            -

            Parameters

            -
              -
            • -
              v: T
            • -
            • -
              k: number
            -

            Returns U

      • -
      • -
        Optional thisArg: any
        -

        Value of 'this' used to invoke the mapfn.

        -
      -

      Returns U[]

    -
    - -
      - -
    • -
      -

      Parameters

      -
        -
      • -
        arg: any
      -

      Returns arg is any[]

    -
    - -
      - -
    • -

      Returns a new array from a set of elements.

      -
      -
      -

      Type Parameters

      -
        -
      • -

        T

      -
      -

      Parameters

      -
        -
      • -
        Rest ...items: T[]
        -

        A set of elements to include in the new array object.

        -
      -

      Returns T[]

    - -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Returns SearchResults

    • Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.

      +

      Returns string

    • Returns a copy of an array with its elements reversed.

      +

      Returns Post[]

    • Returns a copy of an array with its elements sorted.

      +

      Parameters

      • Optional compareFn: ((a, b) => number)

        Function used to determine the order of the elements. It is expected to return +a negative value if the first argument is less than the second argument, zero if they're equal, and a positive +value otherwise. If omitted, the elements are sorted in ascending, ASCII character order.

        +
        [11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22]
        +
        +
          • (a, b): number
          • Parameters

            Returns number

      Returns Post[]

    • Copies an array and removes elements and, if necessary, inserts new elements in their place. Returns the copied array.

      +

      Parameters

      • start: number

        The zero-based location in the array from which to start removing elements.

        +
      • deleteCount: number

        The number of elements to remove.

        +
      • Rest ...items: Post[]

        Elements to insert into the copied array in place of the deleted elements.

        +

      Returns Post[]

      The copied array.

      +
    • Copies an array and removes elements while returning the remaining elements.

      +

      Parameters

      • start: number

        The zero-based location in the array from which to start removing elements.

        +
      • Optional deleteCount: number

        The number of elements to remove.

        +

      Returns Post[]

      A copy of the original array with the remaining elements.

      +
    • Returns a string representation of an array.

      +

      Returns string

    • Inserts new elements at the start of an array, and returns the new length of the array.

      +

      Parameters

      • Rest ...items: Post[]

        Elements to insert at the start of the array.

        +

      Returns number

    • Returns an iterable of values in the array

      +

      Returns IterableIterator<Post>

    • Copies an array, then overwrites the value at the provided index with the +given value. If the index is negative, then it replaces from the end +of the array.

      +

      Parameters

      • index: number

        The index of the value to overwrite. If the index is +negative, then it replaces from the end of the array.

        +
      • value: Post

        The value to write into the copied array.

        +

      Returns Post[]

      The copied array with the updated value.

      +
    • Creates an array from an array-like object.

      +

      Type Parameters

      • T

      Parameters

      • arrayLike: ArrayLike<T>

        An array-like object to convert to an array.

        +

      Returns T[]

    • Creates an array from an iterable object.

      +

      Type Parameters

      • T
      • U

      Parameters

      • arrayLike: ArrayLike<T>

        An array-like object to convert to an array.

        +
      • mapfn: ((v, k) => U)

        A mapping function to call on every element of the array.

        +
          • (v, k): U
          • Parameters

            • v: T
            • k: number

            Returns U

      • Optional thisArg: any

        Value of 'this' used to invoke the mapfn.

        +

      Returns U[]

    • Creates an array from an iterable object.

      +

      Type Parameters

      • T

      Parameters

      • iterable: Iterable<T> | ArrayLike<T>

        An iterable object to convert to an array.

        +

      Returns T[]

    • Creates an array from an iterable object.

      +

      Type Parameters

      • T
      • U

      Parameters

      • iterable: Iterable<T> | ArrayLike<T>

        An iterable object to convert to an array.

        +
      • mapfn: ((v, k) => U)

        A mapping function to call on every element of the array.

        +
          • (v, k): U
          • Parameters

            • v: T
            • k: number

            Returns U

      • Optional thisArg: any

        Value of 'this' used to invoke the mapfn.

        +

      Returns U[]

    • Parameters

      • arg: any

      Returns arg is any[]

    • Returns a new array from a set of elements.

      +

      Type Parameters

      • T

      Parameters

      • Rest ...items: T[]

        A set of elements to include in the new array object.

        +

      Returns T[]

    \ No newline at end of file diff --git a/docs/classes/Site.html b/docs/classes/Site.html index 946c7aa..141bc0e 100644 --- a/docs/classes/Site.html +++ b/docs/classes/Site.html @@ -1,184 +1,26 @@ -Site | @himeka/booru - v2.7.6
    -
    - -
    -
    -
    -
    - -

    Class Site

    -
    -

    Represents a site, mostly used for JSDoc

    -
    -
    -

    Hierarchy

    -
      -
    • Site
    -
    -
    -
    - -
    -
    -

    Constructors

    -
    -
    -

    Properties

    -
    -
    -

    Constructors

    -
    - -
    -
    -

    Properties

    -
    - -
    aliases: string[]
    -

    The aliases of this site

    -
    -
    - -
    api: default
    -

    An object representing the api of this site

    -
    -
    - -
    defaultTags: string[]
    -

    Tags to add to every request, if not included

    -
    -
    - -
    domain: string
    -

    The domain of the Site (the "google.com" part of "https://google.com/foo")

    -
    -
    - -
    insecure: boolean
    -

    If this site supports only http://

    -
    -
    - -
    nsfw: boolean
    -

    If this site serves NSFW posts or not

    -
    -
    - -
    paginate: string
    -

    The url query param to paginate on the site

    -
    -
    - -
    random: string | boolean
    -

    If the site supports order:random. +Site | @himeka/booru - v2.7.7

    Represents a site, mostly used for JSDoc

    +

    Constructors

    Properties

    aliases: string[]

    The aliases of this site

    +
    api: default

    An object representing the api of this site

    +
    defaultTags: string[]

    Tags to add to every request, if not included

    +
    domain: string

    The domain of the Site (the "google.com" part of "https://google.com/foo")

    +
    insecure: boolean

    If this site supports only http://

    +
    nsfw: boolean

    If this site serves NSFW posts or not

    +
    paginate: string

    The url query param to paginate on the site

    +
    random: string | boolean

    If the site supports order:random. If a string, this means a custom random system is used :/

    -
    -
    - -
    tagJoin: string
    -

    The character to use to join tags when creating the search url

    -
    -
    - -
    tagQuery: string
    -

    The url query param for tags

    -
    -
    - -
    type: string
    -

    The type of this site (json/xml/derpi)

    -
    -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +
    tagJoin: string

    The character to use to join tags when creating the search url

    +
    tagQuery: string

    The url query param for tags

    +
    type: string

    The type of this site (json/xml/derpi)

    +
    \ No newline at end of file diff --git a/docs/classes/XmlBooru.html b/docs/classes/XmlBooru.html index d2270ae..f93ba37 100644 --- a/docs/classes/XmlBooru.html +++ b/docs/classes/XmlBooru.html @@ -1,252 +1,36 @@ -XmlBooru | @himeka/booru - v2.7.6
    -
    - -
    -
    -
    -
    - -

    Class XmlBooru

    -
    -

    A basic, JSON booru

    - -

    Example

    const Booru = require('booru')
    // Aliases are supported
    const e9 = Booru('e9')

    // You can then search the site
    const imgs = await e9.search(['cat', 'cute'], {limit: 3})

    // And use the images
    imgs.forEach(i => console.log(i.fileUrl))

    // Or access other methods on the Booru
    e9.postView(imgs[0].id) -
    -
    -
    -

    Hierarchy

    -
    -
    -
    -
    - -
    -
    -

    Constructors

    -
    -
    -

    Properties

    -
    -
    -

    Methods

    -
    -
    -

    Constructors

    -
    - -
    -
    -

    Properties

    -
    - -
    credentials?: BooruCredentials
    -

    The credentials to use for this booru

    -
    -
    - -
    domain: string
    -

    The domain of the booru

    -
    -
    - -
    site: Site
    -

    The site object representing this booru

    -
    -
    -

    Methods

    -
    - -
      - -
    • Protected -

      The internal & common searching logic, pls dont use this use .search instead

      - -

      Returns

      -
      -

      Parameters

      -
        -
      • -
        tags: string | string[]
        -

        The tags to search with

        -
      • -
      • -
        searchArgs: default = {}
        -

        The arguments for the search

        -
      -

      Returns Promise<any>

    -
    - -
      - -
    • -

      Generates a URL to search the booru with, mostly for debugging purposes

      - -

      Returns

      A URL to search the booru

      -
      -
      -

      Parameters

      -
        -
      • -
        opt: Partial<SearchUrlParams>
      -

      Returns string

    -
    - -
    -
    - -
      - -
    • -

      Gets the url you'd see in your browser from a post id for this booru

      - -

      Returns

      The url to the post

      -
      -
      -

      Parameters

      -
        -
      • -
        id: string | number
        -

        The id to get the postView for

        -
      -

      Returns string

    -
    - -
    -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +XmlBooru | @himeka/booru - v2.7.7

    Class XmlBooru

    A basic, JSON booru

    +

    Example

    const Booru = require('booru')
    // Aliases are supported
    const e9 = Booru('e9')

    // You can then search the site
    const imgs = await e9.search(['cat', 'cute'], {limit: 3})

    // And use the images
    imgs.forEach(i => console.log(i.fileUrl))

    // Or access other methods on the Booru
    e9.postView(imgs[0].id) +
    +

    Hierarchy (view full)

    Constructors

    Properties

    credentials?: BooruCredentials

    The credentials to use for this booru

    +
    domain: string

    The domain of the booru

    +
    site: Site

    The site object representing this booru

    +

    Methods

    • Protected

      The internal & common searching logic, pls dont use this use .search instead

      +

      Parameters

      • tags: string[]

        The tags to search with

        +
      • searchArgs: default = {}

        The arguments for the search

        +

      Returns Promise<any>

    • Generates a URL to search the booru with, mostly for debugging purposes

      +

      Parameters

      • opt: Partial<SearchUrlParams>

      Returns string

      A URL to search the booru

      +
    • Gets the url you'd see in your browser from a post id for this booru

      +

      Parameters

      • id: string | number

        The id to get the postView for

        +

      Returns string

      The url to the post

      +
    \ No newline at end of file diff --git a/docs/functions/forSite.html b/docs/functions/forSite.html index bd41917..1ed362f 100644 --- a/docs/functions/forSite.html +++ b/docs/functions/forSite.html @@ -1,79 +1,5 @@ -forSite | @himeka/booru - v2.7.6
    -
    - -
    -
    -
    -
    - -

    Function forSite

    -
    -
      - -
    • -

      Create a new booru to search with

      - -

      Returns

      A booru to use

      -
      -
      -

      Parameters

      -
        -
      • -
        site: string
        -

        The Site domain (or alias of it) to create a booru from

        -
      • -
      • -
        credentials: any = null
        -

        The credentials to use on this booru

        -
      -

      Returns BooruClass

    -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +forSite | @himeka/booru - v2.7.7

    Function forSite

    • Create a new booru to search with

      +

      Parameters

      • site: string

        The Site domain (or alias of it) to create a booru from

        +
      • credentials: any = null

        The credentials to use on this booru

        +

      Returns BooruClass

      A booru to use

      +
    \ No newline at end of file diff --git a/docs/functions/resolveSite.html b/docs/functions/resolveSite.html index f9303dd..0de75c7 100644 --- a/docs/functions/resolveSite.html +++ b/docs/functions/resolveSite.html @@ -1,75 +1,4 @@ -resolveSite | @himeka/booru - v2.7.6
    -
    - -
    -
    -
    -
    - -

    Function resolveSite

    -
    -
      - -
    • -

      Check if site is a supported site (and check if it's an alias and return the sites's true name)

      - -

      Returns

      null if site is not supported, the site otherwise

      -
      -
      -

      Parameters

      -
        -
      • -
        domain: string
        -

        The site to resolveSite

        -
      -

      Returns string | null

    -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +resolveSite | @himeka/booru - v2.7.7

    Function resolveSite

    • Check if site is a supported site (and check if it's an alias and return the sites's true name)

      +

      Parameters

      • domain: string

        The site to resolveSite

        +

      Returns string | null

      null if site is not supported, the site otherwise

      +
    \ No newline at end of file diff --git a/docs/functions/search.html b/docs/functions/search.html index 2cbf61e..10a6193 100644 --- a/docs/functions/search.html +++ b/docs/functions/search.html @@ -1,87 +1,9 @@ -search | @himeka/booru - v2.7.6
    -
    - -
    -
    -
    -
    - -

    Function search

    -
    -
      - -
    • -

      Searches a site for images with tags and returns the results

      - -

      Returns

      A promise with the images as an array of objects

      - -

      Example

      const Booru = require('booru')
      // Returns a promise with the latest cute glace pic from e926
      Booru.search('e926', ['glaceon', 'cute']) -
      -
      -
      -

      Parameters

      -

      Returns Promise<SearchResults>

      A promise with the images as an array of objects

      +

      Example

      const Booru = require('booru')
      // Returns a promise with the latest cute glace pic from e926
      Booru.search('e926', ['glaceon', 'cute']) +
      +
    \ No newline at end of file diff --git a/docs/hierarchy.html b/docs/hierarchy.html new file mode 100644 index 0000000..4efa1f3 --- /dev/null +++ b/docs/hierarchy.html @@ -0,0 +1 @@ +@himeka/booru - v2.7.7

    @himeka/booru - v2.7.7

    Class Hierarchy

    \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index e9b0532..dacd957 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,32 +1,10 @@ -@himeka/booru - v2.7.6
    -
    - -
    -
    -
    -
    -

    @himeka/booru - v2.7.6

    -
    - -

    booru

    -
    -

    npm GitHub Typescript typings

    +@himeka/booru - v2.7.7

    @himeka/booru - v2.7.7

    booru

    npm GitHub Typescript typings

    English | 中文

    A node package to search boorus

    Forked from AtoraSuunva/booru

    - - -

    Features

    -
    -
      +

      Features

      • Search 20 different boorus (check sites.json)
      • Normalizes all received data into Post objects that are consistent no matter which booru you use
      • Access to the raw data received from the booru as well (transformed from XML to JSON, if applicable)
      • @@ -39,70 +17,42 @@

        Features

      • Coming soon(-ish): Support for more than just searching

      - - -

      Installation

      -
      -
      npm i @himeka/booru
      # or
      yarn add @himeka/booru -
      +

      Installation

      npm i @himeka/booru
      # or
      yarn add @himeka/booru +

      - - -

      Usage

      -
      -
      const Booru = require('@himeka/booru')

      Booru.search('safebooru', ['glaceon'], { limit: 3, random: true }).then(
      posts => {
      for (let post of posts) console.log(post.fileUrl, post.postView)
      },
      )

      // or (using alias support and creating boorus)
      const sb = Booru.forSite('sb')

      sb.search(['cat', 'dog'], { limit: 2 }) -
      +

      Usage

      const Booru = require('@himeka/booru')

      Booru.search('safebooru', ['glaceon'], { limit: 3, random: true }).then(
      posts => {
      for (let post of posts) console.log(post.fileUrl, post.postView)
      },
      )

      // or (using alias support and creating boorus)
      const sb = Booru.forSite('sb')

      sb.search(['cat', 'dog'], { limit: 2 }) +

      See example.js for more examples


      - - -

      Docs

      -
      -

      Available here: docs

      - - -

      Web support

      -
      -

      booru was built for Node.js, and is only officially supported for Node.js. Issues relating to web are fine, although support might be limited.

      +

      Docs

      Available here: docs

      +

      Web support

      booru was built for Node.js, and is only officially supported for Node.js. Issues relating to web are fine, although support might be limited.

      It's possible to use booru on the web using webpack (or similar), although your experience may vary. Some websites don't have the proper CORS headers, meaning that API requests to those sites from a browser will fail! This is not an issue I can fix in the package, and requires either that booru to add proper support themselves or for you to find a workaround for CORS.

      - - -

      FAQ

      -
      - - -

      What are the properties of a Post?

      -
      -

      The basic structure of a Post object looks like:

      -
      Post {
      _data: {/*...*/}, // The raw data from the booru
      fileUrl: 'https://aaaa.com/img.jpg', // The direct link to the image, ready to post
      id: '124125', // The image ID, as a string
      tags: ['cat', 'cute'], // The tags, split into an Array
      score: 5, // The score as a Number
      source: 'https://ex.com/aaa.png', // Source of the image, if supplied
      rating: 's', // Rating of the image
      createdAt: Date, // The `Date` this image was created at
      postView: 'https://booru.ex/show/12345' // A URL to the post
      } -
      +

      For sites that do not support CORS, there are two solutions as follows

      +
        +
      1. Define the global method BOORU_FETCH_PROXY to handle the request URL. Note that the code should be placed before calling Booru.search.
      2. +
      +
      // Replace with your own CORS proxy
      globalThis.BOORU_FETCH_PROXY = u => `https://cors.example.com/${u}` +
      +
        +
      1. You can hack it according to the following code. Note that this code should be placed before the reference @himeka/booru.
      2. +
      +

      The CORS proxy in the following example needs to support calls in the form of https://cors.example.com/https://konachan.net/post.json.

      +
      const _fetch = window.fetch
      const proxy = 'https://cors.example.com/' // Replace with your own CORS proxy
      window.fetch = (input, init) => {
      let url = input.toString()
      if (url.startsWith('https')) { // Handle judgment conditions by yourself
      url = proxy + url // Process it to the format required by the proxy
      }
      return _fetch(url, init)
      } +
      +

      FAQ

      What are the properties of a Post?

      The basic structure of a Post object looks like:

      +
      Post {
      _data: {/*...*/}, // The raw data from the booru
      fileUrl: 'https://aaaa.com/img.jpg', // The direct link to the image, ready to post
      id: '124125', // The image ID, as a string
      tags: ['cat', 'cute'], // The tags, split into an Array
      score: 5, // The score as a Number
      source: 'https://ex.com/aaa.png', // Source of the image, if supplied
      rating: 's', // Rating of the image
      createdAt: Date, // The `Date` this image was created at
      postView: 'https://booru.ex/show/12345' // A URL to the post
      } +

      s: 'Safe' q: 'Questionable' e: 'Explicit' u: 'Unrated'

      Derpibooru has Safe, Suggestive, Questionable, Explicit, although Suggestive will be shown as q in <Post>.rating

      - - -

      Can I contribute?

      -
      -

      Sure! Just fork this repo, push your changes, and then make a PR.

      +

      Can I contribute?

      Sure! Just fork this repo, push your changes, and then make a PR.

      I'll accept PR based on what they do and code style (Not super strict about it, but it's best if it roughly follows the rest of the code)

      - - -

      Why?

      -
      -

      Why not?

      - - -

      License?

      -
      -

      It's MIT

      +

      Why?

      Why not?

      +

      License?

      It's MIT


      - - -

      Contributors

      -
      -

      BobbyWibowo

      +

      Contributors

      BobbyWibowo

      Change from request-promise-native to snek-fetch

      @@ -122,44 +72,4 @@

      Contributors

      Add missing type information


      -
    -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/BooruCredentials.html b/docs/interfaces/BooruCredentials.html index b723e41..3bf33f7 100644 --- a/docs/interfaces/BooruCredentials.html +++ b/docs/interfaces/BooruCredentials.html @@ -1,75 +1,3 @@ -BooruCredentials | @himeka/booru - v2.7.6
    -
    - -
    -
    -
    -
    - -

    Interface BooruCredentials

    -
    -

    Hierarchy

    -
      -
    • BooruCredentials
    -
    -
    -
    - -
    -
    -

    Properties

    -
    -
    -

    Properties

    -
    - -
    query?: string
    -
    - -
    token?: string
    -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +BooruCredentials | @himeka/booru - v2.7.7

    Interface BooruCredentials

    interface BooruCredentials {
        query?: string;
        token?: string;
    }

    Properties

    Properties

    query?: string
    token?: string
    \ No newline at end of file diff --git a/docs/interfaces/SearchParameters.html b/docs/interfaces/SearchParameters.html index 455abc6..bbcfd79 100644 --- a/docs/interfaces/SearchParameters.html +++ b/docs/interfaces/SearchParameters.html @@ -1,109 +1,12 @@ -SearchParameters | @himeka/booru - v2.7.6
    -
    - -
    -
    -
    -
    - -

    Interface SearchParameters

    -
    -

    Just an interface for Booru's search params :)

    -
    -
    -

    Hierarchy

    -
      -
    • SearchParameters
    -
    -
    -
    - -
    -
    -

    Properties

    -
    - -
    credentials?: BooruCredentials
    -

    The credentials to use to auth with the booru

    -
    -
    - -
    limit?: number
    -

    The limit on max posts to show, you might get less posts than this

    -
    -
    - -
    page?: number
    -

    Which page of results to fetch

    -
    -
    - -
    random?: boolean
    -

    Should posts be in random order, implementation differs per booru

    -
    -
    - -
    showUnavailable?: boolean
    -

    Return unavailable posts (ie. banned/deleted posts)

    -
    -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +SearchParameters | @himeka/booru - v2.7.7

    Interface SearchParameters

    Just an interface for Booru's search params :)

    +
    interface SearchParameters {
        credentials?: BooruCredentials;
        limit?: number;
        page?: number;
        random?: boolean;
        showUnavailable?: boolean;
    }

    Properties

    credentials?: BooruCredentials

    The credentials to use to auth with the booru

    +
    limit?: number

    The limit on max posts to show, you might get less posts than this

    +
    page?: number

    Which page of results to fetch

    +
    random?: boolean

    Should posts be in random order, implementation differs per booru

    +
    showUnavailable?: boolean

    Return unavailable posts (ie. banned/deleted posts)

    +
    \ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index 238e78f..acb2cfe 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,92 +1,15 @@ -@himeka/booru - v2.7.6
    -
    - -
    -
    -
    -
    -

    @himeka/booru - v2.7.6

    -
    -
    -
    - -
    -
    -

    References

    -
    -
    -

    Classes

    -
    -
    -

    Interfaces

    -
    -
    -

    Variables

    -
    -
    -

    Functions

    -
    -
    -

    References

    -
    -Renames and re-exports forSite
    -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +@himeka/booru - v2.7.7

    @himeka/booru - v2.7.7

    References

    Renames and re-exports forSite
    \ No newline at end of file diff --git a/docs/variables/sites.html b/docs/variables/sites.html index 1063aab..2b3f98b 100644 --- a/docs/variables/sites.html +++ b/docs/variables/sites.html @@ -1,62 +1,2 @@ -sites | @himeka/booru - v2.7.6
    -
    - -
    -
    -
    -
    - -

    Variable sitesConst

    -
    sites: SMap<default> = ...
    -

    A map of site url/SiteInfo

    -
    -
    -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +sites | @himeka/booru - v2.7.7

    Variable sitesConst

    sites: SMap<default> = ...

    A map of site url/SiteInfo

    +
    \ No newline at end of file diff --git a/example.js b/example.js index 6528136..6660f6b 100644 --- a/example.js +++ b/example.js @@ -3,6 +3,9 @@ const { BooruError, sites } = require('./dist') // for ES6: // import Booru, { search, BooruError, sites } from 'booru' +// Use you own cors proxy in browser case +// globalThis.BOORU_FETCH_PROXY = u => `https://cors.example.com/${u}` + const argTags = process.argv.slice(3) const site = process.argv[2] || 'sb' const tags = process.argv[2] ? argTags : ['cat'] diff --git a/package.json b/package.json index e934d93..c54731a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@himeka/booru", - "version": "2.7.6", + "version": "2.7.7", "description": "Search (and do other things) on a bunch of different boorus!", "author": "asadahimeka (https://github.com/asadahimeka)", "license": "MIT", @@ -54,7 +54,7 @@ "node": ">=10.0.0" }, "dependencies": { - "fast-xml-parser": "4.0.11", + "fast-xml-parser": "4.4.0", "isomorphic-unfetch": "3.1.0" }, "devDependencies": { @@ -68,7 +68,7 @@ "eslint": "8.27.0", "eslint-config-prettier": "8.5.0", "eslint-plugin-import": "2.26.0", - "eslint-plugin-jsdoc": "39.6.2", + "eslint-plugin-jsdoc": "48.2.9", "execa": "6.1.0", "jest": "29.3.1", "minimist": "1.2.7", diff --git a/readme.md b/readme.md index ff21b98..1b20346 100755 --- a/readme.md +++ b/readme.md @@ -64,17 +64,26 @@ booru was built for Node.js, and is only officially supported for Node.js. Issue It's possible to use booru on the web using webpack (or similar), although your experience may vary. Some websites don't have the proper CORS headers, meaning that API requests to those sites from a browser will fail! This is not an issue I can fix in the package, and requires either that booru to add proper support themselves or for you to find a workaround for CORS. -For sites that do not support CORS, you can hack the code as follows, noting that this code should be placed before importing `@himeka/booru`. +For sites that do not support CORS, there are two solutions as follows -The CORS proxy needs to support calls of the form `https://cors.example.com/https://konachan.net/post.json`. +- Define the global method `BOORU_FETCH_PROXY` to handle the request URL. Note that the code should be placed before calling `Booru.search`. + +```js +// Replace with your own CORS proxy +globalThis.BOORU_FETCH_PROXY = u => `https://cors.example.com/${u}` +``` + +- Or you can hack it according to the following code. Note that this code should be placed before the reference `@himeka/booru`. + +The CORS proxy in the following example needs to support calls in the form of `https://cors.example.com/https://konachan.net/post.json`. ```js const _fetch = window.fetch const proxy = 'https://cors.example.com/' // Replace with your own CORS proxy -window.fetch = (input, init) => { + window.fetch = (input, init) => { let url = input.toString() - if (url.startsWith('https')) { - url = proxy + url + if (url.startsWith('https')) { // Handle judgment conditions by yourself + url = proxy + url // Process it to the format required by the proxy } return _fetch(url, init) } diff --git a/readme.zh-cn.md b/readme.zh-cn.md index 6edf1c9..6827919 100644 --- a/readme.zh-cn.md +++ b/readme.zh-cn.md @@ -65,17 +65,26 @@ booru 主要是为 Node.js 构建的,浏览器支持可能有限。 可以使用 webpack(或类似工具)在 web 上使用 booru,尽管体验可能会有所不同。 某些网站没有正确的 CORS 标头,这意味着从浏览器对这些网站的 API 请求将失败,需要自行解决跨域问题。 -对于不支持 CORS 的站点,可以按如下代码 hack 一下,注意这段代码要放到引用 `@himeka/booru` 之前。 +对于不支持 CORS 的站点,有如下两种方式解决 -CORS 代理需要支持 `https://cors.example.com/https://konachan.net/post.json` 形式的调用。 +- 定义全局方法 `BOORU_FETCH_PROXY` 来处理请求 URL,注意代码要放到调用 `Booru.search` 之前。 + +```js +// 替换成你自己的 CORS 代理 +globalThis.BOORU_FETCH_PROXY = u => `https://cors.example.com/${u}` +``` + +- 或者可以按如下代码 hack 一下,注意这段代码要放到引用 `@himeka/booru` 之前。 + +下面例子的 CORS 代理需要支持 `https://cors.example.com/https://konachan.net/post.json` 形式的调用。 ```js const _fetch = window.fetch const proxy = 'https://cors.example.com/' // 替换成你自己的 CORS 代理 window.fetch = (input, init) => { let url = input.toString() - if (url.startsWith('https')) { - url = proxy + url + if (url.startsWith('https')) { // 自行处理条件 + url = proxy + url // 自行处理为代理所需要的格式 } return _fetch(url, init) } diff --git a/src/Constants.ts b/src/Constants.ts index 3d2511a..deb681b 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -69,6 +69,8 @@ function expandTags(tags: string[]): string[] { }) } +declare const BOORU_FETCH_PROXY: (uri: string) => string + /** * Create a full uri to search with * @@ -92,7 +94,7 @@ export function searchURI( const q = credentials.query credentialsQuery = q.startsWith('&') ? q : '&' + q } - return ( + let uri = ( `http${site.insecure ? '' : 's'}://` + `${site.domain}${site.api.search}` + `${site.tagQuery}=${expandTags(tags).join(site.tagJoin)}` + @@ -100,6 +102,10 @@ export function searchURI( `&${site.paginate}=${page}` + `${credentialsQuery}` ) + if (typeof BOORU_FETCH_PROXY === 'function') { + uri = BOORU_FETCH_PROXY(uri) || uri + } + return uri } /** @@ -111,6 +117,6 @@ export function searchURI( export const defaultOptions: RequestInit = { headers: { Accept: 'application/json, application/xml;q=0.9, */*;q=0.8', - 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.52', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0', }, } diff --git a/src/boorus/Booru.ts b/src/boorus/Booru.ts index 720b218..0cadceb 100644 --- a/src/boorus/Booru.ts +++ b/src/boorus/Booru.ts @@ -79,6 +79,14 @@ export class Booru { this.credentials = credentials } + protected normalizeTags(tags: string | string[]): string[] { + if (!Array.isArray(tags)) { + return [tags] + } else { + return tags.slice(); + } + } + /** * Search for images on this booru * @param {String|String[]} tags The tag(s) to search for @@ -96,9 +104,10 @@ export class Booru { }: SearchParameters = {}, ): Promise { const fakeLimit: number = random && !this.site.random ? 100 : 0 + const tagArray = this.normalizeTags(tags) try { - const searchResult = await this.doSearchRequest(tags, { + const searchResult = await this.doSearchRequest(tagArray, { limit, random, page, @@ -107,7 +116,7 @@ export class Booru { }) return this.parseSearchResult(searchResult, { fakeLimit, - tags, + tags: tagArray, limit, random, page, @@ -142,12 +151,12 @@ export class Booru { * The internal & common searching logic, pls dont use this use .search instead * * @protected - * @param {String[]|String} tags The tags to search with + * @param {String[]} tags The tags to search with * @param {InternalSearchParameters} searchArgs The arguments for the search * @return {Promise} */ protected async doSearchRequest( - tags: string[] | string, + tags: string[], { uri = null, limit = 1, @@ -156,7 +165,6 @@ export class Booru { credentials }: InternalSearchParameters = {}, ): Promise { - if (!Array.isArray(tags)) tags = [tags] // Used for random on sites without order:random let fakeLimit: number | undefined @@ -294,10 +302,6 @@ export class Booru { tags = [] } - if (!Array.isArray(tags)) { - tags = [tags] - } - if (!showUnavailable) { posts = posts.filter((p) => p.available) } diff --git a/src/boorus/Derpibooru.ts b/src/boorus/Derpibooru.ts index f1f7e3c..75b669b 100644 --- a/src/boorus/Derpibooru.ts +++ b/src/boorus/Derpibooru.ts @@ -1,58 +1,56 @@ -/** - * @packageDocumentation - * @module Boorus - */ - -import { BooruError } from '../Constants' -import SearchParameters from '../structures/SearchParameters' -import SearchResults from '../structures/SearchResults' -import Site from '../structures/Site' -import Booru, { BooruCredentials } from './Booru' - -/** - * A class designed for Derpibooru - * >:( - * @private - * @extends Booru - * @inheritDoc - */ -export default class Derpibooru extends Booru { - /** - * Create a new booru for Derpibooru from a site - * @param site The site to use - * @param credentials Credentials for the API (Currently not used) - */ - constructor(site: Site, credentials?: BooruCredentials) { - super(site, credentials) - } - - /** @inheritDoc */ - public override search( - tags: string[] | string, - { limit = 1, random = false, page = 0 }: SearchParameters = {}, - ): Promise { - if (!Array.isArray(tags)) { - tags = [tags] - } - - // For any image, you must supply * - if (tags[0] === undefined) { - tags[0] = '*' - } - - // Derpibooru offsets the pages by 1 - page += 1 - - const uri = - this.getSearchUrl({ tags, limit, page }) + - (random && this.site.random === 'string' ? `&${this.site.random}` : '') + - (this.credentials ? `&key=${this.credentials.token}` : '') - - return super - .doSearchRequest(tags, { limit, random, page, uri }) - .then((r) => - super.parseSearchResult(r, { fakeLimit: 0, tags, limit, random, page }), - ) - .catch((e) => Promise.reject(new BooruError(e))) - } -} +/** + * @packageDocumentation + * @module Boorus + */ + +import { BooruError } from '../Constants' +import SearchParameters from '../structures/SearchParameters' +import SearchResults from '../structures/SearchResults' +import Site from '../structures/Site' +import Booru, { BooruCredentials } from './Booru' + +/** + * A class designed for Derpibooru + * >:( + * @private + * @extends Booru + * @inheritDoc + */ +export default class Derpibooru extends Booru { + /** + * Create a new booru for Derpibooru from a site + * @param site The site to use + * @param credentials Credentials for the API (Currently not used) + */ + constructor(site: Site, credentials?: BooruCredentials) { + super(site, credentials) + } + + /** @inheritDoc */ + public override search( + tags: string[] | string, + { limit = 1, random = false, page = 0 }: SearchParameters = {}, + ): Promise { + const tagArray = this.normalizeTags(tags) + + // For any image, you must supply * + if (tags[0] === undefined) { + tagArray [0] = '*' + } + + // Derpibooru offsets the pages by 1 + page += 1 + + const uri = + this.getSearchUrl({ tags: tagArray, limit, page }) + + (random && this.site.random === 'string' ? `&${this.site.random}` : '') + + (this.credentials ? `&key=${this.credentials.token}` : '') + + return super + .doSearchRequest(tagArray, { limit, random, page, uri }) + .then((r) => + super.parseSearchResult(r, { fakeLimit: 0, tags: tagArray, limit, random, page }), + ) + .catch((e) => Promise.reject(new BooruError(e))) + } +} diff --git a/src/sites.json b/src/sites.json index 3d91fa2..6fe7457 100644 --- a/src/sites.json +++ b/src/sites.json @@ -195,7 +195,7 @@ ], "nsfw": true, "api": { - "search": "/api/danbooru/find_posts/index.xml?", + "search": "/api/danbooru/find_posts?", "postView": "/post/view/" }, "random": false diff --git a/src/structures/InternalSearchParameters.ts b/src/structures/InternalSearchParameters.ts index 2ac2cf8..a673dd9 100644 --- a/src/structures/InternalSearchParameters.ts +++ b/src/structures/InternalSearchParameters.ts @@ -15,5 +15,5 @@ export default interface InternalSearchParameters extends SearchParameters { /** If `order:random` should be faked */ fakeLimit?: number /** The tags used in the search */ - tags?: string[] | string + tags?: string[] } diff --git a/yarn.lock b/yarn.lock index 354a24e..1a5b8ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -297,14 +297,17 @@ resolved "https://registry.npmmirror.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@es-joy/jsdoccomment@~0.36.0": - version "0.36.0" - resolved "https://registry.npmmirror.com/@es-joy/jsdoccomment/-/jsdoccomment-0.36.0.tgz#e3898aad334281a10ceb3c0ec406297a79f2b043" - integrity sha512-u0XZyvUF6Urb2cSivSXA8qXIpT/CxkHcdtZKoWusAzgzmsTWpg0F2FpWXsolHmMUyVY3dLWaoy+0ccJ5uf2QjA== - dependencies: - comment-parser "1.3.1" - esquery "^1.4.0" - jsdoc-type-pratt-parser "~3.1.0" +"@es-joy/jsdoccomment@~0.43.1": + version "0.43.1" + resolved "https://registry.npmmirror.com/@es-joy/jsdoccomment/-/jsdoccomment-0.43.1.tgz#4b1979b7b4ff8b596fb19a3aa696a438e44608d7" + integrity sha512-I238eDtOolvCuvtxrnqtlBaw0BwdQuYqK7eA6XIonicMdOOOb75mqdIzkGDUbS04+1Di007rgm9snFRNeVrOog== + dependencies: + "@types/eslint" "^8.56.5" + "@types/estree" "^1.0.5" + "@typescript-eslint/types" "^7.2.0" + comment-parser "1.4.1" + esquery "^1.5.0" + jsdoc-type-pratt-parser "~4.0.0" "@esbuild/android-arm@0.15.13": version "0.15.13" @@ -671,6 +674,19 @@ dependencies: "@babel/types" "^7.3.0" +"@types/eslint@^8.56.5": + version "8.56.10" + resolved "https://registry.npmmirror.com/@types/eslint/-/eslint-8.56.10.tgz#eb2370a73bf04a901eeba8f22595c7ee0f7eb58d" + integrity sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*", "@types/estree@^1.0.5": + version "1.0.5" + resolved "https://registry.npmmirror.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== + "@types/graceful-fs@^4.1.3": version "4.1.5" resolved "https://registry.npmmirror.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" @@ -705,6 +721,11 @@ expect "^29.0.0" pretty-format "^29.0.0" +"@types/json-schema@*": + version "7.0.15" + resolved "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + "@types/json-schema@^7.0.9": version "7.0.11" resolved "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" @@ -808,6 +829,11 @@ resolved "https://registry.npmmirror.com/@typescript-eslint/types/-/types-5.42.1.tgz#0d4283c30e9b70d2aa2391c36294413de9106df2" integrity sha512-Qrco9dsFF5lhalz+lLFtxs3ui1/YfC6NdXu+RAGBa8uSfn01cjO7ssCsjIsUs484vny9Xm699FSKwpkCcqwWwA== +"@typescript-eslint/types@^7.2.0": + version "7.12.0" + resolved "https://registry.npmmirror.com/@typescript-eslint/types/-/types-7.12.0.tgz#bf208f971a8da1e7524a5d9ae2b5f15192a37981" + integrity sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg== + "@typescript-eslint/typescript-estree@5.42.1": version "5.42.1" resolved "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.1.tgz#f9a223ecb547a781d37e07a5ac6ba9ff681eaef0" @@ -912,6 +938,11 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +are-docs-informative@^0.0.2: + version "0.0.2" + resolved "https://registry.npmmirror.com/are-docs-informative/-/are-docs-informative-0.0.2.tgz#387f0e93f5d45280373d387a59d34c96db321963" + integrity sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1209,10 +1240,10 @@ commander@^4.0.0: resolved "https://registry.npmmirror.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== -comment-parser@1.3.1: - version "1.3.1" - resolved "https://registry.npmmirror.com/comment-parser/-/comment-parser-1.3.1.tgz#3d7ea3adaf9345594aedee6563f422348f165c1b" - integrity sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA== +comment-parser@1.4.1: + version "1.4.1" + resolved "https://registry.npmmirror.com/comment-parser/-/comment-parser-1.4.1.tgz#bdafead37961ac079be11eb7ec65c4d021eaf9cc" + integrity sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg== concat-map@0.0.1: version "0.0.1" @@ -1580,18 +1611,19 @@ eslint-plugin-import@2.26.0: resolve "^1.22.0" tsconfig-paths "^3.14.1" -eslint-plugin-jsdoc@39.6.2: - version "39.6.2" - resolved "https://registry.npmmirror.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-39.6.2.tgz#dcc86cec7cce47aa1a646e38debd5bdf76f63742" - integrity sha512-dvgY/W7eUFoAIIiaWHERIMI61ZWqcz9YFjEeyTzdPlrZc3TY/3aZm5aB91NUoTLWYZmO/vFlYSuQi15tF7uE5A== +eslint-plugin-jsdoc@48.2.9: + version "48.2.9" + resolved "https://registry.npmmirror.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.9.tgz#dd5e293bc584c94e24f0b2bc4a953252b3f96d70" + integrity sha512-ErpKyr2mEUEkcdZ4nwW/cvDjClvAcvJMEXkGGll0wf8sro8h6qeQ3qlZyp1vM1dRk8Ap6rMdke8FnP94QBIaVQ== dependencies: - "@es-joy/jsdoccomment" "~0.36.0" - comment-parser "1.3.1" + "@es-joy/jsdoccomment" "~0.43.1" + are-docs-informative "^0.0.2" + comment-parser "1.4.1" debug "^4.3.4" escape-string-regexp "^4.0.0" - esquery "^1.4.0" - semver "^7.3.8" - spdx-expression-parse "^3.0.1" + esquery "^1.5.0" + semver "^7.6.2" + spdx-expression-parse "^4.0.0" eslint-scope@^5.1.1: version "5.1.1" @@ -1692,6 +1724,13 @@ esquery@^1.4.0: dependencies: estraverse "^5.1.0" +esquery@^1.5.0: + version "1.5.0" + resolved "https://registry.npmmirror.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== + dependencies: + estraverse "^5.1.0" + esrecurse@^4.3.0: version "4.3.0" resolved "https://registry.npmmirror.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" @@ -1786,10 +1825,10 @@ fast-levenshtein@^2.0.6: resolved "https://registry.npmmirror.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== -fast-xml-parser@4.0.11: - version "4.0.11" - resolved "https://registry.npmmirror.com/fast-xml-parser/-/fast-xml-parser-4.0.11.tgz#42332a9aca544520631c8919e6ea871c0185a985" - integrity sha512-4aUg3aNRR/WjQAcpceODG1C3x3lFANXRo8+1biqfieHmg9pyMt7qB4lQV/Ta6sJCTbA5vfD8fnA8S54JATiFUA== +fast-xml-parser@4.4.0: + version "4.4.0" + resolved "https://registry.npmmirror.com/fast-xml-parser/-/fast-xml-parser-4.4.0.tgz#341cc98de71e9ba9e651a67f41f1752d1441a501" + integrity sha512-kLY3jFlwIYwBNDojclKsNAC12sfD6NwW74QB2CoNGPvtVxjliYehVunB3HYyNi+n4Tt1dAcgwYvmKF/Z18flqg== dependencies: strnum "^1.0.5" @@ -2684,10 +2723,10 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -jsdoc-type-pratt-parser@~3.1.0: - version "3.1.0" - resolved "https://registry.npmmirror.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-3.1.0.tgz#a4a56bdc6e82e5865ffd9febc5b1a227ff28e67e" - integrity sha512-MgtD0ZiCDk9B+eI73BextfRrVQl0oyzRG8B2BjORts6jbunj4ScKPcyXGTbB6eXL4y9TzxCm6hyeLq/2ASzNdw== +jsdoc-type-pratt-parser@~4.0.0: + version "4.0.0" + resolved "https://registry.npmmirror.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz#136f0571a99c184d84ec84662c45c29ceff71114" + integrity sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ== jsesc@^2.5.1: version "2.5.2" @@ -3227,7 +3266,7 @@ safe-regex-test@^1.0.0: get-intrinsic "^1.1.3" is-regex "^1.1.4" -semver@7.3.8, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8: +semver@7.3.8, semver@^7.3.5, semver@^7.3.7: version "7.3.8" resolved "https://registry.npmmirror.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== @@ -3239,6 +3278,11 @@ semver@^6.0.0, semver@^6.3.0: resolved "https://registry.npmmirror.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.6.2: + version "7.6.2" + resolved "https://registry.npmmirror.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" + integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -3300,10 +3344,10 @@ spdx-exceptions@^2.1.0: resolved "https://registry.npmmirror.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== -spdx-expression-parse@^3.0.1: - version "3.0.1" - resolved "https://registry.npmmirror.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== +spdx-expression-parse@^4.0.0: + version "4.0.0" + resolved "https://registry.npmmirror.com/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz#a23af9f3132115465dac215c099303e4ceac5794" + integrity sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ== dependencies: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0"