From d7e9841680c76422678f35b3c2b528d88f392edd Mon Sep 17 00:00:00 2001 From: Derick M <58572875+TurtIeSocks@users.noreply.github.com> Date: Wed, 11 Sep 2024 09:56:50 -0400 Subject: [PATCH] chore(readme): document updated method signatures --- README.md | 29 +++++++++++++++-------------- src/uicons.ts | 4 ++-- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 9be102f..ab21e29 100644 --- a/README.md +++ b/README.md @@ -41,35 +41,36 @@ const indexJson = await fetch('https://www.uicons-repo.com/index.json').then( uicons.init(indexJson) // Below are some example usages with variable names for demonstration, see intellisense in your IDE for type information +// Please note that in some cases, such as with Stardust, the `reward_id` is the `amount` of the reward +const device = uicons.device(online) +const gym = uicons.gym(team_id, trainer_count, in_battle, ex, ar, power_level) +const invasion = uicons.invasion(grunt_id, confirmed) +const misc = uicons.misc(filename_without_extension) +const nest = uicons.nest(type_id) const pokemon = uicons.pokemon( pokemon_id, - form_id, evolution_id, - gender_id, + form_id, costume_id, + gender_id, alignment_id, + bread_id, shiny ) -const type = uicons.type(type_id) const pokestop = uicons.pokestop( lure_id, - power, display, - invasion_active, quest_active, ar + power, ) -// Please note that in some cases, such as with Stardust, the `reward_id` is the `amount` of the reward +const egg = uicons.raidEgg(raid_level, hatched, ex) const reward = uicons.reward(reward_type_id, reward_id, amount) -const invasion = uicons.invasion(grunt_id, confirmed) -const gym = uicons.gym(team_id, trainer_count, in_battle, ex, ar) -const egg = uicons.egg(raid_level, hatched, ex) -const team = uicons.team(team_id) -const weather = uicons.weather(weather_id) -const nest = uicons.nest(type_id) -const misc = uicons.misc(filename_without_extension) -const device = uicons.device(online) +const rewardWithOutId = uicons.reward(reward_type_id, amount) const spawnpoint = uicons.spawnpoint(has_known_tth) +const team = uicons.team(team_id) +const type = uicons.type(type_id) +const weather = uicons.weather(weather_id, severity, 'day') ``` ## Development diff --git a/src/uicons.ts b/src/uicons.ts index 48cf9e9..334d709 100644 --- a/src/uicons.ts +++ b/src/uicons.ts @@ -536,7 +536,7 @@ export class UICONS { ): string reward( questRewardType: U = 'unset' as U, - rewardId = 0, + rewardIdOrAmount = 0, amount = 0 ): string { if (!this.#isReady('reward')) return '' @@ -553,7 +553,7 @@ export class UICONS { Number.isInteger(amountSafe) && amountSafe > 1 ? [`_a${amount}`, ''] : [''] - const safeId = +rewardId || amountSafe || 0 + const safeId = +rewardIdOrAmount || amountSafe || 0 for (let a = 0; a < amountSuffixes.length; a += 1) { const result = `${safeId}${amountSuffixes[a]}.${