@vestra-player/sdk 1.8.0 → 1.9.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/CHANGELOG.md +40 -0
- package/README.md +2 -2
- package/bin/vestra-plugin.mjs +11 -100
- package/capability-scan.json +3 -1
- package/dist/api-requests.d.ts +11 -36
- package/dist/api-requests.js +18 -47
- package/dist/capability-scan.d.ts +1 -1
- package/dist/capability-scan.js +8 -9
- package/dist/docs-tree.json.gz +0 -0
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/manifest.d.ts +5 -0
- package/dist/manifest.js +9 -24
- package/dist/member-uses.d.ts +61 -0
- package/dist/member-uses.js +160 -0
- package/dist/player-runtime.d.ts +1 -2
- package/dist/player-runtime.js +1 -2
- package/dist/plugin/appearance.d.ts +1 -1
- package/dist/plugin/appearance.js +2 -2
- package/dist/plugin/bindings.d.ts +1 -1
- package/dist/plugin/bindings.js +2 -2
- package/dist/plugin/commands.js +1 -12
- package/dist/plugin/connection.d.ts +26 -7
- package/dist/plugin/connection.js +68 -36
- package/dist/plugin/drops.js +1 -1
- package/dist/plugin/index.js +9 -15
- package/dist/plugin/media.js +0 -12
- package/dist/plugin/mpv.js +0 -7
- package/dist/plugin/packages.js +1 -2
- package/dist/plugin/player/events.d.ts +4 -3
- package/dist/plugin/player/events.js +7 -6
- package/dist/plugin/player.d.ts +21 -13
- package/dist/plugin/player.js +56 -21
- package/dist/plugin/services.d.ts +4 -4
- package/dist/plugin/services.js +7 -29
- package/dist/plugin/settings.js +1 -1
- package/dist/plugin/shaders.js +0 -2
- package/dist/plugin/stream.d.ts +2 -1
- package/dist/plugin/stream.js +2 -2
- package/dist/plugin/testing/commands.d.ts +3 -10
- package/dist/plugin/testing/commands.js +6 -15
- package/dist/plugin/testing/index.d.ts +26 -116
- package/dist/plugin/testing/index.js +30 -104
- package/dist/plugin/testing/processing.js +1 -1
- package/dist/plugin/testing/services.js +0 -1
- package/dist/plugin/timeline.d.ts +2 -3
- package/dist/plugin/timeline.js +4 -8
- package/dist/plugin/types/base.d.ts +40 -86
- package/dist/plugin/types/commands.d.ts +10 -67
- package/dist/plugin/types/packages.d.ts +17 -55
- package/dist/plugin/types/playback.d.ts +126 -144
- package/dist/plugin/types/plugin-wire.d.ts +6 -36
- package/dist/plugin/types/processing.d.ts +10 -49
- package/dist/plugin/types/services.d.ts +11 -70
- package/dist/plugin/types/snapshots.d.ts +7 -60
- package/dist/plugin/types/sources.d.ts +2 -11
- package/dist/plugin/types/subtitles.d.ts +5 -26
- package/dist/plugin/types/ui-content.d.ts +1 -16
- package/dist/plugin/types/ui-layout.d.ts +53 -79
- package/dist/plugin/types/ui-locale.d.ts +5 -23
- package/dist/plugin/types/ui-shell.d.ts +13 -59
- package/dist/plugin/view/layout.js +1 -1
- package/dist/plugin/view.js +0 -2
- package/dist/plugin/window.d.ts +1 -1
- package/dist/plugin/window.js +1 -1
- package/dist/plugin/wire-facade.js +1 -2
- package/dist/processing.d.ts +2 -3
- package/dist/protocol.d.ts +14 -0
- package/dist/protocol.js +14 -0
- package/dist/request-queue.js +1 -1
- package/dist/subtitles.d.ts +1 -1
- package/dist/ts-plugin.d.ts +8 -15
- package/dist/ts-plugin.js +3 -141
- package/dist/wire.d.ts +7 -12
- package/dist/wire.js +6 -8
- package/llms.txt +4 -4
- package/package.json +1 -2
- package/dist/capabilities.d.ts +0 -107
- package/dist/capabilities.js +0 -69
- package/dist/capability-check.d.ts +0 -176
- package/dist/capability-check.js +0 -461
- package/dist/capability-rules.d.ts +0 -125
- package/dist/capability-rules.js +0 -192
- package/dist/host-capabilities.d.ts +0 -10
- package/dist/host-capabilities.js +0 -492
|
@@ -4,8 +4,7 @@ import type { PackageManifest, PackageSource } from "../types.ts";
|
|
|
4
4
|
import type { Json, LayoutSlot, LocalServices, PlaybackStats, Transport, WireSystemInfo } from "../../wire.ts";
|
|
5
5
|
import { BAR_BUTTON_ICONS, BAR_BUTTON_LIMITS, BUILTIN_COMMANDS, BUILTIN_SUBMENUS, COMMAND_LIMITS, MENU_IDS } from "../../commands.ts";
|
|
6
6
|
import type { BuiltinCommand, BuiltinSubmenu } from "../../commands.ts";
|
|
7
|
-
import {
|
|
8
|
-
import type { CapabilityInfo } from "../../capabilities.ts";
|
|
7
|
+
import { MESSAGE_LIMIT } from "../../protocol.ts";
|
|
9
8
|
import { OSD_LIMITS } from "../osd.ts";
|
|
10
9
|
import { TIMELINE_LIMITS } from "../timeline.ts";
|
|
11
10
|
import { SECRET_LIMITS, SESSION_STORAGE_LIMITS } from "../services.ts";
|
|
@@ -30,9 +29,6 @@ export { BAR_BUTTON_ICONS, BAR_BUTTON_LIMITS };
|
|
|
30
29
|
/** The submenus of the player's built-in plugins, by key path. */
|
|
31
30
|
export { BUILTIN_COMMANDS, BUILTIN_SUBMENUS };
|
|
32
31
|
export type { BuiltinCommand, BuiltinSubmenu };
|
|
33
|
-
/** The manifest capabilities: what each opens and how the store shows it. */
|
|
34
|
-
export { CAPABILITY_INFO };
|
|
35
|
-
export type { CapabilityInfo };
|
|
36
32
|
/** The longest message a plugin may send the player. */
|
|
37
33
|
export { MESSAGE_LIMIT };
|
|
38
34
|
/** The player's limits on the on-screen display. */
|
|
@@ -132,7 +128,6 @@ type Call = {
|
|
|
132
128
|
* callback the way the user's input would; `userClose` closes it the way
|
|
133
129
|
* the title-bar button would.
|
|
134
130
|
*
|
|
135
|
-
* @capability None.
|
|
136
131
|
* @since 1.0.0
|
|
137
132
|
* @category Testing
|
|
138
133
|
*/
|
|
@@ -154,8 +149,6 @@ export interface FakeWindow {
|
|
|
154
149
|
* name may be kebab-case or camelCase; `args` are the callback arguments.
|
|
155
150
|
* Follow it with `await host.settle()` before asserting.
|
|
156
151
|
*
|
|
157
|
-
* @capability None.
|
|
158
|
-
*
|
|
159
152
|
* @example Type into a window's search field
|
|
160
153
|
* The test types "cat" into the window's search box and checks the
|
|
161
154
|
* plugin's results. `emit` delivers the Slint callback `search-changed`
|
|
@@ -179,8 +172,6 @@ export interface FakeWindow {
|
|
|
179
172
|
* and the plugin's `window.onClose` listeners run (unlike the plugin's own
|
|
180
173
|
* `close()`).
|
|
181
174
|
*
|
|
182
|
-
* @capability None.
|
|
183
|
-
*
|
|
184
175
|
* @example Close a window the way the user does
|
|
185
176
|
* The test closes the plugin's window with its title-bar button and checks
|
|
186
177
|
* that the plugin stopped its timer. Unlike the plugin's own `close()`,
|
|
@@ -241,7 +232,6 @@ export interface FileDialogText {
|
|
|
241
232
|
* Read it again after `settle()` to see changes; `run` executes it as the
|
|
242
233
|
* menu would.
|
|
243
234
|
*
|
|
244
|
-
* @capability None.
|
|
245
235
|
* @since 1.0.0
|
|
246
236
|
* @category Testing
|
|
247
237
|
*/
|
|
@@ -322,7 +312,6 @@ export interface FakeCommand {
|
|
|
322
312
|
* idle. Rejects (with a {@link HostError}) when the command is disabled or
|
|
323
313
|
* busy, like the player, which does not call `run` then.
|
|
324
314
|
*
|
|
325
|
-
* @capability None.
|
|
326
315
|
* @throws `command` (rejects) A `HostError`: the command is disabled or
|
|
327
316
|
* busy (the message says which).
|
|
328
317
|
*
|
|
@@ -353,8 +342,6 @@ export interface FakeCommand {
|
|
|
353
342
|
* the command is enabled and not busy, accent-coloured while checked, with
|
|
354
343
|
* the command's title (and reason) as the tooltip.
|
|
355
344
|
*
|
|
356
|
-
* @capability None.
|
|
357
|
-
*
|
|
358
345
|
* @example Check a bar button's tooltip while it is disabled
|
|
359
346
|
* The test checks that the Export button shows why it cannot be clicked.
|
|
360
347
|
* The tooltip is the command's title; while the command is disabled or
|
|
@@ -393,7 +380,6 @@ export interface FakeBarButton {
|
|
|
393
380
|
* as its menu item would. Rejects (with a {@link HostError}) while the
|
|
394
381
|
* button is disabled, and once the command is gone.
|
|
395
382
|
*
|
|
396
|
-
* @capability None.
|
|
397
383
|
* @throws `command` (rejects) A `HostError`: the command is disabled or
|
|
398
384
|
* busy.
|
|
399
385
|
* @throws `missing` (rejects) A `HostError`: the command is gone.
|
|
@@ -424,8 +410,6 @@ export interface FakeBarButton {
|
|
|
424
410
|
* plugin released it or the player retired it. Tests assert on it; nothing
|
|
425
411
|
* is played.
|
|
426
412
|
*
|
|
427
|
-
* @capability None.
|
|
428
|
-
*
|
|
429
413
|
* @example Check that the stream delivers frames
|
|
430
414
|
* The test starts the plugin's generator and checks that video and audio
|
|
431
415
|
* arrive. The counters grow as the SDK pulls frames and sends them over
|
|
@@ -499,7 +483,6 @@ export interface MarkdownWire {
|
|
|
499
483
|
* const panel: FakePanel = host.mounted("adjust");
|
|
500
484
|
* assert.deepEqual(panel.locks, { focused: false, dragging: true, popupOpen: false });
|
|
501
485
|
* ```n *
|
|
502
|
-
* @capability None.
|
|
503
486
|
* @since 1.6.15
|
|
504
487
|
* @category Testing
|
|
505
488
|
*/
|
|
@@ -585,7 +568,6 @@ export type FakePanel = Omit<FakeWindow, "callbacks" | "userClose"> & {
|
|
|
585
568
|
* {@link startPlugin}, drive it, `settle()`, and assert on what it
|
|
586
569
|
* recorded.
|
|
587
570
|
*
|
|
588
|
-
* @capability None.
|
|
589
571
|
* @see [Test a plugin](../../../docs/guides/testing.md)
|
|
590
572
|
* @since 1.0.0
|
|
591
573
|
* @category Testing
|
|
@@ -597,7 +579,7 @@ export declare class TestHost implements Transport {
|
|
|
597
579
|
* Wire-level; prefer {@link TestHost.sent} for one method.
|
|
598
580
|
*/
|
|
599
581
|
readonly calls: Call[];
|
|
600
|
-
/** The host events the plugin subscribed to
|
|
582
|
+
/** The host events the plugin subscribed to. */
|
|
601
583
|
readonly subscriptions: Set<string>;
|
|
602
584
|
/**
|
|
603
585
|
* The subscribed events the plugin really listens to: an `onChange` and
|
|
@@ -719,7 +701,6 @@ export declare class TestHost implements Transport {
|
|
|
719
701
|
* await host.pressOsdAction(0); // runs the plugin's `reveal` command
|
|
720
702
|
* ```
|
|
721
703
|
*
|
|
722
|
-
* @capability None.
|
|
723
704
|
* @since 1.6.9
|
|
724
705
|
*/
|
|
725
706
|
pressOsdAction(index: number): Promise<void>;
|
|
@@ -768,8 +749,6 @@ export declare class TestHost implements Transport {
|
|
|
768
749
|
* @param directory - The package directory (holding `locales/`).
|
|
769
750
|
* @since 1.5.9
|
|
770
751
|
*
|
|
771
|
-
* @capability None.
|
|
772
|
-
*
|
|
773
752
|
* @example Load the translations after changing the language
|
|
774
753
|
* The test switches the host to German before starting the plugin and
|
|
775
754
|
* loads that catalog itself (`startPlugin` does the same). Texts are then
|
|
@@ -804,8 +783,6 @@ export declare class TestHost implements Transport {
|
|
|
804
783
|
* ```
|
|
805
784
|
*
|
|
806
785
|
* @since 1.5.9
|
|
807
|
-
*
|
|
808
|
-
* @capability None.
|
|
809
786
|
*/
|
|
810
787
|
translate(text: TextValue, args?: TemplateArgs): string;
|
|
811
788
|
/**
|
|
@@ -822,11 +799,9 @@ export declare class TestHost implements Transport {
|
|
|
822
799
|
* @param language - `"system"` or a locale.
|
|
823
800
|
* @since 1.5.9
|
|
824
801
|
*
|
|
825
|
-
* @capability None.
|
|
826
|
-
*
|
|
827
802
|
* @example Simulate the user choosing French for the next start
|
|
828
803
|
* The plugin hears that the saved interface language changed. The host
|
|
829
|
-
* pushes `appearance.changed`, which a plugin
|
|
804
|
+
* pushes `appearance.changed`, which a plugin sees (after `plugin.player.subscribe()`) in
|
|
830
805
|
* `appearance.language` once it has read it and subscribed; this run's
|
|
831
806
|
* language does not change.
|
|
832
807
|
* ```ts
|
|
@@ -1072,7 +1047,6 @@ export declare class TestHost implements Transport {
|
|
|
1072
1047
|
* assert.equal(plugin.timeline.ranges[0]?.plugin, "community.clips");
|
|
1073
1048
|
* ```
|
|
1074
1049
|
*
|
|
1075
|
-
* @capability None.
|
|
1076
1050
|
* @since 1.6.9
|
|
1077
1051
|
*/
|
|
1078
1052
|
setTimelineRanges(pluginId: string, ranges: {
|
|
@@ -1091,8 +1065,8 @@ export declare class TestHost implements Transport {
|
|
|
1091
1065
|
* @example Let another plugin publish chapters
|
|
1092
1066
|
* The plugin under test sees two chapter marks another plugin put on the
|
|
1093
1067
|
* timeline. `setTimelineLayer` stores that plugin's whole layer and pushes
|
|
1094
|
-
* `timeline.changed`; once the plugin uses `plugin.timeline` (
|
|
1095
|
-
* `
|
|
1068
|
+
* `timeline.changed`; once the plugin uses `plugin.timeline` (after
|
|
1069
|
+
* `plugin.player.subscribe()`) the SDK keeps `marks` current from that event, and `settle()`
|
|
1096
1070
|
* lets it arrive.
|
|
1097
1071
|
* ```ts
|
|
1098
1072
|
* import assert from "node:assert/strict";
|
|
@@ -1106,7 +1080,6 @@ export declare class TestHost implements Transport {
|
|
|
1106
1080
|
* assert.equal(plugin.timeline.marks.length, 2);
|
|
1107
1081
|
* ```
|
|
1108
1082
|
*
|
|
1109
|
-
* @capability None.
|
|
1110
1083
|
* @since 1.0.0
|
|
1111
1084
|
*/
|
|
1112
1085
|
setTimelineLayer(pluginId: string, marks: {
|
|
@@ -1149,7 +1122,6 @@ export declare class TestHost implements Transport {
|
|
|
1149
1122
|
* );
|
|
1150
1123
|
* ```
|
|
1151
1124
|
*
|
|
1152
|
-
* @capability None.
|
|
1153
1125
|
* @since 1.0.0
|
|
1154
1126
|
*/
|
|
1155
1127
|
imagePath(value: Json | undefined): string | null;
|
|
@@ -1192,7 +1164,6 @@ export declare class TestHost implements Transport {
|
|
|
1192
1164
|
* });
|
|
1193
1165
|
* ```
|
|
1194
1166
|
*
|
|
1195
|
-
* @capability None.
|
|
1196
1167
|
* @throws Never: files nobody takes are ignored, as in the player.
|
|
1197
1168
|
* @since 1.0.0
|
|
1198
1169
|
*/
|
|
@@ -1214,17 +1185,15 @@ export declare class TestHost implements Transport {
|
|
|
1214
1185
|
* Simulate another plugin switching the palette: updates
|
|
1215
1186
|
* {@link TestHost.appearance} and pushes `appearance.changed`.
|
|
1216
1187
|
*
|
|
1217
|
-
* @capability None.
|
|
1218
|
-
*
|
|
1219
1188
|
* @example Simulate another plugin switching to the light palette
|
|
1220
1189
|
* The plugin hears the palette change. The host updates `appearance` and
|
|
1221
|
-
* pushes `appearance.changed` to a plugin that listens
|
|
1190
|
+
* pushes `appearance.changed` to a plugin that listens (after `plugin.player.subscribe()`).
|
|
1222
1191
|
* ```ts
|
|
1223
1192
|
* import assert from "node:assert/strict";
|
|
1224
1193
|
* declare const host: TestHost;
|
|
1225
1194
|
* // ---cut---
|
|
1226
1195
|
* const themes: string[] = [];
|
|
1227
|
-
* plugin.player.on("appearance.changed", ({ theme }) => themes.push(theme)); // subscribes
|
|
1196
|
+
* plugin.player.on("appearance.changed", ({ theme }) => themes.push(theme)); // subscribes
|
|
1228
1197
|
* host.setAppearance("vestra-light");
|
|
1229
1198
|
* await host.settle();
|
|
1230
1199
|
* assert.deepEqual(themes, ["vestra-light"]);
|
|
@@ -1282,7 +1251,6 @@ export declare class TestHost implements Transport {
|
|
|
1282
1251
|
* assert.equal(page.props["step"], 10);
|
|
1283
1252
|
* ```
|
|
1284
1253
|
*
|
|
1285
|
-
* @capability None.
|
|
1286
1254
|
* @since 1.0.0
|
|
1287
1255
|
*/
|
|
1288
1256
|
settingsPage(id: string): {
|
|
@@ -1314,8 +1282,6 @@ export declare class TestHost implements Transport {
|
|
|
1314
1282
|
* Simulate the backdrop's `effective` changing (`false`: a video frame
|
|
1315
1283
|
* appeared; `true`: there is none again); pushed to the plugin.
|
|
1316
1284
|
*
|
|
1317
|
-
* @capability None.
|
|
1318
|
-
*
|
|
1319
1285
|
* @example Make a video picture replace the backdrop
|
|
1320
1286
|
* The plugin's backdrop hears that a video frame now covers it. `false`
|
|
1321
1287
|
* means a picture appeared; the change is pushed like the player's
|
|
@@ -1362,8 +1328,6 @@ export declare class TestHost implements Transport {
|
|
|
1362
1328
|
* ```
|
|
1363
1329
|
*
|
|
1364
1330
|
* @since 1.5.2
|
|
1365
|
-
*
|
|
1366
|
-
* @capability None.
|
|
1367
1331
|
*/
|
|
1368
1332
|
mountOther(slot: "bottom" | "sidebar" | "adjust" | "backdrop", plugin: string, options?: {
|
|
1369
1333
|
title?: string;
|
|
@@ -1374,8 +1338,6 @@ export declare class TestHost implements Transport {
|
|
|
1374
1338
|
*
|
|
1375
1339
|
* @since 1.5.2
|
|
1376
1340
|
*
|
|
1377
|
-
* @capability None.
|
|
1378
|
-
*
|
|
1379
1341
|
* @example Let the playlist's tab go away
|
|
1380
1342
|
* The other plugin's sidebar tab disappears and the plugin's own tab
|
|
1381
1343
|
* becomes current. When the removed tab was current, the next tab (else
|
|
@@ -1397,8 +1359,6 @@ export declare class TestHost implements Transport {
|
|
|
1397
1359
|
*
|
|
1398
1360
|
* @since 1.5.2
|
|
1399
1361
|
*
|
|
1400
|
-
* @capability None.
|
|
1401
|
-
*
|
|
1402
1362
|
* @example Click another plugin's sidebar tab
|
|
1403
1363
|
* The user switches the sidebar to the playlist; the plugin's panel is in
|
|
1404
1364
|
* a background tab now. The change is pushed as `window.state`.
|
|
@@ -1427,8 +1387,6 @@ export declare class TestHost implements Transport {
|
|
|
1427
1387
|
* `video.view()` then fails with `conflict`), or, with `null`, releasing
|
|
1428
1388
|
* it (values reset to the defaults).
|
|
1429
1389
|
*
|
|
1430
|
-
* @capability None.
|
|
1431
|
-
*
|
|
1432
1390
|
* @example Let another plugin own the display layer
|
|
1433
1391
|
* The plugin's `video.view()` fails with `conflict` because another plugin
|
|
1434
1392
|
* took the display layer first. `null` releases it again.
|
|
@@ -1467,8 +1425,6 @@ export declare class TestHost implements Transport {
|
|
|
1467
1425
|
* `video.render()` then fails with `conflict`), or, with `null`, releasing
|
|
1468
1426
|
* them (values reset to the defaults).
|
|
1469
1427
|
*
|
|
1470
|
-
* @capability None.
|
|
1471
|
-
*
|
|
1472
1428
|
* @example Let another plugin own the render options
|
|
1473
1429
|
* The plugin's render options report `conflict` while another plugin owns
|
|
1474
1430
|
* them; `null` releases them and resets the values to the defaults.
|
|
@@ -1512,7 +1468,6 @@ export declare class TestHost implements Transport {
|
|
|
1512
1468
|
* assert.equal(render.status.state, "failed");
|
|
1513
1469
|
* ```
|
|
1514
1470
|
*
|
|
1515
|
-
* @capability None.
|
|
1516
1471
|
* @since 1.0.0
|
|
1517
1472
|
*/
|
|
1518
1473
|
failVideoRender(code: "failed" | "unsupported" | "previous-crash", message: string): void;
|
|
@@ -1553,8 +1508,6 @@ export declare class TestHost implements Transport {
|
|
|
1553
1508
|
* player never pushes it, it refuses the `set` request itself after
|
|
1554
1509
|
* an abnormal end. To test that, set {@link TestHost.previousCrash}.
|
|
1555
1510
|
*
|
|
1556
|
-
* @capability None.
|
|
1557
|
-
*
|
|
1558
1511
|
* @example Make the plugin's shader fail to compile
|
|
1559
1512
|
* The plugin's shader handle reports `failed`, as when mpv rejects a
|
|
1560
1513
|
* shader. The host pushes the failure only to a handle that holds
|
|
@@ -1858,8 +1811,6 @@ export declare class TestHost implements Transport {
|
|
|
1858
1811
|
* plugin's file resolvers and of {@link TestHost.otherResolvers}, sorted,
|
|
1859
1812
|
* each once.
|
|
1860
1813
|
*
|
|
1861
|
-
* @capability None.
|
|
1862
|
-
*
|
|
1863
1814
|
* @example Check the file types a resolver adds
|
|
1864
1815
|
* The test checks the list the plugin will hear in
|
|
1865
1816
|
* `resolvers.fileTypes`: the extensions of its own file resolvers and of
|
|
@@ -1891,7 +1842,7 @@ export declare class TestHost implements Transport {
|
|
|
1891
1842
|
* declare const host: TestHost;
|
|
1892
1843
|
* // ---cut---
|
|
1893
1844
|
* const heard: string[][] = [];
|
|
1894
|
-
* // A listener of the event
|
|
1845
|
+
* // A listener of the event: each list the player sends.
|
|
1895
1846
|
* plugin.player.on("resolvers.fileTypes", ({ fileTypes }) => heard.push(fileTypes));
|
|
1896
1847
|
* // Another plugin starts with a resolver for .ch8 files.
|
|
1897
1848
|
* host.otherResolvers.push({ owner: "example.emulator", extensions: ["ch8"] });
|
|
@@ -1900,7 +1851,6 @@ export declare class TestHost implements Transport {
|
|
|
1900
1851
|
* assert.deepEqual(heard, [["ch8"]]);
|
|
1901
1852
|
* ```
|
|
1902
1853
|
*
|
|
1903
|
-
* @capability None.
|
|
1904
1854
|
* @since 1.5.8
|
|
1905
1855
|
*/
|
|
1906
1856
|
updateFileTypes(): void;
|
|
@@ -2020,8 +1970,6 @@ export declare class TestHost implements Transport {
|
|
|
2020
1970
|
* @param name - The property, as mpv names it.
|
|
2021
1971
|
* @param value - Its new value.
|
|
2022
1972
|
*
|
|
2023
|
-
* @capability None.
|
|
2024
|
-
*
|
|
2025
1973
|
* @example The frame rate behind the filters changes
|
|
2026
1974
|
* The plugin's listener hears the value the test gives the property.
|
|
2027
1975
|
* `setMpvProperty` stores it and sends the `mpv.property` event that
|
|
@@ -2247,7 +2195,6 @@ export declare class TestHost implements Transport {
|
|
|
2247
2195
|
* assert.match(String(host.window("upscale").props.blocker), /Picture Adjustments/);
|
|
2248
2196
|
* ```
|
|
2249
2197
|
*
|
|
2250
|
-
* @capability None.
|
|
2251
2198
|
* @since 1.5.43
|
|
2252
2199
|
*/
|
|
2253
2200
|
upscalingDecoding(cause: UpscalingDecodingCause, plugins?: readonly UpscalingPlugin[]): UpscalingReason;
|
|
@@ -2257,8 +2204,6 @@ export declare class TestHost implements Transport {
|
|
|
2257
2204
|
* plugin listening with `plugin.video.upscaling.onChange` receives it.
|
|
2258
2205
|
* Nothing reaches a plugin that does not listen.
|
|
2259
2206
|
*
|
|
2260
|
-
* @capability None.
|
|
2261
|
-
*
|
|
2262
2207
|
* @example Show the new factor in the plugin's window
|
|
2263
2208
|
* The window resized: the test changes the area and the factor, sends
|
|
2264
2209
|
* the change, and checks that the plugin's window shows the new factor.
|
|
@@ -2337,8 +2282,6 @@ export declare class TestHost implements Transport {
|
|
|
2337
2282
|
* plugin listening with `plugin.video.motion("amd").onChange` receives it.
|
|
2338
2283
|
* Nothing reaches a plugin that does not listen.
|
|
2339
2284
|
*
|
|
2340
|
-
* @capability None.
|
|
2341
|
-
*
|
|
2342
2285
|
* @example The GPU fell behind
|
|
2343
2286
|
* The player turned the converter off for this video; the plugin's
|
|
2344
2287
|
* panel shows the reason.
|
|
@@ -2455,9 +2398,9 @@ export declare class TestHost implements Transport {
|
|
|
2455
2398
|
readonly coreRuns: string[];
|
|
2456
2399
|
/**
|
|
2457
2400
|
* The plugin is built into the player (`startPlugin`'s `builtin`). Only
|
|
2458
|
-
* then does the host
|
|
2459
|
-
* (`commands.run`, `palette.lead
|
|
2460
|
-
* `capability`, as in the player.
|
|
2401
|
+
* then does the host answer the built-in-only requests
|
|
2402
|
+
* (`commands.list`, `commands.run`, `palette.lead.*`); otherwise they
|
|
2403
|
+
* fail with `capability`, as in the player.
|
|
2461
2404
|
*
|
|
2462
2405
|
* @since 1.7.9
|
|
2463
2406
|
*/
|
|
@@ -2513,7 +2456,6 @@ export declare class TestHost implements Transport {
|
|
|
2513
2456
|
* await stop();
|
|
2514
2457
|
* ```
|
|
2515
2458
|
*
|
|
2516
|
-
* @capability None.
|
|
2517
2459
|
* @throws `Error` without a code (rejects) The plugin has no lead row.
|
|
2518
2460
|
* @since 1.7.9
|
|
2519
2461
|
*/
|
|
@@ -2544,7 +2486,6 @@ export declare class TestHost implements Transport {
|
|
|
2544
2486
|
* assert.deepEqual(host.coreRuns, ["play-pause"]);
|
|
2545
2487
|
* ```
|
|
2546
2488
|
*
|
|
2547
|
-
* @capability None.
|
|
2548
2489
|
* @since 1.0.0
|
|
2549
2490
|
*/
|
|
2550
2491
|
coreAction(id: string): FakeCommand;
|
|
@@ -2588,15 +2529,12 @@ export declare class TestHost implements Transport {
|
|
|
2588
2529
|
* host.reset("system.openPath");
|
|
2589
2530
|
* ```
|
|
2590
2531
|
*
|
|
2591
|
-
* @capability None.
|
|
2592
2532
|
* @since 1.0.0
|
|
2593
2533
|
*/
|
|
2594
2534
|
handle(method: string, handler: Handler): void;
|
|
2595
2535
|
/**
|
|
2596
2536
|
* Restore the default behaviour of a method replaced with {@link TestHost.handle}.
|
|
2597
2537
|
*
|
|
2598
|
-
* @capability None.
|
|
2599
|
-
*
|
|
2600
2538
|
* @example Restore the default answer after a simulated failure
|
|
2601
2539
|
* The first write fails, the second succeeds. `reset` removes the handler
|
|
2602
2540
|
* that `handle` installed, so the method is answered by the test host
|
|
@@ -2620,14 +2558,12 @@ export declare class TestHost implements Transport {
|
|
|
2620
2558
|
* Deliver a host event to the plugin. Like the player, subscription-based
|
|
2621
2559
|
* events (`source.state`, `playback.backend`, `window.state`,
|
|
2622
2560
|
* `timeline.changed`, `appearance.changed`) are delivered only when the
|
|
2623
|
-
* plugin subscribed (it
|
|
2561
|
+
* plugin subscribed (it called `plugin.player.subscribe()` and listens). Most tests use the
|
|
2624
2562
|
* higher-level helpers (`setSource`, `setMainWindow`, ...) instead.
|
|
2625
2563
|
*
|
|
2626
2564
|
* @param event - The wire event name.
|
|
2627
2565
|
* @param data - The event payload (wire-level shape).
|
|
2628
2566
|
*
|
|
2629
|
-
* @capability None.
|
|
2630
|
-
*
|
|
2631
2567
|
* @example Deliver a raw event the helpers do not cover
|
|
2632
2568
|
* The test pushes a `window.state` event after changing `layout` by hand.
|
|
2633
2569
|
* Like the player, the host delivers it only when the plugin subscribed;
|
|
@@ -2674,7 +2610,6 @@ export declare class TestHost implements Transport {
|
|
|
2674
2610
|
* await host.settle();
|
|
2675
2611
|
* ```
|
|
2676
2612
|
*
|
|
2677
|
-
* @capability None.
|
|
2678
2613
|
* @since 1.0.0
|
|
2679
2614
|
*/
|
|
2680
2615
|
setSource(patch: Partial<SourceState>): void;
|
|
@@ -2707,7 +2642,6 @@ export declare class TestHost implements Transport {
|
|
|
2707
2642
|
* assert.equal(plugin.window.state.maximized, true);
|
|
2708
2643
|
* ```
|
|
2709
2644
|
*
|
|
2710
|
-
* @capability None.
|
|
2711
2645
|
* @since 1.0.0
|
|
2712
2646
|
*/
|
|
2713
2647
|
setMainWindow(patch: Partial<{
|
|
@@ -2728,8 +2662,6 @@ export declare class TestHost implements Transport {
|
|
|
2728
2662
|
* those switched on, pop out or collapse (reference §6.3). No effect outside
|
|
2729
2663
|
* fullscreen, or on a column switched off or floating.
|
|
2730
2664
|
*
|
|
2731
|
-
* @capability None.
|
|
2732
|
-
*
|
|
2733
2665
|
* @example Pop the sidebar out in fullscreen
|
|
2734
2666
|
* The pointer reaches the right edge in fullscreen and the attached
|
|
2735
2667
|
* sidebar pops out over the video. Outside fullscreen, or with the
|
|
@@ -2769,7 +2701,6 @@ export declare class TestHost implements Transport {
|
|
|
2769
2701
|
* assert.equal(plugin.player.isCurrent(before), false);
|
|
2770
2702
|
* ```
|
|
2771
2703
|
*
|
|
2772
|
-
* @capability None.
|
|
2773
2704
|
* @since 1.0.0
|
|
2774
2705
|
*/
|
|
2775
2706
|
openElsewhere(source: string, phase?: SourceState["phase"]): void;
|
|
@@ -2794,7 +2725,6 @@ export declare class TestHost implements Transport {
|
|
|
2794
2725
|
* host.failStream(producer!.id, "producer transport closed");
|
|
2795
2726
|
* ```
|
|
2796
2727
|
*
|
|
2797
|
-
* @capability None.
|
|
2798
2728
|
* @since 1.5.7
|
|
2799
2729
|
*/
|
|
2800
2730
|
failStream(producerId: number, message: string): void;
|
|
@@ -2828,7 +2758,6 @@ export declare class TestHost implements Transport {
|
|
|
2828
2758
|
* await host.press("Delete", { panel: true }); // while the panel has focus
|
|
2829
2759
|
* ```
|
|
2830
2760
|
*
|
|
2831
|
-
* @capability None.
|
|
2832
2761
|
* @throws `command` (rejects) A `HostError`: the command that would run is
|
|
2833
2762
|
* busy (the player only logs this).
|
|
2834
2763
|
* @throws `Error` (rejects) Nothing is bound to the key.
|
|
@@ -2877,7 +2806,6 @@ export declare class TestHost implements Transport {
|
|
|
2877
2806
|
* assert.equal(host.window("picture").props["brightness-down"], "⇧W");
|
|
2878
2807
|
* ```
|
|
2879
2808
|
*
|
|
2880
|
-
* @capability None.
|
|
2881
2809
|
* @throws `Error` `command` is neither a command of the plugin nor a
|
|
2882
2810
|
* core command.
|
|
2883
2811
|
* @since 1.6.6
|
|
@@ -2907,8 +2835,6 @@ export declare class TestHost implements Transport {
|
|
|
2907
2835
|
state: "starting" | "running" | "disabled" | "failed" | "stopped";
|
|
2908
2836
|
/** Why it failed (`state: "failed"`). */
|
|
2909
2837
|
error: string | null;
|
|
2910
|
-
/** Its declared capabilities. */
|
|
2911
|
-
capabilities: string[];
|
|
2912
2838
|
/** The package directory. */
|
|
2913
2839
|
directory: string;
|
|
2914
2840
|
/** Shipped with the player: `uninstall` and `install` are `unsupported`. */
|
|
@@ -2954,7 +2880,7 @@ export declare class TestHost implements Transport {
|
|
|
2954
2880
|
* // ---cut---
|
|
2955
2881
|
* host.candidates.set("/downloads/someone.demo-1.0.0.vxp", {
|
|
2956
2882
|
* id: "someone.demo", version: "1.0.0", apiVersion: "vestra/1",
|
|
2957
|
-
* entry: "main.js",
|
|
2883
|
+
* entry: "main.js",
|
|
2958
2884
|
* });
|
|
2959
2885
|
* ```
|
|
2960
2886
|
*/
|
|
@@ -2976,7 +2902,6 @@ export declare class TestHost implements Transport {
|
|
|
2976
2902
|
* host.installKeepsDisabled = false; // every install runs
|
|
2977
2903
|
* ```
|
|
2978
2904
|
*
|
|
2979
|
-
* @capability None.
|
|
2980
2905
|
* @since 1.5.55
|
|
2981
2906
|
*/
|
|
2982
2907
|
installKeepsDisabled: boolean;
|
|
@@ -3005,7 +2930,6 @@ export declare class TestHost implements Transport {
|
|
|
3005
2930
|
* assert.equal(host.markdown(rows[0]!.body)?.text, "**Hello**");
|
|
3006
2931
|
* ```
|
|
3007
2932
|
*
|
|
3008
|
-
* @capability None.
|
|
3009
2933
|
* @since 1.1.0
|
|
3010
2934
|
*/
|
|
3011
2935
|
markdown(value: Json | undefined): MarkdownWire | null;
|
|
@@ -3023,8 +2947,6 @@ export declare class TestHost implements Transport {
|
|
|
3023
2947
|
* Replace the plugin list and push `packages.changed` (another plugin
|
|
3024
2948
|
* started, stopped, was installed or removed).
|
|
3025
2949
|
*
|
|
3026
|
-
* @capability None.
|
|
3027
|
-
*
|
|
3028
2950
|
* @example Simulate another plugin starting
|
|
3029
2951
|
* The plugin's store window hears that a plugin is running now. The list
|
|
3030
2952
|
* replaces `packages` and is pushed as `packages.changed`, which the
|
|
@@ -3044,7 +2966,6 @@ export declare class TestHost implements Transport {
|
|
|
3044
2966
|
* asks this plugin's sequence provider. Rejects with `unavailable` when
|
|
3045
2967
|
* there is no provider or its flag is false.
|
|
3046
2968
|
*
|
|
3047
|
-
* @capability None.
|
|
3048
2969
|
* @throws `unavailable` (rejects) A `HostError`: there is no sequence
|
|
3049
2970
|
* provider, or its flag is false.
|
|
3050
2971
|
*
|
|
@@ -3068,8 +2989,6 @@ export declare class TestHost implements Transport {
|
|
|
3068
2989
|
* The plugin's command with this local id. Throws when it is not
|
|
3069
2990
|
* registered (never added, or disposed).
|
|
3070
2991
|
*
|
|
3071
|
-
* @capability None.
|
|
3072
|
-
*
|
|
3073
2992
|
* @example Read a command's state after a change
|
|
3074
2993
|
* The test checks that Export becomes enabled once a file is ready. The
|
|
3075
2994
|
* record is updated as the plugin sends new state; read it after
|
|
@@ -3131,7 +3050,6 @@ export declare class TestHost implements Transport {
|
|
|
3131
3050
|
* assert.equal(host.window("picture").props["brightness"], 0);
|
|
3132
3051
|
* ```
|
|
3133
3052
|
*
|
|
3134
|
-
* @capability None.
|
|
3135
3053
|
* @since 1.0.0
|
|
3136
3054
|
*/
|
|
3137
3055
|
window(id: string): FakeWindow;
|
|
@@ -3156,7 +3074,6 @@ export declare class TestHost implements Transport {
|
|
|
3156
3074
|
* await host.settle();
|
|
3157
3075
|
* ```
|
|
3158
3076
|
*
|
|
3159
|
-
* @capability None.
|
|
3160
3077
|
* @since 1.0.0
|
|
3161
3078
|
*/
|
|
3162
3079
|
mounted(slot?: "bottom" | "sidebar" | "adjust" | "backdrop"): FakePanel;
|
|
@@ -3174,7 +3091,6 @@ export declare class TestHost implements Transport {
|
|
|
3174
3091
|
* assert.deepEqual(host.sent("osd.show").at(-1), { text: "Saved" });
|
|
3175
3092
|
* ```
|
|
3176
3093
|
*
|
|
3177
|
-
* @capability None.
|
|
3178
3094
|
* @since 1.0.0
|
|
3179
3095
|
*/
|
|
3180
3096
|
sent(method: string): Record<string, Json>[];
|
|
@@ -3229,7 +3145,6 @@ export declare class TestHost implements Transport {
|
|
|
3229
3145
|
* assert.equal(importWindow.props["status-text"], expected);
|
|
3230
3146
|
* ```
|
|
3231
3147
|
*
|
|
3232
|
-
* @capability None.
|
|
3233
3148
|
* @throws Never.
|
|
3234
3149
|
* @since 1.0.0
|
|
3235
3150
|
*/
|
|
@@ -3241,8 +3156,6 @@ export declare class TestHost implements Transport {
|
|
|
3241
3156
|
* `ENOTEMPTY`, `EBUSY`, `EPERM`) is retried for about 1.5 s, then left
|
|
3242
3157
|
* for the system to clean, with a warning on the console.
|
|
3243
3158
|
*
|
|
3244
|
-
* @capability None.
|
|
3245
|
-
*
|
|
3246
3159
|
* @example Clean up a host that was never started
|
|
3247
3160
|
* A test that made a host but failed before `startPlugin` removes the
|
|
3248
3161
|
* host's temporary directories itself. `stop()` from `startPlugin` calls
|
|
@@ -3272,7 +3185,6 @@ export declare class TestHost implements Transport {
|
|
|
3272
3185
|
* and start it again on its next use. Filter chains, streams, jobs and the
|
|
3273
3186
|
* like (which also keep a plugin running) are not listed.
|
|
3274
3187
|
*
|
|
3275
|
-
* @capability None.
|
|
3276
3188
|
* @since 1.5.40
|
|
3277
3189
|
*
|
|
3278
3190
|
* @example Check that a plugin can be stopped while idle
|
|
@@ -3296,18 +3208,16 @@ export declare class TestHost implements Transport {
|
|
|
3296
3208
|
* registration started during activation (commands, panels, resolvers, ...),
|
|
3297
3209
|
* then wait until the host is idle.
|
|
3298
3210
|
*
|
|
3299
|
-
* The manifest id
|
|
3300
|
-
*
|
|
3301
|
-
*
|
|
3302
|
-
*
|
|
3303
|
-
*
|
|
3304
|
-
*
|
|
3305
|
-
* marks, video shaders and views, among others) fail with `capability` as in
|
|
3306
|
-
* the player, but a call the player refuses for an undeclared capability can
|
|
3307
|
-
* succeed here. `vestra-plugin check` (and the TypeScript plugin) reports
|
|
3308
|
-
* those calls from the sources.
|
|
3211
|
+
* The manifest id comes from `directory/manifest.json` unless `id` is
|
|
3212
|
+
* given; then no manifest is read (and without `directory` none is read
|
|
3213
|
+
* either: the id is `"test.plugin"`). Nothing in the manifest changes how
|
|
3214
|
+
* the plugin runs: event delivery and the start-up reads are the plugin's
|
|
3215
|
+
* own calls (`plugin.player.subscribe()`, `plugin.player.read()`), as in
|
|
3216
|
+
* the player.
|
|
3309
3217
|
*
|
|
3310
|
-
* Rejects when `manifest.json` cannot be read or parsed, when
|
|
3218
|
+
* Rejects when `manifest.json` cannot be read or parsed, when it still has
|
|
3219
|
+
* `capabilities` (removed in 1.9.0; the message says what to call
|
|
3220
|
+
* instead), when `activate`
|
|
3311
3221
|
* throws, or when a registration made during activation fails (for example
|
|
3312
3222
|
* `limit`, `conflict`, `invalid`). Stricter than the player's runner for
|
|
3313
3223
|
* commands: there the SDK logs a command declaration the player refuses during
|
|
@@ -3369,7 +3279,6 @@ export declare class TestHost implements Transport {
|
|
|
3369
3279
|
* player's runner does and returns the host to drive, the `plugin` object
|
|
3370
3280
|
* to call directly, and `stop` to end it like the player.
|
|
3371
3281
|
*
|
|
3372
|
-
* @capability None.
|
|
3373
3282
|
* @see [Test a plugin](../../../docs/guides/testing.md)
|
|
3374
3283
|
* @since 1.0.0
|
|
3375
3284
|
* @category Testing
|
|
@@ -3381,10 +3290,11 @@ export declare function startPlugin(activate: (plugin: Plugin) => unknown, optio
|
|
|
3381
3290
|
* files resolve against it. Default: the current working directory.
|
|
3382
3291
|
*/
|
|
3383
3292
|
directory?: string | URL;
|
|
3384
|
-
/**
|
|
3293
|
+
/**
|
|
3294
|
+
* The plugin's id; then `manifest.json` is not read. Default: the
|
|
3295
|
+
* manifest's id, or `"test.plugin"` without `directory`.
|
|
3296
|
+
*/
|
|
3385
3297
|
id?: string;
|
|
3386
|
-
/** Use these capabilities instead of reading `manifest.json`. */
|
|
3387
|
-
capabilities?: string[];
|
|
3388
3298
|
/**
|
|
3389
3299
|
* Run the plugin as one built into the player
|
|
3390
3300
|
* ({@link TestHost.builtin}): only then do `commands.run` and
|