electron-incremental-update 2.0.0-beta.8 → 2.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/README.md +307 -198
- package/dist/chunk-IABBXJFB.js +87 -0
- package/dist/{chunk-72ZAJ7AF.js → chunk-RCRKUKFX.js} +1 -1
- package/dist/index.cjs +110 -104
- package/dist/index.d.cts +139 -34
- package/dist/index.d.ts +139 -34
- package/dist/index.js +105 -102
- package/dist/provider.cjs +85 -54
- package/dist/provider.d.cts +62 -29
- package/dist/provider.d.ts +62 -29
- package/dist/provider.js +85 -55
- package/dist/types-BLdN9rkY.d.ts +72 -0
- package/dist/types-DkCn03M3.d.cts +72 -0
- package/dist/utils.cjs +25 -25
- package/dist/utils.d.cts +37 -24
- package/dist/utils.d.ts +37 -24
- package/dist/utils.js +2 -11
- package/dist/version-BYVQ367i.d.cts +62 -0
- package/dist/version-BYVQ367i.d.ts +62 -0
- package/dist/vite.d.ts +58 -94
- package/dist/vite.js +67 -55
- package/dist/{zip-DPF5IFkK.d.cts → zip-rm9ED9nU.d.cts} +23 -0
- package/dist/{zip-DPF5IFkK.d.ts → zip-rm9ED9nU.d.ts} +23 -0
- package/package.json +10 -7
- package/dist/chunk-4MH6ZXCY.js +0 -81
- package/dist/core-DJdvtwvU.d.ts +0 -134
- package/dist/core-ZUlLHadf.d.cts +0 -134
- package/dist/types-CItP6bL-.d.cts +0 -104
- package/dist/types-CItP6bL-.d.ts +0 -104
package/dist/core-DJdvtwvU.d.ts
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'node:events';
|
|
2
|
-
import { a as UpdateJSON, U as UpdateInfo, D as DownloadingInfo, I as IProvider, c as URLHandler } from './types-CItP6bL-.js';
|
|
3
|
-
|
|
4
|
-
declare const ErrorInfo: {
|
|
5
|
-
readonly download: "Download failed";
|
|
6
|
-
readonly validate: "Validate failed";
|
|
7
|
-
readonly param: "Missing params";
|
|
8
|
-
readonly network: "Network error";
|
|
9
|
-
};
|
|
10
|
-
declare class UpdaterError extends Error {
|
|
11
|
-
code: keyof typeof ErrorInfo;
|
|
12
|
-
constructor(msg: keyof typeof ErrorInfo, info: string);
|
|
13
|
-
}
|
|
14
|
-
type CheckResult<T extends UpdateJSON> = {
|
|
15
|
-
success: true;
|
|
16
|
-
data: Omit<T, 'beta'>;
|
|
17
|
-
} | {
|
|
18
|
-
success: false;
|
|
19
|
-
/**
|
|
20
|
-
* minimal version that can update
|
|
21
|
-
*/
|
|
22
|
-
data: string;
|
|
23
|
-
} | {
|
|
24
|
-
success: false;
|
|
25
|
-
data: UpdaterError;
|
|
26
|
-
};
|
|
27
|
-
type DownloadResult = {
|
|
28
|
-
success: true;
|
|
29
|
-
} | {
|
|
30
|
-
success: false;
|
|
31
|
-
data: UpdaterError;
|
|
32
|
-
};
|
|
33
|
-
interface Logger {
|
|
34
|
-
info: (msg: string) => void;
|
|
35
|
-
debug: (msg: string) => void;
|
|
36
|
-
warn: (msg: string) => void;
|
|
37
|
-
error: (msg: string, e?: unknown) => void;
|
|
38
|
-
}
|
|
39
|
-
interface UpdaterOption {
|
|
40
|
-
/**
|
|
41
|
-
* public key of signature, which will be auto generated by plugin,
|
|
42
|
-
* generate by `selfsigned` if not set
|
|
43
|
-
*/
|
|
44
|
-
SIGNATURE_CERT?: string;
|
|
45
|
-
/**
|
|
46
|
-
* whether to receive beta update
|
|
47
|
-
*/
|
|
48
|
-
receiveBeta?: boolean;
|
|
49
|
-
logger?: Logger;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
declare class Updater extends EventEmitter<{
|
|
53
|
-
'checking': any;
|
|
54
|
-
'update-available': [data: UpdateInfo];
|
|
55
|
-
'update-unavailable': [reason: string];
|
|
56
|
-
'error': [error: UpdaterError];
|
|
57
|
-
'download-progress': [info: DownloadingInfo];
|
|
58
|
-
'update-downloaded': any;
|
|
59
|
-
}> {
|
|
60
|
-
private CERT;
|
|
61
|
-
private info?;
|
|
62
|
-
private provider;
|
|
63
|
-
/**
|
|
64
|
-
* updater logger
|
|
65
|
-
*/
|
|
66
|
-
logger?: Logger;
|
|
67
|
-
/**
|
|
68
|
-
* whether to receive beta update
|
|
69
|
-
*/
|
|
70
|
-
receiveBeta?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* whether force update in DEV
|
|
73
|
-
*/
|
|
74
|
-
forceUpdate?: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* initialize incremental updater
|
|
77
|
-
* @param provider update provider
|
|
78
|
-
* @param option UpdaterOption
|
|
79
|
-
*/
|
|
80
|
-
constructor(provider: IProvider, option?: UpdaterOption);
|
|
81
|
-
/**
|
|
82
|
-
* this function is used to parse download data.
|
|
83
|
-
* - if format is `'json'`
|
|
84
|
-
* - if data is `UpdateJSON`, return it
|
|
85
|
-
* - if data is string or absent, download URL data and return it
|
|
86
|
-
* - if format is `'buffer'`
|
|
87
|
-
* - if data is `Buffer`, return it
|
|
88
|
-
* - if data is string or absent, download URL data and return it
|
|
89
|
-
* @param format 'json' or 'buffer'
|
|
90
|
-
* @param data download URL or update json or buffer
|
|
91
|
-
*/
|
|
92
|
-
private fetch;
|
|
93
|
-
/**
|
|
94
|
-
* handle error message and emit error event
|
|
95
|
-
*/
|
|
96
|
-
private err;
|
|
97
|
-
/**
|
|
98
|
-
* check update info using default options
|
|
99
|
-
*/
|
|
100
|
-
checkUpdate(): Promise<boolean>;
|
|
101
|
-
/**
|
|
102
|
-
* check update info using existing update json
|
|
103
|
-
* @param data existing update json
|
|
104
|
-
*/
|
|
105
|
-
checkUpdate(data: UpdateJSON): Promise<boolean>;
|
|
106
|
-
/**
|
|
107
|
-
* download update using default options
|
|
108
|
-
*/
|
|
109
|
-
downloadUpdate(): Promise<boolean>;
|
|
110
|
-
/**
|
|
111
|
-
* download update using existing `asar.gz` buffer and signature
|
|
112
|
-
* @param data existing `asar.gz` buffer
|
|
113
|
-
* @param info update info
|
|
114
|
-
*/
|
|
115
|
-
downloadUpdate(data: Uint8Array, info: Omit<UpdateInfo, 'minimumVersion'>): Promise<boolean>;
|
|
116
|
-
/**
|
|
117
|
-
* quit App and install
|
|
118
|
-
*/
|
|
119
|
-
quitAndInstall(): void;
|
|
120
|
-
/**
|
|
121
|
-
* setup provider URL handler
|
|
122
|
-
*
|
|
123
|
-
* @example
|
|
124
|
-
* updater.setURLHandler((url, isDownloadingAsar) => {
|
|
125
|
-
* if (isDownloadingAsar) {
|
|
126
|
-
* url.hostname = 'https://cdn.jsdelivr.net/gh'
|
|
127
|
-
* return url
|
|
128
|
-
* }
|
|
129
|
-
* })
|
|
130
|
-
*/
|
|
131
|
-
setURLHandler(handler: URLHandler): void;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export { type CheckResult as C, type DownloadResult as D, ErrorInfo as E, type Logger as L, Updater as U, type UpdaterOption as a, UpdaterError as b };
|
package/dist/core-ZUlLHadf.d.cts
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'node:events';
|
|
2
|
-
import { a as UpdateJSON, U as UpdateInfo, D as DownloadingInfo, I as IProvider, c as URLHandler } from './types-CItP6bL-.cjs';
|
|
3
|
-
|
|
4
|
-
declare const ErrorInfo: {
|
|
5
|
-
readonly download: "Download failed";
|
|
6
|
-
readonly validate: "Validate failed";
|
|
7
|
-
readonly param: "Missing params";
|
|
8
|
-
readonly network: "Network error";
|
|
9
|
-
};
|
|
10
|
-
declare class UpdaterError extends Error {
|
|
11
|
-
code: keyof typeof ErrorInfo;
|
|
12
|
-
constructor(msg: keyof typeof ErrorInfo, info: string);
|
|
13
|
-
}
|
|
14
|
-
type CheckResult<T extends UpdateJSON> = {
|
|
15
|
-
success: true;
|
|
16
|
-
data: Omit<T, 'beta'>;
|
|
17
|
-
} | {
|
|
18
|
-
success: false;
|
|
19
|
-
/**
|
|
20
|
-
* minimal version that can update
|
|
21
|
-
*/
|
|
22
|
-
data: string;
|
|
23
|
-
} | {
|
|
24
|
-
success: false;
|
|
25
|
-
data: UpdaterError;
|
|
26
|
-
};
|
|
27
|
-
type DownloadResult = {
|
|
28
|
-
success: true;
|
|
29
|
-
} | {
|
|
30
|
-
success: false;
|
|
31
|
-
data: UpdaterError;
|
|
32
|
-
};
|
|
33
|
-
interface Logger {
|
|
34
|
-
info: (msg: string) => void;
|
|
35
|
-
debug: (msg: string) => void;
|
|
36
|
-
warn: (msg: string) => void;
|
|
37
|
-
error: (msg: string, e?: unknown) => void;
|
|
38
|
-
}
|
|
39
|
-
interface UpdaterOption {
|
|
40
|
-
/**
|
|
41
|
-
* public key of signature, which will be auto generated by plugin,
|
|
42
|
-
* generate by `selfsigned` if not set
|
|
43
|
-
*/
|
|
44
|
-
SIGNATURE_CERT?: string;
|
|
45
|
-
/**
|
|
46
|
-
* whether to receive beta update
|
|
47
|
-
*/
|
|
48
|
-
receiveBeta?: boolean;
|
|
49
|
-
logger?: Logger;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
declare class Updater extends EventEmitter<{
|
|
53
|
-
'checking': any;
|
|
54
|
-
'update-available': [data: UpdateInfo];
|
|
55
|
-
'update-unavailable': [reason: string];
|
|
56
|
-
'error': [error: UpdaterError];
|
|
57
|
-
'download-progress': [info: DownloadingInfo];
|
|
58
|
-
'update-downloaded': any;
|
|
59
|
-
}> {
|
|
60
|
-
private CERT;
|
|
61
|
-
private info?;
|
|
62
|
-
private provider;
|
|
63
|
-
/**
|
|
64
|
-
* updater logger
|
|
65
|
-
*/
|
|
66
|
-
logger?: Logger;
|
|
67
|
-
/**
|
|
68
|
-
* whether to receive beta update
|
|
69
|
-
*/
|
|
70
|
-
receiveBeta?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* whether force update in DEV
|
|
73
|
-
*/
|
|
74
|
-
forceUpdate?: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* initialize incremental updater
|
|
77
|
-
* @param provider update provider
|
|
78
|
-
* @param option UpdaterOption
|
|
79
|
-
*/
|
|
80
|
-
constructor(provider: IProvider, option?: UpdaterOption);
|
|
81
|
-
/**
|
|
82
|
-
* this function is used to parse download data.
|
|
83
|
-
* - if format is `'json'`
|
|
84
|
-
* - if data is `UpdateJSON`, return it
|
|
85
|
-
* - if data is string or absent, download URL data and return it
|
|
86
|
-
* - if format is `'buffer'`
|
|
87
|
-
* - if data is `Buffer`, return it
|
|
88
|
-
* - if data is string or absent, download URL data and return it
|
|
89
|
-
* @param format 'json' or 'buffer'
|
|
90
|
-
* @param data download URL or update json or buffer
|
|
91
|
-
*/
|
|
92
|
-
private fetch;
|
|
93
|
-
/**
|
|
94
|
-
* handle error message and emit error event
|
|
95
|
-
*/
|
|
96
|
-
private err;
|
|
97
|
-
/**
|
|
98
|
-
* check update info using default options
|
|
99
|
-
*/
|
|
100
|
-
checkUpdate(): Promise<boolean>;
|
|
101
|
-
/**
|
|
102
|
-
* check update info using existing update json
|
|
103
|
-
* @param data existing update json
|
|
104
|
-
*/
|
|
105
|
-
checkUpdate(data: UpdateJSON): Promise<boolean>;
|
|
106
|
-
/**
|
|
107
|
-
* download update using default options
|
|
108
|
-
*/
|
|
109
|
-
downloadUpdate(): Promise<boolean>;
|
|
110
|
-
/**
|
|
111
|
-
* download update using existing `asar.gz` buffer and signature
|
|
112
|
-
* @param data existing `asar.gz` buffer
|
|
113
|
-
* @param info update info
|
|
114
|
-
*/
|
|
115
|
-
downloadUpdate(data: Uint8Array, info: Omit<UpdateInfo, 'minimumVersion'>): Promise<boolean>;
|
|
116
|
-
/**
|
|
117
|
-
* quit App and install
|
|
118
|
-
*/
|
|
119
|
-
quitAndInstall(): void;
|
|
120
|
-
/**
|
|
121
|
-
* setup provider URL handler
|
|
122
|
-
*
|
|
123
|
-
* @example
|
|
124
|
-
* updater.setURLHandler((url, isDownloadingAsar) => {
|
|
125
|
-
* if (isDownloadingAsar) {
|
|
126
|
-
* url.hostname = 'https://cdn.jsdelivr.net/gh'
|
|
127
|
-
* return url
|
|
128
|
-
* }
|
|
129
|
-
* })
|
|
130
|
-
*/
|
|
131
|
-
setURLHandler(handler: URLHandler): void;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export { type CheckResult as C, type DownloadResult as D, ErrorInfo as E, type Logger as L, Updater as U, type UpdaterOption as a, UpdaterError as b };
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { Promisable } from '@subframe7536/type-utils';
|
|
2
|
-
|
|
3
|
-
interface Version {
|
|
4
|
-
major: number;
|
|
5
|
-
minor: number;
|
|
6
|
-
patch: number;
|
|
7
|
-
stage: string;
|
|
8
|
-
stageVersion: number;
|
|
9
|
-
}
|
|
10
|
-
declare function parseVersion(version: string): Version;
|
|
11
|
-
declare function defaultIsLowerVersion(oldVer: string, newVer: string): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* update info json
|
|
14
|
-
*/
|
|
15
|
-
type UpdateInfo = {
|
|
16
|
-
signature: string;
|
|
17
|
-
minimumVersion: string;
|
|
18
|
-
version: string;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* {@link UpdateInfo} with beta
|
|
22
|
-
*/
|
|
23
|
-
type UpdateJSON = UpdateInfo & {
|
|
24
|
-
beta: UpdateInfo;
|
|
25
|
-
};
|
|
26
|
-
declare function isUpdateJSON(json: any): json is UpdateJSON;
|
|
27
|
-
declare function defaultVersionJsonGenerator(existingJson: UpdateJSON, signature: string, version: string, minimumVersion: string): UpdateJSON;
|
|
28
|
-
|
|
29
|
-
type URLHandler = (url: URL, isDownloadAsar: boolean) => Promisable<URL | string | undefined | null>;
|
|
30
|
-
type OnDownloading = (progress: DownloadingInfo) => void;
|
|
31
|
-
interface DownloadingInfo {
|
|
32
|
-
/**
|
|
33
|
-
* download delta
|
|
34
|
-
*/
|
|
35
|
-
delta: number;
|
|
36
|
-
/**
|
|
37
|
-
* downloaded percent, 0 ~ 100
|
|
38
|
-
*
|
|
39
|
-
* If not `Content-Length` header, will be nagative
|
|
40
|
-
*/
|
|
41
|
-
percent: number;
|
|
42
|
-
/**
|
|
43
|
-
* total size
|
|
44
|
-
*
|
|
45
|
-
* If not `Content-Length` header, will be -1
|
|
46
|
-
*/
|
|
47
|
-
total: number;
|
|
48
|
-
/**
|
|
49
|
-
* downloaded size
|
|
50
|
-
*/
|
|
51
|
-
transferred: number;
|
|
52
|
-
/**
|
|
53
|
-
* download speed, bytes per second
|
|
54
|
-
*/
|
|
55
|
-
bps: number;
|
|
56
|
-
}
|
|
57
|
-
interface IProvider {
|
|
58
|
-
/**
|
|
59
|
-
* provider name
|
|
60
|
-
*/
|
|
61
|
-
name: string;
|
|
62
|
-
/**
|
|
63
|
-
* custom url handler
|
|
64
|
-
*
|
|
65
|
-
* for Github, there are some {@link https://github.com/XIU2/UserScript/blob/master/GithubEnhanced-High-Speed-Download.user.js#L34 public CDN links}
|
|
66
|
-
*/
|
|
67
|
-
urlHandler?: URLHandler;
|
|
68
|
-
onDownloading?: OnDownloading;
|
|
69
|
-
/**
|
|
70
|
-
* download update json
|
|
71
|
-
* @param versionPath parsed version path
|
|
72
|
-
*/
|
|
73
|
-
downloadJSON: (versionPath: string) => Promise<UpdateJSON>;
|
|
74
|
-
/**
|
|
75
|
-
* download update asar
|
|
76
|
-
* @param name app name
|
|
77
|
-
* @param updateInfo existing update info
|
|
78
|
-
* @param onDownloading hook for on downloading
|
|
79
|
-
*/
|
|
80
|
-
downloadAsar: (name: string, updateInfo: UpdateInfo, onDownloading?: (info: DownloadingInfo) => void) => Promise<Buffer>;
|
|
81
|
-
/**
|
|
82
|
-
* compare version
|
|
83
|
-
* @param oldVer old version string
|
|
84
|
-
* @param newVer new version string
|
|
85
|
-
* @returns if version1 < version2
|
|
86
|
-
*/
|
|
87
|
-
isLowerVersion: (oldVer: string, newVer: string) => boolean;
|
|
88
|
-
/**
|
|
89
|
-
* unzip file buffer
|
|
90
|
-
* @param buffer source buffer
|
|
91
|
-
*/
|
|
92
|
-
unzipFile: (buffer: Buffer) => Promise<Buffer>;
|
|
93
|
-
/**
|
|
94
|
-
* verify asar signature
|
|
95
|
-
* @param buffer file buffer
|
|
96
|
-
* @param version target version
|
|
97
|
-
* @param signature signature
|
|
98
|
-
* @param cert certificate
|
|
99
|
-
* @returns if signature is valid, returns the version, otherwise returns `undefined`
|
|
100
|
-
*/
|
|
101
|
-
verifySignaure: (buffer: Buffer, version: string, signature: string, cert: string) => Promisable<boolean>;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export { type DownloadingInfo as D, type IProvider as I, type OnDownloading as O, type UpdateInfo as U, type Version as V, type UpdateJSON as a, defaultVersionJsonGenerator as b, type URLHandler as c, defaultIsLowerVersion as d, isUpdateJSON as i, parseVersion as p };
|
package/dist/types-CItP6bL-.d.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { Promisable } from '@subframe7536/type-utils';
|
|
2
|
-
|
|
3
|
-
interface Version {
|
|
4
|
-
major: number;
|
|
5
|
-
minor: number;
|
|
6
|
-
patch: number;
|
|
7
|
-
stage: string;
|
|
8
|
-
stageVersion: number;
|
|
9
|
-
}
|
|
10
|
-
declare function parseVersion(version: string): Version;
|
|
11
|
-
declare function defaultIsLowerVersion(oldVer: string, newVer: string): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* update info json
|
|
14
|
-
*/
|
|
15
|
-
type UpdateInfo = {
|
|
16
|
-
signature: string;
|
|
17
|
-
minimumVersion: string;
|
|
18
|
-
version: string;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* {@link UpdateInfo} with beta
|
|
22
|
-
*/
|
|
23
|
-
type UpdateJSON = UpdateInfo & {
|
|
24
|
-
beta: UpdateInfo;
|
|
25
|
-
};
|
|
26
|
-
declare function isUpdateJSON(json: any): json is UpdateJSON;
|
|
27
|
-
declare function defaultVersionJsonGenerator(existingJson: UpdateJSON, signature: string, version: string, minimumVersion: string): UpdateJSON;
|
|
28
|
-
|
|
29
|
-
type URLHandler = (url: URL, isDownloadAsar: boolean) => Promisable<URL | string | undefined | null>;
|
|
30
|
-
type OnDownloading = (progress: DownloadingInfo) => void;
|
|
31
|
-
interface DownloadingInfo {
|
|
32
|
-
/**
|
|
33
|
-
* download delta
|
|
34
|
-
*/
|
|
35
|
-
delta: number;
|
|
36
|
-
/**
|
|
37
|
-
* downloaded percent, 0 ~ 100
|
|
38
|
-
*
|
|
39
|
-
* If not `Content-Length` header, will be nagative
|
|
40
|
-
*/
|
|
41
|
-
percent: number;
|
|
42
|
-
/**
|
|
43
|
-
* total size
|
|
44
|
-
*
|
|
45
|
-
* If not `Content-Length` header, will be -1
|
|
46
|
-
*/
|
|
47
|
-
total: number;
|
|
48
|
-
/**
|
|
49
|
-
* downloaded size
|
|
50
|
-
*/
|
|
51
|
-
transferred: number;
|
|
52
|
-
/**
|
|
53
|
-
* download speed, bytes per second
|
|
54
|
-
*/
|
|
55
|
-
bps: number;
|
|
56
|
-
}
|
|
57
|
-
interface IProvider {
|
|
58
|
-
/**
|
|
59
|
-
* provider name
|
|
60
|
-
*/
|
|
61
|
-
name: string;
|
|
62
|
-
/**
|
|
63
|
-
* custom url handler
|
|
64
|
-
*
|
|
65
|
-
* for Github, there are some {@link https://github.com/XIU2/UserScript/blob/master/GithubEnhanced-High-Speed-Download.user.js#L34 public CDN links}
|
|
66
|
-
*/
|
|
67
|
-
urlHandler?: URLHandler;
|
|
68
|
-
onDownloading?: OnDownloading;
|
|
69
|
-
/**
|
|
70
|
-
* download update json
|
|
71
|
-
* @param versionPath parsed version path
|
|
72
|
-
*/
|
|
73
|
-
downloadJSON: (versionPath: string) => Promise<UpdateJSON>;
|
|
74
|
-
/**
|
|
75
|
-
* download update asar
|
|
76
|
-
* @param name app name
|
|
77
|
-
* @param updateInfo existing update info
|
|
78
|
-
* @param onDownloading hook for on downloading
|
|
79
|
-
*/
|
|
80
|
-
downloadAsar: (name: string, updateInfo: UpdateInfo, onDownloading?: (info: DownloadingInfo) => void) => Promise<Buffer>;
|
|
81
|
-
/**
|
|
82
|
-
* compare version
|
|
83
|
-
* @param oldVer old version string
|
|
84
|
-
* @param newVer new version string
|
|
85
|
-
* @returns if version1 < version2
|
|
86
|
-
*/
|
|
87
|
-
isLowerVersion: (oldVer: string, newVer: string) => boolean;
|
|
88
|
-
/**
|
|
89
|
-
* unzip file buffer
|
|
90
|
-
* @param buffer source buffer
|
|
91
|
-
*/
|
|
92
|
-
unzipFile: (buffer: Buffer) => Promise<Buffer>;
|
|
93
|
-
/**
|
|
94
|
-
* verify asar signature
|
|
95
|
-
* @param buffer file buffer
|
|
96
|
-
* @param version target version
|
|
97
|
-
* @param signature signature
|
|
98
|
-
* @param cert certificate
|
|
99
|
-
* @returns if signature is valid, returns the version, otherwise returns `undefined`
|
|
100
|
-
*/
|
|
101
|
-
verifySignaure: (buffer: Buffer, version: string, signature: string, cert: string) => Promisable<boolean>;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export { type DownloadingInfo as D, type IProvider as I, type OnDownloading as O, type UpdateInfo as U, type Version as V, type UpdateJSON as a, defaultVersionJsonGenerator as b, type URLHandler as c, defaultIsLowerVersion as d, isUpdateJSON as i, parseVersion as p };
|