-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
197 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { KeyId, LinkSelfHref, request } from "../shared/index.ts"; | ||
|
||
interface Emblem { | ||
id: number; | ||
media: KeyId[]; | ||
} | ||
|
||
interface Border { | ||
id: number; | ||
media: KeyId[]; | ||
} | ||
|
||
interface IdRgba { | ||
id: number; | ||
rgba: { | ||
r: number; | ||
g: number; | ||
b: number; | ||
a: number; | ||
}; | ||
} | ||
|
||
interface GuildCrests extends LinkSelfHref { | ||
emblems: Emblem[]; | ||
borders: Border[]; | ||
colors: { | ||
emblems: IdRgba[]; | ||
borders: IdRgba[]; | ||
backgrounds: IdRgba[]; | ||
}; | ||
} | ||
|
||
interface Asset { | ||
key: string; | ||
value: string; | ||
} | ||
|
||
interface GuildCrestBorder extends LinkSelfHref { | ||
assets: Asset[]; | ||
id: number; | ||
} | ||
|
||
interface GuildCrestEmblem extends LinkSelfHref { | ||
assets: Asset[]; | ||
id: number; | ||
} | ||
|
||
/** | ||
* Returns the Guild Crest Components Index | ||
* | ||
* @returns A promise that resolves to an object representing a list of all Guild Crest Components. | ||
*/ | ||
export async function guildCrests(): Promise<GuildCrests> { | ||
return await request({ | ||
method: "GET", | ||
url: "/data/wow/guild-crest/index", | ||
namespace: "static", | ||
}); | ||
} | ||
|
||
/** | ||
* Returns a Guild Crest Border Media | ||
* | ||
* @param borderId - The unique identifier for the Covenant | ||
* @returns A promise that resolves to an object representing details about a Guild Crest Border Media. | ||
*/ | ||
export async function guildCrestBorder(borderId: number): Promise<GuildCrestBorder> { | ||
return await request({ | ||
method: "GET", | ||
url: `/data/wow/media/guild-crest/border/${borderId}`, | ||
namespace: "static", | ||
}); | ||
} | ||
|
||
/** | ||
* Returns a Crest Emblem Media | ||
* | ||
* @param emblemId - The unique identifier for the Crest Emblem Media | ||
* @returns A promise that resolves to an object representing details about a Crest Emblem Media. | ||
*/ | ||
export async function guildCrestEmblem(emblemId: number): Promise<GuildCrestEmblem> { | ||
return await request({ | ||
method: "GET", | ||
url: `/data/wow/media/guild-crest/emblem/${emblemId}`, | ||
namespace: "static", | ||
}); | ||
} |
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,106 @@ | ||
import { KeyId, KeyNameId, LinkSelfHref, LocalizedString, request } from "../shared/index.ts"; | ||
|
||
interface Heirlooms extends LinkSelfHref { | ||
heirlooms: KeyNameId[]; | ||
} | ||
|
||
interface TypeName { | ||
type: string; | ||
name: LocalizedString; | ||
} | ||
|
||
interface ValueDisplayString { | ||
value: number; | ||
display_string: LocalizedString; | ||
} | ||
|
||
interface UpgradeStats { | ||
type: TypeName; | ||
value: number; | ||
display: { | ||
display_string: LocalizedString; | ||
color: { | ||
r: number; | ||
g: number; | ||
b: number; | ||
a: number; | ||
}; | ||
}; | ||
} | ||
|
||
interface Upgrade { | ||
item: { | ||
item: KeyId; | ||
context: number; | ||
bonus_list: number[]; | ||
quality: TypeName; | ||
name: LocalizedString; | ||
media: KeyId; | ||
item_class: KeyNameId; | ||
item_subclass: KeyNameId; | ||
inventory_type: TypeName; | ||
binding: TypeName; | ||
weapon: { | ||
damage: { | ||
min_value: number; | ||
max_value: number; | ||
display_string: LocalizedString; | ||
damage_class: TypeName; | ||
}; | ||
attack_speed: ValueDisplayString; | ||
dps: ValueDisplayString; | ||
}; | ||
stats: UpgradeStats[]; | ||
upgrades: { | ||
value: number; | ||
max_value: number; | ||
display_string: LocalizedString; | ||
}; | ||
requirements: { | ||
level: { | ||
display_string: LocalizedString; | ||
}; | ||
}; | ||
level: ValueDisplayString; | ||
}; | ||
level: number; | ||
} | ||
|
||
interface Heirloom extends LinkSelfHref { | ||
id: number; | ||
item: KeyNameId; | ||
source: { | ||
type: string; | ||
name: LocalizedString; | ||
}; | ||
source_description: LocalizedString; | ||
upgrades: Upgrade[]; | ||
media: KeyId; | ||
} | ||
|
||
/** | ||
* Returns the Heirloom Index | ||
* | ||
* @returns A promise that resolves to an object representing a list of all Heirlooms. | ||
*/ | ||
export async function heirlooms(): Promise<Heirlooms> { | ||
return await request({ | ||
method: "GET", | ||
url: "/data/wow/heirloom/index", | ||
namespace: "static", | ||
}); | ||
} | ||
|
||
/** | ||
* Returns a Heirloom | ||
* | ||
* @param heirloomId - The unique identifier for the Heirloom | ||
* @returns A promise that resolves to an object representing details about a Heirloom. | ||
*/ | ||
export async function heirloom(heirloomId: number): Promise<Heirloom> { | ||
return await request({ | ||
method: "GET", | ||
url: `/data/wow/heirloom/${heirloomId}`, | ||
namespace: "static", | ||
}); | ||
} |
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