diff --git a/.changeset/five-tools-suffer.md b/.changeset/five-tools-suffer.md new file mode 100644 index 0000000..458a58f --- /dev/null +++ b/.changeset/five-tools-suffer.md @@ -0,0 +1,5 @@ +--- +"@gw2api/types": patch +--- + +Add types for `/v2/currencies` diff --git a/packages/types/data/color.ts b/packages/types/data/color.ts index d44769d..55ba46f 100644 --- a/packages/types/data/color.ts +++ b/packages/types/data/color.ts @@ -1,3 +1,7 @@ +/** + * Color as returned from /v2/colors + * @see https://wiki.guildwars2.com/wiki/API:2/colors + */ export type Color = { /** The color id */ id: number; diff --git a/packages/types/data/currency.ts b/packages/types/data/currency.ts new file mode 100644 index 0000000..562ed89 --- /dev/null +++ b/packages/types/data/currency.ts @@ -0,0 +1,20 @@ +/** + * Currency as returned from /v2/currencies + * @see https://wiki.guildwars2.com/wiki/API:2/currencies + */ +export type Currency = { + /** The currency id */ + id: number; + + /** The name of the currency */ + name: string; + + /** The description of the currency */ + description: string; + + /** The order as displayed in-game */ + order: number; + + /** The icon of the currency */ + icon: string; +} diff --git a/packages/types/endpoints.ts b/packages/types/endpoints.ts index 74e6034..d5ae8b5 100644 --- a/packages/types/endpoints.ts +++ b/packages/types/endpoints.ts @@ -9,6 +9,7 @@ import type { Character, CharacterBackstory, CharacterBuildTab, CharacterCore, C import type { Color } from './data/color'; import type { Listing, Price, TransactionCurrent, TransactionHistoric } from './data/commerce'; import type { Createsubtoken } from './data/createsubtoken'; +import type { Currency } from './data/currency'; import type { Item } from './data/item'; import type { MaterialCategory } from './data/material'; import type { Quaggan } from './data/quaggan'; @@ -411,6 +412,7 @@ export type EndpointType ? BulkExpandedResponseType<'/v2/characters', Url, string, Character> : Url extends CreateSubtokenUrl<'/v2/createsubtoken'> ? Createsubtoken : Url extends BulkExpandedEndpointUrl<'/v2/colors', number> ? BulkExpandedResponseType<'/v2/colors', Url, number, Color> : + Url extends BulkExpandedEndpointUrl<'/v2/currencies', number> ? BulkExpandedResponseType<'/v2/currencies', Url, number, Currency> : Url extends BulkExpandedEndpointUrl<'/v2/items', number> ? BulkExpandedResponseType<'/v2/items', Url, number, Item> : Url extends BulkExpandedEndpointUrl<'/v2/materials', number> ? BulkExpandedResponseType<'/v2/materials', Url, number, MaterialCategory> : Url extends BulkExpandedEndpointUrl<'/v2/quaggans', string> ? BulkExpandedResponseType<'/v2/quaggans', Url, string, Quaggan> :