Skip to content

TemplatesPlugin

Unofficial

Internal plugin registration for the templates feature.

Import:

import type { TemplatesPlugin } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface TemplatesPlugin extends InternalPlugin<TemplatesPluginInstance>

Extends: InternalPlugin<TemplatesPluginInstance>

Constructor

new TemplatesPlugin(app: App, instance: TemplatesPluginInstance, internalPlugins: InternalPlugins)

Constructor.

To get the constructor instance, use getInternalPluginConstructor from obsidian-typings/implementations.

Properties

Property Type Description
_children Component[] Child Components attached to current component, will be unloaded on unloading parent component.
(Inherited from InternalPlugin)
_events EventRef[] Events that are attached to the current component, will be detached on unloading parent component.
(Inherited from InternalPlugin)
_loaded boolean Whether the component and its children are loaded.
(Inherited from InternalPlugin)
addedButtonEls HTMLDivElement[] Button elements added by this plugin.
(Inherited from InternalPlugin)
app App Reference to the app.
(Inherited from InternalPlugin)
commands Command[] Commands registered by this plugin.
(Inherited from InternalPlugin)
enabled boolean Whether this plugin is currently enabled.
(Inherited from InternalPlugin)
hasStatusBarItem boolean Whether this plugin has a status bar item.
(Inherited from InternalPlugin)
instance TemplatesPluginInstance The plugin instance containing the actual logic.
(Inherited from InternalPlugin)
lastSave number Timestamp of the last settings save.
(Inherited from InternalPlugin)
manager InternalPlugins Reference to the internal plugins manager.
(Inherited from InternalPlugin)
mobileFileInfo MobileFileInfo[] Mobile file info renderers registered by this plugin.
(Inherited from InternalPlugin)
onConfigFileChange Debouncer<[], Promise<void>> Debounced handler for config file changes.
(Inherited from InternalPlugin)
ribbonItems RibbonItem[] Ribbon items registered by this plugin.
(Inherited from InternalPlugin)
statusBarEl HTMLDivElement | null Status bar element for this plugin, or null if none.
(Inherited from InternalPlugin)
views Record<string, ViewCreator> View creators registered by this plugin, keyed by view type.
(Inherited from InternalPlugin)

Methods

Method Returns Description
addChild(component) T Adds a child component, loading it if this component is loaded.
(Inherited from InternalPlugin)
addSettingTab(settingTab) void Add a settings tab for this plugin.
(Inherited from InternalPlugin)
deleteData() Promise<void> Delete persisted data for this plugin.
(Inherited from InternalPlugin)
disable(isDisabledByUser?) void Disable this plugin.
(Inherited from InternalPlugin)
enable(isEnabledByUser?) Promise<void> Enable this plugin.
(Inherited from InternalPlugin)
getModifiedTime() Promise<number | undefined> Get the last modified time of the plugin config file.
(Inherited from InternalPlugin)
handleConfigFileChange() Promise<void> Handle changes to the plugin config file.
(Inherited from InternalPlugin)
init() void Initialize this plugin.
(Inherited from InternalPlugin)
load() void Load this component and its children.
(Inherited from InternalPlugin)
loadData() Promise<null | object> Load persisted data for this plugin.
(Inherited from InternalPlugin)
onload() void Override this to load your component.
(Inherited from InternalPlugin)
onunload() void Override this to unload your component
(Inherited from InternalPlugin)
register(cb) void Registers a callback to be called when unloading.
(Inherited from InternalPlugin)
registerDomEvent(el, type, callback, options?) void Registers a DOM event to be detached when unloading.
(Inherited from InternalPlugin)
registerDomEvent(el, type, callback, options?) void Registers a DOM event to be detached when unloading
(Inherited from InternalPlugin)
registerDomEvent(el, type, callback, options?) void Registers a DOM event to be detached when unloading
(Inherited from InternalPlugin)
registerEvent(eventRef) void Registers an event to be detached when unloading.
(Inherited from InternalPlugin)
registerGlobalCommand(command) void Register a global command for this plugin.
(Inherited from InternalPlugin)
registerInterval(id) number Registers an interval (from setInterval) to be cancelled when unloading. Use window.setInterval instead of setInterval to avoid TypeScript confusing between NodeJS vs Browser API
(Inherited from InternalPlugin)
registerMobileFileInfo(renderCallback) void Register a mobile file info renderer callback.
(Inherited from InternalPlugin)
registerRibbonItem(title, icon, callback) void Register a ribbon item button for this plugin.
(Inherited from InternalPlugin)
registerScopeEvent(keymapEventHandler) void Register a scope keymap event handler to be removed on unload.
(Inherited from InternalPlugin)
registerStatusBarItem() void Register a status bar item for this plugin.
(Inherited from InternalPlugin)
registerViewType(type, creator) void Register a view type with its creator function.
(Inherited from InternalPlugin)
removeChild(component) T Removes a child component, unloading it.
(Inherited from InternalPlugin)
saveData(data) Promise<void> Save data for this plugin.
(Inherited from InternalPlugin)
unload() void Override this to unload your component.
(Inherited from InternalPlugin)

Links to this page: