@students-dev/audify-js 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +92 -441
  2. package/dist/AudioEngine.js +232 -0
  3. package/dist/cjs/index.js +1478 -1746
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/constants/index.js +35 -0
  6. package/dist/engine/Filters.js +137 -0
  7. package/dist/engine/MockAudioContext.js +53 -0
  8. package/dist/engine/Player.js +209 -0
  9. package/dist/esm/index.js +1474 -1744
  10. package/dist/esm/index.js.map +1 -1
  11. package/dist/events/EventBus.js +61 -0
  12. package/dist/index.js +18 -0
  13. package/dist/interfaces/index.js +1 -0
  14. package/dist/plugins/Plugin.js +27 -0
  15. package/dist/plugins/PluginManager.js +106 -0
  16. package/dist/providers/LavalinkProvider.js +81 -0
  17. package/dist/providers/LocalProvider.js +70 -0
  18. package/dist/providers/ProviderRegistry.js +20 -0
  19. package/dist/providers/SpotifyProvider.js +59 -0
  20. package/dist/providers/YouTubeProvider.js +48 -0
  21. package/dist/queue/Queue.js +186 -0
  22. package/dist/queue/Track.js +54 -0
  23. package/dist/types/AudioEngine.d.ts +107 -0
  24. package/dist/types/constants/index.d.ts +39 -0
  25. package/dist/types/engine/Filters.d.ts +25 -24
  26. package/dist/types/engine/MockAudioContext.d.ts +43 -0
  27. package/dist/types/engine/Player.d.ts +25 -21
  28. package/dist/types/events/EventBus.d.ts +17 -15
  29. package/dist/types/index.d.ts +17 -15
  30. package/dist/types/interfaces/index.d.ts +31 -0
  31. package/dist/types/plugins/Plugin.d.ts +11 -43
  32. package/dist/types/plugins/PluginManager.d.ts +19 -19
  33. package/dist/types/providers/LavalinkProvider.d.ts +15 -46
  34. package/dist/types/providers/LocalProvider.d.ts +11 -22
  35. package/dist/types/providers/ProviderRegistry.d.ts +10 -0
  36. package/dist/types/providers/SpotifyProvider.d.ts +12 -52
  37. package/dist/types/providers/YouTubeProvider.d.ts +11 -28
  38. package/dist/types/queue/Queue.d.ts +28 -22
  39. package/dist/types/queue/Track.d.ts +18 -16
  40. package/dist/types/utils/Logger.d.ts +12 -16
  41. package/dist/types/utils/Metadata.d.ts +16 -15
  42. package/dist/types/utils/Probe.d.ts +7 -7
  43. package/dist/types/utils/Time.d.ts +9 -9
  44. package/dist/utils/Logger.js +59 -0
  45. package/dist/utils/Metadata.js +90 -0
  46. package/dist/utils/Probe.js +59 -0
  47. package/dist/utils/Time.js +54 -0
  48. package/package.json +14 -8
@@ -0,0 +1,107 @@
1
+ import { Player } from './engine/Player';
2
+ import { Filters } from './engine/Filters';
3
+ import { Queue } from './queue/Queue';
4
+ import { EventBus } from './events/EventBus';
5
+ import { ProviderRegistry } from './providers/ProviderRegistry';
6
+ import { PluginManager } from './plugins/PluginManager';
7
+ import { LoopMode } from './constants';
8
+ import { IAudioEngine, IProvider, ITrack } from './interfaces';
9
+ /**
10
+ * Main audio engine class
11
+ */
12
+ export declare class AudioEngine implements IAudioEngine {
13
+ options: any;
14
+ player: Player;
15
+ filters: Filters;
16
+ queue: Queue;
17
+ eventBus: EventBus;
18
+ providers: ProviderRegistry;
19
+ plugins: PluginManager;
20
+ isReady: boolean;
21
+ constructor(options?: any);
22
+ /**
23
+ * Initialize the audio engine
24
+ */
25
+ initialize(): Promise<void>;
26
+ registerProvider(provider: IProvider): Promise<void>;
27
+ getProvider(name: string): IProvider | undefined;
28
+ /**
29
+ * Play track or resume playback
30
+ * @param track - Track to play or track identifier
31
+ */
32
+ play(track?: ITrack | string): Promise<void>;
33
+ /**
34
+ * Pause playback
35
+ */
36
+ pause(): void;
37
+ /**
38
+ * Stop playback
39
+ */
40
+ stop(): void;
41
+ /**
42
+ * Seek to position
43
+ * @param time - Time in seconds
44
+ */
45
+ seek(time: number): void;
46
+ /**
47
+ * Set volume
48
+ * @param volume - Volume level (0-1)
49
+ */
50
+ setVolume(volume: number): void;
51
+ /**
52
+ * Add track(s) to queue
53
+ * @param tracks - Track(s) to add
54
+ */
55
+ add(tracks: ITrack | ITrack[] | string | string[]): void;
56
+ /**
57
+ * Remove track from queue
58
+ * @param identifier - Track index or ID
59
+ */
60
+ remove(identifier: number | string): ITrack | null;
61
+ /**
62
+ * Skip to next track
63
+ */
64
+ next(): void;
65
+ /**
66
+ * Go to previous track
67
+ */
68
+ previous(): void;
69
+ /**
70
+ * Shuffle queue
71
+ */
72
+ shuffle(): void;
73
+ /**
74
+ * Clear queue
75
+ */
76
+ clear(): void;
77
+ /**
78
+ * Jump to track in queue
79
+ * @param index - Track index
80
+ */
81
+ jump(index: number): void;
82
+ /**
83
+ * Apply audio filter
84
+ * @param type - Filter type
85
+ * @param options - Filter options
86
+ */
87
+ applyFilter(type: any, options: any): void;
88
+ /**
89
+ * Remove audio filter
90
+ * @param type - Filter type
91
+ */
92
+ removeFilter(type: any): void;
93
+ /**
94
+ * Set loop mode
95
+ * @param mode - Loop mode
96
+ */
97
+ setLoopMode(mode: LoopMode): void;
98
+ /**
99
+ * Get current state
100
+ * @returns Engine state
101
+ */
102
+ getState(): any;
103
+ /**
104
+ * Destroy the engine
105
+ */
106
+ destroy(): void;
107
+ }
@@ -0,0 +1,39 @@
1
+ export declare const EVENTS: {
2
+ readonly READY: "ready";
3
+ readonly ERROR: "error";
4
+ readonly PLAY: "play";
5
+ readonly PAUSE: "pause";
6
+ readonly STOP: "stop";
7
+ readonly TRACK_START: "trackStart";
8
+ readonly TRACK_END: "trackEnd";
9
+ readonly TRACK_ADD: "trackAdd";
10
+ readonly TRACK_REMOVE: "trackRemove";
11
+ readonly QUEUE_UPDATE: "queueUpdate";
12
+ readonly FILTER_APPLIED: "filterApplied";
13
+ readonly VOLUME_CHANGE: "volumeChange";
14
+ readonly SEEK: "seek";
15
+ };
16
+ export type EventType = typeof EVENTS[keyof typeof EVENTS];
17
+ export declare const LOOP_MODES: {
18
+ readonly OFF: "off";
19
+ readonly TRACK: "track";
20
+ readonly QUEUE: "queue";
21
+ };
22
+ export type LoopMode = typeof LOOP_MODES[keyof typeof LOOP_MODES];
23
+ export declare const PLAYER_STATES: {
24
+ readonly IDLE: "idle";
25
+ readonly PLAYING: "playing";
26
+ readonly PAUSED: "paused";
27
+ readonly BUFFERING: "buffering";
28
+ };
29
+ export type PlayerState = typeof PLAYER_STATES[keyof typeof PLAYER_STATES];
30
+ export declare const FILTER_TYPES: {
31
+ readonly BASSBOOST: "bassboost";
32
+ readonly NIGHTCORE: "nightcore";
33
+ readonly VAPORWAVE: "vaporwave";
34
+ readonly ROTATE_8D: "8d";
35
+ readonly PITCH: "pitch";
36
+ readonly SPEED: "speed";
37
+ readonly REVERB: "reverb";
38
+ };
39
+ export type FilterType = typeof FILTER_TYPES[keyof typeof FILTER_TYPES];
@@ -1,48 +1,49 @@
1
+ import { FilterType } from '../constants';
1
2
  /**
2
3
  * Audio filters and effects
3
4
  */
4
- export class Filters {
5
- constructor(audioContext: any);
6
- audioContext: any;
7
- filters: Map<any, any>;
8
- enabled: Set<any>;
5
+ export declare class Filters {
6
+ private audioContext;
7
+ private filters;
8
+ private enabled;
9
+ constructor(audioContext: AudioContext);
9
10
  /**
10
11
  * Apply filter
11
- * @param {string} type - Filter type
12
- * @param {Object} options - Filter options
12
+ * @param type - Filter type
13
+ * @param options - Filter options
13
14
  */
14
- apply(type: string, options?: any): void;
15
+ apply(type: FilterType, options?: any): void;
15
16
  /**
16
17
  * Remove filter
17
- * @param {string} type - Filter type
18
+ * @param type - Filter type
18
19
  */
19
- remove(type: string): void;
20
+ remove(type: FilterType): void;
20
21
  /**
21
22
  * Clear all filters
22
23
  */
23
24
  clear(): void;
24
25
  /**
25
26
  * Check if filter is enabled
26
- * @param {string} type - Filter type
27
- * @returns {boolean} Is enabled
27
+ * @param type - Filter type
28
+ * @returns Is enabled
28
29
  */
29
- isEnabled(type: string): boolean;
30
+ isEnabled(type: FilterType): boolean;
30
31
  /**
31
32
  * Get enabled filters
32
- * @returns {Set} Enabled filter types
33
+ * @returns Enabled filter types
33
34
  */
34
- getEnabled(): Set<any>;
35
- applyBassBoost(options?: {}): void;
36
- applyNightcore(options?: {}): void;
37
- applyVaporwave(options?: {}): void;
38
- apply8DRotate(options?: {}): void;
39
- applyPitch(options?: {}): void;
40
- applySpeed(options?: {}): void;
41
- applyReverb(options?: {}): void;
35
+ getEnabled(): Set<FilterType>;
36
+ private applyBassBoost;
37
+ private applyNightcore;
38
+ private applyVaporwave;
39
+ private apply8DRotate;
40
+ private applyPitch;
41
+ private applySpeed;
42
+ private applyReverb;
42
43
  /**
43
44
  * Connect filters to audio node
44
- * @param {AudioNode} input - Input node
45
- * @param {AudioNode} output - Output node
45
+ * @param input - Input node
46
+ * @param output - Output node
46
47
  */
47
48
  connect(input: AudioNode, output: AudioNode): void;
48
49
  }
@@ -0,0 +1,43 @@
1
+ export declare class MockAudioContext {
2
+ state: string;
3
+ currentTime: number;
4
+ private startTime;
5
+ constructor();
6
+ private updateTime;
7
+ createGain(): {
8
+ connect: () => void;
9
+ gain: {
10
+ value: number;
11
+ };
12
+ };
13
+ createBiquadFilter(): {
14
+ connect: () => void;
15
+ frequency: {
16
+ value: number;
17
+ };
18
+ gain: {
19
+ value: number;
20
+ };
21
+ };
22
+ createPanner(): {
23
+ connect: () => void;
24
+ };
25
+ createConvolver(): {
26
+ connect: () => void;
27
+ };
28
+ createBufferSource(): MockAudioBufferSource;
29
+ decodeAudioData(buffer: ArrayBuffer): Promise<any>;
30
+ suspend(): void;
31
+ resume(): void;
32
+ close(): void;
33
+ }
34
+ declare class MockAudioBufferSource {
35
+ buffer: any;
36
+ onended: (() => void) | null;
37
+ private context;
38
+ constructor(context: MockAudioContext);
39
+ connect(): void;
40
+ start(when?: number, offset?: number): void;
41
+ stop(): void;
42
+ }
43
+ export {};
@@ -1,22 +1,32 @@
1
+ import { LoopMode } from '../constants';
2
+ import { EventBus } from '../events/EventBus';
3
+ import { ITrack } from '../interfaces';
4
+ import { AudioEngine } from '../AudioEngine';
1
5
  /**
2
6
  * Audio player with playback controls
3
7
  */
4
- export class Player {
5
- constructor(audioEngine: any);
6
- audioEngine: any;
7
- audioContext: any;
8
- source: any;
8
+ export declare class Player {
9
+ private audioEngine;
10
+ audioContext: AudioContext;
11
+ private source;
9
12
  isPlaying: boolean;
10
13
  currentTime: number;
11
14
  duration: number;
12
15
  volume: number;
13
- loopMode: string;
16
+ loopMode: LoopMode;
14
17
  eventBus: EventBus;
18
+ constructor(audioEngine: AudioEngine);
15
19
  /**
16
- * Play audio
17
- * @param {Track} track - Track to play
20
+ * Play audio track
21
+ * @param track - Track to play
18
22
  */
19
- play(track: Track): Promise<void>;
23
+ play(track: ITrack): Promise<void>;
24
+ /**
25
+ * Play audio from URL/Stream directly
26
+ * This is called by Providers or as fallback
27
+ * @param track - Track object with URL
28
+ */
29
+ playStream(track: ITrack): Promise<void>;
20
30
  /**
21
31
  * Pause playback
22
32
  */
@@ -31,32 +41,26 @@ export class Player {
31
41
  stop(): void;
32
42
  /**
33
43
  * Seek to position
34
- * @param {number} time - Time in seconds
44
+ * @param time - Time in seconds
35
45
  */
36
46
  seek(time: number): void;
37
47
  /**
38
48
  * Set volume
39
- * @param {number} volume - Volume level (0-1)
49
+ * @param volume - Volume level (0-1)
40
50
  */
41
51
  setVolume(volume: number): void;
42
52
  /**
43
53
  * Set loop mode
44
- * @param {string} mode - Loop mode
45
- */
46
- setLoopMode(mode: string): void;
47
- /**
48
- * Load track into player
49
- * @param {Track} track - Track to load
54
+ * @param mode - Loop mode
50
55
  */
51
- loadTrack(track: Track): Promise<void>;
56
+ setLoopMode(mode: LoopMode): void;
52
57
  /**
53
58
  * Handle track end based on loop mode
54
59
  */
55
- handleTrackEnd(): void;
60
+ private handleTrackEnd;
56
61
  /**
57
62
  * Get current playback state
58
- * @returns {Object} State object
63
+ * @returns State object
59
64
  */
60
65
  getState(): any;
61
66
  }
62
- import { EventBus } from '../events/EventBus.js';
@@ -1,35 +1,37 @@
1
+ export type Listener = (data?: any) => void;
1
2
  /**
2
3
  * Simple event emitter for handling events
3
4
  */
4
- export class EventBus {
5
- events: {};
5
+ export declare class EventBus {
6
+ private events;
7
+ constructor();
6
8
  /**
7
9
  * Register an event listener
8
- * @param {string} event - Event name
9
- * @param {Function} callback - Callback function
10
+ * @param event - Event name
11
+ * @param callback - Callback function
10
12
  */
11
- on(event: string, callback: Function): void;
13
+ on(event: string, callback: Listener): void;
12
14
  /**
13
15
  * Remove an event listener
14
- * @param {string} event - Event name
15
- * @param {Function} callback - Callback function
16
+ * @param event - Event name
17
+ * @param callback - Callback function
16
18
  */
17
- off(event: string, callback: Function): void;
19
+ off(event: string, callback: Listener): void;
18
20
  /**
19
21
  * Emit an event
20
- * @param {string} event - Event name
21
- * @param {*} data - Data to pass to listeners
22
+ * @param event - Event name
23
+ * @param data - Data to pass to listeners
22
24
  */
23
- emit(event: string, data: any): void;
25
+ emit(event: string, data?: any): void;
24
26
  /**
25
27
  * Remove all listeners for an event
26
- * @param {string} event - Event name
28
+ * @param event - Event name
27
29
  */
28
30
  removeAllListeners(event: string): void;
29
31
  /**
30
32
  * Get all listeners for an event
31
- * @param {string} event - Event name
32
- * @returns {Function[]} Array of listeners
33
+ * @param event - Event name
34
+ * @returns Array of listeners
33
35
  */
34
- listeners(event: string): Function[];
36
+ listeners(event: string): Listener[];
35
37
  }
@@ -1,15 +1,17 @@
1
- export { AudioEngine } from "./engine/AudioEngine.js";
2
- export { Queue } from "./queue/Queue.js";
3
- export { Track } from "./queue/Track.js";
4
- export { PluginManager } from "./plugins/PluginManager.js";
5
- export { EventBus } from "./events/EventBus.js";
6
- export { Logger } from "./utils/Logger.js";
7
- export { TimeUtils } from "./utils/Time.js";
8
- export { MetadataUtils } from "./utils/Metadata.js";
9
- export { ProbeUtils } from "./utils/Probe.js";
10
- export { YouTubeProvider } from "./providers/YouTubeProvider.js";
11
- export { SoundCloudProvider } from "./providers/SoundCloudProvider.js";
12
- export { LocalProvider } from "./providers/LocalProvider.js";
13
- export { SpotifyProvider } from "./providers/SpotifyProvider.js";
14
- export { LavalinkProvider } from "./providers/LavalinkProvider.js";
15
- export * from "./constants/Modes.js";
1
+ export { AudioEngine } from './AudioEngine';
2
+ export { Queue } from './queue/Queue';
3
+ export { Track } from './queue/Track';
4
+ export { Filters as FilterManager } from './engine/Filters';
5
+ export { Filters } from './engine/Filters';
6
+ export { PluginManager } from './plugins/PluginManager';
7
+ export { Plugin } from './plugins/Plugin';
8
+ export { EventBus } from './events/EventBus';
9
+ export * from './constants';
10
+ export * from './interfaces';
11
+ export * from './providers/LocalProvider';
12
+ export * from './providers/YouTubeProvider';
13
+ export * from './providers/SpotifyProvider';
14
+ export * from './providers/LavalinkProvider';
15
+ export * from './utils/Logger';
16
+ export * from './utils/Time';
17
+ export * from './utils/Metadata';
@@ -0,0 +1,31 @@
1
+ export interface ITrack {
2
+ id: string;
3
+ url: string;
4
+ title: string;
5
+ artist?: string;
6
+ duration?: number;
7
+ thumbnail?: string;
8
+ source?: string;
9
+ metadata: Record<string, any>;
10
+ }
11
+ export interface IAudioEngine {
12
+ play(track: ITrack): Promise<void>;
13
+ player: any;
14
+ }
15
+ export interface IProvider {
16
+ name: string;
17
+ version: string;
18
+ initialize(engine: IAudioEngine): Promise<void>;
19
+ resolve(query: string): Promise<ITrack | ITrack[]>;
20
+ play(track: ITrack): Promise<void>;
21
+ stop(): Promise<void>;
22
+ destroy(): void;
23
+ }
24
+ export interface IPlugin {
25
+ name: string;
26
+ version: string;
27
+ onLoad(engine: IAudioEngine): void;
28
+ onUnload(): void;
29
+ onEnable(): void;
30
+ onDisable(): void;
31
+ }
@@ -1,49 +1,17 @@
1
- /**
2
- * Base plugin class
3
- */
4
- export class Plugin {
5
- constructor(name: any, version?: string);
6
- name: any;
1
+ import { IPlugin, IAudioEngine } from '../interfaces';
2
+ export declare abstract class Plugin implements IPlugin {
3
+ name: string;
7
4
  version: string;
8
5
  enabled: boolean;
9
6
  loaded: boolean;
10
- /**
11
- * Called when plugin is loaded
12
- * @param {AudioEngine} engine - Audio engine instance
13
- */
14
- onLoad(engine: AudioEngine): void;
15
- engine: AudioEngine;
16
- /**
17
- * Called when plugin is enabled
18
- */
7
+ protected engine?: IAudioEngine;
8
+ constructor(name: string, version?: string);
9
+ onLoad(engine: IAudioEngine): void;
10
+ onUnload(): void;
19
11
  onEnable(): void;
20
- /**
21
- * Called when plugin is disabled
22
- */
23
12
  onDisable(): void;
24
- /**
25
- * Hook called before play
26
- * @param {Track} track - Track being played
27
- */
28
- beforePlay(track: Track): void;
29
- /**
30
- * Hook called after play
31
- * @param {Track} track - Track being played
32
- */
33
- afterPlay(track: Track): void;
34
- /**
35
- * Hook called when track ends
36
- * @param {Track} track - Track that ended
37
- */
38
- trackEnd(track: Track): void;
39
- /**
40
- * Hook called when queue updates
41
- * @param {Queue} queue - Updated queue
42
- */
43
- queueUpdate(queue: Queue): void;
44
- /**
45
- * Get plugin info
46
- * @returns {Object} Plugin information
47
- */
48
- getInfo(): any;
13
+ beforePlay(track: any): void;
14
+ afterPlay(track: any): void;
15
+ trackEnd(track: any): void;
16
+ queueUpdate(queue: any): void;
49
17
  }
@@ -1,51 +1,51 @@
1
+ import { IPlugin, IAudioEngine } from '../interfaces';
1
2
  /**
2
3
  * Plugin manager for loading and managing plugins
3
4
  */
4
- export class PluginManager {
5
- constructor(audioEngine: any);
6
- engine: any;
7
- plugins: Map<any, any>;
5
+ export declare class PluginManager {
6
+ private engine;
7
+ private plugins;
8
+ constructor(engine: IAudioEngine);
8
9
  /**
9
10
  * Load a plugin
10
- * @param {Plugin} plugin - Plugin instance
11
+ * @param plugin - Plugin instance
11
12
  */
12
- load(plugin: Plugin): void;
13
+ load(plugin: IPlugin): void;
13
14
  /**
14
15
  * Enable a plugin
15
- * @param {string} name - Plugin name
16
+ * @param name - Plugin name
16
17
  */
17
18
  enable(name: string): void;
18
19
  /**
19
20
  * Disable a plugin
20
- * @param {string} name - Plugin name
21
+ * @param name - Plugin name
21
22
  */
22
23
  disable(name: string): void;
23
24
  /**
24
25
  * Unload a plugin
25
- * @param {string} name - Plugin name
26
+ * @param name - Plugin name
26
27
  */
27
28
  unload(name: string): void;
28
29
  /**
29
30
  * Get plugin by name
30
- * @param {string} name - Plugin name
31
- * @returns {Plugin|null} Plugin instance
31
+ * @param name - Plugin name
32
+ * @returns Plugin instance
32
33
  */
33
- get(name: string): Plugin | null;
34
+ get(name: string): IPlugin | undefined;
34
35
  /**
35
36
  * Get all plugins
36
- * @returns {Map} Map of plugins
37
+ * @returns Map of plugins
37
38
  */
38
- getAll(): Map<any, any>;
39
+ getAll(): Map<string, IPlugin>;
39
40
  /**
40
41
  * Get enabled plugins
41
- * @returns {Plugin[]} Array of enabled plugins
42
+ * @returns Array of enabled plugins
42
43
  */
43
- getEnabled(): Plugin[];
44
+ getEnabled(): IPlugin[];
44
45
  /**
45
46
  * Call hook on all enabled plugins
46
- * @param {string} hook - Hook name
47
- * @param {...*} args - Arguments to pass
47
+ * @param hook - Hook name
48
+ * @param args - Arguments to pass
48
49
  */
49
50
  callHook(hook: string, ...args: any[]): void;
50
51
  }
51
- import { Plugin } from './Plugin.js';
@@ -1,48 +1,17 @@
1
- /**
2
- * Lavalink provider for connecting to Lavalink server
3
- */
4
- export class LavalinkProvider {
5
- constructor(options?: {});
6
- host: any;
7
- port: any;
8
- password: any;
9
- secure: any;
10
- manager: LavalinkManager<import("lavalink-client").Player>;
11
- node: any;
12
- isConnected: boolean;
13
- /**
14
- * Connect to Lavalink server
15
- * @returns {Promise<void>}
16
- */
17
- connect(): Promise<void>;
18
- /**
19
- * Disconnect from Lavalink server
20
- */
21
- disconnect(): void;
22
- /**
23
- * Create a player for a guild/channel
24
- * @param {string} guildId - Guild ID
25
- * @param {string} channelId - Voice channel ID
26
- * @returns {Object} Player instance
27
- */
28
- createPlayer(guildId: string, channelId: string): any;
29
- /**
30
- * Load track from Lavalink
31
- * @param {string} identifier - Track identifier (URL or search query)
32
- * @returns {Promise<Object>} Track info
33
- */
34
- loadTrack(identifier: string): Promise<any>;
35
- /**
36
- * Format Lavalink track to internal format
37
- * @param {Object} lavalinkTrack - Lavalink track object
38
- * @returns {Object} Formatted track
39
- * @private
40
- */
1
+ import { IProvider, ITrack, IAudioEngine } from '../interfaces';
2
+ export declare class LavalinkProvider implements IProvider {
3
+ name: string;
4
+ version: string;
5
+ private engine;
6
+ private manager;
7
+ private node;
8
+ private options;
9
+ constructor(options?: any);
10
+ initialize(engine: IAudioEngine): Promise<void>;
11
+ resolve(identifier: string): Promise<ITrack | ITrack[]>;
12
+ play(track: ITrack): Promise<void>;
13
+ createPlayer(guildId: string, channelId: string): import("lavalink-client").Player;
14
+ stop(): Promise<void>;
15
+ destroy(): void;
41
16
  private _formatTrack;
42
- /**
43
- * Get node stats
44
- * @returns {Promise<Object>} Node stats
45
- */
46
- getStats(): Promise<any>;
47
17
  }
48
- import { LavalinkManager } from 'lavalink-client';