@blizzard-api/d3 0.1.6 → 1.0.0

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/package.json CHANGED
@@ -1,25 +1,21 @@
1
1
  {
2
2
  "name": "@blizzard-api/d3",
3
- "version": "0.1.6",
3
+ "version": "1.0.0",
4
4
  "license": "MIT",
5
5
  "author": "Putro",
6
6
  "description": "A series of helpers to interact with the Diablo 3 Blizzard API",
7
7
  "repository": "https://github.com/Pewtro/blizzard-api/tree/main/packages/d3",
8
8
  "type": "module",
9
9
  "engines": {
10
- "node": "^18.18 || ^20.9 || ^21.1 || ^22"
10
+ "node": "^18.18 || >=20.9"
11
11
  },
12
- "main": "./dist/index.cjs",
13
12
  "module": "./dist/index.js",
14
13
  "types": "./dist/index.d.ts",
15
14
  "exports": {
16
15
  "import": {
16
+ "@blizzard-api/d3-local": "./src/index.ts",
17
17
  "types": "./dist/index.d.ts",
18
18
  "default": "./dist/index.js"
19
- },
20
- "require": {
21
- "types": "./dist/index.d.cts",
22
- "default": "./dist/index.cjs"
23
19
  }
24
20
  },
25
21
  "files": [
@@ -38,10 +34,10 @@
38
34
  ],
39
35
  "dependencies": {},
40
36
  "peerDependencies": {
41
- "@blizzard-api/core": "1.2.1"
37
+ "@blizzard-api/core": "2.0.0"
42
38
  },
43
39
  "devDependencies": {
44
- "@blizzard-api/core": "1.2.1"
40
+ "@blizzard-api/core": "2.0.0"
45
41
  },
46
42
  "scripts": {
47
43
  "build": "tsup",
package/dist/index.cjs DELETED
@@ -1,181 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- // src/base.ts
6
- var base = "d3/data";
7
- var profileBase = `d3/profile`;
8
- var gameDataBase = `data/d3`;
9
-
10
- // src/act/act.ts
11
- function act(actId) {
12
- return {
13
- path: `${base}/act/${actId}`
14
- };
15
- }
16
- function actIndex() {
17
- return {
18
- path: `${base}/act`
19
- };
20
- }
21
-
22
- // src/artisan-and-recipe/artisan-and-recipe.ts
23
- function artisan(artisanSlug) {
24
- return {
25
- path: `${base}/artisan/${artisanSlug}`
26
- };
27
- }
28
- function recipe(artisanSlug, recipeSlug) {
29
- return {
30
- path: `${base}/artisan/${artisanSlug}/recipe/${recipeSlug}`
31
- };
32
- }
33
-
34
- // src/character-class-and-skill/character-class-and-skill.ts
35
- function characterClass(characterClassSlug) {
36
- return {
37
- path: `${base}/character-class/${characterClassSlug}`
38
- };
39
- }
40
- function skill(characterClassSlug, skillSlug) {
41
- return {
42
- path: `${base}/hero/${characterClassSlug}/skill/${skillSlug}`
43
- };
44
- }
45
-
46
- // src/follower/follower.ts
47
- function follower(followerSlug) {
48
- return {
49
- path: `${base}/follower/${followerSlug}`
50
- };
51
- }
52
-
53
- // src/game-data/game-data.ts
54
- function seasonIndex() {
55
- return {
56
- path: `${gameDataBase}/season`
57
- };
58
- }
59
- function season(id) {
60
- return {
61
- path: `${gameDataBase}/season/${id}`
62
- };
63
- }
64
- function seasonLeaderboard(id, leaderboard) {
65
- return {
66
- path: `${gameDataBase}/season/${id}/leaderboard/${leaderboard}`
67
- };
68
- }
69
- function eraIndex() {
70
- return {
71
- path: `${gameDataBase}/era`
72
- };
73
- }
74
- function era(id) {
75
- return {
76
- path: `${gameDataBase}/era/${id}`
77
- };
78
- }
79
- function eraLeaderboard(id, leaderboard) {
80
- return {
81
- path: `${gameDataBase}/era/${id}/leaderboard/${leaderboard}`
82
- };
83
- }
84
-
85
- // src/item/item.ts
86
- function item(itemSlugAndId) {
87
- return {
88
- path: `${base}/item/${itemSlugAndId}`
89
- };
90
- }
91
-
92
- // src/item-type/item-type.ts
93
- function itemTypeIndex() {
94
- return {
95
- path: `${base}/item-type`
96
- };
97
- }
98
- function itemType(itemTypeSlug) {
99
- return {
100
- path: `${base}/item-type/${itemTypeSlug}`
101
- };
102
- }
103
-
104
- // src/profile/profile.ts
105
- function account(battleTag) {
106
- return {
107
- path: `${profileBase}/${battleTag}`
108
- };
109
- }
110
- function accountHero(battleTag, heroId) {
111
- return {
112
- path: `${profileBase}/${battleTag}/hero/${heroId}`
113
- };
114
- }
115
- function accountHeroItems(battleTag, heroId) {
116
- return {
117
- path: `${profileBase}/${battleTag}/hero/${heroId}/items`
118
- };
119
- }
120
- function accountHeroFollowerItems(battleTag, heroId) {
121
- return {
122
- path: `${profileBase}/${battleTag}/hero/${heroId}/follower-items`
123
- };
124
- }
125
-
126
- // src/index.ts
127
- var d3 = {
128
- //Act
129
- act,
130
- actIndex,
131
- //Artisan and Recipe
132
- artisan,
133
- recipe,
134
- //Follower
135
- follower,
136
- //Character Class and Skill
137
- characterClass,
138
- skill,
139
- //Item Type
140
- itemType,
141
- itemTypeIndex,
142
- //Item
143
- item,
144
- //Profile
145
- account,
146
- accountHero,
147
- accountHeroFollowerItems,
148
- accountHeroItems,
149
- //Game Data
150
- era,
151
- eraIndex,
152
- eraLeaderboard,
153
- season,
154
- seasonIndex,
155
- seasonLeaderboard
156
- };
157
-
158
- exports.account = account;
159
- exports.accountHero = accountHero;
160
- exports.accountHeroFollowerItems = accountHeroFollowerItems;
161
- exports.accountHeroItems = accountHeroItems;
162
- exports.act = act;
163
- exports.actIndex = actIndex;
164
- exports.artisan = artisan;
165
- exports.characterClass = characterClass;
166
- exports.d3 = d3;
167
- exports.default = d3;
168
- exports.era = era;
169
- exports.eraIndex = eraIndex;
170
- exports.eraLeaderboard = eraLeaderboard;
171
- exports.follower = follower;
172
- exports.item = item;
173
- exports.itemType = itemType;
174
- exports.itemTypeIndex = itemTypeIndex;
175
- exports.recipe = recipe;
176
- exports.season = season;
177
- exports.seasonIndex = seasonIndex;
178
- exports.seasonLeaderboard = seasonLeaderboard;
179
- exports.skill = skill;
180
- //# sourceMappingURL=index.cjs.map
181
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/base.ts","../src/act/act.ts","../src/artisan-and-recipe/artisan-and-recipe.ts","../src/character-class-and-skill/character-class-and-skill.ts","../src/follower/follower.ts","../src/game-data/game-data.ts","../src/item/item.ts","../src/item-type/item-type.ts","../src/profile/profile.ts","../src/index.ts"],"names":[],"mappings":";;;;;AAAO,IAAM,IAAO,GAAA,SAAA,CAAA;AAEb,IAAM,WAAc,GAAA,CAAA,UAAA,CAAA,CAAA;AAGpB,IAAM,YAAe,GAAA,CAAA,OAAA,CAAA,CAAA;;;ACDrB,SAAS,IAAI,KAAsC,EAAA;AACxD,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,CAAA,EAAG,IAAI,CAAA,KAAA,EAAQ,KAAK,CAAA,CAAA;AAAA,GAC5B,CAAA;AACF,CAAA;AAEO,SAAS,QAAuC,GAAA;AACrD,EAAO,OAAA;AAAA,IACL,IAAA,EAAM,GAAG,IAAI,CAAA,IAAA,CAAA;AAAA,GACf,CAAA;AACF,CAAA;;;ACVO,SAAS,QAAQ,WAAgD,EAAA;AACtE,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,CAAA,EAAG,IAAI,CAAA,SAAA,EAAY,WAAW,CAAA,CAAA;AAAA,GACtC,CAAA;AACF,CAAA;AAEO,SAAS,MAAA,CAAO,aAAqB,UAA8C,EAAA;AACxF,EAAO,OAAA;AAAA,IACL,MAAM,CAAG,EAAA,IAAI,CAAY,SAAA,EAAA,WAAW,WAAW,UAAU,CAAA,CAAA;AAAA,GAC3D,CAAA;AACF,CAAA;;;ACVO,SAAS,eAAe,kBAA8D,EAAA;AAC3F,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,CAAA,EAAG,IAAI,CAAA,iBAAA,EAAoB,kBAAkB,CAAA,CAAA;AAAA,GACrD,CAAA;AACF,CAAA;AAEO,SAAS,KAAA,CAAM,oBAA4B,SAA4C,EAAA;AAC5F,EAAO,OAAA;AAAA,IACL,MAAM,CAAG,EAAA,IAAI,CAAS,MAAA,EAAA,kBAAkB,UAAU,SAAS,CAAA,CAAA;AAAA,GAC7D,CAAA;AACF,CAAA;;;ACVO,SAAS,SAAS,YAA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ACA,WAAA;AAAA,EACA,wBAAA;AAAA,EACA,gBAAA;AAAA;AAAA,EAEA,GAAA;AAAA,EACA,QAAA;AAAA,EACA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA,iBAAA;AACF","file":"index.cjs","sourcesContent":["export const base = 'd3/data';\r\n\r\nexport const profileBase = `d3/profile`;\r\n\r\n//Why is the game data APIs base root the reverse of the regular base?\r\nexport const gameDataBase = `data/d3`;\r\n\r\n/**\r\n * Base interface for Blizzard API responses.\r\n */\r\nexport interface ResponseBase {\r\n _links: {\r\n self: {\r\n href: string;\r\n };\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { base } from '../base';\r\nimport type { ActIndexResponse, ActResponse } from './types';\r\n\r\nexport function act(actId: number): Resource<ActResponse> {\r\n return {\r\n path: `${base}/act/${actId}`,\r\n };\r\n}\r\n\r\nexport function actIndex(): Resource<ActIndexResponse> {\r\n return {\r\n path: `${base}/act`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { base } from '../base';\r\nimport type { ArtisanResponse, RecipeResponse } from './types';\r\n\r\nexport function artisan(artisanSlug: string): Resource<ArtisanResponse> {\r\n return {\r\n path: `${base}/artisan/${artisanSlug}`,\r\n };\r\n}\r\n\r\nexport function recipe(artisanSlug: string, recipeSlug: string): Resource<RecipeResponse> {\r\n return {\r\n path: `${base}/artisan/${artisanSlug}/recipe/${recipeSlug}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { base } from '../base';\r\nimport type { CharacterClassResponse, SkillResponse } from './types';\r\n\r\nexport function characterClass(characterClassSlug: string): Resource<CharacterClassResponse> {\r\n return {\r\n path: `${base}/character-class/${characterClassSlug}`,\r\n };\r\n}\r\n\r\nexport function skill(characterClassSlug: string, skillSlug: string): Resource<SkillResponse> {\r\n return {\r\n path: `${base}/hero/${characterClassSlug}/skill/${skillSlug}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { base } from '../base';\r\nimport type { FollowerResponse } from './types';\r\n\r\nexport function follower(followerSlug: string): Resource<FollowerResponse> {\r\n return {\r\n path: `${base}/follower/${followerSlug}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { gameDataBase } from '../base';\r\nimport type {\r\n EraIndexResponse,\r\n EraLeaderboardResponse,\r\n EraResponse,\r\n SeasonIndexResponse,\r\n SeasonLeaderboardResponse,\r\n SeasonResponse,\r\n} from './types';\r\n\r\nexport function seasonIndex(): Resource<SeasonIndexResponse> {\r\n return {\r\n path: `${gameDataBase}/season`,\r\n };\r\n}\r\n\r\nexport function season(id: number): Resource<SeasonResponse> {\r\n return {\r\n path: `${gameDataBase}/season/${id}`,\r\n };\r\n}\r\n\r\nexport function seasonLeaderboard(id: number, leaderboard: string): Resource<SeasonLeaderboardResponse> {\r\n return {\r\n path: `${gameDataBase}/season/${id}/leaderboard/${leaderboard}`,\r\n };\r\n}\r\n\r\nexport function eraIndex(): Resource<EraIndexResponse> {\r\n return {\r\n path: `${gameDataBase}/era`,\r\n };\r\n}\r\n\r\nexport function era(id: number): Resource<EraResponse> {\r\n return {\r\n path: `${gameDataBase}/era/${id}`,\r\n };\r\n}\r\n\r\nexport function eraLeaderboard(id: number, leaderboard: string): Resource<EraLeaderboardResponse> {\r\n return {\r\n path: `${gameDataBase}/era/${id}/leaderboard/${leaderboard}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { base } from '../base';\r\nimport type { ItemResponse } from './types';\r\n\r\nexport function item(itemSlugAndId: string): Resource<ItemResponse> {\r\n return {\r\n path: `${base}/item/${itemSlugAndId}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { base } from '../base';\r\nimport type { ItemTypeIndexResponse, ItemTypeResponse } from './types';\r\n\r\nexport function itemTypeIndex(): Resource<Array<ItemTypeIndexResponse>> {\r\n return {\r\n path: `${base}/item-type`,\r\n };\r\n}\r\n\r\nexport function itemType(itemTypeSlug: string): Resource<Array<ItemTypeResponse>> {\r\n return {\r\n path: `${base}/item-type/${itemTypeSlug}`,\r\n };\r\n}\r\n","import type { Resource } from '@blizzard-api/core';\r\nimport { profileBase } from '../base';\r\nimport type { AccountHeroFollowerItemsResponse, AccountHeroResponse, AccountResponse } from './types';\r\n\r\nexport function account(battleTag: string): Resource<AccountResponse> {\r\n return {\r\n path: `${profileBase}/${battleTag}`,\r\n };\r\n}\r\n\r\nexport function accountHero(battleTag: string, heroId: number): Resource<AccountHeroResponse> {\r\n return {\r\n path: `${profileBase}/${battleTag}/hero/${heroId}`,\r\n };\r\n}\r\n\r\nexport function accountHeroItems(battleTag: string, heroId: number): Resource<AccountHeroResponse> {\r\n return {\r\n path: `${profileBase}/${battleTag}/hero/${heroId}/items`,\r\n };\r\n}\r\n\r\nexport function accountHeroFollowerItems(\r\n battleTag: string,\r\n heroId: number,\r\n): Resource<AccountHeroFollowerItemsResponse> {\r\n return {\r\n path: `${profileBase}/${battleTag}/hero/${heroId}/follower-items`,\r\n };\r\n}\r\n","import { act, actIndex } from './act/act';\r\nimport { artisan, recipe } from './artisan-and-recipe/artisan-and-recipe';\r\nimport { characterClass, skill } from './character-class-and-skill/character-class-and-skill';\r\nimport { follower } from './follower/follower';\r\nimport { era, eraIndex, eraLeaderboard, season, seasonIndex, seasonLeaderboard } from './game-data/game-data';\r\nimport { item } from './item/item';\r\nimport { itemType, itemTypeIndex } from './item-type/item-type';\r\nimport { account, accountHero, accountHeroFollowerItems, accountHeroItems } from './profile/profile';\r\n\r\nconst d3 = {\r\n //Act\r\n act,\r\n actIndex,\r\n //Artisan and Recipe\r\n artisan,\r\n recipe,\r\n //Follower\r\n follower,\r\n //Character Class and Skill\r\n characterClass,\r\n skill,\r\n //Item Type\r\n itemType,\r\n itemTypeIndex,\r\n //Item\r\n item,\r\n //Profile\r\n account,\r\n accountHero,\r\n accountHeroFollowerItems,\r\n accountHeroItems,\r\n //Game Data\r\n era,\r\n eraIndex,\r\n eraLeaderboard,\r\n season,\r\n seasonIndex,\r\n seasonLeaderboard,\r\n};\r\nexport { d3 as default, d3 };\r\n\r\n//Act\r\nexport * from './act/act';\r\nexport type * from './act/types';\r\n//Artisan and Recipe\r\nexport * from './artisan-and-recipe/artisan-and-recipe';\r\nexport type * from './artisan-and-recipe/types';\r\n//Character Class and Skill\r\nexport * from './character-class-and-skill/character-class-and-skill';\r\nexport type * from './character-class-and-skill/types';\r\n//Follower\r\nexport * from './follower/follower';\r\nexport type * from './follower/types';\r\n//Game Data\r\nexport * from './game-data/game-data';\r\nexport type * from './game-data/types';\r\n//Item\r\nexport * from './item/item';\r\nexport type * from './item/types';\r\n//Item Type\r\nexport * from './item-type/item-type';\r\nexport type * from './item-type/types';\r\n//Profile\r\nexport * from './profile/profile';\r\nexport type * from './profile/types';\r\n"]}
package/dist/index.d.cts DELETED
@@ -1,642 +0,0 @@
1
- import { Resource } from '@blizzard-api/core';
2
-
3
- interface ActResponse {
4
- name: string;
5
- number: number;
6
- quests: Array<Quest>;
7
- slug: string;
8
- }
9
- interface ActIndexResponse {
10
- acts: Array<Act$1>;
11
- }
12
- interface Act$1 {
13
- name: string;
14
- number: number;
15
- quests: Array<Quest>;
16
- slug: string;
17
- }
18
- interface Quest {
19
- id: number;
20
- name: string;
21
- slug: string;
22
- }
23
-
24
- declare function act(actId: number): Resource<ActResponse>;
25
- declare function actIndex(): Resource<ActIndexResponse>;
26
-
27
- interface ArtisanResponse {
28
- name: string;
29
- portrait: string;
30
- slug: string;
31
- training: Training;
32
- }
33
- interface Training {
34
- tiers: Array<Tier>;
35
- }
36
- interface Tier {
37
- taughtRecipes: Array<Recipe>;
38
- tier: number;
39
- trainedRecipes: Array<Recipe>;
40
- }
41
- interface Recipe {
42
- cost: number;
43
- id: string;
44
- itemProduced: Item$1;
45
- name: string;
46
- reagents: Array<Reagent$1>;
47
- slug: string;
48
- }
49
- interface Item$1 {
50
- icon: string;
51
- id: string;
52
- name: string;
53
- path: string;
54
- slug: string;
55
- }
56
- interface Reagent$1 {
57
- item: Item$1;
58
- quantity: number;
59
- }
60
- interface RecipeResponse {
61
- cost: number;
62
- id: string;
63
- itemProduced: Item$1;
64
- name: string;
65
- reagents: Array<Reagent$1>;
66
- slug: string;
67
- }
68
-
69
- declare function artisan(artisanSlug: string): Resource<ArtisanResponse>;
70
- declare function recipe(artisanSlug: string, recipeSlug: string): Resource<RecipeResponse>;
71
-
72
- interface CharacterClassResponse {
73
- femaleName: string;
74
- icon: string;
75
- maleName: string;
76
- name: string;
77
- skillCategories: Array<SkillCategory>;
78
- skills: Record<'active' | 'passive', Array<Skill$2>>;
79
- slug: string;
80
- }
81
- interface SkillCategory {
82
- name: string;
83
- slug: string;
84
- }
85
- interface Skill$2 {
86
- description: string;
87
- descriptionHtml: string;
88
- flavorText?: string;
89
- icon: string;
90
- level: number;
91
- name: string;
92
- slug: string;
93
- tooltipUrl: string;
94
- }
95
- interface SkillResponse {
96
- runes: Array<Rune$1>;
97
- skill: Skill$2;
98
- }
99
- interface Rune$1 {
100
- description: string;
101
- descriptionHtml: string;
102
- level: number;
103
- name: string;
104
- slug: string;
105
- type: string;
106
- }
107
-
108
- declare function characterClass(characterClassSlug: string): Resource<CharacterClassResponse>;
109
- declare function skill(characterClassSlug: string, skillSlug: string): Resource<SkillResponse>;
110
-
111
- interface FollowerResponse {
112
- name: string;
113
- portrait: string;
114
- realName: string;
115
- skills: Array<Skill$1>;
116
- slug: string;
117
- }
118
- interface Skill$1 {
119
- description: string;
120
- descriptionHtml: string;
121
- icon: string;
122
- level: number;
123
- name: string;
124
- slug: string;
125
- tooltipUrl: string;
126
- }
127
-
128
- declare function follower(followerSlug: string): Resource<FollowerResponse>;
129
-
130
- /**
131
- * Base interface for Blizzard API responses.
132
- */
133
- interface ResponseBase {
134
- _links: {
135
- self: {
136
- href: string;
137
- };
138
- };
139
- }
140
-
141
- interface SeasonIndexResponse extends ResponseBase {
142
- current_season: number;
143
- generated_by: string;
144
- last_update_time: string;
145
- season: Array<{
146
- href: string;
147
- }>;
148
- service_current_season: number;
149
- service_season_state: string;
150
- }
151
- interface SeasonResponse extends ResponseBase {
152
- generated_by: string;
153
- last_update_time: string;
154
- leaderboard: Array<Leaderboard>;
155
- season_id: number;
156
- }
157
- interface Leaderboard {
158
- hardcore?: boolean;
159
- hero_class_string?: string;
160
- ladder: {
161
- href: string;
162
- };
163
- team_size?: number;
164
- }
165
- interface SeasonLeaderboardResponse extends ResponseBase {
166
- achievement_points: boolean;
167
- column: Array<Column>;
168
- generated_by: string;
169
- key: string;
170
- last_update_time: string;
171
- row: Array<Row>;
172
- season: number;
173
- title: string;
174
- }
175
- interface Column {
176
- hidden: boolean;
177
- id: LeaderboardId;
178
- label: null | string;
179
- order?: number;
180
- type: 'DATETIME' | 'NUMBER' | 'STRING';
181
- }
182
- type LeaderboardId = 'AchievementPoints' | 'BattleTag' | 'ClanName' | 'CompletedTime' | 'GameAccount' | 'HeroBattleTag' | 'HeroClanTag' | 'HeroClass' | 'HeroGender' | 'HeroId' | 'HeroLevel' | 'HeroVisualItems' | 'ParagonLevel' | 'Rank' | 'RiftLevel' | 'RiftTime';
183
- interface Row {
184
- data: Array<RowData>;
185
- order: number;
186
- player: Array<Player>;
187
- }
188
- interface RowData {
189
- id: LeaderboardId;
190
- number?: number;
191
- string?: string;
192
- timestamp?: number;
193
- }
194
- interface Player {
195
- accountId: number;
196
- data: Array<RowData>;
197
- key: string;
198
- }
199
- interface EraIndexResponse extends ResponseBase {
200
- current_era: number;
201
- era: Array<{
202
- href: string;
203
- }>;
204
- generated_by: string;
205
- last_update_time: string;
206
- }
207
- interface EraResponse extends ResponseBase {
208
- era_id: number;
209
- era_start_date: number;
210
- generated_by: string;
211
- last_update_time: string;
212
- leaderboard: Array<EraLeaderboard>;
213
- }
214
- interface Self {
215
- href: string;
216
- }
217
- interface EraLeaderboard {
218
- hardcore?: boolean;
219
- hero_class_string?: string;
220
- ladder: Self;
221
- team_size: number;
222
- }
223
- interface EraLeaderboardResponse extends ResponseBase {
224
- column: Array<Column>;
225
- era: number;
226
- generated_by: string;
227
- greater_rift: boolean;
228
- greater_rift_solo_class: string;
229
- key: string;
230
- last_update_time: string;
231
- row: Array<Row>;
232
- title: string;
233
- }
234
-
235
- declare function seasonIndex(): Resource<SeasonIndexResponse>;
236
- declare function season(id: number): Resource<SeasonResponse>;
237
- declare function seasonLeaderboard(id: number, leaderboard: string): Resource<SeasonLeaderboardResponse>;
238
- declare function eraIndex(): Resource<EraIndexResponse>;
239
- declare function era(id: number): Resource<EraResponse>;
240
- declare function eraLeaderboard(id: number, leaderboard: string): Resource<EraLeaderboardResponse>;
241
-
242
- interface ItemResponse {
243
- accountBound: boolean;
244
- attributes: Attributes$1;
245
- color: string;
246
- damage: string;
247
- damageHtml: string;
248
- dps: string;
249
- flavorText: string;
250
- flavorTextHtml: string;
251
- icon: string;
252
- id: string;
253
- isSeasonRequiredToDrop: boolean;
254
- name: string;
255
- randomAffixes: Array<RandomAffix>;
256
- requiredLevel: number;
257
- seasonRequiredToDrop: number;
258
- setItems: Array<unknown>;
259
- slots: Array<string>;
260
- slug: string;
261
- stackSizeMax: number;
262
- tooltipParams: string;
263
- type: Type;
264
- typeName: string;
265
- }
266
- interface Attributes$1 {
267
- other: Array<unknown>;
268
- primary: Array<Primary>;
269
- secondary: Array<Primary>;
270
- }
271
- interface Primary {
272
- text: string;
273
- textHtml: string;
274
- }
275
- interface RandomAffix {
276
- oneOf: Array<Primary>;
277
- }
278
- interface Type {
279
- id: string;
280
- twoHanded: boolean;
281
- }
282
-
283
- declare function item(itemSlugAndId: string): Resource<ItemResponse>;
284
-
285
- interface ItemTypeIndexResponse {
286
- id: string;
287
- name: string;
288
- path: string;
289
- }
290
- interface ItemTypeResponse {
291
- icon: string;
292
- id: string;
293
- name: string;
294
- path: string;
295
- slug: string;
296
- }
297
-
298
- declare function itemTypeIndex(): Resource<Array<ItemTypeIndexResponse>>;
299
- declare function itemType(itemTypeSlug: string): Resource<Array<ItemTypeResponse>>;
300
-
301
- interface AccountResponse {
302
- battleTag: string;
303
- blacksmith: Artisan;
304
- blacksmithHardcore: Artisan;
305
- blacksmithSeason: Artisan;
306
- blacksmithSeasonHardcore: Artisan;
307
- guildName: string;
308
- heroes: Array<Hero>;
309
- highestHardcoreLevel: number;
310
- jeweler: Artisan;
311
- jewelerHardcore: Artisan;
312
- jewelerSeason: Artisan;
313
- jewelerSeasonHardcore: Artisan;
314
- kills: AccountResponseKills;
315
- lastHeroPlayed: number;
316
- lastUpdated: number;
317
- mystic: Artisan;
318
- mysticHardcore: Artisan;
319
- mysticSeason: Artisan;
320
- mysticSeasonHardcore: Artisan;
321
- paragonLevel: number;
322
- paragonLevelHardcore: number;
323
- paragonLevelSeason: number;
324
- paragonLevelSeasonHardcore: number;
325
- progression: Progression;
326
- seasonalProfiles: Record<`season${number}`, Season>;
327
- timePlayed: TimePlayed;
328
- }
329
- interface Artisan {
330
- level: number;
331
- slug: 'blacksmith' | 'jeweler' | 'mystic';
332
- }
333
- interface Hero {
334
- class: string;
335
- classSlug: string;
336
- dead: boolean;
337
- gender: number;
338
- hardcore: boolean;
339
- id: number;
340
- kills: HeroKills;
341
- 'last-updated': number;
342
- level: number;
343
- name: string;
344
- paragonLevel: number;
345
- seasonal: boolean;
346
- }
347
- interface HeroKills {
348
- elites: number;
349
- }
350
- interface AccountResponseKills {
351
- elites: number;
352
- hardcoreMonsters: number;
353
- monsters: number;
354
- }
355
- interface Progression {
356
- act1: boolean;
357
- act2: boolean;
358
- act3: boolean;
359
- act4: boolean;
360
- act5: boolean;
361
- }
362
- interface Season {
363
- highestHardcoreLevel: number;
364
- kills: AccountResponseKills;
365
- paragonLevel: number;
366
- paragonLevelHardcore: number;
367
- seasonId: number;
368
- timePlayed: TimePlayed;
369
- }
370
- interface TimePlayed {
371
- barbarian: number;
372
- crusader: number;
373
- 'demon-hunter': number;
374
- monk: number;
375
- necromancer: number;
376
- 'witch-doctor': number;
377
- wizard: number;
378
- }
379
- interface AccountHeroResponse {
380
- alive: boolean;
381
- class: string;
382
- followers: Followers;
383
- gender: number;
384
- hardcore: boolean;
385
- highestSoloRiftCompleted: number;
386
- id: number;
387
- items: Record<string, Item>;
388
- kills: Kills;
389
- lastUpdated: number;
390
- legendaryPowers: Array<Item>;
391
- level: number;
392
- name: string;
393
- paragonLevel: number;
394
- progression: HeroProgression;
395
- seasonal: boolean;
396
- seasonCreated: number;
397
- skills: Skills;
398
- stats: Record<string, number>;
399
- }
400
- interface Followers {
401
- enchantress: Enchantress;
402
- scoundrel: Scoundrel;
403
- templar: Templar;
404
- }
405
- interface Enchantress {
406
- items: EnchantressItems;
407
- level: number;
408
- skills: Array<unknown>;
409
- slug: string;
410
- stats: Stats;
411
- }
412
- interface EnchantressItems {
413
- mainHand: Item;
414
- }
415
- interface Item {
416
- displayColor?: DisplayColor;
417
- dyeColor?: Item;
418
- icon: string;
419
- id: string;
420
- name: string;
421
- tooltipParams: string;
422
- }
423
- interface Stats {
424
- experienceBonus: number;
425
- goldFind: number;
426
- magicFind: number;
427
- }
428
- interface Scoundrel {
429
- items: Record<string, Item>;
430
- level: number;
431
- skills: Array<Skill>;
432
- slug: string;
433
- stats: Stats;
434
- }
435
- interface Skill {
436
- description: string;
437
- descriptionHtml: string;
438
- flavorText?: string;
439
- icon: string;
440
- level: number;
441
- name: string;
442
- slug: string;
443
- tooltipUrl: string;
444
- }
445
- interface Templar {
446
- items: TemplarItems;
447
- level: number;
448
- skills: Array<Skill>;
449
- slug: string;
450
- stats: Stats;
451
- }
452
- interface TemplarItems {
453
- bracers: Item;
454
- feet: Item;
455
- hands: Item;
456
- head: Item;
457
- mainHand: Item;
458
- offHand: Item;
459
- shoulders: Item;
460
- torso: Item;
461
- waist: Item;
462
- }
463
- interface Kills {
464
- elites: number;
465
- }
466
- interface HeroProgression {
467
- act1: Act;
468
- act2: Act;
469
- act3: Act;
470
- act4: Act;
471
- act5: Act;
472
- }
473
- interface Act {
474
- completed: boolean;
475
- completedQuests: Array<CompletedQuest>;
476
- }
477
- interface CompletedQuest {
478
- name: string;
479
- slug: string;
480
- }
481
- interface Skills {
482
- active: Array<Active>;
483
- passive: Array<Passive>;
484
- }
485
- interface Active {
486
- rune: Rune;
487
- skill: Skill;
488
- }
489
- interface Rune {
490
- description: string;
491
- descriptionHtml: string;
492
- level: number;
493
- name: string;
494
- slug: string;
495
- type: string;
496
- }
497
- interface Passive {
498
- skill: Skill;
499
- }
500
- type DisplayColor = 'blue' | 'green' | 'orange' | 'white' | 'yellow';
501
- interface AccountHeroItemsResponse {
502
- accountBound: boolean;
503
- armor: number;
504
- attacksPerSecond: number;
505
- attributes: Attributes;
506
- attributesHtml: Attributes;
507
- craftedBy?: CraftedBy;
508
- damage?: string;
509
- displayColor: DisplayColor;
510
- dps?: string;
511
- elementalType?: string;
512
- flavorText: string;
513
- gems?: Array<Gem>;
514
- icon: string;
515
- id: string;
516
- isSeasonRequiredToDrop: boolean;
517
- itemLevel: number;
518
- maxDamage: number;
519
- minDamage: number;
520
- name: string;
521
- openSockets: number;
522
- requiredLevel: number;
523
- seasonRequiredToDrop: number;
524
- set?: Set;
525
- slots: string;
526
- stackSizeMax: number;
527
- tooltipParams: string;
528
- type: Record<string, boolean | string>;
529
- typeName: string;
530
- }
531
- interface Attributes {
532
- primary: Array<string>;
533
- secondary?: Array<string>;
534
- }
535
- interface CraftedBy {
536
- cost: number;
537
- id: string;
538
- itemProduced: ItemProduced;
539
- name: string;
540
- reagents: Array<Reagent>;
541
- slug: string;
542
- }
543
- interface ItemProduced {
544
- id: string;
545
- path: string;
546
- }
547
- interface Reagent {
548
- item: AccountHeroItem;
549
- quantity: number;
550
- }
551
- interface AccountHeroItem {
552
- icon: string;
553
- id: string;
554
- name: string;
555
- path: string;
556
- slug: string;
557
- }
558
- interface Gem {
559
- attributes: Array<string>;
560
- isGem: boolean;
561
- isJewel: boolean;
562
- item: AccountHeroItem;
563
- jewelRank?: number;
564
- jewelSecondaryUnlockRank?: number;
565
- }
566
- interface Set {
567
- description: string;
568
- descriptionHtml: string;
569
- name: string;
570
- slug: string;
571
- }
572
- interface AccountHeroFollowerItemsResponse {
573
- enchantress: Record<string, FollowerItem>;
574
- scoundrel: Record<string, FollowerItem>;
575
- templar: Record<string, FollowerItem>;
576
- }
577
- interface FollowerItem {
578
- accountBound: boolean;
579
- armor: number;
580
- attacksPerSecond: number;
581
- attributes?: Attributes;
582
- attributesHtml?: Attributes;
583
- blockChance?: string;
584
- craftedBy?: CraftedBy;
585
- damage?: string;
586
- displayColor: string;
587
- dps?: string;
588
- dye?: Dye;
589
- flavorText?: string;
590
- icon: string;
591
- id: string;
592
- isSeasonRequiredToDrop: boolean;
593
- itemLevel: number;
594
- maxDamage: number;
595
- minDamage: number;
596
- name: string;
597
- openSockets: number;
598
- requiredLevel: number;
599
- seasonRequiredToDrop: number;
600
- set?: Set;
601
- slots: string;
602
- stackSizeMax: number;
603
- tooltipParams: string;
604
- type: Record<string, boolean | string>;
605
- typeName: string;
606
- }
607
- interface Dye {
608
- icon: string;
609
- id: string;
610
- name: string;
611
- tooltipParams: string;
612
- }
613
-
614
- declare function account(battleTag: string): Resource<AccountResponse>;
615
- declare function accountHero(battleTag: string, heroId: number): Resource<AccountHeroResponse>;
616
- declare function accountHeroItems(battleTag: string, heroId: number): Resource<AccountHeroResponse>;
617
- declare function accountHeroFollowerItems(battleTag: string, heroId: number): Resource<AccountHeroFollowerItemsResponse>;
618
-
619
- declare const d3: {
620
- act: typeof act;
621
- actIndex: typeof actIndex;
622
- artisan: typeof artisan;
623
- recipe: typeof recipe;
624
- follower: typeof follower;
625
- characterClass: typeof characterClass;
626
- skill: typeof skill;
627
- itemType: typeof itemType;
628
- itemTypeIndex: typeof itemTypeIndex;
629
- item: typeof item;
630
- account: typeof account;
631
- accountHero: typeof accountHero;
632
- accountHeroFollowerItems: typeof accountHeroFollowerItems;
633
- accountHeroItems: typeof accountHeroItems;
634
- era: typeof era;
635
- eraIndex: typeof eraIndex;
636
- eraLeaderboard: typeof eraLeaderboard;
637
- season: typeof season;
638
- seasonIndex: typeof seasonIndex;
639
- seasonLeaderboard: typeof seasonLeaderboard;
640
- };
641
-
642
- export { type AccountHeroFollowerItemsResponse, type AccountHeroItemsResponse, type AccountHeroResponse, type AccountResponse, type ActIndexResponse, type ActResponse, type ArtisanResponse, type Attributes$1 as Attributes, type CharacterClassResponse, type EraIndexResponse, type EraLeaderboardResponse, type EraResponse, type FollowerResponse, type ItemResponse, type ItemTypeIndexResponse, type ItemTypeResponse, type Primary, type RandomAffix, type RecipeResponse, type SeasonIndexResponse, type SeasonLeaderboardResponse, type SeasonResponse, type SkillResponse, type Type, account, accountHero, accountHeroFollowerItems, accountHeroItems, act, actIndex, artisan, characterClass, d3, d3 as default, era, eraIndex, eraLeaderboard, follower, item, itemType, itemTypeIndex, recipe, season, seasonIndex, seasonLeaderboard, skill };