ProsemirrorEx.Transform.Mappable protocol (prosemirror_ex v0.3.0)

Copy Markdown View Source

Protocol for things that positions can be mapped through.

Ports the Mappable interface from prosemirror-transform/src/map.ts.

Summary

Types

t()

All the types that implement this protocol.

Functions

Map a position through this object. assoc determines with which side the position is associated (-1 or 1, defaults to 1), which determines in which direction to move when a chunk of content is inserted at the mapped position.

Map a position, and return a MapResult containing additional information about the mapping.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

map(mappable, pos, assoc)

@spec map(t(), non_neg_integer(), integer()) :: non_neg_integer()

Map a position through this object. assoc determines with which side the position is associated (-1 or 1, defaults to 1), which determines in which direction to move when a chunk of content is inserted at the mapped position.

map_result(mappable, pos, assoc)

Map a position, and return a MapResult containing additional information about the mapping.