@students-dev/audify-js 1.0.0 → 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 (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -310
  3. package/dist/AudioEngine.js +232 -0
  4. package/dist/cjs/index.js +1497 -1392
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/constants/index.js +35 -0
  7. package/dist/engine/Filters.js +137 -0
  8. package/dist/engine/MockAudioContext.js +53 -0
  9. package/dist/engine/Player.js +209 -0
  10. package/dist/esm/index.js +1490 -1389
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/events/EventBus.js +61 -0
  13. package/dist/index.js +18 -0
  14. package/dist/interfaces/index.js +1 -0
  15. package/dist/plugins/Plugin.js +27 -0
  16. package/dist/plugins/PluginManager.js +106 -0
  17. package/dist/providers/LavalinkProvider.js +81 -0
  18. package/dist/providers/LocalProvider.js +70 -0
  19. package/dist/providers/ProviderRegistry.js +20 -0
  20. package/dist/providers/SpotifyProvider.js +59 -0
  21. package/dist/providers/YouTubeProvider.js +48 -0
  22. package/dist/queue/Queue.js +186 -0
  23. package/dist/queue/Track.js +54 -0
  24. package/dist/types/AudioEngine.d.ts +107 -0
  25. package/dist/types/constants/index.d.ts +39 -0
  26. package/dist/types/engine/AudioEngine.d.ts +44 -1
  27. package/dist/types/engine/Filters.d.ts +25 -24
  28. package/dist/types/engine/MockAudioContext.d.ts +43 -0
  29. package/dist/types/engine/Player.d.ts +25 -21
  30. package/dist/types/events/EventBus.d.ts +17 -15
  31. package/dist/types/index.d.ts +17 -13
  32. package/dist/types/interfaces/index.d.ts +31 -0
  33. package/dist/types/plugins/Plugin.d.ts +11 -43
  34. package/dist/types/plugins/PluginManager.d.ts +19 -19
  35. package/dist/types/providers/LavalinkProvider.d.ts +17 -0
  36. package/dist/types/providers/LocalProvider.d.ts +11 -22
  37. package/dist/types/providers/ProviderRegistry.d.ts +10 -0
  38. package/dist/types/providers/SpotifyProvider.d.ts +14 -0
  39. package/dist/types/providers/YouTubeProvider.d.ts +11 -28
  40. package/dist/types/queue/Queue.d.ts +28 -22
  41. package/dist/types/queue/Track.d.ts +18 -16
  42. package/dist/types/utils/Logger.d.ts +12 -16
  43. package/dist/types/utils/Metadata.d.ts +16 -15
  44. package/dist/types/utils/Probe.d.ts +7 -7
  45. package/dist/types/utils/Time.d.ts +9 -9
  46. package/dist/utils/Logger.js +59 -0
  47. package/dist/utils/Metadata.js +90 -0
  48. package/dist/utils/Probe.js +59 -0
  49. package/dist/utils/Time.js +54 -0
  50. package/package.json +19 -9
@@ -9,6 +9,8 @@ export class AudioEngine {
9
9
  filters: Filters;
10
10
  queue: Queue;
11
11
  eventBus: EventBus;
12
+ spotifyProvider: SpotifyProvider;
13
+ lavalinkProvider: LavalinkProvider;
12
14
  isReady: boolean;
13
15
  /**
14
16
  * Initialize the audio engine
@@ -46,7 +48,7 @@ export class AudioEngine {
46
48
  * Remove track from queue
47
49
  * @param {number|string} identifier - Track index or ID
48
50
  */
49
- remove(identifier: number | string): import("../index.js").Track;
51
+ remove(identifier: number | string): Track;
50
52
  /**
51
53
  * Skip to next track
52
54
  */
@@ -89,6 +91,44 @@ export class AudioEngine {
89
91
  * @returns {Object} Engine state
90
92
  */
91
93
  getState(): any;
94
+ /**
95
+ * Initialize Spotify provider
96
+ * @param {Object} options - Spotify options
97
+ */
98
+ initSpotify(options?: any): void;
99
+ /**
100
+ * Load Spotify track and add to queue
101
+ * @param {string} trackId - Spotify track ID
102
+ * @param {Object} options - Options including token
103
+ * @returns {Promise<Track>} Added track
104
+ */
105
+ loadSpotifyTrack(trackId: string, options?: any): Promise<Track>;
106
+ /**
107
+ * Search Spotify tracks
108
+ * @param {string} query - Search query
109
+ * @param {Object} options - Search options
110
+ * @returns {Promise<Array>} Search results
111
+ */
112
+ searchSpotifyTracks(query: string, options?: any): Promise<any[]>;
113
+ /**
114
+ * Connect to Lavalink server
115
+ * @param {Object} options - Lavalink connection options
116
+ * @returns {Promise<void>}
117
+ */
118
+ connectLavalink(options?: any): Promise<void>;
119
+ /**
120
+ * Load Lavalink track and add to queue
121
+ * @param {string} identifier - Track identifier
122
+ * @returns {Promise<Track|Array<Track>>} Added track(s)
123
+ */
124
+ loadLavalinkTrack(identifier: string): Promise<Track | Array<Track>>;
125
+ /**
126
+ * Get Lavalink player for guild/channel
127
+ * @param {string} guildId - Guild ID
128
+ * @param {string} channelId - Voice channel ID
129
+ * @returns {Object} Lavalink player
130
+ */
131
+ getLavalinkPlayer(guildId: string, channelId: string): any;
92
132
  /**
93
133
  * Destroy the engine
94
134
  */
@@ -98,3 +138,6 @@ import { Player } from './Player.js';
98
138
  import { Filters } from './Filters.js';
99
139
  import { Queue } from '../queue/Queue.js';
100
140
  import { EventBus } from '../events/EventBus.js';
141
+ import { SpotifyProvider } from '../providers/SpotifyProvider.js';
142
+ import { LavalinkProvider } from '../providers/LavalinkProvider.js';
143
+ import { Track } from '../queue/Track.js';
@@ -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,13 +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 * 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';
@@ -0,0 +1,17 @@
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;
16
+ private _formatTrack;
17
+ }
@@ -1,23 +1,12 @@
1
- /**
2
- * Local file provider for Node.js
3
- */
4
- export class LocalProvider {
5
- /**
6
- * Check if path is a valid local audio file
7
- * @param {string} path - File path
8
- * @returns {boolean} Is valid audio file
9
- */
10
- static isValidPath(path: string): boolean;
11
- /**
12
- * Get track info from local file
13
- * @param {string} path - File path
14
- * @returns {Promise<Object>} Track info
15
- */
16
- static getInfo(path: string): Promise<any>;
17
- /**
18
- * Check if file exists
19
- * @param {string} path - File path
20
- * @returns {Promise<boolean>} File exists
21
- */
22
- static exists(path: string): Promise<boolean>;
1
+ import { IProvider, ITrack, IAudioEngine } from '../interfaces';
2
+ export declare class LocalProvider implements IProvider {
3
+ name: string;
4
+ version: string;
5
+ private engine;
6
+ initialize(engine: IAudioEngine): Promise<void>;
7
+ resolve(path: string): Promise<ITrack | ITrack[]>;
8
+ play(track: ITrack): Promise<void>;
9
+ stop(): Promise<void>;
10
+ destroy(): void;
11
+ private exists;
23
12
  }
@@ -0,0 +1,10 @@
1
+ import { IProvider } from '../interfaces';
2
+ export declare class ProviderRegistry {
3
+ private providers;
4
+ constructor();
5
+ register(provider: IProvider): void;
6
+ unregister(name: string): void;
7
+ get(name: string): IProvider | undefined;
8
+ getAll(): IProvider[];
9
+ has(name: string): boolean;
10
+ }
@@ -0,0 +1,14 @@
1
+ import { IProvider, ITrack, IAudioEngine } from '../interfaces';
2
+ export declare class SpotifyProvider implements IProvider {
3
+ name: string;
4
+ version: string;
5
+ private engine;
6
+ private spotifyApi;
7
+ constructor(options?: any);
8
+ initialize(engine: IAudioEngine): Promise<void>;
9
+ resolve(query: string): Promise<ITrack | ITrack[]>;
10
+ play(track: ITrack): Promise<void>;
11
+ stop(): Promise<void>;
12
+ destroy(): void;
13
+ private _formatTrack;
14
+ }
@@ -1,29 +1,12 @@
1
- /**
2
- * YouTube provider for basic info fetching
3
- */
4
- export class YouTubeProvider {
5
- /**
6
- * Check if URL is a valid YouTube URL
7
- * @param {string} url - URL to check
8
- * @returns {boolean} Is valid YouTube URL
9
- */
10
- static isValidUrl(url: string): boolean;
11
- /**
12
- * Extract video ID from YouTube URL
13
- * @param {string} url - YouTube URL
14
- * @returns {string|null} Video ID
15
- */
16
- static extractVideoId(url: string): string | null;
17
- /**
18
- * Get basic track info from YouTube URL
19
- * @param {string} url - YouTube URL
20
- * @returns {Promise<Object>} Track info
21
- */
22
- static getInfo(url: string): Promise<any>;
23
- /**
24
- * Get stream URL (not implemented without dependencies)
25
- * @param {string} url - YouTube URL
26
- * @returns {Promise<string>} Stream URL
27
- */
28
- static getStreamUrl(url: string): Promise<string>;
1
+ import { IProvider, ITrack, IAudioEngine } from '../interfaces';
2
+ export declare class YouTubeProvider implements IProvider {
3
+ name: string;
4
+ version: string;
5
+ private engine;
6
+ initialize(engine: IAudioEngine): Promise<void>;
7
+ resolve(query: string): Promise<ITrack | ITrack[]>;
8
+ play(track: ITrack): Promise<void>;
9
+ stop(): Promise<void>;
10
+ destroy(): void;
11
+ private extractVideoId;
29
12
  }