@wailsio/runtime 3.0.0-alpha.29 → 3.0.0-alpha.30

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/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@wailsio/runtime",
3
3
  "type": "module",
4
- "version": "3.0.0-alpha.29",
4
+ "version": "3.0.0-alpha.30",
5
5
  "description": "Wails Runtime",
6
+ "types": "types/index.d.ts",
6
7
  "exports": {
7
8
  ".": {
8
9
  "types": "./types/index.d.ts",
@@ -19,7 +20,7 @@
19
20
  "build:types": "npx -p typescript tsc src/index.js --declaration --allowJs --emitDeclarationOnly --outDir types",
20
21
  "postbuild:types": "wails3 task generate:events",
21
22
  "build:docs": "npx typedoc ./src/index.js",
22
- "build:docs:md": "npx typedoc --plugin typedoc-plugin-markdown --namedAnchors true --hideBreadcrumbs true --out ../../../../../../mkdocs-website/docs/en/api/js ./src/index.js"
23
+ "build:docs:md": "npx typedoc --plugin typedoc-plugin-markdown --namedAnchors true --hideBreadcrumbs true --out ../../../../../../old_mkdocs/docs/en/api/js ./src/index.js"
23
24
  },
24
25
  "author": "The Wails Team",
25
26
  "license": "MIT",
@@ -189,5 +189,6 @@ export const EventTypes = {
189
189
  ThemeChanged: "common:ThemeChanged",
190
190
  WindowDidMove: "common:WindowDidMove",
191
191
  WindowDidResize: "common:WindowDidResize",
192
+ ApplicationOpenedWithFile: "common:ApplicationOpenedWithFile",
192
193
  },
193
194
  };
package/src/index.js CHANGED
@@ -43,6 +43,18 @@ export {
43
43
  WML
44
44
  };
45
45
 
46
+ let initialised = false;
47
+ export function init() {
48
+ window._wails.invoke = System.invoke;
49
+ System.invoke("wails:runtime:ready");
50
+ initialised = true;
51
+ }
52
+
53
+ window.addEventListener("load", () => {
54
+ if (!initialised) {
55
+ init();
56
+ }
57
+ });
58
+
46
59
  // Notify backend
47
- window._wails.invoke = System.invoke;
48
- System.invoke("wails:runtime:ready");
60
+
package/src/window.js CHANGED
@@ -90,7 +90,7 @@ const ZoomResetMethod = 47;
90
90
  */
91
91
  const caller = Symbol();
92
92
 
93
- class Window {
93
+ export class Window {
94
94
  /**
95
95
  * Initialises a window object with the specified name.
96
96
  *
@@ -189,5 +189,6 @@ export declare const EventTypes: {
189
189
  ThemeChanged: string,
190
190
  WindowDidMove: string,
191
191
  WindowDidResize: string,
192
+ ApplicationOpenedWithFile: string,
192
193
  },
193
194
  };