Skip to content

Commit

Permalink
Add types for /v2/home/cats and /v2/home/nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
darthmaim committed Aug 10, 2024
1 parent d97021e commit fcd1158
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-rockets-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@gw2api/types": patch
---

Add types for `/v2/home/cats` and `/v2/home/nodes`
22 changes: 22 additions & 0 deletions packages/types/data/home.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Cats (/v2/home/cats).
*
* @see https://wiki.guildwars2.com/wiki/API:2/home/cats
*/
export interface HomeCat {
/** The cat id */
id: number,

/** The hint on how to obtain the cat */
hint: string,
}

/**
* Home instance nodes (/v2/home/nodes).
*
* @see https://wiki.guildwars2.com/wiki/API:2/home/nodes
*/
export interface HomeNode {
/** The cat id */
id: string,
}
3 changes: 3 additions & 0 deletions packages/types/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type { Listing, Price, TransactionCurrent, TransactionHistoric } from './
import type { Createsubtoken } from './data/createsubtoken';
import type { Currency } from './data/currency';
import type { GuildUpgrade } from './data/guild';
import type { HomeCat, HomeNode } from './data/home';
import type { HomesteadDecoration } from './data/homestead';
import type { Item } from './data/item';
import type { Legendaryarmory } from './data/legendaryarmory';
Expand Down Expand Up @@ -438,6 +439,8 @@ export type EndpointType<Url extends KnownEndpoint | (string & {}), Schema exten
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/guild/upgrades', number> ? BulkExpandedResponseType<'/v2/guild/upgrades', Url, number, GuildUpgrade> :
Url extends BulkExpandedEndpointUrl<'/v2/home/cats', number> ? BulkExpandedResponseType<'/v2/home/cats', Url, number, HomeCat> :
Url extends BulkExpandedEndpointUrl<'/v2/home/nodes', string> ? BulkExpandedResponseType<'/v2/home/nodes', Url, string, HomeNode> :
Url extends BulkExpandedEndpointUrl<'/v2/homestead/decorations', number> ? BulkExpandedResponseType<'/v2/homestead/decorations', Url, number, HomesteadDecoration> :
Url extends BulkExpandedEndpointUrl<'/v2/items', number> ? BulkExpandedResponseType<'/v2/items', Url, number, Item<Schema>> :
Url extends BulkExpandedEndpointUrl<'/v2/legendaryarmory', number> ? BulkExpandedResponseType<'/v2/legendaryarmory', Url, number, Legendaryarmory> :
Expand Down

0 comments on commit fcd1158

Please sign in to comment.