@yoopta/editor
Version:
<h2 align="center">Yoopta-Editor v1 🎉</h2> <p align="center">Yoopta-Editor - is an open source notion-like editor 💥</p> <div align="center"> <img width="574" alt="Screen Shot 2023-01-25 at 16 04 29" src="https://user-images.githubusercontent.com/2909311
27 lines • 1.1 kB
TypeScript
import type { PluginElement } from '../../plugins/types';
import type { YooEditor } from '../types';
import type { GetRootElementOptions } from './types';
/**
* Get the root element definition for a given block type (plugin).
*
* Each plugin defines one or more elements. The root element is either the only
* element in the map, or the one marked with `asRoot: true`.
*
* @param editor - YooEditor instance
* @param options - Options with `blockType` specifying the plugin type
* @returns The root PluginElement definition, or `undefined` if the plugin
* doesn't exist or has no root element.
*
* @example
* ```typescript
* // Get root element of an Accordion plugin
* const rootElement = Elements.getRootElement(editor, { blockType: 'Accordion' });
*
* // Check if root element is void
* if (rootElement?.props?.nodeType === 'void') {
* // handle void element
* }
* ```
*/
export declare function getRootElement(editor: YooEditor, options: GetRootElementOptions): PluginElement<string, unknown> | undefined;
//# sourceMappingURL=getRootElement.d.ts.map