@open-orpheus/plugin-api 0.0.0-stage → 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 (215) hide show
  1. package/dist/host/_native/open-orpheus__database.d.ts +50 -0
  2. package/dist/host/_native/open-orpheus__window.d.ts +266 -0
  3. package/dist/host/src/constants.d.ts +6 -0
  4. package/dist/host/src/main/afp.d.ts +1 -0
  5. package/dist/host/src/main/arguments.d.ts +4 -0
  6. package/dist/host/src/main/audio/ChunkTracker.d.ts +23 -0
  7. package/dist/host/src/main/audio/DownloadScheduler.d.ts +53 -0
  8. package/dist/host/src/main/audio/MediaEngine.d.ts +47 -0
  9. package/dist/host/src/main/audio/OnlineStreamer.d.ts +66 -0
  10. package/dist/host/src/main/audio/StorageManager.d.ts +18 -0
  11. package/dist/host/src/main/audio.d.ts +6 -0
  12. package/dist/host/src/main/av3a/Av3aEngine.d.ts +24 -0
  13. package/dist/host/src/main/av3a/Av3aM4aSession.d.ts +101 -0
  14. package/dist/host/src/main/av3a/Av3aPlaybackProcess.d.ts +52 -0
  15. package/dist/host/src/main/av3a/detect.d.ts +6 -0
  16. package/dist/host/src/main/av3a/sources.d.ts +13 -0
  17. package/dist/host/src/main/av3a/types.d.ts +54 -0
  18. package/dist/host/src/main/bridge/modules/inputRegion.d.ts +1 -0
  19. package/dist/host/src/main/bridge/modules/lyrics.d.ts +1 -0
  20. package/dist/host/src/main/bridge/modules/settings.d.ts +1 -0
  21. package/dist/host/src/main/bridge/register.d.ts +9 -0
  22. package/dist/host/src/main/cache/HttpCacheStorage.d.ts +10 -0
  23. package/dist/host/src/main/cache/LyricCahceManager.d.ts +21 -0
  24. package/dist/host/src/main/cache/PlayCacheManager.d.ts +72 -0
  25. package/dist/host/src/main/cache.d.ts +7 -0
  26. package/dist/host/src/main/calls/app.d.ts +1 -0
  27. package/dist/host/src/main/calls/audioeffect.d.ts +1 -0
  28. package/dist/host/src/main/calls/browser.d.ts +1 -0
  29. package/dist/host/src/main/calls/desktop.d.ts +2 -0
  30. package/dist/host/src/main/calls/desktoppet.d.ts +1 -0
  31. package/dist/host/src/main/calls/download.d.ts +1 -0
  32. package/dist/host/src/main/calls/index.d.ts +16 -0
  33. package/dist/host/src/main/calls/musiclibrary.d.ts +1 -0
  34. package/dist/host/src/main/calls/network.d.ts +1 -0
  35. package/dist/host/src/main/calls/os.d.ts +1 -0
  36. package/dist/host/src/main/calls/player.d.ts +22 -0
  37. package/dist/host/src/main/calls/process.d.ts +1 -0
  38. package/dist/host/src/main/calls/rtc.d.ts +1 -0
  39. package/dist/host/src/main/calls/storage.d.ts +1 -0
  40. package/dist/host/src/main/calls/trayicon.d.ts +1 -0
  41. package/dist/host/src/main/calls/update.d.ts +1 -0
  42. package/dist/host/src/main/calls/winhelper.d.ts +1 -0
  43. package/dist/host/src/main/calls.d.ts +5 -0
  44. package/dist/host/src/main/channel.d.ts +1 -0
  45. package/dist/host/src/main/cookie.d.ts +13 -0
  46. package/dist/host/src/main/crypto.d.ts +46 -0
  47. package/dist/host/src/main/database/KeyvSqliteDriver.d.ts +6 -0
  48. package/dist/host/src/main/database.d.ts +5 -0
  49. package/dist/host/src/main/dawn.d.ts +31 -0
  50. package/dist/host/src/main/device.d.ts +3 -0
  51. package/dist/host/src/main/download.d.ts +40 -0
  52. package/dist/host/src/main/error.d.ts +1 -0
  53. package/dist/host/src/main/folders.d.ts +18 -0
  54. package/dist/host/src/main/fonts.d.ts +1 -0
  55. package/dist/host/src/main/gui.d.ts +4 -0
  56. package/dist/host/src/main/id3.d.ts +42 -0
  57. package/dist/host/src/main/lifecycle.d.ts +118 -0
  58. package/dist/host/src/main/logger.d.ts +12 -0
  59. package/dist/host/src/main/lyrics/DbusLyricsService.d.ts +115 -0
  60. package/dist/host/src/main/lyrics/LyricsDispatcher.d.ts +26 -0
  61. package/dist/host/src/main/lyrics/dbus.d.ts +16 -0
  62. package/dist/host/src/main/lyrics/parse.d.ts +21 -0
  63. package/dist/host/src/main/lyrics.d.ts +2 -0
  64. package/dist/host/src/main/mediaSession.d.ts +42 -0
  65. package/dist/host/src/main/menu/AppMenu.d.ts +35 -0
  66. package/dist/host/src/main/menu/anchor.d.ts +13 -0
  67. package/dist/host/src/main/menu/backend/DesktopWindowBackend.d.ts +30 -0
  68. package/dist/host/src/main/menu/backend/MenuBackend.d.ts +28 -0
  69. package/dist/host/src/main/menu/backend/WaylandOverlayBackend.d.ts +15 -0
  70. package/dist/host/src/main/menu/backend/WaylandPopupBackend.d.ts +31 -0
  71. package/dist/host/src/main/menu/constants.d.ts +12 -0
  72. package/dist/host/src/main/menu/index.d.ts +2 -0
  73. package/dist/host/src/main/menu/native-popup.d.ts +16 -0
  74. package/dist/host/src/main/menu/patch.d.ts +3 -0
  75. package/dist/host/src/main/menu/skin.d.ts +3 -0
  76. package/dist/host/src/main/menu/surface/BaseWindowMenuSurface.d.ts +69 -0
  77. package/dist/host/src/main/menu/surface/MenuSurface.d.ts +29 -0
  78. package/dist/host/src/main/menu/surface/MenuSurfacePath.d.ts +29 -0
  79. package/dist/host/src/main/menu/surface/SurfacePool.d.ts +15 -0
  80. package/dist/host/src/main/menu/workaround.d.ts +6 -0
  81. package/dist/host/src/main/ncae.d.ts +8 -0
  82. package/dist/host/src/main/network/handler.d.ts +3 -0
  83. package/dist/host/src/main/network/interceptor.d.ts +2 -0
  84. package/dist/host/src/main/network/interceptors/anonymous.d.ts +2 -0
  85. package/dist/host/src/main/network/pipeline.d.ts +8 -0
  86. package/dist/host/src/main/network/types.d.ts +70 -0
  87. package/dist/host/src/main/orpheus.d.ts +10 -0
  88. package/dist/host/src/main/pack.d.ts +27 -0
  89. package/dist/host/src/main/packs/Pack.d.ts +12 -0
  90. package/dist/host/src/main/packs/SkinPack.d.ts +6 -0
  91. package/dist/host/src/main/packs/WebPack.d.ts +6 -0
  92. package/dist/host/src/main/playback/PlaybackController.d.ts +57 -0
  93. package/dist/host/src/main/playback/PlayerCommandRouter.d.ts +85 -0
  94. package/dist/host/src/main/playback/adapters/MediaSessionAdapter.d.ts +61 -0
  95. package/dist/host/src/main/playback/adapters/MprisAdapter.d.ts +48 -0
  96. package/dist/host/src/main/playback/adapters/NowPlayingAdapter.d.ts +23 -0
  97. package/dist/host/src/main/playback/adapters/SmtcAdapter.d.ts +23 -0
  98. package/dist/host/src/main/playback/artwork.d.ts +47 -0
  99. package/dist/host/src/main/playback/modes.d.ts +8 -0
  100. package/dist/host/src/main/playback/types.d.ts +39 -0
  101. package/dist/host/src/main/plugin/discover.d.ts +36 -0
  102. package/dist/host/src/main/plugin/index.d.ts +12 -0
  103. package/dist/host/src/main/plugin/loader.d.ts +43 -0
  104. package/dist/host/src/main/plugin/manager.d.ts +15 -0
  105. package/dist/host/src/main/plugin/metadata.d.ts +24 -0
  106. package/dist/host/src/main/plugin/state.d.ts +17 -0
  107. package/dist/host/src/main/plugin/tree.d.ts +13 -0
  108. package/dist/host/src/main/plugin/types.d.ts +18 -0
  109. package/dist/host/src/main/protocol.d.ts +4 -0
  110. package/dist/host/src/main/request.d.ts +16 -0
  111. package/dist/host/src/main/settings.d.ts +6 -0
  112. package/dist/host/src/main/shortcuts.d.ts +10 -0
  113. package/dist/host/src/main/shutdown.d.ts +32 -0
  114. package/dist/host/src/main/skin/color.d.ts +2 -0
  115. package/dist/host/src/main/skin/dui.d.ts +15 -0
  116. package/dist/host/src/main/tray.d.ts +8 -0
  117. package/dist/host/src/main/update.d.ts +2 -0
  118. package/dist/host/src/main/util/display.d.ts +3 -0
  119. package/dist/host/src/main/util/env.d.ts +1 -0
  120. package/dist/host/src/main/util/fs.d.ts +21 -0
  121. package/dist/host/src/main/util/image.d.ts +1 -0
  122. package/dist/host/src/main/util/musicFile.d.ts +1 -0
  123. package/dist/host/src/main/util/musicPicture.d.ts +2 -0
  124. package/dist/host/src/main/util/path.d.ts +2 -0
  125. package/dist/host/src/main/util/send.d.ts +13 -0
  126. package/dist/host/src/main/util/url.d.ts +19 -0
  127. package/dist/host/src/main/util/window.d.ts +2 -0
  128. package/dist/host/src/main/window.d.ts +294 -0
  129. package/dist/host/src/main/windows/desktop-lyrics.d.ts +12 -0
  130. package/dist/host/src/main/windows/desktop-pet.d.ts +8 -0
  131. package/dist/host/src/main/windows/main.d.ts +6 -0
  132. package/dist/host/src/main/windows/manage.d.ts +2 -0
  133. package/dist/host/src/main/windows/mini-player.d.ts +16 -0
  134. package/dist/host/src/main/windows/music-desktop.d.ts +13 -0
  135. package/dist/host/src/main/windows/package-download.d.ts +2 -0
  136. package/dist/host/src/main/windows/plugin-manager.d.ts +5 -0
  137. package/dist/host/src/main/xeapi.d.ts +53 -0
  138. package/dist/host/src/preload/AudioEffectManager.d.ts +124 -0
  139. package/dist/host/src/preload/PlaybackBackend.d.ts +34 -0
  140. package/dist/host/src/preload/Player.d.ts +221 -0
  141. package/dist/host/src/preload/av3a/Av3aPcmPlayer.d.ts +84 -0
  142. package/dist/host/src/preload/av3a/bridge.d.ts +21 -0
  143. package/dist/host/src/preload/av3a/channel.d.ts +40 -0
  144. package/dist/host/src/preload/av3a/detect.d.ts +6 -0
  145. package/dist/host/src/preload/backends/Av3aPlaybackBackend.d.ts +32 -0
  146. package/dist/host/src/preload/backends/MediaPlaybackBackend.d.ts +25 -0
  147. package/dist/host/src/shared/CallDispatcher.d.ts +12 -0
  148. package/dist/host/src/shared/contracts/av3a-api.d.ts +50 -0
  149. package/dist/host/src/shared/contracts/av3a-process.d.ts +56 -0
  150. package/dist/host/src/shared/contracts/desktop-lyrics-api.d.ts +23 -0
  151. package/dist/host/src/shared/contracts/input-region-api.d.ts +6 -0
  152. package/dist/host/src/shared/contracts/lyrics-api.d.ts +11 -0
  153. package/dist/host/src/shared/contracts/manage-api.d.ts +33 -0
  154. package/dist/host/src/shared/contracts/mini-player-api.d.ts +19 -0
  155. package/dist/host/src/shared/contracts/plugin-manager-api.d.ts +34 -0
  156. package/dist/host/src/shared/contracts/settings-api.d.ts +15 -0
  157. package/dist/host/src/shared/playbackMode.d.ts +2 -0
  158. package/dist/host/src/shared/plugin/registry.d.ts +32 -0
  159. package/dist/host/src/shared/types/desktop-lyrics.d.ts +44 -0
  160. package/dist/host/src/shared/types/dui.d.ts +37 -0
  161. package/dist/host/src/shared/types/input-region.d.ts +6 -0
  162. package/dist/host/src/shared/types/lyrics.d.ts +15 -0
  163. package/dist/host/src/shared/types/manage.d.ts +14 -0
  164. package/dist/host/src/shared/types/menu-surface.d.ts +43 -0
  165. package/dist/host/src/shared/types/menu.d.ts +29 -0
  166. package/dist/host/src/shared/types/mini-player.d.ts +90 -0
  167. package/dist/host/src/shared/types/ncae.d.ts +21 -0
  168. package/dist/host/src/shared/types/package-download.d.ts +6 -0
  169. package/dist/host/src/shared/types/playback-mode.d.ts +3 -0
  170. package/dist/host/src/shared/types/settings.d.ts +9 -0
  171. package/dist/host/src/shared/types/update.d.ts +6 -0
  172. package/dist/host/src/shared/util.d.ts +22 -0
  173. package/dist/index.d.ts +7 -0
  174. package/dist/preload/host/src/constants.d.ts +6 -0
  175. package/dist/preload/host/src/main/network/types.d.ts +70 -0
  176. package/dist/preload/host/src/preload/AudioEffectManager.d.ts +124 -0
  177. package/dist/preload/host/src/preload/MusicRecognizer.d.ts +25 -0
  178. package/dist/preload/host/src/preload/PlaybackBackend.d.ts +34 -0
  179. package/dist/preload/host/src/preload/Player.d.ts +221 -0
  180. package/dist/preload/host/src/preload/YunxinIM.d.ts +15 -0
  181. package/dist/preload/host/src/preload/audioplayer.d.ts +4 -0
  182. package/dist/preload/host/src/preload/av3a/Av3aPcmPlayer.d.ts +84 -0
  183. package/dist/preload/host/src/preload/av3a/bridge.d.ts +21 -0
  184. package/dist/preload/host/src/preload/av3a/channel.d.ts +40 -0
  185. package/dist/preload/host/src/preload/av3a/detect.d.ts +6 -0
  186. package/dist/preload/host/src/preload/backends/Av3aPlaybackBackend.d.ts +32 -0
  187. package/dist/preload/host/src/preload/backends/MediaPlaybackBackend.d.ts +25 -0
  188. package/dist/preload/host/src/preload/calls/app.d.ts +1 -0
  189. package/dist/preload/host/src/preload/calls/audioeffect.d.ts +1 -0
  190. package/dist/preload/host/src/preload/calls/audioplayer.d.ts +1 -0
  191. package/dist/preload/host/src/preload/calls/im.d.ts +1 -0
  192. package/dist/preload/host/src/preload/calls/index.d.ts +6 -0
  193. package/dist/preload/host/src/preload/calls/network.d.ts +1 -0
  194. package/dist/preload/host/src/preload/calls/nimsys.d.ts +1 -0
  195. package/dist/preload/host/src/preload/calls/os.d.ts +1 -0
  196. package/dist/preload/host/src/preload/calls/player.d.ts +1 -0
  197. package/dist/preload/host/src/preload/calls/update.d.ts +1 -0
  198. package/dist/preload/host/src/preload/calls.d.ts +4 -0
  199. package/dist/preload/host/src/preload/channel.d.ts +1 -0
  200. package/dist/preload/host/src/preload/playbackMode.d.ts +13 -0
  201. package/dist/preload/host/src/preload/plugin/types.d.ts +18 -0
  202. package/dist/preload/host/src/preload/util.d.ts +1 -0
  203. package/dist/preload/host/src/shared/CallDispatcher.d.ts +12 -0
  204. package/dist/preload/host/src/shared/contracts/av3a-api.d.ts +50 -0
  205. package/dist/preload/host/src/shared/contracts/av3a-process.d.ts +56 -0
  206. package/dist/preload/host/src/shared/playbackMode.d.ts +2 -0
  207. package/dist/preload/host/src/shared/plugin/registry.d.ts +32 -0
  208. package/dist/preload/host/src/shared/types/ncae.d.ts +21 -0
  209. package/dist/preload/host/src/shared/types/playback-mode.d.ts +3 -0
  210. package/dist/preload/host/src/shared/util.d.ts +22 -0
  211. package/dist/preload/index.d.ts +7 -0
  212. package/dist/preload/registry-map.d.ts +36 -0
  213. package/dist/registry-map.d.ts +145 -0
  214. package/package.json +58 -4
  215. package/README.md +0 -3
@@ -0,0 +1,32 @@
1
+ import type { AudioPlayInfo } from "../Player";
2
+ import type { PlaybackBackend, PlaybackEventSink } from "../PlaybackBackend";
3
+ /**
4
+ * The AV3A decode backend. Owns an `Av3aPcmPlayer` (worklet playback, PCM
5
+ * resampling/downmix, seek/rate) plus the AV3A timeupdate clock, and raises
6
+ * the same media events as the media-element backend through the sink.
7
+ */
8
+ export declare class Av3aPlaybackBackend implements PlaybackBackend {
9
+ private readonly player;
10
+ private readonly sink;
11
+ private readonly effectInput;
12
+ private attached;
13
+ private clock;
14
+ private openResolve;
15
+ private playbackRateValue;
16
+ constructor(ctx: AudioContext, effectInput: AudioNode, sink: PlaybackEventSink);
17
+ get sourceNode(): AudioNode | null;
18
+ get currentTime(): number;
19
+ get duration(): number;
20
+ get paused(): boolean;
21
+ get ended(): boolean;
22
+ get playbackRate(): number;
23
+ setPlaybackRate(rate: number): void;
24
+ load(playInfo: AudioPlayInfo): Promise<void>;
25
+ play(): Promise<void>;
26
+ pause(): void;
27
+ stop(): void;
28
+ seek(seconds: number): void;
29
+ private startClock;
30
+ private stopClock;
31
+ dispose(): Promise<void>;
32
+ }
@@ -0,0 +1,25 @@
1
+ import type { PlaybackBackend, PlaybackEventSink } from "../PlaybackBackend";
2
+ /**
3
+ * The media-element backend. Owns the hidden `<audio>` element and its
4
+ * `MediaElementAudioSourceNode` so its output flows through the shared WebAudio
5
+ * graph. Real element events are raised through the sink (which `Player` gates
6
+ * to the active backend).
7
+ */
8
+ export declare class MediaPlaybackBackend implements PlaybackBackend {
9
+ readonly sourceNode: MediaElementAudioSourceNode;
10
+ private readonly element;
11
+ private readonly sink;
12
+ constructor(ctx: AudioContext, sink: PlaybackEventSink);
13
+ load(): Promise<void>;
14
+ play(): Promise<void>;
15
+ pause(): void;
16
+ stop(): void;
17
+ seek(seconds: number): void;
18
+ get currentTime(): number;
19
+ get duration(): number;
20
+ get paused(): boolean;
21
+ get ended(): boolean;
22
+ get playbackRate(): number;
23
+ setPlaybackRate(rate: number): void;
24
+ dispose(): Promise<void>;
25
+ }
@@ -0,0 +1,12 @@
1
+ export type HandlerFunction<Args extends unknown[] = unknown[], Return extends unknown[] | void = void> = (...args: Args) => Return | Promise<Return>;
2
+ export type CallbackHandlerFunction<Args extends unknown[] = unknown[]> = (callback: (...args: unknown[]) => void, ...args: Args) => void | Promise<void>;
3
+ export default class CallDispatcher {
4
+ private handlers;
5
+ private callbackHandlers;
6
+ registerHandler<Args extends unknown[], Return extends unknown[] | void>(cmd: string, handler: HandlerFunction<Args, Return>): void;
7
+ registerHandlers(handlers: {
8
+ [cmd: string]: HandlerFunction;
9
+ }): void;
10
+ registerCallbackHandler<Args extends unknown[]>(cmd: string, handler: CallbackHandlerFunction<Args>): void;
11
+ dispatch(cmd: string, callback: (...args: unknown[]) => void, ...args: unknown[]): Promise<void | false>;
12
+ }
@@ -0,0 +1,50 @@
1
+ import type { AudioPlayInfo } from "../../preload/Player";
2
+ /** Track metadata reported once the AV3A track has been indexed (`moov`). */
3
+ export interface Av3aTrackInfo {
4
+ sampleRate: number;
5
+ channels: number;
6
+ frameCount: number;
7
+ durationSeconds: number;
8
+ mediaStart: number;
9
+ mediaEnd: number;
10
+ }
11
+ /** One decoded PCM16 frame. */
12
+ export interface Av3aPcmEvent {
13
+ /** Interleaved little-endian PCM16 (`channels * 1024` samples). */
14
+ data: ArrayBuffer;
15
+ /** 0-based AV3A frame index within the track. */
16
+ frameIndex: number;
17
+ sampleRate: number;
18
+ channels: number;
19
+ /** Presentation timestamp in milliseconds. */
20
+ pts: number;
21
+ }
22
+ /**
23
+ * Control-plane bridge between the player window and main's AV3A playback
24
+ * manager (which forks the decode utility process).
25
+ *
26
+ * `events.*` are pushed from main via `webContents.send("av3a.<event>", ...)`;
27
+ * the remaining methods are invoked by the player via
28
+ * `ipcRenderer.invoke("av3a.<method>", ...)`.
29
+ *
30
+ * Decode events (`opened`/`pcm`/`done`/`error`), frames, and flow control
31
+ * (`pause`/`resume`/`seek`) are intentionally NOT here: they travel on the
32
+ * direct renderer<->decode-utility channel (see `av3a-process.ts`), keeping
33
+ * the main process off the real-time path. Main's `error` event is kept as a
34
+ * fallback for terminal, main-originated failures (e.g. the decode process
35
+ * crashing).
36
+ */
37
+ export interface Av3aContract {
38
+ events: {
39
+ error(callback: (message: string) => void): void;
40
+ /** Download progress of the encoded source. */
41
+ progress(callback: (loaded: number, total: number) => void): void;
42
+ };
43
+ /**
44
+ * Start decoding `playInfo` in the AV3A decode utility process.
45
+ * Currently supports URL playback (`type === 4`, `audioFormat === "av3a"`).
46
+ */
47
+ start(playInfo: AudioPlayInfo): Promise<void>;
48
+ /** Stop decoding: tear down the utility process and the underlying streamer. */
49
+ stop(): Promise<void>;
50
+ }
@@ -0,0 +1,56 @@
1
+ import type { Av3aPcmEvent, Av3aTrackInfo } from "./av3a-api";
2
+ /**
3
+ * Messaging between the main process and the AV3A decode utility process
4
+ * (`process.parentPort` <-> `UtilityProcess.postMessage`).
5
+ */
6
+ /** main -> utility process */
7
+ export type Av3aProcessMainToService = {
8
+ type: "init";
9
+ path: string;
10
+ totalLength: number;
11
+ prefixEnd: number;
12
+ } | {
13
+ type: "frontier";
14
+ prefixEnd: number;
15
+ } | {
16
+ type: "rangeReady";
17
+ id: number;
18
+ prefixEnd: number;
19
+ } | {
20
+ type: "rangeError";
21
+ id: number;
22
+ message: string;
23
+ };
24
+ /** utility process -> main (main only serves byte ranges; nothing else). */
25
+ export type Av3aProcessServiceToMain = {
26
+ type: "ensureRange";
27
+ id: number;
28
+ start: number;
29
+ end: number;
30
+ };
31
+ /**
32
+ * Direct channel (a `MessageChannelMain` end in each process) between the
33
+ * renderer and the AV3A decode utility process. Every decode event — opened,
34
+ * PCM frames, done, errors — plus flow control and seeks travels here, in
35
+ * order, without main on the path. That keeps playback flowing while main is
36
+ * busy (e.g. blocked by a window drag).
37
+ */
38
+ export type Av3aChannelRendererToService = {
39
+ type: "pause";
40
+ } | {
41
+ type: "resume";
42
+ } | {
43
+ type: "seek";
44
+ frameIndex: number;
45
+ };
46
+ export type Av3aChannelServiceToRenderer = ({
47
+ type: "pcm";
48
+ } & Av3aPcmEvent) | {
49
+ type: "opened";
50
+ info: Av3aTrackInfo;
51
+ } | {
52
+ type: "done";
53
+ } | {
54
+ type: "error";
55
+ message: string;
56
+ };
@@ -0,0 +1,23 @@
1
+ import type { DesktopLyricsPlayInfo, LyricsStyle } from "../types/desktop-lyrics";
2
+ export interface DesktopLyricsContract {
3
+ platform: NodeJS.Platform;
4
+ events: {
5
+ styleUpdate(callback: (style: LyricsStyle) => void): void;
6
+ lockUpdate(callback: (locked: boolean) => void): void;
7
+ offsetUpdate(callback: (offset: number) => void): void;
8
+ playInfoUpdate(callback: (info: DesktopLyricsPlayInfo | null) => void): void;
9
+ blur(callback: () => void): void;
10
+ };
11
+ requestFullUpdate(): Promise<void>;
12
+ dragWindow(): Promise<void>;
13
+ changeOrientation(): Promise<void>;
14
+ performAction(action: string): Promise<void>;
15
+ onMouseWheel(pageX: number, pageY: number, delta: number, modifier?: number): Promise<void>;
16
+ }
17
+ export interface DesktopLyricsPreviewContract {
18
+ requestInit(): Promise<{
19
+ style: LyricsStyle;
20
+ text: string;
21
+ }>;
22
+ ready(): Promise<void>;
23
+ }
@@ -0,0 +1,6 @@
1
+ import type { InputRegion } from "../types/input-region";
2
+ export type { InputRegion };
3
+ export interface InputRegionContract {
4
+ platform: NodeJS.Platform;
5
+ setInputRegions(regions: InputRegion[]): Promise<boolean>;
6
+ }
@@ -0,0 +1,11 @@
1
+ import type { LyricsStore } from "../types/lyrics";
2
+ export interface LyricsContract {
3
+ events: {
4
+ lyricsStoreUpdate(callback: (store: LyricsStore | null) => void): void;
5
+ sloganUpdate(callback: (slogan: string | null) => void): void;
6
+ playStateUpdate(callback: (state: boolean) => void): void;
7
+ timeUpdate(callback: (time: number) => void): void;
8
+ playbackRateUpdate(callback: (rate: number) => void): void;
9
+ };
10
+ requestFullUpdate(): Promise<void>;
11
+ }
@@ -0,0 +1,33 @@
1
+ import type { UpdateInfo } from "../types/update";
2
+ import type { CacheGroupStats, AllCacheStats } from "../types/manage";
3
+ export type { CacheGroupStats, AllCacheStats };
4
+ export interface ManageContract {
5
+ platform: NodeJS.Platform;
6
+ versions: NodeJS.ProcessVersions;
7
+ events: {
8
+ setFont(callback: (font: string | null) => void): void;
9
+ };
10
+ getFont(): Promise<string | null>;
11
+ checkUpdate(ignoreCache?: boolean): Promise<UpdateInfo | null>;
12
+ openPluginManager(): Promise<void>;
13
+ openLogFolder(): Promise<void>;
14
+ pack: {
15
+ getWebPackCommitHash(): Promise<string>;
16
+ redownloadPackage(): Promise<void>;
17
+ };
18
+ cache: {
19
+ getStats(): Promise<AllCacheStats>;
20
+ clearResources(category: "http" | "http:vacuum" | "lyrics" | "wasm"): Promise<void>;
21
+ };
22
+ protocol: {
23
+ isClient(): Promise<boolean>;
24
+ getClientName(): Promise<string>;
25
+ setAsClient(isClient: boolean): Promise<void>;
26
+ };
27
+ gpu: {
28
+ openInfo(): Promise<void>;
29
+ };
30
+ menu: {
31
+ enableDefaultMenu(): Promise<void>;
32
+ };
33
+ }
@@ -0,0 +1,19 @@
1
+ import type { MiniPlayerPlayInfo, MiniPlayerPlayState, MiniPlayerListData, MiniPlayerFullState, MiniPlayerStyle, MiniPlayerShowVolumeRequest, MiniPlayerLikeMark, MiniPlayerTogetherStatus } from "../types/mini-player";
2
+ export interface MiniPlayerContract {
3
+ events: {
4
+ playInfoUpdate(callback: (info: MiniPlayerPlayInfo | null) => void): void;
5
+ coverUpdate(callback: (url: string | null) => void): void;
6
+ likeUpdate(callback: (liked: MiniPlayerLikeMark) => void): void;
7
+ favourUpdate(callback: (favourited: boolean) => void): void;
8
+ muteUpdate(callback: (muted: boolean) => void): void;
9
+ playStateUpdate(callback: (state: MiniPlayerPlayState) => void): void;
10
+ listUpdate(callback: (data: MiniPlayerListData) => void): void;
11
+ togetherStatusUpdate(callback: (status: MiniPlayerTogetherStatus) => void): void;
12
+ showVolume(callback: (data: MiniPlayerShowVolumeRequest) => void): void;
13
+ styleUpdate(callback: (style: MiniPlayerStyle | null) => void): void;
14
+ setFont(callback: (font: string | null) => void): void;
15
+ };
16
+ requestFullUpdate(): Promise<MiniPlayerFullState>;
17
+ dragWindow(): Promise<void>;
18
+ fireCall(cmd: string, ...args: unknown[]): Promise<void>;
19
+ }
@@ -0,0 +1,34 @@
1
+ export declare enum PluginKind {
2
+ Builtin = "builtin",
3
+ User = "user"
4
+ }
5
+ export declare enum PluginActivationStatus {
6
+ Active = "active",
7
+ Inactive = "inactive",
8
+ Failed = "failed"
9
+ }
10
+ export interface PluginManagerEntry {
11
+ id: string;
12
+ name: string;
13
+ version: string;
14
+ description?: string;
15
+ author?: string;
16
+ license?: string;
17
+ kind: PluginKind;
18
+ /** Persisted intent: should this plugin be activated? */
19
+ enabled: boolean;
20
+ /** Runtime outcome from the plugin loader. */
21
+ status: PluginActivationStatus;
22
+ error?: string;
23
+ }
24
+ export interface PluginManagerState {
25
+ /** False when the plugin system itself is disabled. */
26
+ available: boolean;
27
+ plugins: PluginManagerEntry[];
28
+ }
29
+ export interface PluginManagerContract {
30
+ platform: NodeJS.Platform;
31
+ versions: NodeJS.ProcessVersions;
32
+ list(): Promise<PluginManagerState>;
33
+ setEnabled(id: string, enabled: boolean): Promise<PluginManagerState>;
34
+ }
@@ -0,0 +1,15 @@
1
+ export interface SettingsContract {
2
+ events: {
3
+ change(callback: (key: string, value: unknown) => void): Promise<void>;
4
+ delete(callback: (key: string) => void): Promise<void>;
5
+ };
6
+ get(key: string): Promise<unknown | undefined>;
7
+ get(key: string[]): Promise<(unknown | undefined)[]>;
8
+ set(key: string, value: unknown): Promise<boolean>;
9
+ setMany(entries: {
10
+ key: string;
11
+ value: unknown;
12
+ }[]): Promise<boolean[]>;
13
+ delete(key: string): Promise<boolean>;
14
+ deleteMany(key: string[]): Promise<boolean[]>;
15
+ }
@@ -0,0 +1,2 @@
1
+ import type { PlaybackMode } from "./types/playback-mode";
2
+ export declare function isPlaybackMode(mode: unknown): mode is PlaybackMode;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Loose shape of a build-time registry.
3
+ *
4
+ * The host only passes the registry through to plugins; precise per-module
5
+ * types live in the generated `@open-orpheus/plugin-api` package.
6
+ */
7
+ import type { RegistryLoad } from "../../../../registry-map";
8
+ export type { RegistryLoad };
9
+ /**
10
+ * Lazy access to a realm's host module surface.
11
+ *
12
+ * Every module is imported on demand; the registry itself has no static
13
+ * imports and therefore no initialization side effects.
14
+ */
15
+ export type Registry<Load extends RegistryLoad = RegistryLoad> = {
16
+ /** Import a module. Resolves immediately for modules that are already evaluated. */
17
+ load<Key extends keyof Load>(key: Key): ReturnType<Load[Key]>;
18
+ /** Every key this registry can serve. */
19
+ keys(): Array<keyof Load>;
20
+ };
21
+ export declare function createRegistry<Load extends RegistryLoad>(lazyModules: Load): Registry<Load>;
22
+ /**
23
+ * Plugin-contributed exports for one realm, keyed by plugin id.
24
+ *
25
+ * The entry module is the plugin's public surface; lifecycle exports
26
+ * (`activate`/`deactivate`) are reserved and typed away in the SDK.
27
+ */
28
+ export interface PluginRegistry {
29
+ load<T = unknown>(id: string): Promise<T>;
30
+ keys(): string[];
31
+ }
32
+ export declare function createPluginRegistry(loaders: ReadonlyMap<string, () => Promise<unknown>>): PluginRegistry;
@@ -0,0 +1,44 @@
1
+ export declare enum TextAlignType {
2
+ Left = "left",
3
+ Center = "center",
4
+ Right = "right"
5
+ }
6
+ export declare enum LineMode {
7
+ Single = "single",
8
+ Double = "double"
9
+ }
10
+ export declare enum ShowTranslate {
11
+ None = "none",
12
+ Translate = "translate",
13
+ Roman = "roman"
14
+ }
15
+ export interface LyricGradient {
16
+ top: string;
17
+ bottom: string;
18
+ }
19
+ export interface LyricsStyle {
20
+ font: {
21
+ family: string;
22
+ size: number;
23
+ weight: string;
24
+ };
25
+ textAlign: [TextAlignType, TextAlignType];
26
+ lineMode: LineMode;
27
+ vertical: boolean;
28
+ color: {
29
+ notPlayed: LyricGradient;
30
+ played: LyricGradient;
31
+ };
32
+ outline: {
33
+ notPlayed: string;
34
+ played: string;
35
+ };
36
+ dropShadow: boolean;
37
+ showTranslate: ShowTranslate;
38
+ }
39
+ export interface DesktopLyricsPlayInfo {
40
+ albumId: string;
41
+ albumName: string;
42
+ artistName: string;
43
+ songName: string;
44
+ }
@@ -0,0 +1,37 @@
1
+ export interface BtnState {
2
+ uri: string;
3
+ color?: string;
4
+ }
5
+ export interface BtnImages {
6
+ normal: BtnState;
7
+ hot?: BtnState;
8
+ pushed?: BtnState;
9
+ disabled?: BtnState;
10
+ }
11
+ export type LayoutNode = {
12
+ type: "horizontal";
13
+ children: LayoutNode[];
14
+ } | {
15
+ type: "vertical";
16
+ children: LayoutNode[];
17
+ } | {
18
+ type: "container";
19
+ width?: number;
20
+ height?: number;
21
+ children: LayoutNode[];
22
+ } | {
23
+ type: "control";
24
+ width?: number;
25
+ height?: number;
26
+ } | {
27
+ type: "button";
28
+ width: number;
29
+ height: number;
30
+ index: number;
31
+ };
32
+ export interface ElementTemplate {
33
+ height: number;
34
+ minWidth: number;
35
+ maxWidth: number;
36
+ layout: LayoutNode;
37
+ }
@@ -0,0 +1,6 @@
1
+ export interface InputRegion {
2
+ x: number;
3
+ y: number;
4
+ width: number;
5
+ height: number;
6
+ }
@@ -0,0 +1,15 @@
1
+ export interface LyricWord {
2
+ text: string;
3
+ start_time: number;
4
+ duration: number;
5
+ }
6
+ export interface LyricLine {
7
+ start_time: number;
8
+ end_time: number;
9
+ words: LyricWord[];
10
+ }
11
+ export type Lyrics = LyricLine[];
12
+ export type LyricsType = "regular" | "per-word" | "translate" | "roma";
13
+ export type LyricsStore = {
14
+ regular: Lyrics;
15
+ } & Partial<Record<LyricsType, Lyrics>>;
@@ -0,0 +1,14 @@
1
+ export interface CacheGroupStats {
2
+ entryCount: number;
3
+ sizeBytes: number;
4
+ /** If this is provided, it means that `sizeBytes` is only the actual data size,
5
+ * that is not the actual data size on disk (might still be occupied by leftover data).
6
+ */
7
+ sizeBytesOnDisk?: number;
8
+ }
9
+ export interface AllCacheStats {
10
+ play: CacheGroupStats;
11
+ http: CacheGroupStats;
12
+ lyrics: CacheGroupStats;
13
+ wasm: CacheGroupStats;
14
+ }
@@ -0,0 +1,43 @@
1
+ import type { ElementTemplate } from "./dui";
2
+ import type { AppMenuItem, MenuSkin } from "./menu";
3
+ export type MenuSurfaceId = string;
4
+ export type MenuHostKind = "window" | "overlay";
5
+ export type MenuSurfaceRole = "root" | "child";
6
+ export interface MenuAnchor {
7
+ x: number;
8
+ y: number;
9
+ }
10
+ export interface MenuMeasurement {
11
+ width: number;
12
+ height: number;
13
+ }
14
+ export interface MenuSurfaceConfig {
15
+ id: MenuSurfaceId;
16
+ host: MenuHostKind;
17
+ role: MenuSurfaceRole;
18
+ parentId: MenuSurfaceId | null;
19
+ depth: number;
20
+ anchor?: MenuAnchor;
21
+ items: AppMenuItem[];
22
+ templates: Record<string, ElementTemplate>;
23
+ colors: MenuSkin;
24
+ shadowInset?: number;
25
+ }
26
+ export interface MenuUpdate {
27
+ items?: AppMenuItem[];
28
+ patches?: AppMenuItem[];
29
+ templates?: Record<string, ElementTemplate>;
30
+ colors?: MenuSkin;
31
+ }
32
+ export interface MenuChildOpenRequest {
33
+ parentId: MenuSurfaceId;
34
+ depth: number;
35
+ itemRect: {
36
+ x: number;
37
+ y: number;
38
+ width: number;
39
+ height: number;
40
+ };
41
+ items: AppMenuItem[];
42
+ templates: Record<string, ElementTemplate>;
43
+ }
@@ -0,0 +1,29 @@
1
+ import type { BtnImages } from "./dui";
2
+ export type AppMenuItemBtn = {
3
+ id: string;
4
+ url: string;
5
+ images?: BtnImages | null;
6
+ enable: boolean;
7
+ };
8
+ export type AppMenuItem = {
9
+ text: string;
10
+ menu: boolean;
11
+ enable: boolean;
12
+ separator: boolean;
13
+ children: AppMenuItem[] | null;
14
+ raw_text?: string;
15
+ hotkey?: string;
16
+ image_color: string;
17
+ image_path?: string;
18
+ check_image_path?: string;
19
+ menu_id: string | null;
20
+ style?: string;
21
+ btns?: AppMenuItemBtn[];
22
+ };
23
+ export type MenuSkin = {
24
+ background: string;
25
+ foreground: string;
26
+ foregroundDisabled: string;
27
+ separator: string;
28
+ itemHover: string;
29
+ };
@@ -0,0 +1,90 @@
1
+ import type { BtnImages } from "./dui";
2
+ export declare enum MiniPlayerLikeMark {
3
+ Unliked = 0,
4
+ Liked = 1,
5
+ UseFavour = 2
6
+ }
7
+ export interface MiniPlayerPlayInfo {
8
+ albumId: string;
9
+ albumName: string;
10
+ artistName: string;
11
+ playId: string;
12
+ songName: string;
13
+ songType: string;
14
+ url: string;
15
+ }
16
+ export interface MiniPlayerPlayState {
17
+ playing: boolean;
18
+ }
19
+ export interface MiniPlayerListElement {
20
+ id: string;
21
+ from: string;
22
+ title: string;
23
+ track_id: string;
24
+ program: null | 1;
25
+ mv: string;
26
+ album: string;
27
+ artist: string;
28
+ alias: string;
29
+ cloud: 0 | 1;
30
+ }
31
+ export interface MiniPlayerListData {
32
+ items: MiniPlayerListElement[];
33
+ currentPlay: string | null;
34
+ }
35
+ export interface MiniPlayerTogetherUser {
36
+ avatarUrl: string;
37
+ }
38
+ export interface MiniPlayerTogetherStatus {
39
+ status: "alone" | "waiting" | "togetherOwner" | "together";
40
+ self: MiniPlayerTogetherUser;
41
+ other: MiniPlayerTogetherUser;
42
+ }
43
+ export interface MiniPlayerFullState {
44
+ playInfo: MiniPlayerPlayInfo | null;
45
+ coverUrl: string | null;
46
+ likeMark: MiniPlayerLikeMark;
47
+ favour: boolean;
48
+ mute: boolean;
49
+ currentPlay: string | null;
50
+ playState: MiniPlayerPlayState;
51
+ listItems: MiniPlayerListElement[];
52
+ togetherStatus: MiniPlayerTogetherStatus;
53
+ style: MiniPlayerStyle | null;
54
+ font: string | null;
55
+ }
56
+ export interface MiniPlayerStyle {
57
+ background: string;
58
+ lrcColor: string;
59
+ titleColor: string;
60
+ artistColor: string;
61
+ prevButton: BtnImages;
62
+ playButton: BtnImages;
63
+ pauseButton: BtnImages;
64
+ nextButton: BtnImages;
65
+ loveButton: BtnImages;
66
+ lovedButton: BtnImages;
67
+ favourButton: BtnImages;
68
+ favouredButton: BtnImages;
69
+ volumeButton: BtnImages;
70
+ volumeMutedButton: BtnImages;
71
+ listButton: BtnImages;
72
+ closeButton: BtnImages;
73
+ toWebButton: BtnImages;
74
+ list: {
75
+ background: string;
76
+ itemBackground: string;
77
+ hoverBackground: string;
78
+ selectedBackground: string;
79
+ playingBackground: string;
80
+ scrollBar: string;
81
+ color: string;
82
+ hoverColor: string;
83
+ selectedColor: string;
84
+ playButton: BtnImages;
85
+ pauseButton: BtnImages;
86
+ radioIcon: BtnImages;
87
+ radioHoverIcon: BtnImages;
88
+ };
89
+ }
90
+ export type MiniPlayerShowVolumeRequest = [number, boolean];
@@ -0,0 +1,21 @@
1
+ export declare enum NcaeType {
2
+ /** JSON effect parameters. */
3
+ Json = 1,
4
+ /** WAV impulse response (convolution data). */
5
+ Wav = 2
6
+ }
7
+ export interface NcaeHeader {
8
+ /** Raw payload size as declared in the file (before decompression). */
9
+ payloadSize: number;
10
+ /** Type flag. */
11
+ type: NcaeType;
12
+ }
13
+ export interface Ncae {
14
+ header: NcaeHeader;
15
+ /**
16
+ * Decompressed payload.
17
+ * - Type 1 (JSON): the raw JSON string.
18
+ * - Type 2 (WAV): a Buffer containing the RIFF/WAVE data.
19
+ */
20
+ payload: string | Uint8Array;
21
+ }