[AI] Typescript: low hanging fruit (#7091)

* [AI] Use loot-core workspace in desktop-electron and fix related types

- Add loot-core as workspace dependency in desktop-electron
- Import GlobalPrefsJson from loot-core package in desktop-electron
- Allow null in usersSlice data type (UsersState)
- Add explicit SQL.Database return type to openDatabase in sqlite electron

Made-with: Cursor

* Re-add loot-core as a workspace dependency in desktop-electron
This commit is contained in:
Matiss Janis Aboltins
2026-03-04 18:32:01 +00:00
committed by GitHub
parent b373b612a4
commit cf05a7ea01
6 changed files with 11 additions and 3 deletions

View File

@@ -100,7 +100,7 @@ function regexp(regex: string, text: string | null) {
return new RegExp(regex).test(text || '') ? 1 : 0;
}
export function openDatabase(pathOrBuffer: string | Buffer) {
export function openDatabase(pathOrBuffer: string | Buffer): SQL.Database {
const db = new SQL(pathOrBuffer);
// Define Unicode-aware LOWER, UPPER, and LIKE implementation.
// This is necessary because better-sqlite3 uses SQLite build without ICU support.