mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
chore(electron): renaming clipboard api (#3005)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { clipboard, nativeImage } from 'electron';
|
||||
import { clipboard, type IpcMainInvokeEvent, nativeImage } from 'electron';
|
||||
|
||||
import type { NamespaceHandlers } from '../type';
|
||||
|
||||
export const clipboardHandlers = {
|
||||
copyAsPng: async (_, dataURL: string) => {
|
||||
copyAsImageFromString: async (_: IpcMainInvokeEvent, dataURL: string) => {
|
||||
clipboard.writeImage(nativeImage.createFromDataURL(dataURL));
|
||||
},
|
||||
} satisfies NamespaceHandlers;
|
||||
|
||||
@@ -81,7 +81,7 @@ export abstract class UIHandlerManager extends HandlerManager<
|
||||
> {}
|
||||
|
||||
type ClipboardHandlers = {
|
||||
copyAsPng: (dataURL: string) => Promise<void>;
|
||||
copyAsImageFromString: (dataURL: string) => Promise<void>;
|
||||
};
|
||||
|
||||
export abstract class ClipboardHandlerManager extends HandlerManager<
|
||||
|
||||
Reference in New Issue
Block a user