Skip to content

Commit

Permalink
Merge pull request #54 from GW2Treasures/feature/undefined-schema
Browse files Browse the repository at this point in the history
Fix type resolution for undefined schema
  • Loading branch information
darthmaim authored Jul 22, 2024
2 parents 7644f93 + 900aefc commit d925819
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/red-hornets-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@gw2api/types": patch
---

Fix type resolution for undefined schema
1 change: 1 addition & 0 deletions packages/types/data/account.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { SchemaAfter, SchemaVersion } from "../schema";

export type Account<Schema extends SchemaVersion = undefined> =
Schema extends undefined ? AccountBase :
Schema extends SchemaAfter<'2019-12-19T00:00:00.000Z'> | 'latest' ? Account_2019_12_19 :
Schema extends SchemaAfter<'2019-02-21T00:00:00.000Z'> ? Account_2019_02_21 :
AccountBase;
Expand Down
1 change: 1 addition & 0 deletions packages/types/data/item.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { SchemaAfter, SchemaVersion } from "../schema";

export type Item<Schema extends SchemaVersion = undefined> =
Schema extends undefined ? ItemBase :
Schema extends SchemaAfter<'2020-11-17T00:30:00.000Z'> | 'latest' ? Item_2020_11_17 :
ItemBase;

Expand Down
1 change: 1 addition & 0 deletions packages/types/data/tokeninfo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { SchemaAfter, SchemaVersion } from "../schema";

export type Tokeninfo<Schema extends SchemaVersion = undefined> =
Schema extends undefined ? TokeninfoBase :
Schema extends SchemaAfter<'2019-05-22T00:00:00.000Z'> | 'latest' ? Tokeninfo_2019_05_22 :
TokeninfoBase;

Expand Down

0 comments on commit d925819

Please sign in to comment.