-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(getskills): add
getSkills
method
- Loading branch information
Showing
10 changed files
with
399 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Local imports | ||
import './models/Skill.js' | ||
import { getEntities } from './api/index.js' | ||
|
||
|
||
|
||
|
||
|
||
/** | ||
* Returns data for held items | ||
* | ||
* @param {Object} [options] An object containing filtering options | ||
* @param {string[]} [options.ids] Array of item IDs to be returned | ||
* @param {string} [options.patch] Maximum patch version to return data for | ||
* | ||
* @returns {Promise<Skill[]>} An array containing data for each item requested | ||
*/ | ||
export async function getSkills(options = {}) { | ||
if ((typeof options !== 'object') || Array.isArray(options)) { | ||
throw new TypeError('options must be an object') | ||
} | ||
|
||
return getEntities({ | ||
...options, | ||
type: 'skills', | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* A Pokémon's special ability | ||
* | ||
* @typedef {Object} Skill | ||
* @property {number} cooldown The amount of time the ability requires to recharge after use | ||
* @property {string} description A description of the ability | ||
* @property {string} displayName The display name of the ability | ||
* @property {string} id The skill's ID, prefixed by the name of the Pokémon to whom the skill belongs | ||
* @property {string[]} requires A list of requirements that must be met for a Pokémon to be allowed to have the skill | ||
* @property {number} slot The slot in which this ability can be set | ||
* @property {number} type The attack category of this skill | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.