UndoBulkOperationCommandHandler
A command handler that lists the plugin’s bulk operations recorded in the vault repository and reverts the one the user picks. Available only on desktop, while the plugin’s bulk-operation commits are enabled.
Import:
import { UndoBulkOperationCommandHandler } from '@mnaoumov/obsidian-lib/command-handlers/undo-bulk-operation-command-handler';Signature:
export class UndoBulkOperationCommandHandler extends GlobalCommandHandlerExtends: GlobalCommandHandler
Constructor
new UndoBulkOperationCommandHandler(params: UndoBulkOperationCommandHandlerConstructorParams)Creates a new instance.
Properties
| Property | Type | Description |
|---|---|---|
| bulkOperationCommitComponent | BulkOperationCommitComponent | The component that commits the plugin's bulk operations. |
| icon | IconName | The icon for the command. (Inherited from GlobalCommandHandler) |
| id | string | The ID of the command. (Inherited from GlobalCommandHandler) |
| isEnabled | () => boolean | Whether the plugin's opt-in setting for bulk-operation commits is on. |
| name | string | The display name of the command. (Inherited from GlobalCommandHandler) |
Methods
| Method | Returns | Description |
|---|---|---|
| buildCommand() | Command | Builds a plain Obsidian Command object with a checkCallback.(Inherited from GlobalCommandHandler) |
| canExecute() | boolean | Checks whether the command can currently execute: on desktop, with bulk-operation commits enabled. |
| execute() | Promise<void> | Executes the command, letting the user pick a bulk operation to revert. |
| onRegistered(context) | Promise<void> | Called after the command has been registered with Obsidian. Subclasses use the provided context to register menu event handlers. Throws when the same instance is registered twice. A handler stores per-registration state — the plugin name here, the active-file provider and the submenu override in AbstractFileCommandHandler, plus whatever a subclass records — and the menu closures registered here read that state lazily, at menu-render time. So a second registration silently rewrites what the first registration's closures will see. CommandHandlerComponent registers a handler set once per menu surface, which is why CommandHandlerFactory must build FRESH instances on every call; this guard turns a factory that hands out shared instances into a loud failure instead of a wrong context menu.(Inherited from GlobalCommandHandler) |
Links to this page: