From b3003e6419faa32363cc2a607b8e626648cac71c Mon Sep 17 00:00:00 2001 From: Sergey Papushin Date: Thu, 16 Apr 2020 18:53:43 -0500 Subject: [PATCH] Fix linter errors --- src/api/GameList.ts | 4 ++-- src/api/SpeedrunCom.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/GameList.ts b/src/api/GameList.ts index 3f43a72..6dd16ca 100644 --- a/src/api/GameList.ts +++ b/src/api/GameList.ts @@ -20,7 +20,7 @@ const gameIdToCategoriesPromises: Map> = new Map(); const gameIdToGameInfoMap: Map = new Map(); const gameIdToGameInfoPromises: Map> = new Map(); const gameAndCategoryToLeaderboardPromises: Map> = new Map(); -const gameAndCategoryToLeaderboardMap: Map>> = new Map(); +const gameAndCategoryToLeaderboardMap: Map[]> = new Map(); let gameListPromise: Option> = null; let platformListPromise: Option> = null; let regionListPromise: Option> = null; @@ -61,7 +61,7 @@ export function getRegions(): Map { return regionList; } -export function getLeaderboard(gameName: string, categoryName: string): Array> | undefined { +export function getLeaderboard(gameName: string, categoryName: string): Run[] | undefined { const key = JSON.stringify({ gameName, categoryName }); return gameAndCategoryToLeaderboardMap.get(key); } diff --git a/src/api/SpeedrunCom.ts b/src/api/SpeedrunCom.ts index 8731781..e104151 100644 --- a/src/api/SpeedrunCom.ts +++ b/src/api/SpeedrunCom.ts @@ -148,10 +148,10 @@ export interface Record { run: Run, } -export type PlayersNotEmbedded = Array; +export type PlayersNotEmbedded = (PlayerUserRef | PlayerGuest)[]; export interface PlayersEmbedded { - data: Array, + data: (PlayerUser | PlayerGuest)[], } export interface Run { @@ -314,7 +314,7 @@ async function executePaginatedRequest(uri: string): Promise> { return new Page(data as T[], next); } -export async function getGame(gameId: string, embeds?: Array<"variables">): Promise { +export async function getGame(gameId: string, embeds?: "variables"[]): Promise { const parameters = []; if (embeds !== undefined) { parameters.push(`embed=${embeds.join(",")}`); @@ -349,7 +349,7 @@ export async function getCategories(gameId: string): Promise { export async function getLeaderboard( gameId: string, categoryId: string, - embeds?: Array<"players">, + embeds?: "players"[], ): Promise { const parameters = []; if (embeds !== undefined) {