ThirdPartyPluginAdapter<TApi>
How to get from one third-party plugin’s instance to its typed API.
An adapter is plain data plus one function, so it can be a module-level constant shared by every consumer, and adding a plugin means adding one adapter.
Import:
import type { ThirdPartyPluginAdapter } from '@mnaoumov/obsidian-lib/plugin/third-party-plugin';Signature:
export interface ThirdPartyPluginAdapter<TApi extends object>Properties
| Property | Type | Description |
|---|---|---|
| getApi | (plugin: Plugin) => null | TApi | Reads the typed API off a running instance of the plugin, VERIFYING its shape. Return null when the instance does not carry the members the adapter types, which is what a release that renamed or reshaped them looks like. Never cast: a cast asserts a shape nothing checked. |
| minPluginVersion? | string | The oldest release of the plugin the adapter was verified against, compared with its manifest.version. A release below it reads as PluginAvailability.Outdated. |
| pluginId | string | The manifest.id of the plugin. |
| pluginName | string | The display name of the plugin, shown to the user. |
Links to this page: