Skip to main content
Module

x/hypixel/util/ResultObject.ts>ResultObject

With thorough IntelliSense support & 100% test coverage, this is an unopinionated async/await API wrapper for Hypixel's Public API. It is developed in TypeScript complete with documentation, typed interfaces for all API responses (and an OpenAPI 3.0 schema!), built-in rate-limit handling, flexible cache support, helper functions, and support for undocumented endpoints.
Latest
type alias ResultObject
import { type ResultObject } from "https://deno.land/x/hypixel@v3.1.1/util/ResultObject.ts";

Generic intersection type for result objects to include metadata as a non-enumerable property.

Examples

Example 1

const result = await client.watchdogstats();
console.log(result);
// {watchdog_lastMinute: 1, staff_rollingDaily: 2609, watchdog_total: 5591714, watchdog_rollingDaily: 4213, …}
console.log(result.meta)
// {success: true}

Type Parameters

T extends Components.Schemas.ApiSuccess
K extends (keyof T)[]
definition: (T[K[number]] extends string | number | boolean ? Omit<T, K[number]> : T[K[number]]) & { meta: (T[K[number]] extends string | number | boolean ? Pick<T, K[number]> : Omit<T, K[number]>) & DefaultMeta; }