Skip to content

EmbedRegistry

Unofficial

A registry for embeddable files components.

Import:

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

Signature:

export interface EmbedRegistry extends Events

Extends: Events

Constructor

new EmbedRegistry()

Constructor.

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

Properties

Property Type Description
_ Record<string, EventsEntry[]> Internal storage of registered event handlers by event name.
(Inherited from Events)
embedByExtension EmbedRegistryEmbedByExtensionRecord Mapping of file extensions to constructors for embeddable widgets.

Methods

Method Returns Description
getEmbedCreator(file) EmbedCreator | null Get the embed constructor for a specific file type.
isExtensionRegistered(extension) boolean Check whether a file extension has a registered embed constructor.
off(name, callback) void Remove an event listener.
(Inherited from Events)
offref(ref) void Remove an event listener by reference.
(Inherited from Events)
on(name, callback, ctx?) EventRef Add an event listener.
(Inherited from Events)
registerExtension(extension, embedCreator) void Register an embed constructor for a specific file extension.
registerExtensions(extensions, embedCreator) void Register an embed constructor for a list of file extensions.
trigger(name, data?) void Trigger an event, executing all the listeners in order even if some of them throw an error.
(Inherited from Events)
tryTrigger(evt, args) void Try to trigger an event, executing all the listeners in order even if some of them throw an error.
(Inherited from Events)
unregisterExtension(extension) void Unregister an embed constructor for a specific file extension.
unregisterExtensions(extensions) void Unregister an embed constructor for a list of file extensions.

Links to this page: