@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 • 832 B
TypeScript
import type { SlateElement, YooEditor } from '../types';
import type { GetElementOptions } from './types';
/**
* Get single element from a block
*
* @param editor - YooEditor instance
* @param options - Get options
* @returns Element or null if not found
*
* @example
* ```typescript
* // Get element by type and path
* const element = editor.getElement({
* blockId: 'accordion-1',
* type: 'accordion-list-item',
* path: [0, 1]
* });
*
* // Get element with custom matcher
* const activeItem = editor.getElement({
* blockId: 'accordion-1',
* match: (el) => el.type === 'accordion-list-item' && el.props?.isExpanded
* });
* ```
*/
export declare function getElement(editor: YooEditor, options: GetElementOptions): SlateElement | null;
//# sourceMappingURL=getElement.d.ts.map