UNPKG

obsidian-dev-utils

Version:

This is the collection of useful functions that you can use for your Obsidian plugin development

41 lines (40 loc) 1.01 kB
/** * @packageDocumentation * * Utility for displaying alert modals in Obsidian. * * This module exports a function to display a modal with a message in Obsidian. The modal includes an "OK" button to close it. */ import type { App } from 'obsidian'; /** * The options for the alert modal. */ export interface AlertOptions { /** * The Obsidian app instance. */ app: App; /** * The CSS class to apply to the modal. */ cssClass?: string; /** * The message to display in the modal. */ message: DocumentFragment | string; /** * The text for the "OK" button. */ okButtonText?: string; /** * The title of the modal. */ title?: DocumentFragment | string; } /** * Displays an alert modal in Obsidian with a specified message. * * @param options - The options for the alert modal. * @returns A {@link Promise} that resolves when the modal is closed. */ export declare function alert(options: AlertOptions): Promise<void>;