mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-09 06:02:22 -05:00
[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:
committed by
GitHub
parent
b373b612a4
commit
cf05a7ea01
@@ -60,7 +60,7 @@ export const signOut = createAppAsyncThunk(
|
||||
);
|
||||
|
||||
type UsersState = {
|
||||
data: Awaited<ReturnType<Handlers['subscribe-get-user']>>;
|
||||
data: Awaited<ReturnType<Handlers['subscribe-get-user']>> | null;
|
||||
};
|
||||
|
||||
const initialState: UsersState = {
|
||||
|
||||
@@ -25,7 +25,7 @@ import type {
|
||||
import { copy, exists, mkdir, remove } from 'fs-extra';
|
||||
import promiseRetry from 'promise-retry';
|
||||
|
||||
import type { GlobalPrefsJson } from '../loot-core/src/types/prefs';
|
||||
import type { GlobalPrefsJson } from 'loot-core/src/types/prefs';
|
||||
|
||||
import { getMenu } from './menu';
|
||||
import {
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
"cross-env": "^10.1.0",
|
||||
"electron": "39.2.7",
|
||||
"electron-builder": "26.4.0",
|
||||
"loot-core": "workspace:*",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-strict-plugin": "^2.4.4"
|
||||
},
|
||||
|
||||
@@ -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.
|
||||
|
||||
6
upcoming-release-notes/7091.md
Normal file
6
upcoming-release-notes/7091.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Maintenance
|
||||
authors: [MatissJanis]
|
||||
---
|
||||
|
||||
TypeScript: clean up some types
|
||||
Reference in New Issue
Block a user