Files
actual-actualbudget/packages/loot-core/typings/window.ts
Matiss Janis Aboltins 31a027fc64 [AI] Add per-package tsconfigs and typescript-strict-plugin for typecheck (#7019)
* [AI] Add per-package tsconfigs and typescript-strict-plugin for typecheck

Co-authored-by: Cursor <cursoragent@cursor.com>

* Update TypeScript configuration across multiple packages to correct plugin path key from "path" to "paths" and add reference to process-worker typings in index.electron.ts.

* Remove reference to process-worker typings in index.electron.ts and add new process-worker typings file for global Process augmentation.

* Refactor TypeScript build configurations across multiple packages by removing tsconfig.dist.json files and updating build scripts to use default TypeScript compilation. Adjusted compiler options to target ES2021 and enable declaration generation.

* Update TypeScript configuration in api package to refine include and exclude patterns for better file management.

* Update build script in api package to ensure migration SQL files are copied to the correct directory by creating the destination folder if it doesn't exist.

* Update TypeScript configurations in crdt and desktop-electron packages to refine include and exclude patterns for improved file management.

* Update TypeScript dependencies across multiple packages to include typescript-strict-plugin for enhanced type checking and maintain consistency in package.json files.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 21:26:22 +00:00

63 lines
1.7 KiB
TypeScript

import type EventEmitter from 'events';
export type IpcClient = {
on: EventEmitter['on'];
emit: (name: string, data: unknown) => void;
};
type FileDialogOptions = {
properties?: Array<'openFile' | 'openDirectory'>;
filters?: {
name: string;
extensions: string[];
}[];
};
type Actual = {
IS_DEV: boolean;
ACTUAL_VERSION: string;
openURLInBrowser: (url: string) => void;
openInFileManager: (filepath: string) => void;
saveFile: (
contents: string | Buffer,
filename: string,
dialogTitle?: string,
) => Promise<void>;
openFileDialog: (options: FileDialogOptions) => Promise<string[]>;
relaunch: () => void;
reload: (() => Promise<void>) | undefined;
restartElectronServer: () => void;
moveBudgetDirectory: (
currentBudgetDirectory: string,
newDirectory: string,
) => Promise<void>;
applyAppUpdate: () => Promise<void>;
ipcConnect: (callback: (client: IpcClient) => void) => void;
getServerSocket: () => Promise<Worker | null>;
setTheme: (theme: string) => void;
logToTerminal: (...args: unknown[]) => void;
onEventFromMain: (
event: string,
listener: (...args: unknown[]) => void,
) => void;
isUpdateReadyForDownload: () => boolean;
waitForUpdateReadyForDownload: () => Promise<void>;
startSyncServer: () => Promise<void>;
stopSyncServer: () => Promise<void>;
isSyncServerRunning: () => Promise<boolean>;
startOAuthServer: () => Promise<string>;
};
declare global {
var Actual: Actual;
// oxlint-disable-next-line typescript/consistent-type-definitions -- global Window augmentation requires interface
interface Window {
Actual: Actual;
}
var IS_TESTING: boolean;
var currentMonth: string | null;
}