UNPKG

electron-findbar

Version:
66 lines (65 loc) 1.68 kB
import { IpcRendererEvent } from 'electron'; /** * Remote IPC events to control the findbar through the renderer. */ interface Remote { /** * Get last queried text and the "match case" status. */ getLastState(): Promise<{ text: string; matchCase: boolean; movable: boolean; }>; /** * Change the input value and find it. * @param text - The text to search for */ inputChange(text: string): void; /** * Toggle case sensitive search * @param value - Whether to match case or not */ matchCase(value: boolean): void; /** * Navigate to the previous match */ previous(): void; /** * Navigate to the next match */ next(): void; /** * Open the findbar */ open(): void; /** * Close the findbar */ close(): void; /** * Listen for matches change event */ onMatchesChange(listener: (event: IpcRendererEvent, matches: { active: number; total: number; }) => void): void; /** * Listen for input focus event */ onInputFocus(listener: (event: IpcRendererEvent) => void): void; /** * Listen for text change event */ onTextChange(listener: (event: IpcRendererEvent, text: string) => void): void; /** * Listen for match case change event */ onMatchCaseChange(listener: (event: IpcRendererEvent, status: boolean) => void): void; /** * Listen for force theme change event */ onForceTheme(listener: (event: IpcRendererEvent, theme: 'light' | 'dark' | 'system') => void): void; } declare const Remote: Remote; export = Remote;