@vestra-player/sdk 1.6.2 → 1.6.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 +6 -0
- package/dist/docs-tree.json.gz +0 -0
- package/dist/plugin/testing.d.ts +5 -5
- package/dist/plugin/testing.js +4 -4
- package/dist/plugin/types.d.ts +23 -23
- package/llms.txt +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.6.3
|
|
4
|
+
|
|
5
|
+
**Who must change: nobody.** Documentation only: no change to the TypeScript API, the wire or `TestHost`, `apiVersion` stays `vestra/1`, no new capability, no player version needed.
|
|
6
|
+
|
|
7
|
+
- **Examples name window handles after the window they name (its Slint file where there is one).** The API examples, guides, tutorials and example plugins no longer call a window handle `window`: `readmeWindow` for `ui/readme.slint`, `presetsWindow`, `thumbnailWindow`, `bookmarkWindow`, `blurWindow` and so on, in `plugin.windows.create(…)` and `host.window(…)` alike.
|
|
8
|
+
|
|
3
9
|
## 1.6.2
|
|
4
10
|
|
|
5
11
|
**Who must change: nobody, but check `TestHost` tests of a full sidebar or of `keepsRunning` with a background tab.** No change to the TypeScript API or the wire, `apiVersion` stays `vestra/1`, no new capability, no player version needed. `TestHost` follows player 0.7.3: it no longer refuses a ninth sidebar tab, and `keepsRunning` lists a sidebar panel only while its tab is the current tab, as `"its sidebar tab is the current tab"`. A test that expected `conflict` for a ninth tab, or `"a mounted panel"` for a sidebar panel, now fails.
|
package/dist/docs-tree.json.gz
CHANGED
|
Binary file
|
package/dist/plugin/testing.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ type Call = {
|
|
|
115
115
|
* import assert from "node:assert/strict";
|
|
116
116
|
* declare const host: TestHost;
|
|
117
117
|
* // ---cut---
|
|
118
|
-
* await host.command("open-picture").run(); // the plugin calls
|
|
118
|
+
* await host.command("open-picture").run(); // the plugin calls pictureWindow.show()
|
|
119
119
|
* const picture = host.window("picture");
|
|
120
120
|
* assert.equal(picture.visible, true);
|
|
121
121
|
* picture.emit("adjust", "brightness", 40); // fire a Slint callback
|
|
@@ -2746,11 +2746,11 @@ export declare class TestHost implements Transport {
|
|
|
2746
2746
|
* declare const host: TestHost;
|
|
2747
2747
|
* declare const expected: string;
|
|
2748
2748
|
* // ---cut---
|
|
2749
|
-
* const
|
|
2750
|
-
*
|
|
2751
|
-
* for (let i = 0; i < 100 &&
|
|
2749
|
+
* const importWindow = host.window("import");
|
|
2750
|
+
* importWindow.emit("load-file"); // the plugin reads and parses the file itself
|
|
2751
|
+
* for (let i = 0; i < 100 && importWindow.props["status-text"] !== expected; i++)
|
|
2752
2752
|
* await host.settle(20);
|
|
2753
|
-
* assert.equal(
|
|
2753
|
+
* assert.equal(importWindow.props["status-text"], expected);
|
|
2754
2754
|
* ```
|
|
2755
2755
|
*
|
|
2756
2756
|
* @capability None.
|
package/dist/plugin/testing.js
CHANGED
|
@@ -3479,11 +3479,11 @@ export class TestHost {
|
|
|
3479
3479
|
* declare const host: TestHost;
|
|
3480
3480
|
* declare const expected: string;
|
|
3481
3481
|
* // ---cut---
|
|
3482
|
-
* const
|
|
3483
|
-
*
|
|
3484
|
-
* for (let i = 0; i < 100 &&
|
|
3482
|
+
* const importWindow = host.window("import");
|
|
3483
|
+
* importWindow.emit("load-file"); // the plugin reads and parses the file itself
|
|
3484
|
+
* for (let i = 0; i < 100 && importWindow.props["status-text"] !== expected; i++)
|
|
3485
3485
|
* await host.settle(20);
|
|
3486
|
-
* assert.equal(
|
|
3486
|
+
* assert.equal(importWindow.props["status-text"], expected);
|
|
3487
3487
|
* ```
|
|
3488
3488
|
*
|
|
3489
3489
|
* @capability None.
|
package/dist/plugin/types.d.ts
CHANGED
|
@@ -367,10 +367,10 @@ export interface Scope extends Disposable {
|
|
|
367
367
|
* return;
|
|
368
368
|
* }
|
|
369
369
|
* live = plugin.scope();
|
|
370
|
-
* const
|
|
370
|
+
* const statsWindow = live.windows.create("ui/stats.slint");
|
|
371
371
|
* const timer = setInterval(() => live?.update(), 1000);
|
|
372
372
|
* live.onDispose(() => clearInterval(timer));
|
|
373
|
-
* await
|
|
373
|
+
* await statsWindow.show();
|
|
374
374
|
* },
|
|
375
375
|
* });
|
|
376
376
|
* ```
|
|
@@ -487,12 +487,12 @@ export interface Scope extends Disposable {
|
|
|
487
487
|
* promise settles; state changed between the awaits of a long handler
|
|
488
488
|
* shows only after an explicit `update()`.
|
|
489
489
|
* ```ts
|
|
490
|
-
* declare const
|
|
490
|
+
* declare const downloadWindow: Window;
|
|
491
491
|
* declare function downloadPart(part: number): Promise<void>;
|
|
492
492
|
* // ---cut---
|
|
493
493
|
* let done = 0;
|
|
494
|
-
*
|
|
495
|
-
*
|
|
494
|
+
* downloadWindow.bind(() => ({ progress: done }));
|
|
495
|
+
* downloadWindow.on("start", async () => {
|
|
496
496
|
* for (let part = 0; part < 10; part++) {
|
|
497
497
|
* await downloadPart(part);
|
|
498
498
|
* done = part + 1;
|
|
@@ -1682,11 +1682,11 @@ export interface Ui {
|
|
|
1682
1682
|
* calls `image()` again after rewriting it, because the SDK does not send
|
|
1683
1683
|
* a value that did not change.
|
|
1684
1684
|
* ```ts
|
|
1685
|
-
* const
|
|
1685
|
+
* const thumbnailWindow = plugin.windows.create("ui/thumbnail.slint");
|
|
1686
1686
|
* const file = `${plugin.dataDirectory}/thumbnail.png`;
|
|
1687
1687
|
* // … write the PNG to `file` (for example with plugin.tools.run("ffmpeg", …)) …
|
|
1688
|
-
*
|
|
1689
|
-
* await
|
|
1688
|
+
* thumbnailWindow.set({ thumbnail: plugin.ui.image(file) });
|
|
1689
|
+
* await thumbnailWindow.show();
|
|
1690
1690
|
* ```
|
|
1691
1691
|
*
|
|
1692
1692
|
* @since 1.0.0
|
|
@@ -1850,11 +1850,11 @@ export interface Ui {
|
|
|
1850
1850
|
* const response = await fetch(readmeUrl);
|
|
1851
1851
|
* if (!response.ok) throw new Error(`README: HTTP ${response.status}`);
|
|
1852
1852
|
* const text = await response.text();
|
|
1853
|
-
* const
|
|
1853
|
+
* const readmeWindow = plugin.windows.create("ui/readme.slint");
|
|
1854
1854
|
* // Bound before the first `show`, as a tool window requires.
|
|
1855
|
-
*
|
|
1856
|
-
*
|
|
1857
|
-
* await
|
|
1855
|
+
* readmeWindow.on("openLink", (url: string) => plugin.system.openUrl(url));
|
|
1856
|
+
* readmeWindow.set({ doc: await plugin.ui.markdown(text, { base: readmeUrl }) });
|
|
1857
|
+
* await readmeWindow.show();
|
|
1858
1858
|
* ```
|
|
1859
1859
|
*
|
|
1860
1860
|
* @since 1.1.0
|
|
@@ -1999,10 +1999,10 @@ export interface View {
|
|
|
1999
1999
|
* sends the value even though it equals the one sent before, which is
|
|
2000
2000
|
* what pulls a control the user moved back to the plugin's value.
|
|
2001
2001
|
* ```ts
|
|
2002
|
-
* const
|
|
2002
|
+
* const presetsWindow = plugin.windows.create("ui/presets.slint");
|
|
2003
2003
|
* let presetIndex = 0;
|
|
2004
|
-
*
|
|
2005
|
-
* if (index > 2)
|
|
2004
|
+
* presetsWindow.on("presetChosen", (index: number) => {
|
|
2005
|
+
* if (index > 2) presetsWindow.set({ presetIndex }); // "Custom" is not a preset
|
|
2006
2006
|
* else presetIndex = index;
|
|
2007
2007
|
* });
|
|
2008
2008
|
* ```
|
|
@@ -2165,9 +2165,9 @@ export interface Window extends View, Disposable {
|
|
|
2165
2165
|
* window; it rejects with a code, such as `host` for a Slint file that
|
|
2166
2166
|
* does not compile or `unavailable` without a user interface.
|
|
2167
2167
|
* ```ts
|
|
2168
|
-
* const
|
|
2168
|
+
* const inspectorWindow = plugin.windows.create("ui/inspector.slint");
|
|
2169
2169
|
* try {
|
|
2170
|
-
* await
|
|
2170
|
+
* await inspectorWindow.show();
|
|
2171
2171
|
* } catch (error) {
|
|
2172
2172
|
* // The code is data; `message` has the details for the log.
|
|
2173
2173
|
* await plugin.osd.show("Cannot open the inspector ({})", [(error as PluginError).code]);
|
|
@@ -2276,8 +2276,8 @@ export interface Window extends View, Disposable {
|
|
|
2276
2276
|
* store writes the change to `window.json` shortly after.
|
|
2277
2277
|
* ```ts
|
|
2278
2278
|
* const store = plugin.storage.json("window", { defaults: { open: false } });
|
|
2279
|
-
* const
|
|
2280
|
-
*
|
|
2279
|
+
* const notesWindow = plugin.windows.create("ui/notes.slint");
|
|
2280
|
+
* notesWindow.onClose(() => store.save({ open: false }));
|
|
2281
2281
|
* ```
|
|
2282
2282
|
*
|
|
2283
2283
|
* @see [Remember a window's state between runs](../../docs/how-to/window-state.md)
|
|
@@ -5390,9 +5390,9 @@ export interface Stream extends Disposable {
|
|
|
5390
5390
|
* connection; it resolves once both are closed.
|
|
5391
5391
|
* ```ts
|
|
5392
5392
|
* declare const stream: Stream;
|
|
5393
|
-
* declare const
|
|
5393
|
+
* declare const generatorWindow: Window;
|
|
5394
5394
|
* // ---cut---
|
|
5395
|
-
*
|
|
5395
|
+
* generatorWindow.onClose(() => stream.stop());
|
|
5396
5396
|
* ```
|
|
5397
5397
|
*
|
|
5398
5398
|
* @since 1.0.0
|
|
@@ -9660,10 +9660,10 @@ export interface JsonStore<T> extends Disposable {
|
|
|
9660
9660
|
* writes the file only once the user stops for 300 ms. Each `save`
|
|
9661
9661
|
* replaces the value and restarts the debounce timer.
|
|
9662
9662
|
* ```ts
|
|
9663
|
-
* declare const
|
|
9663
|
+
* declare const volumeWindow: Window;
|
|
9664
9664
|
* // ---cut---
|
|
9665
9665
|
* const store = plugin.storage.json("prefs", { defaults: { volume: 100 } });
|
|
9666
|
-
*
|
|
9666
|
+
* volumeWindow.on("volumeChanged", (volume: number) => store.save({ ...store.value, volume }));
|
|
9667
9667
|
* ```
|
|
9668
9668
|
*
|
|
9669
9669
|
* @since 1.0.0
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Vestra Player SDK
|
|
2
2
|
|
|
3
|
-
> @vestra-player/sdk 1.6.
|
|
3
|
+
> @vestra-player/sdk 1.6.3: write plugins for Vestra Player in TypeScript (plugin API `vestra/1`). A plugin is a folder with `manifest.json` and an entry module whose default export `activate(plugin)` the player calls. The documentation is a tree of short pages read by path, like `go doc`: the same pages and API as https://vestrasys.github.io/vestra-player-sdk/.
|
|
4
4
|
|
|
5
5
|
## Read the documentation
|
|
6
6
|
|