@open-orpheus/plugin-api 0.0.0-stage → 0.21.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 +7 -0
- package/README.md +191 -2
- package/dist/client/index.d.ts +37 -0
- package/dist/client/index.js +53 -0
- package/dist/client/index.js.map +1 -0
- package/dist/configuration/host/src/shared/plugin/configuration/index.d.ts +21 -0
- package/dist/configuration/index.d.ts +5 -0
- package/dist/host/_native/open-orpheus__database.d.ts +50 -0
- package/dist/host/_native/open-orpheus__window.d.ts +284 -0
- package/dist/host/src/constants.d.ts +6 -0
- package/dist/host/src/main/afp.d.ts +1 -0
- package/dist/host/src/main/arguments.d.ts +4 -0
- package/dist/host/src/main/assets.d.ts +2 -0
- package/dist/host/src/main/audio/ChunkTracker.d.ts +23 -0
- package/dist/host/src/main/audio/DownloadScheduler.d.ts +53 -0
- package/dist/host/src/main/audio/MediaEngine.d.ts +47 -0
- package/dist/host/src/main/audio/OnlineStreamer.d.ts +66 -0
- package/dist/host/src/main/audio/StorageManager.d.ts +18 -0
- package/dist/host/src/main/audio.d.ts +6 -0
- package/dist/host/src/main/av3a/Av3aEngine.d.ts +24 -0
- package/dist/host/src/main/av3a/Av3aM4aSession.d.ts +101 -0
- package/dist/host/src/main/av3a/Av3aPlaybackProcess.d.ts +52 -0
- package/dist/host/src/main/av3a/detect.d.ts +6 -0
- package/dist/host/src/main/av3a/sources.d.ts +13 -0
- package/dist/host/src/main/av3a/types.d.ts +54 -0
- package/dist/host/src/main/bridge/ipc-main-bridge.d.ts +24 -0
- package/dist/host/src/main/bridge/modules/inputRegion.d.ts +1 -0
- package/dist/host/src/main/bridge/modules/lyrics.d.ts +1 -0
- package/dist/host/src/main/bridge/modules/settings.d.ts +1 -0
- package/dist/host/src/main/bridge/register.d.ts +9 -0
- package/dist/host/src/main/bridge/window.d.ts +7 -0
- package/dist/host/src/main/cache/HttpCacheStorage.d.ts +10 -0
- package/dist/host/src/main/cache/LyricCahceManager.d.ts +21 -0
- package/dist/host/src/main/cache/PlayCacheManager.d.ts +72 -0
- package/dist/host/src/main/cache.d.ts +7 -0
- package/dist/host/src/main/calls/app.d.ts +1 -0
- package/dist/host/src/main/calls/audioeffect.d.ts +1 -0
- package/dist/host/src/main/calls/browser.d.ts +1 -0
- package/dist/host/src/main/calls/desktop.d.ts +2 -0
- package/dist/host/src/main/calls/desktoppet.d.ts +1 -0
- package/dist/host/src/main/calls/download.d.ts +1 -0
- package/dist/host/src/main/calls/index.d.ts +16 -0
- package/dist/host/src/main/calls/musiclibrary.d.ts +1 -0
- package/dist/host/src/main/calls/network.d.ts +1 -0
- package/dist/host/src/main/calls/os.d.ts +1 -0
- package/dist/host/src/main/calls/player.d.ts +22 -0
- package/dist/host/src/main/calls/process.d.ts +1 -0
- package/dist/host/src/main/calls/rtc.d.ts +1 -0
- package/dist/host/src/main/calls/storage.d.ts +1 -0
- package/dist/host/src/main/calls/trayicon.d.ts +1 -0
- package/dist/host/src/main/calls/update.d.ts +1 -0
- package/dist/host/src/main/calls/winhelper.d.ts +1 -0
- package/dist/host/src/main/calls.d.ts +5 -0
- package/dist/host/src/main/channel.d.ts +1 -0
- package/dist/host/src/main/cookie.d.ts +13 -0
- package/dist/host/src/main/crypto.d.ts +46 -0
- package/dist/host/src/main/database/KeyvSqliteDriver.d.ts +6 -0
- package/dist/host/src/main/database.d.ts +5 -0
- package/dist/host/src/main/dawn.d.ts +31 -0
- package/dist/host/src/main/device.d.ts +3 -0
- package/dist/host/src/main/download.d.ts +40 -0
- package/dist/host/src/main/error.d.ts +1 -0
- package/dist/host/src/main/folders.d.ts +18 -0
- package/dist/host/src/main/fonts.d.ts +1 -0
- package/dist/host/src/main/gui.d.ts +4 -0
- package/dist/host/src/main/id3.d.ts +42 -0
- package/dist/host/src/main/lifecycle.d.ts +127 -0
- package/dist/host/src/main/logger.d.ts +12 -0
- package/dist/host/src/main/lyrics/DbusLyricsService.d.ts +115 -0
- package/dist/host/src/main/lyrics/LyricsDispatcher.d.ts +26 -0
- package/dist/host/src/main/lyrics/dbus.d.ts +16 -0
- package/dist/host/src/main/lyrics/parse.d.ts +21 -0
- package/dist/host/src/main/lyrics.d.ts +2 -0
- package/dist/host/src/main/mediaSession.d.ts +42 -0
- package/dist/host/src/main/menu/AppMenu.d.ts +35 -0
- package/dist/host/src/main/menu/anchor.d.ts +13 -0
- package/dist/host/src/main/menu/backend/DesktopWindowBackend.d.ts +30 -0
- package/dist/host/src/main/menu/backend/MenuBackend.d.ts +28 -0
- package/dist/host/src/main/menu/backend/WaylandLayerShellBackend.d.ts +35 -0
- package/dist/host/src/main/menu/backend/WaylandOverlayBackend.d.ts +15 -0
- package/dist/host/src/main/menu/backend/WaylandPopupBackend.d.ts +31 -0
- package/dist/host/src/main/menu/constants.d.ts +14 -0
- package/dist/host/src/main/menu/index.d.ts +2 -0
- package/dist/host/src/main/menu/native-popup.d.ts +16 -0
- package/dist/host/src/main/menu/patch.d.ts +3 -0
- package/dist/host/src/main/menu/skin.d.ts +3 -0
- package/dist/host/src/main/menu/surface/BaseWindowMenuSurface.d.ts +81 -0
- package/dist/host/src/main/menu/surface/CaptureLayerSurface.d.ts +22 -0
- package/dist/host/src/main/menu/surface/MenuSurface.d.ts +29 -0
- package/dist/host/src/main/menu/surface/MenuSurfacePath.d.ts +29 -0
- package/dist/host/src/main/menu/surface/SurfacePool.d.ts +15 -0
- package/dist/host/src/main/menu/workaround.d.ts +12 -0
- package/dist/host/src/main/ncae.d.ts +8 -0
- package/dist/host/src/main/network/handler.d.ts +3 -0
- package/dist/host/src/main/network/interceptor.d.ts +2 -0
- package/dist/host/src/main/network/interceptors/anonymous.d.ts +2 -0
- package/dist/host/src/main/network/pipeline.d.ts +8 -0
- package/dist/host/src/main/network/types.d.ts +70 -0
- package/dist/host/src/main/orpheus.d.ts +10 -0
- package/dist/host/src/main/pack.d.ts +27 -0
- package/dist/host/src/main/packs/Pack.d.ts +12 -0
- package/dist/host/src/main/packs/SkinPack.d.ts +6 -0
- package/dist/host/src/main/packs/WebPack.d.ts +6 -0
- package/dist/host/src/main/playback/PlaybackController.d.ts +57 -0
- package/dist/host/src/main/playback/PlayerCommandRouter.d.ts +85 -0
- package/dist/host/src/main/playback/adapters/MediaSessionAdapter.d.ts +61 -0
- package/dist/host/src/main/playback/adapters/MprisAdapter.d.ts +48 -0
- package/dist/host/src/main/playback/adapters/NowPlayingAdapter.d.ts +23 -0
- package/dist/host/src/main/playback/adapters/SmtcAdapter.d.ts +23 -0
- package/dist/host/src/main/playback/artwork.d.ts +47 -0
- package/dist/host/src/main/playback/modes.d.ts +8 -0
- package/dist/host/src/main/playback/types.d.ts +59 -0
- package/dist/host/src/main/plugin/assets.d.ts +8 -0
- package/dist/host/src/main/plugin/catalog.d.ts +42 -0
- package/dist/host/src/main/plugin/discover.d.ts +33 -0
- package/dist/host/src/main/plugin/index.d.ts +15 -0
- package/dist/host/src/main/plugin/loader.d.ts +90 -0
- package/dist/host/src/main/plugin/manager.d.ts +61 -0
- package/dist/host/src/main/plugin/metadata.d.ts +34 -0
- package/dist/host/src/main/plugin/state.d.ts +27 -0
- package/dist/host/src/main/plugin/tree.d.ts +13 -0
- package/dist/host/src/main/protocol.d.ts +4 -0
- package/dist/host/src/main/request.d.ts +16 -0
- package/dist/host/src/main/settings.d.ts +21 -0
- package/dist/host/src/main/shortcuts.d.ts +10 -0
- package/dist/host/src/main/shutdown.d.ts +50 -0
- package/dist/host/src/main/skin/color.d.ts +2 -0
- package/dist/host/src/main/skin/dui.d.ts +15 -0
- package/dist/host/src/main/tray.d.ts +8 -0
- package/dist/host/src/main/update.d.ts +2 -0
- package/dist/host/src/main/util/color.d.ts +7 -0
- package/dist/host/src/main/util/display.d.ts +3 -0
- package/dist/host/src/main/util/env.d.ts +1 -0
- package/dist/host/src/main/util/fs.d.ts +21 -0
- package/dist/host/src/main/util/image.d.ts +1 -0
- package/dist/host/src/main/util/musicFile.d.ts +1 -0
- package/dist/host/src/main/util/musicPicture.d.ts +2 -0
- package/dist/host/src/main/util/path.d.ts +2 -0
- package/dist/host/src/main/util/send.d.ts +13 -0
- package/dist/host/src/main/util/url.d.ts +19 -0
- package/dist/host/src/main/util/window.d.ts +2 -0
- package/dist/host/src/main/window.d.ts +316 -0
- package/dist/host/src/main/windows/color-picker.d.ts +3 -0
- package/dist/host/src/main/windows/desktop-lyrics.d.ts +12 -0
- package/dist/host/src/main/windows/desktop-pet.d.ts +8 -0
- package/dist/host/src/main/windows/main.d.ts +6 -0
- package/dist/host/src/main/windows/manage.d.ts +2 -0
- package/dist/host/src/main/windows/mini-player.d.ts +16 -0
- package/dist/host/src/main/windows/music-desktop.d.ts +13 -0
- package/dist/host/src/main/windows/package-download.d.ts +2 -0
- package/dist/host/src/main/windows/plugin-manager-events.d.ts +7 -0
- package/dist/host/src/main/windows/plugin-manager.d.ts +5 -0
- package/dist/host/src/main/xeapi.d.ts +48 -0
- package/dist/host/src/preload/AudioEffectManager.d.ts +124 -0
- package/dist/host/src/preload/PlaybackBackend.d.ts +34 -0
- package/dist/host/src/preload/Player.d.ts +229 -0
- package/dist/host/src/preload/av3a/Av3aPcmPlayer.d.ts +84 -0
- package/dist/host/src/preload/av3a/bridge.d.ts +21 -0
- package/dist/host/src/preload/av3a/channel.d.ts +40 -0
- package/dist/host/src/preload/av3a/detect.d.ts +6 -0
- package/dist/host/src/preload/backends/Av3aPlaybackBackend.d.ts +32 -0
- package/dist/host/src/preload/backends/MediaPlaybackBackend.d.ts +25 -0
- package/dist/host/src/shared/CallDispatcher.d.ts +12 -0
- package/dist/host/src/shared/bridge/constants.d.ts +2 -0
- package/dist/host/src/shared/bridge/endpoint.d.ts +29 -0
- package/dist/host/src/shared/bridge/hub.d.ts +136 -0
- package/dist/host/src/shared/bridge/protocol.d.ts +91 -0
- package/dist/host/src/shared/bridge/realm.d.ts +14 -0
- package/dist/host/src/shared/bridge/routes.d.ts +37 -0
- package/dist/host/src/shared/contracts/av3a-api.d.ts +50 -0
- package/dist/host/src/shared/contracts/av3a-process.d.ts +56 -0
- package/dist/host/src/shared/contracts/color-picker-api.d.ts +17 -0
- package/dist/host/src/shared/contracts/desktop-lyrics-api.d.ts +22 -0
- package/dist/host/src/shared/contracts/input-region-api.d.ts +5 -0
- package/dist/host/src/shared/contracts/lyrics-api.d.ts +11 -0
- package/dist/host/src/shared/contracts/manage-api.d.ts +31 -0
- package/dist/host/src/shared/contracts/menu-surface-api.d.ts +35 -0
- package/dist/host/src/shared/contracts/mini-player-api.d.ts +19 -0
- package/dist/host/src/shared/contracts/plugin-manager-api.d.ts +223 -0
- package/dist/host/src/shared/contracts/settings-api.d.ts +15 -0
- package/dist/host/src/shared/playbackMode.d.ts +2 -0
- package/dist/host/src/shared/plugin/cache-bust.d.ts +8 -0
- package/dist/host/src/shared/plugin/lifecycle.d.ts +217 -0
- package/dist/host/src/shared/plugin/realms/main/index.d.ts +18 -0
- package/dist/host/src/shared/plugin/registry.d.ts +69 -0
- package/dist/host/src/shared/plugin/runtime-state.d.ts +4 -0
- package/dist/host/src/shared/settings/defaults.d.ts +35 -0
- package/dist/host/src/shared/settings/index.d.ts +3 -0
- package/dist/host/src/shared/settings/keys.d.ts +21 -0
- package/dist/host/src/shared/settings/values.d.ts +13 -0
- package/dist/host/src/shared/types/desktop-lyrics.d.ts +61 -0
- package/dist/host/src/shared/types/dui.d.ts +37 -0
- package/dist/host/src/shared/types/input-region.d.ts +6 -0
- package/dist/host/src/shared/types/lyrics.d.ts +15 -0
- package/dist/host/src/shared/types/manage.d.ts +14 -0
- package/dist/host/src/shared/types/menu-surface.d.ts +43 -0
- package/dist/host/src/shared/types/menu.d.ts +29 -0
- package/dist/host/src/shared/types/mini-player.d.ts +97 -0
- package/dist/host/src/shared/types/ncae.d.ts +29 -0
- package/dist/host/src/shared/types/package-download.d.ts +14 -0
- package/dist/host/src/shared/types/playback-mode.d.ts +3 -0
- package/dist/host/src/shared/types/settings.d.ts +9 -0
- package/dist/host/src/shared/types/update.d.ts +6 -0
- package/dist/host/src/shared/util.d.ts +22 -0
- package/dist/index.d.ts +7 -0
- package/dist/plugin-manager/host/src/preload/logger.d.ts +10 -0
- package/dist/plugin-manager/host/src/preload/util.d.ts +1 -0
- package/dist/plugin-manager/host/src/shared/bridge/constants.d.ts +2 -0
- package/dist/plugin-manager/host/src/shared/bridge/endpoint.d.ts +29 -0
- package/dist/plugin-manager/host/src/shared/bridge/hub.d.ts +136 -0
- package/dist/plugin-manager/host/src/shared/bridge/protocol.d.ts +91 -0
- package/dist/plugin-manager/host/src/shared/bridge/routes.d.ts +37 -0
- package/dist/plugin-manager/host/src/shared/contracts/plugin-manager-api.d.ts +223 -0
- package/dist/plugin-manager/host/src/shared/plugin/lifecycle.d.ts +217 -0
- package/dist/plugin-manager/host/src/shared/plugin/realms/common/index.d.ts +34 -0
- package/dist/plugin-manager/host/src/shared/plugin/realms/plugin-manager/index.d.ts +11 -0
- package/dist/plugin-manager/host/src/shared/plugin/registry.d.ts +69 -0
- package/dist/plugin-manager/host/src/shared/util.d.ts +22 -0
- package/dist/plugin-manager/index.d.ts +7 -0
- package/dist/plugin-manager/registry-map.d.ts +16 -0
- package/dist/preload/host/src/constants.d.ts +6 -0
- package/dist/preload/host/src/main/network/types.d.ts +70 -0
- package/dist/preload/host/src/preload/AudioEffectManager.d.ts +124 -0
- package/dist/preload/host/src/preload/MusicRecognizer.d.ts +25 -0
- package/dist/preload/host/src/preload/PlaybackBackend.d.ts +34 -0
- package/dist/preload/host/src/preload/Player.d.ts +229 -0
- package/dist/preload/host/src/preload/YunxinIM.d.ts +15 -0
- package/dist/preload/host/src/preload/audioplayer.d.ts +4 -0
- package/dist/preload/host/src/preload/av3a/Av3aPcmPlayer.d.ts +84 -0
- package/dist/preload/host/src/preload/av3a/bridge.d.ts +21 -0
- package/dist/preload/host/src/preload/av3a/channel.d.ts +40 -0
- package/dist/preload/host/src/preload/av3a/detect.d.ts +6 -0
- package/dist/preload/host/src/preload/backends/Av3aPlaybackBackend.d.ts +32 -0
- package/dist/preload/host/src/preload/backends/MediaPlaybackBackend.d.ts +25 -0
- package/dist/preload/host/src/preload/calls/app.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/audioeffect.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/audioplayer.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/im.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/index.d.ts +6 -0
- package/dist/preload/host/src/preload/calls/network.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/nimsys.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/os.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/player.d.ts +1 -0
- package/dist/preload/host/src/preload/calls/update.d.ts +1 -0
- package/dist/preload/host/src/preload/calls.d.ts +4 -0
- package/dist/preload/host/src/preload/channel.d.ts +1 -0
- package/dist/preload/host/src/preload/logger.d.ts +10 -0
- package/dist/preload/host/src/preload/playbackMode.d.ts +13 -0
- package/dist/preload/host/src/preload/util.d.ts +1 -0
- package/dist/preload/host/src/shared/CallDispatcher.d.ts +12 -0
- package/dist/preload/host/src/shared/bridge/endpoint.d.ts +29 -0
- package/dist/preload/host/src/shared/bridge/hub.d.ts +136 -0
- package/dist/preload/host/src/shared/bridge/protocol.d.ts +91 -0
- package/dist/preload/host/src/shared/bridge/routes.d.ts +37 -0
- package/dist/preload/host/src/shared/contracts/av3a-api.d.ts +50 -0
- package/dist/preload/host/src/shared/contracts/av3a-process.d.ts +56 -0
- package/dist/preload/host/src/shared/contracts/plugin-manager-api.d.ts +223 -0
- package/dist/preload/host/src/shared/playbackMode.d.ts +2 -0
- package/dist/preload/host/src/shared/plugin/lifecycle.d.ts +217 -0
- package/dist/preload/host/src/shared/plugin/realms/common/index.d.ts +34 -0
- package/dist/preload/host/src/shared/plugin/realms/preload/index.d.ts +11 -0
- package/dist/preload/host/src/shared/plugin/registry.d.ts +69 -0
- package/dist/preload/host/src/shared/types/ncae.d.ts +29 -0
- package/dist/preload/host/src/shared/types/playback-mode.d.ts +3 -0
- package/dist/preload/host/src/shared/util.d.ts +22 -0
- package/dist/preload/index.d.ts +7 -0
- package/dist/preload/registry-map.d.ts +43 -0
- package/dist/registry-map.d.ts +164 -0
- package/package.json +73 -3
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { BtnImages } from "./dui.js";
|
|
2
|
+
export declare const MiniPlayerLikeMark: {
|
|
3
|
+
readonly Unliked: 0;
|
|
4
|
+
readonly Liked: 1;
|
|
5
|
+
readonly UseFavour: 2;
|
|
6
|
+
readonly [x: number]: string;
|
|
7
|
+
};
|
|
8
|
+
export type MiniPlayerLikeMark = 0 | 1 | 2;
|
|
9
|
+
export declare namespace MiniPlayerLikeMark {
|
|
10
|
+
type Unliked = 0;
|
|
11
|
+
type Liked = 1;
|
|
12
|
+
type UseFavour = 2;
|
|
13
|
+
}
|
|
14
|
+
export interface MiniPlayerPlayInfo {
|
|
15
|
+
albumId: string;
|
|
16
|
+
albumName: string;
|
|
17
|
+
artistName: string;
|
|
18
|
+
playId: string;
|
|
19
|
+
songName: string;
|
|
20
|
+
songType: string;
|
|
21
|
+
url: string;
|
|
22
|
+
}
|
|
23
|
+
export interface MiniPlayerPlayState {
|
|
24
|
+
playing: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface MiniPlayerListElement {
|
|
27
|
+
id: string;
|
|
28
|
+
from: string;
|
|
29
|
+
title: string;
|
|
30
|
+
track_id: string;
|
|
31
|
+
program: null | 1;
|
|
32
|
+
mv: string;
|
|
33
|
+
album: string;
|
|
34
|
+
artist: string;
|
|
35
|
+
alias: string;
|
|
36
|
+
cloud: 0 | 1;
|
|
37
|
+
}
|
|
38
|
+
export interface MiniPlayerListData {
|
|
39
|
+
items: MiniPlayerListElement[];
|
|
40
|
+
currentPlay: string | null;
|
|
41
|
+
}
|
|
42
|
+
export interface MiniPlayerTogetherUser {
|
|
43
|
+
avatarUrl: string;
|
|
44
|
+
}
|
|
45
|
+
export interface MiniPlayerTogetherStatus {
|
|
46
|
+
status: "alone" | "waiting" | "togetherOwner" | "together";
|
|
47
|
+
self: MiniPlayerTogetherUser;
|
|
48
|
+
other: MiniPlayerTogetherUser;
|
|
49
|
+
}
|
|
50
|
+
export interface MiniPlayerFullState {
|
|
51
|
+
playInfo: MiniPlayerPlayInfo | null;
|
|
52
|
+
coverUrl: string | null;
|
|
53
|
+
likeMark: MiniPlayerLikeMark;
|
|
54
|
+
favour: boolean;
|
|
55
|
+
mute: boolean;
|
|
56
|
+
currentPlay: string | null;
|
|
57
|
+
playState: MiniPlayerPlayState;
|
|
58
|
+
listItems: MiniPlayerListElement[];
|
|
59
|
+
togetherStatus: MiniPlayerTogetherStatus;
|
|
60
|
+
style: MiniPlayerStyle | null;
|
|
61
|
+
font: string | null;
|
|
62
|
+
}
|
|
63
|
+
export interface MiniPlayerStyle {
|
|
64
|
+
background: string;
|
|
65
|
+
lrcColor: string;
|
|
66
|
+
titleColor: string;
|
|
67
|
+
artistColor: string;
|
|
68
|
+
prevButton: BtnImages;
|
|
69
|
+
playButton: BtnImages;
|
|
70
|
+
pauseButton: BtnImages;
|
|
71
|
+
nextButton: BtnImages;
|
|
72
|
+
loveButton: BtnImages;
|
|
73
|
+
lovedButton: BtnImages;
|
|
74
|
+
favourButton: BtnImages;
|
|
75
|
+
favouredButton: BtnImages;
|
|
76
|
+
volumeButton: BtnImages;
|
|
77
|
+
volumeMutedButton: BtnImages;
|
|
78
|
+
listButton: BtnImages;
|
|
79
|
+
closeButton: BtnImages;
|
|
80
|
+
toWebButton: BtnImages;
|
|
81
|
+
list: {
|
|
82
|
+
background: string;
|
|
83
|
+
itemBackground: string;
|
|
84
|
+
hoverBackground: string;
|
|
85
|
+
selectedBackground: string;
|
|
86
|
+
playingBackground: string;
|
|
87
|
+
scrollBar: string;
|
|
88
|
+
color: string;
|
|
89
|
+
hoverColor: string;
|
|
90
|
+
selectedColor: string;
|
|
91
|
+
playButton: BtnImages;
|
|
92
|
+
pauseButton: BtnImages;
|
|
93
|
+
radioIcon: BtnImages;
|
|
94
|
+
radioHoverIcon: BtnImages;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export type MiniPlayerShowVolumeRequest = [number, boolean];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const NcaeType: {
|
|
2
|
+
/** JSON effect parameters. */
|
|
3
|
+
readonly Json: 1;
|
|
4
|
+
/** WAV impulse response (convolution data). */
|
|
5
|
+
readonly Wav: 2;
|
|
6
|
+
readonly [x: number]: string;
|
|
7
|
+
};
|
|
8
|
+
export type NcaeType = 1 | 2;
|
|
9
|
+
export declare namespace NcaeType {
|
|
10
|
+
/** JSON effect parameters. */
|
|
11
|
+
type Json = 1;
|
|
12
|
+
/** WAV impulse response (convolution data). */
|
|
13
|
+
type Wav = 2;
|
|
14
|
+
}
|
|
15
|
+
export interface NcaeHeader {
|
|
16
|
+
/** Raw payload size as declared in the file (before decompression). */
|
|
17
|
+
payloadSize: number;
|
|
18
|
+
/** Type flag. */
|
|
19
|
+
type: NcaeType;
|
|
20
|
+
}
|
|
21
|
+
export interface Ncae {
|
|
22
|
+
header: NcaeHeader;
|
|
23
|
+
/**
|
|
24
|
+
* Decompressed payload.
|
|
25
|
+
* - Type 1 (JSON): the raw JSON string.
|
|
26
|
+
* - Type 2 (WAV): a Buffer containing the RIFF/WAVE data.
|
|
27
|
+
*/
|
|
28
|
+
payload: string | Uint8Array;
|
|
29
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const PackageDownloadReason: {
|
|
2
|
+
readonly NotFound: 0;
|
|
3
|
+
readonly LoadFailed: 1;
|
|
4
|
+
readonly UserRequested: 2;
|
|
5
|
+
readonly UpdateAvailable: 3;
|
|
6
|
+
readonly [x: number]: string;
|
|
7
|
+
};
|
|
8
|
+
export type PackageDownloadReason = 0 | 1 | 2 | 3;
|
|
9
|
+
export declare namespace PackageDownloadReason {
|
|
10
|
+
type NotFound = 0;
|
|
11
|
+
type LoadFailed = 1;
|
|
12
|
+
type UserRequested = 2;
|
|
13
|
+
type UpdateAvailable = 3;
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare function toError(error: unknown): Error;
|
|
2
|
+
/**
|
|
3
|
+
* Get or set the image size of a Netease CDN URL.
|
|
4
|
+
*
|
|
5
|
+
* To get, leave `sizeOrWidth` and `height` empty.
|
|
6
|
+
* To set, set `sizeOrWidth` and/or `height`.
|
|
7
|
+
*
|
|
8
|
+
* @param url
|
|
9
|
+
* @param sizeOrWidth If provided, sets the image size or width
|
|
10
|
+
* @param height If provided, use this as the height, or `sizeOrWidth` will be used for height
|
|
11
|
+
*/
|
|
12
|
+
export declare function imageSize(url: string): [number, number] | null;
|
|
13
|
+
export declare function imageSize(url: string, sizeOrWidth: number, height?: number): string;
|
|
14
|
+
/** Convert dB to linear gain. */
|
|
15
|
+
export declare function dbToGain(db: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* Convert volume (0-1) to linear gain, logarithmic mapping.
|
|
18
|
+
*
|
|
19
|
+
* @param input
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function volumeToGain(input: number, minDb?: number): number;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// AUTO-GENERATED by packages/plugin-api/scripts/build.ts. Do not edit.
|
|
2
|
+
// The plugin-facing type surface. Generated from the host; contains no
|
|
3
|
+
// references back to the host repository.
|
|
4
|
+
|
|
5
|
+
export type { PluginModule, PluginRuntime } from "./host/src/shared/plugin/realms/main/index.js";
|
|
6
|
+
export type { LoadedModule, PluginRegistry, Registry } from "./host/src/shared/plugin/registry.js";
|
|
7
|
+
export type { RegistryLoad } from "./registry-map.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LogFn } from "pino";
|
|
2
|
+
type Bindings = Record<string, unknown>;
|
|
3
|
+
/** `child()` factory returned by the facade. */
|
|
4
|
+
type ChildFactory = (bindings: Bindings) => Facade;
|
|
5
|
+
/** The facade surface: a log method per level, plus `child(bindings)`. */
|
|
6
|
+
type Facade = Record<string, LogFn> & {
|
|
7
|
+
child: ChildFactory;
|
|
8
|
+
};
|
|
9
|
+
declare const logger: Facade;
|
|
10
|
+
export default logger;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const channel: string | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed client surface over a mount.
|
|
3
|
+
*
|
|
4
|
+
* Property access builds a route; calling a leaf sends a request, and leaves
|
|
5
|
+
* under `events` create subscriptions. The proxy is path-based, so nested
|
|
6
|
+
* contract groups work without codegen.
|
|
7
|
+
*/
|
|
8
|
+
import type { BridgeError } from "./protocol.js";
|
|
9
|
+
type AnyFunction = (...args: any[]) => any;
|
|
10
|
+
export type EventArgs<F> = F extends (callback: (...args: infer A) => void) => unknown ? A : never;
|
|
11
|
+
export type EventEndpoint<E> = {
|
|
12
|
+
[K in keyof E]: E[K] extends (callback: (payload: any) => void) => unknown ? (callback: (...args: EventArgs<E[K]>) => void, onError?: (error: BridgeError) => void) => () => void : E[K] extends object ? EventEndpoint<E[K]> : never;
|
|
13
|
+
};
|
|
14
|
+
export type Endpoint<T> = {
|
|
15
|
+
[K in keyof T as K extends "events" ? never : T[K] extends AnyFunction ? K : T[K] extends object ? K : never]: T[K] extends AnyFunction ? (...args: Parameters<T[K]>) => Promise<Awaited<ReturnType<T[K]>>> : T[K] extends object ? Endpoint<T[K]> : never;
|
|
16
|
+
} & (T extends {
|
|
17
|
+
events: infer E;
|
|
18
|
+
} ? {
|
|
19
|
+
events: EventEndpoint<E>;
|
|
20
|
+
} : {});
|
|
21
|
+
export interface EndpointHooks {
|
|
22
|
+
/** Send a request for the route suffix (for example `cache.getStats`). */
|
|
23
|
+
request(route: string, args: unknown[]): Promise<unknown>;
|
|
24
|
+
/** Subscribe to an event route suffix (for example `timeUpdate`). */
|
|
25
|
+
subscribe(route: string, callback: (...args: unknown[]) => void, onError?: (error: BridgeError) => void): () => void;
|
|
26
|
+
}
|
|
27
|
+
export declare function createEndpoint<T>(hooks: EndpointHooks): Endpoint<T>;
|
|
28
|
+
declare const joinRoute: (mount: string, suffix: string) => string;
|
|
29
|
+
export { joinRoute };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hub: the per-realm router.
|
|
3
|
+
*
|
|
4
|
+
* A hub owns three things:
|
|
5
|
+
* - mounts: routes served by this realm,
|
|
6
|
+
* - ports: bridges attached to this realm (one per outside peer),
|
|
7
|
+
* - links: explicit relay rules between two attached ports.
|
|
8
|
+
*
|
|
9
|
+
* Routes are resolved locally first, then through a link, and rejected
|
|
10
|
+
* otherwise. All frames are correlated with ids owned by the sending hop; a
|
|
11
|
+
* link rewrites ids on the way through and remembers how to send the response
|
|
12
|
+
* back.
|
|
13
|
+
*/
|
|
14
|
+
import { type Endpoint, type EventArgs } from "./endpoint.js";
|
|
15
|
+
import { BridgeError, type Frame } from "./protocol.js";
|
|
16
|
+
type AnyFunction = (...args: any[]) => unknown;
|
|
17
|
+
export interface BridgeInfo<Meta = unknown> {
|
|
18
|
+
/** Stable id of this port, unique within the hub. */
|
|
19
|
+
readonly id: string;
|
|
20
|
+
/**
|
|
21
|
+
* Opaque transport metadata (realm, window, session, ...). The hub never
|
|
22
|
+
* interprets it; it is forwarded to `authorize` and diagnostics verbatim.
|
|
23
|
+
*/
|
|
24
|
+
readonly meta: Meta;
|
|
25
|
+
}
|
|
26
|
+
/** A transport across one boundary. Inert until attached to a hub. */
|
|
27
|
+
export interface Bridge<Meta = unknown> {
|
|
28
|
+
readonly info: BridgeInfo<Meta>;
|
|
29
|
+
send(frame: Frame): void;
|
|
30
|
+
onFrame(handler: (frame: Frame) => void): () => void;
|
|
31
|
+
close(): void;
|
|
32
|
+
}
|
|
33
|
+
export interface Origin<Meta = unknown> {
|
|
34
|
+
readonly bridgeId: string;
|
|
35
|
+
/** Port ids the frame traversed, oldest first. */
|
|
36
|
+
readonly chain: readonly string[];
|
|
37
|
+
/** The peer metadata supplied by the transport that opened this port. */
|
|
38
|
+
readonly meta: Meta;
|
|
39
|
+
}
|
|
40
|
+
export interface CallContext<Meta = unknown> {
|
|
41
|
+
readonly route: string;
|
|
42
|
+
readonly origin: Origin<Meta>;
|
|
43
|
+
readonly signal: AbortSignal;
|
|
44
|
+
/** Id of the port the call arrived on. */
|
|
45
|
+
readonly peer: string;
|
|
46
|
+
}
|
|
47
|
+
export type Handler<Meta = unknown> = (ctx: CallContext<Meta>, ...args: unknown[]) => unknown;
|
|
48
|
+
export type Handlers<T, Meta = unknown> = {
|
|
49
|
+
[K in keyof T as K extends "events" ? never : T[K] extends AnyFunction ? K : T[K] extends object ? K : never]: T[K] extends AnyFunction ? (ctx: CallContext<Meta>, ...args: Parameters<T[K]>) => ReturnType<T[K]> : T[K] extends object ? Handlers<T[K], Meta> : never;
|
|
50
|
+
};
|
|
51
|
+
export type Emitter<T> = {
|
|
52
|
+
[K in keyof T]: T[K] extends (callback: (...args: any) => void) => unknown ? (...args: EventArgs<T[K]>) => void : T[K] extends object ? Emitter<T[K]> : never;
|
|
53
|
+
};
|
|
54
|
+
export interface Mount<T> {
|
|
55
|
+
readonly route: string;
|
|
56
|
+
readonly emit: T extends {
|
|
57
|
+
events: infer E;
|
|
58
|
+
} ? Emitter<E> : Record<string, never>;
|
|
59
|
+
dispose(): void;
|
|
60
|
+
}
|
|
61
|
+
export interface MountOptions<Meta = unknown> {
|
|
62
|
+
/** Fine-grained origin check, applied after the port ingress ACL. */
|
|
63
|
+
readonly authorize?: (origin: Origin<Meta>) => boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface LinkOptions {
|
|
66
|
+
/** Consumer route pattern → server route pattern. Also the link's ACL. */
|
|
67
|
+
readonly routes: Readonly<Record<string, string>>;
|
|
68
|
+
/** Default timeout for requests traversing this link. */
|
|
69
|
+
readonly timeoutMs?: number;
|
|
70
|
+
}
|
|
71
|
+
export interface ConnectOptions {
|
|
72
|
+
readonly timeoutMs?: number;
|
|
73
|
+
readonly onError?: (error: BridgeError) => void;
|
|
74
|
+
}
|
|
75
|
+
export interface Port<Meta = unknown> {
|
|
76
|
+
readonly id: string;
|
|
77
|
+
readonly origin: Origin<Meta>;
|
|
78
|
+
send(frame: Frame): void;
|
|
79
|
+
dispose(): void;
|
|
80
|
+
}
|
|
81
|
+
export interface Link {
|
|
82
|
+
dispose(): void;
|
|
83
|
+
}
|
|
84
|
+
export declare class HubImpl<Meta = unknown> {
|
|
85
|
+
private readonly mounts;
|
|
86
|
+
private readonly ports;
|
|
87
|
+
private readonly portRecords;
|
|
88
|
+
private readonly links;
|
|
89
|
+
private readonly localSubs;
|
|
90
|
+
private readonly localOrigin;
|
|
91
|
+
private localSubSeq;
|
|
92
|
+
private closed;
|
|
93
|
+
constructor(options?: {
|
|
94
|
+
localMeta?: Meta;
|
|
95
|
+
});
|
|
96
|
+
mount<T>(route: string, impl: Handlers<T, Meta>, options?: MountOptions<Meta>): Mount<T>;
|
|
97
|
+
attach(bridge: Bridge<Meta>): Port<Meta>;
|
|
98
|
+
bridge(client: Port<Meta>, server: Port<Meta>, options: LinkOptions): Link;
|
|
99
|
+
connect<T>(route: string, options?: ConnectOptions): Endpoint<T>;
|
|
100
|
+
connect<T>(port: Port<Meta>, route: string, options?: ConnectOptions): Endpoint<T>;
|
|
101
|
+
dispose(): void;
|
|
102
|
+
private dispatch;
|
|
103
|
+
private reportDispatchFailure;
|
|
104
|
+
private acceptSession;
|
|
105
|
+
private resetPortSession;
|
|
106
|
+
private handleRequest;
|
|
107
|
+
private handleSubscribe;
|
|
108
|
+
private handleResponse;
|
|
109
|
+
private handleEvent;
|
|
110
|
+
private handleUnsubscribe;
|
|
111
|
+
private handleCancel;
|
|
112
|
+
private matchingLinks;
|
|
113
|
+
private forward;
|
|
114
|
+
private expire;
|
|
115
|
+
private forget;
|
|
116
|
+
private removeLink;
|
|
117
|
+
private requestLocal;
|
|
118
|
+
private subscribeLocal;
|
|
119
|
+
private requestVia;
|
|
120
|
+
private subscribeVia;
|
|
121
|
+
private createEmitter;
|
|
122
|
+
private emit;
|
|
123
|
+
private dropSubscriptions;
|
|
124
|
+
private resolveMount;
|
|
125
|
+
private originFor;
|
|
126
|
+
private send;
|
|
127
|
+
private fail;
|
|
128
|
+
private failSub;
|
|
129
|
+
private requirePort;
|
|
130
|
+
private detach;
|
|
131
|
+
private assertOpen;
|
|
132
|
+
}
|
|
133
|
+
export declare function createHub<Meta = unknown>(options?: {
|
|
134
|
+
localMeta?: Meta;
|
|
135
|
+
}): HubImpl<Meta>;
|
|
136
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire protocol for the Open Orpheus bridge.
|
|
3
|
+
*
|
|
4
|
+
* A frame is a data-only message that can cross a process boundary
|
|
5
|
+
* (`ipcRenderer`/`ipcMain`), a context boundary (`contextBridge`) or an
|
|
6
|
+
* in-memory test transport. Everything is correlated by numeric ids that are
|
|
7
|
+
* owned by the hop that generated them, so relays never need global ids.
|
|
8
|
+
*/
|
|
9
|
+
export interface SerializedError {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly message: string;
|
|
12
|
+
readonly code?: string;
|
|
13
|
+
readonly data?: unknown;
|
|
14
|
+
}
|
|
15
|
+
export type Result = {
|
|
16
|
+
readonly ok: true;
|
|
17
|
+
readonly value: unknown;
|
|
18
|
+
} | {
|
|
19
|
+
readonly ok: false;
|
|
20
|
+
readonly error: SerializedError;
|
|
21
|
+
};
|
|
22
|
+
export type Frame = {
|
|
23
|
+
readonly t: "req";
|
|
24
|
+
readonly id: number;
|
|
25
|
+
/** Preload document identity; lets the main side reset stale state on reload. */
|
|
26
|
+
readonly session?: string;
|
|
27
|
+
readonly route: string;
|
|
28
|
+
readonly args: unknown[];
|
|
29
|
+
readonly chain: readonly string[];
|
|
30
|
+
} | {
|
|
31
|
+
readonly t: "sub";
|
|
32
|
+
readonly id: number;
|
|
33
|
+
/** Preload document identity; lets the main side reset stale state on reload. */
|
|
34
|
+
readonly session?: string;
|
|
35
|
+
readonly route: string;
|
|
36
|
+
readonly chain: readonly string[];
|
|
37
|
+
} | ({
|
|
38
|
+
readonly t: "res";
|
|
39
|
+
readonly id: number;
|
|
40
|
+
readonly session?: string;
|
|
41
|
+
} & Result) | ({
|
|
42
|
+
readonly t: "sres";
|
|
43
|
+
readonly id: number;
|
|
44
|
+
readonly session?: string;
|
|
45
|
+
} & DistributionResult) | {
|
|
46
|
+
readonly t: "evt";
|
|
47
|
+
readonly id: number;
|
|
48
|
+
readonly session?: string;
|
|
49
|
+
readonly payload: readonly unknown[];
|
|
50
|
+
} | {
|
|
51
|
+
readonly t: "unsub";
|
|
52
|
+
readonly id: number;
|
|
53
|
+
readonly session?: string;
|
|
54
|
+
} | {
|
|
55
|
+
readonly t: "cancel";
|
|
56
|
+
readonly id: number;
|
|
57
|
+
readonly session?: string;
|
|
58
|
+
};
|
|
59
|
+
export type DistributionResult = {
|
|
60
|
+
readonly ok: true;
|
|
61
|
+
} | {
|
|
62
|
+
readonly ok: false;
|
|
63
|
+
readonly error: SerializedError;
|
|
64
|
+
};
|
|
65
|
+
export type RequestFrame = Extract<Frame, {
|
|
66
|
+
t: "req";
|
|
67
|
+
}>;
|
|
68
|
+
export type SubscribeFrame = Extract<Frame, {
|
|
69
|
+
t: "sub";
|
|
70
|
+
}>;
|
|
71
|
+
export type ResponseFrame = Extract<Frame, {
|
|
72
|
+
t: "res";
|
|
73
|
+
}>;
|
|
74
|
+
export type SubscribeResultFrame = Extract<Frame, {
|
|
75
|
+
t: "sres";
|
|
76
|
+
}>;
|
|
77
|
+
export type EventFrame = Extract<Frame, {
|
|
78
|
+
t: "evt";
|
|
79
|
+
}>;
|
|
80
|
+
export declare class BridgeError extends Error {
|
|
81
|
+
readonly code: string;
|
|
82
|
+
readonly data?: unknown;
|
|
83
|
+
constructor(code: string, message: string, options?: {
|
|
84
|
+
data?: unknown;
|
|
85
|
+
cause?: unknown;
|
|
86
|
+
});
|
|
87
|
+
toSerialized(): SerializedError;
|
|
88
|
+
static from(serialized: SerializedError | undefined): BridgeError;
|
|
89
|
+
}
|
|
90
|
+
export declare function serializeError(error: unknown): SerializedError;
|
|
91
|
+
export declare function isBridgeError(error: unknown, code?: string): error is BridgeError;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route pattern compilation for bridge mount ACLs and link rewrites.
|
|
3
|
+
*
|
|
4
|
+
* Patterns are dot-separated segments:
|
|
5
|
+
* - a literal segment matches itself,
|
|
6
|
+
* - `*` matches exactly one non-empty segment,
|
|
7
|
+
* - `**` matches the remainder of the route and is only valid as the last
|
|
8
|
+
* segment.
|
|
9
|
+
*
|
|
10
|
+
* Rewrite targets refer to captures with `$1`, `$2`, ... in source order.
|
|
11
|
+
*/
|
|
12
|
+
export interface RouteMatch {
|
|
13
|
+
/** The pattern that matched. */
|
|
14
|
+
readonly pattern: string;
|
|
15
|
+
/** The route the frame carried when it entered the link. */
|
|
16
|
+
readonly route: string;
|
|
17
|
+
/** The route the frame must carry when it leaves the link. */
|
|
18
|
+
readonly to: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Compile one pattern. Throws `InvalidRoutePattern` for empty segments and for
|
|
22
|
+
* a `**` that is not the final segment.
|
|
23
|
+
*/
|
|
24
|
+
export declare function compilePattern(pattern: string): {
|
|
25
|
+
re: RegExp;
|
|
26
|
+
captures: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Ordered rewrite table. The first matching rule wins; a route that matches
|
|
30
|
+
* none is not allowed through the link.
|
|
31
|
+
*/
|
|
32
|
+
export declare class RouteTable {
|
|
33
|
+
private readonly rules;
|
|
34
|
+
private constructor();
|
|
35
|
+
static from(routes: Readonly<Record<string, string>>): RouteTable;
|
|
36
|
+
rewrite(route: string): RouteMatch | null;
|
|
37
|
+
}
|