webamp 1.4.3-beta.5 → 2.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 (154) hide show
  1. package/README.md +20 -0
  2. package/built/types/js/Disposable.d.ts +11 -0
  3. package/built/types/js/actionCreators/equalizer.d.ts +8 -0
  4. package/built/types/js/actionCreators/files.d.ts +24 -0
  5. package/built/types/js/actionCreators/index.d.ts +22 -0
  6. package/built/types/js/actionCreators/media.d.ts +20 -0
  7. package/built/types/js/actionCreators/milkdrop.d.ts +13 -0
  8. package/built/types/js/actionCreators/playlist.d.ts +16 -0
  9. package/built/types/js/actionCreators/windows.d.ts +27 -0
  10. package/built/types/js/actionTypes.d.ts +87 -0
  11. package/built/types/js/components/App.d.ts +12 -0
  12. package/built/types/js/components/Balance.d.ts +8 -0
  13. package/built/types/js/components/Character.d.ts +9 -0
  14. package/built/types/js/components/CharacterString.d.ts +6 -0
  15. package/built/types/js/components/ClickedDiv.d.ts +8 -0
  16. package/built/types/js/components/ClipPaths.d.ts +8 -0
  17. package/built/types/js/components/ContextMenu.d.ts +31 -0
  18. package/built/types/js/components/ContextMenuTarget.d.ts +9 -0
  19. package/built/types/js/components/ContextMenuWrapper.d.ts +7 -0
  20. package/built/types/js/components/Css.d.ts +7 -0
  21. package/built/types/js/components/DropTarget.d.ts +13 -0
  22. package/built/types/js/components/EqualizerWindow/Band.d.ts +14 -0
  23. package/built/types/js/components/EqualizerWindow/EqAuto.d.ts +3 -0
  24. package/built/types/js/components/EqualizerWindow/EqGraph.d.ts +2 -0
  25. package/built/types/js/components/EqualizerWindow/EqOn.d.ts +2 -0
  26. package/built/types/js/components/EqualizerWindow/EqTitleButtons.d.ts +1 -0
  27. package/built/types/js/components/EqualizerWindow/EqualizerShade.d.ts +2 -0
  28. package/built/types/js/components/EqualizerWindow/PresetsContextMenu.d.ts +2 -0
  29. package/built/types/js/components/EqualizerWindow/index.d.ts +2 -0
  30. package/built/types/js/components/EqualizerWindow/spline.d.ts +1 -0
  31. package/built/types/js/components/FFTNullsoft.d.ts +16 -0
  32. package/built/types/js/components/FocusTarget.d.ts +9 -0
  33. package/built/types/js/components/Fullscreen.d.ts +8 -0
  34. package/built/types/js/components/GenWindow/index.d.ts +14 -0
  35. package/built/types/js/components/MainWindow/ActionButtons.d.ts +3 -0
  36. package/built/types/js/components/MainWindow/Close.d.ts +3 -0
  37. package/built/types/js/components/MainWindow/ClutterBar.d.ts +3 -0
  38. package/built/types/js/components/MainWindow/Eject.d.ts +3 -0
  39. package/built/types/js/components/MainWindow/EqToggleButton.d.ts +3 -0
  40. package/built/types/js/components/MainWindow/Kbps.d.ts +3 -0
  41. package/built/types/js/components/MainWindow/Khz.d.ts +3 -0
  42. package/built/types/js/components/MainWindow/MainBalance.d.ts +4 -0
  43. package/built/types/js/components/MainWindow/MainContextMenu.d.ts +7 -0
  44. package/built/types/js/components/MainWindow/MainVolume.d.ts +3 -0
  45. package/built/types/js/components/MainWindow/Marquee.d.ts +7 -0
  46. package/built/types/js/components/MainWindow/Minimize.d.ts +3 -0
  47. package/built/types/js/components/MainWindow/MonoStereo.d.ts +3 -0
  48. package/built/types/js/components/MainWindow/PlaylistToggleButton.d.ts +3 -0
  49. package/built/types/js/components/MainWindow/Position.d.ts +3 -0
  50. package/built/types/js/components/MainWindow/Repeat.d.ts +3 -0
  51. package/built/types/js/components/MainWindow/Shade.d.ts +3 -0
  52. package/built/types/js/components/MainWindow/Shuffle.d.ts +3 -0
  53. package/built/types/js/components/MainWindow/Time.d.ts +3 -0
  54. package/built/types/js/components/MainWindow/index.d.ts +8 -0
  55. package/built/types/js/components/MilkdropWindow/Background.d.ts +7 -0
  56. package/built/types/js/components/MilkdropWindow/Desktop.d.ts +7 -0
  57. package/built/types/js/components/MilkdropWindow/MilkdropContextMenu.d.ts +6 -0
  58. package/built/types/js/components/MilkdropWindow/PresetOverlay.d.ts +7 -0
  59. package/built/types/js/components/MilkdropWindow/Visualizer.d.ts +7 -0
  60. package/built/types/js/components/MilkdropWindow/index.d.ts +5 -0
  61. package/built/types/js/components/MiniTime.d.ts +2 -0
  62. package/built/types/js/components/OptionsContextMenu.d.ts +2 -0
  63. package/built/types/js/components/PlaybackContextMenu.d.ts +2 -0
  64. package/built/types/js/components/PlaylistWindow/AddMenu.d.ts +2 -0
  65. package/built/types/js/components/PlaylistWindow/ListMenu.d.ts +1 -0
  66. package/built/types/js/components/PlaylistWindow/MiscMenu.d.ts +2 -0
  67. package/built/types/js/components/PlaylistWindow/MiscOptionsContextMenu.d.ts +2 -0
  68. package/built/types/js/components/PlaylistWindow/PlaylistActionArea.d.ts +2 -0
  69. package/built/types/js/components/PlaylistWindow/PlaylistMenu.d.ts +8 -0
  70. package/built/types/js/components/PlaylistWindow/PlaylistMenuEntry.d.ts +7 -0
  71. package/built/types/js/components/PlaylistWindow/PlaylistResizeTarget.d.ts +5 -0
  72. package/built/types/js/components/PlaylistWindow/PlaylistScrollBar.d.ts +1 -0
  73. package/built/types/js/components/PlaylistWindow/PlaylistShade.d.ts +2 -0
  74. package/built/types/js/components/PlaylistWindow/RemoveMenu.d.ts +2 -0
  75. package/built/types/js/components/PlaylistWindow/RunningTimeDisplay.d.ts +2 -0
  76. package/built/types/js/components/PlaylistWindow/SelectionMenu.d.ts +1 -0
  77. package/built/types/js/components/PlaylistWindow/SortContextMenu.d.ts +1 -0
  78. package/built/types/js/components/PlaylistWindow/TrackCell.d.ts +9 -0
  79. package/built/types/js/components/PlaylistWindow/TrackList.d.ts +2 -0
  80. package/built/types/js/components/PlaylistWindow/TrackTitle.d.ts +6 -0
  81. package/built/types/js/components/PlaylistWindow/index.d.ts +5 -0
  82. package/built/types/js/components/ResizeTarget.d.ts +11 -0
  83. package/built/types/js/components/Skin.d.ts +1 -0
  84. package/built/types/js/components/SkinsContextMenu.d.ts +2 -0
  85. package/built/types/js/components/VerticalSlider.d.ts +15 -0
  86. package/built/types/js/components/Vis.d.ts +5 -0
  87. package/built/types/js/components/VisPainter.d.ts +147 -0
  88. package/built/types/js/components/Volume.d.ts +8 -0
  89. package/built/types/js/components/WinampButton.d.ts +23 -0
  90. package/built/types/js/components/WindowManager.d.ts +8 -0
  91. package/built/types/js/constants.d.ts +38 -0
  92. package/built/types/js/emitter.d.ts +9 -0
  93. package/built/types/js/fileUtils.d.ts +15 -0
  94. package/built/types/js/hooks.d.ts +21 -0
  95. package/built/types/js/hotkeys.d.ts +2 -0
  96. package/built/types/js/loadQueue.d.ts +9 -0
  97. package/built/types/js/marqueeUtils.d.ts +6 -0
  98. package/built/types/js/marqueeUtils.test.d.ts +1 -0
  99. package/built/types/js/media/StereoBalanceNode.d.ts +3 -0
  100. package/built/types/js/media/elementSource.d.ts +26 -0
  101. package/built/types/js/media/index.d.ts +43 -0
  102. package/built/types/js/mediaMiddleware.d.ts +4 -0
  103. package/built/types/js/playlistHtml.d.ts +10 -0
  104. package/built/types/js/reducers/display.d.ts +26 -0
  105. package/built/types/js/reducers/equalizer.d.ts +10 -0
  106. package/built/types/js/reducers/index.d.ts +4 -0
  107. package/built/types/js/reducers/media.d.ts +14 -0
  108. package/built/types/js/reducers/milkdrop.d.ts +15 -0
  109. package/built/types/js/reducers/network.d.ts +6 -0
  110. package/built/types/js/reducers/playlist.d.ts +9 -0
  111. package/built/types/js/reducers/settings.d.ts +6 -0
  112. package/built/types/js/reducers/tracks.d.ts +7 -0
  113. package/built/types/js/reducers/tracks.test.d.ts +1 -0
  114. package/built/types/js/reducers/userInput.d.ts +9 -0
  115. package/built/types/js/reducers/windows.d.ts +34 -0
  116. package/built/types/js/regionParser.d.ts +6 -0
  117. package/built/types/js/resizeUtils.d.ts +23 -0
  118. package/built/types/js/resizeUtils.test.d.ts +1 -0
  119. package/built/types/js/selectors.d.ts +184 -0
  120. package/built/types/js/selectors.test.d.ts +1 -0
  121. package/built/types/js/serialization.test.d.ts +1 -0
  122. package/built/types/js/serializedStates/v1Types.d.ts +64 -0
  123. package/built/types/js/skinParser.d.ts +12 -0
  124. package/built/types/js/skinParserUtils.d.ts +19 -0
  125. package/built/types/js/skinSelectors.d.ts +6 -0
  126. package/built/types/js/skinSprites.d.ts +17 -0
  127. package/built/types/js/snapUtils.d.ts +32 -0
  128. package/built/types/js/snapUtils.test.d.ts +1 -0
  129. package/built/types/js/spinParserUtils.test.d.ts +1 -0
  130. package/built/types/js/store.d.ts +4 -0
  131. package/built/types/js/trackUtils.d.ts +3 -0
  132. package/built/types/js/types.d.ts +734 -0
  133. package/built/types/js/utils.d.ts +71 -0
  134. package/built/types/js/utils.test.d.ts +1 -0
  135. package/built/types/js/webamp.d.ts +6 -0
  136. package/built/types/js/webampLazy.d.ts +156 -0
  137. package/built/types/scripts/postcss-optimize-data-uri-pngs.d.ts +2 -0
  138. package/built/types/scripts/rollupPlugins.d.mts +8 -0
  139. package/built/types/vite.config.d.ts +2 -0
  140. package/built/webamp.bundle.js +43627 -36184
  141. package/built/webamp.bundle.js.map +1 -0
  142. package/built/webamp.bundle.min.js +43 -71
  143. package/built/webamp.bundle.min.js.map +1 -1
  144. package/built/webamp.bundle.min.mjs +44 -0
  145. package/built/webamp.bundle.min.mjs.map +1 -0
  146. package/built/webamp.lazy-bundle.js +14215 -18995
  147. package/built/webamp.lazy-bundle.js.map +1 -0
  148. package/built/webamp.lazy-bundle.min.js +41 -50
  149. package/built/webamp.lazy-bundle.min.js.map +1 -1
  150. package/built/webamp.lazy-bundle.min.mjs +42 -0
  151. package/built/webamp.lazy-bundle.min.mjs.map +1 -0
  152. package/package.json +68 -75
  153. package/CHANGELOG.md +0 -198
  154. package/index.d.ts +0 -277
@@ -0,0 +1,734 @@
1
+ /// <reference types="react" />
2
+ /// <reference types="node" />
3
+ import { PlaylistState } from "./reducers/playlist";
4
+ import { SettingsState } from "./reducers/settings";
5
+ import { UserInputState } from "./reducers/userInput";
6
+ import { MediaState } from "./reducers/media";
7
+ import { ThunkDispatch, ThunkAction } from "redux-thunk";
8
+ import { DisplayState } from "./reducers/display";
9
+ import { WindowsState, WindowPositions as _WindowPositions, WebampWindow as _WebampWindow, WindowInfo as _WindowInfo } from "./reducers/windows";
10
+ import { EqualizerState } from "./reducers/equalizer";
11
+ import { NetworkState } from "./reducers/network";
12
+ import { MilkdropState } from "./reducers/milkdrop";
13
+ import { SerializedStateV1 } from "./serializedStates/v1Types";
14
+ import { TracksState } from "./reducers/tracks";
15
+ import { IAudioMetadata, IOptions } from "music-metadata-browser";
16
+ import { Store as ReduxStore } from "redux";
17
+ export type WebampWindow = _WebampWindow;
18
+ export type WindowInfo = _WindowInfo;
19
+ export type WindowPositions = _WindowPositions;
20
+ export interface Point {
21
+ x: number;
22
+ y: number;
23
+ }
24
+ export interface Diff {
25
+ x?: number;
26
+ y?: number;
27
+ }
28
+ export interface BoundingBox {
29
+ width: number;
30
+ height: number;
31
+ }
32
+ export interface Box extends Point {
33
+ width: number;
34
+ height: number;
35
+ }
36
+ export interface FilePicker {
37
+ contextMenuName: string;
38
+ filePicker: () => Promise<Track[]>;
39
+ requiresNetwork: boolean;
40
+ }
41
+ export type Skin = {
42
+ url: string;
43
+ name: string;
44
+ };
45
+ export interface MilkdropMessage {
46
+ text: string;
47
+ time: number;
48
+ }
49
+ export type Band = 60 | 170 | 310 | 600 | 1000 | 3000 | 6000 | 12000 | 14000 | 16000;
50
+ export type Slider = Band | "preamp";
51
+ export type CursorImage = {
52
+ type: "cur";
53
+ url: string;
54
+ } | {
55
+ type: "ani";
56
+ aniData: Uint8Array;
57
+ };
58
+ export type Cursors = {
59
+ [cursor: string]: CursorImage;
60
+ };
61
+ export type GenLetterWidths = {
62
+ [letter: string]: number;
63
+ };
64
+ export interface PlaylistStyle {
65
+ normal: string;
66
+ current: string;
67
+ normalbg: string;
68
+ selectedbg: string;
69
+ font: string;
70
+ }
71
+ export type SkinImages = {
72
+ [sprite: string]: string;
73
+ };
74
+ export type SkinRegion = {
75
+ [windowName: string]: string[];
76
+ };
77
+ export type DummyVizData = {
78
+ 0: 11.75;
79
+ 8: 11.0625;
80
+ 16: 8.5;
81
+ 24: 7.3125;
82
+ 32: 6.75;
83
+ 40: 6.4375;
84
+ 48: 6.25;
85
+ 56: 5.875;
86
+ 64: 5.625;
87
+ 72: 5.25;
88
+ 80: 5.125;
89
+ 88: 4.875;
90
+ 96: 4.8125;
91
+ 104: 4.375;
92
+ 112: 3.625;
93
+ 120: 1.5625;
94
+ };
95
+ export interface SkinGenExColors {
96
+ itemBackground: string;
97
+ itemForeground: string;
98
+ windowBackground: string;
99
+ buttonText: string;
100
+ windowText: string;
101
+ divider: string;
102
+ playlistSelection: string;
103
+ listHeaderBackground: string;
104
+ listHeaderText: string;
105
+ listHeaderFrameTopAndLeft: string;
106
+ listHeaderFrameBottomAndRight: string;
107
+ listHeaderFramePressed: string;
108
+ listHeaderDeadArea: string;
109
+ scrollbarOne: string;
110
+ scrollbarTwo: string;
111
+ pressedScrollbarOne: string;
112
+ pressedScrollbarTwo: string;
113
+ scrollbarDeadArea: string;
114
+ listTextHighlighted: string;
115
+ listTextHighlightedBackground: string;
116
+ listTextSelected: string;
117
+ listTextSelectedBackground: string;
118
+ }
119
+ export type WindowId = "main" | "playlist" | "equalizer" | "milkdrop";
120
+ export type SkinData = {
121
+ skinImages: SkinImages;
122
+ skinColors: string[];
123
+ skinPlaylistStyle: PlaylistStyle;
124
+ skinCursors: Cursors;
125
+ skinRegion: SkinRegion;
126
+ skinGenLetterWidths: GenLetterWidths;
127
+ skinGenExColors: SkinGenExColors | null;
128
+ };
129
+ export type ButterchurnPresetJson = {
130
+ name: string;
131
+ butterchurnPresetObject: Object;
132
+ };
133
+ export interface ButterchurnPresetUrl {
134
+ name: string;
135
+ butterchurnPresetUrl: string;
136
+ }
137
+ export type LazyButterchurnPresetJson = {
138
+ name: string;
139
+ getButterchrunPresetObject: () => Promise<Object>;
140
+ };
141
+ export type Preset = ButterchurnPresetJson | ButterchurnPresetUrl | LazyButterchurnPresetJson;
142
+ export type StatePreset = {
143
+ type: "RESOLVED";
144
+ name: string;
145
+ preset: Object;
146
+ } | {
147
+ type: "UNRESOLVED";
148
+ name: string;
149
+ getPreset: () => Promise<Object>;
150
+ };
151
+ export interface ButterchurnOptions {
152
+ getPresets(): Promise<Preset[]>;
153
+ importButterchurn(): Promise<any>;
154
+ importConvertPreset?: () => Promise<{
155
+ convertPreset(file: string, endpoint: string): Promise<Object>;
156
+ }>;
157
+ presetConverterEndpoint?: string;
158
+ butterchurnOpen: boolean;
159
+ }
160
+ export interface EqfPreset {
161
+ name: string;
162
+ hz60: number;
163
+ hz170: number;
164
+ hz310: number;
165
+ hz600: number;
166
+ hz1000: number;
167
+ hz3000: number;
168
+ hz12000: number;
169
+ hz14000: number;
170
+ hz16000: number;
171
+ hz6000: number;
172
+ preamp: number;
173
+ }
174
+ export declare enum TransitionType {
175
+ IMMEDIATE = 0,
176
+ DEFAULT = 1,
177
+ USER_PRESET = 2
178
+ }
179
+ export interface Size {
180
+ width: number;
181
+ height: number;
182
+ }
183
+ export type Action = {
184
+ type: "@@init";
185
+ } | {
186
+ type: "NETWORK_CONNECTED";
187
+ } | {
188
+ type: "NETWORK_DISCONNECTED";
189
+ } | {
190
+ type: "SET_AVAILABLE_SKINS";
191
+ skins: Array<Skin>;
192
+ } | {
193
+ type: "PLAY";
194
+ } | {
195
+ type: "IS_PLAYING";
196
+ } | {
197
+ type: "PAUSE";
198
+ } | {
199
+ type: "STOP";
200
+ } | {
201
+ type: "IS_STOPPED";
202
+ } | {
203
+ type: "TOGGLE_TIME_MODE";
204
+ } | {
205
+ type: "UPDATE_TIME_ELAPSED";
206
+ elapsed: number;
207
+ } | {
208
+ type: "ADD_TRACK_FROM_URL";
209
+ atIndex: number | null;
210
+ id: number;
211
+ defaultName?: string;
212
+ duration?: number;
213
+ url: string;
214
+ } | {
215
+ type: "SET_MEDIA";
216
+ id: number;
217
+ length: number;
218
+ kbps: string;
219
+ khz: string;
220
+ channels: number;
221
+ } | {
222
+ type: "SET_VOLUME";
223
+ volume: number;
224
+ } | {
225
+ type: "SET_BALANCE";
226
+ balance: number;
227
+ } | {
228
+ type: "TOGGLE_REPEAT";
229
+ } | {
230
+ type: "TOGGLE_SHUFFLE";
231
+ } | {
232
+ type: "SET_FOCUS";
233
+ input: string;
234
+ } | {
235
+ type: "SET_BAND_FOCUS";
236
+ input: string;
237
+ bandFocused: Slider;
238
+ } | {
239
+ type: "UNSET_FOCUS";
240
+ } | {
241
+ type: "SET_SCRUB_POSITION";
242
+ position: number;
243
+ } | {
244
+ type: "SET_USER_MESSAGE";
245
+ message: string;
246
+ } | {
247
+ type: "UNSET_USER_MESSAGE";
248
+ } | {
249
+ type: "TOGGLE_DOUBLESIZE_MODE";
250
+ } | {
251
+ type: "TOGGLE_LLAMA_MODE";
252
+ } | {
253
+ type: "STEP_MARQUEE";
254
+ } | {
255
+ type: "DISABLE_MARQUEE";
256
+ } | {
257
+ type: "STOP_WORKING";
258
+ } | {
259
+ type: "START_WORKING";
260
+ } | {
261
+ type: "CLOSE_WINAMP";
262
+ } | {
263
+ type: "OPEN_WINAMP";
264
+ } | {
265
+ type: "LOADING";
266
+ } | {
267
+ type: "LOADED";
268
+ } | {
269
+ type: "SET_SKIN_DATA";
270
+ data: SkinData;
271
+ } | {
272
+ type: "TOGGLE_VISUALIZER_STYLE";
273
+ } | {
274
+ type: "SET_PLAYLIST_SCROLL_POSITION";
275
+ position: number;
276
+ } | {
277
+ type: "SET_Z_INDEX";
278
+ zIndex: number;
279
+ } | {
280
+ type: "SET_DUMMY_VIZ_DATA";
281
+ data: DummyVizData;
282
+ } | {
283
+ type: "SET_BAND_VALUE";
284
+ band: Slider;
285
+ value: number;
286
+ } | {
287
+ type: "SET_EQ_ON";
288
+ } | {
289
+ type: "SET_EQ_OFF";
290
+ } | {
291
+ type: "SET_EQ_AUTO";
292
+ value: boolean;
293
+ } | {
294
+ type: "SET_FOCUSED_WINDOW";
295
+ window: WindowId | null;
296
+ } | {
297
+ type: "TOGGLE_WINDOW_SHADE_MODE";
298
+ windowId: WindowId;
299
+ } | {
300
+ type: "TOGGLE_WINDOW";
301
+ windowId: WindowId;
302
+ } | {
303
+ type: "CLOSE_WINDOW";
304
+ windowId: WindowId;
305
+ } | {
306
+ type: "SET_WINDOW_VISIBILITY";
307
+ windowId: WindowId;
308
+ hidden: boolean;
309
+ } | {
310
+ type: "ADD_GEN_WINDOW";
311
+ windowId: WindowId;
312
+ title: string;
313
+ open: boolean;
314
+ } | {
315
+ type: "WINDOW_SIZE_CHANGED";
316
+ windowId: WindowId;
317
+ size: [number, number];
318
+ } | {
319
+ type: "UPDATE_WINDOW_POSITIONS";
320
+ positions: WindowPositions;
321
+ absolute?: boolean;
322
+ } | {
323
+ type: "CLICKED_TRACK";
324
+ index: number;
325
+ } | {
326
+ type: "CTRL_CLICKED_TRACK";
327
+ index: number;
328
+ } | {
329
+ type: "SHIFT_CLICKED_TRACK";
330
+ index: number;
331
+ } | {
332
+ type: "SELECT_ALL";
333
+ } | {
334
+ type: "SELECT_ZERO";
335
+ } | {
336
+ type: "INVERT_SELECTION";
337
+ } | {
338
+ type: "REMOVE_ALL_TRACKS";
339
+ } | {
340
+ type: "REMOVE_TRACKS";
341
+ ids: number[];
342
+ } | {
343
+ type: "REVERSE_LIST";
344
+ } | {
345
+ type: "RANDOMIZE_LIST";
346
+ } | {
347
+ type: "SET_TRACK_ORDER";
348
+ trackOrder: number[];
349
+ } | {
350
+ type: "SET_MEDIA_TAGS";
351
+ id: number;
352
+ title: string;
353
+ artist: string;
354
+ album?: string;
355
+ albumArtUrl?: string | null;
356
+ numberOfChannels?: number;
357
+ bitrate?: number;
358
+ sampleRate?: number;
359
+ } | {
360
+ type: "MEDIA_TAG_REQUEST_INITIALIZED";
361
+ id: number;
362
+ } | {
363
+ type: "MEDIA_TAG_REQUEST_FAILED";
364
+ id: number;
365
+ } | {
366
+ type: "SET_MEDIA_DURATION";
367
+ id: number;
368
+ duration: number;
369
+ } | {
370
+ type: "PLAY_TRACK";
371
+ id: number;
372
+ } | {
373
+ type: "BUFFER_TRACK";
374
+ id: number;
375
+ } | {
376
+ type: "DRAG_SELECTED";
377
+ offset: number;
378
+ } | {
379
+ type: "PLAY";
380
+ } | {
381
+ type: "PAUSE";
382
+ } | {
383
+ type: "SEEK_TO_PERCENT_COMPLETE";
384
+ percent: number;
385
+ } | {
386
+ type: "MINIMIZE_WINAMP";
387
+ } | {
388
+ type: "CLOSE_REQUESTED";
389
+ cancel: () => void;
390
+ } | {
391
+ type: "LOAD_SERIALIZED_STATE";
392
+ serializedState: SerializedStateV1;
393
+ } | {
394
+ type: "RESET_WINDOW_SIZES";
395
+ } | {
396
+ type: "BROWSER_WINDOW_SIZE_CHANGED";
397
+ height: number;
398
+ width: number;
399
+ } | {
400
+ type: "LOAD_DEFAULT_SKIN";
401
+ } | {
402
+ type: "ENABLE_MILKDROP";
403
+ open: boolean;
404
+ } | {
405
+ type: "SCHEDULE_MILKDROP_MESSAGE";
406
+ message: string;
407
+ } | {
408
+ type: "SET_MILKDROP_DESKTOP";
409
+ enabled: boolean;
410
+ } | {
411
+ type: "SET_MILKDROP_FULLSCREEN";
412
+ enabled: boolean;
413
+ } | {
414
+ type: "PRESET_REQUESTED";
415
+ index: number;
416
+ addToHistory: boolean;
417
+ } | {
418
+ type: "GOT_BUTTERCHURN_PRESETS";
419
+ presets: StatePreset[];
420
+ } | {
421
+ type: "GOT_BUTTERCHURN";
422
+ butterchurn: any;
423
+ } | {
424
+ type: "TOGGLE_RANDOMIZE_PRESETS";
425
+ } | {
426
+ type: "TOGGLE_PRESET_CYCLING";
427
+ } | {
428
+ type: "RESOLVE_PRESET_AT_INDEX";
429
+ index: number;
430
+ json: Object;
431
+ } | {
432
+ type: "SELECT_PRESET_AT_INDEX";
433
+ index: number;
434
+ transitionType: TransitionType;
435
+ } | {
436
+ type: "TOGGLE_PRESET_OVERLAY";
437
+ } | {
438
+ type: "MAIN_CONTEXT_MENU_OPENED";
439
+ } | {
440
+ type: "DROPPED_FILES";
441
+ count: number;
442
+ firstFileName: string | null;
443
+ windowId: WindowId;
444
+ } | {
445
+ type: "OPENED_FILES";
446
+ expectedType: "SKIN" | "MEDIA" | "EQ";
447
+ count: number;
448
+ firstFileName: string | null;
449
+ };
450
+ export type MediaTagRequestStatus = "INITIALIZED" | "FAILED" | "COMPLETE" | "NOT_REQUESTED";
451
+ export type MediaStatus = "PLAYING" | "STOPPED" | "PAUSED";
452
+ export type LoadStyle = "BUFFER" | "PLAY" | "NONE";
453
+ export type TimeMode = "ELAPSED" | "REMAINING";
454
+ interface TrackInfo {
455
+ /**
456
+ * Name to be used until ID3 tags can be resolved.
457
+ *
458
+ * If the track has a `url`, and this property is not given,
459
+ * the filename will be used instead.
460
+ *
461
+ * Example: `'My Song'`
462
+ */
463
+ defaultName?: string;
464
+ /**
465
+ * Data to be used _instead_ of trying to fetch ID3 tags.
466
+ *
467
+ * Example: `{ artist: 'Jordan Eldredge', title: "Jordan's Song" }`
468
+ */
469
+ metaData?: {
470
+ artist: string;
471
+ title: string;
472
+ album?: string;
473
+ albumArtUrl?: string;
474
+ };
475
+ /**
476
+ * Duration (in seconds) to be used instead of fetching enough of the file to measure its length.
477
+ *
478
+ * Example: 95
479
+ */
480
+ duration?: number;
481
+ }
482
+ export interface URLTrack extends TrackInfo {
483
+ /**
484
+ * Source URL of the track
485
+ *
486
+ * Note: This URL must be served the with correct CORs headers.
487
+ *
488
+ * Example: `'https://example.com/song.mp3'`
489
+ */
490
+ url: string;
491
+ }
492
+ export interface BlobTrack extends TrackInfo {
493
+ /**
494
+ * Blob source of the track
495
+ */
496
+ blob: Blob;
497
+ }
498
+ export interface LoadedURLTrack {
499
+ url: string;
500
+ metaData: {
501
+ artist: string | null;
502
+ title: string | null;
503
+ album: string | null;
504
+ albumArtUrl: string | null;
505
+ };
506
+ }
507
+ export interface Options {
508
+ /**
509
+ * An object representing the initial skin to use.
510
+ *
511
+ * If omitted, the default skin, included in the bundle, will be used.
512
+ * Note: This URL must be served the with correct CORs headers.
513
+ *
514
+ * Example: `{ url: './path/to/skin.wsz' }`
515
+ */
516
+ initialSkin?: {
517
+ url: string;
518
+ };
519
+ /**
520
+ * An array of `Track`s to prepopulate the playlist with.
521
+ */
522
+ initialTracks?: Track[];
523
+ /**
524
+ * An array of objects representing available skins.
525
+ *
526
+ * These will appear in the "Options" menu under "Skins".
527
+ * Note: These URLs must be served with the correct CORs headers.
528
+ *
529
+ * Example: `[ { url: "./green.wsz", name: "Green Dimension V2" } ]`
530
+ */
531
+ availableSkins?: {
532
+ url: string;
533
+ name: string;
534
+ }[];
535
+ /**
536
+ * Configure how the Winamp windows should be laid out on initial render.
537
+ */
538
+ windowLayout?: WindowLayout;
539
+ /**
540
+ * Controls if "double size mode", where the fixed sized windows are rendered
541
+ * at 2x, should be enabled
542
+ *
543
+ * **Note:** In keeping with the original Winamp, double size mode does not
544
+ * apply to resizable windows like the equalizer or Milkdrop.
545
+ *
546
+ * Default: `false`
547
+ */
548
+ enableDoubleSizeMode?: boolean;
549
+ /**
550
+ * Should global hotkeys be enabled?
551
+ *
552
+ * Default: `false`
553
+ */
554
+ enableHotkeys?: boolean;
555
+ /**
556
+ * An array of additional file pickers.
557
+ *
558
+ * These will appear in the "Options" menu under "Play".
559
+ *
560
+ * For example, this option can be used to provide a "Dropbox" file picker.
561
+ */
562
+ filePickers?: [
563
+ {
564
+ /**
565
+ * The name that will appear in the context menu.
566
+ *
567
+ * Example: `"My File Picker..."`
568
+ */
569
+ contextMenuName: string;
570
+ /**
571
+ * A function which returns a Promise that resolves to an array of `Track`s
572
+ *
573
+ * Example: `() => Promise.resolve([{ url: './rick_roll.mp3' }])`
574
+ */
575
+ filePicker: () => Promise<Track[]>;
576
+ /**
577
+ * Indicates if this options should be made available when the user is offline.
578
+ */
579
+ requiresNetwork: boolean;
580
+ }
581
+ ];
582
+ zIndex?: number;
583
+ handleTrackDropEvent?: (e: React.DragEvent<HTMLDivElement>) => Track[] | null | Promise<Track[] | null>;
584
+ handleAddUrlEvent?: () => Track[] | null | Promise<Track[] | null>;
585
+ handleLoadListEvent?: () => Track[] | null | Promise<Track[] | null>;
586
+ handleSaveListEvent?: (tracks: Track[]) => null | Promise<null>;
587
+ }
588
+ /**
589
+ * Specifies the initial position and size of a the Winamp windows.
590
+ *
591
+ * Positions are specified in pixels from the top left corner of an imaginary
592
+ * box. On initial render, the collection of visible windows will be centered
593
+ * within the HTML element passed to `Webamp.renderWhenReady(element)`. In other
594
+ * words, the positions given here will determine the _relative_ position of the
595
+ * windows. The absolute position will be determined by the HTML element in
596
+ * which Webamp is centered.
597
+ *
598
+ * Enabling "shade mode" for a window that supports it, will cause it to be
599
+ * rendered minimized. Be default windows are not in shade mode.
600
+ *
601
+ * Windows which support resizing can have their size specified. If omitted,
602
+ * they default to their small base size.
603
+ *
604
+ * Windows that are omitted will start closed. Enabling "closed" for a window
605
+ * that supports it, will cause it to start closed.
606
+ */
607
+ export type WindowLayout = {
608
+ main?: {
609
+ position: WindowPosition;
610
+ shadeMode?: boolean;
611
+ closed?: boolean;
612
+ };
613
+ equalizer?: {
614
+ position: WindowPosition;
615
+ shadeMode?: boolean;
616
+ closed?: boolean;
617
+ };
618
+ playlist?: {
619
+ position: WindowPosition;
620
+ shadeMode?: boolean;
621
+ size?: WindowSize | null;
622
+ closed?: boolean;
623
+ };
624
+ milkdrop?: {
625
+ position: WindowPosition;
626
+ size?: WindowSize | null;
627
+ closed?: boolean;
628
+ };
629
+ };
630
+ /**
631
+ * Offset from the top left corner of an imaginary box.
632
+ */
633
+ export type WindowPosition = {
634
+ top: number;
635
+ left: number;
636
+ };
637
+ /**
638
+ * Resizable windows in Winamp have a base size and can be expanded in
639
+ * increments based on the size of the skin sprite.
640
+ *
641
+ * To specify a window being larger than its base size, use `extraHeight` to
642
+ * specify how many sprite increments to expand the window's height by, and
643
+ * `extraWidth` to specify how many sprite increments to expand the window's
644
+ * width by.
645
+ */
646
+ export type WindowSize = {
647
+ extraHeight: number;
648
+ extraWidth: number;
649
+ };
650
+ /**
651
+ * Many methods on the webamp instance deal with track.
652
+ *
653
+ * Either `url` or `blob` must be specified
654
+ */
655
+ export type Track = URLTrack | BlobTrack;
656
+ export interface PlaylistTrack {
657
+ id: number;
658
+ artist?: string;
659
+ title?: string;
660
+ album?: string;
661
+ url: string;
662
+ defaultName: string | null;
663
+ albumArtUrl?: string | null;
664
+ mediaTagsRequestStatus: MediaTagRequestStatus;
665
+ duration: number | null;
666
+ kbps?: string;
667
+ khz: string;
668
+ channels?: number;
669
+ }
670
+ export interface AppState {
671
+ userInput: UserInputState;
672
+ windows: WindowsState;
673
+ display: DisplayState;
674
+ settings: SettingsState;
675
+ equalizer: EqualizerState;
676
+ playlist: PlaylistState;
677
+ media: MediaState;
678
+ network: NetworkState;
679
+ tracks: TracksState;
680
+ milkdrop: MilkdropState;
681
+ }
682
+ export type PartialState = any;
683
+ /**
684
+ * Type definition of the music-metadata-browser module.
685
+ * Ref: https://github.com/Borewit/music-metadata-browser/blob/master/src/index.ts
686
+ */
687
+ export interface IMusicMetadataBrowserApi {
688
+ /**
689
+ * Parse Web API File
690
+ * @param {Blob} blob
691
+ * @param {IOptions} options Parsing options
692
+ * @returns {Promise<IAudioMetadata>}
693
+ */
694
+ parseBlob(blob: Blob, options?: IOptions): Promise<IAudioMetadata>;
695
+ /**
696
+ * Parse fetched file, using the Web Fetch API
697
+ * @param {string} audioTrackUrl URL to download the audio track from
698
+ * @param {IOptions} options Parsing options
699
+ * @returns {Promise<IAudioMetadata>}
700
+ */
701
+ fetchFromUrl(audioTrackUrl: string, options?: IOptions): Promise<IAudioMetadata>;
702
+ /**
703
+ * Parse audio from Node Buffer
704
+ * @param {Stream.Readable} stream Audio input stream
705
+ * @param {string} mimeType <string> Content specification MIME-type, e.g.: 'audio/mpeg'
706
+ * @param {IOptions} options Parsing options
707
+ * @returns {Promise<IAudioMetadata>}
708
+ */
709
+ parseBuffer(buf: Buffer, mimeType?: string, options?: IOptions): Promise<IAudioMetadata>;
710
+ }
711
+ export interface Extras {
712
+ requireJSZip(): Promise<any>;
713
+ requireMusicMetadata(): Promise<IMusicMetadataBrowserApi>;
714
+ convertPreset: ((file: File) => Promise<Object>) | null;
715
+ handleTrackDropEvent?: (e: React.DragEvent<HTMLDivElement>) => Track[] | null | Promise<Track[] | null>;
716
+ handleAddUrlEvent?: () => Track[] | null | Promise<Track[] | null>;
717
+ handleLoadListEvent?: () => Track[] | null | Promise<Track[] | null>;
718
+ handleSaveListEvent?: (tracks: Track[]) => null | Promise<null>;
719
+ }
720
+ export type GetState = () => AppState;
721
+ export type Thunk = ThunkAction<void, AppState, Extras, Action>;
722
+ export type Dispatch = ThunkDispatch<AppState, Extras, Action>;
723
+ export type Reducer = (state: AppState, action: Action) => AppState;
724
+ export type Middleware = (store: MiddlewareStore) => (next: Dispatch) => (action: Action) => any;
725
+ export interface Store extends ReduxStore {
726
+ subscribe(cb: () => void): () => void;
727
+ dispatch: Dispatch;
728
+ getState: GetState;
729
+ }
730
+ export interface MiddlewareStore {
731
+ dispatch: Dispatch;
732
+ getState: GetState;
733
+ }
734
+ export {};