GrammarlyEditorPluginCallbacks
Callback functions for custom eventsopen in new window emitted by the Grammarly Text Editor Plugin.
interface GrammarlyEditorPluginCallbacks {
onDocumentStats?: (event: CustomEvent<DocumentStats>) => void;
onPluginError?: (event: CustomEvent<Error>) => void;
onPluginTurnedOff?: (event: CustomEvent) => void;
onSessionStats?: (event: CustomEvent<SessionStats>) => void;
onSuggestionCardAction?: (event: CustomEvent<{
action: /** Suggestion was accepted by the user. */ "accept" | /** Suggestion was dismissed by the user. */ "dismiss" | /** Suggestion card was closed by the user using close button. (excludes when closed due to click-outside) */ "close";
}>) => 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
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.
Triggered when a suggestion card is acted upon by the user (accept, dismiss, or close).
Since: v2.3.14
Triggered when a suggestion card is closed.
Since: v1.8.0
Triggered when a suggestion card is opened.
Since: v1.8.0