├── .eslintrc.yml ├── .gitattributes ├── .github ├── CONTRIBUTING.md ├── atlanna.yml └── workflows │ ├── nodejs.yml │ └── npm-publish.yml ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── docs ├── .nojekyll ├── assets │ ├── highlight.css │ ├── main.js │ ├── navigation.js │ ├── search.js │ └── style.css ├── classes │ └── Pokedex.html ├── index.html ├── interfaces │ ├── EvolutionStone.html │ ├── EvolutionStoneList.html │ ├── PokedexOptions.html │ ├── Pokemon.html │ └── PokemonList.html └── modules.html ├── package.json ├── src └── pokedex.ts └── tsconfig.json /.eslintrc.yml: -------------------------------------------------------------------------------- 1 | env: 2 | es6: true 3 | node: true 4 | extends: 5 | - 'eslint:recommended' 6 | - 'plugin:@typescript-eslint/eslint-recommended' 7 | - 'plugin:@typescript-eslint/recommended' 8 | globals: 9 | Atomics: readonly 10 | SharedArrayBuffer: readonly 11 | parser: '@typescript-eslint/parser' 12 | parserOptions: 13 | ecmaVersion: 2022 14 | sourceType: module 15 | plugins: 16 | - '@typescript-eslint' 17 | rules: 18 | indent: 19 | - error 20 | - 4 21 | linebreak-style: 22 | - error 23 | - unix 24 | quotes: 25 | - error 26 | - double 27 | semi: 28 | - error 29 | - always 30 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | 3 | *.bat text eol=crlf 4 | *.cmd text eol=crlf 5 | *.ps1 text eol=crlf 6 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Make sure that you have [Git](https://git-scm.com/ 'Git Website') and [Node.js](https://nodejs.org 'Node.js Website') installed. 4 | 5 | 1. Fork and clone the repository. 6 | 1. Install dependencies 7 | ```bash 8 | npm install 9 | ``` 10 | 1. Do you magic code stuffs! 11 | 1. Run the tests and transpile the code. 12 | ```bash 13 | npm test && npm run build 14 | ``` 15 | If you get any errors, fix it. 16 | 1. [Submit a pull request](https://github.com/PokeDevs/node-pokedex-api/compare) 17 | 18 | *Thank you for improving the Project.* 19 | -------------------------------------------------------------------------------- /.github/atlanna.yml: -------------------------------------------------------------------------------- 1 | # Auto Responses 2 | 3 | # Auto response when a new issue is opened. 4 | issueOpenedResponse: | 5 | Thank you for opening this issue. 6 | A maintainer will get by as soon as practical to address this issue. 7 | 8 | # Auto response when an issue is closed. 9 | issueClosedResponse: | 10 | If you think this was a mistake, feel free to reopen this isssue. 11 | 12 | # Auto response when someone opens an issue for the first time. 13 | firstIssueOpenedResponse: | 14 | Thank you for opening this issue. 15 | A maintainer will get by as soon as practical to address this issue. 16 | 17 | Since this is your first time here, please check the contributing guidelines to see other ways you can get involved. 18 | 19 | # Auto response when a new pull request is opened. 20 | pullRequestOpenedResponse: | 21 | Thank you for opening this pull request. 22 | A maintainer will get by as soon as practical to review the changes. 23 | 24 | # Auto response when a pull request is merged. 25 | pullRequestMergedResponse: | 26 | Thank you for your contribution. 27 | 28 | # Auto response when a pull request is closed. 29 | pullRequestClosedResponse: | 30 | If you think this was a mistake, feel free to reopen this pull request. 31 | 32 | # Auto response when someone opens a pull request for the first time. 33 | firstPullRequestOpenedResponse: | 34 | Thank you for opening this issue. 35 | A maintainer will get by as soon as practical to review the changes. 36 | 37 | Since this is your first time here, please check the contributing guidelines to make sure you're doing it right. 38 | 39 | # Auto response when someone's pull request is merged for the first time. 40 | firstPullRequestMergedResponse: | 41 | Thank you for your contribution. 42 | We hope to see more contributions from you. 43 | 44 | 45 | # Invite contributors to the organization after their pull requeust is merged. 46 | inviteContributors: false 47 | 48 | 49 | # Create a status check to show pull requests as "Pending" if it's a work-in-progress. 50 | workInProgressCheck: true 51 | -------------------------------------------------------------------------------- /.github/workflows/nodejs.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and build the code on push or pull request events but only for the main branch 2 | 3 | name: Node.js 4 | 5 | on: 6 | push: 7 | branches: [ main ] 8 | pull_request: 9 | branches: [ main ] 10 | 11 | jobs: 12 | test: 13 | name: Test 14 | runs-on: ubuntu-latest 15 | 16 | strategy: 17 | matrix: 18 | node-version: [ 18.x ] 19 | 20 | steps: 21 | - name: Checkout 22 | uses: actions/checkout@v3 23 | 24 | - name: Use Node.js ${{ matrix.node-version }} 25 | uses: actions/setup-node@v3 26 | with: 27 | node-version: ${{ matrix.node-version }} 28 | 29 | - name: Dependencies 30 | run: npm install 31 | 32 | - name: Test 33 | run: npm test 34 | env: 35 | CI: true 36 | 37 | - name: Build 38 | run: npm run build 39 | -------------------------------------------------------------------------------- /.github/workflows/npm-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will run tests using node and then publish a package to npm when a release is created 2 | 3 | name: Node.js Package 4 | 5 | on: 6 | release: 7 | types: [ created ] 8 | 9 | jobs: 10 | release: 11 | name: Release 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v3 17 | 18 | - name: Setup Node.js 19 | uses: actions/setup-node@v3 20 | with: 21 | node-version: 18 22 | registry-url: https://registry.npmjs.org/ 23 | 24 | - name: Dependencies 25 | run: npm install 26 | 27 | - name: Test 28 | run: npm test 29 | env: 30 | CI: true 31 | 32 | - name: Build 33 | run: npm run build 34 | 35 | - name: Publish 36 | run: npm publish 37 | env: 38 | NODE_AUTH_TOKEN: ${{ secrets.npm_token }} 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Linux ### 2 | *~ 3 | 4 | # temporary files which can be created if a process still has a handle open of a deleted file 5 | .fuse_hidden* 6 | 7 | # KDE directory preferences 8 | .directory 9 | 10 | # Linux trash folder which might appear on any partition or disk 11 | .Trash-* 12 | 13 | # .nfs files are created when an open file is removed but is still being accessed 14 | .nfs* 15 | 16 | ### macOS ### 17 | *.DS_Store 18 | .AppleDouble 19 | .LSOverride 20 | 21 | # Icon must end with two \r 22 | Icon 23 | 24 | # Thumbnails 25 | ._* 26 | 27 | # Files that might appear in the root of a volume 28 | .DocumentRevisions-V100 29 | .fseventsd 30 | .Spotlight-V100 31 | .TemporaryItems 32 | .Trashes 33 | .VolumeIcon.icns 34 | .com.apple.timemachine.donotpresent 35 | 36 | # Directories potentially created on remote AFP share 37 | .AppleDB 38 | .AppleDesktop 39 | Network Trash Folder 40 | Temporary Items 41 | .apdisk 42 | 43 | ### Node ### 44 | # Logs 45 | logs 46 | *.log 47 | npm-debug.log* 48 | yarn-debug.log* 49 | yarn-error.log* 50 | 51 | # Runtime data 52 | pids 53 | *.pid 54 | *.seed 55 | *.pid.lock 56 | 57 | # Directory for instrumented libs generated by jscoverage/JSCover 58 | lib-cov 59 | 60 | # Coverage directory used by tools like istanbul 61 | coverage 62 | 63 | # nyc test coverage 64 | .nyc_output 65 | 66 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 67 | .grunt 68 | 69 | # Bower dependency directory (https://bower.io/) 70 | bower_components 71 | 72 | # node-waf configuration 73 | .lock-wscript 74 | 75 | # Compiled binary addons (http://nodejs.org/api/addons.html) 76 | build/Release 77 | 78 | # Dependency directories 79 | node_modules/ 80 | jspm_packages/ 81 | 82 | # Typescript files 83 | /dist 84 | /typings 85 | 86 | # Optional npm cache directory 87 | .npm 88 | 89 | # Optional eslint cache 90 | .eslintcache 91 | 92 | # Optional REPL history 93 | .node_repl_history 94 | 95 | # Output of 'npm pack' 96 | *.tgz 97 | 98 | # Yarn Integrity file 99 | .yarn-integrity 100 | 101 | # dotenv environment variables file 102 | .env 103 | 104 | 105 | ### Windows ### 106 | # Windows thumbnail cache files 107 | Thumbs.db 108 | ehthumbs.db 109 | ehthumbs_vista.db 110 | 111 | # Folder config file 112 | Desktop.ini 113 | 114 | # Recycle Bin used on file shares 115 | $RECYCLE.BIN/ 116 | 117 | # Windows Installer files 118 | *.cab 119 | *.msi 120 | *.msm 121 | *.msp 122 | 123 | # Windows shortcuts 124 | *.lnk 125 | 126 | # Lock files 127 | package-lock.json 128 | yarn.lock 129 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /.github 2 | /src 3 | /.eslintignore 4 | /.eslintrc.yml 5 | /makefile 6 | /tsconfig.json 7 | /package-lock.json 8 | /yarn-error.log 9 | /yarn.lock 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 TRACTION 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pokédex API Library Wrapper 2 | A wrapper library for the [Pokédex API](https://pokedevs.gitbook.io). 3 | 4 | ## Installation 5 | This is a [Node.js](https://nodejs.org/en) module available through the 6 | [npm registry](https://www.npmjs.com/). 7 | 8 | Before installing, [download and install Node.js](https://nodejs.org/en/download/). 9 | We recommend installing the latest LTS version of Node.js. 10 | 11 | Installation is done using the [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): 12 | 13 | ```bash 14 | npm install pokedex-api 15 | ``` 16 | 17 | ## Get Started 18 | Read the [Wiki](https://github.com/PokeDevs/node-pokedex-api/wiki) to see the available classes and methods (with examples) and know 19 | how to use them. 20 | 21 | ## Pokédex API 22 | * [Official Website and Documentation](https://pokedevs.gitbook.io) 23 | * [GitHub Organization](https://github.com/PokeDevs) for other libraries 24 | * [Discord](https://discord.gg/Z8txJ6a) for discussion 25 | 26 | ## Contributors 27 | The developer of the [Pokédex API](https://pokedevs.gitbook.io) and this 28 | wrapper library is [@iamtraction](https://github.com/iamtraction). 29 | 30 | [List of all contributors](https://github.com/PokeDevs/node-pokedex-api/graphs/contributors) 31 | 32 | ## Donate 33 | If want to support the development of this project to keep this alive forever, 34 | you can send donations to the developers. 35 | Your donations will ensure the development of this project and I'll make sure 36 | this project stays active forever. You can [donate via PayPal](https://paypal.me/snkrsnkampa). 37 | 38 | ## License 39 | 40 | [MIT](https://github.com/PokeDevs/node-pokedex-api/blob/master/LICENSE) 41 | 42 | > If you liked this project you can **⭐ Star** it on 43 | > [GitHub](https://github.com/PokeDevs/node-pokdex-api). 44 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. -------------------------------------------------------------------------------- /docs/assets/highlight.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --light-hl-0: #795E26; 3 | --dark-hl-0: #DCDCAA; 4 | --light-hl-1: #000000; 5 | --dark-hl-1: #D4D4D4; 6 | --light-hl-2: #A31515; 7 | --dark-hl-2: #CE9178; 8 | --light-code-background: #FFFFFF; 9 | --dark-code-background: #1E1E1E; 10 | } 11 | 12 | @media (prefers-color-scheme: light) { :root { 13 | --hl-0: var(--light-hl-0); 14 | --hl-1: var(--light-hl-1); 15 | --hl-2: var(--light-hl-2); 16 | --code-background: var(--light-code-background); 17 | } } 18 | 19 | @media (prefers-color-scheme: dark) { :root { 20 | --hl-0: var(--dark-hl-0); 21 | --hl-1: var(--dark-hl-1); 22 | --hl-2: var(--dark-hl-2); 23 | --code-background: var(--dark-code-background); 24 | } } 25 | 26 | :root[data-theme='light'] { 27 | --hl-0: var(--light-hl-0); 28 | --hl-1: var(--light-hl-1); 29 | --hl-2: var(--light-hl-2); 30 | --code-background: var(--light-code-background); 31 | } 32 | 33 | :root[data-theme='dark'] { 34 | --hl-0: var(--dark-hl-0); 35 | --hl-1: var(--dark-hl-1); 36 | --hl-2: var(--dark-hl-2); 37 | --code-background: var(--dark-code-background); 38 | } 39 | 40 | .hl-0 { color: var(--hl-0); } 41 | .hl-1 { color: var(--hl-1); } 42 | .hl-2 { color: var(--hl-2); } 43 | pre, code { background: var(--code-background); } 44 | -------------------------------------------------------------------------------- /docs/assets/main.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | "use strict";(()=>{var Pe=Object.create;var ne=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Ie(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Pe(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. 3 | `,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),v=s.str.charAt(1),f;v in s.node.edges?f=s.node.edges[v]:(f=new t.TokenSet,s.node.edges[v]=f),s.str.length==1&&(f.final=!0),i.push({node:f,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){re.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(n&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{le(e,t)}),le(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ne(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ve(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s=i?r.index.search(`*${i}*`):[];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=` 4 | ${ce(l.parent,i)}.${d}`);let v=document.createElement("li");v.classList.value=l.classes??"";let f=document.createElement("a");f.href=r.base+l.url,f.innerHTML=u+d,v.append(f),e.appendChild(v)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ve(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),e.blur()}}function ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var C=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",pe="mousemove",B="mouseup",J={x:0,y:0},fe=!1,ee=!1,He=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(He=!0,F="touchstart",pe="touchmove",B="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(pe,t=>{if(ee&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(B,()=>{ee=!1});document.addEventListener("click",t=>{fe&&(t.preventDefault(),t.stopImmediatePropagation(),fe=!1)});var X=class extends C{constructor(n){super(n);this.className=this.el.dataset.toggle||"",this.el.addEventListener(B,r=>this.onPointerUp(r)),this.el.addEventListener("click",r=>r.preventDefault()),document.addEventListener(F,r=>this.onDocumentPointerDown(r)),document.addEventListener(B,r=>this.onDocumentPointerUp(r))}setActive(n){if(this.active==n)return;this.active=n,document.documentElement.classList.toggle("has-"+this.className,n),this.el.classList.toggle("active",n);let r=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(r),setTimeout(()=>document.documentElement.classList.remove(r),500)}onPointerUp(n){D||(this.setActive(!0),n.preventDefault())}onDocumentPointerDown(n){if(this.active){if(n.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(n){if(!D&&this.active&&n.target.closest(".col-sidebar")){let r=n.target.closest("a");if(r){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),r.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ve=document.head.appendChild(document.createElement("style"));ve.dataset.for="filters";var Y=class extends C{constructor(n){super(n);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ve.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } 5 | `}fromLocalStorage(){let n=Q.getItem(this.key);return n?n==="true":this.el.checked}setLocalStorage(n){Q.setItem(this.key,n.toString()),this.value=n,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(n=>{n.style.display="block";let r=Array.from(n.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);n.style.display=r?"none":"block"})}};var Z=class extends C{constructor(n){super(n);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let r=Q.getItem(this.key);this.el.open=r?r==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let i=this.summary.querySelector("a");i&&i.addEventListener("click",()=>{location.assign(i.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.ensureActivePageVisible()}function we(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.href===r.href&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); 6 | /*! Bundled license information: 7 | 8 | lunr/lunr.js: 9 | (** 10 | * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 11 | * Copyright (C) 2020 Oliver Nightingale 12 | * @license MIT 13 | *) 14 | (*! 15 | * lunr.utils 16 | * Copyright (C) 2020 Oliver Nightingale 17 | *) 18 | (*! 19 | * lunr.Set 20 | * Copyright (C) 2020 Oliver Nightingale 21 | *) 22 | (*! 23 | * lunr.tokenizer 24 | * Copyright (C) 2020 Oliver Nightingale 25 | *) 26 | (*! 27 | * lunr.Pipeline 28 | * Copyright (C) 2020 Oliver Nightingale 29 | *) 30 | (*! 31 | * lunr.Vector 32 | * Copyright (C) 2020 Oliver Nightingale 33 | *) 34 | (*! 35 | * lunr.stemmer 36 | * Copyright (C) 2020 Oliver Nightingale 37 | * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt 38 | *) 39 | (*! 40 | * lunr.stopWordFilter 41 | * Copyright (C) 2020 Oliver Nightingale 42 | *) 43 | (*! 44 | * lunr.trimmer 45 | * Copyright (C) 2020 Oliver Nightingale 46 | *) 47 | (*! 48 | * lunr.TokenSet 49 | * Copyright (C) 2020 Oliver Nightingale 50 | *) 51 | (*! 52 | * lunr.Index 53 | * Copyright (C) 2020 Oliver Nightingale 54 | *) 55 | (*! 56 | * lunr.Builder 57 | * Copyright (C) 2020 Oliver Nightingale 58 | *) 59 | */ 60 | -------------------------------------------------------------------------------- /docs/assets/navigation.js: -------------------------------------------------------------------------------- 1 | window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACouuVipJrShRslIKyM9OTUmtUNJRKkgsyQAKJOckFhenFutDJfQySnJzgLLZmXkpSlaGRha1OnC9rmX5OaUlmfl5wSX5eakIIzLzSlKL0hKTgaagKkE1zMjUDKdhPpnFJUQYCFKGz1CoJ/wLQDqKsRqIqoSQYbn5eThNAcoRoR2nz5DkMY2JBQBfr9STsgEAAA==" -------------------------------------------------------------------------------- /docs/assets/search.js: -------------------------------------------------------------------------------- 1 | window.searchData = "data:application/octet-stream;base64,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"; -------------------------------------------------------------------------------- /docs/classes/Pokedex.html: -------------------------------------------------------------------------------- 1 | Pokedex | pokedex-api
2 |
3 | 10 |
11 |
12 |
13 |
14 | 17 |

Class Pokedex

18 |
19 |

Hierarchy

20 |
    21 |
  • Pokedex
24 |
25 |
26 |
27 | 28 |
29 |
30 |

Constructors

31 |
33 |
34 |

Properties

35 |
authorization 36 | url 37 | useragent 38 |
39 |
40 |

Methods

41 |
47 |
48 |

Constructors

49 |
50 | 51 |
62 |
63 |

Properties

64 |
65 | 66 |
authorization: string
69 |
70 | 71 |
url: string
74 |
75 | 76 |
useragent: string
79 |
80 |

Methods

81 |
82 | 83 |
    84 | 85 |
  • 86 |

    Get the details of the specified evolution stone.

    87 |
    88 |
    89 |

    Parameters

    90 |
      91 |
    • 92 |
      name: string
    93 |

    Returns Promise<EvolutionStone>

    94 |
97 |
98 | 99 |
    100 | 101 |
  • 102 |

    Get the details of the specified Pokémon and its forms.

    103 |
    104 |
    105 |

    Parameters

    106 |
      107 |
    • 108 |
      slug: string | number
    109 |

    Returns Promise<Pokemon[]>

    110 |
113 |
114 | 115 |
124 |
125 | 126 |
    127 | 128 |
  • 129 |

    Get a list of all the discovered Pokémon.

    130 |
    131 |

    Returns Promise<PokemonList>

    132 |
135 |
136 | 137 |
    138 | 139 |
  • 140 |
    141 |

    Type Parameters

    142 |
      143 |
    • 144 |

      R

    145 |
    146 |

    Parameters

    147 |
      148 |
    • 149 |
      path: string = "/"
    150 |

    Returns Promise<R>

153 |
154 | 181 |
190 |
191 |

Generated using TypeDoc

192 |
-------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | pokedex-api
2 |
3 | 10 |
11 |
12 |
13 |
14 |

pokedex-api

15 |

Pokédex API Library Wrapper

A wrapper library for the Pokédex API.

16 |

Installation

This is a Node.js module available through the 17 | npm registry.

18 |

Before installing, download and install Node.js. 19 | We recommend installing the latest LTS version of Node.js.

20 |

Installation is done using the npm install command:

21 |
npm install pokedex-api
22 | 
23 |

Get Started

Read the Wiki to see the available classes and methods (with examples) and know 24 | how to use them.

25 |

Pokédex API

30 |

Contributors

The developer of the Pokédex API and this 31 | wrapper library is @iamtraction.

32 |

List of all contributors

33 |

Donate

If want to support the development of this project to keep this alive forever, 34 | you can send donations to the developers. 35 | Your donations will ensure the development of this project and I'll make sure 36 | this project stays active forever. You can donate via PayPal.

37 |

License

MIT

38 |
39 |

If you liked this project you can ⭐ Star it on 40 | GitHub.

41 |
42 |
43 |
44 | 73 |
82 |
83 |

Generated using TypeDoc

84 |
-------------------------------------------------------------------------------- /docs/interfaces/EvolutionStone.html: -------------------------------------------------------------------------------- 1 | EvolutionStone | pokedex-api
2 |
3 | 10 |
11 |
12 |
13 |
14 | 17 |

Interface EvolutionStone

18 |
19 |

Hierarchy

20 |
    21 |
  • EvolutionStone
24 |
25 |
26 |
27 | 28 |
29 |
30 |

Properties

31 |
aka 32 | effects 33 | name 34 | slug 35 | sprite 36 |
37 |
38 |

Properties

39 |
40 | 41 |
aka: string
44 |
45 | 46 |
effects: string[]
49 |
50 | 51 |
name: string
54 |
55 | 56 |
slug: string
59 |
60 | 61 |
sprite: string
64 |
65 | 88 |
97 |
98 |

Generated using TypeDoc

99 |
-------------------------------------------------------------------------------- /docs/interfaces/EvolutionStoneList.html: -------------------------------------------------------------------------------- 1 | EvolutionStoneList | pokedex-api
2 |
3 | 10 |
11 |
12 |
13 |
14 | 17 |

Interface EvolutionStoneList

18 |
19 |

Hierarchy

20 |
    21 |
  • EvolutionStoneList
22 |
23 |

Indexable

24 |
[name: string]: string
27 |
28 | 42 |
51 |
52 |

Generated using TypeDoc

53 |
-------------------------------------------------------------------------------- /docs/interfaces/PokedexOptions.html: -------------------------------------------------------------------------------- 1 | PokedexOptions | pokedex-api
2 |
3 | 10 |
11 |
12 |
13 |
14 | 17 |

Interface PokedexOptions

18 |
19 |

Hierarchy

20 |
    21 |
  • PokedexOptions
24 |
25 |
26 |
27 | 28 |
29 |
30 |

Properties

31 |
34 |
35 |

Properties

36 |
37 | 38 |
authorization?: string
39 |

The API key for Pokédex API, if you have one.

40 |
41 |
44 |
45 | 46 |
useragent?: string
47 |

A custom User-Agent header used while making request to the Pokédex API.

48 |
49 |
52 |
53 | 73 |
82 |
83 |

Generated using TypeDoc

84 |
-------------------------------------------------------------------------------- /docs/interfaces/PokemonList.html: -------------------------------------------------------------------------------- 1 | PokemonList | pokedex-api
2 |
3 | 10 |
11 |
12 |
13 |
14 | 17 |

Interface PokemonList

18 |
19 |

Hierarchy

20 |
    21 |
  • PokemonList
22 |
23 |

Indexable

24 |
[number: string]: string
27 |
28 | 42 |
51 |
52 |

Generated using TypeDoc

53 |
-------------------------------------------------------------------------------- /docs/modules.html: -------------------------------------------------------------------------------- 1 | pokedex-api
2 |
3 | 10 |
11 |
12 |
13 |
14 |

pokedex-api

15 |
16 |
17 |

Index

18 |
19 |

Classes

20 |
Pokedex 21 |
22 |
23 |

Interfaces

24 |
30 |
31 | 45 |
54 |
55 |

Generated using TypeDoc

56 |
-------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pokedex-api", 3 | "version": "2.0.0", 4 | "description": "Node.js wrapper library for the Pokédex API.", 5 | "type": "module", 6 | "main": "./dist/pokedex.js", 7 | "typings": "./typings/pokedex.d.ts", 8 | "repository": "https://github.com/PokeDevs/node-pokedex-api.git", 9 | "homepage": "https://pokedevs.gitbook.io", 10 | "author": "iamtraction", 11 | "license": "MIT", 12 | "keywords": [ 13 | "pokemon", 14 | "pokedex", 15 | "api", 16 | "database", 17 | "pokeapi", 18 | "pokedb", 19 | "wrapper", 20 | "library" 21 | ], 22 | "scripts": { 23 | "docs": "npx typedoc src/pokedex.ts", 24 | "build": "tsc", 25 | "test": "eslint . --ext .ts" 26 | }, 27 | "devDependencies": { 28 | "@types/node": "^20.6.0", 29 | "@typescript-eslint/eslint-plugin": "^6.7.0", 30 | "@typescript-eslint/parser": "^6.7.0", 31 | "eslint": "^8.49.0", 32 | "typescript": "^5.2.2" 33 | }, 34 | "dependencies": { 35 | "undici": "^5.24.0" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/pokedex.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @author iamtraction 3 | * @license MIT 4 | */ 5 | import { fetch } from "undici"; 6 | 7 | export interface PokedexOptions { 8 | /** The API key for Pokédex API, if you have one. */ 9 | authorization?: string; 10 | /** A custom User-Agent header used while making request to the Pokédex API. */ 11 | useragent?: string; 12 | } 13 | 14 | export interface EvolutionStone { 15 | name: string 16 | aka: string; 17 | slug: string; 18 | effects: string[]; 19 | sprite: string; 20 | } 21 | export interface EvolutionStoneList { 22 | [name: string]: string; 23 | } 24 | export interface Pokemon { 25 | number: number; 26 | name: string; 27 | codename?: string; 28 | gen: number; 29 | species: string; 30 | types: string[], 31 | abilities: { 32 | name: string; 33 | description: string; 34 | hidden: boolean; 35 | }[]; 36 | height: string; 37 | weight: string; 38 | mega: boolean | { 39 | stone: string; 40 | sprite: string; 41 | }; 42 | baseStats: { 43 | hp: number; 44 | attack: number; 45 | defense: number; 46 | spAtk: number; 47 | spDef: number; 48 | speed: number; 49 | }; 50 | training: { 51 | evYield: string; 52 | catchRate: string; 53 | baseFriendship: string; 54 | baseExp: string; 55 | growthRate: string; 56 | }; 57 | breeding: { 58 | gender: string; 59 | eggGroups: string[]; 60 | eggCycles: string; 61 | }; 62 | sprite: string; 63 | } 64 | export interface PokemonList { 65 | [number: string]: string; 66 | } 67 | 68 | export class Pokedex { 69 | private url: string; 70 | private authorization: string; 71 | private useragent: string; 72 | 73 | constructor(options: PokedexOptions = {}) { 74 | this.url = "https://ex.traction.one/pokedex"; 75 | this.authorization = options?.authorization; 76 | this.useragent = options?.useragent || "pokedex.js"; 77 | } 78 | 79 | private request = async (path: string = "/"): Promise => { 80 | const res = await fetch(this.url + path, { 81 | headers: { 82 | "authorization": this.authorization, 83 | "user-agent": this.useragent, 84 | }, 85 | }); 86 | const body = await res.json(); 87 | 88 | if (res.status >= 400 && res.status < 600) { 89 | throw body; 90 | } 91 | 92 | return body as R; 93 | }; 94 | 95 | /** Get the details of the specified evolution stone. */ 96 | public getEvolutionStone = async (name: string): Promise => { 97 | return await this.request("/evolution/stones/" + name); 98 | }; 99 | 100 | /** Get the details of the specified Pokémon and its forms. */ 101 | public getPokemon = async (slug: number | string): Promise => { 102 | return await this.request("/pokemon/" + slug); 103 | }; 104 | 105 | /** Get a list of all the evolution stones. */ 106 | public listEvolutionStones = async (): Promise => { 107 | return await this.request("/evolution/stones"); 108 | }; 109 | 110 | /** Get a list of all the discovered Pokémon. */ 111 | public listPokemon = async (): Promise => { 112 | return await this.request("/pokemon"); 113 | }; 114 | } 115 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": true, 3 | "compilerOptions": { 4 | "alwaysStrict": true, 5 | "declaration": true, 6 | "declarationDir": "typings", 7 | "declarationMap": false, 8 | "esModuleInterop": true, 9 | "module": "Node16", 10 | "noUnusedLocals": true, 11 | "noUnusedParameters": true, 12 | "outDir": "dist", 13 | "removeComments": true, 14 | "resolveJsonModule": true, 15 | "rootDir": "src", 16 | "skipLibCheck": true, 17 | "sourceMap": false, 18 | "strict": false, 19 | "target": "ES2022" 20 | } 21 | } 22 | --------------------------------------------------------------------------------