Skip to content

Commit 3e95d57

Browse files
add: types for Lyrics and structural methods
1 parent bcaaf04 commit 3e95d57

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

build/index.d.ts

+28-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { EventEmitter } from "events";
22

3+
type Nullable<T> = T | null
4+
35
export declare class Track {
46
constructor(data: any, requester: any, node: Node);
57

@@ -13,6 +15,7 @@ export declare class Track {
1315
sourceName: string;
1416
title: string;
1517
uri: string;
18+
isrc: string | null
1619
thumbnail: string | null;
1720
requester: any;
1821
};
@@ -459,6 +462,30 @@ type NodeInfoSemanticVersionObj = {
459462
patch: number;
460463
}
461464

465+
export interface NodeLyricsResult {
466+
/** The name of the source */
467+
sourceName: string;
468+
/** The name of the provider */
469+
provider: string;
470+
/** The Lyrics Text */
471+
text: Nullable<string>;
472+
/** The Lyrics Lines */
473+
lines: Array<NodeLyricsLine>;
474+
/** Additional plugin related Information */
475+
plugin: object
476+
}
477+
478+
interface NodeLyricsLine {
479+
/** timestamp of the line in ms(milliseconds) */
480+
timestamp: number;
481+
/** Duration of the line in ms(milliseconds) */
482+
duration: number;
483+
/** The Lyric String */
484+
line: string;
485+
/** Additional plugin related Information */
486+
plugin: object
487+
}
488+
462489
export declare class Node {
463490
constructor(riffy: Riffy, node: LavalinkNode, options: NodeOptions);
464491
public riffy: Riffy;
@@ -488,7 +515,7 @@ export declare class Node {
488515

489516
public connected: boolean;
490517
public reconnecting: boolean;
491-
public info: NodeInfo;
518+
public info: NodeInfo | {};
492519
public stats: {
493520
players: 0,
494521
playingPlayers: 0,

build/structures/Node.js

+11
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ class Node {
6565

6666
this.lastStats = Date.now();
6767
}
68+
69+
70+
lyrics = {
71+
/** @description fetches Lyrics for Currently playing Track
72+
* @param {boolean} skipTrackSource skips the Track Source & fetches from highest priority source (configured on Lavalink Server)
73+
*/
74+
getCurrentTrack: async (skipTrackSource) {
75+
76+
}
77+
}
78+
6879
/**
6980
* @typedef {Object} fetchInfoOptions
7081
* @property {import("..").Version} [restVersion] The Rest Version to fetch info the from, Default: one set in the constructor(Node.restVersion)

0 commit comments

Comments
 (0)