1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00
Files
joplin/packages/app-desktop/commands/copyToClipboard.ts
2025-05-05 00:29:31 +01:00

16 lines
418 B
TypeScript

import { CommandRuntime, CommandDeclaration } from '@joplin/lib/services/CommandService';
import { clipboard } from 'electron';
export const declaration: CommandDeclaration = {
name: 'copyToClipboard',
};
export const runtime = (): CommandRuntime => {
return {
execute: async (_context, content: string) => {
if (!content || (typeof content !== 'string')) return;
clipboard.writeText(content);
},
};
};