@vestra-player/sdk 1.7.1 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +6 -9
  3. package/bin/vestra-plugin.mjs +4 -4
  4. package/dist/api-requests.d.ts +8 -8
  5. package/dist/api-requests.js +8 -8
  6. package/dist/capability-check.d.ts +15 -15
  7. package/dist/capability-check.js +4 -4
  8. package/dist/capability-rules.d.ts +4 -5
  9. package/dist/capability-rules.js +4 -5
  10. package/dist/commands.d.ts +34 -44
  11. package/dist/commands.js +21 -27
  12. package/dist/docs-tree.json.gz +0 -0
  13. package/dist/docs.d.ts +1 -1
  14. package/dist/docs.js +13 -3
  15. package/dist/i18n-tools.js +1 -1
  16. package/dist/i18n.js +1 -1
  17. package/dist/media.d.ts +7 -7
  18. package/dist/palettes.d.ts +5 -5
  19. package/dist/palettes.js +5 -5
  20. package/dist/plugin/appearance.js +1 -1
  21. package/dist/plugin/bindings.d.ts +2 -3
  22. package/dist/plugin/bindings.js +2 -3
  23. package/dist/plugin/commands.js +10 -11
  24. package/dist/plugin/connection.d.ts +18 -19
  25. package/dist/plugin/connection.js +23 -24
  26. package/dist/plugin/index.d.ts +5 -5
  27. package/dist/plugin/index.js +1 -1
  28. package/dist/plugin/osd.d.ts +1 -1
  29. package/dist/plugin/osd.js +1 -1
  30. package/dist/plugin/passes.d.ts +4 -4
  31. package/dist/plugin/passes.js +4 -4
  32. package/dist/plugin/patch.d.ts +8 -8
  33. package/dist/plugin/patch.js +12 -12
  34. package/dist/plugin/player/events.js +5 -5
  35. package/dist/plugin/resolvers.js +3 -3
  36. package/dist/plugin/scope.d.ts +4 -4
  37. package/dist/plugin/scope.js +4 -4
  38. package/dist/plugin/services.d.ts +2 -3
  39. package/dist/plugin/services.js +2 -3
  40. package/dist/plugin/shaders.js +5 -6
  41. package/dist/plugin/state.js +10 -10
  42. package/dist/plugin/testing/commands.d.ts +4 -5
  43. package/dist/plugin/testing/commands.js +4 -5
  44. package/dist/plugin/testing/i18n.d.ts +1 -1
  45. package/dist/plugin/testing/i18n.js +1 -1
  46. package/dist/plugin/testing/index.d.ts +147 -165
  47. package/dist/plugin/testing/index.js +137 -155
  48. package/dist/plugin/testing/internals.d.ts +2 -2
  49. package/dist/plugin/testing/internals.js +2 -2
  50. package/dist/plugin/timeline.d.ts +1 -1
  51. package/dist/plugin/timeline.js +2 -2
  52. package/dist/plugin/types/base.d.ts +90 -111
  53. package/dist/plugin/types/commands.d.ts +142 -174
  54. package/dist/plugin/types/packages.d.ts +48 -63
  55. package/dist/plugin/types/playback.d.ts +45 -59
  56. package/dist/plugin/types/plugin-wire.d.ts +38 -45
  57. package/dist/plugin/types/processing.d.ts +52 -65
  58. package/dist/plugin/types/services.d.ts +18 -25
  59. package/dist/plugin/types/snapshots.d.ts +34 -46
  60. package/dist/plugin/types/sources.d.ts +14 -16
  61. package/dist/plugin/types/subtitles.d.ts +7 -8
  62. package/dist/plugin/types/ui-content.d.ts +111 -116
  63. package/dist/plugin/types/ui-layout.d.ts +52 -63
  64. package/dist/plugin/types/ui-locale.d.ts +41 -45
  65. package/dist/plugin/types/ui-shell.d.ts +69 -87
  66. package/dist/plugin/values.d.ts +15 -18
  67. package/dist/plugin/values.js +16 -19
  68. package/dist/plugin/view/base.d.ts +2 -2
  69. package/dist/plugin/view/base.js +7 -8
  70. package/dist/plugin/view/layout.d.ts +2 -2
  71. package/dist/plugin/view/panel.js +2 -4
  72. package/dist/plugin/view/writer.d.ts +8 -8
  73. package/dist/plugin/view/writer.js +37 -39
  74. package/dist/plugin/when.d.ts +3 -3
  75. package/dist/plugin/wire-facade.js +6 -7
  76. package/dist/processing.d.ts +26 -30
  77. package/dist/processing.js +4 -4
  78. package/dist/source-resolvers.d.ts +2 -2
  79. package/dist/source.d.ts +1 -2
  80. package/dist/subtitles.d.ts +1 -1
  81. package/dist/ts-plugin.d.ts +5 -5
  82. package/dist/wire.d.ts +63 -70
  83. package/dist/wire.js +21 -25
  84. package/llms.txt +7 -10
  85. package/package.json +1 -1
  86. package/slint/vestra/bar-buttons.slint +6 -8
  87. package/slint/vestra/focus.slint +1 -1
  88. package/slint/vestra/widgets.slint +2 -4
@@ -3,15 +3,13 @@ import type { FileResolverOptions, WebResolverOptions } from "./sources.ts";
3
3
  import type { ConfirmOptions, Dialogs, Osd, OsdPanel } from "./ui-shell.ts";
4
4
  import type { Disposable } from "./base.ts";
5
5
  /**
6
- * The player's palettes: `vestra`, the dark default, and `vestra-light`
7
- * (player 0.4.0, SDK 1.5.0), a light palette whose video area stays dark.
8
- * Both draw on the logo's colours. Read colours from `Theme` instead of
9
- * branching on the id: a later version may add palettes.
6
+ * The player's palettes: `vestra`, the dark default, and `vestra-light`, a
7
+ * light palette whose video area stays dark. Both draw on the logo's colours.
8
+ * Read colours from `Theme` instead of branching on the id: a later version may
9
+ * add palettes.
10
10
  *
11
11
  * @remarks
12
- * The player treats an id it does not have as `vestra`: plugins built with an
13
- * older SDK that still ask for a palette removed in SDK 1.4.0 keep working,
14
- * and a player older than 0.4.0 answers `vestra-light` with `vestra`.
12
+ * The player treats an id it does not have as `vestra`.
15
13
  *
16
14
  * @since 1.0.0
17
15
  * @category UI
@@ -52,7 +50,7 @@ export type ThemeId = "vestra" | "vestra-light";
52
50
  * });
53
51
  * ```
54
52
  *
55
- * @see [Windows, panels, settings pages, dialogs and the OSD](../../../docs/explanation/ui.md) (theme tokens)
53
+ * @see [Theme](../../../docs/reference/theme.md)
56
54
  * @since 1.0.0
57
55
  * @category UI
58
56
  */
@@ -68,15 +66,14 @@ export interface Appearance {
68
66
  *
69
67
  * @remarks
70
68
  * Needs `events`: without it the listener never runs for other plugins'
71
- * changes. Views need no help to follow the palette; use this for things
72
- * the plugin draws itself (a rendered image, colours it computes). Errors
73
- * go to {@link Scope.onError}. When the player starts a stopped plugin
74
- * for a palette change (player 0.5.21), {@link Appearance.theme} already
75
- * has the new palette at start and the listener still hears the change
76
- * (SDK 1.5.56; before, it did not run). A language change does not call
77
- * it, except in one case: a plugin started for a language change alone
78
- * may hear the unchanged palette once, since the player's event does not
79
- * say which of the two changed.
69
+ * changes. Views need no help to follow the palette; use this for things the
70
+ * plugin draws itself (a rendered image, colours it computes). Errors go to
71
+ * {@link Scope.onError}. When the player starts a stopped plugin for a
72
+ * palette change, {@link Appearance.theme} already has the new palette at
73
+ * start and the listener still hears the change. A
74
+ * language change does not call it, except in one case: a plugin started for
75
+ * a language change alone may hear the unchanged palette once, since the
76
+ * player's event does not say which of the two changed.
80
77
  *
81
78
  * @capability events
82
79
  *
@@ -196,12 +193,11 @@ export type Locale = "en" | "zh-Hans" | "ja" | "ko" | "de" | "fr" | "es";
196
193
  */
197
194
  export type LanguagePreference = "system" | Locale;
198
195
  /**
199
- * Arguments of a template sentence ({@link Osd.show},
200
- * {@link OsdPanel.set}, {@link ConfirmOptions.args}, {@link I18n.text}): an
201
- * array for `{}` and `{0}`, `{1}` placeholders, or an object for `{name}`
202
- * placeholders. At most 16. Strings and finite numbers are data, shown as
203
- * they are (whole numbers without a fraction); a {@link Text} or
204
- * {@link TextList} argument (SDK 1.5.11, player 0.4.3) is translated too,
196
+ * Arguments of a template sentence ({@link Osd.show}, {@link OsdPanel.set},
197
+ * {@link ConfirmOptions.args}, {@link I18n.text}): an array for `{}` and `{0}`,
198
+ * `{1}` placeholders, or an object for `{name}` placeholders. At most 16.
199
+ * Strings and finite numbers are data, shown as they are (whole numbers without
200
+ * a fraction); a {@link Text} or {@link TextList} argument is translated too,
205
201
  * so a sentence can be built from translated parts.
206
202
  *
207
203
  * @since 1.5.9
@@ -215,12 +211,12 @@ export type TemplateArgs = readonly TextArg[] | Readonly<Record<string, TextArg>
215
211
  *
216
212
  * @remarks
217
213
  * Accepted wherever the player shows a plugin's text: command titles, path
218
- * segments and reasons, {@link Osd.show} and {@link OsdPanel.set} (as the
219
- * text or an argument), the texts of {@link Dialogs.confirm}, file dialog
220
- * titles and `saveFile`'s `fileName`, and property values where Slint
221
- * expects a `string` (at any depth: a `[string]` model, a struct field).
222
- * Nested in another text's arguments it is translated too. Requires player
223
- * 0.4.3. Limits: `TEXT_LIMITS` in `@vestra-player/sdk/testing`.
214
+ * segments and reasons, {@link Osd.show} and {@link OsdPanel.set} (as the text
215
+ * or an argument), the texts of {@link Dialogs.confirm}, file dialog titles and
216
+ * `saveFile`'s `fileName`, and property values where Slint expects a `string`
217
+ * (at any depth: a `[string]` model, a struct field). Nested in another text's
218
+ * arguments it is translated too. Limits: `TEXT_LIMITS` in
219
+ * `@vestra-player/sdk/testing`.
224
220
  *
225
221
  * The wire form `{ $vestraText, args }` is what the player reads; write it
226
222
  * with {@link I18n.text}, so that `vestra-plugin i18n extract` finds the
@@ -300,16 +296,16 @@ export type TextValue = string | Text | TextList;
300
296
  * its arguments (`osd.show("Speed {}×", [rate])`), never a sentence
301
297
  * composed in TypeScript.
302
298
  *
303
- * Where words and data cannot be separated that way (a menu item with a
304
- * number, a `[string]` model, a sentence made of translated parts), the
305
- * plugin passes a text value ({@link I18n.text}, {@link I18n.list}; SDK
306
- * 1.5.11): data the player translates, never a translated string.
299
+ * Where words and data cannot be separated that way (a menu item with a number,
300
+ * a `[string]` model, a sentence made of translated parts), the plugin passes a
301
+ * text value ({@link I18n.text}, {@link I18n.list}): data the player
302
+ * translates, never a translated string.
307
303
  *
308
304
  * The language is fixed when the player starts: {@link I18n.locale} never
309
305
  * changes during a run. Read it for what is not text, such as the order of
310
306
  * names or a date format. `vestra-plugin i18n extract` collects the texts
311
307
  * into `locales/messages.pot`; see the
312
- * [i18n guide](../../../docs/how-to/i18n.md).
308
+ * [i18n guide](../../../docs/guides/i18n.md).
313
309
  *
314
310
  * @capability None.
315
311
  *
@@ -406,23 +402,23 @@ export interface I18n {
406
402
  list(items: readonly TextArg[], style?: ListStyle): TextList;
407
403
  /**
408
404
  * An `Error` whose words the player shows translated: throw it where the
409
- * player shows a plugin's failure to the user, such as from a
410
- * file or web resolver's `resolve` ({@link FileResolverOptions}, {@link WebResolverOptions}) (also when a stream
411
- * fails while it starts). The player shows `text` translated with this
412
- * plugin's catalog (as `player.state.error` and the failure message);
413
- * `message` is the English rendering, for logs and older players.
414
- * Elsewhere it is an ordinary `Error`.
405
+ * player shows a plugin's failure to the user, such as from a file or web
406
+ * resolver's `resolve` ({@link FileResolverOptions},
407
+ * {@link WebResolverOptions}) (also when a stream fails while it starts). The
408
+ * player shows `text` translated with this plugin's catalog (as
409
+ * `player.state.error` and the failure message); `message` is the English
410
+ * rendering, for logs. Elsewhere it is an ordinary `Error`.
415
411
  *
416
412
  * @param source - English source text, as {@link I18n.text}'s.
417
413
  * @param args - Values for its placeholders.
418
414
  * @throws `invalid` A malformed or over-limit value.
419
415
  *
420
416
  * @example Fail an open with a message the user can read
421
- * Opening a `.ch8` file the plugin cannot load shows "The program file
422
- * was not found." in the user's language. The player shows the message of
423
- * an error thrown from `resolve`; `i18n.error` makes an `Error` whose text
424
- * the player translates with this plugin's catalog, while its `message`
425
- * stays English for logs and older players.
417
+ * Opening a `.ch8` file the plugin cannot load shows "The program file was
418
+ * not found." in the user's language. The player shows the message of an
419
+ * error thrown from `resolve`; `i18n.error` makes an `Error` whose text the
420
+ * player translates with this plugin's catalog, while its `message` stays
421
+ * English for logs.
426
422
  * ```ts
427
423
  * import { readFile } from "node:fs/promises";
428
424
  * declare function startEmulator(program: Uint8Array): ResolvedStream;
@@ -98,7 +98,7 @@ export type SettingsCategory = "general" | "playback" | "subtitles" | "video" |
98
98
  * }
99
99
  * ```
100
100
  *
101
- * @see {@link Settings.page}, [Windows, panels, settings pages, dialogs and the OSD](../../../docs/explanation/ui.md)
101
+ * @see {@link Settings.page}, [Add settings and translations](../../../docs/guides/i18n.md)
102
102
  * @since 1.0.0
103
103
  * @category UI
104
104
  */
@@ -159,7 +159,7 @@ export type SettingsPage = View & Disposable & {
159
159
  * page.on("resumeToggled", (on: boolean) => store.save({ ...store.value, resume: on }));
160
160
  * ```
161
161
  *
162
- * @see {@link SettingsPage}, [Windows, panels, settings pages, dialogs and the OSD](../../../docs/explanation/ui.md)
162
+ * @see {@link SettingsPage}, [Add settings and translations](../../../docs/guides/i18n.md)
163
163
  * @since 1.0.0
164
164
  * @category UI
165
165
  */
@@ -332,14 +332,14 @@ export interface BackdropSlot {
332
332
  * or the sidebar moves to or from its floating window, while the global is
333
333
  * one stable address.
334
334
  *
335
- * A plugin mounts at most one panel per slot (SDK 1.6.15, player 0.7.6;
336
- * before, one panel in all): a playback plugin can have its control bar in
337
- * `"bottom"` and its controls in `"adjust"`. Each {@link Panel} has its own
338
- * bridge, state, `toggle()` and `setInteraction()`; disposing one leaves
339
- * the others, and stopping the plugin unmounts them all. The bottom bar and
340
- * the backdrop hold one panel for all plugins; the sidebar and the adjust
341
- * column one tab per plugin. {@link Panels.bottom}, {@link Panels.sidebar}
342
- * and {@link Panels.adjust} describe the positions, whoever mounted there.
335
+ * A plugin mounts at most one panel per slot: a
336
+ * playback plugin can have its control bar in `"bottom"` and its controls in
337
+ * `"adjust"`. Each {@link Panel} has its own bridge, state, `toggle()` and
338
+ * `setInteraction()`; disposing one leaves the others, and stopping the plugin
339
+ * unmounts them all. The bottom bar and the backdrop hold one panel for all
340
+ * plugins; the sidebar and the adjust column one tab per plugin.
341
+ * {@link Panels.bottom}, {@link Panels.sidebar} and {@link Panels.adjust}
342
+ * describe the positions, whoever mounted there.
343
343
  *
344
344
  * @capability ui.mount
345
345
  *
@@ -356,7 +356,7 @@ export interface BackdropSlot {
356
356
  *
357
357
  * {@includeCode ../../../examples/panel-menu/ui/panel.slint}
358
358
  *
359
- * @see {@link Panel}, {@link PanelSlot}, [Windows, panels, settings pages, dialogs and the OSD](../../../docs/explanation/ui.md)
359
+ * @see {@link Panel}, {@link PanelSlot}, [Example: Adjust panel](../../../docs/examples/adjust-panel.md), [Example: Panel menu](../../../docs/examples/panel-menu.md)
360
360
  * @since 1.0.0
361
361
  * @category UI
362
362
  */
@@ -377,28 +377,23 @@ export interface Panels {
377
377
  * {@link Panel.setInteraction} locks keep it).
378
378
  * - `"sidebar"`: right of the video, the window's full height, as wide as the
379
379
  * user drags it (at least 317). The user can detach it into a floating
380
- * window titled `title`. Several plugins may mount here (player 0.4.x
381
- * after 0.4.0): each panel is a tab, labelled `title` (else the plugin's
382
- * name), and the player draws a 31px tab strip above the current one
383
- * while there are two or more (with one panel, nothing changes).
384
- * Before player 0.7.3 a ninth tab was refused with `conflict`.
385
- * Showing, hiding and detaching apply to the whole sidebar. If the
386
- * bridge global declares `in property <bool> tabbed`, the player sets
387
- * it to `true` while it draws the strip, so a panel with a tab strip of
388
- * its own can hide it. Panel coordinates (drops) start below the strip.
380
+ * window titled `title`. Several plugins may mount here: each panel is a tab, labelled `title` (else the plugin's name),
381
+ * and the player draws a 31px tab strip above the current one while there
382
+ * are two or more (with one panel, nothing changes). Showing, hiding and
383
+ * detaching apply to the whole sidebar. If the bridge global declares
384
+ * `in property <bool> tabbed`, the player sets it to `true` while it draws
385
+ * the strip, so a panel with a tab strip of its own can hide it. Panel
386
+ * coordinates (drops) start below the strip.
389
387
  * - `"backdrop"`: the whole video area, under the OSD, while there is no
390
388
  * video picture (see {@link Panels.backdrop}). One plugin at a time (as
391
389
  * for the bottom bar, another one's mount rejects with `conflict`); it
392
390
  * takes no pointer or keyboard input. While it is mounted, the player does
393
391
  * not show the cover art of audio files itself (from the next file
394
392
  * opened on), so the plugin can draw it.
395
- * - `"adjust"` (player 0.7.6, SDK 1.6.11): **controls that change what is
396
- * playing**: the picture, the sound, the subtitles, the speed (the
397
- * player's own Picture, Audio, Subtitles and Playback panels, a colour
398
- * grading tool). Several plugins may mount here, one tab each, labelled
399
- * `title` (else the plugin's name). Declare `minPlayerVersion: "0.7.6"`:
400
- * older players refuse the slot (`invalid`, "unknown mount slot"), and a
401
- * mount refused during `activate` fails the activation.
393
+ * - `"adjust"`: **controls that change what is playing**: the picture, the
394
+ * sound, the subtitles, the speed (the player's own Picture, Audio,
395
+ * Subtitles and Playback panels, a colour grading tool). Several plugins
396
+ * may mount here, one tab each, labelled `title` (else the plugin's name).
402
397
  *
403
398
  * **Choosing between `"sidebar"` and `"adjust"`.** The slot says what the
404
399
  * panel is for; the player decides how it looks and may change that at any
@@ -437,13 +432,11 @@ export interface Panels {
437
432
  * @returns A {@link Panel} owned by this scope; await {@link Panel.ready}
438
433
  * for the result.
439
434
  *
440
- * @throws `Error` without a code (throws) This plugin already has a panel
441
- * in this slot (a panel in another slot is fine from player 0.7.6;
442
- * players before 0.7.6 refuse a second panel with `conflict`, so a
443
- * plugin that mounts two declares `minPlayerVersion` 0.7.6), or the file
444
- * exports no component or global, or several and `options`
445
- * does not name one. A file that cannot be read throws Node's file system
446
- * error (`code` `ENOENT` and so on).
435
+ * @throws `Error` without a code (throws) This plugin already has a panel in
436
+ * this slot (a panel in another slot is fine), or the file
437
+ * exports no component or global, or several and `options` does not name one.
438
+ * A file that cannot be read throws Node's file system error (`code` `ENOENT`
439
+ * and so on).
447
440
  * @throws The errors of {@link Panel.ready} (rejects `ready`) The player
448
441
  * refused the mount.
449
442
  *
@@ -481,21 +474,16 @@ export interface Panels {
481
474
  /** The sidebar position, including its floating state; any plugin may read and toggle it. */
482
475
  readonly sidebar: SidebarSlot;
483
476
  /**
484
- * The adjust column (player 0.7.6, SDK 1.6.11), whoever mounted there;
485
- * any plugin may read and toggle it. The same shape as
486
- * {@link Panels.sidebar} without floating: the adjust column never
487
- * detaches.
477
+ * The adjust column, whoever mounted there; any plugin may read and toggle
478
+ * it. The same shape as {@link Panels.sidebar} without floating: the adjust
479
+ * column never detaches.
488
480
  *
489
481
  * @remarks
490
- * `state` is `null` while no plugin has a panel there. Players before
491
- * 0.7.6 build the `plugin` object with their own SDK, which has no
492
- * `adjust`: there `plugin.panels.adjust` is `undefined` and reading its
493
- * `state` throws a `TypeError`, so declare `"minPlayerVersion": "0.7.6"`
494
- * (or test `plugin.panels.adjust` first). The column starts hidden (`preferred: false`, `reason:
495
- * "userHidden"`) until the user opens it. To open the column at your own
496
- * panel, call {@link Panel.show} (or {@link Panel.toggle}, which closes it
497
- * again when your tab is already the current one, the behaviour of the
498
- * player's own `Alt+1…4`).
482
+ * `state` is `null` while no plugin has a panel there. The column starts
483
+ * hidden (`preferred: false`, `reason: "userHidden"`) until the user opens
484
+ * it. To open the column at your own panel, call {@link Panel.show} (or
485
+ * {@link Panel.toggle}, which closes it again when your tab is already the
486
+ * current one, the behaviour of the player's own `Alt+1…4`).
499
487
  *
500
488
  * @example Open the adjust column at this plugin's tab with a key
501
489
  * One command opens the column at the plugin's tab, and pressing it again
@@ -520,8 +508,7 @@ export interface Panels {
520
508
  * });
521
509
  * ```
522
510
  *
523
- * @player 0.7.6 (declare `"minPlayerVersion": "0.7.6"`; older players
524
- * have no `adjust`: reading its `state` throws a `TypeError`).
511
+ * @player 0.7.6
525
512
  * @since 1.6.11
526
513
  */
527
514
  readonly adjust: PanelSlot;
@@ -556,13 +543,12 @@ export interface ConfirmOptions {
556
543
  /** A checkbox under the text, such as "Don't ask again"; 1–40 characters. */
557
544
  checkbox?: TextValue;
558
545
  /**
559
- * Values for the placeholders of `message` and `detail` (player 0.4.3).
560
- * Any of the texts may instead be a {@link Text} (SDK 1.5.11), which
561
- * carries its own arguments; `args` only fills the string ones.
562
- * Every text of the dialog is English source text that the player shows
563
- * translated from the plugin's catalog; `message` and `detail` are
564
- * templates like {@link Osd.show}'s. The length limits apply to the shown
565
- * text.
546
+ * Values for the placeholders of `message` and `detail`. Any of the texts may
547
+ * instead be a {@link Text}, which carries its own arguments; `args` only
548
+ * fills the string ones. Every text of the dialog is English source text that
549
+ * the player shows translated from the plugin's catalog; `message` and
550
+ * `detail` are templates like {@link Osd.show}'s. The length limits apply to
551
+ * the shown text.
566
552
  *
567
553
  * @since 1.5.9
568
554
  */
@@ -614,7 +600,7 @@ export interface ConfirmOptions {
614
600
  * }
615
601
  * ```
616
602
  *
617
- * @see [Windows, panels, settings pages, dialogs and the OSD](../../../docs/explanation/ui.md)
603
+ * @see [Platforms](../../../docs/reference/platforms.md)
618
604
  * @since 1.0.0
619
605
  * @category UI
620
606
  */
@@ -792,10 +778,9 @@ export interface Dialogs {
792
778
  /** The dialog's title (English source text or a {@link Text}), at most 256 bytes. */
793
779
  title?: TextValue;
794
780
  /**
795
- * The proposed file name: a plain name, at most 256 bytes. A string is
796
- * data (not translated); a {@link Text} (SDK 1.5.11) is shown
797
- * translated, `text("Playlist.m3u8")` (a `/` or `\\` in a translation
798
- * becomes `-`).
781
+ * The proposed file name: a plain name, at most 256 bytes. A string is data
782
+ * (not translated); a {@link Text} is shown translated,
783
+ * `text("Playlist.m3u8")` (a `/` or `\\` in a translation becomes `-`).
799
784
  */
800
785
  fileName?: TextValue;
801
786
  }): Promise<string | null>;
@@ -845,9 +830,8 @@ export interface OsdPanel extends Disposable {
845
830
  * @param text - The text, with `\n` between lines: at most 32 lines and
846
831
  * 4096 bytes once translated and formatted. `null` hides the block. A
847
832
  * template, like {@link Osd.show}'s.
848
- * @param args - Values for its placeholders (player 0.4.3); `null` or
849
- * omitted for none.
850
- * @param options - `maxColumns`: cut long lines (SDK 1.5.11).
833
+ * @param args - Values for its placeholders; `null` or omitted for none.
834
+ * @param options - `maxColumns`: cut long lines.
851
835
  *
852
836
  * @example Show two loop points, then hide the block
853
837
  * The block shows "A: 12.0 s" and "B: 18.5 s" on two lines, then
@@ -873,9 +857,8 @@ export interface OsdPanelOptions {
873
857
  /**
874
858
  * Cut every line longer than this many columns, after translation and
875
859
  * formatting, ending it with `…`: a wide character (Chinese, Japanese,
876
- * Korean, full-width forms) is two columns, a combining mark none, any
877
- * other one. An integer from 8 to 1000 (player 0.4.3; older players show
878
- * whole lines). Measure the video area to choose it.
860
+ * Korean, full-width forms) is two columns, a combining mark none, any other
861
+ * one. An integer from 8 to 1000. Measure the video area to choose it.
879
862
  */
880
863
  maxColumns?: number;
881
864
  }
@@ -923,7 +906,7 @@ export interface OsdPanelOptions {
923
906
  * say("Blur on");
924
907
  * ```
925
908
  *
926
- * @see {@link OsdPanel}, [Windows, panels, settings pages, dialogs and the OSD](../../../docs/explanation/ui.md)
909
+ * @see {@link OsdPanel}, [Limits: on-screen display](../../../docs/reference/limits.md#on-screen-display)
927
910
  * @since 1.0.0
928
911
  * @category UI
929
912
  */
@@ -935,27 +918,26 @@ export interface Osd {
935
918
  * Replaces the message on screen, whichever plugin showed it. A message
936
919
  * that is on screen when the plugin stops still disappears on time.
937
920
  *
938
- * The text is a template in English: the player shows its translation
939
- * from the plugin's catalog, with the placeholders (`{}`, `{0}`, `{name}`;
940
- * `{{` and `}}` for braces) filled from `args`. Without `args` the text
941
- * shows as it is (braces included). Untranslated, the English template is
942
- * formatted. Never compose the sentence in TypeScript
943
- * (`` `Speed ${rate}×` ``): translators can only translate whole templates.
944
- * An argument that is itself words is a {@link Text} (SDK 1.5.11), and a
945
- * message made of a varying number of parts is a {@link TextList} of
946
- * texts; `text` may also be a `Text` (then without `args`).
921
+ * The text is a template in English: the player shows its translation from
922
+ * the plugin's catalog, with the placeholders (`{}`, `{0}`, `{name}`; `{{`
923
+ * and `}}` for braces) filled from `args`. Without `args` the text shows as
924
+ * it is (braces included). Untranslated, the English template is formatted.
925
+ * Never compose the sentence in TypeScript (`` `Speed ${rate}×` ``):
926
+ * translators can only translate whole templates. An argument that is itself
927
+ * words is a {@link Text}, and a message made of a varying number of parts is
928
+ * a {@link TextList} of texts; `text` may also be a `Text` (then without
929
+ * `args`).
947
930
  *
948
931
  * @capability ui.osd
949
932
  *
950
- * @param text - The template, 1–200 characters once translated and
951
- * formatted; line breaks become spaces.
952
- * With `options.actions` (player 0.7.6) the message ends in up to two
953
- * buttons, each running one of the plugin's own commands
954
- * ({@link OsdShowOptions}). Older players show the message without them.
933
+ * @param text - The template, 1–200 characters once translated and formatted;
934
+ * line breaks become spaces. With `options.actions` the message ends in up to
935
+ * two buttons, each running one of the plugin's own commands
936
+ * ({@link OsdShowOptions}).
955
937
  *
956
- * @param args - Values for its placeholders (player 0.4.3; older players
957
- * show the template as it is). Pass `null` with a `Text` and options.
958
- * @param options - Action buttons after the text (SDK 1.6.9).
938
+ * @param args - Values for its placeholders. Pass `null` with a `Text` and
939
+ * options.
940
+ * @param options - Action buttons after the text.
959
941
  * @returns Resolves once the message is on screen.
960
942
  *
961
943
  * @throws `invalid` (rejects) The shown text is empty, only white space,
@@ -1024,7 +1006,7 @@ export interface Osd {
1024
1006
  panel(): OsdPanel;
1025
1007
  }
1026
1008
  /**
1027
- * One button at the end of an OSD message ({@link Osd.show}, player 0.7.6).
1009
+ * One button at the end of an OSD message ({@link Osd.show}).
1028
1010
  *
1029
1011
  * @since 1.6.9
1030
1012
  * @category UI
@@ -1047,7 +1029,7 @@ export interface OsdAction {
1047
1029
  command: string;
1048
1030
  }
1049
1031
  /**
1050
- * Options of {@link Osd.show} (SDK 1.6.9).
1032
+ * Options of {@link Osd.show}.
1051
1033
  *
1052
1034
  * @remarks
1053
1035
  * A message with actions stays about 4 seconds instead of 2, and does not
@@ -12,17 +12,15 @@ import type { Json } from "../wire.ts";
12
12
  * makes `Window.show` reject; a panel or settings page opens without it and
13
13
  * the failure goes to the plugin's `onError`.
14
14
  *
15
- * Since player 0.6.0 (SDK 1.5.46) they allow a whole list: a plugin binds
16
- * all of its rows (a playlist of 50,000 entries fits) and the view draws
17
- * them with a Slint `ListView`, which builds only the rows on screen. The
18
- * SDK sends a changed array as row patches, and an array larger than one
19
- * request (about 512 KiB of rows) as its first rows followed by `insert`
20
- * patches of the rest; the player converts large writes off its interface
21
- * thread. Before player 0.6.0 the limits were 4,096 rows, 16,384 values and
22
- * 1 MiB of text, so a long list had to be sent as a window of rows.
15
+ * They allow a whole list: a plugin binds all of its rows (a playlist of 50,000
16
+ * entries fits) and the view draws them with a Slint `ListView`, which builds
17
+ * only the rows on screen. The SDK sends a changed array as row patches, and an
18
+ * array larger than one request (about 512 KiB of rows) as its first rows
19
+ * followed by `insert` patches of the rest; the player converts large writes
20
+ * off its interface thread.
23
21
  *
24
- * In a row, `null` where the view declares an `image` shows no picture
25
- * (player 0.6.0): rows without a thumbnail need no placeholder image.
22
+ * In a row, `null` where the view declares an `image` shows no picture: rows
23
+ * without a thumbnail need no placeholder image.
26
24
  *
27
25
  * @example Bind a whole list
28
26
  * The view draws every row with a `ListView`; the SDK sends what changed.
@@ -42,25 +40,24 @@ export declare const UI_VALUE_LIMITS: {
42
40
  /** Nesting depth; the value itself is depth 0 (8). */
43
41
  readonly depth: 8;
44
42
  /**
45
- * Values in all, counting every array, object, string, number, boolean
46
- * and null, the value itself included; a Markdown document is one
47
- * (1,048,576; 16,384 before player 0.6.0).
43
+ * Values in all, counting every array, object, string, number, boolean and
44
+ * null, the value itself included; a Markdown document is one (1,048,576).
48
45
  */
49
46
  readonly values: number;
50
- /** Rows of one array (100,000; 4,096 before player 0.6.0). */
47
+ /** Rows of one array (100,000). */
51
48
  readonly arrayRows: 100000;
52
49
  /** UTF-8 bytes of one string or object field name (64 KiB). */
53
50
  readonly stringBytes: number;
54
51
  /**
55
52
  * UTF-8 bytes of all strings and field names together, the text of the
56
- * value's Markdown documents included (32 MiB; 1 MiB before player 0.6.0).
53
+ * value's Markdown documents included (32 MiB).
57
54
  */
58
55
  readonly textBytes: number;
59
56
  };
60
57
  /**
61
58
  * The player's runtime image limits (`src/host/src/ui/ui_image.rs`): a file's
62
- * bytes and sides, the decoded pixels each plugin caches, and (SDK 1.5.19,
63
- * player 0.5.1) the decoded pixels the nested images of one view may show.
59
+ * bytes and sides, the decoded pixels each plugin caches, and the decoded
60
+ * pixels the nested images of one view may show.
64
61
  *
65
62
  * @since 1.5.19
66
63
  * @category Testing
@@ -72,7 +69,7 @@ export declare const IMAGE_LIMITS: Readonly<{
72
69
  side: 4096;
73
70
  /** The decoded pixel bytes the player caches for each plugin's images. */
74
71
  pluginBytes: number;
75
- /** The decoded pixel bytes the nested images of one view may show (player 0.5.1). */
72
+ /** The decoded pixel bytes the nested images of one view may show. */
76
73
  viewBytes: number;
77
74
  }>;
78
75
  /**
@@ -10,17 +10,15 @@
10
10
  * makes `Window.show` reject; a panel or settings page opens without it and
11
11
  * the failure goes to the plugin's `onError`.
12
12
  *
13
- * Since player 0.6.0 (SDK 1.5.46) they allow a whole list: a plugin binds
14
- * all of its rows (a playlist of 50,000 entries fits) and the view draws
15
- * them with a Slint `ListView`, which builds only the rows on screen. The
16
- * SDK sends a changed array as row patches, and an array larger than one
17
- * request (about 512 KiB of rows) as its first rows followed by `insert`
18
- * patches of the rest; the player converts large writes off its interface
19
- * thread. Before player 0.6.0 the limits were 4,096 rows, 16,384 values and
20
- * 1 MiB of text, so a long list had to be sent as a window of rows.
13
+ * They allow a whole list: a plugin binds all of its rows (a playlist of 50,000
14
+ * entries fits) and the view draws them with a Slint `ListView`, which builds
15
+ * only the rows on screen. The SDK sends a changed array as row patches, and an
16
+ * array larger than one request (about 512 KiB of rows) as its first rows
17
+ * followed by `insert` patches of the rest; the player converts large writes
18
+ * off its interface thread.
21
19
  *
22
- * In a row, `null` where the view declares an `image` shows no picture
23
- * (player 0.6.0): rows without a thumbnail need no placeholder image.
20
+ * In a row, `null` where the view declares an `image` shows no picture: rows
21
+ * without a thumbnail need no placeholder image.
24
22
  *
25
23
  * @example Bind a whole list
26
24
  * The view draws every row with a `ListView`; the SDK sends what changed.
@@ -40,18 +38,17 @@ export const UI_VALUE_LIMITS = {
40
38
  /** Nesting depth; the value itself is depth 0 (8). */
41
39
  depth: 8,
42
40
  /**
43
- * Values in all, counting every array, object, string, number, boolean
44
- * and null, the value itself included; a Markdown document is one
45
- * (1,048,576; 16,384 before player 0.6.0).
41
+ * Values in all, counting every array, object, string, number, boolean and
42
+ * null, the value itself included; a Markdown document is one (1,048,576).
46
43
  */
47
44
  values: 1024 * 1024,
48
- /** Rows of one array (100,000; 4,096 before player 0.6.0). */
45
+ /** Rows of one array (100,000). */
49
46
  arrayRows: 100_000,
50
47
  /** UTF-8 bytes of one string or object field name (64 KiB). */
51
48
  stringBytes: 64 * 1024,
52
49
  /**
53
50
  * UTF-8 bytes of all strings and field names together, the text of the
54
- * value's Markdown documents included (32 MiB; 1 MiB before player 0.6.0).
51
+ * value's Markdown documents included (32 MiB).
55
52
  */
56
53
  textBytes: 32 * 1024 * 1024,
57
54
  };
@@ -67,8 +64,8 @@ function documentText(value) {
67
64
  }
68
65
  /**
69
66
  * The player's runtime image limits (`src/host/src/ui/ui_image.rs`): a file's
70
- * bytes and sides, the decoded pixels each plugin caches, and (SDK 1.5.19,
71
- * player 0.5.1) the decoded pixels the nested images of one view may show.
67
+ * bytes and sides, the decoded pixels each plugin caches, and the decoded
68
+ * pixels the nested images of one view may show.
72
69
  *
73
70
  * @since 1.5.19
74
71
  * @category Testing
@@ -80,7 +77,7 @@ export const IMAGE_LIMITS = Object.freeze({
80
77
  side: 4096,
81
78
  /** The decoded pixel bytes the player caches for each plugin's images. */
82
79
  pluginBytes: 64 * 1024 * 1024,
83
- /** The decoded pixel bytes the nested images of one view may show (player 0.5.1). */
80
+ /** The decoded pixel bytes the nested images of one view may show. */
84
81
  viewBytes: 32 * 1024 * 1024,
85
82
  });
86
83
  /**
@@ -108,7 +105,7 @@ export function valueLimitProblem(value) {
108
105
  if (budget.values === L.values)
109
106
  return `UI value exceeds ${L.values} total nodes`;
110
107
  budget.values += 1;
111
- // An image (nested from SDK 1.5.19) is one value, like a document.
108
+ // An image (also nested) is one value, like a document.
112
109
  if (isObject(value) && "$vestraImage" in value)
113
110
  return null;
114
111
  const doc = documentText(value);
@@ -18,8 +18,8 @@ export declare abstract class ViewBase implements View {
18
18
  set(props: Props): void;
19
19
  bind(props: () => Props): import("../types.ts").Disposable;
20
20
  /**
21
- * `plugin.wire.view(v)` (SDK 1.7.0): the writer's direct writes, for a
22
- * scope of the plugin that made this view.
21
+ * `plugin.wire.view(v)`: the writer's direct writes, for a scope of the
22
+ * plugin that made this view.
23
23
  */
24
24
  [DIRECT](scope: ScopeImpl): DirectWrites;
25
25
  /** {@link ViewBinder.snapshot}: current desired properties. */
@@ -1,10 +1,9 @@
1
1
  /**
2
- * `ViewBase`: what windows, panels and settings pages share — callbacks, and
3
- * a {@link ViewWriter} (L1) with a {@link ViewBinder} (L2) over it. A view
4
- * joins the update passes on its first `bind()` (SDK 1.7.0,
5
- * doc/specs/sdk-refactor.md §4 Step 2 in the player repository); until
6
- * then `set()` goes straight to the writer, which sends whole values and
7
- * keeps no row-patch bases for it.
2
+ * `ViewBase`: what windows, panels and settings pages share — callbacks, and a
3
+ * {@link ViewWriter} (L1) with a {@link ViewBinder} (L2) over it. A view joins
4
+ * the update passes on its first `bind()` (doc/specs/sdk-refactor.md §4 Step 2
5
+ * in the player repository); until then `set()` goes straight to the writer,
6
+ * which sends whole values and keeps no row-patch bases for it.
8
7
  */
9
8
  import { readFileSync } from "node:fs";
10
9
  import { resolve } from "node:path";
@@ -59,8 +58,8 @@ export class ViewBase {
59
58
  return this.#binder.bind(props);
60
59
  }
61
60
  /**
62
- * `plugin.wire.view(v)` (SDK 1.7.0): the writer's direct writes, for a
63
- * scope of the plugin that made this view.
61
+ * `plugin.wire.view(v)`: the writer's direct writes, for a scope of the
62
+ * plugin that made this view.
64
63
  */
65
64
  [DIRECT](scope) {
66
65
  if (scope.runtime !== this.scope.runtime)
@@ -6,9 +6,9 @@ export type LayoutName = "bottom" | "sidebar" | "adjust";
6
6
  export type Layout = {
7
7
  bottom: SlotState | null;
8
8
  sidebar: SlotState | null;
9
- /** Player 0.7.6; `null` from older players. */
9
+ /** The adjust column. */
10
10
  adjust: SlotState | null;
11
- /** `PanelSlot.panels` (null from players without tabs). */
11
+ /** `PanelSlot.panels`. */
12
12
  tabs: {
13
13
  bottom: readonly SlotPanel[] | null;
14
14
  sidebar: readonly SlotPanel[] | null;