obsidian-dev-utils
Version:
This is the collection of useful functions that you can use for your Obsidian plugin development
23 lines (22 loc) • 876 B
text/typescript
/**
* @packageDocumentation
*
* This module provides utility functions for managing Obsidian plugins,
* including displaying error messages, disabling plugins, and reloading them.
*/
import type { Plugin } from 'obsidian';
/**
* Reloads the specified plugin by disabling and then re-enabling it.
*
* @param plugin - The plugin to reload.
* @returns A {@link Promise} that resolves when the plugin is reloaded.
*/
export declare function reloadPlugin(plugin: Plugin): Promise<void>;
/**
* Displays an error message as a notice, logs it to the console, and disables the specified plugin.
*
* @param plugin - The plugin to disable.
* @param message - The error message to display and log.
* @returns A {@link Promise} that resolves when the plugin is disabled.
*/
export declare function showErrorAndDisablePlugin(plugin: Plugin, message: string): Promise<void>;