obsidian-dev-utils
Version:
This is the collection of useful functions that you can use for your Obsidian plugin development
29 lines (28 loc) • 969 B
text/typescript
/**
* @packageDocumentation
*
* Base classes for non-editor commands.
*/
import type { Plugin } from 'obsidian';
import type { CommandInvocationBase } from './CommandBase.cjs';
import { CommandBase } from './CommandBase.cjs';
/**
* Base class for non-editor commands.
*
* @typeParam TPlugin - The type of the plugin that the command belongs to.
*/
export declare abstract class NonEditorCommandBase<TPlugin extends Plugin> extends CommandBase<TPlugin> {
/**
* Checks if the command can execute or executes it.
*
* @param checking - Is checking mode only. If `true`, only the check if the command can execute is performed. If `false`, the command is executed.
* @returns Whether the command can execute.
*/
checkCallback(checking: boolean): boolean;
/**
* Creates a new command invocation.
*
* @returns The command invocation.
*/
protected abstract createCommandInvocation(): CommandInvocationBase;
}