@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
34 lines • 957 B
TypeScript
import type { YooEditor } from '../types';
import type { ToggleMarkOptions } from './types';
/**
* Toggle mark in specified selection or blocks
*
* @param editor - YooEditor instance
* @param options - Toggle mark options
*
* @example
* ```typescript
* // Toggle bold in current text selection (slate.selection) or whole block
* Marks.toggle(editor, { type: 'bold' });
*
* // Toggle mark in specific selection
* Marks.toggle(editor, {
* type: 'bold',
* selection: { anchor: { path: [0, 0], offset: 0 }, focus: { path: [0, 0], offset: 5 } }
* });
*
* // Toggle italic in specific block
* Marks.toggle(editor, {
* type: 'italic',
* at: 0
* });
*
* // Toggle underline in multiple blocks
* Marks.toggle(editor, {
* type: 'underline',
* at: [0, 1, 2]
* });
* ```
*/
export declare function toggle(editor: YooEditor, options: ToggleMarkOptions): void;
//# sourceMappingURL=toggle.d.ts.map