diff --git a/src/Utils.ts b/src/Utils.ts index b09ab4ad..fd3ca128 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -1,36 +1,20 @@ export type Constructor = new (...args: unknown[]) => T; -export type OmitNested> = { - [key in keyof I]: key extends K ? Omit : I[key]; +export type OmitNested> = { + [key in keyof I]: key extends K ? Omit : I[key]; }; /** * @see https://github.com/microsoft/TypeScript/issues/43505#issuecomment-1686128430 */ export type NumericRange< - start extends number, - end extends number, - arr extends unknown[] = [], - acc extends number = never, + start extends number, + end extends number, + arr extends unknown[] = [], + acc extends number = never > = arr['length'] extends end - ? acc | start | end - : NumericRange; - -export type OmitNested> = { - [key in keyof I]: key extends K ? Omit : I[key]; -}; - -/** - * @see https://github.com/microsoft/TypeScript/issues/43505#issuecomment-1686128430 - */ -export type NumericRange< - start extends number, - end extends number, - arr extends unknown[] = [], - acc extends number = never, -> = arr['length'] extends end - ? acc | start | end - : NumericRange; + ? acc | start | end + : NumericRange; /** * Merge the default options to user input diff --git a/src/node/Node.ts b/src/node/Node.ts index 6b0d34d7..b758c14f 100644 --- a/src/node/Node.ts +++ b/src/node/Node.ts @@ -97,7 +97,7 @@ export interface Stats { * @see https://semver.org/spec/v2.0.0.html * @see https://lavalink.dev/api/rest.html#version-object */ -export type NodeInfoVersion = { +export interface NodeInfoVersion { /** * Full version string */ @@ -122,13 +122,13 @@ export type NodeInfoVersion = { * Build metadata as a dot separated list of identifiers */ build?: string; -}; +} /** * Lavalink Git information * @see https://lavalink.dev/api/rest.html#git-object */ -export type NodeInfoGit = { +export interface NodeInfoGit { /** * Branch of build */ @@ -141,13 +141,13 @@ export type NodeInfoGit = { * Millisecond unix timestamp for when the commit was created */ commitTime: number; -}; +} /** * Lavalink plugins * @see https://lavalink.dev/api/rest.html#plugin-object */ -export type NodeInfoPlugin = { +export interface NodeInfoPlugin { /** * Name of the plugin */ @@ -156,13 +156,13 @@ export type NodeInfoPlugin = { * Version of the plugin */ version: string; -}; +} /** * Node information * @see https://lavalink.dev/api/rest.html#get-lavalink-info */ -export type NodeInfo = { +export interface NodeInfo { /** * Version of this Lavalink server */ @@ -195,7 +195,7 @@ export type NodeInfo = { * Enabled plugins for this server */ plugins: NodeInfoPlugin[]; -}; +} export interface ResumableHeaders { [key: string]: string; diff --git a/src/node/Rest.ts b/src/node/Rest.ts index 3118a5b4..08cb5d54 100644 --- a/src/node/Rest.ts +++ b/src/node/Rest.ts @@ -238,7 +238,7 @@ export interface EmptyResult { * Empty object * @see https://lavalink.dev/api/rest.html#empty-result-data */ - data: {}; + data: Record; } /** @@ -426,7 +426,7 @@ export interface LavalinkPlayerVoice { * Voice state of player * @see https://lavalink.dev/api/rest.html#voice-state */ -export interface LavalinkPlayerVoiceOptions extends Omit {} +export type LavalinkPlayerVoiceOptions = Omit; /** * Represents a Lavalink player