View Source Yex.Doc (y_ex v0.6.2)
Summary
Functions
Stop monitoring document updates.
Get or insert the array type.
Get or insert the map type.
Get or insert the text type.
Get or insert the xml fragment type.
Monitor document updates.
Create a new document.
Start a transaction.
Create a new document with options.
Types
@type t() :: %Yex.Doc{reference: any()}
Functions
Stop monitoring document updates.
@spec get_array(t(), String.t()) :: Yex.Array.t()
Get or insert the array type.
Get or insert the map type.
@spec get_text(t(), String.t()) :: Yex.Text.t()
Get or insert the text type.
Get or insert the xml fragment type.
Monitor document updates.
@spec new() :: t()
Create a new document.
Start a transaction.
Examples
iex> doc = Doc.new()
iex> text = Doc.get_text(doc, "text")
iex> Yex.Doc.monitor_update(doc)
iex> Doc.transaction(doc, fn ->
iex> Text.insert(text, 0, "Hello")
iex> Text.insert(text, 0, "Hello", %{"bold" => true})
iex> end)
iex> assert_receive {:update_v1, _, nil, _}
iex> refute_receive {:update_v1, _, nil, _} # only one update message
@spec with_options(Yex.Doc.Options.t()) :: t()
Create a new document with options.