@songloft/lynx-plugin-sdk 2.22.0 → 2.23.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.
package/README.md CHANGED
@@ -50,6 +50,10 @@ const theme = getTheme()
50
50
 
51
51
  `PlayerState` 包含:`queue`、`current_index`、`current_song`、`is_playing`、`current_time`、`duration`、`volume`、`play_mode`、`source_playlist_id`。
52
52
 
53
+ ### 播放音效
54
+
55
+ `host.getInfo` 公布 `player.audioEffects` 能力时,可通过 `invokeHost('player', 'getAudioEffects')` 获取会话和预设。沿用 `player` 命名空间的 `applyAudioEffects` 和 `clearAudioEffects` 操作该会话。类型定义为 `PlaybackAudioEffectsState`、`PlaybackAudioEffects` 和 `ApplyPlaybackAudioEffectsOptions`。见 [宿主接口文档](https://github.com/songloft-org/songloft-player-lynx/blob/main/docs/reference/plugin-client-sdk.md#插件播放音效)。
56
+
53
57
  ### `onThemeChange(cb): () => void`
54
58
 
55
59
  监听宿主推送的主题变更(`'light'` / `'dark'`)。返回取消订阅函数。
@@ -0,0 +1,25 @@
1
+ /** Temporary host audio effects for a plugin's playback session. */
2
+ export interface PlaybackAudioEffects {
3
+ equalizer?: {
4
+ preset: string;
5
+ };
6
+ reverb?: {
7
+ preset: string;
8
+ };
9
+ }
10
+ export interface PlaybackAudioEffectsState {
11
+ playbackId: string | null;
12
+ supported: {
13
+ equalizer?: {
14
+ presets: string[];
15
+ };
16
+ reverb?: {
17
+ presets: string[];
18
+ };
19
+ };
20
+ applied: PlaybackAudioEffects | null;
21
+ }
22
+ export interface ApplyPlaybackAudioEffectsOptions {
23
+ playbackId: string;
24
+ effects: PlaybackAudioEffects;
25
+ }
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -16,3 +16,4 @@ export { apiGet, apiPost, apiPut, apiDelete } from './api.js';
16
16
  export { onPlayerState, onThemeChange, onPush, type PlayerState, } from './events.js';
17
17
  export { getGlobalProps, getFrameId, getTheme } from './globals.js';
18
18
  export { PluginSocket } from './socket.js';
19
+ export type { ApplyPlaybackAudioEffectsOptions, PlaybackAudioEffects, PlaybackAudioEffectsState, } from './audio-effects.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@songloft/lynx-plugin-sdk",
3
- "version": "2.22.0",
3
+ "version": "2.23.0",
4
4
  "description": "SDK for Songloft plugins rendered via Lynx native (renderEngine: lynx)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",