Back to reference

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

onDocumentStats optional(event: CustomEvent<DocumentStats>) => void
Triggered when new text information is available.
Since: v1.9.0

onPluginError optional(event: CustomEvent<Error>) => void
Triggered on fatal error with the plugin
Since: v1.9.0

onPluginTurnedOff optional(event: CustomEvent) => void
Triggered when the user turns off Grammarly.
Since: v1.9.0

onSessionStats optional(event: CustomEvent<SessionStats>) => void
Triggered when new session information is available.
Since: v1.9.0

onSuggestionCardClose optional(event: CustomEvent) => void
Triggered when a suggestion card is closed
Since: v1.8.0

onSuggestionCardOpen optional(event: CustomEvent) => void
Triggered when a suggestion card is opened
Since: v1.8.0

Last Updated: 7/29/2022, 4:38:54 PM