distube 2.8.18 → 3.0.0-0

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 (139) hide show
  1. package/README.md +32 -98
  2. package/dist/DisTube.d.ts +522 -0
  3. package/dist/DisTube.d.ts.map +1 -0
  4. package/dist/DisTube.js +794 -0
  5. package/dist/DisTube.js.map +1 -0
  6. package/dist/constant.d.ts +130 -0
  7. package/dist/constant.d.ts.map +1 -0
  8. package/dist/constant.js +150 -0
  9. package/dist/constant.js.map +1 -0
  10. package/dist/core/DisTubeBase.d.ts +55 -0
  11. package/dist/core/DisTubeBase.d.ts.map +1 -0
  12. package/dist/core/DisTubeBase.js +76 -0
  13. package/dist/core/DisTubeBase.js.map +1 -0
  14. package/dist/core/DisTubeHandler.d.ts +84 -0
  15. package/dist/core/DisTubeHandler.d.ts.map +1 -0
  16. package/dist/core/DisTubeHandler.js +311 -0
  17. package/dist/core/DisTubeHandler.js.map +1 -0
  18. package/dist/core/DisTubeOptions.d.ts +26 -0
  19. package/dist/core/DisTubeOptions.d.ts.map +1 -0
  20. package/dist/core/DisTubeOptions.js +93 -0
  21. package/dist/core/DisTubeOptions.js.map +1 -0
  22. package/dist/core/DisTubeStream.d.ts +52 -0
  23. package/dist/core/DisTubeStream.d.ts.map +1 -0
  24. package/dist/core/DisTubeStream.js +109 -0
  25. package/dist/core/DisTubeStream.js.map +1 -0
  26. package/dist/core/index.d.ts +7 -0
  27. package/dist/core/index.d.ts.map +1 -0
  28. package/dist/core/index.js +19 -0
  29. package/dist/core/index.js.map +1 -0
  30. package/dist/core/manager/BaseManager.d.ts +18 -0
  31. package/dist/core/manager/BaseManager.d.ts.map +1 -0
  32. package/dist/core/manager/BaseManager.js +44 -0
  33. package/dist/core/manager/BaseManager.js.map +1 -0
  34. package/dist/core/manager/QueueManager.d.ts +60 -0
  35. package/dist/core/manager/QueueManager.d.ts.map +1 -0
  36. package/dist/core/manager/QueueManager.js +202 -0
  37. package/dist/core/manager/QueueManager.js.map +1 -0
  38. package/dist/core/manager/index.d.ts +3 -0
  39. package/dist/core/manager/index.d.ts.map +1 -0
  40. package/dist/core/manager/index.js +15 -0
  41. package/dist/core/manager/index.js.map +1 -0
  42. package/dist/core/voice/DJSAdapter.d.ts +4 -0
  43. package/dist/core/voice/DJSAdapter.d.ts.map +1 -0
  44. package/dist/core/voice/DJSAdapter.js +61 -0
  45. package/dist/core/voice/DJSAdapter.js.map +1 -0
  46. package/dist/core/voice/DisTubeVoice.d.ts +83 -0
  47. package/dist/core/voice/DisTubeVoice.d.ts.map +1 -0
  48. package/dist/core/voice/DisTubeVoice.js +236 -0
  49. package/dist/core/voice/DisTubeVoice.js.map +1 -0
  50. package/dist/core/voice/DisTubeVoiceManager.d.ts +41 -0
  51. package/dist/core/voice/DisTubeVoiceManager.d.ts.map +1 -0
  52. package/dist/core/voice/DisTubeVoiceManager.js +67 -0
  53. package/dist/core/voice/DisTubeVoiceManager.js.map +1 -0
  54. package/dist/core/voice/index.d.ts +4 -0
  55. package/dist/core/voice/index.d.ts.map +1 -0
  56. package/dist/core/voice/index.js +16 -0
  57. package/dist/core/voice/index.js.map +1 -0
  58. package/dist/index.d.ts +8 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +23 -0
  61. package/dist/index.js.map +1 -0
  62. package/dist/plugin/http.d.ts +8 -0
  63. package/dist/plugin/http.d.ts.map +1 -0
  64. package/dist/plugin/http.js +20 -0
  65. package/dist/plugin/http.js.map +1 -0
  66. package/dist/plugin/https.d.ts +14 -0
  67. package/dist/plugin/https.d.ts.map +1 -0
  68. package/dist/plugin/https.js +50 -0
  69. package/dist/plugin/https.js.map +1 -0
  70. package/dist/plugin/index.d.ts +4 -0
  71. package/dist/plugin/index.d.ts.map +1 -0
  72. package/dist/plugin/index.js +16 -0
  73. package/dist/plugin/index.js.map +1 -0
  74. package/dist/plugin/youtube-dl.d.ts +11 -0
  75. package/dist/plugin/youtube-dl.d.ts.map +1 -0
  76. package/dist/plugin/youtube-dl.js +75 -0
  77. package/dist/plugin/youtube-dl.js.map +1 -0
  78. package/dist/struct/CustomPlugin.d.ts +27 -0
  79. package/dist/struct/CustomPlugin.d.ts.map +1 -0
  80. package/dist/struct/CustomPlugin.js +35 -0
  81. package/dist/struct/CustomPlugin.js.map +1 -0
  82. package/dist/struct/DisTubeError.d.ts +54 -0
  83. package/dist/struct/DisTubeError.d.ts.map +1 -0
  84. package/dist/struct/DisTubeError.js +72 -0
  85. package/dist/struct/DisTubeError.js.map +1 -0
  86. package/dist/struct/ExtractorPlugin.d.ts +29 -0
  87. package/dist/struct/ExtractorPlugin.d.ts.map +1 -0
  88. package/dist/struct/ExtractorPlugin.js +32 -0
  89. package/dist/struct/ExtractorPlugin.js.map +1 -0
  90. package/dist/struct/Playlist.d.ts +42 -0
  91. package/dist/struct/Playlist.d.ts.map +1 -0
  92. package/dist/struct/Playlist.js +104 -0
  93. package/dist/struct/Playlist.js.map +1 -0
  94. package/dist/struct/Plugin.d.ts +82 -0
  95. package/dist/struct/Plugin.d.ts.map +1 -0
  96. package/dist/struct/Plugin.js +108 -0
  97. package/dist/struct/Plugin.js.map +1 -0
  98. package/dist/struct/Queue.d.ts +217 -0
  99. package/dist/struct/Queue.d.ts.map +1 -0
  100. package/dist/struct/Queue.js +480 -0
  101. package/dist/struct/Queue.js.map +1 -0
  102. package/dist/struct/SearchResult.d.ts +28 -0
  103. package/dist/struct/SearchResult.d.ts.map +1 -0
  104. package/dist/struct/SearchResult.js +79 -0
  105. package/dist/struct/SearchResult.js.map +1 -0
  106. package/dist/struct/Song.d.ts +68 -0
  107. package/dist/struct/Song.d.ts.map +1 -0
  108. package/dist/struct/Song.js +229 -0
  109. package/dist/struct/Song.js.map +1 -0
  110. package/dist/struct/TaskQueue.d.ts +33 -0
  111. package/dist/struct/TaskQueue.d.ts.map +1 -0
  112. package/dist/struct/TaskQueue.js +58 -0
  113. package/dist/struct/TaskQueue.js.map +1 -0
  114. package/dist/struct/index.d.ts +10 -0
  115. package/dist/struct/index.d.ts.map +1 -0
  116. package/dist/struct/index.js +22 -0
  117. package/dist/struct/index.js.map +1 -0
  118. package/dist/tsconfig.tsbuildinfo +1 -0
  119. package/dist/type.d.ts +159 -0
  120. package/dist/type.d.ts.map +1 -0
  121. package/dist/type.js +3 -0
  122. package/dist/type.js.map +1 -0
  123. package/dist/util.d.ts +47 -0
  124. package/dist/util.d.ts.map +1 -0
  125. package/dist/util.js +205 -0
  126. package/dist/util.js.map +1 -0
  127. package/package.json +50 -24
  128. package/src/DisTube.js +0 -1121
  129. package/src/Playlist.js +0 -107
  130. package/src/Queue.js +0 -120
  131. package/src/SearchResult.js +0 -81
  132. package/src/Song.js +0 -135
  133. package/src/duration.js +0 -39
  134. package/typings/DisTube.d.ts +0 -635
  135. package/typings/Playlist.d.ts +0 -73
  136. package/typings/Queue.d.ts +0 -106
  137. package/typings/SearchResult.d.ts +0 -59
  138. package/typings/Song.d.ts +0 -104
  139. package/typings/duration.d.ts +0 -2
@@ -1,73 +0,0 @@
1
- export = Playlist;
2
- /** Class representing a playlist. */
3
- declare class Playlist {
4
- /**
5
- * Create a playlist
6
- * @param {ytpl.result|Song[]} playlist Playlist
7
- * @param {Discord.User} user Requested user
8
- * @param {Object} properties Custom properties
9
- */
10
- constructor(playlist: any | Song[], user: Discord.User, properties?: any);
11
- /**
12
- * User requested.
13
- * @type {Discord.User}
14
- */
15
- user: Discord.User;
16
- /**
17
- * Playlist songs.
18
- * @type {Song[]}
19
- */
20
- songs: Song[];
21
- /**
22
- * Playlist name.
23
- * @type {string}
24
- */
25
- name: string;
26
- /**
27
- * Playlist URL.
28
- * @type {string}
29
- */
30
- url: string;
31
- /**
32
- * Playlist thumbnail.
33
- * @type {string}
34
- */
35
- thumbnail: string;
36
- /**
37
- * @deprecated use `Playlist.name` instead
38
- * @type {string}
39
- */
40
- title: string;
41
- /**
42
- * @deprecated use `Playlist.songs` instead
43
- * @type {Song[]}
44
- */
45
- items: Song[];
46
- /**
47
- * @deprecated use `Playlist.songs.length` instead
48
- * @type {number}
49
- */
50
- total_items: number;
51
- /**
52
- * @deprecated
53
- * @type {string}
54
- */
55
- id: string;
56
- /**
57
- * @deprecated
58
- * @type {object}
59
- */
60
- author: object;
61
- /**
62
- * Playlist duration in second.
63
- * @type {number}
64
- */
65
- get duration(): number;
66
- /**
67
- * Formatted duration string `hh:mm:ss`.
68
- * @type {string}
69
- */
70
- get formattedDuration(): string;
71
- }
72
- import Discord = require("discord.js");
73
- import Song = require("./Song");
@@ -1,106 +0,0 @@
1
- export = Queue;
2
- /**
3
- * Represents a queue.
4
- */
5
- declare class Queue {
6
- /**
7
- * Create a queue.
8
- * @param {Discord.Message} message Discord.Message
9
- * @param {Song} song The first Song of the Queue
10
- */
11
- constructor(message: Discord.Message, song: Song);
12
- /**
13
- * Stream dispatcher.
14
- * @type {Discord.StreamDispatcher}
15
- */
16
- dispatcher: Discord.StreamDispatcher;
17
- /**
18
- * Voice connection.
19
- * @type {Discord.VoiceConnection}
20
- */
21
- connection: Discord.VoiceConnection;
22
- /**
23
- * Stream volume.
24
- * @type {number}
25
- */
26
- volume: number;
27
- /**
28
- * List of songs
29
- * @type {Song[]}
30
- */
31
- songs: Song[];
32
- /**
33
- * Whether stream is currently stopped.
34
- * @type {boolean}
35
- */
36
- stopped: boolean;
37
- /**
38
- * Whether or not the last song was skipped.
39
- * @type {boolean}
40
- */
41
- skipped: boolean;
42
- /**
43
- * Whether or not the stream is currently playing.
44
- * @type {boolean}
45
- */
46
- playing: boolean;
47
- /**
48
- * Whether or not the stream is currently paused.
49
- * @type {boolean}
50
- */
51
- pause: boolean;
52
- /**
53
- * Type of repeat mode (0 is disabled, 1 is repeating a song, 2 is repeating all the playlist)
54
- * @type {number}
55
- */
56
- repeatMode: number;
57
- /**
58
- * Whether or not the autoplay mode is enabled.
59
- * @type {boolean}
60
- */
61
- autoplay: boolean;
62
- /**
63
- * `@2.0.0` Queue audio filter.
64
- * Available filters: {@link Filter}
65
- * @type {DisTube.Filter}
66
- */
67
- filter: DisTube.Filter;
68
- /**
69
- * `@2.2.0` Message which initialize the queue
70
- * @type {Discord.Message}
71
- */
72
- initMessage: Discord.Message;
73
- /**
74
- * `@2.5.0` ytdl stream
75
- * @type {Readable}
76
- */
77
- stream: any;
78
- /**
79
- * `@2.7.0` What time in the song to begin (in milliseconds).
80
- * @type {number}
81
- */
82
- beginTime: number;
83
- /**
84
- * Formatted duration string.
85
- * @type {string}
86
- */
87
- get formattedDuration(): string;
88
- /**
89
- * Queue's duration.
90
- * @type {number}
91
- */
92
- get duration(): number;
93
- /**
94
- * `@2.7.0` What time in the song is playing (in milliseconds).
95
- * @type {number}
96
- */
97
- get currentTime(): number;
98
- /**
99
- * `@2.8.0` Formatted {@link Queue#currentTime} string.
100
- * @type {string}
101
- */
102
- get formattedCurrentTime(): string;
103
- }
104
- import Discord = require("discord.js");
105
- import Song = require("./Song");
106
- import DisTube = require("./DisTube");
@@ -1,59 +0,0 @@
1
- export = SearchResult;
2
- /** `@2.7.0` Class representing a search result. */
3
- declare class SearchResult {
4
- /**
5
- * Create a search result.
6
- * @param {ytsr.Video} info Video info
7
- */
8
- constructor(info: any);
9
- /**
10
- * Youtube video id
11
- * @type {string}
12
- */
13
- id: string;
14
- /**
15
- * Song name aka video title.
16
- * @type {string}
17
- */
18
- name: string;
19
- /**
20
- * Song duration.
21
- * @type {number}
22
- */
23
- duration: number;
24
- /**
25
- * Formatted duration string `hh:mm:ss` or `mm:ss`.
26
- * @type {string}
27
- */
28
- formattedDuration: string;
29
- /**
30
- * Song URL.
31
- * @type {string}
32
- */
33
- url: string;
34
- /**
35
- * Song thumbnail.
36
- * @type {string}
37
- */
38
- thumbnail: string;
39
- /**
40
- * Indicates if the video is an active live.
41
- * @type {boolean}
42
- */
43
- isLive: boolean;
44
- /**
45
- * Song views count
46
- * @type {number}
47
- */
48
- views: number;
49
- /**
50
- * @deprecated use `Song.name` instead
51
- * @type {string}
52
- */
53
- title: string;
54
- /**
55
- * @deprecated use `Song.url` instead
56
- * @type {string}
57
- */
58
- link: string;
59
- }
package/typings/Song.d.ts DELETED
@@ -1,104 +0,0 @@
1
- export = Song;
2
- /** Class representing a song. */
3
- declare class Song {
4
- /**
5
- * Create a song.
6
- * @param {ytdl.videoInfo|Object} info Video info
7
- * @param {Discord.User} user Requested user
8
- * @param {boolean} [youtube=false] Weather or not the video is a Youtube video.
9
- */
10
- constructor(info: ytdl.videoInfo | any, user: Discord.User, youtube?: boolean);
11
- /**
12
- * `@2.6.0` Weather or not the video is a Youtube video.
13
- * @type {boolean}
14
- */
15
- youtube: boolean;
16
- info: any;
17
- /**
18
- * User requested
19
- * @type {Discord.User}
20
- */
21
- user: Discord.User;
22
- /**
23
- * `@2.1.4` Youtube video id
24
- * @type {string}
25
- */
26
- id: string;
27
- /**
28
- * Song name aka video title.
29
- * @type {string}
30
- */
31
- name: string;
32
- /**
33
- * `@2.5.0` Indicates if the video is an active live.
34
- * @type {boolean}
35
- */
36
- isLive: boolean;
37
- /**
38
- * Song duration.
39
- * @type {number}
40
- */
41
- duration: number;
42
- /**
43
- * Formatted duration string `hh:mm:ss` or `mm:ss`.
44
- * @type {string}
45
- */
46
- formattedDuration: string;
47
- /**
48
- * Song URL.
49
- * @type {string}
50
- */
51
- url: string;
52
- /**
53
- * `@2.6.0` Stream / Download URL.
54
- * @type {?string}
55
- */
56
- streamURL: string | null;
57
- /**
58
- * Song thumbnail.
59
- * @type {?string}
60
- */
61
- thumbnail: string | null;
62
- /**
63
- * Related videos (Only available with YouTube video)
64
- * @type {?ytdl.relatedVideo[]}
65
- */
66
- related: ytdl.relatedVideo[] | null;
67
- /**
68
- * `@2.6.0` Song views count
69
- * @type {number}
70
- */
71
- views: number;
72
- /**
73
- * @deprecated use `Song.views` instead
74
- * @type {number}
75
- */
76
- plays: number;
77
- /**
78
- * `@2.6.0` Song like count
79
- * @type {number}
80
- */
81
- likes: number;
82
- /**
83
- * `@2.6.0` Song dislike count
84
- * @type {number}
85
- */
86
- dislikes: number;
87
- /**
88
- * `@2.6.0` Song repost count
89
- * @type {number}
90
- */
91
- reposts: number;
92
- /**
93
- * @deprecated use `Song.name` instead
94
- * @type {string}
95
- */
96
- title: string;
97
- /**
98
- * @deprecated use `Song.url` instead
99
- * @type {string}
100
- */
101
- link: string;
102
- }
103
- import Discord = require("discord.js");
104
- import ytdl = require("ytdl-core");
@@ -1,2 +0,0 @@
1
- export function formatDuration(milliseconds: any): string;
2
- export function toSecond(string: any): number;