@tauri-apps/plugin-window-state 2.0.0-alpha.1 → 2.0.0-alpha.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/README.md +1 -1
- package/dist-js/index.d.ts +0 -16
- package/dist-js/index.min.js +1934 -3
- package/dist-js/index.mjs +6 -3
- package/package.json +2 -2
package/dist-js/index.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { invoke } from '@tauri-apps/api/primitives';
|
|
2
|
+
import { getCurrent } from '@tauri-apps/api/window';
|
|
3
|
+
|
|
1
4
|
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
|
2
5
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
6
|
// SPDX-License-Identifier: MIT
|
|
@@ -15,7 +18,7 @@ var StateFlags;
|
|
|
15
18
|
* Save the state of all open windows to disk.
|
|
16
19
|
*/
|
|
17
20
|
async function saveWindowState(flags) {
|
|
18
|
-
return
|
|
21
|
+
return invoke("plugin:window-state|save_window_state", {
|
|
19
22
|
flags,
|
|
20
23
|
});
|
|
21
24
|
}
|
|
@@ -23,7 +26,7 @@ async function saveWindowState(flags) {
|
|
|
23
26
|
* Restore the state for the specified window from disk.
|
|
24
27
|
*/
|
|
25
28
|
async function restoreState(label, flags) {
|
|
26
|
-
return
|
|
29
|
+
return invoke("plugin:window-state|restore_state", {
|
|
27
30
|
label,
|
|
28
31
|
flags,
|
|
29
32
|
});
|
|
@@ -32,7 +35,7 @@ async function restoreState(label, flags) {
|
|
|
32
35
|
* Restore the state for the current window from disk.
|
|
33
36
|
*/
|
|
34
37
|
async function restoreStateCurrent(flags) {
|
|
35
|
-
return restoreState(
|
|
38
|
+
return restoreState(getCurrent().label, flags);
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
export { StateFlags, restoreState, restoreStateCurrent, saveWindowState };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tauri-apps/plugin-window-state",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
4
4
|
"description": "Save window positions and sizes and restore them when the app is reopened.",
|
|
5
5
|
"license": "MIT or APACHE-2.0",
|
|
6
6
|
"authors": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"tslib": "2.6.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tauri-apps/api": "2.0.0-alpha.
|
|
28
|
+
"@tauri-apps/api": "2.0.0-alpha.11"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "rollup -c"
|