Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

§Classes

AddMarkStep

Add a mark to all inline content between two positions.

AddNodeMarkStep

Add a mark to a specific node.

AttrStep

Update an attribute in a specific node.

DocAttrStep

Update an attribute in the doc node.

Mapping

A mapping represents a pipeline of zero or more step maps. It has special provisions for losslessly handling mapping positions through a series of steps in which some steps are inverted versions of earlier steps. (This comes up when ‘rebasing’ steps for collaboration or history management.)

MapResult

An object representing a mapped position with extra information.

RemoveMarkStep

Remove a mark from all inline content between two positions.

RemoveNodeMarkStep

Remove a mark from a specific node.

ReplaceAroundStep

Replace a part of the document with a slice of content, but preserve a range of the replaced content by moving it into the slice.

ReplaceStep

Replace a part of the document with a slice of new content.

Step abstract

A step object represents an atomic change. It generally applies only to the document it was created for, since the positions stored in it will only make sense for that document.

StepMap

A map describing the deletions and insertions made by a step, which can be used to find the correspondence between positions in the pre-step version of a document and the same position in the post-step version.

StepResult

The result of applying a step. Contains either a new document or a failure value.

Transform

Abstraction to build up and track an array of steps representing a document transformation.

§Functions

canJoin

Test whether the blocks before and after a given position can be joined.

canSplit

Check whether splitting at the given position is allowed.

dropPoint

Finds a position at or around the given position where the given slice can be inserted. Will look at parent nodes' nearest boundary and try there, even if the original position wasn't directly at the start or end of that node. Returns null when no position was found.

findWrapping

Try to find a valid way to wrap the content in the given range in a node of the given type. May introduce extra nodes around and inside the wrapper node, if necessary. Returns null if no valid wrapping could be found. When innerRange is given, that range's content is used as the content to fit into the wrapping, instead of the content of range.

insertPoint

Try to find a point where a node of the given type can be inserted near pos, by searching up the node hierarchy when pos itself isn't a valid place but is at the start or end of a node. Return null if no position was found.

joinPoint

Find an ancestor of the given position that can be joined to the block before (or after if dir is positive). Returns the joinable point, if any.

liftTarget

Try to find a target depth to which the content in the given range can be lifted. Will not go across isolating parent nodes.

replaceStep

‘Fit’ a slice into a given position in the document, producing a step that inserts it. Will return null if there's no meaningful way to insert the slice here, or inserting it would be a no-op (an empty slice over an empty range).

§Interfaces

Mappable

There are several things that positions can be mapped through. Such objects conform to this interface.