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

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.

class ReplaceAroundStep extends Step {
constructor(
from: number,
to: number,
gapFrom: number,
gapTo: number,
slice: Slice,
insert: number,
structure?: boolean,
);
readonly from: number;
readonly gapFrom: number;
readonly gapTo: number;
readonly insert: number;
readonly slice: Slice;
readonly to: number;
 
apply(doc: Node): StepResult;
getMap(): StepMap;
invert(doc: Node): ReplaceAroundStep;
map(mapping: Mappable): ReplaceAroundStep | null;
toJSON(): any;
}

§Extends

§Constructors

§
new ReplaceAroundStep(from: number, to: number, gapFrom: number, gapTo: number, slice: Slice, insert: number, structure?: boolean)
[src]

Create a replace-around step with the given range and gap. insert should be the point in the slice into which the content of the gap should be moved. structure has the same meaning as it has in the ReplaceStep class.

§Properties

§
from: number
[src]

The start position of the replaced range.

§
gapFrom: number
[src]

The start of preserved range.

§
gapTo: number
[src]

The end of preserved range.

§
insert: number
[src]

The position in the slice where the preserved range should be inserted.

§
slice: Slice
[src]

The slice to insert.

§
to: number
[src]

The end position of the replaced range.

§Methods

§
apply(doc: Node): StepResult
[src]
§
getMap(): StepMap
[src]
§
map(mapping: Mappable): ReplaceAroundStep | null
[src]
§
toJSON(): any
[src]