MingaEditor.Renderer.TextInteractionIndex (Minga v0.1.0)

Copy Markdown View Source

Renderer-owned immutable index for direct text-pointer resolution.

Summary

Functions

Makes one already-published candidate active.

Removes exact lease metadata before releasing its immutable graph pin.

Drops current roots owned by a terminated buffer.

Publishes one complete candidate graph and pins its lease and current root.

Clears every lease, active record, graph node, and root pin for a new connection.

Drops current graph roots for windows absent from the acknowledged output.

Types

current_root()

@type current_root() :: {pid(), root_ref()}

root_ref()

@type root_ref() :: reference()

t()

@type t() :: %MingaEditor.Renderer.TextInteractionIndex{
  current_roots: %{optional(pos_integer()) => current_root()},
  last_publication_nodes: non_neg_integer(),
  table: :ets.table()
}

Functions

activate(text_interaction_index, window_id, presentation_id)

@spec activate(t(), pos_integer(), pos_integer()) :: :ok | {:error, :unknown}

Makes one already-published candidate active.

discard(index, presentation)

@spec discard(t(), MingaEditor.Renderer.TextPresentation.t()) :: t()

Removes exact lease metadata before releasing its immutable graph pin.

drop_buffer(index, buffer)

@spec drop_buffer(t(), pid()) :: t()

Drops current roots owned by a terminated buffer.

last_publication_nodes(text_interaction_index)

@spec last_publication_nodes(t()) :: non_neg_integer()

new()

@spec new() :: t()

publish(index, presentation)

@spec publish(t(), MingaEditor.Renderer.TextPresentation.t()) :: t()

Publishes one complete candidate graph and pins its lease and current root.

reader(text_interaction_index)

reset(index)

@spec reset(t()) :: t()

Clears every lease, active record, graph node, and root pin for a new connection.

retain_current_windows(index, window_ids)

@spec retain_current_windows(t(), MapSet.t(pos_integer())) :: t()

Drops current graph roots for windows absent from the acknowledged output.