win_webview2 1.1.19 → 1.1.21

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 (30) hide show
  1. package/dist/browser/runVirtualDirBrowser.d.ts +7 -0
  2. package/dist/browser/runVirtualDirBrowser.js +11 -0
  3. package/dist/browser/ww2_browser.d.ts +2 -1
  4. package/dist/browser/ww2_browser.js +2 -0
  5. package/dist/node/tsExport/downloadModule.d.ts +15 -3
  6. package/dist/node/tsExport/downloadModule.js +1 -1
  7. package/dist/node/tsExport/runVirtualDir/checkFile.d.ts +2 -0
  8. package/dist/node/tsExport/runVirtualDir/checkFile.js +23 -0
  9. package/dist/node/tsExport/runVirtualDir/checkMapFunction.d.ts +9 -0
  10. package/dist/node/tsExport/runVirtualDir/checkMapFunction.js +40 -0
  11. package/dist/node/tsExport/runVirtualDir/checkWW2.d.ts +8 -0
  12. package/dist/node/tsExport/runVirtualDir/checkWW2.js +74 -0
  13. package/dist/node/tsExport/runVirtualDir/runVirtualDir.d.ts +7 -0
  14. package/dist/node/tsExport/runVirtualDir/runVirtualDir.js +69 -0
  15. package/dist/node/tsExport/runVirtualDir/runVirtualDirCheckWW2.d.ts +1 -0
  16. package/dist/node/tsExport/runVirtualDir/runVirtualDirCheckWW2.js +2 -0
  17. package/dist/node/tsExport/runVirtualDir/runVirtualDirUtil.d.ts +1 -0
  18. package/dist/node/tsExport/runVirtualDir/runVirtualDirUtil.js +2 -0
  19. package/dist/node/tsExport/runVirtualDir/util.d.ts +8 -0
  20. package/dist/node/tsExport/runVirtualDir/util.js +31 -0
  21. package/dist/node/tsExport/runVirtualDir.d.ts +12 -0
  22. package/dist/node/tsExport/runVirtualDir.js +110 -0
  23. package/dist/node/tsExport/runVirtualDirCheckWW2.d.ts +1 -0
  24. package/dist/node/tsExport/runVirtualDirCheckWW2.js +2 -0
  25. package/dist/node/tsExport/runVirtualDirUtil.d.ts +1 -0
  26. package/dist/node/tsExport/runVirtualDirUtil.js +2 -0
  27. package/dist/node/tsExport/winwebview2.d.ts +2 -1
  28. package/dist/node/tsExport/winwebview2.js +3 -1
  29. package/dist/node/tsExport/ww2_server.js +2 -2
  30. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ export declare function callVirtualDirFunction(arg: {
2
+ funName: string;
3
+ params: object;
4
+ }): Promise<{
5
+ err: string;
6
+ result: object;
7
+ }>;
@@ -0,0 +1,11 @@
1
+ export async function callVirtualDirFunction(arg) {
2
+ let response = await fetch("/ww2_postmethod", {
3
+ method: "POST",
4
+ body: JSON.stringify(arg),
5
+ headers: {
6
+ "Content-Type": "application/json"
7
+ },
8
+ });
9
+ let result = await response.json();
10
+ return result;
11
+ }
@@ -1,3 +1,4 @@
1
+ import { callVirtualDirFunction } from "./runVirtualDirBrowser";
1
2
  interface WW2FileDialogArg {
2
3
  filter: string;
3
4
  ownerClassName: string;
@@ -29,4 +30,4 @@ export declare function callWw2(arg: PostData): Promise<{
29
30
  err: string;
30
31
  result: string;
31
32
  }>;
32
- export {};
33
+ export { callVirtualDirFunction };
@@ -1,3 +1,4 @@
1
+ import { callVirtualDirFunction } from "./runVirtualDirBrowser";
1
2
  export async function callWw2(arg) {
2
3
  let response = await fetch("/ww2_post", {
3
4
  method: "POST",
@@ -9,3 +10,4 @@ export async function callWw2(arg) {
9
10
  let result = await response.json();
10
11
  return result;
11
12
  }
13
+ export { callVirtualDirFunction };
@@ -1,6 +1,16 @@
1
1
  import { WwvPlatFrom } from "./ww2_config";
2
- interface Ww2WebConfig {
3
- callback: (err: any, data: any) => void;
2
+ interface ResourceRequest {
3
+ uri: string;
4
+ method: string;
5
+ body: Uint8Array;
6
+ }
7
+ interface ResourceResponse {
8
+ status: number;
9
+ contentType: string;
10
+ body: Uint8Array;
11
+ }
12
+ export interface Ww2WebConfig {
13
+ onClose: (err: any, data: any) => void;
4
14
  wclassname: string;
5
15
  url: string;
6
16
  title: string;
@@ -9,6 +19,8 @@ interface Ww2WebConfig {
9
19
  isKiosk: boolean;
10
20
  isMaximize: boolean;
11
21
  isDebug: boolean;
22
+ virtualHostName?: string;
23
+ onVirtualHostRequested?: (req: ResourceRequest, reply: (res: ResourceResponse) => void) => void;
12
24
  }
13
25
  interface WW2FileDialogArg {
14
26
  callback: (err: any, data: any) => void;
@@ -23,7 +35,7 @@ export interface WW2ControlWindowsArg {
23
35
  height?: number;
24
36
  width?: number;
25
37
  }
26
- interface Ww2Module {
38
+ export interface Ww2Module {
27
39
  openWeb: (arg: Ww2WebConfig) => void;
28
40
  openFileDialog: (arg: WW2FileDialogArg) => void;
29
41
  openFolderDialog: (arg: WW2FileDialogArg) => void;
@@ -22,7 +22,7 @@ function extractZip(zipPath, targetDir) {
22
22
  }
23
23
  }
24
24
  ;
25
- const binFileVersion = "1.1.16";
25
+ const binFileVersion = "1.1.21";
26
26
  async function downloadModuleFile(platform) {
27
27
  let modulePath = (0, dirnameTool_1.getWWVNodeModuleFolder)();
28
28
  let winlibPath = node_path_1.default.join(modulePath, "win_lib");
@@ -0,0 +1,2 @@
1
+ import { InternalFunctionResultPromise } from "./util";
2
+ export declare function checkFileFromVirtualFolder(htmlFolderPath: string, currentPath: string): InternalFunctionResultPromise;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.checkFileFromVirtualFolder = checkFileFromVirtualFolder;
7
+ const node_fs_1 = require("node:fs");
8
+ const util_1 = require("./util");
9
+ const node_path_1 = __importDefault(require("node:path"));
10
+ const promises_1 = require("node:fs/promises");
11
+ async function checkFileFromVirtualFolder(htmlFolderPath, currentPath) {
12
+ let contentType = (0, util_1.getContentType)(currentPath);
13
+ let filePath = node_path_1.default.join(htmlFolderPath, currentPath);
14
+ if (!(0, node_fs_1.existsSync)(filePath)) {
15
+ return null;
16
+ }
17
+ let fileContent = await (0, promises_1.readFile)(filePath);
18
+ let uint8 = new Uint8Array(fileContent);
19
+ return {
20
+ content: uint8,
21
+ contentType
22
+ };
23
+ }
@@ -0,0 +1,9 @@
1
+ import { InternalFunctionResultPromise } from "./util";
2
+ export declare function checkMapFunction(arg: {
3
+ mapfunction: {
4
+ [key: string]: (msg: object) => Promise<object>;
5
+ };
6
+ body: Uint8Array;
7
+ method: string;
8
+ path: string;
9
+ }): InternalFunctionResultPromise;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkMapFunction = checkMapFunction;
4
+ const util_1 = require("./util");
5
+ async function checkMapFunction(arg) {
6
+ if (arg.path != "/ww2_postmethod")
7
+ return null;
8
+ if (arg.method != "POST")
9
+ return null;
10
+ if (arg.body == null)
11
+ return null;
12
+ let jsonResponse = {
13
+ data: null,
14
+ error: null
15
+ };
16
+ try {
17
+ let bodyString = (0, util_1.byteArrayToString)(arg.body);
18
+ let bodyObject = JSON.parse(bodyString);
19
+ if (bodyObject.funName == null || bodyObject.funName == "")
20
+ throw "no method name";
21
+ if (!arg.mapfunction[bodyObject.funName])
22
+ throw "no method match";
23
+ jsonResponse.data = await arg.mapfunction[bodyObject.funName](bodyObject.params);
24
+ }
25
+ catch (error) {
26
+ jsonResponse.error = error;
27
+ }
28
+ let serverResponse = null;
29
+ try {
30
+ let responseText = JSON.stringify(jsonResponse);
31
+ serverResponse = {
32
+ content: (0, util_1.byteArrayFromString)(responseText),
33
+ contentType: "application/json"
34
+ };
35
+ }
36
+ catch (error) {
37
+ console.log(error);
38
+ }
39
+ return serverResponse;
40
+ }
@@ -0,0 +1,8 @@
1
+ import { Ww2Module } from "../downloadModule";
2
+ import { InternalFunctionResultPromise } from "./util";
3
+ export declare function checkWw2BrowserFunction(arg: {
4
+ path: string;
5
+ method: string;
6
+ body: Uint8Array;
7
+ ww2Module: Ww2Module;
8
+ }): InternalFunctionResultPromise;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkWw2BrowserFunction = checkWw2BrowserFunction;
4
+ const util_1 = require("./util");
5
+ async function checkWw2BrowserFunction(arg) {
6
+ if (arg.path != "/ww2_post")
7
+ return null;
8
+ if (arg.method != "POST")
9
+ return null;
10
+ if (arg.body == null)
11
+ return null;
12
+ let result = null;
13
+ try {
14
+ let resultText = "";
15
+ let bodyString = (0, util_1.byteArrayToString)(arg.body);
16
+ let body = JSON.parse(bodyString);
17
+ let ww2Module = arg.ww2Module;
18
+ if (body.openWeb) {
19
+ let openWebArg = body.openWeb;
20
+ ww2Module.openWeb({
21
+ onClose: () => {
22
+ },
23
+ height: openWebArg.height,
24
+ wclassname: openWebArg.wclassname,
25
+ isDebug: openWebArg.isDebug,
26
+ isKiosk: openWebArg.isKiosk,
27
+ isMaximize: openWebArg.isMaximize,
28
+ title: openWebArg.title,
29
+ url: openWebArg.url,
30
+ width: openWebArg.width
31
+ });
32
+ resultText = "open web";
33
+ }
34
+ else if (body.controlWindow) {
35
+ ww2Module.controlWindow(body.controlWindow);
36
+ resultText = "controlWindow";
37
+ }
38
+ else if (body.openFileDialog) {
39
+ let openFileDialogArg = body.openFileDialog;
40
+ resultText = await new Promise((r, x) => {
41
+ ww2Module.openFileDialog({
42
+ callback: (err, d) => {
43
+ r(d);
44
+ },
45
+ filter: openFileDialogArg.filter,
46
+ ownerClassName: openFileDialogArg.ownerClassName
47
+ });
48
+ });
49
+ }
50
+ else if (body.openFolderDialog) {
51
+ let ofArg = body.openFolderDialog;
52
+ resultText = await new Promise((r, x) => {
53
+ ww2Module.openFolderDialog({
54
+ callback: (err, data) => {
55
+ r(data);
56
+ },
57
+ filter: ofArg.filter,
58
+ ownerClassName: ofArg.ownerClassName
59
+ });
60
+ });
61
+ }
62
+ let jsonStrResponse = JSON.stringify({
63
+ error: null,
64
+ result: resultText
65
+ });
66
+ result = {
67
+ content: (0, util_1.byteArrayFromString)(jsonStrResponse),
68
+ contentType: "application/json"
69
+ };
70
+ }
71
+ catch (error) {
72
+ }
73
+ return result;
74
+ }
@@ -0,0 +1,7 @@
1
+ import { Ww2WebConfig } from "../downloadModule";
2
+ export declare function runVirtualDir(config: Omit<Ww2WebConfig, "onVirtualHostRequested" | "url" | "virtualHostName"> & {
3
+ mapFunction: {
4
+ [key: string]: (msg: object) => Promise<object>;
5
+ };
6
+ htmlFolderPath: string;
7
+ }): void;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runVirtualDir = runVirtualDir;
4
+ const downloadModule_1 = require("../downloadModule");
5
+ const winwebview2_1 = require("../winwebview2");
6
+ const util_1 = require("./util");
7
+ const checkFile_1 = require("./checkFile");
8
+ const checkWW2_1 = require("./checkWW2");
9
+ const checkMapFunction_1 = require("./checkMapFunction");
10
+ function runVirtualDir(config) {
11
+ (0, downloadModule_1.getModule)().then((wwvModule) => {
12
+ (0, winwebview2_1.closeSplash)();
13
+ let hostname = "https://myapp.local";
14
+ let wwvConfig = {
15
+ onClose: config.onClose,
16
+ height: config.height,
17
+ width: config.width,
18
+ wclassname: config.wclassname,
19
+ isDebug: config.isDebug,
20
+ isKiosk: config.isKiosk,
21
+ isMaximize: config.isMaximize,
22
+ virtualHostName: hostname,
23
+ url: hostname,
24
+ onVirtualHostRequested: async (req, response) => {
25
+ try {
26
+ let parsedUrl = new URL(req.uri, hostname);
27
+ let cleanPath = parsedUrl.pathname;
28
+ if (cleanPath == "/" || cleanPath == "")
29
+ cleanPath = "index.html";
30
+ console.log(cleanPath);
31
+ let serverResponse = await (0, checkFile_1.checkFileFromVirtualFolder)(config.htmlFolderPath, cleanPath);
32
+ if (serverResponse == null) {
33
+ serverResponse = await (0, checkWW2_1.checkWw2BrowserFunction)({
34
+ body: req.body,
35
+ method: req.method,
36
+ path: cleanPath,
37
+ ww2Module: wwvModule
38
+ });
39
+ }
40
+ if (serverResponse == null) {
41
+ serverResponse = await (0, checkMapFunction_1.checkMapFunction)({
42
+ body: req.body,
43
+ mapfunction: config.mapFunction,
44
+ method: req.method,
45
+ path: cleanPath
46
+ });
47
+ }
48
+ if (serverResponse != null) {
49
+ response({
50
+ body: serverResponse.content,
51
+ contentType: serverResponse.contentType,
52
+ status: 200
53
+ });
54
+ return;
55
+ }
56
+ response({
57
+ body: (0, util_1.byteArrayFromString)("no response"),
58
+ contentType: "text/plain",
59
+ status: 404
60
+ });
61
+ }
62
+ catch (error) {
63
+ }
64
+ },
65
+ title: config.title,
66
+ };
67
+ wwvModule.openWeb(wwvConfig);
68
+ });
69
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export declare function byteArrayFromString(txt: string): Uint8Array<ArrayBuffer>;
2
+ export declare function byteArrayToString(body: Uint8Array): string;
3
+ export declare function getContentType(url: string): string;
4
+ export interface InternalFunctionResult {
5
+ content: Uint8Array;
6
+ contentType: string;
7
+ }
8
+ export type InternalFunctionResultPromise = Promise<InternalFunctionResult | null>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.byteArrayFromString = byteArrayFromString;
4
+ exports.byteArrayToString = byteArrayToString;
5
+ exports.getContentType = getContentType;
6
+ function byteArrayFromString(txt) {
7
+ const encoder = new TextEncoder();
8
+ const uint8Array = encoder.encode(txt);
9
+ return uint8Array;
10
+ }
11
+ function byteArrayToString(body) {
12
+ const decoder = new TextDecoder('utf-8');
13
+ const str = decoder.decode(body);
14
+ return str;
15
+ }
16
+ const mimeTypes = {
17
+ '.html': 'text/html',
18
+ '.js': 'application/javascript',
19
+ '.css': 'text/css',
20
+ '.json': 'application/json',
21
+ '.png': 'image/png',
22
+ '.jpg': 'image/jpeg',
23
+ '.gif': 'image/gif',
24
+ '.svg': 'image/svg+xml',
25
+ '.pdf': 'application/pdf',
26
+ '.zip': 'application/zip'
27
+ };
28
+ function getContentType(url) {
29
+ const ext = url.substring(url.lastIndexOf('.')).toLowerCase();
30
+ return mimeTypes[ext] || 'application/octet-stream';
31
+ }
@@ -0,0 +1,12 @@
1
+ import { Ww2WebConfig } from "./downloadModule";
2
+ export interface JsonMsg {
3
+ funName: string;
4
+ data: string;
5
+ replyFun: string;
6
+ }
7
+ export declare function runVirtualDir(config: Omit<Ww2WebConfig, "onVirtualHostRequested" | "url" | "virtualHostName"> & {
8
+ mapFunction: {
9
+ [key: string]: (msg: string) => Promise<string>;
10
+ };
11
+ htmlFolderPath: string;
12
+ }): void;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.runVirtualDir = runVirtualDir;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const downloadModule_1 = require("./downloadModule");
9
+ const winwebview2_1 = require("./winwebview2");
10
+ const node_fs_1 = require("node:fs");
11
+ const promises_1 = require("node:fs/promises");
12
+ function byteArrayFromString(txt) {
13
+ const encoder = new TextEncoder();
14
+ const uint8Array = encoder.encode(txt);
15
+ return uint8Array;
16
+ }
17
+ function byteArrayToString(body) {
18
+ const decoder = new TextDecoder('utf-8');
19
+ const str = decoder.decode(body);
20
+ return str;
21
+ }
22
+ const mimeTypes = {
23
+ '.html': 'text/html',
24
+ '.js': 'application/javascript',
25
+ '.css': 'text/css',
26
+ '.json': 'application/json',
27
+ '.png': 'image/png',
28
+ '.jpg': 'image/jpeg',
29
+ '.gif': 'image/gif',
30
+ '.svg': 'image/svg+xml',
31
+ '.pdf': 'application/pdf',
32
+ '.zip': 'application/zip'
33
+ };
34
+ function getContentType(url) {
35
+ const ext = url.substring(url.lastIndexOf('.')).toLowerCase();
36
+ return mimeTypes[ext] || 'application/octet-stream';
37
+ }
38
+ async function getFile(htmlFolderPath, currentPath) {
39
+ let contentType = getContentType(currentPath);
40
+ let filePath = node_path_1.default.join(htmlFolderPath, currentPath);
41
+ if (!(0, node_fs_1.existsSync)(filePath)) {
42
+ return null;
43
+ }
44
+ let fileContent = await (0, promises_1.readFile)(filePath);
45
+ let uint8 = new Uint8Array(fileContent);
46
+ return {
47
+ content: uint8,
48
+ contentType
49
+ };
50
+ }
51
+ async function checkWw2BrowserFunction(arg) {
52
+ if (arg.path != "/ww2_post")
53
+ return null;
54
+ if (arg.method != "POST")
55
+ return null;
56
+ if (arg.body == null)
57
+ return null;
58
+ let result = null;
59
+ try {
60
+ let bodyString = byteArrayToString(arg.body);
61
+ let jsonObj = JSON.parse(bodyString);
62
+ }
63
+ catch (error) {
64
+ }
65
+ return result;
66
+ }
67
+ function runVirtualDir(config) {
68
+ (0, downloadModule_1.getModule)().then((wwv) => {
69
+ (0, winwebview2_1.closeSplash)();
70
+ let hostname = "https://myapp.local";
71
+ let wwvConfig = {
72
+ onClose: config.onClose,
73
+ height: config.height,
74
+ width: config.width,
75
+ wclassname: config.wclassname,
76
+ isDebug: config.isDebug,
77
+ isKiosk: config.isKiosk,
78
+ isMaximize: config.isMaximize,
79
+ virtualHostName: hostname,
80
+ url: hostname,
81
+ onVirtualHostRequested: async (req, response) => {
82
+ try {
83
+ let parsedUrl = new URL(req.uri, hostname);
84
+ let cleanPath = parsedUrl.pathname;
85
+ if (cleanPath == "/")
86
+ cleanPath = "index.html";
87
+ console.log(cleanPath);
88
+ let file = await getFile(config.htmlFolderPath, cleanPath);
89
+ if (file != null) {
90
+ response({
91
+ body: file.content,
92
+ contentType: file.contentType,
93
+ status: 200
94
+ });
95
+ return;
96
+ }
97
+ response({
98
+ body: byteArrayFromString("test dulu"),
99
+ contentType: "text/plain",
100
+ status: 200
101
+ });
102
+ }
103
+ catch (error) {
104
+ }
105
+ },
106
+ title: config.title,
107
+ };
108
+ wwv.openWeb(wwvConfig);
109
+ });
110
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +1,10 @@
1
1
  import { getWWVNodeModuleFolder } from "./dirnameTool";
2
2
  import { readConfig } from "./ww2_config";
3
3
  import { downloadModuleAndExtract } from "./downloadModule";
4
+ import { runVirtualDir } from "./runVirtualDir/runVirtualDir";
4
5
  export declare function closeSplash(): Promise<void>;
5
6
  export * from "./downloadModule";
6
7
  export * from "./ww2_server";
7
8
  export { findUserProjectRoot } from "./dirnameTool";
8
9
  export { readConfig };
9
- export { getWWVNodeModuleFolder, downloadModuleAndExtract };
10
+ export { getWWVNodeModuleFolder, downloadModuleAndExtract, runVirtualDir };
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.downloadModuleAndExtract = exports.getWWVNodeModuleFolder = exports.readConfig = exports.findUserProjectRoot = void 0;
17
+ exports.runVirtualDir = exports.downloadModuleAndExtract = exports.getWWVNodeModuleFolder = exports.readConfig = exports.findUserProjectRoot = void 0;
18
18
  exports.closeSplash = closeSplash;
19
19
  const dirnameTool_1 = require("./dirnameTool");
20
20
  Object.defineProperty(exports, "getWWVNodeModuleFolder", { enumerable: true, get: function () { return dirnameTool_1.getWWVNodeModuleFolder; } });
@@ -22,6 +22,8 @@ const ww2_config_1 = require("./ww2_config");
22
22
  Object.defineProperty(exports, "readConfig", { enumerable: true, get: function () { return ww2_config_1.readConfig; } });
23
23
  const downloadModule_1 = require("./downloadModule");
24
24
  Object.defineProperty(exports, "downloadModuleAndExtract", { enumerable: true, get: function () { return downloadModule_1.downloadModuleAndExtract; } });
25
+ const runVirtualDir_1 = require("./runVirtualDir/runVirtualDir");
26
+ Object.defineProperty(exports, "runVirtualDir", { enumerable: true, get: function () { return runVirtualDir_1.runVirtualDir; } });
25
27
  function closeSplash() {
26
28
  return (0, downloadModule_1.getModule)().then((module) => {
27
29
  module.controlWindow({
@@ -21,7 +21,7 @@ async function ww2_CreateServer(arg) {
21
21
  if (body.openWeb) {
22
22
  let openWebArg = body.openWeb;
23
23
  ww2Module.openWeb({
24
- callback: () => {
24
+ onClose: () => {
25
25
  },
26
26
  height: openWebArg.height,
27
27
  wclassname: openWebArg.wclassname,
@@ -84,7 +84,7 @@ async function ww2_CreateServer(arg) {
84
84
  console.log("open UI");
85
85
  let uiConfig = arg.uiConfig;
86
86
  ww2Module.openWeb({
87
- callback: (err, data) => {
87
+ onClose: (err, data) => {
88
88
  process.exit();
89
89
  },
90
90
  wclassname: uiConfig.wclassname,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "win_webview2",
3
- "version": "1.1.19",
3
+ "version": "1.1.21",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/nnttoo/win_webview2"