@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
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2026 YUCLing
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,192 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @open-orpheus/plugin-api
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Type and runtime API for [Open Orpheus](https://github.com/YUCLing/open-orpheus)
|
|
4
|
+
plugins. The declarations are generated from the host; the `./client` entry is a
|
|
5
|
+
small runtime client that plugin scripts bundle to call an API they published.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install --save-dev @open-orpheus/plugin-api
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Main realm:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import type { PluginModule, PluginRuntime } from "@open-orpheus/plugin-api";
|
|
19
|
+
|
|
20
|
+
export const activate: PluginModule["activate"] = async (runtime: PluginRuntime) => {
|
|
21
|
+
const { default: logger } = await runtime.registry.load("@main/logger");
|
|
22
|
+
logger.info("plugin activated");
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Client runtime for plugin scripts:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { connect } from "@open-orpheus/plugin-api/client";
|
|
30
|
+
|
|
31
|
+
const api = connect<MyApi>("myPlugin");
|
|
32
|
+
await api.refresh();
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Keep `@open-orpheus/plugin-api` in `devDependencies` and bundle this import into
|
|
36
|
+
the plugin's assets; `assets://` scripts cannot resolve bare specifiers, and the
|
|
37
|
+
client has no runtime install step. The surface exists once the plugin's preload
|
|
38
|
+
realm has mounted an API.
|
|
39
|
+
|
|
40
|
+
Use `LoadedModule` when a host module's type is needed without loading it:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import type { LoadedModule } from "@open-orpheus/plugin-api";
|
|
44
|
+
|
|
45
|
+
type Logger = LoadedModule<"@main/logger">;
|
|
46
|
+
// same as Awaited<ReturnType<RegistryLoad["@main/logger"]>>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Preload realm:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import type { PluginModule, PluginRuntime } from "@open-orpheus/plugin-api/preload";
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Plugin-manager realm:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import type { PluginModule, PluginRuntime } from "@open-orpheus/plugin-api/plugin-manager";
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The plugin-manager realm runs only in the plugin manager window. Declare it in
|
|
62
|
+
`metadata.json` as a `plugin-manager` entry; it is optional and separate from
|
|
63
|
+
the main and preload entries.
|
|
64
|
+
|
|
65
|
+
## Deep imports and stability
|
|
66
|
+
|
|
67
|
+
The generated tree mirrors the host's module graph, so implementation types can
|
|
68
|
+
be imported directly through the package wildcard:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import type { PlaybackMode } from "@open-orpheus/plugin-api/host/src/shared/types/playback-mode.js";
|
|
72
|
+
import type PlaybackController from "@open-orpheus/plugin-api/host/src/main/playback/PlaybackController.js";
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Include the `.js` extension: the package is ESM and the emitted declarations use
|
|
76
|
+
explicit specifiers. These are type-only imports; the package ships no runtime
|
|
77
|
+
code.
|
|
78
|
+
|
|
79
|
+
Deep imports are **not** part of the supported plugin API. Declarations tagged
|
|
80
|
+
`@internal` in the host, and implementation modules such as
|
|
81
|
+
`host/src/main/plugin/**`, are published only because the tree is generated from
|
|
82
|
+
the host source. The tag is a stability marker, not access control: the
|
|
83
|
+
declaration remains importable. These entries are **more unstable than the rest
|
|
84
|
+
of the generated surface** — the package entry points and registry keys. They
|
|
85
|
+
can change, move, or disappear in any release without a deprecation cycle.
|
|
86
|
+
Prefer `PluginModule`, `PluginRuntime`, `Registry`, `LoadedModule`, and the
|
|
87
|
+
generated registry keys for anything a plugin depends on.
|
|
88
|
+
|
|
89
|
+
In the generated declarations, enums are literal union types, so host
|
|
90
|
+
signatures accept their values directly:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
import type { PlaybackStatus } from "@open-orpheus/plugin-api/host/src/main/playback/types.js";
|
|
94
|
+
|
|
95
|
+
const status: PlaybackStatus = "playing";
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Normal enums also keep a `declare const` object and a namespace of member type
|
|
99
|
+
aliases, so values loaded from the registry retain their literal types and
|
|
100
|
+
`Enum.Member` still works in type positions; the package still ships no runtime
|
|
101
|
+
code. Numeric enums keep their reverse index, so `Enum[value]` remains valid.
|
|
102
|
+
`const enum`s are union-only; neither their values nor their `Enum.Member` type
|
|
103
|
+
names are available.
|
|
104
|
+
|
|
105
|
+
## Lifecycle
|
|
106
|
+
|
|
107
|
+
`activate` runs for each realm instance. `deactivate` is optional, but should be
|
|
108
|
+
idempotent and undo everything that `activate` registered.
|
|
109
|
+
|
|
110
|
+
Activation and cleanup are serialized: the host never calls `deactivate` while
|
|
111
|
+
the matching `activate` is still running. If activation exceeds the host's
|
|
112
|
+
deadline the plugin is reported as hung; cleanup starts only after activation
|
|
113
|
+
settles. A disable received during activation is applied immediately after that
|
|
114
|
+
activation finishes.
|
|
115
|
+
|
|
116
|
+
Main-realm entries (and renderer configuration modules) are imported with a
|
|
117
|
+
cache-busting `?t=<timestamp>-<rand>` query, so each enable/disable cycle
|
|
118
|
+
evaluates the entry afresh. Within one enable epoch, activation and cross-plugin
|
|
119
|
+
`load()` share a single evaluation. Top-level code therefore runs again on every
|
|
120
|
+
enable: keep it declarative and put setup in `activate()` and teardown in
|
|
121
|
+
`deactivate()`.
|
|
122
|
+
|
|
123
|
+
Only the entry is cache-busted. Modules the entry imports resolve without the
|
|
124
|
+
query and keep their first evaluation for the life of the process (main realm) or
|
|
125
|
+
window document (configuration UI). So:
|
|
126
|
+
|
|
127
|
+
- Module-level state in an imported helper survives disable/enable. Keep
|
|
128
|
+
per-activation state in the entry or in `activate()`.
|
|
129
|
+
- Never create listeners, timers, IPC handlers, or `contextBridge` APIs at the
|
|
130
|
+
top level of an imported module; that code does not run again, while the entry
|
|
131
|
+
that owns it does.
|
|
132
|
+
- `deactivate()` must clean up explicitly; do not rely on imported modules being
|
|
133
|
+
reset.
|
|
134
|
+
- Build output matters: shared chunks or separate lazy-import chunks are exactly
|
|
135
|
+
these uncached modules. Inlining each entry (no code splitting) makes all of
|
|
136
|
+
its code re-evaluate, at the cost of bundle size; otherwise treat every emitted
|
|
137
|
+
chunk as a process-lifetime singleton.
|
|
138
|
+
|
|
139
|
+
Preload and plugin-manager bundles are CommonJS evaluated by the host and are
|
|
140
|
+
re-evaluated after a full disable, but not on retry. Editing plugin files
|
|
141
|
+
requires restarting the realm or application.
|
|
142
|
+
|
|
143
|
+
## Cross-plugin exports
|
|
144
|
+
|
|
145
|
+
`runtime.plugins` exposes two distinct operations:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
await runtime.plugins.load("other-plugin"); // evaluate and return exports
|
|
149
|
+
await runtime.plugins.whenActive("other-plugin"); // wait until it is running
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
`load` does not wait for the other plugin's `activate`. Use `whenActive` when
|
|
153
|
+
your plugin needs the other plugin to be fully initialized. Readiness cycles
|
|
154
|
+
fail immediately with an `Activation readiness cycle` error instead of timing
|
|
155
|
+
out.
|
|
156
|
+
|
|
157
|
+
## Configuration UI
|
|
158
|
+
|
|
159
|
+
Declare the panel in `metadata.json`, relative to the plugin's `assets/`
|
|
160
|
+
directory and as an `.mjs` file:
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
"configuration": "configuration/index.mjs"
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
That module is browser ESM the host imports and owns. Export `mount()` and return
|
|
167
|
+
a cleanup function, or nothing:
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
import type { ConfigurationModule } from "@open-orpheus/plugin-api/configuration";
|
|
171
|
+
|
|
172
|
+
export const mount: ConfigurationModule["mount"] = (root, context) => {
|
|
173
|
+
root.textContent = "Settings";
|
|
174
|
+
return () => {
|
|
175
|
+
root.replaceChildren();
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
There is no registration API. `context` provides `pluginId`, `assetsBaseUrl`
|
|
181
|
+
(the plugin's `assets/` root), and an `AbortSignal`. The host awaits the returned
|
|
182
|
+
cleanup and reports failures per plugin. If you need host data, expose it from the
|
|
183
|
+
plugin-manager preload realm through `contextBridge`; the host activates that
|
|
184
|
+
realm before mounting the panel.
|
|
185
|
+
|
|
186
|
+
## Versioning
|
|
187
|
+
|
|
188
|
+
The package version matches the Open Orpheus release it was generated from.
|
|
189
|
+
|
|
190
|
+
## Publishing
|
|
191
|
+
|
|
192
|
+
Releases are staged on npm by the release workflow, synchorized with Open Orpheus's release.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface BridgeSerializedError {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly message: string;
|
|
4
|
+
readonly code?: string;
|
|
5
|
+
readonly data?: unknown;
|
|
6
|
+
}
|
|
7
|
+
export type BridgeResult = {
|
|
8
|
+
readonly ok: true;
|
|
9
|
+
readonly value: unknown;
|
|
10
|
+
} | {
|
|
11
|
+
readonly ok: false;
|
|
12
|
+
readonly error: BridgeSerializedError;
|
|
13
|
+
};
|
|
14
|
+
/** The subset of `window.__ooBridge` a plugin client needs. */
|
|
15
|
+
export interface BridgeSurface {
|
|
16
|
+
request(route: string, args: unknown[]): Promise<BridgeResult>;
|
|
17
|
+
}
|
|
18
|
+
/** The API a plugin published, as seen from the renderer. */
|
|
19
|
+
export type BridgeEndpoint<T> = {
|
|
20
|
+
[K in keyof T]: T[K] extends (...args: infer A) => infer R ? (...args: A) => Promise<Awaited<R>> : T[K] extends object ? BridgeEndpoint<T[K]> : T[K];
|
|
21
|
+
};
|
|
22
|
+
export declare class BridgeRequestError extends Error {
|
|
23
|
+
readonly code?: string;
|
|
24
|
+
readonly data?: unknown;
|
|
25
|
+
constructor(error: BridgeSerializedError);
|
|
26
|
+
}
|
|
27
|
+
export interface BridgeClient {
|
|
28
|
+
connect<T>(route: string): BridgeEndpoint<T>;
|
|
29
|
+
}
|
|
30
|
+
export declare function createClient(surface: BridgeSurface): BridgeClient;
|
|
31
|
+
/**
|
|
32
|
+
* Connect to a route on the current window's surface.
|
|
33
|
+
*
|
|
34
|
+
* The plugin must have mounted an API from its preload realm first; that mount
|
|
35
|
+
* is what creates and exposes `window.__ooBridge`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function connect<T>(route: string, surface?: BridgeSurface): BridgeEndpoint<T>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Runtime client for plugin scripts. Bundled by plugins; no host imports.
|
|
2
|
+
//
|
|
3
|
+
// The surface is installed by the plugin's preload realm when it publishes an
|
|
4
|
+
// API with `runtime.mainWorld.mount(...)`.
|
|
5
|
+
export class BridgeRequestError extends Error {
|
|
6
|
+
code;
|
|
7
|
+
data;
|
|
8
|
+
constructor(error) {
|
|
9
|
+
super(error.message);
|
|
10
|
+
this.name = error.name || "BridgeRequestError";
|
|
11
|
+
this.code = error.code;
|
|
12
|
+
this.data = error.data;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function createClient(surface) {
|
|
16
|
+
return {
|
|
17
|
+
connect(route) {
|
|
18
|
+
return endpoint(surface, route);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Connect to a route on the current window's surface.
|
|
24
|
+
*
|
|
25
|
+
* The plugin must have mounted an API from its preload realm first; that mount
|
|
26
|
+
* is what creates and exposes `window.__ooBridge`.
|
|
27
|
+
*/
|
|
28
|
+
export function connect(route, surface) {
|
|
29
|
+
return createClient(surface ?? windowSurface()).connect(route);
|
|
30
|
+
}
|
|
31
|
+
function windowSurface() {
|
|
32
|
+
const surface = globalThis.__ooBridge;
|
|
33
|
+
if (!surface) {
|
|
34
|
+
throw new Error("No __ooBridge surface is exposed in this window; the plugin's preload realm has not mounted an API.");
|
|
35
|
+
}
|
|
36
|
+
return surface;
|
|
37
|
+
}
|
|
38
|
+
function endpoint(surface, route, path = []) {
|
|
39
|
+
return new Proxy(function bridgeMethod() { }, {
|
|
40
|
+
get(_target, property) {
|
|
41
|
+
if (typeof property === "symbol" || property === "then")
|
|
42
|
+
return undefined;
|
|
43
|
+
return endpoint(surface, route, [...path, property]);
|
|
44
|
+
},
|
|
45
|
+
async apply(_target, _thisArg, args) {
|
|
46
|
+
const result = await surface.request([route, ...path].join("."), args);
|
|
47
|
+
if (!result.ok)
|
|
48
|
+
throw new BridgeRequestError(result.error);
|
|
49
|
+
return result.value;
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../runtime/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,8EAA8E;AAC9E,2CAA2C;AA2B3C,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,IAAI,CAAU;IACd,IAAI,CAAW;IAExB,YAAY,KAA4B;QACtC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,oBAAoB,CAAC;QAC/C,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;CACF;AAMD,MAAM,UAAU,YAAY,CAAC,OAAsB;IACjD,OAAO;QACL,OAAO,CAAI,KAAa;YACtB,OAAO,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAsB,CAAC;QACvD,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAI,KAAa,EAAE,OAAuB;IAC/D,OAAO,YAAY,CAAC,OAAO,IAAI,aAAa,EAAE,CAAC,CAAC,OAAO,CAAI,KAAK,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,aAAa;IACpB,MAAM,OAAO,GAAI,UAA6C,CAAC,UAAU,CAAC;IAC1E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,qGAAqG,CACtG,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,QAAQ,CAAC,OAAsB,EAAE,KAAa,EAAE,OAAiB,EAAE;IAC1E,OAAO,IAAI,KAAK,CAAC,SAAS,YAAY,KAAI,CAAC,EAAE;QAC3C,GAAG,CAAC,OAAO,EAAE,QAAQ;YACnB,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,MAAM;gBAAE,OAAO,SAAS,CAAC;YAC1E,OAAO,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;QACvD,CAAC;QACD,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAe;YAC5C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;YACvE,IAAI,CAAC,MAAM,CAAC,EAAE;gBAAE,MAAM,IAAI,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC3D,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Everything a plugin's configuration module is handed when it mounts. */
|
|
2
|
+
export interface ConfigurationContext {
|
|
3
|
+
readonly pluginId: string;
|
|
4
|
+
/** `assets://` base URL for this plugin's assets, for resolving relative resources. */
|
|
5
|
+
readonly assetsBaseUrl: string;
|
|
6
|
+
/** Aborted when the host closes or invalidates this mount. */
|
|
7
|
+
readonly signal: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
/** Cleanup returned by `mount()`, if the plugin needs one. */
|
|
10
|
+
export type ConfigurationUnmount = () => void | Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* The named exports a plugin's configuration entry must provide.
|
|
13
|
+
*
|
|
14
|
+
* Entries are browser ESM modules served from the plugin's `assets/`
|
|
15
|
+
* directory. The host imports, mounts, and unmounts them. Module top-level
|
|
16
|
+
* code must only define exports: ESM evaluation cannot be undone when the host
|
|
17
|
+
* invalidates an attempt, so lifecycle work belongs in `mount()`.
|
|
18
|
+
*/
|
|
19
|
+
export interface ConfigurationModule {
|
|
20
|
+
mount(root: HTMLDivElement, context: ConfigurationContext): void | ConfigurationUnmount | Promise<void | ConfigurationUnmount>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
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 { ConfigurationContext, ConfigurationModule, ConfigurationUnmount } from "./host/src/shared/plugin/configuration/index.js";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* auto-generated by NAPI-RS */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Which binding artifact the generated loader actually loaded: `'native'` for
|
|
6
|
+
* a native addon, otherwise the `platformArchABI` of the WASI flavor. Every
|
|
7
|
+
* flavor napi-rs can build is listed, because `NAPI_RS_NATIVE_LIBRARY_PATH`
|
|
8
|
+
* can point the loader at a WASI artifact this package does not build itself.
|
|
9
|
+
*/
|
|
10
|
+
export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-wasip1'
|
|
11
|
+
|
|
12
|
+
export declare class Database {
|
|
13
|
+
constructor(path: string)
|
|
14
|
+
/** Gets the path to database file. */
|
|
15
|
+
get filePath(): string
|
|
16
|
+
/** Execute a single SQL statement with named parameters. */
|
|
17
|
+
execNamed(sql: string, parameters: Record<string, unknown>): Promise<[number, Record<string, unknown>[]]>
|
|
18
|
+
/** Execute a single SQL statement with positional (`?`) parameters. */
|
|
19
|
+
exec(sql: string, parameters: unknown[]): Promise<[number, Record<string, unknown>[]]>
|
|
20
|
+
/**
|
|
21
|
+
* Execute SQL string, returns an array of objects representing rows,
|
|
22
|
+
* and an array of performance info (total time, execution time, rows affected).
|
|
23
|
+
*
|
|
24
|
+
* For NCM, not intended for Open Orpheus.
|
|
25
|
+
*/
|
|
26
|
+
executeSql(sql: string): Promise<[number, Record<string, string>[], [number, number, number]]>
|
|
27
|
+
/**
|
|
28
|
+
* Execute a SQL contains multiple statements as one transaction.
|
|
29
|
+
*
|
|
30
|
+
* For NCM, not intended for Open Orpheus.
|
|
31
|
+
*/
|
|
32
|
+
executeTransaction(sql: string): Promise<[number, Record<string, string>[], [number, number, number]]>
|
|
33
|
+
/**
|
|
34
|
+
* Execute multiple SQL statements inside an array, returns values of the last statement as an array.
|
|
35
|
+
*
|
|
36
|
+
* ## Example return
|
|
37
|
+
* ```json
|
|
38
|
+
* {
|
|
39
|
+
* "value": [
|
|
40
|
+
* [
|
|
41
|
+
* "a",
|
|
42
|
+
* "b"
|
|
43
|
+
* ]
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* For NCM, not intended for Open Orpheus.
|
|
48
|
+
*/
|
|
49
|
+
executeSqls(sqls: string[]): Promise<{ value: string[][] }>
|
|
50
|
+
}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/* auto-generated by NAPI-RS */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Which binding artifact the generated loader actually loaded: `'native'` for
|
|
6
|
+
* a native addon, otherwise the `platformArchABI` of the WASI flavor. Every
|
|
7
|
+
* flavor napi-rs can build is listed, because `NAPI_RS_NATIVE_LIBRARY_PATH`
|
|
8
|
+
* can point the loader at a WASI artifact this package does not build itself.
|
|
9
|
+
*/
|
|
10
|
+
export declare const __napiBindingTarget: 'native' | 'wasm32-wasi' | 'wasm32-wasip1'
|
|
11
|
+
|
|
12
|
+
/** Cancel a pending pointer-axis capture. */
|
|
13
|
+
export declare function cancelWindowPointerAxisCapture(token: number): boolean
|
|
14
|
+
|
|
15
|
+
export declare function cancelWindowTouch(token: number): boolean
|
|
16
|
+
|
|
17
|
+
/** Capture the first pointer enter on an existing managed window surface. */
|
|
18
|
+
export declare function captureCursorEnter(windowId: string, timeoutMs: number): Promise<[number, number] | null>
|
|
19
|
+
|
|
20
|
+
/** Invoke once when a Wayland pointer-axis event reaches this window's client. */
|
|
21
|
+
export declare function captureWindowNextPointerAxis(windowId: string, callback: (axis: number) => void): number
|
|
22
|
+
|
|
23
|
+
/** Invoke once when a touch press lands in a managed window. */
|
|
24
|
+
export declare function captureWindowTouch(windowId: string, callback: (x: number, y: number) => void): number
|
|
25
|
+
|
|
26
|
+
/** Withdraw a popup policy the window will not use after all. */
|
|
27
|
+
export declare function clearWindowPopupPolicy(targetWindowId: string): boolean
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Attach the managed window id to a title, the way the proxy expects it.
|
|
31
|
+
*
|
|
32
|
+
* The window id rides in front of the real title, separated from it by
|
|
33
|
+
* invisible characters, so the proxy can name the window on the wire while the
|
|
34
|
+
* compositor is shown only the title. `ManagedWindow` writes titles through
|
|
35
|
+
* this and nothing else writes them at all.
|
|
36
|
+
*/
|
|
37
|
+
export declare function decorateWindowTitle(id: string, title: string): string
|
|
38
|
+
|
|
39
|
+
export type DesktopEnvironment = 0 | 1 | 2 | 3 | 4;
|
|
40
|
+
|
|
41
|
+
export declare function dragWindow(hwnd: Buffer): void
|
|
42
|
+
|
|
43
|
+
/** Release completed native input callbacks on the JavaScript thread. */
|
|
44
|
+
export declare function drainWindowCallbacks(): void
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Release the native state recorded for a window that will not return.
|
|
48
|
+
*
|
|
49
|
+
* The layer-shell policy and the recorded input region are dropped, so a
|
|
50
|
+
* discarded wrapper cannot leave them behind. Do not call this for a window
|
|
51
|
+
* that merely hides and is shown again: it keeps its id and needs the record.
|
|
52
|
+
*/
|
|
53
|
+
export declare function forgetWindowState(windowId: string): boolean
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Gets the position of the cursor
|
|
57
|
+
*
|
|
58
|
+
* Only for X11 on Linux.
|
|
59
|
+
*/
|
|
60
|
+
export declare function getCursorPosition(): [number, number] | null
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Get current detected desktop environment.
|
|
64
|
+
*
|
|
65
|
+
* Mostly for Linux to use, on Windows/macOS, returns hardcoded values.
|
|
66
|
+
*/
|
|
67
|
+
export declare function getDesktopEnvironment(): DesktopEnvironment
|
|
68
|
+
|
|
69
|
+
/** Current pointer position inside a window surface, when the pointer is over it. */
|
|
70
|
+
export declare function getPointerPosition(windowId: string): WindowPointerPosition | null
|
|
71
|
+
|
|
72
|
+
/** Native popup capability. */
|
|
73
|
+
export declare function getPopupCapability(): PopupCapability
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The compositor's unique name for the output Electron reports as a `Display.id`.
|
|
77
|
+
*
|
|
78
|
+
* On Linux, this is the `wl_output.name` event (for example `DP-1`), looked up
|
|
79
|
+
* across the live Wayland connections. `null` when none of them knows the display,
|
|
80
|
+
* the client has not bound it yet, or the compositor is too old to send a name.
|
|
81
|
+
*
|
|
82
|
+
* On the other platforms, this is a ID that will be consistent across sessions.
|
|
83
|
+
*/
|
|
84
|
+
export declare function getUniqueDisplayId(displayId: number): string | null
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The `Display.id` of the output a managed window's surface entered.
|
|
88
|
+
*
|
|
89
|
+
* Wayland does not report a window's global position, but it does report which
|
|
90
|
+
* outputs its surface entered. This maps that back to the `Display.id` Electron
|
|
91
|
+
* uses. `null` when the window has no surface, has not entered an output yet,
|
|
92
|
+
* or the compositor is too old to expose the mapping.
|
|
93
|
+
*/
|
|
94
|
+
export declare function getWindowOutputDisplayId(windowId: string): number | null
|
|
95
|
+
|
|
96
|
+
/** Whether the compositor currently reports the window's toplevel as activated. */
|
|
97
|
+
export declare function isWindowActivated(windowId: string): boolean
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Whether the compositor currently gives this window keyboard focus.
|
|
101
|
+
*
|
|
102
|
+
* This is the authoritative `wl_keyboard.enter`/`leave` state, not Electron's
|
|
103
|
+
* xdg-activation-based `isFocused()`. Layer surfaces can be keyboard-focused
|
|
104
|
+
* without ever receiving an xdg `activated` state.
|
|
105
|
+
*/
|
|
106
|
+
export declare function isWindowKeyboardFocused(windowId: string): boolean
|
|
107
|
+
|
|
108
|
+
/** Whether a pointer is currently over this window's surface. */
|
|
109
|
+
export declare function isWindowPointerInside(windowId: string): boolean
|
|
110
|
+
|
|
111
|
+
/** Whether the window's Wayland surface was converted to an xdg_popup. */
|
|
112
|
+
export declare function isWindowWaylandPopup(windowId: string): boolean
|
|
113
|
+
|
|
114
|
+
/** Latest mouse/touch press across all tracked windows, if any. */
|
|
115
|
+
export declare function latestWindowPress(): LatestWindowPress | null
|
|
116
|
+
|
|
117
|
+
export interface LatestWindowPress {
|
|
118
|
+
windowId: string
|
|
119
|
+
x: number
|
|
120
|
+
y: number
|
|
121
|
+
touch: boolean
|
|
122
|
+
ageMs: number
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** The stacking layer a layer surface is placed in, bottom-most first. */
|
|
126
|
+
export type LayerShellLayer = 0 | 1 | 2 | 3;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Layer-shell state for a window the application is about to create.
|
|
130
|
+
*
|
|
131
|
+
* With an owner, applied only to that managed window; without one, applied to
|
|
132
|
+
* the next eligible toplevel. Declare it before the window (or its surface) is
|
|
133
|
+
* brought into existence. A declaration without size or anchors covers the output.
|
|
134
|
+
*/
|
|
135
|
+
export interface LayerShellOptions {
|
|
136
|
+
/** Purpose of the surface, e.g. `"open-orpheus-menu"`. Required. */
|
|
137
|
+
namespace: string
|
|
138
|
+
/** Defaults to the top layer. */
|
|
139
|
+
layer?: LayerShellLayer
|
|
140
|
+
/**
|
|
141
|
+
* The `Display.id` of the output to create the layer surface on.
|
|
142
|
+
*
|
|
143
|
+
* Electron's `Display.id` is the Wayland registry global name, so it can
|
|
144
|
+
* be passed through unchanged. Omit it to let the compositor choose.
|
|
145
|
+
*/
|
|
146
|
+
output?: number
|
|
147
|
+
anchorTop?: boolean
|
|
148
|
+
anchorBottom?: boolean
|
|
149
|
+
anchorLeft?: boolean
|
|
150
|
+
anchorRight?: boolean
|
|
151
|
+
/**
|
|
152
|
+
* Surface size in surface-local coordinates. `0` lets the compositor
|
|
153
|
+
* decide, which requires the two opposite anchors on that axis.
|
|
154
|
+
*/
|
|
155
|
+
width?: number
|
|
156
|
+
height?: number
|
|
157
|
+
marginTop?: number
|
|
158
|
+
marginRight?: number
|
|
159
|
+
marginBottom?: number
|
|
160
|
+
marginLeft?: number
|
|
161
|
+
/** `-1` ignore other surfaces, `0` avoid them, `>0` reserve space. */
|
|
162
|
+
exclusiveZone?: number
|
|
163
|
+
/** `0` none, `1` exclusive, `2` on demand (needs layer shell v4). */
|
|
164
|
+
keyboardInteractivity?: number
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The layer-shell version advertised by a live compositor, or `null`.
|
|
169
|
+
*
|
|
170
|
+
* `null` means no live connection advertises `zwlr_layer_shell_v1`. A version
|
|
171
|
+
* of 4 or higher supports `on_demand` keyboard focus, which menus require for
|
|
172
|
+
* focus-loss dismissal.
|
|
173
|
+
*/
|
|
174
|
+
export declare function layerShellVersion(): number | null
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Listen for windows whose layer-shell role was refused.
|
|
178
|
+
*
|
|
179
|
+
* A compositor never releases a surface's role, so a window whose surface is
|
|
180
|
+
* already an ordinary toplevel can never become a layer surface. The callback
|
|
181
|
+
* gets the custom window id that was refused; the application has to re-create
|
|
182
|
+
* that window (a new surface) for the role to apply.
|
|
183
|
+
*
|
|
184
|
+
* Only for Wayland on Linux.
|
|
185
|
+
*/
|
|
186
|
+
export declare function onLayerShellRoleRefused(callback: (windowId: string) => void): void
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Whether the active Wayland hooks allow a native popup attempt.
|
|
190
|
+
*
|
|
191
|
+
* Independent of the desktop name. This does not guarantee that a particular
|
|
192
|
+
* window can become a popup: arming still requires a tracked parent, anchor
|
|
193
|
+
*/
|
|
194
|
+
export interface PopupCapability {
|
|
195
|
+
supported: boolean
|
|
196
|
+
reason?: string
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Set regions that the window is used to receive inputs.
|
|
201
|
+
*
|
|
202
|
+
* Only for Linux.
|
|
203
|
+
*/
|
|
204
|
+
export declare function setInputRegion(windowHandle: string | Buffer, rects?: { x: number, y: number, w: number, h: number }[] | null): boolean
|
|
205
|
+
|
|
206
|
+
export declare function setWindowAsBackground(hwnd: Buffer, displayId?: number | undefined | null): void
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Register (or clear) the layer-shell policy for a managed window.
|
|
210
|
+
*
|
|
211
|
+
* The policy is keyed by the id the application names the window with, so it
|
|
212
|
+
* may be registered before the window — or its surface — exists. It is read
|
|
213
|
+
* once, when the proxy resolves a surface's window id from the decorated
|
|
214
|
+
* title: a surface that has not taken a role yet becomes a layer surface with
|
|
215
|
+
* these options, and a surface that is already an ordinary toplevel can never
|
|
216
|
+
* become one.
|
|
217
|
+
*
|
|
218
|
+
* Returns whether the policy was accepted; `None` clears the policy. Refused
|
|
219
|
+
* options are not stored, and the window is still created as an ordinary one.
|
|
220
|
+
*/
|
|
221
|
+
export declare function setWindowLayerShell(windowId: string, options?: LayerShellOptions | undefined | null): boolean
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Resize an existing layer surface, keeping its anchors and margins.
|
|
225
|
+
*
|
|
226
|
+
* The request is applied at the surface's next commit, because layer state is
|
|
227
|
+
* double-buffered. Returns whether the window currently is a layer surface.
|
|
228
|
+
*/
|
|
229
|
+
export declare function setWindowLayerShellSize(windowId: string, width: number, height: number): boolean
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Register the intent to present `target_window_id` as an xdg_popup of
|
|
233
|
+
* `parent_window_id`, with the size the renderer measured.
|
|
234
|
+
*
|
|
235
|
+
* Identified by managed window id, like the layer-shell policy: the role is
|
|
236
|
+
* decided when the decorated title names the window, and everything the
|
|
237
|
+
* positioner needs (the parent's surface, the anchor, the object id) is
|
|
238
|
+
* resolved then. Omit the anchor to use the last pointer-button position on
|
|
239
|
+
* the parent. `shadow_inset` excludes transparent client-side shadow margins
|
|
240
|
+
* from the window geometry. Returns whether the intent was accepted.
|
|
241
|
+
*/
|
|
242
|
+
export declare function setWindowPopupPolicy(targetWindowId: string, parentWindowId: string, width: number, height: number, anchorX?: number | undefined | null, anchorY?: number | undefined | null, shadowInset?: number | undefined | null, anchorRectWidth?: number | undefined | null): boolean
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Whether native xdg_popup conversion is available.
|
|
246
|
+
* data and a reusable object ID. Callers must retain an overlay fallback.
|
|
247
|
+
*/
|
|
248
|
+
export declare function supportsNativeWaylandPopup(): boolean
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Re-key the native state recorded for one managed window under another.
|
|
252
|
+
*
|
|
253
|
+
* A policy switch replaces the wrapper, and the replacement is a different
|
|
254
|
+
* window with a different id. The layer-shell policy and the recorded input
|
|
255
|
+
* region follow it, so nothing has to be mirrored on the application side.
|
|
256
|
+
*/
|
|
257
|
+
export declare function transferWindowState(fromId: string, toId: string): boolean
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Whether a layer-shell policy could be sent.
|
|
261
|
+
*
|
|
262
|
+
* The same option validation `setWindowLayerShell` applies, without storing
|
|
263
|
+
* anything: callers can report options that could never be sent, and a
|
|
264
|
+
* settings UI can check a choice before anything is created.
|
|
265
|
+
*
|
|
266
|
+
* This answers for the options only, never for the compositor: whether it
|
|
267
|
+
* takes layer surfaces at all is `layerShellVersion()`, and a caller that
|
|
268
|
+
* needs both asks both.
|
|
269
|
+
*/
|
|
270
|
+
export declare function validateLayerShellOptions(options: LayerShellOptions): boolean
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* How long ago the most recent pointer button press landed in this window.
|
|
274
|
+
*
|
|
275
|
+
* `undefined` when that press was somewhere else, or there was none. A caller
|
|
276
|
+
* can use it to tell a click that just happened here from a press that merely
|
|
277
|
+
* happened at some point in the past.
|
|
278
|
+
*/
|
|
279
|
+
export declare function windowLastPressAgeMs(windowId: string): number | null
|
|
280
|
+
|
|
281
|
+
export interface WindowPointerPosition {
|
|
282
|
+
x: number
|
|
283
|
+
y: number
|
|
284
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const BUILD: string;
|
|
2
|
+
export declare const VERSION: string;
|
|
3
|
+
export declare const CORE_VERSION: string;
|
|
4
|
+
export declare const NATIVE_VERSION = "60316";
|
|
5
|
+
export declare const SECRET_KEY = "7ada0f7ccadbe165e6e7fbe01113f4df";
|
|
6
|
+
export declare const OSVER = "Microsoft-Windows-11--build-22631-64bit";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function GenerateFP(samples: Float32Array): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function raceArgument<T>(predicate: (arg: string, index: number, array: string[]) => Promise<T | null> | T | null, argv?: string[]): Promise<T | null>;
|
|
2
|
+
export declare function parseMoveRun(arg: string, index: number, array: string[]): [string, string] | null;
|
|
3
|
+
export declare function parseWebCommand(arg: string): string | null;
|
|
4
|
+
export declare function parseLocalFile(arg: string): Promise<string | null>;
|