Problem
Implement TextInput with edit(text), undo(), redo(), and getCurrentState(). A new edit after undo discards the redo history.
const editor = new TextInput();
editor.edit("First version");
editor.edit("Second version");
editor.undo(); // "First version"
editor.redo(); // "Second version"
editor.undo(); // "First version"
editor.edit("Third version");
editor.undo(); // "First version"
editor.redo(); // "Third version"