chore(electron): renaming clipboard api (#3005)

This commit is contained in:
Fangdun Tsai
2023-07-04 20:51:59 +08:00
committed by GitHub
parent e4539dfeb1
commit 2bc15665b9
2 changed files with 3 additions and 3 deletions

View File

@@ -1,9 +1,9 @@
import { clipboard, nativeImage } from 'electron'; import { clipboard, type IpcMainInvokeEvent, nativeImage } from 'electron';
import type { NamespaceHandlers } from '../type'; import type { NamespaceHandlers } from '../type';
export const clipboardHandlers = { export const clipboardHandlers = {
copyAsPng: async (_, dataURL: string) => { copyAsImageFromString: async (_: IpcMainInvokeEvent, dataURL: string) => {
clipboard.writeImage(nativeImage.createFromDataURL(dataURL)); clipboard.writeImage(nativeImage.createFromDataURL(dataURL));
}, },
} satisfies NamespaceHandlers; } satisfies NamespaceHandlers;

View File

@@ -81,7 +81,7 @@ export abstract class UIHandlerManager extends HandlerManager<
> {} > {}
type ClipboardHandlers = { type ClipboardHandlers = {
copyAsPng: (dataURL: string) => Promise<void>; copyAsImageFromString: (dataURL: string) => Promise<void>;
}; };
export abstract class ClipboardHandlerManager extends HandlerManager< export abstract class ClipboardHandlerManager extends HandlerManager<