File tree 2 files changed +18
-16
lines changed
2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change 1
1
import WebSocket = require( 'ws' ) ;
2
2
import { EventEmitter } from 'events' ;
3
3
import Connection , { Options as ConnectionOptions } from '../core/Connection' ;
4
- import Http , { Track , TrackResponse } from '../core/Http' ;
4
+ import Http , { Track , TrackInfo , TrackResponse } from '../core/Http' ;
5
5
import PlayerStore from '../core/PlayerStore' ;
6
6
7
7
export interface VoiceStateUpdate {
@@ -74,9 +74,9 @@ export default abstract class BaseNode extends EventEmitter {
74
74
throw new Error ( 'no available http module' ) ;
75
75
}
76
76
77
- public decode ( track : string ) : Promise < Track > ;
77
+ public decode ( track : string ) : Promise < TrackInfo > ;
78
78
public decode ( tracks : string [ ] ) : Promise < Track [ ] > ;
79
- public decode ( tracks : string | string [ ] ) : Promise < Track | Track [ ] > {
79
+ public decode ( tracks : string | string [ ] ) : Promise < TrackInfo | Track [ ] > {
80
80
if ( this . http ) return this . http . decode ( tracks ) ;
81
81
throw new Error ( 'no available http module' ) ;
82
82
}
Original file line number Diff line number Diff line change @@ -39,18 +39,20 @@ export interface PlaylistInfo {
39
39
selectedTrack ?: number
40
40
}
41
41
42
+ export interface TrackInfo {
43
+ identifier : string ;
44
+ isSeekable : boolean ;
45
+ author : string ;
46
+ length : number ;
47
+ isStream : boolean ;
48
+ position : number ;
49
+ title : string ;
50
+ uri : string ;
51
+ }
52
+
42
53
export interface Track {
43
54
track : string ;
44
- info : {
45
- identifier : string ;
46
- isSeekable : boolean ;
47
- author : string ;
48
- length : number ;
49
- isStream : boolean ;
50
- position : number ;
51
- title : string ;
52
- uri : string ;
53
- } ;
55
+ info : TrackInfo ;
54
56
}
55
57
56
58
export default class Http {
@@ -77,10 +79,10 @@ export default class Http {
77
79
return this . do ( 'GET' , url ) ;
78
80
}
79
81
80
- public decode ( track : string ) : Promise < Track > ;
82
+ public decode ( track : string ) : Promise < TrackInfo > ;
81
83
public decode ( tracks : string [ ] ) : Promise < Track [ ] > ;
82
- public decode ( tracks : string | string [ ] ) : Promise < Track | Track [ ] > ;
83
- public decode ( tracks : string | string [ ] ) : Promise < Track | Track [ ] > {
84
+ public decode ( tracks : string | string [ ] ) : Promise < TrackInfo | Track [ ] > ;
85
+ public decode ( tracks : string | string [ ] ) : Promise < TrackInfo | Track [ ] > {
84
86
const url = this . url ( ) ;
85
87
if ( Array . isArray ( tracks ) ) {
86
88
url . pathname = '/decodetracks' ;
You can’t perform that action at this time.
0 commit comments