@scarlett-player/audio-ui 0.2.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.
@@ -0,0 +1,113 @@
1
+ import { Plugin } from '@scarlett-player/core';
2
+
3
+ /**
4
+ * Audio UI Plugin Types
5
+ */
6
+
7
+ /**
8
+ * Audio UI layout modes
9
+ */
10
+ type AudioUILayout = 'full' | 'compact' | 'mini';
11
+ /**
12
+ * Audio UI theme
13
+ */
14
+ interface AudioUITheme {
15
+ /** Primary color (buttons, progress) */
16
+ primary?: string;
17
+ /** Background color */
18
+ background?: string;
19
+ /** Text color */
20
+ text?: string;
21
+ /** Secondary text color (artist, duration) */
22
+ textSecondary?: string;
23
+ /** Progress bar background */
24
+ progressBackground?: string;
25
+ /** Progress bar fill */
26
+ progressFill?: string;
27
+ /** Border radius */
28
+ borderRadius?: string;
29
+ /** Font family */
30
+ fontFamily?: string;
31
+ }
32
+ /**
33
+ * Audio UI plugin configuration
34
+ */
35
+ interface AudioUIPluginConfig {
36
+ /** Layout mode (default: 'full') */
37
+ layout?: AudioUILayout;
38
+ /** Show album artwork (default: true) */
39
+ showArtwork?: boolean;
40
+ /** Show track title (default: true) */
41
+ showTitle?: boolean;
42
+ /** Show artist name (default: true) */
43
+ showArtist?: boolean;
44
+ /** Show duration/time (default: true) */
45
+ showTime?: boolean;
46
+ /** Show volume control (default: true) */
47
+ showVolume?: boolean;
48
+ /** Show shuffle button - requires playlist plugin (default: true) */
49
+ showShuffle?: boolean;
50
+ /** Show repeat button - requires playlist plugin (default: true) */
51
+ showRepeat?: boolean;
52
+ /** Show next/previous buttons (default: true) */
53
+ showNavigation?: boolean;
54
+ /** Default artwork URL when none provided */
55
+ defaultArtwork?: string;
56
+ /** Custom theme */
57
+ theme?: AudioUITheme;
58
+ /** CSS class prefix (default: 'scarlett-audio') */
59
+ classPrefix?: string;
60
+ /** Auto-hide controls after inactivity (ms, 0 to disable) */
61
+ autoHide?: number;
62
+ /** Index signature for PluginConfig compatibility */
63
+ [key: string]: unknown;
64
+ }
65
+ /**
66
+ * Audio UI plugin interface
67
+ */
68
+ interface IAudioUIPlugin extends Plugin<AudioUIPluginConfig> {
69
+ /**
70
+ * Get the UI container element
71
+ */
72
+ getElement(): HTMLElement | null;
73
+ /**
74
+ * Set the layout mode
75
+ */
76
+ setLayout(layout: AudioUILayout): void;
77
+ /**
78
+ * Update the theme
79
+ */
80
+ setTheme(theme: Partial<AudioUITheme>): void;
81
+ /**
82
+ * Show the UI
83
+ */
84
+ show(): void;
85
+ /**
86
+ * Hide the UI
87
+ */
88
+ hide(): void;
89
+ /**
90
+ * Toggle UI visibility
91
+ */
92
+ toggle(): void;
93
+ }
94
+
95
+ /**
96
+ * Audio UI Plugin for Scarlett Player
97
+ *
98
+ * Provides a compact, beautiful audio player interface:
99
+ * - Album artwork display
100
+ * - Track title and artist
101
+ * - Progress bar with seek
102
+ * - Play/pause, next/previous controls
103
+ * - Volume control
104
+ * - Shuffle/repeat (when playlist plugin present)
105
+ * - Multiple layout modes (full, compact, mini)
106
+ */
107
+
108
+ /**
109
+ * Create an Audio UI Plugin instance.
110
+ */
111
+ declare function createAudioUIPlugin(config?: Partial<AudioUIPluginConfig>): IAudioUIPlugin;
112
+
113
+ export { type AudioUILayout, type AudioUIPluginConfig, type AudioUITheme, type IAudioUIPlugin, createAudioUIPlugin, createAudioUIPlugin as default };
@@ -0,0 +1,113 @@
1
+ import { Plugin } from '@scarlett-player/core';
2
+
3
+ /**
4
+ * Audio UI Plugin Types
5
+ */
6
+
7
+ /**
8
+ * Audio UI layout modes
9
+ */
10
+ type AudioUILayout = 'full' | 'compact' | 'mini';
11
+ /**
12
+ * Audio UI theme
13
+ */
14
+ interface AudioUITheme {
15
+ /** Primary color (buttons, progress) */
16
+ primary?: string;
17
+ /** Background color */
18
+ background?: string;
19
+ /** Text color */
20
+ text?: string;
21
+ /** Secondary text color (artist, duration) */
22
+ textSecondary?: string;
23
+ /** Progress bar background */
24
+ progressBackground?: string;
25
+ /** Progress bar fill */
26
+ progressFill?: string;
27
+ /** Border radius */
28
+ borderRadius?: string;
29
+ /** Font family */
30
+ fontFamily?: string;
31
+ }
32
+ /**
33
+ * Audio UI plugin configuration
34
+ */
35
+ interface AudioUIPluginConfig {
36
+ /** Layout mode (default: 'full') */
37
+ layout?: AudioUILayout;
38
+ /** Show album artwork (default: true) */
39
+ showArtwork?: boolean;
40
+ /** Show track title (default: true) */
41
+ showTitle?: boolean;
42
+ /** Show artist name (default: true) */
43
+ showArtist?: boolean;
44
+ /** Show duration/time (default: true) */
45
+ showTime?: boolean;
46
+ /** Show volume control (default: true) */
47
+ showVolume?: boolean;
48
+ /** Show shuffle button - requires playlist plugin (default: true) */
49
+ showShuffle?: boolean;
50
+ /** Show repeat button - requires playlist plugin (default: true) */
51
+ showRepeat?: boolean;
52
+ /** Show next/previous buttons (default: true) */
53
+ showNavigation?: boolean;
54
+ /** Default artwork URL when none provided */
55
+ defaultArtwork?: string;
56
+ /** Custom theme */
57
+ theme?: AudioUITheme;
58
+ /** CSS class prefix (default: 'scarlett-audio') */
59
+ classPrefix?: string;
60
+ /** Auto-hide controls after inactivity (ms, 0 to disable) */
61
+ autoHide?: number;
62
+ /** Index signature for PluginConfig compatibility */
63
+ [key: string]: unknown;
64
+ }
65
+ /**
66
+ * Audio UI plugin interface
67
+ */
68
+ interface IAudioUIPlugin extends Plugin<AudioUIPluginConfig> {
69
+ /**
70
+ * Get the UI container element
71
+ */
72
+ getElement(): HTMLElement | null;
73
+ /**
74
+ * Set the layout mode
75
+ */
76
+ setLayout(layout: AudioUILayout): void;
77
+ /**
78
+ * Update the theme
79
+ */
80
+ setTheme(theme: Partial<AudioUITheme>): void;
81
+ /**
82
+ * Show the UI
83
+ */
84
+ show(): void;
85
+ /**
86
+ * Hide the UI
87
+ */
88
+ hide(): void;
89
+ /**
90
+ * Toggle UI visibility
91
+ */
92
+ toggle(): void;
93
+ }
94
+
95
+ /**
96
+ * Audio UI Plugin for Scarlett Player
97
+ *
98
+ * Provides a compact, beautiful audio player interface:
99
+ * - Album artwork display
100
+ * - Track title and artist
101
+ * - Progress bar with seek
102
+ * - Play/pause, next/previous controls
103
+ * - Volume control
104
+ * - Shuffle/repeat (when playlist plugin present)
105
+ * - Multiple layout modes (full, compact, mini)
106
+ */
107
+
108
+ /**
109
+ * Create an Audio UI Plugin instance.
110
+ */
111
+ declare function createAudioUIPlugin(config?: Partial<AudioUIPluginConfig>): IAudioUIPlugin;
112
+
113
+ export { type AudioUILayout, type AudioUIPluginConfig, type AudioUITheme, type IAudioUIPlugin, createAudioUIPlugin, createAudioUIPlugin as default };