From 98f3b98055a0d08925614c80597a7fcef6dce218 Mon Sep 17 00:00:00 2001 From: cyclane Date: Sat, 3 Jul 2021 10:53:43 +0100 Subject: [PATCH] Promise type fix --- src/lib/hypixel.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lib/hypixel.ts b/src/lib/hypixel.ts index c351dc5..98013c1 100644 --- a/src/lib/hypixel.ts +++ b/src/lib/hypixel.ts @@ -1,11 +1,9 @@ import { authorize, requestWithDefaults } from "./util"; -export type HypixelResponse = Promise< - { - _response: Response; - success: boolean; - } & T ->; +export type HypixelResponse = { + _response: Response; + success: boolean; +} & T; export const ENDPOINT = "https://api.hypixel.net/"; const request = requestWithDefaults(ENDPOINT); @@ -15,15 +13,17 @@ const request = requestWithDefaults(ENDPOINT); * @param key API key * @returns A response with the API key information */ -export async function getAPIKeyInformation(key: string): HypixelResponse<{ - record?: { - key: string; - owner: string; - limit: number; - queriesInPastMin: number; - totalQueries: number; - }; -}> { +export async function getAPIKeyInformation(key: string): Promise< + HypixelResponse<{ + record?: { + key: string; + owner: string; + limit: number; + queriesInPastMin: number; + totalQueries: number; + }; + }> +> { let response = await request("/key", authorize(key)); return { ...(await response.json()),