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 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'; /** * Options for {@link alert}. */ export interface AlertOptions { /** * An Obsidian app instance. */ app: App; /** * A CSS class to apply to the modal. */ cssClass?: string; /** * A message to display in the modal. */ message: DocumentFragment | string; /** * A text for the "OK" button. */ okButtonText?: string; /** * A 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>;