![]()
Provides a fluent API for adding, reading, and managing persisted history entries.
public interface IHistory
Adds an entry to history.
PromptPlusLibrary.IHistory AddHistory(string value, System.Nullable<System.TimeSpan> timeout=null);
value System.String
The value to store in history.
timeout System.Nullable<System.TimeSpan>
Optional lifetime for the entry. After the timeout expires, the entry may be removed
depending on the implementation. If null, no expiration is applied.
IHistory
The current IHistory instance for fluent chaining.
Reads all history entries and deserializes them to the specified type.
System.Collections.Generic.IList<T> ReadHistory<T>();
T
The type used to deserialize history entries.
System.Collections.Generic.IList<T>
A list of deserialized history entries.
Removes persisted history, such as deleting the backing store or clearing all entries.
void Remove();
Persists in-memory history entries to durable storage.
void Save();