Raxol.Terminal.Clipboard.History (Raxol v0.5.0)

View Source

Manages clipboard history for the terminal.

Summary

Functions

Adds content to the clipboard history.

Clears the clipboard history.

Gets content from the clipboard history by index.

Gets all entries from the clipboard history with the specified format.

Creates a new clipboard history with the specified size limit.

Types

t()

@type t() :: %Raxol.Terminal.Clipboard.History{
  entries: [{String.t(), String.t()}],
  max_size: non_neg_integer()
}

Functions

add(history, content, format)

@spec add(t(), String.t(), String.t()) :: {:ok, t()}

Adds content to the clipboard history.

clear(history)

@spec clear(t()) :: {:ok, t()}

Clears the clipboard history.

get(history, index, format)

@spec get(t(), non_neg_integer(), String.t()) ::
  {:ok, String.t()} | {:error, :not_found}

Gets content from the clipboard history by index.

get_all(history, format, limit \\ :infinity)

@spec get_all(t(), String.t(), non_neg_integer() | :infinity) ::
  {:ok, [String.t()], t()}

Gets all entries from the clipboard history with the specified format.

new(max_size)

@spec new(non_neg_integer()) :: t()

Creates a new clipboard history with the specified size limit.