PluginSuggestionComponentConstructorParams
Parameters for the PluginSuggestionComponent constructor.
Import:
import type { PluginSuggestionComponentConstructorParams } from 'obsidian-dev-utils/obsidian/components/plugin-suggestion-component';Signature:
export interface PluginSuggestionComponentConstructorParamsProperties
| Property | Type | Description |
|---|---|---|
| app | App | The Obsidian app instance. |
| pluginNoticeComponent | PluginNoticeComponent | The notice component of the plugin making the suggestion, used to show the suggestion and its outcome. |
| pluginSettingsComponent | PluginSettingsComponentBase<object> | The settings component holding whatever isSuggestionDeclined reads.Taken as a whole component rather than as a bare "ready" flag so the host cannot forget to wire the wait: the notice is decided only after this component has read data.json. See PluginSettingsComponentBase.whenLoadedFromFile for why the read cannot simply happen at layout-ready. |
| reason | string | The localized sentence explaining what the host plugin cannot do without the suggested plugin. The host plugin owns this string: only it knows which of its features are affected. |
| suggestedPluginId | string | The id of the suggested plugin, as listed in Obsidian's community plugin registry. |
| suggestedPluginName | string | The display name of the suggested plugin, shown to the user. |
Methods
| Method | Returns | Description |
|---|---|---|
| isSuggestionDeclined(this) | boolean | Whether the user has already declined this suggestion. Storage belongs to the host plugin (typically one of its settings), because this component has no data.json of its own and a decline has to outlive a reload.Only ever called once pluginSettingsComponent reports its settings loaded, so an implementation reading a setting is guaranteed to read the stored value rather than its default. |
| setSuggestionDeclined(this, isDeclined) | Promisable<void> | Records the user's answer to the suggestion. |