1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Desktop: Plugins: Allow commands registered within the beta markdown editor to take arguments (#9963)

This commit is contained in:
Henry Heino
2024-02-22 13:30:48 -08:00
committed by GitHub
parent e5e191110c
commit fbeaf31a14
6 changed files with 57 additions and 16 deletions

View File

@ -533,6 +533,8 @@ export interface MarkdownItContentScriptModule extends Omit<ContentScriptModule,
plugin: (markdownIt: any, options: any)=> any;
}
type EditorCommandCallback = (...args: any[])=> any;
export interface CodeMirrorControl {
/** Points to a CodeMirror 6 EditorView instance. */
editor: any;
@ -541,8 +543,9 @@ export interface CodeMirrorControl {
/** `extension` should be a [CodeMirror 6 extension](https://codemirror.net/docs/ref/#state.Extension). */
addExtension(extension: any|any[]): void;
execCommand(name: string): any;
supportsCommand(name: string): boolean;
execCommand(name: string, ...args: any[]): any;
registerCommand(name: string, callback: EditorCommandCallback): void;
joplinExtensions: {
/**