mirror of
https://github.com/zadam/trilium.git
synced 2026-05-07 02:36:07 +02:00
chore: fix various type errors
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
},
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"../server/src/*.d.ts"
|
||||
"../server/src/*.d.ts",
|
||||
"package.json"
|
||||
],
|
||||
"exclude": [
|
||||
"eslint.config.js",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { extractZip, importData, initializeDatabase, startElectron } from "./utils.js";
|
||||
import { initializeTranslations } from "@triliumnext/server/src/services/i18n.js";
|
||||
import debounce from "@triliumnext/client/src/services/debounce.js";
|
||||
import cls from "@triliumnext/server/src/services/cls.js";
|
||||
import fs from "fs/promises";
|
||||
import { join } from "path";
|
||||
import cls from "@triliumnext/server/src/services/cls.js";
|
||||
|
||||
import { extractZip, importData, startElectron } from "./utils.js";
|
||||
|
||||
// Paths are relative to apps/edit-docs/dist.
|
||||
const DEMO_ZIP_PATH = join(__dirname, "../../server/src/assets/db/demo.zip");
|
||||
@@ -15,8 +15,7 @@ async function main() {
|
||||
setTimeout(() => registerHandlers(), 10_000);
|
||||
});
|
||||
|
||||
await initializeTranslations();
|
||||
await initializeDatabase(true);
|
||||
// TODO: Initialize core.
|
||||
cls.init(async () => {
|
||||
await importData(DEMO_ZIP_DIR_PATH);
|
||||
setOptions();
|
||||
|
||||
@@ -121,8 +121,7 @@ async function main() {
|
||||
}, 10_000);
|
||||
});
|
||||
|
||||
await initializeTranslations();
|
||||
await initializeDatabase(true);
|
||||
// TODO: Initialize core.
|
||||
|
||||
// Wait for becca to be loaded before importing data
|
||||
const { becca_loader: beccaLoader } = await import("@triliumnext/core");
|
||||
|
||||
@@ -24,7 +24,7 @@ export default class WebSocketMessagingProvider implements MessagingProvider {
|
||||
init(httpServer: HttpServer, sessionParser: express.RequestHandler) {
|
||||
this.webSocketServer = new WebSocketServer({
|
||||
verifyClient: (info, done) => {
|
||||
sessionParser(info.req as express.Request, {}, () => {
|
||||
sessionParser(info.req as express.Request, {} as express.Response, () => {
|
||||
const allowed = isElectron || (info.req as any).session.loggedIn || (config.General && config.General.noAuthentication);
|
||||
|
||||
if (!allowed) {
|
||||
|
||||
@@ -44,7 +44,8 @@ export default class BetterSqlite3Provider implements DatabaseProvider {
|
||||
|
||||
prepare(query: string): Statement {
|
||||
if (!this.dbConnection) throw new Error("DB not open.");
|
||||
return this.dbConnection.prepare(query);
|
||||
// Cast is safe: better-sqlite3 only returns bigint when safeIntegers() is enabled, which we don't use.
|
||||
return this.dbConnection.prepare(query) as unknown as Statement;
|
||||
}
|
||||
|
||||
transaction<T>(func: (statement: Statement) => T): Transaction {
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
"types": []
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
"src/**/*.ts",
|
||||
"src/**/*.json"
|
||||
],
|
||||
"references": [],
|
||||
"exclude": [
|
||||
|
||||
Reference in New Issue
Block a user