fix: typing errors

This commit is contained in:
Johannes Millan 2025-08-04 22:08:29 +02:00
parent 62c2649320
commit 6b93b6dc35
4 changed files with 6 additions and 17 deletions

View file

@ -4,11 +4,9 @@
import { ElectronAPI } from '../../../electron/electronAPI';
// Extend the existing Window interface declaration
// Note: In test environment, this is declared as required in test.ts
// In runtime, this may be undefined in web context
declare global {
interface Window {
ea?: ElectronAPI | undefined;
ea: ElectronAPI;
}
}

View file

@ -2,7 +2,7 @@ import { saveAs } from 'file-saver';
import { Directory, Encoding, Filesystem, WriteFileResult } from '@capacitor/filesystem';
import { IS_ANDROID_WEB_VIEW } from './is-android-web-view';
import { Log } from '../core/log';
import '../core/window-ea';
import '../core/window-ea.d';
const isRunningInSnap = (): boolean => {
return !!window.ea?.isSnap?.();

View file

@ -11,7 +11,7 @@ import { environment } from './environments/environment';
import { IS_ELECTRON, LanguageCode } from './app/app.constants';
import { IS_ANDROID_WEB_VIEW } from './app/util/is-android-web-view';
import { androidInterface } from './app/features/android/android-interface';
import { ElectronAPI } from '../electron/electronAPI.d';
import './app/core/window-ea.d';
import { App as CapacitorApp } from '@capacitor/app';
import { GlobalErrorHandler } from './app/core/error-handler/global-error-handler.class';
import {
@ -77,11 +77,7 @@ if (environment.production || environment.stage) {
enableProdMode();
}
declare global {
interface Window {
ea: ElectronAPI;
}
}
// Window.ea declaration is in src/app/core/window-ea.d.ts
const createTranslateLoader = (http: HttpClient): TranslateHttpLoader =>
new TranslateHttpLoader(http, './assets/i18n/', '.json');

View file

@ -6,13 +6,8 @@ import {
platformBrowserDynamicTesting,
} from '@angular/platform-browser-dynamic/testing';
import { provideExperimentalZonelessChangeDetection } from '@angular/core';
import { ElectronAPI } from '../electron/electronAPI';
declare global {
interface Window {
ea: ElectronAPI;
}
}
// Import type definitions for window.ea
import './app/core/window-ea.d';
beforeAll(() => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 2000;