CommandPaletteModal
Unofficial
Fuzzy suggest modal used by the command palette to search and execute commands.
Import:
import type { CommandPaletteModal } from '@obsidian-typings/obsidian-catalyst-latest';Signature:
export interface CommandPaletteModal extends FuzzySuggestModal<Command>Extends: FuzzySuggestModal<Command>
Constructor
new CommandPaletteModal(app: App)Constructor.
To extract the constructor type, use ExtractConstructor<FuzzySuggestModal>.
Properties
| Property | Type | Description | |
|---|---|---|---|
| chooser | SuggestModalChooser<FuzzyMatch<Command>, this> | The suggestion chooser that manages selection and rendering. (Inherited from FuzzySuggestModal) | |
| clearButtonEl | HTMLDivElement | Button element to clear the input field. (Inherited from FuzzySuggestModal) | |
| commands | Command[] | null | Cached list of available commands, or null if not yet populated. | |
| ctaEl | HTMLDivElement | Call-to-action element displayed in the modal. (Inherited from FuzzySuggestModal) | |
| emptyStateText | string | The text to display when there are no suggestions. (Inherited from FuzzySuggestModal) | |
| inputEl | HTMLInputElement | The input element. (Inherited from FuzzySuggestModal) | |
| instructionsEl | HTMLDivElement | Element displaying keyboard shortcut instructions. (Inherited from FuzzySuggestModal) | |
| isOpen | boolean | Whether the suggest modal is currently open. (Inherited from FuzzySuggestModal) | |
| limit | number | The limit of the number of suggestions. (Inherited from FuzzySuggestModal) | |
| plugin | CommandPalettePluginInstance | Reference to the command palette plugin instance. | |
| resultContainerEl | HTMLElement | The result container element. (Inherited from FuzzySuggestModal) |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| getItems() | Command[] | Get the items to be used in the fuzzy search. (Inherited from FuzzySuggestModal) | |
| getItemText(item) | string | Get the text to be used in the fuzzy search. (Inherited from FuzzySuggestModal) | |
| getSuggestions(query) | FuzzyMatch<Command>[] | Get the suggestions for the fuzzy match. (Inherited from FuzzySuggestModal) | |
| onChooseItem(item, evt) | void | Called when an item is chosen. (Inherited from FuzzySuggestModal) | |
| onChooseSuggestion(item, evt) | void | Called when a suggestion is chosen. (Inherited from FuzzySuggestModal) | |
| onChooseSuggestion(item, evt) | void | Choose a suggestion. (Inherited from FuzzySuggestModal) | |
| onInput() | void | Handle input change in the suggest modal. (Inherited from FuzzySuggestModal) | |
| onNoSuggestion() | void | Set the callback to be called when there are no suggestions. (Inherited from FuzzySuggestModal) | |
| renderSuggestion(item, el) | void | Render the suggestion. (Inherited from FuzzySuggestModal) | |
| renderSuggestion(value, el) | void | Render a suggestion. (Inherited from FuzzySuggestModal) | |
| selectActiveSuggestion(evt) | void | Select the active suggestion. (Inherited from FuzzySuggestModal) | |
| selectSuggestion(value, evt) | void | Select a suggestion. (Inherited from FuzzySuggestModal) | |
| setInstructions(instructions) | void | Set the instructions. (Inherited from FuzzySuggestModal) | |
| setPlaceholder(placeholder) | void | Set the placeholder text. (Inherited from FuzzySuggestModal) | |
| sortSuggestions(suggestions) | void | Sorts the fuzzy-match suggestions, highest score first. (Inherited from FuzzySuggestModal) | |
| updateSuggestions() | void | Refresh the displayed suggestions based on the current query. (Inherited from FuzzySuggestModal) |
Links to this page: