mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix: skipLibCheck
This commit is contained in:
parent
d2604e91d4
commit
3e82d30a32
34
electron.ts
34
electron.ts
@ -1,10 +1,10 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const { app, globalShortcut, BrowserWindow } = require("electron");
|
import electron = require("electron");
|
||||||
const sqlInit = require("./src/services/sql_init");
|
import sqlInit = require("./src/services/sql_init");
|
||||||
const appIconService = require("./src/services/app_icon.js");
|
import appIconService = require("./src/services/app_icon");
|
||||||
const windowService = require("./src/services/window");
|
import windowService = require("./src/services/window");
|
||||||
const tray = require("./src/services/tray");
|
import tray = require("./src/services/tray");
|
||||||
|
|
||||||
// Adds debug features like hotkeys for triggering dev tools and reload
|
// Adds debug features like hotkeys for triggering dev tools and reload
|
||||||
require("electron-debug")();
|
require("electron-debug")();
|
||||||
@ -14,31 +14,33 @@ appIconService.installLocalAppIcon();
|
|||||||
require("electron-dl")({ saveAs: true });
|
require("electron-dl")({ saveAs: true });
|
||||||
|
|
||||||
// needed for excalidraw export https://github.com/zadam/trilium/issues/4271
|
// needed for excalidraw export https://github.com/zadam/trilium/issues/4271
|
||||||
app.commandLine.appendSwitch("enable-experimental-web-platform-features");
|
electron.app.commandLine.appendSwitch(
|
||||||
|
"enable-experimental-web-platform-features"
|
||||||
|
);
|
||||||
|
|
||||||
// Quit when all windows are closed, except on macOS. There, it's common
|
// Quit when all windows are closed, except on macOS. There, it's common
|
||||||
// for applications and their menu bar to stay active until the user quits
|
// for applications and their menu bar to stay active until the user quits
|
||||||
// explicitly with Cmd + Q.
|
// explicitly with Cmd + Q.
|
||||||
app.on("window-all-closed", () => {
|
electron.app.on("window-all-closed", () => {
|
||||||
if (process.platform !== "darwin") {
|
if (process.platform !== "darwin") {
|
||||||
app.quit();
|
electron.app.quit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on("ready", async () => {
|
electron.app.on("ready", async () => {
|
||||||
// app.setAppUserModelId('com.github.zadam.trilium');
|
// electron.app.setAppUserModelId('com.github.zadam.trilium');
|
||||||
|
|
||||||
// if db is not initialized -> setup process
|
// if db is not initialized -> setup process
|
||||||
// if db is initialized, then we need to wait until the migration process is finished
|
// if db is initialized, then we need to wait until the migration process is finished
|
||||||
if (sqlInit.isDbInitialized()) {
|
if (sqlInit.isDbInitialized()) {
|
||||||
await sqlInit.dbReady;
|
await sqlInit.dbReady;
|
||||||
|
|
||||||
await windowService.createMainWindow(app);
|
await windowService.createMainWindow(electron.app);
|
||||||
|
|
||||||
if (process.platform === "darwin") {
|
if (process.platform === "darwin") {
|
||||||
app.on("activate", async () => {
|
electron.app.on("activate", async () => {
|
||||||
if (BrowserWindow.getAllWindows().length === 0) {
|
if (electron.BrowserWindow.getAllWindows().length === 0) {
|
||||||
await windowService.createMainWindow(app);
|
await windowService.createMainWindow(electron.app);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -51,8 +53,8 @@ app.on("ready", async () => {
|
|||||||
await windowService.registerGlobalShortcuts();
|
await windowService.registerGlobalShortcuts();
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on("will-quit", () => {
|
electron.app.on("will-quit", () => {
|
||||||
globalShortcut.unregisterAll();
|
electron.globalShortcut.unregisterAll();
|
||||||
});
|
});
|
||||||
|
|
||||||
// this is to disable electron warning spam in the dev console (local development only)
|
// this is to disable electron warning spam in the dev console (local development only)
|
||||||
|
@ -68,6 +68,6 @@ function getExePath() {
|
|||||||
return path.resolve(resourceDir.ELECTRON_APP_ROOT_DIR, 'trilium');
|
return path.resolve(resourceDir.ELECTRON_APP_ROOT_DIR, 'trilium');
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export = {
|
||||||
installLocalAppIcon
|
installLocalAppIcon
|
||||||
};
|
};
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"lib": ["ES2022"],
|
"lib": ["ES2022"],
|
||||||
"downlevelIteration": true
|
"downlevelIteration": true,
|
||||||
|
"skipLibCheck": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./src/**/*.js",
|
"./src/**/*.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user