JSPM

  • Created
  • Published
  • Downloads 2180
  • Score
    100M100P100Q116677F
  • License MIT

Package Exports

  • @tcgdex/sdk

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tcgdex/sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

TCGdex Javacript SDK

Install

Yarn/npm

yarn add @tcgdex/sdk

or with npm

npm install @tcgdex/sdk

Usage

Note: a complete documentation is in progress

import TCGdex from '@tcgdex/sdk'
import TranslationUtil from '@tcgdex/sdk/TranslationUtil'
import Tag from '@tcgdex/sdk/interfaces/Tag'

// init the class
const tcgdex = new TCGdex("en") // Lang code (Optionnal) (See TranslationUtil.ts line 3)

// change lang
tcgdex.lang = "fr"

// get Card object wih global id
await tcgdex.getCard("base1-1")

// get Card object with local id and set
await tcgdex.getCard(1, "base1")

// get Set informations
await tcgdex.getSet("base1")

// get Expansion
await tcgdex.getExpansion("base")

// Translate information from code to the lang
TranslationUtil.translate("tag", Tag.STAGE2, "en")