Skip to main content

addComment

Create a comment annotation anchored to the text range from a TextSelectedEvent.

askAi

Send a text-generation prompt to any AI model via Velt’s proxy. The provider is resolved automatically from the model name prefix (gpt-*/o1-*/o3-*/o4-* → OpenAI, claude-* → Anthropic, gemini-* → Gemini).

enableRewriter

on

Subscribe to Rewriter events. Supports 'textSelected' to receive a TextSelectedEvent whenever a user selects text in a Rewriter-enabled region.

replaceText

Replace the DOM text identified by a TextSelectedEvent with new text.

enableDefaultUI

Show or hide the built-in Velt rewriter toolbar. Calling disableDefaultUI() suppresses the toolbar on text selection while keeping all rewriter events active, so you can render a fully custom UI. Call enableDefaultUI() to restore the default toolbar.
  • Returns: void