UNPKG

nodesu

Version:
986 lines (274 loc) 15.5 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: UserComponent</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: UserComponent</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span> <span class="ancestors"><a href="module-Components.html">Components</a>.</span>UserComponent<span class="signature">()</span><span class="type-signature"></span></h2> <div class="class-description">User-related API component</div> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="UserComponent"><span class="type-signature"></span>new UserComponent<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="components_UserComponent.js.html">components/UserComponent.js</a>, <a href="components_UserComponent.js.html#line16">line 16</a> </li></ul></dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>api.user .get('4222959') .then(console.log);</code></pre> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(user, mode<span class="signature-attributes">opt</span>, eventDays<span class="signature-attributes">opt</span>, lookupType<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;(Object|User)>}</span></h4> <div class="description"> Gets general user information. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>user</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> </td> <td class="description last">The username or id to lookup.</td> </tr> <tr> <td class="name"><code>mode</code></td> <td class="type"> <span class="param-type"><a href="global.html#Mode">Mode</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">The gamemode.</td> </tr> <tr> <td class="name"><code>eventDays</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">The max number of event days.</td> </tr> <tr> <td class="name"><code>lookupType</code></td> <td class="type"> <span class="param-type"><a href="global.html#LookupType">LookupType</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">The lookup type, id/string to lookup the user.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="components_UserComponent.js.html">components/UserComponent.js</a>, <a href="components_UserComponent.js.html#line25">line 25</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The object from the API, or User object if parsing is enabled. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;(Object|User)></span> </dd> </dl> <h4 class="name" id="getBest"><span class="type-signature"></span>getBest<span class="signature">(user, mode<span class="signature-attributes">opt</span>, limit<span class="signature-attributes">opt</span>, lookupType<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;(Array.&lt;Object>|Array.&lt;UserScore>)>}</span></h4> <div class="description"> Gets the top scores for the user specified. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>user</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> </td> <td class="description last">The username or id to lookup.</td> </tr> <tr> <td class="name"><code>mode</code></td> <td class="type"> <span class="param-type"><a href="global.html#Mode">Mode</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">The gamemode.</td> </tr> <tr> <td class="name"><code>limit</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Amount of results to limit to.</td> </tr> <tr> <td class="name"><code>lookupType</code></td> <td class="type"> <span class="param-type"><a href="global.html#LookupType">LookupType</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">The lookup type, id/string to lookup the user.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="components_UserComponent.js.html">components/UserComponent.js</a>, <a href="components_UserComponent.js.html#line46">line 46</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The object array from the API, or UserScore object array if parsing is enabled. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;(Array.&lt;Object>|Array.&lt;UserScore>)></span> </dd> </dl> <h4 class="name" id="getRecent"><span class="type-signature"></span>getRecent<span class="signature">(user, mode<span class="signature-attributes">opt</span>, limit<span class="signature-attributes">opt</span>, lookupType<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;(Array.&lt;Object>|Array.&lt;UserScore>)>}</span></h4> <div class="description"> Gets the recent plays for the user specified. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>user</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> </td> <td class="description last">The username or id to lookup.</td> </tr> <tr> <td class="name"><code>mode</code></td> <td class="type"> <span class="param-type"><a href="global.html#Mode">Mode</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">The gamemode.</td> </tr> <tr> <td class="name"><code>limit</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">Amount of results to limit to.</td> </tr> <tr> <td class="name"><code>lookupType</code></td> <td class="type"> <span class="param-type"><a href="global.html#LookupType">LookupType</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">The lookup type, id/string to lookup the user.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="components_UserComponent.js.html">components/UserComponent.js</a>, <a href="components_UserComponent.js.html#line66">line 66</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The object array from the API, or UserScore object array if parsing is enabled. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;(Array.&lt;Object>|Array.&lt;UserScore>)></span> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Components.html">Components</a></li><li><a href="module-CustomClasses.html">CustomClasses</a></li><li><a href="module-Enums.html">Enums</a></li><li><a href="module-Errors.html">Errors</a></li></ul><h3>Classes</h3><ul><li><a href="Client.html">Client</a></li><li><a href="module-Components.BeatmapsComponent.html">BeatmapsComponent</a></li><li><a href="module-Components.MultiComponent.html">MultiComponent</a></li><li><a href="module-Components.ReplayComponent.html">ReplayComponent</a></li><li><a href="module-Components.ScoresComponent.html">ScoresComponent</a></li><li><a href="module-Components.UserComponent.html">UserComponent</a></li><li><a href="module-CustomClasses.Beatmap.html">Beatmap</a></li><li><a href="module-CustomClasses.BeatmapScore.html">BeatmapScore</a></li><li><a href="module-CustomClasses.Multi.html">Multi</a></li><li><a href="module-CustomClasses.MultiGame.html">MultiGame</a></li><li><a href="module-CustomClasses.MultiMatch.html">MultiMatch</a></li><li><a href="module-CustomClasses.MultiScore.html">MultiScore</a></li><li><a href="module-CustomClasses.ReplayData.html">ReplayData</a></li><li><a href="module-CustomClasses.Score.html">Score</a></li><li><a href="module-CustomClasses.User.html">User</a></li><li><a href="module-CustomClasses.UserEvent.html">UserEvent</a></li><li><a href="module-CustomClasses.UserScore.html">UserScore</a></li><li><a href="module-Errors.OsuApiError.html">OsuApiError</a></li><li><a href="Requester.html">Requester</a></li></ul><h3>Global</h3><ul><li><a href="global.html#ApprovalStatus">ApprovalStatus</a></li><li><a href="global.html#Converts">Converts</a></li><li><a href="global.html#Genre">Genre</a></li><li><a href="global.html#Language">Language</a></li><li><a href="global.html#LookupType">LookupType</a></li><li><a href="global.html#Mode">Mode</a></li><li><a href="global.html#Mods">Mods</a></li><li><a href="global.html#MultiScoringType">MultiScoringType</a></li><li><a href="global.html#MultiTeam">MultiTeam</a></li><li><a href="global.html#MultiTeamType">MultiTeamType</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a> on Sat Apr 11 2020 14:41:31 GMT+1000 (GMT+10:00) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>