clickgo-native 0.0.19 → 1.0.0

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/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright [yyyy] [name of copyright owner]
189
+ Copyright 2025 MAIYUN.NET
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -1,13 +1,20 @@
1
1
  # ClickGo Native
2
2
 
3
- <p align="center"><img src="dist/icon.png" width="100" height="100" alt="ClickGo Native"></p>
4
-
5
- [![npm version](https://img.shields.io/npm/v/clickgo-native.svg?colorB=brightgreen)](https://www.npmjs.com/package/clickgo-native "Stable Version")
6
- [![npm version](https://img.shields.io/npm/v/clickgo-native/dev.svg)](https://www.npmjs.com/package/clickgo-native "Development Version")
7
- [![License](https://img.shields.io/github/license/maiyun/clickgo-native.svg)](https://github.com/maiyun/clickgo-native/blob/master/LICENSE)
8
- [![GitHub issues](https://img.shields.io/github/issues/maiyun/clickgo-native.svg)](https://github.com/maiyun/clickgo-native/issues)
9
- [![GitHub Releases](https://img.shields.io/github/release/maiyun/clickgo-native.svg)](https://github.com/maiyun/clickgo-native/releases "Stable Release")
10
- [![GitHub Pre-Releases](https://img.shields.io/github/release/maiyun/clickgo-native/all.svg)](https://github.com/maiyun/clickgo-native/releases "Pre-Release")
3
+ <p align="center"><img src="./dist/icon.png" width="100" height="100" alt="ClickGo Native"></p>
4
+ <p align="center">
5
+ <a href="https://github.com/maiyun/clickgo-native/blob/master/LICENSE">
6
+ <img alt="License" src="https://img.shields.io/github/license/maiyun/clickgo-native?color=blue" />
7
+ </a>
8
+ <a href="https://www.npmjs.com/package/clickgo-native">
9
+ <img alt="NPM stable version" src="https://img.shields.io/npm/v/clickgo-native?color=brightgreen&logo=npm" />
10
+ </a>
11
+ <a href="https://github.com/maiyun/clickgo-native/releases">
12
+ <img alt="GitHub releases" src="https://img.shields.io/github/v/release/maiyun/clickgo-native?color=brightgreen&logo=github" />
13
+ </a>
14
+ <a href="https://github.com/maiyun/clickgo-native/issues">
15
+ <img alt="GitHub issues" src="https://img.shields.io/github/issues/maiyun/clickgo-native?color=blue&logo=github" />
16
+ </a>
17
+ </p>
11
18
 
12
19
  The software developed with ClickGo will run in Windows, Mac OS, Linux.
13
20
 
@@ -19,12 +26,6 @@ You can install directly using NPM:
19
26
  $ npm i clickgo-native --save
20
27
  ```
21
28
 
22
- Or install the developing (unstable) version for newest features:
23
-
24
- ```sh
25
- $ npm i clickgo-native@dev --save
26
- ```
27
-
28
29
  **Node**
29
30
 
30
31
  ```typescript
@@ -41,10 +42,6 @@ native.launcher(new Boot());
41
42
 
42
43
  Clone and `npm run native`.
43
44
 
44
- ## Changelog
45
-
46
- [Changelog](doc/CHANGELOG.md)
47
-
48
45
  ## License
49
46
 
50
47
  This library is published under [Apache-2.0](./LICENSE) license.
package/dist/index.d.ts CHANGED
@@ -1,22 +1,68 @@
1
- import * as libFs from './lib/fs';
2
- export declare const fs: typeof libFs;
3
- import * as libTool from './lib/tool';
4
- export declare const tool: typeof libTool;
1
+ /** --- 全局类 --- */
5
2
  export declare abstract class AbstractBoot {
6
- get isImmersion(): boolean;
3
+ /**
4
+ * --- 是否含有实体窗体边框和标题 ---
5
+ */
7
6
  get hasFrame(): boolean;
7
+ /**
8
+ * --- 没有实体窗体时整个实体进程是不是会被结束 ---
9
+ */
8
10
  get isNoFormQuit(): boolean;
11
+ /**
12
+ * --- 当前系统代号 ---
13
+ */
9
14
  get platform(): NodeJS.Platform;
15
+ /**
16
+ * --- 当前的通讯 token ---
17
+ */
10
18
  get token(): string;
19
+ /** --- 入口方法 --- */
11
20
  abstract main(): void | Promise<void>;
21
+ /**
22
+ * --- 开始运行起来一个主实体窗体,整个进程本方法只能执行一次 ---
23
+ * @param path 实体窗体网页路径
24
+ * @param opt 参数
25
+ */
12
26
  run(path: string, opt?: {
27
+ /** --- 是否显示实体窗体边框和标题,默认 true --- */
13
28
  'frame'?: boolean;
29
+ /** --- 没有实体窗体时整个实体进程是不是会被结束,默认 true --- */
14
30
  'quit'?: boolean;
31
+ /** --- 是否是开发模式,默认 false --- */
15
32
  'dev'?: boolean;
33
+ /** --- 自定义宽度 --- */
34
+ 'width'?: number;
35
+ /** --- 自定义高度 --- */
36
+ 'height'?: number;
37
+ /** --- 是否有最大化按钮,默认 true --- */
38
+ 'max'?: boolean;
39
+ /** --- 最大化状态,默认 false --- */
40
+ 'stateMax'?: boolean;
41
+ /** --- 应用启动后、网页加载成功前显示的底色 --- */
42
+ 'background'?: string;
16
43
  }): void;
44
+ /**
45
+ * --- 绑定监听网页调用方法的方法 ---
46
+ * @param name 方法名
47
+ * @param handler 要执行的函数
48
+ * @param once 是否只执行一次
49
+ */
17
50
  on(name: string, handler: (...param: any[]) => any | Promise<any>, once?: boolean): void;
51
+ /**
52
+ * --- 绑定监听网页调用方法的方法但只会执行一次 ---
53
+ * @param name 方法名
54
+ * @param handler 要执行的函数
55
+ */
18
56
  once(name: string, handler: (...param: any[]) => any | Promise<any>): void;
57
+ /**
58
+ * --- 解绑监听的方法 ---
59
+ * @param name 方法名
60
+ */
19
61
  off(name: string): void;
62
+ /**
63
+ * --- 显示一个 dialog ---
64
+ * @param opt 选项或者一段文字
65
+ */
20
66
  dialog(options?: string | {
21
67
  'type'?: 'info' | 'error' | 'question' | 'warning';
22
68
  'title'?: string;
@@ -25,5 +71,24 @@ export declare abstract class AbstractBoot {
25
71
  'buttons'?: string[];
26
72
  }): number;
27
73
  }
74
+ export declare function showMainForm(path: string, opt?: {
75
+ /** --- 是否是开发模式,默认 false --- */
76
+ 'dev'?: boolean;
77
+ /** --- 自定义宽度 --- */
78
+ 'width'?: number;
79
+ /** --- 自定义高度 --- */
80
+ 'height'?: number;
81
+ /** --- 是否有最大化按钮,默认 true --- */
82
+ 'max'?: boolean;
83
+ /** --- 最大化状态,默认 false --- */
84
+ 'stateMax'?: boolean;
85
+ /** --- 应用启动后、网页加载成功前显示的底色 --- */
86
+ 'background'?: string;
87
+ }): void;
88
+ /** --- 用户调用运行 boot 类 --- */
28
89
  export declare function launcher(boot: AbstractBoot): void;
90
+ /**
91
+ * --- 验证 token 是否正确 ---
92
+ * @param t 要验证的 token
93
+ */
29
94
  export declare function verifyToken(t: string): boolean;