unite-lib 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { Locale, getMapDescription, getMapName, getPokemonName } from './i18n/index.cjs';
1
+ export { Locale, getMapDescription, getMapName, getNeutralName, getPokemonName, getSpawnInfo, getSpawnInfoForSpawn } from './i18n/index.cjs';
2
2
 
3
3
  /**
4
4
  * Battle role in Pokémon Unite (Attacker, Defender, etc.).
@@ -87,6 +87,30 @@ interface Map {
87
87
  /** Optional description. */
88
88
  description?: string;
89
89
  }
90
+ /** Wild/neutral Pokémon or item that can spawn on a map. */
91
+ interface Neutral {
92
+ id: string;
93
+ /** Image path (relative to package root or baseUrl). */
94
+ image: string;
95
+ /** Display name in English (use getNeutralName for other locales). */
96
+ name: string;
97
+ /** Pokédex number (omit for non-Pokémon e.g. berries). */
98
+ dex?: number;
99
+ }
100
+ /** A single spawn point on a map, linked to a neutral by neutralId. */
101
+ interface MapSpawn {
102
+ mapId: string;
103
+ neutralId: string;
104
+ left: string;
105
+ top: string;
106
+ spawnTime: string;
107
+ respawnTime: number;
108
+ permanentDelete: boolean;
109
+ /** Optional HTML description (default locale). Use getSpawnInfo for i18n). */
110
+ info?: string;
111
+ /** Optional i18n key for info (spawn.info.<key>). When set, getSpawnInfo uses it. */
112
+ infoKey?: string;
113
+ }
90
114
 
91
115
  declare const pokemons: Array<Pokemon>;
92
116
 
@@ -94,6 +118,10 @@ declare const moves: Move[];
94
118
 
95
119
  declare const maps: Map[];
96
120
 
121
+ declare const neutrals: Neutral[];
122
+
123
+ declare const spawns: MapSpawn[];
124
+
97
125
  interface GetImageUrlOptions {
98
126
  /** Base URL for assets (e.g. CDN). No trailing slash. */
99
127
  baseUrl?: string;
@@ -108,14 +136,28 @@ declare function getImageUrl(pokemon: Pokemon, imageKey: keyof PokemonImages, op
108
136
  * Falls back to map.image when resolution is omitted or not available.
109
137
  */
110
138
  declare function getMapImageUrl(map: Map, resolution?: MapResolution, options?: GetImageUrlOptions): string;
139
+ /**
140
+ * Returns spawns for a given map id (e.g. "map-groudon", "map-kyogre", "map-rayquaza").
141
+ */
142
+ declare function getSpawnsByMap(mapId: string): MapSpawn[];
143
+ /**
144
+ * Returns the neutral by id, or undefined if not found.
145
+ */
146
+ declare function getNeutralById(id: string): Neutral | undefined;
147
+ /**
148
+ * Returns the image URL for a neutral (wild Pokémon or item).
149
+ */
150
+ declare function getNeutralImageUrl(neutral: Neutral, options?: GetImageUrlOptions): string;
111
151
  declare function getPokemonByName(name: string): Pokemon | undefined;
112
152
  declare function getPokemonByDex(dex: number): Pokemon | undefined;
113
153
  /**
114
154
  * Slug from roster image: "pokemons/roster-venusaur.png" -> "venusaur"
155
+ * Use this slug with getPokemonName(id, locale) for i18n.
115
156
  */
157
+ declare function getPokemonSlug(pokemon: Pokemon): string;
116
158
  declare function getPokemonBySlug(slug: string): Pokemon | undefined;
117
159
  declare function getPokemonsByBattleType(battleType: BattleType): Pokemon[];
118
160
  declare function getPokemonsByTag(tag: Tag): Pokemon[];
119
161
  declare function getActivePokemons(): Pokemon[];
120
162
 
121
- export { BattleType, type GetImageUrlOptions, type Map, type MapResolution, type Move, type MoveSlotId, type Pokemon, type PokemonImages, type PokemonStats, Tag, getActivePokemons, getImageUrl, getMapImageUrl, getPokemonByDex, getPokemonByName, getPokemonBySlug, getPokemonsByBattleType, getPokemonsByTag, maps, moves, pokemons };
163
+ export { BattleType, type GetImageUrlOptions, type Map, type MapResolution, type MapSpawn, type Move, type MoveSlotId, type Neutral, type Pokemon, type PokemonImages, type PokemonStats, Tag, getActivePokemons, getImageUrl, getMapImageUrl, getNeutralById, getNeutralImageUrl, getPokemonByDex, getPokemonByName, getPokemonBySlug, getPokemonSlug, getPokemonsByBattleType, getPokemonsByTag, getSpawnsByMap, maps, moves, neutrals, pokemons, spawns };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { Locale, getMapDescription, getMapName, getPokemonName } from './i18n/index.js';
1
+ export { Locale, getMapDescription, getMapName, getNeutralName, getPokemonName, getSpawnInfo, getSpawnInfoForSpawn } from './i18n/index.js';
2
2
 
3
3
  /**
4
4
  * Battle role in Pokémon Unite (Attacker, Defender, etc.).
@@ -87,6 +87,30 @@ interface Map {
87
87
  /** Optional description. */
88
88
  description?: string;
89
89
  }
90
+ /** Wild/neutral Pokémon or item that can spawn on a map. */
91
+ interface Neutral {
92
+ id: string;
93
+ /** Image path (relative to package root or baseUrl). */
94
+ image: string;
95
+ /** Display name in English (use getNeutralName for other locales). */
96
+ name: string;
97
+ /** Pokédex number (omit for non-Pokémon e.g. berries). */
98
+ dex?: number;
99
+ }
100
+ /** A single spawn point on a map, linked to a neutral by neutralId. */
101
+ interface MapSpawn {
102
+ mapId: string;
103
+ neutralId: string;
104
+ left: string;
105
+ top: string;
106
+ spawnTime: string;
107
+ respawnTime: number;
108
+ permanentDelete: boolean;
109
+ /** Optional HTML description (default locale). Use getSpawnInfo for i18n). */
110
+ info?: string;
111
+ /** Optional i18n key for info (spawn.info.<key>). When set, getSpawnInfo uses it. */
112
+ infoKey?: string;
113
+ }
90
114
 
91
115
  declare const pokemons: Array<Pokemon>;
92
116
 
@@ -94,6 +118,10 @@ declare const moves: Move[];
94
118
 
95
119
  declare const maps: Map[];
96
120
 
121
+ declare const neutrals: Neutral[];
122
+
123
+ declare const spawns: MapSpawn[];
124
+
97
125
  interface GetImageUrlOptions {
98
126
  /** Base URL for assets (e.g. CDN). No trailing slash. */
99
127
  baseUrl?: string;
@@ -108,14 +136,28 @@ declare function getImageUrl(pokemon: Pokemon, imageKey: keyof PokemonImages, op
108
136
  * Falls back to map.image when resolution is omitted or not available.
109
137
  */
110
138
  declare function getMapImageUrl(map: Map, resolution?: MapResolution, options?: GetImageUrlOptions): string;
139
+ /**
140
+ * Returns spawns for a given map id (e.g. "map-groudon", "map-kyogre", "map-rayquaza").
141
+ */
142
+ declare function getSpawnsByMap(mapId: string): MapSpawn[];
143
+ /**
144
+ * Returns the neutral by id, or undefined if not found.
145
+ */
146
+ declare function getNeutralById(id: string): Neutral | undefined;
147
+ /**
148
+ * Returns the image URL for a neutral (wild Pokémon or item).
149
+ */
150
+ declare function getNeutralImageUrl(neutral: Neutral, options?: GetImageUrlOptions): string;
111
151
  declare function getPokemonByName(name: string): Pokemon | undefined;
112
152
  declare function getPokemonByDex(dex: number): Pokemon | undefined;
113
153
  /**
114
154
  * Slug from roster image: "pokemons/roster-venusaur.png" -> "venusaur"
155
+ * Use this slug with getPokemonName(id, locale) for i18n.
115
156
  */
157
+ declare function getPokemonSlug(pokemon: Pokemon): string;
116
158
  declare function getPokemonBySlug(slug: string): Pokemon | undefined;
117
159
  declare function getPokemonsByBattleType(battleType: BattleType): Pokemon[];
118
160
  declare function getPokemonsByTag(tag: Tag): Pokemon[];
119
161
  declare function getActivePokemons(): Pokemon[];
120
162
 
121
- export { BattleType, type GetImageUrlOptions, type Map, type MapResolution, type Move, type MoveSlotId, type Pokemon, type PokemonImages, type PokemonStats, Tag, getActivePokemons, getImageUrl, getMapImageUrl, getPokemonByDex, getPokemonByName, getPokemonBySlug, getPokemonsByBattleType, getPokemonsByTag, maps, moves, pokemons };
163
+ export { BattleType, type GetImageUrlOptions, type Map, type MapResolution, type MapSpawn, type Move, type MoveSlotId, type Neutral, type Pokemon, type PokemonImages, type PokemonStats, Tag, getActivePokemons, getImageUrl, getMapImageUrl, getNeutralById, getNeutralImageUrl, getPokemonByDex, getPokemonByName, getPokemonBySlug, getPokemonSlug, getPokemonsByBattleType, getPokemonsByTag, getSpawnsByMap, maps, moves, neutrals, pokemons, spawns };