@songloft/lynx-plugin-sdk 2.21.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Songloft contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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.21.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",