feat(web): add ElectronAPI type declaration for window.electronAPI

This commit is contained in:
CREDO23 2026-03-20 20:39:18 +02:00
parent 9e058e1329
commit d6d4ebc75d
2 changed files with 15 additions and 1 deletions

View file

@ -317,7 +317,7 @@ const Composer: FC = () => {
// Clipboard content
const [clipboardText, setClipboardText] = useState<string | undefined>();
useEffect(() => {
const api = (window as { electronAPI?: { getClipboardContent?: () => Promise<string> } }).electronAPI;
const api = window.electronAPI;
if (!api?.getClipboardContent) return;
api.getClipboardContent().then((text) => {
if (text) setClipboardText(text);