Skip to content

EmbedRegistry

Unofficial

A registry for embeddable files components.

Import:

import type { EmbedRegistry } from '@obsidian-typings/obsidian-public-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

PropertyTypeDescription
_Record<string, EventsEntry[]>Internal storage of registered event handlers by event name.
(Inherited from Events)
embedByExtensionEmbedRegistryEmbedByExtensionRecordMapping of file extensions to constructors for embeddable widgets.

Methods

MethodReturnsDescription
getEmbedCreator(file)EmbedCreator | nullGet the embed constructor for a specific file type.
isExtensionRegistered(extension)booleanCheck whether a file extension has a registered embed constructor.
off(name, callback)voidRemove an event listener.
(Inherited from Events)
offref(ref)voidRemove an event listener by reference.
(Inherited from Events)
on(name, callback, ctx?)EventRefAdd an event listener.
(Inherited from Events)
registerExtension(extension, embedCreator)voidRegister an embed constructor for a specific file extension.
registerExtensions(extensions, embedCreator)voidRegister an embed constructor for a list of file extensions.
trigger(name, data?)voidTrigger an event, executing all the listeners in order even if some of them throw an error.
(Inherited from Events)
tryTrigger(evt, args)voidTry to trigger an event, executing all the listeners in order even if some of them throw an error.
(Inherited from Events)
unregisterExtension(extension)voidUnregister an embed constructor for a specific file extension.
unregisterExtensions(extensions)voidUnregister an embed constructor for a list of file extensions.

Links to this page: