mweiss/elm-rte-toolkit/1.0.1

NOTE: the latest version is 1.0.4

RichText.Model.History

This module contains the type used to store undo/redo history.

type alias History =
History

History contains the undo deque and redo stack related to undo history.

{ groupDelayMilliseconds : Int
, size : Int
}
-> History

Provides an empty History with the given config. The config values are as follows:

  • groupDelayMilliseconds is the interval which the editor will ignore adding multiple text changes onto the undo stack. This is so the history doesn't get overwhelmed by single character changes.
  • size is the number of states stored in the history
peek : History -> Maybe ( String, State )

Returns the last executed action and previous state on the undo stack.

undoList : History -> List ( String, State )

Returns the entire undo stack.

redoList : History -> List State

Returns the entire redo stack.