@cinc101/electron-capture
Version:
Electron multi-screen screenshot plugin with annotation and multi-language support.
28 lines (25 loc) • 780 B
TypeScript
import { ipcMain, screen, BrowserWindow, desktopCapturer, dialog } from 'electron';
export interface CapturePluginExports {
prepareCaptureWindow: () => void;
onCaptureDone?: (imageDataUrl: string) => void;
onCaptureCancel?: () => void;
}
export interface PluginContext {
electron: {
ipcMain: typeof ipcMain;
screen: typeof screen;
BrowserWindow: typeof BrowserWindow;
desktopCapturer: typeof desktopCapturer;
dialog: typeof dialog;
};
ipc: {
registerCommand: (channel: string, handler: (...args: any[]) => any) => void;
};
exports?: CapturePluginExports;
logger?: (msg: string) => void;
config?: {
color?: string;
lang?: 'zh' | 'en';
};
}
export declare function onLoad(ctx: PluginContext): void;