UNPKG

@atlaskit/editor-core

Version:

A package contains Atlassian editor core functionality

56 lines (55 loc) 2.02 kB
import { Mark, Plugin, PluginKey, EditorState, EditorView, Schema } from '../../prosemirror'; export declare type StateChangeHandler = (state: TextFormattingState) => any; export declare type BlockTypeStateSubscriber = (state: TextFormattingState) => void; export declare class TextFormattingState { private changeHandlers; private state; emActive: boolean; emDisabled: boolean; emHidden: boolean; codeActive: boolean; codeDisabled: boolean; codeHidden: boolean; underlineActive: boolean; underlineDisabled: boolean; underlineHidden: boolean; strikeActive: boolean; strikeDisabled: boolean; strikeHidden: boolean; strongActive: boolean; strongDisabled: boolean; strongHidden: boolean; superscriptActive: boolean; superscriptDisabled: boolean; superscriptHidden: boolean; subscriptActive: boolean; subscriptDisabled: boolean; subscriptHidden: boolean; marksToRemove: any; keymapHandler: any; constructor(state: EditorState<any>); toggleEm(view: EditorView): boolean; toggleCode(view: EditorView): boolean; toggleStrike(view: EditorView): boolean; toggleStrong(view: EditorView): boolean; toggleSuperscript(view: EditorView): boolean; toggleSubscript(view: EditorView): boolean; toggleUnderline(view: EditorView): boolean; subscribe(cb: StateChangeHandler): void; unsubscribe(cb: StateChangeHandler): void; update(newEditorState: EditorState<any>): void; /** * Determine if a mark (with specific attribute values) exists anywhere in the selection. */ markActive(mark: Mark): boolean; private triggerOnChange(); /** * Determine if a mark of a specific type exists anywhere in the selection. */ private anyMarkActive(markType); private toggleMark(view, markType, attrs?); } export declare const stateKey: PluginKey; export declare const plugin: Plugin; declare const plugins: (schema: Schema<any, any>) => Plugin[]; export default plugins;