UNPKG

@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

33 lines • 907 B
import type { YooEditor } from '../types'; import type { AddMarkOptions } from './types'; /** * Add mark to specified selection or blocks * * @param editor - YooEditor instance * @param options - Add mark options * * @example * ```typescript * // Add bold mark to current text selection (slate.selection) or whole block * Marks.add(editor, { * type: 'bold', * value: true * }); * * // Add mark to specific selection * Marks.add(editor, { * type: 'bold', * value: true, * selection: { anchor: { path: [0, 0], offset: 0 }, focus: { path: [0, 0], offset: 5 } } * }); * * // Add color mark to specific block (ignores text selection) * Marks.add(editor, { * type: 'color', * value: '#ff0000', * at: 0 * }); * ``` */ export declare function addMark(editor: YooEditor, options: AddMarkOptions): void; //# sourceMappingURL=addMark.d.ts.map