ChiriVulpes / scryfall-sdk

A Node.js SDK for https://scryfall.com/docs/api, written in TypeScript.
MIT License
98 stars 14 forks source link

Property 'gatherer' of type 'string | undefined' is not assignable to string index type 'string'. importing the library in a clean project. #11

Closed usersaurus closed 5 years ago

usersaurus commented 5 years ago

Importing the library in a clean create-react-app ts project is throwing the following error in IScry.d.ts

Property 'gatherer' of type 'string | undefined' is not assignable to string index type 'string'.

The same is happening in the following interfaces

`export interface RelatedUris { gatherer?: string; tcgplayer_decks?: string; edhrec?: string; mtgtop8?: string;

}`

`export interface PurchaseUris { amazon?: string; ebay?: string; tcgplayer?: string; magiccardmarket?: string; cardhoarder?: string; card_kingdom?: string; mtgo_traders?: string; coolstuffinc?: string;

}`

Removing ? in all these types fix the problem (and, as far as I know, that info is always populated by scryfall api).

Don't know if I'm missing something. If not, I'm able to PR the change.

ChiriVulpes commented 5 years ago

What version of typescript are you using?

usersaurus commented 5 years ago

Oh, sorry. Tried with Typescript 3.1.3 and 3.1.5.

usersaurus commented 5 years ago

Not working correctly in 3.1.6 too

ChiriVulpes commented 5 years ago

Should be fixed as of v1.3.3