@vestra-player/sdk 1.7.1 → 1.7.3
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/CHANGELOG.md +20 -0
- package/README.md +6 -9
- package/bin/vestra-plugin.mjs +4 -4
- package/dist/api-requests.d.ts +8 -8
- package/dist/api-requests.js +8 -8
- package/dist/capability-check.d.ts +15 -15
- package/dist/capability-check.js +4 -4
- package/dist/capability-rules.d.ts +4 -5
- package/dist/capability-rules.js +4 -5
- package/dist/commands.d.ts +34 -44
- package/dist/commands.js +21 -27
- package/dist/docs-tree.json.gz +0 -0
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +13 -3
- package/dist/i18n-tools.js +1 -1
- package/dist/i18n.js +1 -1
- package/dist/media.d.ts +7 -7
- package/dist/palettes.d.ts +5 -5
- package/dist/palettes.js +5 -5
- package/dist/plugin/appearance.js +1 -1
- package/dist/plugin/bindings.d.ts +2 -3
- package/dist/plugin/bindings.js +2 -3
- package/dist/plugin/commands.js +10 -11
- package/dist/plugin/connection.d.ts +18 -19
- package/dist/plugin/connection.js +23 -24
- package/dist/plugin/index.d.ts +5 -5
- package/dist/plugin/index.js +1 -1
- package/dist/plugin/osd.d.ts +1 -1
- package/dist/plugin/osd.js +1 -1
- package/dist/plugin/passes.d.ts +4 -4
- package/dist/plugin/passes.js +4 -4
- package/dist/plugin/patch.d.ts +8 -8
- package/dist/plugin/patch.js +12 -12
- package/dist/plugin/player/events.js +5 -5
- package/dist/plugin/resolvers.js +3 -3
- package/dist/plugin/scope.d.ts +4 -4
- package/dist/plugin/scope.js +4 -4
- package/dist/plugin/services.d.ts +2 -3
- package/dist/plugin/services.js +2 -3
- package/dist/plugin/shaders.js +5 -6
- package/dist/plugin/state.js +10 -10
- package/dist/plugin/testing/commands.d.ts +4 -5
- package/dist/plugin/testing/commands.js +4 -5
- package/dist/plugin/testing/i18n.d.ts +1 -1
- package/dist/plugin/testing/i18n.js +1 -1
- package/dist/plugin/testing/index.d.ts +147 -165
- package/dist/plugin/testing/index.js +141 -155
- package/dist/plugin/testing/internals.d.ts +9 -2
- package/dist/plugin/testing/internals.js +9 -2
- package/dist/plugin/testing/layout.d.ts +46 -3
- package/dist/plugin/testing/layout.js +102 -7
- package/dist/plugin/testing/services.js +10 -2
- package/dist/plugin/testing/slint-types.d.ts +75 -0
- package/dist/plugin/testing/slint-types.js +974 -0
- package/dist/plugin/timeline.d.ts +1 -1
- package/dist/plugin/timeline.js +2 -2
- package/dist/plugin/types/base.d.ts +90 -111
- package/dist/plugin/types/commands.d.ts +142 -174
- package/dist/plugin/types/packages.d.ts +48 -63
- package/dist/plugin/types/playback.d.ts +45 -59
- package/dist/plugin/types/plugin-wire.d.ts +38 -45
- package/dist/plugin/types/processing.d.ts +52 -65
- package/dist/plugin/types/services.d.ts +18 -25
- package/dist/plugin/types/snapshots.d.ts +34 -46
- package/dist/plugin/types/sources.d.ts +14 -16
- package/dist/plugin/types/subtitles.d.ts +7 -8
- package/dist/plugin/types/ui-content.d.ts +111 -116
- package/dist/plugin/types/ui-layout.d.ts +52 -63
- package/dist/plugin/types/ui-locale.d.ts +41 -45
- package/dist/plugin/types/ui-shell.d.ts +69 -87
- package/dist/plugin/values.d.ts +15 -18
- package/dist/plugin/values.js +16 -19
- package/dist/plugin/view/base.d.ts +2 -2
- package/dist/plugin/view/base.js +7 -8
- package/dist/plugin/view/layout.d.ts +2 -2
- package/dist/plugin/view/panel.js +2 -4
- package/dist/plugin/view/writer.d.ts +8 -8
- package/dist/plugin/view/writer.js +37 -39
- package/dist/plugin/when.d.ts +3 -3
- package/dist/plugin/wire-facade.js +6 -7
- package/dist/processing.d.ts +26 -30
- package/dist/processing.js +4 -4
- package/dist/source-resolvers.d.ts +2 -2
- package/dist/source.d.ts +1 -2
- package/dist/subtitles.d.ts +1 -1
- package/dist/ts-plugin.d.ts +5 -5
- package/dist/wire.d.ts +63 -70
- package/dist/wire.js +21 -25
- package/llms.txt +7 -10
- package/package.json +1 -1
- package/slint/vestra/bar-buttons.slint +6 -8
- package/slint/vestra/focus.slint +1 -1
- package/slint/vestra/widgets.slint +2 -4
|
@@ -486,8 +486,8 @@ export interface MarkdownWire {
|
|
|
486
486
|
* component and interaction locks.
|
|
487
487
|
*
|
|
488
488
|
* @remarks
|
|
489
|
-
* One per slot the plugin mounted
|
|
490
|
-
*
|
|
489
|
+
* One per slot the plugin mounted, kept in {@link TestHost.panels}; disposing a
|
|
490
|
+
* panel removes only its own.
|
|
491
491
|
*
|
|
492
492
|
* @example Check the adjust panel's locks
|
|
493
493
|
* The plugin's adjust panel reports a drag; the test reads the locks it
|
|
@@ -586,7 +586,7 @@ export type FakePanel = Omit<FakeWindow, "callbacks" | "userClose"> & {
|
|
|
586
586
|
* recorded.
|
|
587
587
|
*
|
|
588
588
|
* @capability None.
|
|
589
|
-
* @see [Test a plugin](../../../docs/
|
|
589
|
+
* @see [Test a plugin](../../../docs/guides/testing.md)
|
|
590
590
|
* @since 1.0.0
|
|
591
591
|
* @category Testing
|
|
592
592
|
*/
|
|
@@ -628,8 +628,8 @@ export declare class TestHost implements Transport {
|
|
|
628
628
|
/** Tool windows by id (see {@link TestHost.window}). */
|
|
629
629
|
readonly windows: Map<string, FakeWindow>;
|
|
630
630
|
/**
|
|
631
|
-
* The plugin's mounted panels by slot, in mount order (
|
|
632
|
-
*
|
|
631
|
+
* The plugin's mounted panels by slot, in mount order (one panel per slot).
|
|
632
|
+
* See {@link TestHost.mounted}.
|
|
633
633
|
*/
|
|
634
634
|
readonly panels: Map<string, FakePanel>;
|
|
635
635
|
/**
|
|
@@ -674,9 +674,9 @@ export declare class TestHost implements Transport {
|
|
|
674
674
|
*/
|
|
675
675
|
sidebar: LayoutSlot | null;
|
|
676
676
|
/**
|
|
677
|
-
* The adjust column
|
|
678
|
-
*
|
|
679
|
-
*
|
|
677
|
+
* The adjust column, like the sidebar but never `detached`. It starts
|
|
678
|
+
* hidden (`preferred: false`, `reason: "userHidden"`), as the player's does
|
|
679
|
+
* until the user opens it.
|
|
680
680
|
*/
|
|
681
681
|
adjust: LayoutSlot | null;
|
|
682
682
|
};
|
|
@@ -687,9 +687,9 @@ export declare class TestHost implements Transport {
|
|
|
687
687
|
*/
|
|
688
688
|
readonly osd: string[];
|
|
689
689
|
/**
|
|
690
|
-
* The action buttons of each `osd.show` message, in step with `osd`
|
|
691
|
-
*
|
|
692
|
-
*
|
|
690
|
+
* The action buttons of each `osd.show` message, in step with `osd` (index
|
|
691
|
+
* for index): each button's title as shown and its command; `[]` for a
|
|
692
|
+
* message without actions.
|
|
693
693
|
*/
|
|
694
694
|
readonly osdActions: {
|
|
695
695
|
/** The button title as shown, in the plugin's locale. */
|
|
@@ -698,9 +698,9 @@ export declare class TestHost implements Transport {
|
|
|
698
698
|
command: string;
|
|
699
699
|
}[][];
|
|
700
700
|
/**
|
|
701
|
-
* Press button `index` of the newest OSD message, as the user does
|
|
702
|
-
*
|
|
703
|
-
*
|
|
701
|
+
* Press button `index` of the newest OSD message, as the user does: its
|
|
702
|
+
* command runs as if picked from a menu, and settles. A disabled or busy
|
|
703
|
+
* command does nothing, as in the player.
|
|
704
704
|
*
|
|
705
705
|
* @param index - 0 or 1.
|
|
706
706
|
*
|
|
@@ -733,11 +733,10 @@ export declare class TestHost implements Transport {
|
|
|
733
733
|
* messages, dialog texts, settings page and panel titles show its
|
|
734
734
|
* translations, the way the player shows them.
|
|
735
735
|
*
|
|
736
|
-
* The player's own texts (core actions' messages and menus, its
|
|
737
|
-
*
|
|
738
|
-
*
|
|
739
|
-
*
|
|
740
|
-
* passing; set `locale` to test what a user sees now.
|
|
736
|
+
* The player's own texts (core actions' messages and menus, its refusals) are
|
|
737
|
+
* English, or the player's Simplified Chinese for `"zh-Hans"`. While `locale`
|
|
738
|
+
* was never set they stay in Chinese; set `locale` to test what a user sees
|
|
739
|
+
* now.
|
|
741
740
|
*
|
|
742
741
|
* @example Check a menu path in Simplified Chinese
|
|
743
742
|
* The test starts the plugin with a Chinese interface and checks the
|
|
@@ -1025,8 +1024,7 @@ export declare class TestHost implements Transport {
|
|
|
1025
1024
|
title: string | null;
|
|
1026
1025
|
}[];
|
|
1027
1026
|
/**
|
|
1028
|
-
* Each plugin's ranges by plugin id; layers without ranges are absent
|
|
1029
|
-
* (SDK 1.6.9).
|
|
1027
|
+
* Each plugin's ranges by plugin id; layers without ranges are absent.
|
|
1030
1028
|
*/
|
|
1031
1029
|
rangeLayers: Map<string, {
|
|
1032
1030
|
/** Seconds from the start. */
|
|
@@ -1118,10 +1116,10 @@ export declare class TestHost implements Transport {
|
|
|
1118
1116
|
}[]): void;
|
|
1119
1117
|
/**
|
|
1120
1118
|
* Runtime images written to views (`plugin.ui.image`,
|
|
1121
|
-
* `plugin.ui.remoteImage`), whole values and
|
|
1122
|
-
*
|
|
1123
|
-
*
|
|
1124
|
-
*
|
|
1119
|
+
* `plugin.ui.remoteImage`), whole values and images nested in rows, newest
|
|
1120
|
+
* last. The SDK refuses images of released scopes before anything is sent.
|
|
1121
|
+
* The test host does not read the files, so it does not check the player's
|
|
1122
|
+
* per-view budget (`IMAGE_LIMITS.viewBytes`).
|
|
1125
1123
|
*/
|
|
1126
1124
|
readonly images: {
|
|
1127
1125
|
/** The image file's path, as given to `ui.image`. */
|
|
@@ -1489,14 +1487,13 @@ export declare class TestHost implements Transport {
|
|
|
1489
1487
|
*/
|
|
1490
1488
|
setVideoRenderOwner(pluginId: string | null): void;
|
|
1491
1489
|
/**
|
|
1492
|
-
* What the player pushes when mpv cannot compile a shader (code `failed`)
|
|
1493
|
-
*
|
|
1494
|
-
* `videoRender.gpu` to false and `rendering.reason` to `window-fallback`
|
|
1495
|
-
*
|
|
1496
|
-
*
|
|
1497
|
-
*
|
|
1498
|
-
*
|
|
1499
|
-
* {@link TestHost.previousCrash}.
|
|
1490
|
+
* What the player pushes when mpv cannot compile a shader (code `failed`) or
|
|
1491
|
+
* switches to software rendering (`unsupported`, which also sets
|
|
1492
|
+
* `videoRender.gpu` to false and `rendering.reason` to `window-fallback` with
|
|
1493
|
+
* `message`). Pushed only when this plugin is the owner. `previous-crash` is
|
|
1494
|
+
* a shortcut that only sets the handle's status and reaches `onError`: the
|
|
1495
|
+
* real player never pushes it, it refuses the `set` request itself. To test
|
|
1496
|
+
* that, set {@link TestHost.previousCrash}.
|
|
1500
1497
|
*
|
|
1501
1498
|
* @example Make a shader fail to compile
|
|
1502
1499
|
* The plugin's render options report `failed`, as when mpv rejects a
|
|
@@ -1520,11 +1517,11 @@ export declare class TestHost implements Transport {
|
|
|
1520
1517
|
*/
|
|
1521
1518
|
failVideoRender(code: "failed" | "unsupported" | "previous-crash", message: string): void;
|
|
1522
1519
|
/**
|
|
1523
|
-
* The shader channel (`plugin.video.shaders(id)
|
|
1524
|
-
*
|
|
1525
|
-
*
|
|
1526
|
-
*
|
|
1527
|
-
*
|
|
1520
|
+
* The shader channel (`plugin.video.shaders(id)`): the lists the player holds
|
|
1521
|
+
* for this plugin's handles by id (the real paths, after following links),
|
|
1522
|
+
* and how many shaders other plugins hold, which count against
|
|
1523
|
+
* {@link VIDEO_PROCESSING_LIMITS}`.shaders` (`limit`). Files must be under
|
|
1524
|
+
* {@link TestHost.fileRoots}; under software rendering
|
|
1528
1525
|
* (`videoRender.gpu = false`) a non-empty list fails with `unsupported`.
|
|
1529
1526
|
*
|
|
1530
1527
|
* @since 1.5.39
|
|
@@ -1551,11 +1548,10 @@ export declare class TestHost implements Transport {
|
|
|
1551
1548
|
* rendering (`unsupported`; use {@link TestHost.failVideoRender}, which
|
|
1552
1549
|
* also tells the handles). Pushed only to a handle that holds shaders.
|
|
1553
1550
|
*
|
|
1554
|
-
* `code` (
|
|
1555
|
-
*
|
|
1556
|
-
*
|
|
1557
|
-
*
|
|
1558
|
-
* {@link TestHost.previousCrash}.
|
|
1551
|
+
* `code` (default `failed`) is the error code pushed. `previous-crash` is a
|
|
1552
|
+
* shortcut that only sets the handle's status and reaches `onError`: the real
|
|
1553
|
+
* player never pushes it, it refuses the `set` request itself after
|
|
1554
|
+
* an abnormal end. To test that, set {@link TestHost.previousCrash}.
|
|
1559
1555
|
*
|
|
1560
1556
|
* @capability None.
|
|
1561
1557
|
*
|
|
@@ -1584,11 +1580,10 @@ export declare class TestHost implements Transport {
|
|
|
1584
1580
|
*/
|
|
1585
1581
|
failVideoShaders(id: string, message: string, code?: "failed" | "previous-crash"): void;
|
|
1586
1582
|
/**
|
|
1587
|
-
* Play a run after an abnormal end with plugin shaders on
|
|
1588
|
-
*
|
|
1589
|
-
* `
|
|
1590
|
-
*
|
|
1591
|
-
* (default): shaders apply.
|
|
1583
|
+
* Play a run after an abnormal end with plugin shaders on: while set, a
|
|
1584
|
+
* non-empty `video.shaders` list and a render options `set` with a non-empty
|
|
1585
|
+
* `shaders` list are refused with `previous-crash` and this message; clearing
|
|
1586
|
+
* still works. `null` (default): shaders apply.
|
|
1592
1587
|
*
|
|
1593
1588
|
* @example Check that the plugin stops retrying while shaders are off
|
|
1594
1589
|
* The plugin's shader handle turns `failed` with `previous-crash`, as
|
|
@@ -1945,10 +1940,10 @@ export declare class TestHost implements Transport {
|
|
|
1945
1940
|
};
|
|
1946
1941
|
};
|
|
1947
1942
|
/**
|
|
1948
|
-
* The player's rendering choice behind `plugin.rendering
|
|
1949
|
-
*
|
|
1950
|
-
*
|
|
1951
|
-
*
|
|
1943
|
+
* The player's rendering choice behind `plugin.rendering`. The mode drawing
|
|
1944
|
+
* now is {@link TestHost.videoRender | videoRender.gpu}, as for
|
|
1945
|
+
* `plugin.app.system()`; the rest is preset here and changed by the plugin's
|
|
1946
|
+
* calls, as the player would:
|
|
1952
1947
|
*
|
|
1953
1948
|
* - `setPreference` saves `preference` and never changes the mode. It
|
|
1954
1949
|
* refuses `"gpu"` while `gpu.available` is false: with `unsupported`
|
|
@@ -2013,8 +2008,8 @@ export declare class TestHost implements Transport {
|
|
|
2013
2008
|
restarts: number;
|
|
2014
2009
|
};
|
|
2015
2010
|
/**
|
|
2016
|
-
* The GPU's video upscaler behind `plugin.video.upscaling
|
|
2017
|
-
*
|
|
2011
|
+
* The GPU's video upscaler behind `plugin.video.upscaling`, answered as the
|
|
2012
|
+
* player would:
|
|
2018
2013
|
*
|
|
2019
2014
|
* - `state()` and `set(true)` set `checked` (the player's one GPU check; a
|
|
2020
2015
|
* plugin that should not wake the GPU while it starts can assert it is
|
|
@@ -2070,26 +2065,26 @@ export declare class TestHost implements Transport {
|
|
|
2070
2065
|
checked: boolean;
|
|
2071
2066
|
/** GPU rendering is still starting: a `rendering` reason then lets `set(true)` keep the request. */
|
|
2072
2067
|
renderingStarting: boolean;
|
|
2073
|
-
/** The video's size the state reports
|
|
2068
|
+
/** The video's size the state reports; `null`: no video. */
|
|
2074
2069
|
video: UpscalingVideoSize | null;
|
|
2075
|
-
/** The video area the state reports
|
|
2070
|
+
/** The video area the state reports; `null`: none. */
|
|
2076
2071
|
area: {
|
|
2077
2072
|
/** Width in physical pixels. */
|
|
2078
2073
|
width: number;
|
|
2079
2074
|
/** Height in physical pixels. */
|
|
2080
2075
|
height: number;
|
|
2081
2076
|
} | null;
|
|
2082
|
-
/** The rendering GPU's name the state reports
|
|
2077
|
+
/** The rendering GPU's name the state reports. */
|
|
2083
2078
|
gpu: string | null;
|
|
2084
|
-
/** mpv's decoder the state reports
|
|
2079
|
+
/** mpv's decoder the state reports; `null`: no video. */
|
|
2085
2080
|
hwdecCurrent: string | null;
|
|
2086
2081
|
};
|
|
2087
2082
|
/**
|
|
2088
2083
|
* Make the upscaler's reason `decoding` with `cause`, with the player's
|
|
2089
|
-
* message
|
|
2090
|
-
*
|
|
2091
|
-
*
|
|
2092
|
-
*
|
|
2084
|
+
* message, and set `upscaling.hwdecCurrent` to match (`d3d11va-copy`, `no`,
|
|
2085
|
+
* `nvdec`). `plugins` are named for `copy-back` only, as the player does.
|
|
2086
|
+
* Returns the reason; call {@link TestHost.upscalingChanged} to tell a
|
|
2087
|
+
* listening plugin.
|
|
2093
2088
|
*
|
|
2094
2089
|
* @example Test the window's advice for each cause
|
|
2095
2090
|
* The plugin's window explains why upscaling waits. The test fakes the
|
|
@@ -2111,10 +2106,9 @@ export declare class TestHost implements Transport {
|
|
|
2111
2106
|
upscalingDecoding(cause: UpscalingDecodingCause, plugins?: readonly UpscalingPlugin[]): UpscalingReason;
|
|
2112
2107
|
/**
|
|
2113
2108
|
* Send `video.upscaling.changed` with the state {@link TestHost.upscaling}
|
|
2114
|
-
* describes now (without `enabled`), as the player does when it changes
|
|
2115
|
-
*
|
|
2116
|
-
*
|
|
2117
|
-
* that does not listen.
|
|
2109
|
+
* describes now (without `enabled`), as the player does when it changes; a
|
|
2110
|
+
* plugin listening with `plugin.video.upscaling.onChange` receives it.
|
|
2111
|
+
* Nothing reaches a plugin that does not listen.
|
|
2118
2112
|
*
|
|
2119
2113
|
* @capability None.
|
|
2120
2114
|
*
|
|
@@ -2166,7 +2160,7 @@ export declare class TestHost implements Transport {
|
|
|
2166
2160
|
constructor();
|
|
2167
2161
|
/** The `player.setStepSeek` value in effect (default 5). */
|
|
2168
2162
|
stepSeek: number;
|
|
2169
|
-
/** The `player.setStepSeek` `keyframes` in effect (default `false
|
|
2163
|
+
/** The `player.setStepSeek` `keyframes` in effect (default `false`). */
|
|
2170
2164
|
stepSeekKeyframes: boolean;
|
|
2171
2165
|
/**
|
|
2172
2166
|
* Test data: the keyframe times (seconds, ascending) of the current
|
|
@@ -2216,7 +2210,7 @@ export declare class TestHost implements Transport {
|
|
|
2216
2210
|
readonly seeks: {
|
|
2217
2211
|
/** The target. */
|
|
2218
2212
|
seconds: number;
|
|
2219
|
-
/** `Scrub.seek(seconds, { keyframes: true })
|
|
2213
|
+
/** `Scrub.seek(seconds, { keyframes: true })`. */
|
|
2220
2214
|
keyframes: boolean;
|
|
2221
2215
|
}[];
|
|
2222
2216
|
/** Every `player.step`, newest last. */
|
|
@@ -2383,10 +2377,10 @@ export declare class TestHost implements Transport {
|
|
|
2383
2377
|
/**
|
|
2384
2378
|
* Simulate the user changing the main window (resizing, maximizing or
|
|
2385
2379
|
* restoring it, entering or leaving fullscreen, closing the
|
|
2386
|
-
* picture-in-picture window) and broadcast it. `maximized`
|
|
2387
|
-
*
|
|
2388
|
-
* sidebar (`effective: false`, `reason: "fullscreen"`) and
|
|
2389
|
-
* fullscreen docks it again.
|
|
2380
|
+
* picture-in-picture window) and broadcast it. `maximized` reads `false`
|
|
2381
|
+
* while fullscreen. Like the player, entering fullscreen collapses an
|
|
2382
|
+
* attached, visible sidebar (`effective: false`, `reason: "fullscreen"`) and
|
|
2383
|
+
* leaving fullscreen docks it again.
|
|
2390
2384
|
*
|
|
2391
2385
|
* @example Go fullscreen, report picture-in-picture support, maximize
|
|
2392
2386
|
* The plugin sees the main window fullscreen at 1920×1080, then learns
|
|
@@ -2426,9 +2420,9 @@ export declare class TestHost implements Transport {
|
|
|
2426
2420
|
}>): void;
|
|
2427
2421
|
/**
|
|
2428
2422
|
* The pointer reached the right edge in fullscreen (`true`) or left the
|
|
2429
|
-
* popped-out columns (`false`): the attached sidebar and the adjust column
|
|
2430
|
-
*
|
|
2431
|
-
*
|
|
2423
|
+
* popped-out columns (`false`): the attached sidebar and the adjust column,
|
|
2424
|
+
* those switched on, pop out or collapse (reference §6.3). No effect outside
|
|
2425
|
+
* fullscreen, or on a column switched off or floating.
|
|
2432
2426
|
*
|
|
2433
2427
|
* @capability None.
|
|
2434
2428
|
*
|
|
@@ -2503,18 +2497,18 @@ export declare class TestHost implements Transport {
|
|
|
2503
2497
|
/**
|
|
2504
2498
|
* Press a binding like the host's table would: panel-focus bindings first
|
|
2505
2499
|
* when `panel` is true, then global ones; within a scope the earliest
|
|
2506
|
-
* registration first (the player's own commands before the plugin's), as
|
|
2507
|
-
*
|
|
2508
|
-
*
|
|
2509
|
-
*
|
|
2510
|
-
*
|
|
2511
|
-
*
|
|
2512
|
-
*
|
|
2513
|
-
* `
|
|
2514
|
-
*
|
|
2515
|
-
*
|
|
2516
|
-
*
|
|
2517
|
-
*
|
|
2500
|
+
* registration first (the player's own commands before the plugin's), as the
|
|
2501
|
+
* conflict rule orders them. A disabled command lets the key pass to the next
|
|
2502
|
+
* command bound to it: the one it shadowed, then the global
|
|
2503
|
+
* scope. The first enabled one runs; `press` resolves after it ran (`"ran"`).
|
|
2504
|
+
* When only disabled commands hold the key, the first of them decides, as in
|
|
2505
|
+
* the player: with a `reason` it shows the reason on the OSD and eats the key
|
|
2506
|
+
* (`"reason"`, see `host.osd`); without one the key goes on to the focused
|
|
2507
|
+
* control (`"passed"`, nothing runs). Unlike the player, which only logs a
|
|
2508
|
+
* key that reaches a busy command, `press` then rejects, so a test notices.
|
|
2509
|
+
* Rejects when nothing is bound. Bindings use the reference syntax
|
|
2510
|
+
* (`"Space"`, `"Ctrl+O"`, `"Mouse:WheelUp"`), and user overrides in
|
|
2511
|
+
* `bindings.overlay` apply.
|
|
2518
2512
|
*
|
|
2519
2513
|
* @returns What the key did: `"ran"`, `"reason"` or `"passed"`.
|
|
2520
2514
|
*
|
|
@@ -2557,14 +2551,13 @@ export declare class TestHost implements Transport {
|
|
|
2557
2551
|
*/
|
|
2558
2552
|
get conflicts(): string[][];
|
|
2559
2553
|
/**
|
|
2560
|
-
* Change the keys of one of the plugin's commands, or of one of the
|
|
2561
|
-
*
|
|
2562
|
-
*
|
|
2563
|
-
*
|
|
2564
|
-
*
|
|
2565
|
-
*
|
|
2566
|
-
*
|
|
2567
|
-
* `plugin.commands.keys` reads changed, `commands.keys`.
|
|
2554
|
+
* Change the keys of one of the plugin's commands, or of one of the player's
|
|
2555
|
+
* core commands by its `host/<id>`, as the user does in Keyboard Shortcuts:
|
|
2556
|
+
* `inputs` replaces its keys (`[]` clears them, as Ignore Default Shortcuts
|
|
2557
|
+
* does for every default), `null` gives it its own defaults back. It writes
|
|
2558
|
+
* {@link TestHost.bindings | bindings.overlay}, and the plugin hears it as
|
|
2559
|
+
* from the player: `bindings.changed` and, when what `plugin.commands.keys`
|
|
2560
|
+
* reads changed, `commands.keys`.
|
|
2568
2561
|
*
|
|
2569
2562
|
* @example Check that a key hint follows a rebinding
|
|
2570
2563
|
* The view showed W for Brightness −; after the user moves it to
|
|
@@ -2637,17 +2630,15 @@ export declare class TestHost implements Transport {
|
|
|
2637
2630
|
replace?: boolean;
|
|
2638
2631
|
}[];
|
|
2639
2632
|
/**
|
|
2640
|
-
* Packages `validate` and `validateArchive` accept: path (directory or
|
|
2641
|
-
*
|
|
2642
|
-
*
|
|
2643
|
-
*
|
|
2644
|
-
*
|
|
2645
|
-
*
|
|
2646
|
-
* {@link "@vestra-player/sdk"!InstallOptions.enabled}: a first install
|
|
2647
|
-
*
|
|
2648
|
-
*
|
|
2649
|
-
* {@link TestHost.installKeepsDisabled} to `false` for the older players'
|
|
2650
|
-
* rule (every install runs).
|
|
2633
|
+
* Packages `validate` and `validateArchive` accept: path (directory or `.vxp`
|
|
2634
|
+
* file) → its manifest. Other paths fail with `missing`. `install` adds or
|
|
2635
|
+
* upgrades the entry in {@link TestHost.packages} following the player's
|
|
2636
|
+
* source rules: the same source upgrades, another source needs `replace`
|
|
2637
|
+
* (`conflict` otherwise), a built-in id is `unsupported`. The installed
|
|
2638
|
+
* entry's `state` follows
|
|
2639
|
+
* {@link "@vestra-player/sdk"!InstallOptions.enabled}: a first install runs,
|
|
2640
|
+
* an update of a `disabled` entry stays `disabled` unless `enabled` is
|
|
2641
|
+
* `true`, and `enabled: false` installs it `disabled`.
|
|
2651
2642
|
*
|
|
2652
2643
|
* @example Offer a package file the plugin can install
|
|
2653
2644
|
* The plugin can validate and install `/downloads/someone.demo-1.0.0.vxp`
|
|
@@ -2665,25 +2656,20 @@ export declare class TestHost implements Transport {
|
|
|
2665
2656
|
*/
|
|
2666
2657
|
readonly candidates: Map<string, PackageManifest>;
|
|
2667
2658
|
/**
|
|
2668
|
-
* Which
|
|
2669
|
-
*
|
|
2670
|
-
*
|
|
2671
|
-
*
|
|
2672
|
-
*
|
|
2673
|
-
*
|
|
2674
|
-
*
|
|
2675
|
-
* updates a disabled plugin sets it to `false`; one that keeps testing
|
|
2676
|
-
* both runs once with each.
|
|
2677
|
-
*
|
|
2678
|
-
* @example Keep a test written for players up to 0.6.3
|
|
2659
|
+
* Which install rule `packages.install` plays. `true` (default): an update
|
|
2660
|
+
* or reinstall keeps a `disabled` plugin disabled unless the plugin passes
|
|
2661
|
+
* {@link "@vestra-player/sdk"!InstallOptions.enabled}. `false`: every
|
|
2662
|
+
* install runs the plugin and `enabled` is ignored (it is still checked and
|
|
2663
|
+
* recorded in {@link TestHost.packageCalls}).
|
|
2664
|
+
*
|
|
2665
|
+
* @example Every install runs
|
|
2679
2666
|
* The plugin under test installs an update over a plugin the user
|
|
2680
|
-
* disabled and expects it to run afterwards
|
|
2681
|
-
*
|
|
2682
|
-
* where the update stays disabled.
|
|
2667
|
+
* disabled and expects it to run afterwards. With `false` the host plays
|
|
2668
|
+
* that rule; the default keeps the update disabled.
|
|
2683
2669
|
* ```ts
|
|
2684
2670
|
* declare const host: TestHost;
|
|
2685
2671
|
* // ---cut---
|
|
2686
|
-
* host.installKeepsDisabled = false; // every install runs
|
|
2672
|
+
* host.installKeepsDisabled = false; // every install runs
|
|
2687
2673
|
* ```
|
|
2688
2674
|
*
|
|
2689
2675
|
* @capability None.
|
|
@@ -2847,10 +2833,10 @@ export declare class TestHost implements Transport {
|
|
|
2847
2833
|
window(id: string): FakeWindow;
|
|
2848
2834
|
/**
|
|
2849
2835
|
* The plugin's mounted panel (bottom bar, sidebar, adjust column or
|
|
2850
|
-
* backdrop): the one in `slot`, or without it the only one (
|
|
2851
|
-
*
|
|
2852
|
-
*
|
|
2853
|
-
*
|
|
2836
|
+
* backdrop): the one in `slot`, or without it the only one (a plugin mounts
|
|
2837
|
+
* one panel per slot; with several, name the slot). Throws when there is
|
|
2838
|
+
* none. Its `props` use Slint (kebab-case) names; `emit` fires a callback on
|
|
2839
|
+
* the panel's global.
|
|
2854
2840
|
*
|
|
2855
2841
|
* @example Select a row in the plugin's sidebar panel
|
|
2856
2842
|
* The test checks the panel sits in the sidebar and selects its third
|
|
@@ -2899,12 +2885,12 @@ export declare class TestHost implements Transport {
|
|
|
2899
2885
|
* for: on a loaded machine it can finish after `settle()` returns. Poll
|
|
2900
2886
|
* the result you assert on instead (second example).
|
|
2901
2887
|
*
|
|
2902
|
-
* `settle()` does not wait for the SDK's once-a-second full update pass
|
|
2903
|
-
*
|
|
2904
|
-
*
|
|
2905
|
-
*
|
|
2906
|
-
* `plugin.update()`
|
|
2907
|
-
*
|
|
2888
|
+
* `settle()` does not wait for the SDK's once-a-second full update pass.
|
|
2889
|
+
* After `setSource` (or another player state change) only the bindings that
|
|
2890
|
+
* read a changed field of `plugin.player.state` run again; state the plugin
|
|
2891
|
+
* changed outside a handler without `plugin.update()` shows only in the next
|
|
2892
|
+
* full pass. Have the plugin call `plugin.update()` after such a change, or
|
|
2893
|
+
* wait `settle(1000)`.
|
|
2908
2894
|
*
|
|
2909
2895
|
* @param ms - Extra time to wait, for debounces and timers (default 0).
|
|
2910
2896
|
*
|
|
@@ -2967,19 +2953,17 @@ export declare class TestHost implements Transport {
|
|
|
2967
2953
|
*/
|
|
2968
2954
|
close(): void;
|
|
2969
2955
|
/**
|
|
2970
|
-
* Why the player would keep this plugin running while nothing uses it
|
|
2971
|
-
*
|
|
2972
|
-
*
|
|
2973
|
-
*
|
|
2974
|
-
*
|
|
2975
|
-
* player
|
|
2976
|
-
*
|
|
2977
|
-
*
|
|
2978
|
-
*
|
|
2979
|
-
*
|
|
2980
|
-
*
|
|
2981
|
-
* streams, jobs and the like (which also keep a plugin running) are not
|
|
2982
|
-
* listed.
|
|
2956
|
+
* Why the player would keep this plugin running while nothing uses it (lazy
|
|
2957
|
+
* activation), one line per reason: an event it listens to that is not one
|
|
2958
|
+
* the player wakes it for (with what listens and where it was added), its
|
|
2959
|
+
* panel in the bottom bar or the backdrop, its open windows (these as the
|
|
2960
|
+
* player's log says them), and its sidebar tab while that is the current tab.
|
|
2961
|
+
* The player counts the current tab as busy work, not as something live: it
|
|
2962
|
+
* keeps the plugin running only while the tab is shown, and a sidebar panel
|
|
2963
|
+
* in a background tab is no reason at all (the plugin may go to standby;
|
|
2964
|
+
* showing the tab starts it again). Empty: the player may stop it while idle
|
|
2965
|
+
* and start it again on its next use. Filter chains, streams, jobs and the
|
|
2966
|
+
* like (which also keep a plugin running) are not listed.
|
|
2983
2967
|
*
|
|
2984
2968
|
* @capability None.
|
|
2985
2969
|
* @since 1.5.40
|
|
@@ -3013,21 +2997,19 @@ export declare class TestHost implements Transport {
|
|
|
3013
2997
|
* Rejects when `manifest.json` cannot be read or parsed, when `activate`
|
|
3014
2998
|
* throws, or when a registration made during activation fails (for example
|
|
3015
2999
|
* `limit`, `conflict`, `invalid`). Stricter than the player's runner for
|
|
3016
|
-
* commands
|
|
3017
|
-
*
|
|
3018
|
-
*
|
|
3019
|
-
* bad declaration.
|
|
3000
|
+
* commands: there the SDK logs a command declaration the player refuses during
|
|
3001
|
+
* activation, skips it and activates the rest of the plugin (`onError` hears
|
|
3002
|
+
* it); `startPlugin` fails, so a test shows the bad declaration.
|
|
3020
3003
|
*
|
|
3021
3004
|
* @param activate - The plugin's default-exported `activate` function.
|
|
3022
3005
|
* @param options - Where the plugin lives and how to start it.
|
|
3023
3006
|
* @returns `host`: the {@link TestHost}; `plugin`: the object passed to
|
|
3024
|
-
*
|
|
3025
|
-
*
|
|
3026
|
-
*
|
|
3027
|
-
*
|
|
3028
|
-
*
|
|
3029
|
-
*
|
|
3030
|
-
* temporary files never fails a test.
|
|
3007
|
+
* `activate` (call the plugin API on it directly); `stop()`: dispose the plugin
|
|
3008
|
+
* like the player stopping it (scopes released, stores flushed), wait until the
|
|
3009
|
+
* host is idle and remove the host's temporary files; `stop({ reason })`:
|
|
3010
|
+
* `reason` is the `StopReason` the player sends; `disconnect()` stops it as
|
|
3011
|
+
* when the player is lost (`host-lost`, requests refused with `disabled`).
|
|
3012
|
+
* Removing the temporary files never fails a test.
|
|
3031
3013
|
*
|
|
3032
3014
|
* @example Test that a setting survives a restart
|
|
3033
3015
|
* The test turns on the 10-step option, stops the plugin, starts it again
|
|
@@ -3075,7 +3057,7 @@ export declare class TestHost implements Transport {
|
|
|
3075
3057
|
* to call directly, and `stop` to end it like the player.
|
|
3076
3058
|
*
|
|
3077
3059
|
* @capability None.
|
|
3078
|
-
* @see [Test a plugin](../../../docs/
|
|
3060
|
+
* @see [Test a plugin](../../../docs/guides/testing.md)
|
|
3079
3061
|
* @since 1.0.0
|
|
3080
3062
|
* @category Testing
|
|
3081
3063
|
*/
|
|
@@ -3118,11 +3100,11 @@ export declare function startPlugin(activate: (plugin: Plugin) => unknown, optio
|
|
|
3118
3100
|
plugin: Plugin;
|
|
3119
3101
|
/**
|
|
3120
3102
|
* Stop the plugin, wait for the host, and remove temporary files.
|
|
3121
|
-
* `stop({ reason })
|
|
3122
|
-
*
|
|
3123
|
-
*
|
|
3124
|
-
*
|
|
3125
|
-
*
|
|
3103
|
+
* `stop({ reason })`: `reason` is the reason the player gives
|
|
3104
|
+
* (`plugin.stopReason`, the `onDispose` cleanups' `info.reason`); `stop()`:
|
|
3105
|
+
* none (`undefined`). It still
|
|
3106
|
+
* takes no declared parameter, so it can be passed as a callback
|
|
3107
|
+
* (`t.after(stop)`, `promise.then(stop)`).
|
|
3126
3108
|
*/
|
|
3127
3109
|
stop: {
|
|
3128
3110
|
(): Promise<void>;
|
|
@@ -3131,10 +3113,10 @@ export declare function startPlugin(activate: (plugin: Plugin) => unknown, optio
|
|
|
3131
3113
|
}): Promise<void>;
|
|
3132
3114
|
};
|
|
3133
3115
|
/**
|
|
3134
|
-
* Lose the player
|
|
3135
|
-
*
|
|
3136
|
-
*
|
|
3137
|
-
*
|
|
3116
|
+
* Lose the player: as when it crashes or is killed, the runner stops the
|
|
3117
|
+
* plugin with reason `host-lost`; requests still waiting for their answer
|
|
3118
|
+
* and every later request are refused with `disabled`. Then waits and
|
|
3119
|
+
* removes the temporary files like `stop`.
|
|
3138
3120
|
*/
|
|
3139
3121
|
disconnect(): Promise<void>;
|
|
3140
3122
|
}>;
|