Skip to content

publishPluginApi<TApi>

Publishes a plugin’s API so other plugins can consume it, keyed by the plugin’s manifest.id and revoked automatically when the plugin unloads.

Several contract versions may be published side by side, so a provider can move to 2.0.0 without breaking consumers still pinned to ^1.

Import:

import { publishPluginApi } from 'obsidian-dev-utils/obsidian/plugin/plugin-api';

Signature:

function publishPluginApi(params: PublishPluginApiParams<TApi>): void

Parameters:

ParameterTypeDescription
paramsPublishPluginApiParams<TApi>The parameters for publishing.

Returns: void


Links to this page: