@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,52 @@
1
+ import type { WebContents } from "electron";
2
+ import type { Av3aM4aSource } from "./Av3aM4aSession";
3
+ /**
4
+ * Main-process side of the AV3A decode utility process.
5
+ *
6
+ * Owns the child process lifecycle and the `MessageChannelMain` whose renderer
7
+ * end is handed to the player window (`av3a.channel`). PCM and renderer flow
8
+ * control (pause/resume/seek) travel on that channel directly between the
9
+ * renderer and the utility process — never through main — so playback keeps
10
+ * flowing while main is blocked (e.g. a Windows modal window-drag loop).
11
+ *
12
+ * Main stays on the data path only for what it owns: answering `ensureRange`
13
+ * requests (the file is downloaded here by `OnlineStreamer`) and periodically
14
+ * pushing the contiguous download frontier so the utility can decode ahead
15
+ * without asking. All decode events and PCM go renderer<->utility over the
16
+ * channel; main only pushes a fallback `av3a.error` if the process dies
17
+ * unexpectedly.
18
+ */
19
+ export type Av3aPlaybackProcessOptions = {
20
+ /** The sparse temp file + download control (an `OnlineStreamer` adapter). */
21
+ source: Av3aM4aSource;
22
+ /** The window that hosts the player; receives the renderer channel end. */
23
+ rendererWebContents: WebContents;
24
+ /** Push a fallback `av3a.error` to the renderer (decode process crash). */
25
+ sendEvent: (event: string, ...args: unknown[]) => void;
26
+ };
27
+ /** Best-effort synchronous kill of every live decode process (used on quit). */
28
+ export declare function killAllAv3aProcesses(): void;
29
+ export declare class Av3aPlaybackProcess {
30
+ private readonly options;
31
+ private child;
32
+ private rendererPort;
33
+ private frontierTimer;
34
+ private lastFrontier;
35
+ private stopped;
36
+ constructor(options: Av3aPlaybackProcessOptions);
37
+ get alive(): boolean;
38
+ /**
39
+ * Fork the decode service, wire the renderer channel, and start pushing the
40
+ * download frontier. Resolves once the child has spawned and init is sent.
41
+ */
42
+ start(): Promise<void>;
43
+ /** Stop the child and release the channel. Safe to call twice. */
44
+ stop(): Promise<void>;
45
+ /** Best-effort synchronous kill (used on app quit). */
46
+ killQuietly(): void;
47
+ private pushFrontier;
48
+ private onChildMessage;
49
+ private onChildExit;
50
+ private clearTimer;
51
+ private closeRendererPort;
52
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Whether `path` is an ISO-BMFF file carrying an AV3A track. Detection is a
3
+ * few small reads (never the media payload), so it is deliberately uncached —
4
+ * callers re-sniff per load and the cost is negligible.
5
+ */
6
+ export declare function isAv3aFile(path: string): Promise<boolean>;
@@ -0,0 +1,13 @@
1
+ import type { OnlineStreamer } from "../audio/OnlineStreamer";
2
+ import type { Av3aM4aSource } from "./Av3aM4aSession";
3
+ /**
4
+ * `Av3aM4aSource` for a fully-present local file: the whole file is always
5
+ * available, so the frontier is the full size and `ensureRange` is a no-op.
6
+ * The decode utility process reads the file path directly.
7
+ */
8
+ export declare function localAv3aSource(path: string): Promise<Av3aM4aSource>;
9
+ /**
10
+ * Adapts an `OnlineStreamer` (a progressively downloaded sparse temp file)
11
+ * to the `Av3aM4aSource` the decode session paces against.
12
+ */
13
+ export declare function onlineStreamerToAv3aSource(streamer: OnlineStreamer): Av3aM4aSource;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Shared AV3A decode types + executor contract used by the decode session
3
+ * (`Av3aM4aSession`) and its transport. The transport may be anything that
4
+ * exposes the same async surface (a worker-thread RPC, direct native calls in
5
+ * a utility process, ...); the session only depends on this interface.
6
+ */
7
+ import type { Av3aTrackInfo } from "../../shared/contracts/av3a-api";
8
+ export type { Av3aTrackInfo };
9
+ /** Byte range of the next sample (`done: true` at the end of the track). */
10
+ export type Av3aSampleRange = {
11
+ done: boolean;
12
+ start: number;
13
+ end: number;
14
+ };
15
+ /** One decoded frame; `data` is little-endian PCM16 (zero-copy where possible). */
16
+ export type Av3aDecodedFrame = {
17
+ done: true;
18
+ frameIndex: number;
19
+ sampleRate: 0;
20
+ channels: 0;
21
+ data: null;
22
+ } | {
23
+ done: false;
24
+ frameIndex: number;
25
+ sampleRate: number;
26
+ channels: number;
27
+ data: ArrayBuffer;
28
+ };
29
+ /**
30
+ * The asynchronous decode surface the session paces against.
31
+ *
32
+ * Implementations may talk to a native decoder directly or proxy it through a
33
+ * process boundary; the session treats every call as async so a transport can
34
+ * yield between native calls.
35
+ */
36
+ export interface Av3aDecodeExecutor {
37
+ /** Open an M4A/MP4 file and index its AV3A track. Throws when not ready. */
38
+ open(path: string): Promise<void>;
39
+ /** Track information for the opened file. */
40
+ info(): Promise<Av3aTrackInfo>;
41
+ /** Move to an exact track frame (warm-up frames handled internally). */
42
+ seekToFrame(frameIndex: number): Promise<void>;
43
+ /** Byte range of the sample the next `decodeNext` reads. */
44
+ nextSampleRange(): Promise<Av3aSampleRange>;
45
+ /**
46
+ * Byte range the next `decodeNext` reads (after a seek this also spans the
47
+ * warm-up frames the decoder fast-forwards through).
48
+ */
49
+ decodeWindowRange(): Promise<Av3aSampleRange>;
50
+ /** Decode the next frame. */
51
+ decodeNext(): Promise<Av3aDecodedFrame>;
52
+ /** Release the underlying file handle. */
53
+ close(): Promise<void>;
54
+ }
@@ -0,0 +1 @@
1
+ export declare function registerInputRegionHandlers(wnd: Electron.BrowserWindow): void;
@@ -0,0 +1 @@
1
+ export declare function registerLyricsHandlers(wnd: Electron.BrowserWindow): void;
@@ -0,0 +1 @@
1
+ export declare function registerSettingsHandlers(wnd: Electron.BrowserWindow): void;
@@ -0,0 +1,9 @@
1
+ import type { WebContents, IpcMainInvokeEvent } from "electron";
2
+ type HasFunctionDeep<T> = T extends (...args: never[]) => unknown ? true : T extends Record<string, unknown> ? T extends unknown[] ? false : keyof T extends never ? false : {
3
+ [K in keyof T]: HasFunctionDeep<T[K]>;
4
+ }[keyof T] : false;
5
+ type DeepIpcHandlers<T> = {
6
+ [K in keyof T as K extends "events" ? never : T[K] extends (...args: never[]) => unknown ? K : T[K] extends Record<string, unknown> ? T[K] extends unknown[] ? never : HasFunctionDeep<T[K]> extends true ? K : never : never]: T[K] extends (...args: infer A) => infer R ? (event: IpcMainInvokeEvent, ...args: A) => R | Promise<R> : T[K] extends Record<string, unknown> ? DeepIpcHandlers<T[K]> : never;
7
+ };
8
+ export declare function registerIpcHandlers<T>(wc: WebContents, prefix: string, handlers: DeepIpcHandlers<T>): void;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ import { KeyvSqlite } from "@keyv/sqlite";
2
+ import { Keyv } from "keyv";
3
+ export default class HttpCacheStorage extends Keyv {
4
+ private driver;
5
+ constructor(driver: KeyvSqlite);
6
+ vacuum(): Promise<void>;
7
+ totalSize(): Promise<number>;
8
+ diskSize(): Promise<number>;
9
+ entryCount(): Promise<number>;
10
+ }
@@ -0,0 +1,21 @@
1
+ export default class LyricCacheManager {
2
+ private readonly cacheDir;
3
+ private readonly maxSizeBytes;
4
+ private readonly entries;
5
+ private totalSizeBytes;
6
+ private readonly initPromise;
7
+ private evictionPromise;
8
+ constructor(cacheDir: string, maxSizeBytes?: number);
9
+ private buildEntriesIndex;
10
+ private ready;
11
+ private getEntryKey;
12
+ private resolveEntryPath;
13
+ get(songId: string): Promise<string | null>;
14
+ set(songId: string, content: string): Promise<void>;
15
+ getStats(): Promise<{
16
+ entryCount: number;
17
+ sizeBytes: number;
18
+ }>;
19
+ clear(): Promise<void>;
20
+ private evictIfNeeded;
21
+ }
@@ -0,0 +1,72 @@
1
+ export type PlayCacheConfig = {
2
+ ABName: string;
3
+ autoCacheSize: string;
4
+ configJson: string;
5
+ groupName: string;
6
+ manuSetting: unknown;
7
+ settingLowLimit: string;
8
+ settingUpLimit: string;
9
+ userSettingSize: string;
10
+ };
11
+ export type PlayCacheInfo = {
12
+ ABName: string;
13
+ autoCacheSize: number;
14
+ autoCacheSizeReal: number;
15
+ cachePath: string;
16
+ clearLimitMax: number;
17
+ clearToLimit: number;
18
+ configJson: string;
19
+ currentCachedSize: number;
20
+ diskFreeSize: number;
21
+ groupName: string;
22
+ manuSetting: boolean;
23
+ settingLowLimit: number;
24
+ settingUpLimit: number;
25
+ userSettingSize: number;
26
+ userSettingSizeReal: number;
27
+ };
28
+ export type CacheTrackMeta = {
29
+ bitrate: number;
30
+ cached: number;
31
+ dfsId: string;
32
+ format: string;
33
+ lastAccessTime: number;
34
+ lastModifyTime: number;
35
+ md5: string;
36
+ playInfoExist: boolean;
37
+ playInfoStr: string;
38
+ songId: string;
39
+ volumeGain: number;
40
+ fileSize: number;
41
+ };
42
+ export default class PlayCacheManager {
43
+ private config;
44
+ /** In-memory index of cached tracks, keyed by songId */
45
+ private trackIndex;
46
+ private initPromise;
47
+ private cachePath;
48
+ constructor(cachePath: string);
49
+ private buildIndex;
50
+ private ready;
51
+ setConfig(config: PlayCacheConfig): void;
52
+ getInfo(): Promise<PlayCacheInfo>;
53
+ queryCacheTracks(): Promise<CacheTrackMeta[]>;
54
+ getCachedTrack(songId: string): Promise<{
55
+ meta: CacheTrackMeta;
56
+ audioPath: string;
57
+ } | null>;
58
+ cacheTrack(songId: string, audioBuffer: Buffer, info: {
59
+ md5: string;
60
+ bitrate: number;
61
+ playInfoStr: string;
62
+ volumeGain: number;
63
+ fileSize: number;
64
+ }): Promise<void>;
65
+ private evictIfNeeded;
66
+ private removeTrack;
67
+ clearAll(): Promise<void>;
68
+ private writeMeta;
69
+ private notifyPlayCacheUpdate;
70
+ private getCachedSizeGB;
71
+ private getDiskFreeGB;
72
+ }
@@ -0,0 +1,7 @@
1
+ import LyricCacheManager from "./cache/LyricCahceManager";
2
+ import PlayCacheManager from "./cache/PlayCacheManager";
3
+ import HttpCacheStorage from "./cache/HttpCacheStorage";
4
+ export declare let lyricCacheManager: LyricCacheManager | null;
5
+ export declare let playCacheManager: PlayCacheManager | null;
6
+ export declare let httpCacheStorage: HttpCacheStorage | null;
7
+ export default function createCacheManager(): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import MusicDesktopWindow from "../windows/music-desktop";
2
+ export declare let musicDesktopWindow: MusicDesktopWindow | null;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import "./app";
2
+ import "./audioeffect";
3
+ import "./winhelper";
4
+ import "./browser";
5
+ import "./desktop";
6
+ import "./desktoppet";
7
+ import "./storage";
8
+ import "./musiclibrary";
9
+ import "./os";
10
+ import "./trayicon";
11
+ import "./network";
12
+ import "./download";
13
+ import "./rtc";
14
+ import "./update";
15
+ import "./player";
16
+ import "./process";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ export type PlayInfo = {
2
+ songType: "normal";
3
+ albumId: string;
4
+ albumName: string;
5
+ artistName: string;
6
+ playId: string;
7
+ songName: string;
8
+ url: string;
9
+ } | {
10
+ songType: "local";
11
+ artistName: string;
12
+ playId: string;
13
+ songName: string;
14
+ } | {
15
+ songType: "djradio";
16
+ albumId: string;
17
+ albumName: string;
18
+ artistName: string;
19
+ playId: string;
20
+ songName: string;
21
+ url: "";
22
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { IpcMainInvokeEvent } from "electron";
2
+ import CallDispatcher, { CallbackHandlerFunction, HandlerFunction } from "../shared/CallDispatcher";
3
+ export declare const dispatcher: CallDispatcher;
4
+ export declare function registerCallHandler<Args extends unknown[], Return extends unknown[] | void>(cmd: string, handler: HandlerFunction<[IpcMainInvokeEvent, ...Args], Return>): void;
5
+ export declare function registerCallbackHandler<Args extends unknown[]>(cmd: string, handler: CallbackHandlerFunction<[IpcMainInvokeEvent, ...Args]>): void;
@@ -0,0 +1 @@
1
+ import "./calls/index";
@@ -0,0 +1,13 @@
1
+ import * as cookie from "cookie";
2
+ export declare function getFullCookies(url: string): Promise<Electron.Cookie[]>;
3
+ export declare function getCookies(url: string): Promise<{
4
+ [k: string]: string;
5
+ }>;
6
+ export declare function removeCookie(url: string, name: string): Promise<void>;
7
+ export declare function setCookie(url: string, setCookieValue: cookie.SetCookie): Promise<void>;
8
+ /**
9
+ * Initializes the cookies.
10
+ *
11
+ * Some cookies are required to be inserted ahead of time, this function will do the job.
12
+ */
13
+ export default function initializeCookies(): Promise<void>;
@@ -0,0 +1,46 @@
1
+ export declare const ID_XOR_KEY_1: Buffer<ArrayBuffer>;
2
+ export declare const DATA_AES_KEY: Buffer<ArrayBuffer>;
3
+ export declare const SERIAL_AES_KEY: Buffer<ArrayBuffer>;
4
+ export declare const ID3_AES_KEY: Buffer<ArrayBuffer>;
5
+ export declare const EAPI_KEY: Buffer<ArrayBuffer>;
6
+ export declare const EAPI_SEPARATOR = "-36cd479b6b5-";
7
+ /**
8
+ * Encodes an anonymous user ID.
9
+ *
10
+ * Algorithm:
11
+ * 1. XOR each byte of the UTF-8 encoded ID against the repeating key
12
+ * 2. MD5-hash the XORed bytes → 16 raw bytes
13
+ * 3. Base64-encode the raw MD5 digest
14
+ */
15
+ export declare function encodeAnonymousId(anonymousId: string): string;
16
+ /**
17
+ * Encrypts plaintext using AES-128-ECB + double Base64.
18
+ *
19
+ * Pipeline:
20
+ * plaintext → PKCS#7 pad → AES-128-ECB → Base64 #1 → Base64 #2 (optional)
21
+ */
22
+ export declare function enData(plaintext: string, key?: Buffer<ArrayBuffer>, doubleBase64?: boolean): string | null;
23
+ /**
24
+ * Decrypts a double-Base64-encoded or buffer AES-128-ECB ciphertext.
25
+ *
26
+ * Pipeline (reversed):
27
+ * Base64 #2 decode → Base64 #1 decode → AES-128-ECB decrypt → PKCS#7 unpad
28
+ */
29
+ export declare function deData(bufOr2Base64: string | Buffer, key?: Buffer<ArrayBuffer>, doubleBase64?: boolean): Buffer | null;
30
+ /**
31
+ * Encrypts an EAPI request for /eapi/* endpoints.
32
+ *
33
+ * Algorithm:
34
+ * 1. Build signing message: `nobody{path}use{body}md5forencrypt`
35
+ * 2. MD5-hash it → 32-char lowercase hex digest
36
+ * 3. Build plaintext: `{path}-36cd479b6b5-{body}-36cd479b6b5-{digest}`
37
+ * 4. AES-128-ECB encrypt with PKCS#7 auto-padding
38
+ * 5. HEX encode, uppercase → final `params` string
39
+ */
40
+ export declare function serialData(apiPath: string, body: string | object): string;
41
+ /**
42
+ * Decrypts serialData back to plaintext.
43
+ */
44
+ export declare function deserialData(hexParams: string | ArrayBuffer): string;
45
+ export declare function chacha20Encrypt(key: Buffer, nonce12: Buffer, initialCounter: number, plaintext: Buffer): Buffer;
46
+ export declare function rawRsaEncrypt(plaintext: Buffer, exponent: bigint, modulus: bigint): Buffer;
@@ -0,0 +1,6 @@
1
+ import type { Database } from "../../../_native/open-orpheus__database";
2
+ import { SqliteDriver } from "@keyv/sqlite";
3
+ export type DatabaseSqliteDriver = SqliteDriver & {
4
+ db: Database;
5
+ };
6
+ export default function createKeyvSqliteDriver(db: Database): DatabaseSqliteDriver;
@@ -0,0 +1,5 @@
1
+ import { Database } from "../../_native/open-orpheus__database";
2
+ export declare let webDb: Database;
3
+ export declare let musicLibraryDb: Database;
4
+ export declare let nativeDb: Database;
5
+ export declare function initializeDatabases(): Promise<void>;
@@ -0,0 +1,31 @@
1
+ export interface DawnEntry {
2
+ time?: string;
3
+ action: string;
4
+ data: string;
5
+ }
6
+ /**
7
+ * Process dawn-log entries from the NCM web app.
8
+ *
9
+ * Entries are buffered in RAM. When the queue reaches {@link MAX_QUEUE_SIZE}
10
+ * entries they are encrypted into a bundle and queued for upload.
11
+ *
12
+ * If no endpoint has been set via {@link setStatisEndpoint}, bundles simply
13
+ * accumulate in RAM until the endpoint is configured.
14
+ *
15
+ * @param type The statis type — only `"dawn"` entries are processed.
16
+ * @param entries Array of log entries to buffer.
17
+ */
18
+ export declare function statisV2(type: string, entries: DawnEntry[]): void;
19
+ /**
20
+ * Set the remote upload endpoint and begin periodic uploads.
21
+ *
22
+ * There is no default URL — uploads will not occur until this is called.
23
+ * Typically wired to the `dawn` field from `app.initUrls`.
24
+ *
25
+ * Any bundles queued before calling this function will be uploaded
26
+ * on the next timer tick.
27
+ *
28
+ * @param url The full upload URL.
29
+ * @param referer The Referer URL to be used when uploading.
30
+ */
31
+ export declare function setStatisEndpoint(url: string, referer?: string): void;
@@ -0,0 +1,3 @@
1
+ export declare function getDeviceId(): string;
2
+ export declare function getADDeviceId(): string;
3
+ export declare function prepareDeviceId(): Promise<void>;
@@ -0,0 +1,40 @@
1
+ import Emittery from "emittery";
2
+ export type DownloadStartOptions = {
3
+ headers?: Record<string, string>;
4
+ md5?: string;
5
+ size?: number;
6
+ };
7
+ export type DownloadProgress = {
8
+ path: string;
9
+ percent: number;
10
+ total: number;
11
+ downloaded: number;
12
+ speed: number;
13
+ };
14
+ export type DownloadTaskEvents = {
15
+ progress: DownloadProgress;
16
+ end: DownloadProgress;
17
+ error: unknown;
18
+ };
19
+ export declare class DownloadTask extends Emittery<DownloadTaskEvents> {
20
+ url: string;
21
+ path: string;
22
+ options: DownloadStartOptions;
23
+ private hash;
24
+ private fsHandle;
25
+ private request;
26
+ private writeStream;
27
+ private ema;
28
+ private lastTime;
29
+ private lastBytes;
30
+ private static readonly UPDATE_INTERVAL_MS;
31
+ get isPaused(): boolean;
32
+ constructor(url: string, path: string, options: DownloadStartOptions);
33
+ private updateSpeed;
34
+ private errored;
35
+ start(): Promise<void>;
36
+ pause(): void;
37
+ resume(): void;
38
+ cancel(): Promise<void>;
39
+ }
40
+ export default function startDownload(url: string, path: string, options: DownloadStartOptions, start?: boolean): Promise<DownloadTask>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ export declare const tempDir: string;
2
+ export declare const downloadTemp: string;
3
+ export declare const streamerTemp: string;
4
+ export declare const data: string;
5
+ export declare const log: string;
6
+ export declare const pack: string;
7
+ export declare const userdata: string;
8
+ export declare const storage: string;
9
+ export declare const wasm: string;
10
+ export declare const aegisPublicKey: string;
11
+ export declare const plugins: string;
12
+ export declare const disableHardwareAccelerationFlag: string;
13
+ export declare const lastWebpackHash: string;
14
+ export declare const defaultCache: string;
15
+ export declare let cache: string;
16
+ export declare let download: string;
17
+ export declare function setCachePath(path: string): void;
18
+ export declare function setDownloadPath(path: string): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Protocol } from "electron";
2
+ export declare let font: string | null;
3
+ export declare function setFont(fnt: string | null): void;
4
+ export default function registerGuiScheme(protocol: Protocol): void;
@@ -0,0 +1,42 @@
1
+ export type ID3MusicMetadata = {
2
+ musicId: string;
3
+ musicName: string;
4
+ artist: [string, string][];
5
+ albumId: string;
6
+ album: string;
7
+ albumPicDocId: string;
8
+ albumPic: string;
9
+ bitrate: number;
10
+ mp3DocId: string;
11
+ duration: number;
12
+ mvId: string;
13
+ alias: string[];
14
+ transNames: string[];
15
+ format: string;
16
+ fee: number;
17
+ volumeDelta: number;
18
+ privilege: {
19
+ flag: number;
20
+ };
21
+ };
22
+ /**
23
+ * Convert music metadata JSON string prefixed with `music:` to ID3 comment.
24
+ *
25
+ * @param json
26
+ * @returns
27
+ */
28
+ export declare function ID3JsonToComment(json: string): string;
29
+ /**
30
+ * Convert ID3 comment to music metadata in JSON string, with `music:` prefix.
31
+ *
32
+ * @param comment
33
+ * @returns
34
+ */
35
+ export declare function commentToID3Json(comment: string | null): string | null;
36
+ /**
37
+ * Convert ID3 comment to music metadata.
38
+ *
39
+ * @param comment
40
+ * @returns
41
+ */
42
+ export declare function commentToID3Metadata(comment: string | null): ID3MusicMetadata | null;