@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
19 lines (18 loc) • 972 B
TypeScript
import type { Mark, MarkType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
import type { EditorCommand } from '../types';
export declare function filterChildrenBetween(doc: PMNode, from: number, to: number, predicate: (node: PMNode, pos: number, parent: PMNode | null) => boolean | undefined): {
node: PMNode;
pos: number;
}[];
export declare const transformSmartCharsMentionsAndEmojis: (from: number, to: number, tr: Transaction) => void;
export declare const applyMarkOnRange: (from: number, to: number, removeMark: boolean, mark: Mark, tr: Transaction) => Transaction;
/**
* A custom version of the ProseMirror toggleMark, where we only toggle marks
* on text nodes in the selection rather than all inline nodes.
* @param markType
* @param attrs
*/
export declare const toggleMark: (markType: MarkType, attrs?: {
[key: string]: any;
} | undefined) => EditorCommand;