feat: expose clipboard apis (#2932)

This commit is contained in:
Fangdun Tsai
2023-06-30 12:47:30 +08:00
committed by GitHub
parent 79cded302f
commit d3393cb0fc
3 changed files with 25 additions and 0 deletions

View File

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