Skip to content

PublishPluginApiParams<TApi>

Parameters for publishPluginApi.

Import:

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

Signature:

export interface PublishPluginApiParams<TApi extends object>

Properties

PropertyTypeDescription
apiTApiThe API object to publish. Its methods are handed to consumers through a revocable handle, and they are always invoked with this object as their this, so an implementation using private class fields keeps working.
apiVersionstringThe CONTRACT version, in semver form — independent of the plugin's own version. Plugin 1.4.7 may perfectly well expose API 2.0.0.
contract?PluginApiContractThe contract this version of the API satisfies. Optional: when omitted, no shape check is performed on the provider's behalf and the consumer's own contract (if any) is used instead.
pluginPluginThe publishing plugin. The record is keyed by its manifest.id and revoked automatically when the plugin unloads, via plugin.register().

Links to this page: