Skip to main content

api.getState()

Description

Returns an object with the StateStore properties of RichText

Usage

api.getState(): object;

Returns

The method returns an object with the following parameters:

{     
cursorState: {},
defaultStyles: {},
document: {},
fullscreen: boolean,
history: []
layoutMode: string,
popup: any,
selection: {}
}

Example

// initialize RichText
const editor = new richtext.Richtext("#root", {
// configuration properties
});
// get the State of RichText
const state = editor.api.getState();
console.log(state);

Change log: The method was added in v2.0