update electron to v43
All checks were successful
Android Build / publish (push) Successful in 55s
Linux Build / publish (push) Successful in 1m6s

This commit is contained in:
olcxja 2026-07-09 22:38:33 +02:00
commit fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions

View file

@ -0,0 +1,29 @@
import { fromElectronVersion as napiVersionFromElectronVersion } from 'node-api-version';
export class NodeAPI {
moduleName;
electronVersion;
constructor(moduleName, electronVersion) {
this.moduleName = moduleName;
this.electronVersion = electronVersion;
}
ensureElectronSupport() {
this.getVersionForElectron();
}
getVersionForElectron() {
const electronNapiVersion = napiVersionFromElectronVersion(this.electronVersion);
if (!electronNapiVersion) {
throw new Error(`Native module '${this.moduleName}' requires Node-API but Electron v${this.electronVersion} does not support Node-API`);
}
return electronNapiVersion;
}
getNapiVersion(moduleNapiVersions) {
const electronNapiVersion = this.getVersionForElectron();
// Filter out Node-API versions that are too high
const filteredVersions = moduleNapiVersions.filter((v) => v <= electronNapiVersion);
if (filteredVersions.length === 0) {
throw new Error(`Native module '${this.moduleName}' supports Node-API versions ${moduleNapiVersions.join(', ')} but Electron v${this.electronVersion} only supports Node-API v${electronNapiVersion}`);
}
return Math.max(...filteredVersions);
}
}
//# sourceMappingURL=node-api.js.map