Writer Functions


Functions related to text writing operations. These functions interact with the configured TextWriter.

Write

FunctionDescriptionParametersReturns
INVOX.Write(text)Writes the given text at the current caret position.Stringvoid
INVOX.Write("Hello, world!");

AppendText

FunctionDescriptionParametersReturns
INVOX.AppendText(text)Appends text at the end of the editor content.Stringvoid
INVOX.AppendText("Additional text.");

PrependText

FunctionDescriptionParametersReturns
INVOX.PrependText(text)Prepends text at the beginning of the editor content.Stringvoid
INVOX.PrependText("Prepended text. ");

ClearText

FunctionDescriptionParametersReturns
INVOX.ClearText()Clears all content from the current editor.—void
INVOX.ClearText();

GetText

FunctionDescriptionParametersReturns
INVOX.GetText()Returns the full plain text from the current editor.—String
const text = INVOX.GetText();

SetSelection

FunctionDescriptionParametersReturns
INVOX.SetSelection(range)Sets the current selection range in the editor.INVOX.Rangevoid
INVOX.SetSelection(new INVOX.Range(0, 5));

SetTextWriter

FunctionDescriptionParametersReturns
INVOX.SetTextWriter(writer)Sets the TextWriter implementation to use.Objectvoid
INVOX.SetTextWriter(INVOX.TextAreaTextWriter);

SetWriterTarget

FunctionDescriptionParametersReturns
INVOX.SetWriterTarget(target)Sets the current editor element as writing target.Elementvoid
INVOX.SetWriterTarget(document.getElementById("my-textarea"));

GetWriterTarget

FunctionDescriptionParametersReturns
INVOX.GetWriterTarget()Returns the current writing target element.—Element
const target = INVOX.GetWriterTarget();