Skip to content

Commit

Permalink
add typings
Browse files Browse the repository at this point in the history
  • Loading branch information
fersilva16 committed Jul 24, 2020
1 parent 6b1534c commit 4d92dcc
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
declare module 'runeterra' {
export class DeckEncoder {
static decode(code: string): Card[];

static encode(cards: Card[]): string;

static encodeNofs(cards: Card[]): number[];

static encodeGroup(group: Card[]): number[];

static isValidDeck(cards: Card[]): boolean;

static groupByFactionAndSetSorted(cards: Card[]): Card[][];

static MAX_KNOWN_VERSION: number;
}

export class Card {
code: string;
count: number;

get set(): number;

get faction(): Faction;

get id(): number;

static from(set: string, faction: string, number: string, count: number): Card;

static fromCardString(cardString: number): Card;
}

export class Faction {
shortCode: string;
id: number;

static fromCode(code: string): Faction;

static fromID(id: number): Faction;

static FACTIONS: string[];
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"description": "Legends of Runeterra deck code encoder/decoder",
"main": "src/index.js",
"types": "index.d.ts",
"scripts": {
"test": "mocha test --recursive",
"lint": "standard --fix"
Expand Down

0 comments on commit 4d92dcc

Please sign in to comment.