GrammarlyEditorPluginCallbacks
interface GrammarlyEditorPluginCallbacks {
onDocumentStats?: (event: CustomEvent<DocumentStats>) => void;
onPluginError?: (event: CustomEvent<Error>) => void;
onPluginTurnedOff?: (event: CustomEvent) => void;
onSessionStats?: (event: CustomEvent<SessionStats>) => void;
onSuggestionCardClose?: (event: CustomEvent) => void;
onSuggestionCardOpen?: (event: CustomEvent) => void;
}
Properties
Triggered when new text information is available. This event can be used to track features of text as it is being written.
Since: v1.9.0
document-stats is available only on the Plus plan. Learn moreopen in new window about our plans.
Triggered on fatal error with the plugin.
Since: v1.9.0
onPluginTurnedOffoptionalType: (event: CustomEvent) => void
Triggered when the user turns off Grammarly.
Since: v1.9.0
Triggered when new session information is available. This event can be used to track information about the writing session.
Since: v1.9.0
session-stats is available only on the Plus plan. Learn moreopen in new window about our plans.
onSuggestionCardCloseoptionalType: (event: CustomEvent) => void
Triggered when a suggestion card is closed.
Since: v1.8.0
onSuggestionCardOpenoptionalType: (event: CustomEvent) => void
Triggered when a suggestion card is opened.
Since: v1.8.0