electron-incremental-update 1.3.0 → 2.0.0-beta.10
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 +7 -3
- package/dist/chunk-4MH6ZXCY.js +81 -0
- package/dist/chunk-72ZAJ7AF.js +70 -0
- package/dist/chunk-KZSYEXLO.js +55 -0
- package/dist/index.cjs +173 -386
- package/dist/index.d.cts +84 -213
- package/dist/index.d.ts +84 -213
- package/dist/index.js +142 -282
- package/dist/provider.cjs +232 -0
- package/dist/provider.d.cts +109 -0
- package/dist/provider.d.ts +109 -0
- package/dist/provider.js +139 -0
- package/dist/types-Bnc4jz6R.d.ts +78 -0
- package/dist/types-DEYw5VrL.d.cts +78 -0
- package/dist/utils.cjs +175 -208
- package/dist/utils.d.cts +47 -87
- package/dist/utils.d.ts +47 -87
- package/dist/utils.js +3 -38
- package/dist/version-C4tF_trh.d.cts +62 -0
- package/dist/version-C4tF_trh.d.ts +62 -0
- package/dist/vite.d.ts +93 -95
- package/dist/vite.js +342 -350
- package/dist/zip-rm9ED9nU.d.cts +33 -0
- package/dist/zip-rm9ED9nU.d.ts +33 -0
- package/package.json +28 -16
- package/provider.d.ts +1 -0
- package/provider.js +1 -0
- package/dist/chunk-7ET4GMTZ.js +0 -236
- package/dist/chunk-CXHA5TF7.js +0 -236
- package/dist/chunk-HWUYTDEF.js +0 -236
- package/dist/chunk-RQCTJY4L.js +0 -236
- package/dist/chunk-SBPTSLG7.js +0 -235
- package/dist/pure-GoN_3MEj.d.cts +0 -31
- package/dist/pure-GoN_3MEj.d.ts +0 -31
package/dist/utils.d.cts
CHANGED
|
@@ -1,126 +1,86 @@
|
|
|
1
1
|
import { BrowserWindow } from 'electron';
|
|
2
|
-
export {
|
|
2
|
+
export { e as aesDecrypt, b as aesEncrypt, c as defaultSignature, a as defaultUnzipFile, f as defaultVerifySignature, d as defaultZipFile, h as hashBuffer } from './zip-rm9ED9nU.cjs';
|
|
3
|
+
export { U as UpdateInfo, a as UpdateJSON, V as Version, d as defaultIsLowerVersion, b as defaultVersionJsonGenerator, i as isUpdateJSON, p as parseVersion } from './version-C4tF_trh.cjs';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Compile time dev check
|
|
6
7
|
*/
|
|
7
|
-
declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly linux: boolean;
|
|
12
|
-
};
|
|
8
|
+
declare const isDev: boolean;
|
|
9
|
+
declare const isWin: boolean;
|
|
10
|
+
declare const isMac: boolean;
|
|
11
|
+
declare const isLinux: boolean;
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
13
|
+
* Get the absolute path of `${electron.app.name}.asar` (not `app.asar`)
|
|
15
14
|
*
|
|
16
|
-
*
|
|
15
|
+
* If is in dev, **always** return `'DEV.asar'`
|
|
17
16
|
*/
|
|
18
|
-
declare function getPathFromAppNameAsar(...
|
|
17
|
+
declare function getPathFromAppNameAsar(...paths: string[]): string;
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* App version is read from `version` file in `${electron.app.name}.asar`
|
|
23
|
-
*
|
|
24
|
-
* Entry version is read from `package.json`
|
|
25
|
-
*
|
|
26
|
-
* SystemVersion: `${platform} ${os.release()}`
|
|
19
|
+
* Get app version, if is in dev, return `getEntryVersion()`
|
|
27
20
|
*/
|
|
28
|
-
declare function
|
|
29
|
-
appVersion: string;
|
|
30
|
-
entryVersion: string;
|
|
31
|
-
electronVersion: string;
|
|
32
|
-
nodeVersion: string;
|
|
33
|
-
systemVersion: string;
|
|
34
|
-
};
|
|
21
|
+
declare function getAppVersion(): string;
|
|
35
22
|
/**
|
|
36
|
-
*
|
|
37
|
-
* @param moduleName file name in entry
|
|
23
|
+
* Get entry version
|
|
38
24
|
*/
|
|
39
|
-
|
|
25
|
+
declare function getEntryVersion(): string;
|
|
40
26
|
/**
|
|
41
|
-
* load module from entry
|
|
42
|
-
* @
|
|
43
|
-
* @param devEntryDirPath entry directory path when dev, default `../../dist-entry`
|
|
44
|
-
* @param entryDirPath entry directory path when not dev, default `join(app.getAppPath(), basename(devEntryDirPath))`
|
|
27
|
+
* Use `require` to load native module from entry asar
|
|
28
|
+
* @param moduleName file name in entry
|
|
45
29
|
* @example
|
|
46
|
-
*
|
|
47
|
-
* const db = requireNative<typeof import('../native/db')>('db')
|
|
48
|
-
* db.test()
|
|
30
|
+
* requireNative<typeof import('../native/db')>('db')
|
|
49
31
|
*/
|
|
50
|
-
declare function
|
|
32
|
+
declare function requireNative<T = any>(moduleName: string): T;
|
|
51
33
|
/**
|
|
52
34
|
* Restarts the Electron app.
|
|
53
35
|
*/
|
|
54
36
|
declare function restartApp(): void;
|
|
55
37
|
/**
|
|
56
|
-
*
|
|
57
|
-
* @param id app id
|
|
38
|
+
* Fix app use model id, only for Windows
|
|
39
|
+
* @param id app id, default is `org.${electron.app.name}`
|
|
58
40
|
*/
|
|
59
41
|
declare function setAppUserModelId(id?: string): void;
|
|
60
42
|
/**
|
|
61
|
-
*
|
|
43
|
+
* Disable hardware acceleration for Windows 7
|
|
62
44
|
*/
|
|
63
45
|
declare function disableHWAccForWin7(): void;
|
|
64
46
|
/**
|
|
65
|
-
*
|
|
47
|
+
* Keep single electron instance and auto restore window on `second-instance` event
|
|
66
48
|
* @param window brwoser window to show
|
|
67
49
|
* @returns `false` if the app is running
|
|
68
50
|
*/
|
|
69
51
|
declare function singleInstance(window?: BrowserWindow): boolean;
|
|
70
52
|
/**
|
|
71
|
-
*
|
|
53
|
+
* Set `AppData` dir to the dir of .exe file
|
|
72
54
|
*
|
|
73
|
-
*
|
|
55
|
+
* Useful for portable Windows app
|
|
74
56
|
* @param dirName dir name, default to `data`
|
|
75
57
|
*/
|
|
76
58
|
declare function setPortableAppDataPath(dirName?: string): void;
|
|
77
59
|
/**
|
|
78
|
-
*
|
|
79
|
-
* @param
|
|
60
|
+
* Load `process.env.VITE_DEV_SERVER_URL` when dev, else load html file
|
|
61
|
+
* @param win window
|
|
62
|
+
* @param htmlFilePath html file path, default is `index.html`
|
|
80
63
|
*/
|
|
81
|
-
declare function
|
|
64
|
+
declare function loadPage(win: BrowserWindow, htmlFilePath?: string): void;
|
|
82
65
|
/**
|
|
83
|
-
*
|
|
84
|
-
* @param
|
|
66
|
+
* Get joined path from preload dir
|
|
67
|
+
* @param paths rest paths
|
|
85
68
|
*/
|
|
86
|
-
declare function
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
* get path inside entry asar
|
|
103
|
-
* @param paths joined path
|
|
104
|
-
*/
|
|
105
|
-
getPathFromEntryAsar(...paths: string[]): string;
|
|
106
|
-
/**
|
|
107
|
-
* get path inside `${electron.app.name}.asar/main`
|
|
108
|
-
* @param paths joined path
|
|
109
|
-
*/
|
|
110
|
-
getPathFromMain(...paths: string[]): string;
|
|
111
|
-
/**
|
|
112
|
-
* get path inside `${electron.app.name}.asar/preload`
|
|
113
|
-
* @param paths joined path
|
|
114
|
-
*/
|
|
115
|
-
getPathFromPreload(...paths: string[]): string;
|
|
116
|
-
/**
|
|
117
|
-
* get path inside public dir
|
|
118
|
-
* @param paths joined path
|
|
119
|
-
*/
|
|
120
|
-
getPathFromPublic(...paths: string[]): string;
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
declare function unzipFile(gzipPath: string, targetFilePath?: string): Promise<unknown>;
|
|
124
|
-
declare function zipFile(filePath: string, targetFilePath?: string): Promise<unknown>;
|
|
69
|
+
declare function getPathFromPreload(...paths: string[]): string;
|
|
70
|
+
/**
|
|
71
|
+
* Get joined path from publich dir
|
|
72
|
+
* @param paths rest paths
|
|
73
|
+
*/
|
|
74
|
+
declare function getPathFromPublic(...paths: string[]): string;
|
|
75
|
+
/**
|
|
76
|
+
* Get joined path from entry asar
|
|
77
|
+
* @param paths rest paths
|
|
78
|
+
*/
|
|
79
|
+
declare function getPathFromEntryAsar(...paths: string[]): string;
|
|
80
|
+
/**
|
|
81
|
+
* Handle all unhandled error
|
|
82
|
+
* @param callback callback function
|
|
83
|
+
*/
|
|
84
|
+
declare function handleUnexpectedErrors(callback: (err: unknown) => void): void;
|
|
125
85
|
|
|
126
|
-
export { disableHWAccForWin7, getPathFromAppNameAsar,
|
|
86
|
+
export { disableHWAccForWin7, getAppVersion, getEntryVersion, getPathFromAppNameAsar, getPathFromEntryAsar, getPathFromPreload, getPathFromPublic, handleUnexpectedErrors, isDev, isLinux, isMac, isWin, loadPage, requireNative, restartApp, setAppUserModelId, setPortableAppDataPath, singleInstance };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,126 +1,86 @@
|
|
|
1
1
|
import { BrowserWindow } from 'electron';
|
|
2
|
-
export {
|
|
2
|
+
export { e as aesDecrypt, b as aesEncrypt, c as defaultSignature, a as defaultUnzipFile, f as defaultVerifySignature, d as defaultZipFile, h as hashBuffer } from './zip-rm9ED9nU.js';
|
|
3
|
+
export { U as UpdateInfo, a as UpdateJSON, V as Version, d as defaultIsLowerVersion, b as defaultVersionJsonGenerator, i as isUpdateJSON, p as parseVersion } from './version-C4tF_trh.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Compile time dev check
|
|
6
7
|
*/
|
|
7
|
-
declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly linux: boolean;
|
|
12
|
-
};
|
|
8
|
+
declare const isDev: boolean;
|
|
9
|
+
declare const isWin: boolean;
|
|
10
|
+
declare const isMac: boolean;
|
|
11
|
+
declare const isLinux: boolean;
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
13
|
+
* Get the absolute path of `${electron.app.name}.asar` (not `app.asar`)
|
|
15
14
|
*
|
|
16
|
-
*
|
|
15
|
+
* If is in dev, **always** return `'DEV.asar'`
|
|
17
16
|
*/
|
|
18
|
-
declare function getPathFromAppNameAsar(...
|
|
17
|
+
declare function getPathFromAppNameAsar(...paths: string[]): string;
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* App version is read from `version` file in `${electron.app.name}.asar`
|
|
23
|
-
*
|
|
24
|
-
* Entry version is read from `package.json`
|
|
25
|
-
*
|
|
26
|
-
* SystemVersion: `${platform} ${os.release()}`
|
|
19
|
+
* Get app version, if is in dev, return `getEntryVersion()`
|
|
27
20
|
*/
|
|
28
|
-
declare function
|
|
29
|
-
appVersion: string;
|
|
30
|
-
entryVersion: string;
|
|
31
|
-
electronVersion: string;
|
|
32
|
-
nodeVersion: string;
|
|
33
|
-
systemVersion: string;
|
|
34
|
-
};
|
|
21
|
+
declare function getAppVersion(): string;
|
|
35
22
|
/**
|
|
36
|
-
*
|
|
37
|
-
* @param moduleName file name in entry
|
|
23
|
+
* Get entry version
|
|
38
24
|
*/
|
|
39
|
-
|
|
25
|
+
declare function getEntryVersion(): string;
|
|
40
26
|
/**
|
|
41
|
-
* load module from entry
|
|
42
|
-
* @
|
|
43
|
-
* @param devEntryDirPath entry directory path when dev, default `../../dist-entry`
|
|
44
|
-
* @param entryDirPath entry directory path when not dev, default `join(app.getAppPath(), basename(devEntryDirPath))`
|
|
27
|
+
* Use `require` to load native module from entry asar
|
|
28
|
+
* @param moduleName file name in entry
|
|
45
29
|
* @example
|
|
46
|
-
*
|
|
47
|
-
* const db = requireNative<typeof import('../native/db')>('db')
|
|
48
|
-
* db.test()
|
|
30
|
+
* requireNative<typeof import('../native/db')>('db')
|
|
49
31
|
*/
|
|
50
|
-
declare function
|
|
32
|
+
declare function requireNative<T = any>(moduleName: string): T;
|
|
51
33
|
/**
|
|
52
34
|
* Restarts the Electron app.
|
|
53
35
|
*/
|
|
54
36
|
declare function restartApp(): void;
|
|
55
37
|
/**
|
|
56
|
-
*
|
|
57
|
-
* @param id app id
|
|
38
|
+
* Fix app use model id, only for Windows
|
|
39
|
+
* @param id app id, default is `org.${electron.app.name}`
|
|
58
40
|
*/
|
|
59
41
|
declare function setAppUserModelId(id?: string): void;
|
|
60
42
|
/**
|
|
61
|
-
*
|
|
43
|
+
* Disable hardware acceleration for Windows 7
|
|
62
44
|
*/
|
|
63
45
|
declare function disableHWAccForWin7(): void;
|
|
64
46
|
/**
|
|
65
|
-
*
|
|
47
|
+
* Keep single electron instance and auto restore window on `second-instance` event
|
|
66
48
|
* @param window brwoser window to show
|
|
67
49
|
* @returns `false` if the app is running
|
|
68
50
|
*/
|
|
69
51
|
declare function singleInstance(window?: BrowserWindow): boolean;
|
|
70
52
|
/**
|
|
71
|
-
*
|
|
53
|
+
* Set `AppData` dir to the dir of .exe file
|
|
72
54
|
*
|
|
73
|
-
*
|
|
55
|
+
* Useful for portable Windows app
|
|
74
56
|
* @param dirName dir name, default to `data`
|
|
75
57
|
*/
|
|
76
58
|
declare function setPortableAppDataPath(dirName?: string): void;
|
|
77
59
|
/**
|
|
78
|
-
*
|
|
79
|
-
* @param
|
|
60
|
+
* Load `process.env.VITE_DEV_SERVER_URL` when dev, else load html file
|
|
61
|
+
* @param win window
|
|
62
|
+
* @param htmlFilePath html file path, default is `index.html`
|
|
80
63
|
*/
|
|
81
|
-
declare function
|
|
64
|
+
declare function loadPage(win: BrowserWindow, htmlFilePath?: string): void;
|
|
82
65
|
/**
|
|
83
|
-
*
|
|
84
|
-
* @param
|
|
66
|
+
* Get joined path from preload dir
|
|
67
|
+
* @param paths rest paths
|
|
85
68
|
*/
|
|
86
|
-
declare function
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
* get path inside entry asar
|
|
103
|
-
* @param paths joined path
|
|
104
|
-
*/
|
|
105
|
-
getPathFromEntryAsar(...paths: string[]): string;
|
|
106
|
-
/**
|
|
107
|
-
* get path inside `${electron.app.name}.asar/main`
|
|
108
|
-
* @param paths joined path
|
|
109
|
-
*/
|
|
110
|
-
getPathFromMain(...paths: string[]): string;
|
|
111
|
-
/**
|
|
112
|
-
* get path inside `${electron.app.name}.asar/preload`
|
|
113
|
-
* @param paths joined path
|
|
114
|
-
*/
|
|
115
|
-
getPathFromPreload(...paths: string[]): string;
|
|
116
|
-
/**
|
|
117
|
-
* get path inside public dir
|
|
118
|
-
* @param paths joined path
|
|
119
|
-
*/
|
|
120
|
-
getPathFromPublic(...paths: string[]): string;
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
declare function unzipFile(gzipPath: string, targetFilePath?: string): Promise<unknown>;
|
|
124
|
-
declare function zipFile(filePath: string, targetFilePath?: string): Promise<unknown>;
|
|
69
|
+
declare function getPathFromPreload(...paths: string[]): string;
|
|
70
|
+
/**
|
|
71
|
+
* Get joined path from publich dir
|
|
72
|
+
* @param paths rest paths
|
|
73
|
+
*/
|
|
74
|
+
declare function getPathFromPublic(...paths: string[]): string;
|
|
75
|
+
/**
|
|
76
|
+
* Get joined path from entry asar
|
|
77
|
+
* @param paths rest paths
|
|
78
|
+
*/
|
|
79
|
+
declare function getPathFromEntryAsar(...paths: string[]): string;
|
|
80
|
+
/**
|
|
81
|
+
* Handle all unhandled error
|
|
82
|
+
* @param callback callback function
|
|
83
|
+
*/
|
|
84
|
+
declare function handleUnexpectedErrors(callback: (err: unknown) => void): void;
|
|
125
85
|
|
|
126
|
-
export { disableHWAccForWin7, getPathFromAppNameAsar,
|
|
86
|
+
export { disableHWAccForWin7, getAppVersion, getEntryVersion, getPathFromAppNameAsar, getPathFromEntryAsar, getPathFromPreload, getPathFromPublic, handleUnexpectedErrors, isDev, isLinux, isMac, isWin, loadPage, requireNative, restartApp, setAppUserModelId, setPortableAppDataPath, singleInstance };
|
package/dist/utils.js
CHANGED
|
@@ -1,38 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
getPaths,
|
|
5
|
-
getVersions,
|
|
6
|
-
handleUnexpectedErrors,
|
|
7
|
-
is,
|
|
8
|
-
isUpdateJSON,
|
|
9
|
-
loadNativeModuleFromEntry,
|
|
10
|
-
parseGithubCdnURL,
|
|
11
|
-
parseVersion,
|
|
12
|
-
restartApp,
|
|
13
|
-
setAppUserModelId,
|
|
14
|
-
setPortableAppDataPath,
|
|
15
|
-
singleInstance,
|
|
16
|
-
unzipFile,
|
|
17
|
-
waitAppReady,
|
|
18
|
-
zipFile
|
|
19
|
-
} from "./chunk-SBPTSLG7.js";
|
|
20
|
-
export {
|
|
21
|
-
disableHWAccForWin7,
|
|
22
|
-
getPathFromAppNameAsar,
|
|
23
|
-
getPaths,
|
|
24
|
-
getVersions,
|
|
25
|
-
handleUnexpectedErrors,
|
|
26
|
-
is,
|
|
27
|
-
isUpdateJSON,
|
|
28
|
-
loadNativeModuleFromEntry,
|
|
29
|
-
parseGithubCdnURL,
|
|
30
|
-
parseVersion,
|
|
31
|
-
restartApp,
|
|
32
|
-
setAppUserModelId,
|
|
33
|
-
setPortableAppDataPath,
|
|
34
|
-
singleInstance,
|
|
35
|
-
unzipFile,
|
|
36
|
-
waitAppReady,
|
|
37
|
-
zipFile
|
|
38
|
-
};
|
|
1
|
+
export { disableHWAccForWin7, getAppVersion, getEntryVersion, getPathFromAppNameAsar, getPathFromEntryAsar, getPathFromPreload, getPathFromPublic, handleUnexpectedErrors, isDev, isLinux, isMac, isWin, loadPage, requireNative, restartApp, setAppUserModelId, setPortableAppDataPath, singleInstance } from './chunk-4MH6ZXCY.js';
|
|
2
|
+
export { aesDecrypt, aesEncrypt, defaultSignature, defaultUnzipFile, defaultVerifySignature, defaultZipFile, hashBuffer } from './chunk-KZSYEXLO.js';
|
|
3
|
+
export { defaultIsLowerVersion, defaultVersionJsonGenerator, isUpdateJSON, parseVersion } from './chunk-72ZAJ7AF.js';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
interface Version {
|
|
2
|
+
/**
|
|
3
|
+
* `2` of `2.1.0-beta.10`
|
|
4
|
+
*/
|
|
5
|
+
major: number;
|
|
6
|
+
/**
|
|
7
|
+
* `1` of `2.1.0-beta.10`
|
|
8
|
+
*/
|
|
9
|
+
minor: number;
|
|
10
|
+
/**
|
|
11
|
+
* `0` of `2.1.0-beta.10`
|
|
12
|
+
*/
|
|
13
|
+
patch: number;
|
|
14
|
+
/**
|
|
15
|
+
* `beta` of `2.1.0-beta.10`
|
|
16
|
+
*/
|
|
17
|
+
stage: string;
|
|
18
|
+
/**
|
|
19
|
+
* `10` of `2.1.0-beta.10`
|
|
20
|
+
*/
|
|
21
|
+
stageVersion: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Parse version string to {@link Version}, like `0.2.0-beta.1`
|
|
25
|
+
* @param version version string
|
|
26
|
+
*/
|
|
27
|
+
declare function parseVersion(version: string): Version;
|
|
28
|
+
/**
|
|
29
|
+
* Default function to check the old version is less than new version
|
|
30
|
+
* @param oldVer old version string
|
|
31
|
+
* @param newVer new version string
|
|
32
|
+
*/
|
|
33
|
+
declare function defaultIsLowerVersion(oldVer: string, newVer: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Update info json
|
|
36
|
+
*/
|
|
37
|
+
type UpdateInfo = {
|
|
38
|
+
signature: string;
|
|
39
|
+
minimumVersion: string;
|
|
40
|
+
version: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* {@link UpdateInfo} with beta
|
|
44
|
+
*/
|
|
45
|
+
type UpdateJSON = UpdateInfo & {
|
|
46
|
+
beta: UpdateInfo;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Check is `UpdateJSON`
|
|
50
|
+
* @param json any variable
|
|
51
|
+
*/
|
|
52
|
+
declare function isUpdateJSON(json: any): json is UpdateJSON;
|
|
53
|
+
/**
|
|
54
|
+
* Default function to generate `UpdateJSON`
|
|
55
|
+
* @param existingJson exising update json
|
|
56
|
+
* @param signature sigature
|
|
57
|
+
* @param version target version
|
|
58
|
+
* @param minimumVersion minimum version
|
|
59
|
+
*/
|
|
60
|
+
declare function defaultVersionJsonGenerator(existingJson: UpdateJSON, signature: string, version: string, minimumVersion: string): UpdateJSON;
|
|
61
|
+
|
|
62
|
+
export { type UpdateInfo as U, type Version as V, type UpdateJSON as a, defaultVersionJsonGenerator as b, defaultIsLowerVersion as d, isUpdateJSON as i, parseVersion as p };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
interface Version {
|
|
2
|
+
/**
|
|
3
|
+
* `2` of `2.1.0-beta.10`
|
|
4
|
+
*/
|
|
5
|
+
major: number;
|
|
6
|
+
/**
|
|
7
|
+
* `1` of `2.1.0-beta.10`
|
|
8
|
+
*/
|
|
9
|
+
minor: number;
|
|
10
|
+
/**
|
|
11
|
+
* `0` of `2.1.0-beta.10`
|
|
12
|
+
*/
|
|
13
|
+
patch: number;
|
|
14
|
+
/**
|
|
15
|
+
* `beta` of `2.1.0-beta.10`
|
|
16
|
+
*/
|
|
17
|
+
stage: string;
|
|
18
|
+
/**
|
|
19
|
+
* `10` of `2.1.0-beta.10`
|
|
20
|
+
*/
|
|
21
|
+
stageVersion: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Parse version string to {@link Version}, like `0.2.0-beta.1`
|
|
25
|
+
* @param version version string
|
|
26
|
+
*/
|
|
27
|
+
declare function parseVersion(version: string): Version;
|
|
28
|
+
/**
|
|
29
|
+
* Default function to check the old version is less than new version
|
|
30
|
+
* @param oldVer old version string
|
|
31
|
+
* @param newVer new version string
|
|
32
|
+
*/
|
|
33
|
+
declare function defaultIsLowerVersion(oldVer: string, newVer: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Update info json
|
|
36
|
+
*/
|
|
37
|
+
type UpdateInfo = {
|
|
38
|
+
signature: string;
|
|
39
|
+
minimumVersion: string;
|
|
40
|
+
version: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* {@link UpdateInfo} with beta
|
|
44
|
+
*/
|
|
45
|
+
type UpdateJSON = UpdateInfo & {
|
|
46
|
+
beta: UpdateInfo;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Check is `UpdateJSON`
|
|
50
|
+
* @param json any variable
|
|
51
|
+
*/
|
|
52
|
+
declare function isUpdateJSON(json: any): json is UpdateJSON;
|
|
53
|
+
/**
|
|
54
|
+
* Default function to generate `UpdateJSON`
|
|
55
|
+
* @param existingJson exising update json
|
|
56
|
+
* @param signature sigature
|
|
57
|
+
* @param version target version
|
|
58
|
+
* @param minimumVersion minimum version
|
|
59
|
+
*/
|
|
60
|
+
declare function defaultVersionJsonGenerator(existingJson: UpdateJSON, signature: string, version: string, minimumVersion: string): UpdateJSON;
|
|
61
|
+
|
|
62
|
+
export { type UpdateInfo as U, type Version as V, type UpdateJSON as a, defaultVersionJsonGenerator as b, defaultIsLowerVersion as d, isUpdateJSON as i, parseVersion as p };
|