Skip to content

Commit

Permalink
chore: better string types
Browse files Browse the repository at this point in the history
  • Loading branch information
Qrzy committed Sep 14, 2024
1 parent 83aa8d9 commit f0ac5ff
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions src/wrappers/getBggCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export interface BggCollectionResponse {
median: OfValue<number>
ranks: {
rank: {
type: 'subtype' | 'family' | string
type: 'subtype' | 'family' | (string & {})
id: number
name: string
friendlyname: string
Expand Down Expand Up @@ -102,13 +102,13 @@ export interface BggCollectionResponse {
| 'boardgameversion'
| 'boardgamepublisher'
| 'language'
| string
| (string & {})
id: number
value: string
inbound?: boolean
}[]
name: {
type: 'primary' | string
type: 'primary' | (string & {})
sortindex: number
value: string
}
Expand All @@ -118,11 +118,11 @@ export interface BggCollectionResponse {
length: OfValue<number>
depth: OfValue<number>
weight: OfValue<number>
type: 'boardgameversion' | string
type: 'boardgameversion' | (string & {})
id: number
}
}
objecttype: 'thing' | string
objecttype: 'thing' | (string & {})
objectid: number
subtype: string
collid: number
Expand Down
6 changes: 3 additions & 3 deletions src/wrappers/getBggFamily.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface BggFamilyParams {
}

interface NewType {
type: 'primary' | string
type: 'primary' | (string & {})
sortindex: number
value: string
}
Expand All @@ -19,12 +19,12 @@ export interface BggFamilyResponse {
name: NewType
description: string
link: {
type: 'boardgamefamily' | string
type: 'boardgamefamily' | (string & {})
id: number
value: string
inbound: boolean
}[]
type: 'boardgamefamily' | string
type: 'boardgamefamily' | (string & {})
[prop: string]: unknown
}>
termsofuse: string
Expand Down
4 changes: 2 additions & 2 deletions src/wrappers/getBggGeeklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export interface GeeklistResponse {
body: string
comment: GeeklistItemComment | GeeklistItemComment[]
id: number
objecttype: 'thing' | string
subtype: 'boardgame' | 'boardgameaccessory' | string
objecttype: 'thing' | (string & {})
subtype: 'boardgame' | 'boardgameaccessory' | (string & {})
objectid: number
objectname: string
username: string
Expand Down
2 changes: 1 addition & 1 deletion src/wrappers/getBggPlays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface BggPlaysResponse {
subtype: OfValue<string> | OfValue<string>[]
}
name: string
objecttype: 'thing' | string
objecttype: 'thing' | (string & {})
objectid: number
[prop: string]: unknown
}
Expand Down
6 changes: 3 additions & 3 deletions src/wrappers/getBggSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ export type SearchType = 'rpgitem' | 'videogame' | 'boardgame' | 'boardgameacces

export interface BggSearchParams {
query: string
type?: SearchType | SearchType[] | string
type?: SearchType | SearchType[] | (string & {})
exact?: OneOrNothing
}

export interface BggSearchResponse {
item: {
name: {
type: 'primary' | string
type: 'primary' | (string & {})
value: string
}
yearpublished?: OfValue<number>
type: 'boardgame' | 'boardgameexpansion' | 'rpgitem' | 'videogame' | string
type: 'boardgame' | 'boardgameexpansion' | 'rpgitem' | 'videogame' | (string & {})
id: number
[prop: string]: unknown
}[]
Expand Down
20 changes: 10 additions & 10 deletions src/wrappers/getBggThing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type BggThingLinkType =
| 'boardgamedesigner'
| 'boardgameartist'
| 'boardgamepublisher'
| string
| (string & {})

export type BggVideogameLinkType =
| 'videogameplatform'
Expand All @@ -37,7 +37,7 @@ export type BggVideogameLinkType =
| 'videogamemode'
| 'videogamedeveloper'
| 'videogamepublisher'
| string
| (string & {})

export type BggRpgitemLinkType =
| 'rpg'
Expand All @@ -48,10 +48,10 @@ export type BggRpgitemLinkType =
| 'rpgdesigner'
| 'rpgartist'
| 'rpgproducer'
| string
| (string & {})

export interface BggThingName {
type: 'primary' | 'alternate' | string
type: 'primary' | 'alternate' | (string & {})
sortindex: number
value: string
}
Expand All @@ -66,7 +66,7 @@ export interface BggThingLink<T = BggThingLinkType> {
export interface BggThingVideo {
id: number
title: string
category: 'instructional' | 'unboxing' | 'review' | 'humor' | 'session' | 'interview' | 'other' | string
category: 'instructional' | 'unboxing' | 'review' | 'humor' | 'session' | 'interview' | 'other' | (string & {})
language: string
link: string
username: string
Expand Down Expand Up @@ -136,7 +136,7 @@ export interface BggBoardgameItem extends BggThingItemBase {
length: OfValue<number>
depth: OfValue<number>
weight: OfValue<number>
type: 'boardgameversion' | string
type: 'boardgameversion' | (string & {})
id: number
[prop: string]: unknown
}>
Expand All @@ -151,7 +151,7 @@ export interface BggBoardgameItem extends BggThingItemBase {
bayesaverage: OfValue<number>
ranks: {
rank: SingleOrMany<{
type: 'subtype' | 'family' | string
type: 'subtype' | 'family' | (string & {})
id: number
name: string
friendlyname: string
Expand Down Expand Up @@ -189,7 +189,7 @@ export interface BggBoardgameaccessoryItem extends BggThingItemBase {
item: SingleOrMany<{
thumbnail?: string
image?: string
type: 'bgaccessoryversion' | string
type: 'bgaccessoryversion' | (string & {})
id: number
[prop: string]: unknown
}>
Expand All @@ -209,7 +209,7 @@ export interface BggVideogameItem extends BggThingItemBase {
releasedate: OfValue<string>
versions?: {
item: SingleOrMany<{
type: 'vgcharacterversion' | 'videogameversion' | string
type: 'vgcharacterversion' | 'videogameversion' | (string & {})
id: number
thumbnail?: string
image?: string
Expand All @@ -234,7 +234,7 @@ export interface BggRpgitemItem extends BggThingItemBase {
image?: string
name?: SingleOrMany<BggThingName>
yearpublished?: OfValue<number>
format: OfValue<'electronic' | 'hardcover' | string>
format: OfValue<'electronic' | 'hardcover' | (string & {})>
link?: SingleOrMany<{
type: string
id: number
Expand Down

0 comments on commit f0ac5ff

Please sign in to comment.