Skip to content

Commit

Permalink
add: types for Lyrics and structural methods
Browse files Browse the repository at this point in the history
  • Loading branch information
UnschooledGamer committed Oct 23, 2024
1 parent bcaaf04 commit 3e95d57
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
29 changes: 28 additions & 1 deletion build/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { EventEmitter } from "events";

type Nullable<T> = T | null

export declare class Track {
constructor(data: any, requester: any, node: Node);

Expand All @@ -13,6 +15,7 @@ export declare class Track {
sourceName: string;
title: string;
uri: string;
isrc: string | null
thumbnail: string | null;
requester: any;
};
Expand Down Expand Up @@ -459,6 +462,30 @@ type NodeInfoSemanticVersionObj = {
patch: number;
}

export interface NodeLyricsResult {
/** The name of the source */
sourceName: string;
/** The name of the provider */
provider: string;
/** The Lyrics Text */
text: Nullable<string>;
/** The Lyrics Lines */
lines: Array<NodeLyricsLine>;
/** Additional plugin related Information */
plugin: object
}

interface NodeLyricsLine {
/** timestamp of the line in ms(milliseconds) */
timestamp: number;
/** Duration of the line in ms(milliseconds) */
duration: number;
/** The Lyric String */
line: string;
/** Additional plugin related Information */
plugin: object
}

export declare class Node {
constructor(riffy: Riffy, node: LavalinkNode, options: NodeOptions);
public riffy: Riffy;
Expand Down Expand Up @@ -488,7 +515,7 @@ export declare class Node {

public connected: boolean;
public reconnecting: boolean;
public info: NodeInfo;
public info: NodeInfo | {};
public stats: {
players: 0,
playingPlayers: 0,
Expand Down
11 changes: 11 additions & 0 deletions build/structures/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ class Node {

this.lastStats = Date.now();
}


lyrics = {
/** @description fetches Lyrics for Currently playing Track
* @param {boolean} skipTrackSource skips the Track Source & fetches from highest priority source (configured on Lavalink Server)
*/
getCurrentTrack: async (skipTrackSource) {

}
}

/**
* @typedef {Object} fetchInfoOptions
* @property {import("..").Version} [restVersion] The Rest Version to fetch info the from, Default: one set in the constructor(Node.restVersion)
Expand Down

0 comments on commit 3e95d57

Please sign in to comment.