ngx-editor
Version:
The Rich Text Editor for Angular, Built on ProseMirror
21 lines (20 loc) • 636 B
TypeScript
import type { EditorState, Command } from 'prosemirror-state';
type Name = 'text_color' | 'text_background_color';
type AttrName = 'color' | 'backgroundColor';
interface ColorAttrs {
color: string;
}
interface BackgroundColorAttrs {
backgroundColor: string;
}
declare class TextColor {
name: Name;
attrName: AttrName;
constructor(name: Name, attrName?: AttrName);
apply(attrs: ColorAttrs | BackgroundColorAttrs): Command;
isActive(state: EditorState): boolean;
getActiveColors(state: EditorState): string[];
remove(): Command;
canExecute(state: EditorState): boolean;
}
export default TextColor;