chore(types): re-add type-only BrowserWindow / Tray imports

Follow-up to the CJS refactor: destructuring electron.BrowserWindow /
electron.Tray pulled the values into scope but lost the type
namespace, breaking sites that used the bare class name as a type
(let win: BrowserWindow | null, return-type annotations,
implicitly-any close handlers). Added 'import type { ... as ...Type }'
for each affected file and replaced the type-position references
with the aliased names. Runtime semantics unchanged; typecheck
exits 0 again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
altair823
2026-04-25 12:34:06 +09:00
parent 94fc7c72d3
commit 96cab71fd6
3 changed files with 11 additions and 8 deletions

View File

@@ -1,14 +1,15 @@
import electron from 'electron';
import type { BrowserWindow as BrowserWindowType } from 'electron';
const { BrowserWindow, screen } = electron;
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
let win: BrowserWindow | null = null;
let win: BrowserWindowType | null = null;
const __dirname = fileURLToPath(new URL('.', import.meta.url));
export function getQuickCaptureWindow(): BrowserWindow | null { return win; }
export function getQuickCaptureWindow(): BrowserWindowType | null { return win; }
export function createQuickCaptureWindow(): BrowserWindow {
export function createQuickCaptureWindow(): BrowserWindowType {
if (win && !win.isDestroyed()) return win;
const primary = screen.getPrimaryDisplay();
const W = 640, H = 280;