clickgo-native 0.0.14 → 0.0.16

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/dist/index.d.ts CHANGED
@@ -16,6 +16,13 @@ export declare abstract class AbstractBoot {
16
16
  on(name: string, handler: (...param: any[]) => any | Promise<any>, once?: boolean): void;
17
17
  once(name: string, handler: (...param: any[]) => any | Promise<any>): void;
18
18
  off(name: string): void;
19
+ dialog(options?: string | {
20
+ 'type'?: 'info' | 'error' | 'question' | 'warning';
21
+ 'title'?: string;
22
+ 'message'?: string;
23
+ 'detail'?: string;
24
+ 'buttons'?: string[];
25
+ }): number;
19
26
  }
20
27
  export declare function launcher(boot: AbstractBoot): void;
21
28
  export declare function verifyToken(t: string): boolean;
package/dist/index.js CHANGED
@@ -370,6 +370,32 @@ const methods = {
370
370
  return exports.tool.parsePath(path);
371
371
  }
372
372
  },
373
+ 'cg-form-dialog': {
374
+ 'once': false,
375
+ handler: function (t, options = {}) {
376
+ var _a, _b;
377
+ if (!t || !form) {
378
+ return -1;
379
+ }
380
+ if (!verifyToken(t)) {
381
+ return -1;
382
+ }
383
+ if (typeof options === 'string') {
384
+ options = {
385
+ 'message': options
386
+ };
387
+ }
388
+ (_a = options.title) !== null && _a !== void 0 ? _a : (options.title = 'ClickGo');
389
+ (_b = options.message) !== null && _b !== void 0 ? _b : (options.message = '');
390
+ return electron.dialog.showMessageBoxSync(form, {
391
+ 'type': options.type,
392
+ 'title': options.title,
393
+ 'message': options.message,
394
+ 'detail': options.detail,
395
+ 'buttons': options.buttons,
396
+ });
397
+ }
398
+ },
373
399
  'cg-ping': {
374
400
  'once': false,
375
401
  handler: function (t) {
@@ -449,6 +475,26 @@ class AbstractBoot {
449
475
  }
450
476
  delete methods[name];
451
477
  }
478
+ dialog(options = {}) {
479
+ var _a, _b;
480
+ if (!form) {
481
+ return -1;
482
+ }
483
+ if (typeof options === 'string') {
484
+ options = {
485
+ 'message': options
486
+ };
487
+ }
488
+ (_a = options.title) !== null && _a !== void 0 ? _a : (options.title = 'ClickGo');
489
+ (_b = options.message) !== null && _b !== void 0 ? _b : (options.message = '');
490
+ return electron.dialog.showMessageBoxSync(form, {
491
+ 'type': options.type,
492
+ 'title': options.title,
493
+ 'message': options.message,
494
+ 'detail': options.detail,
495
+ 'buttons': options.buttons,
496
+ });
497
+ }
452
498
  }
453
499
  exports.AbstractBoot = AbstractBoot;
454
500
  function launcher(boot) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clickgo-native",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "The software developed with ClickGo will run in Windows, Mac OS, Linux.",
5
5
  "keywords": [
6
6
  "clickgo",
@@ -17,8 +17,8 @@
17
17
  "@litert/eslint-plugin-rules": "^0.3.1",
18
18
  "@litert/loader": "^3.5.9",
19
19
  "@types/node": "^24.0.14",
20
- "clickgo": "^3.16.19",
21
- "electron": "^37.2.1",
20
+ "clickgo": "^3.16.20",
21
+ "electron": "^37.2.2",
22
22
  "jszip": "^3.10.1",
23
23
  "typescript": "^5.8.3"
24
24
  }