prosemirror-transform 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,690 @@
1
+ import { Node, Schema, Slice, Fragment, NodeRange, NodeType, Attrs, Mark, MarkType, ContentMatch } from 'prosemirror-model';
2
+
3
+ /**
4
+ There are several things that positions can be mapped through.
5
+ Such objects conform to this interface.
6
+ */
7
+ interface Mappable {
8
+ /**
9
+ Map a position through this object. When given, `assoc` (should
10
+ be -1 or 1, defaults to 1) determines with which side the
11
+ position is associated, which determines in which direction to
12
+ move when a chunk of content is inserted at the mapped position.
13
+ */
14
+ map: (pos: number, assoc?: number) => number;
15
+ /**
16
+ Map a position, and return an object containing additional
17
+ information about the mapping. The result's `deleted` field tells
18
+ you whether the position was deleted (completely enclosed in a
19
+ replaced range) during the mapping. When content on only one side
20
+ is deleted, the position itself is only considered deleted when
21
+ `assoc` points in the direction of the deleted content.
22
+ */
23
+ mapResult: (pos: number, assoc?: number) => MapResult;
24
+ }
25
+ /**
26
+ An object representing a mapped position with extra
27
+ information.
28
+ */
29
+ declare class MapResult {
30
+ /**
31
+ The mapped version of the position.
32
+ */
33
+ readonly pos: number;
34
+ /**
35
+ Tells you whether the position was deleted, that is, whether
36
+ the step removed its surroundings from the document.
37
+ */
38
+ readonly deleted: boolean;
39
+ }
40
+ /**
41
+ A map describing the deletions and insertions made by a step, which
42
+ can be used to find the correspondence between positions in the
43
+ pre-step version of a document and the same position in the
44
+ post-step version.
45
+ */
46
+ declare class StepMap implements Mappable {
47
+ /**
48
+ Create a position map. The modifications to the document are
49
+ represented as an array of numbers, in which each group of three
50
+ represents a modified chunk as `[start, oldSize, newSize]`.
51
+ */
52
+ constructor(
53
+ /**
54
+ @internal
55
+ */
56
+ ranges: readonly number[],
57
+ /**
58
+ @internal
59
+ */
60
+ inverted?: boolean);
61
+ mapResult(pos: number, assoc?: number): MapResult;
62
+ map(pos: number, assoc?: number): number;
63
+ /**
64
+ Calls the given function on each of the changed ranges included in
65
+ this map.
66
+ */
67
+ forEach(f: (oldStart: number, oldEnd: number, newStart: number, newEnd: number) => void): void;
68
+ /**
69
+ Create an inverted version of this map. The result can be used to
70
+ map positions in the post-step document to the pre-step document.
71
+ */
72
+ invert(): StepMap;
73
+ /**
74
+ Create a map that moves all positions by offset `n` (which may be
75
+ negative). This can be useful when applying steps meant for a
76
+ sub-document to a larger document, or vice-versa.
77
+ */
78
+ static offset(n: number): StepMap;
79
+ /**
80
+ A StepMap that contains no changed ranges.
81
+ */
82
+ static empty: StepMap;
83
+ }
84
+ /**
85
+ A mapping represents a pipeline of zero or more [step
86
+ maps](https://prosemirror.net/docs/ref/#transform.StepMap). It has special provisions for losslessly
87
+ handling mapping positions through a series of steps in which some
88
+ steps are inverted versions of earlier steps. (This comes up when
89
+ ‘[rebasing](/docs/guide/#transform.rebasing)’ steps for
90
+ collaboration or history management.)
91
+ */
92
+ declare class Mapping implements Mappable {
93
+ /**
94
+ The step maps in this mapping.
95
+ */
96
+ readonly maps: StepMap[];
97
+ /**
98
+ The starting position in the `maps` array, used when `map` or
99
+ `mapResult` is called.
100
+ */
101
+ from: number;
102
+ /**
103
+ The end position in the `maps` array.
104
+ */
105
+ to: number;
106
+ /**
107
+ Create a new mapping with the given position maps.
108
+ */
109
+ constructor(
110
+ /**
111
+ The step maps in this mapping.
112
+ */
113
+ maps?: StepMap[],
114
+ /**
115
+ @internal
116
+ */
117
+ mirror?: number[] | undefined,
118
+ /**
119
+ The starting position in the `maps` array, used when `map` or
120
+ `mapResult` is called.
121
+ */
122
+ from?: number,
123
+ /**
124
+ The end position in the `maps` array.
125
+ */
126
+ to?: number);
127
+ /**
128
+ Create a mapping that maps only through a part of this one.
129
+ */
130
+ slice(from?: number, to?: number): Mapping;
131
+ /**
132
+ Add a step map to the end of this mapping. If `mirrors` is
133
+ given, it should be the index of the step map that is the mirror
134
+ image of this one.
135
+ */
136
+ appendMap(map: StepMap, mirrors?: number): void;
137
+ /**
138
+ Add all the step maps in a given mapping to this one (preserving
139
+ mirroring information).
140
+ */
141
+ appendMapping(mapping: Mapping): void;
142
+ /**
143
+ Finds the offset of the step map that mirrors the map at the
144
+ given offset, in this mapping (as per the second argument to
145
+ `appendMap`).
146
+ */
147
+ getMirror(n: number): number | undefined;
148
+ /**
149
+ Append the inverse of the given mapping to this one.
150
+ */
151
+ appendMappingInverted(mapping: Mapping): void;
152
+ /**
153
+ Create an inverted version of this mapping.
154
+ */
155
+ invert(): Mapping;
156
+ /**
157
+ Map a position through this mapping.
158
+ */
159
+ map(pos: number, assoc?: number): number;
160
+ /**
161
+ Map a position through this mapping, returning a mapping
162
+ result.
163
+ */
164
+ mapResult(pos: number, assoc?: number): MapResult;
165
+ }
166
+
167
+ /**
168
+ A step object represents an atomic change. It generally applies
169
+ only to the document it was created for, since the positions
170
+ stored in it will only make sense for that document.
171
+
172
+ New steps are defined by creating classes that extend `Step`,
173
+ overriding the `apply`, `invert`, `map`, `getMap` and `fromJSON`
174
+ methods, and registering your class with a unique
175
+ JSON-serialization identifier using
176
+ [`Step.jsonID`](https://prosemirror.net/docs/ref/#transform.Step^jsonID).
177
+ */
178
+ declare abstract class Step {
179
+ /**
180
+ Applies this step to the given document, returning a result
181
+ object that either indicates failure, if the step can not be
182
+ applied to this document, or indicates success by containing a
183
+ transformed document.
184
+ */
185
+ abstract apply(doc: Node): StepResult;
186
+ /**
187
+ Get the step map that represents the changes made by this step,
188
+ and which can be used to transform between positions in the old
189
+ and the new document.
190
+ */
191
+ getMap(): StepMap;
192
+ /**
193
+ Create an inverted version of this step. Needs the document as it
194
+ was before the step as argument.
195
+ */
196
+ abstract invert(doc: Node): Step;
197
+ /**
198
+ Map this step through a mappable thing, returning either a
199
+ version of that step with its positions adjusted, or `null` if
200
+ the step was entirely deleted by the mapping.
201
+ */
202
+ abstract map(mapping: Mappable): Step | null;
203
+ /**
204
+ Try to merge this step with another one, to be applied directly
205
+ after it. Returns the merged step when possible, null if the
206
+ steps can't be merged.
207
+ */
208
+ merge(other: Step): Step | null;
209
+ /**
210
+ Create a JSON-serializeable representation of this step. When
211
+ defining this for a custom subclass, make sure the result object
212
+ includes the step type's [JSON id](https://prosemirror.net/docs/ref/#transform.Step^jsonID) under
213
+ the `stepType` property.
214
+ */
215
+ abstract toJSON(): any;
216
+ /**
217
+ Deserialize a step from its JSON representation. Will call
218
+ through to the step class' own implementation of this method.
219
+ */
220
+ static fromJSON(schema: Schema, json: any): Step;
221
+ /**
222
+ To be able to serialize steps to JSON, each step needs a string
223
+ ID to attach to its JSON representation. Use this method to
224
+ register an ID for your step classes. Try to pick something
225
+ that's unlikely to clash with steps from other modules.
226
+ */
227
+ static jsonID(id: string, stepClass: {
228
+ fromJSON(schema: Schema, json: any): Step;
229
+ }): {
230
+ fromJSON(schema: Schema, json: any): Step;
231
+ };
232
+ }
233
+ /**
234
+ The result of [applying](https://prosemirror.net/docs/ref/#transform.Step.apply) a step. Contains either a
235
+ new document or a failure value.
236
+ */
237
+ declare class StepResult {
238
+ /**
239
+ The transformed document, if successful.
240
+ */
241
+ readonly doc: Node | null;
242
+ /**
243
+ The failure message, if unsuccessful.
244
+ */
245
+ readonly failed: string | null;
246
+ /**
247
+ Create a successful step result.
248
+ */
249
+ static ok(doc: Node): StepResult;
250
+ /**
251
+ Create a failed step result.
252
+ */
253
+ static fail(message: string): StepResult;
254
+ /**
255
+ Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given
256
+ arguments. Create a successful result if it succeeds, and a
257
+ failed one if it throws a `ReplaceError`.
258
+ */
259
+ static fromReplace(doc: Node, from: number, to: number, slice: Slice): StepResult;
260
+ }
261
+
262
+ /**
263
+ Abstraction to build up and track an array of
264
+ [steps](https://prosemirror.net/docs/ref/#transform.Step) representing a document transformation.
265
+
266
+ Most transforming methods return the `Transform` object itself, so
267
+ that they can be chained.
268
+ */
269
+ declare class Transform {
270
+ /**
271
+ The current document (the result of applying the steps in the
272
+ transform).
273
+ */
274
+ doc: Node;
275
+ /**
276
+ The steps in this transform.
277
+ */
278
+ readonly steps: Step[];
279
+ /**
280
+ The documents before each of the steps.
281
+ */
282
+ readonly docs: Node[];
283
+ /**
284
+ A mapping with the maps for each of the steps in this transform.
285
+ */
286
+ readonly mapping: Mapping;
287
+ /**
288
+ Create a transform that starts with the given document.
289
+ */
290
+ constructor(
291
+ /**
292
+ The current document (the result of applying the steps in the
293
+ transform).
294
+ */
295
+ doc: Node);
296
+ /**
297
+ The starting document.
298
+ */
299
+ get before(): Node;
300
+ /**
301
+ Apply a new step in this transform, saving the result. Throws an
302
+ error when the step fails.
303
+ */
304
+ step(step: Step): this;
305
+ /**
306
+ Try to apply a step in this transformation, ignoring it if it
307
+ fails. Returns the step result.
308
+ */
309
+ maybeStep(step: Step): StepResult;
310
+ /**
311
+ True when the document has been changed (when there are any
312
+ steps).
313
+ */
314
+ get docChanged(): boolean;
315
+ /**
316
+ Replace the part of the document between `from` and `to` with the
317
+ given `slice`.
318
+ */
319
+ replace(from: number, to?: number, slice?: Slice): this;
320
+ /**
321
+ Replace the given range with the given content, which may be a
322
+ fragment, node, or array of nodes.
323
+ */
324
+ replaceWith(from: number, to: number, content: Fragment | Node | readonly Node[]): this;
325
+ /**
326
+ Delete the content between the given positions.
327
+ */
328
+ delete(from: number, to: number): this;
329
+ /**
330
+ Insert the given content at the given position.
331
+ */
332
+ insert(pos: number, content: Fragment | Node | readonly Node[]): this;
333
+ /**
334
+ Replace a range of the document with a given slice, using
335
+ `from`, `to`, and the slice's
336
+ [`openStart`](https://prosemirror.net/docs/ref/#model.Slice.openStart) property as hints, rather
337
+ than fixed start and end points. This method may grow the
338
+ replaced area or close open nodes in the slice in order to get a
339
+ fit that is more in line with WYSIWYG expectations, by dropping
340
+ fully covered parent nodes of the replaced region when they are
341
+ marked [non-defining as
342
+ context](https://prosemirror.net/docs/ref/#model.NodeSpec.definingAsContext), or including an
343
+ open parent node from the slice that _is_ marked as [defining
344
+ its content](https://prosemirror.net/docs/ref/#model.NodeSpec.definingForContent).
345
+
346
+ This is the method, for example, to handle paste. The similar
347
+ [`replace`](https://prosemirror.net/docs/ref/#transform.Transform.replace) method is a more
348
+ primitive tool which will _not_ move the start and end of its given
349
+ range, and is useful in situations where you need more precise
350
+ control over what happens.
351
+ */
352
+ replaceRange(from: number, to: number, slice: Slice): this;
353
+ /**
354
+ Replace the given range with a node, but use `from` and `to` as
355
+ hints, rather than precise positions. When from and to are the same
356
+ and are at the start or end of a parent node in which the given
357
+ node doesn't fit, this method may _move_ them out towards a parent
358
+ that does allow the given node to be placed. When the given range
359
+ completely covers a parent node, this method may completely replace
360
+ that parent node.
361
+ */
362
+ replaceRangeWith(from: number, to: number, node: Node): this;
363
+ /**
364
+ Delete the given range, expanding it to cover fully covered
365
+ parent nodes until a valid replace is found.
366
+ */
367
+ deleteRange(from: number, to: number): this;
368
+ /**
369
+ Split the content in the given range off from its parent, if there
370
+ is sibling content before or after it, and move it up the tree to
371
+ the depth specified by `target`. You'll probably want to use
372
+ [`liftTarget`](https://prosemirror.net/docs/ref/#transform.liftTarget) to compute `target`, to make
373
+ sure the lift is valid.
374
+ */
375
+ lift(range: NodeRange, target: number): this;
376
+ /**
377
+ Join the blocks around the given position. If depth is 2, their
378
+ last and first siblings are also joined, and so on.
379
+ */
380
+ join(pos: number, depth?: number): this;
381
+ /**
382
+ Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.
383
+ The wrappers are assumed to be valid in this position, and should
384
+ probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).
385
+ */
386
+ wrap(range: NodeRange, wrappers: readonly {
387
+ type: NodeType;
388
+ attrs?: Attrs | null;
389
+ }[]): this;
390
+ /**
391
+ Set the type of all textblocks (partly) between `from` and `to` to
392
+ the given node type with the given attributes.
393
+ */
394
+ setBlockType(from: number, to: number | undefined, type: NodeType, attrs?: Attrs | null): this;
395
+ /**
396
+ Change the type, attributes, and/or marks of the node at `pos`.
397
+ When `type` isn't given, the existing node type is preserved,
398
+ */
399
+ setNodeMarkup(pos: number, type?: NodeType | null, attrs?: Attrs | null, marks?: readonly Mark[]): this;
400
+ /**
401
+ Split the node at the given position, and optionally, if `depth` is
402
+ greater than one, any number of nodes above that. By default, the
403
+ parts split off will inherit the node type of the original node.
404
+ This can be changed by passing an array of types and attributes to
405
+ use after the split.
406
+ */
407
+ split(pos: number, depth?: number, typesAfter?: (null | {
408
+ type: NodeType;
409
+ attrs?: Attrs | null;
410
+ })[]): this;
411
+ /**
412
+ Add the given mark to the inline content between `from` and `to`.
413
+ */
414
+ addMark(from: number, to: number, mark: Mark): this;
415
+ /**
416
+ Remove marks from inline nodes between `from` and `to`. When
417
+ `mark` is a single mark, remove precisely that mark. When it is
418
+ a mark type, remove all marks of that type. When it is null,
419
+ remove all marks of any type.
420
+ */
421
+ removeMark(from: number, to: number, mark?: Mark | MarkType | null): this;
422
+ /**
423
+ Removes all marks and nodes from the content of the node at
424
+ `pos` that don't match the given new parent node type. Accepts
425
+ an optional starting [content match](https://prosemirror.net/docs/ref/#model.ContentMatch) as
426
+ third argument.
427
+ */
428
+ clearIncompatible(pos: number, parentType: NodeType, match?: ContentMatch): this;
429
+ }
430
+
431
+ /**
432
+ Try to find a target depth to which the content in the given range
433
+ can be lifted. Will not go across
434
+ [isolating](https://prosemirror.net/docs/ref/#model.NodeSpec.isolating) parent nodes.
435
+ */
436
+ declare function liftTarget(range: NodeRange): number | null;
437
+ /**
438
+ Try to find a valid way to wrap the content in the given range in a
439
+ node of the given type. May introduce extra nodes around and inside
440
+ the wrapper node, if necessary. Returns null if no valid wrapping
441
+ could be found. When `innerRange` is given, that range's content is
442
+ used as the content to fit into the wrapping, instead of the
443
+ content of `range`.
444
+ */
445
+ declare function findWrapping(range: NodeRange, nodeType: NodeType, attrs?: Attrs | null, innerRange?: NodeRange): {
446
+ type: NodeType;
447
+ attrs: Attrs | null;
448
+ }[] | null;
449
+ /**
450
+ Check whether splitting at the given position is allowed.
451
+ */
452
+ declare function canSplit(doc: Node, pos: number, depth?: number, typesAfter?: (null | {
453
+ type: NodeType;
454
+ attrs?: Attrs | null;
455
+ })[]): boolean;
456
+ /**
457
+ Test whether the blocks before and after a given position can be
458
+ joined.
459
+ */
460
+ declare function canJoin(doc: Node, pos: number): boolean;
461
+ /**
462
+ Find an ancestor of the given position that can be joined to the
463
+ block before (or after if `dir` is positive). Returns the joinable
464
+ point, if any.
465
+ */
466
+ declare function joinPoint(doc: Node, pos: number, dir?: number): number | undefined;
467
+ /**
468
+ Try to find a point where a node of the given type can be inserted
469
+ near `pos`, by searching up the node hierarchy when `pos` itself
470
+ isn't a valid place but is at the start or end of a node. Return
471
+ null if no position was found.
472
+ */
473
+ declare function insertPoint(doc: Node, pos: number, nodeType: NodeType): number | null;
474
+ /**
475
+ Finds a position at or around the given position where the given
476
+ slice can be inserted. Will look at parent nodes' nearest boundary
477
+ and try there, even if the original position wasn't directly at the
478
+ start or end of that node. Returns null when no position was found.
479
+ */
480
+ declare function dropPoint(doc: Node, pos: number, slice: Slice): number | null;
481
+
482
+ /**
483
+ Add a mark to all inline content between two positions.
484
+ */
485
+ declare class AddMarkStep extends Step {
486
+ /**
487
+ The start of the marked range.
488
+ */
489
+ readonly from: number;
490
+ /**
491
+ The end of the marked range.
492
+ */
493
+ readonly to: number;
494
+ /**
495
+ The mark to add.
496
+ */
497
+ readonly mark: Mark;
498
+ /**
499
+ Create a mark step.
500
+ */
501
+ constructor(
502
+ /**
503
+ The start of the marked range.
504
+ */
505
+ from: number,
506
+ /**
507
+ The end of the marked range.
508
+ */
509
+ to: number,
510
+ /**
511
+ The mark to add.
512
+ */
513
+ mark: Mark);
514
+ apply(doc: Node): StepResult;
515
+ invert(): Step;
516
+ map(mapping: Mappable): Step | null;
517
+ merge(other: Step): Step | null;
518
+ toJSON(): any;
519
+ }
520
+ /**
521
+ Remove a mark from all inline content between two positions.
522
+ */
523
+ declare class RemoveMarkStep extends Step {
524
+ /**
525
+ The start of the unmarked range.
526
+ */
527
+ readonly from: number;
528
+ /**
529
+ The end of the unmarked range.
530
+ */
531
+ readonly to: number;
532
+ /**
533
+ The mark to remove.
534
+ */
535
+ readonly mark: Mark;
536
+ /**
537
+ Create a mark-removing step.
538
+ */
539
+ constructor(
540
+ /**
541
+ The start of the unmarked range.
542
+ */
543
+ from: number,
544
+ /**
545
+ The end of the unmarked range.
546
+ */
547
+ to: number,
548
+ /**
549
+ The mark to remove.
550
+ */
551
+ mark: Mark);
552
+ apply(doc: Node): StepResult;
553
+ invert(): Step;
554
+ map(mapping: Mappable): Step | null;
555
+ merge(other: Step): Step | null;
556
+ toJSON(): any;
557
+ }
558
+
559
+ /**
560
+ Replace a part of the document with a slice of new content.
561
+ */
562
+ declare class ReplaceStep extends Step {
563
+ /**
564
+ The start position of the replaced range.
565
+ */
566
+ readonly from: number;
567
+ /**
568
+ The end position of the replaced range.
569
+ */
570
+ readonly to: number;
571
+ /**
572
+ The slice to insert.
573
+ */
574
+ readonly slice: Slice;
575
+ /**
576
+ The given `slice` should fit the 'gap' between `from` and
577
+ `to`—the depths must line up, and the surrounding nodes must be
578
+ able to be joined with the open sides of the slice. When
579
+ `structure` is true, the step will fail if the content between
580
+ from and to is not just a sequence of closing and then opening
581
+ tokens (this is to guard against rebased replace steps
582
+ overwriting something they weren't supposed to).
583
+ */
584
+ constructor(
585
+ /**
586
+ The start position of the replaced range.
587
+ */
588
+ from: number,
589
+ /**
590
+ The end position of the replaced range.
591
+ */
592
+ to: number,
593
+ /**
594
+ The slice to insert.
595
+ */
596
+ slice: Slice,
597
+ /**
598
+ @internal
599
+ */
600
+ structure?: boolean);
601
+ apply(doc: Node): StepResult;
602
+ getMap(): StepMap;
603
+ invert(doc: Node): ReplaceStep;
604
+ map(mapping: Mappable): ReplaceStep | null;
605
+ merge(other: Step): ReplaceStep | null;
606
+ toJSON(): any;
607
+ }
608
+ /**
609
+ Replace a part of the document with a slice of content, but
610
+ preserve a range of the replaced content by moving it into the
611
+ slice.
612
+ */
613
+ declare class ReplaceAroundStep extends Step {
614
+ /**
615
+ The start position of the replaced range.
616
+ */
617
+ readonly from: number;
618
+ /**
619
+ The end position of the replaced range.
620
+ */
621
+ readonly to: number;
622
+ /**
623
+ The start of preserved range.
624
+ */
625
+ readonly gapFrom: number;
626
+ /**
627
+ The end of preserved range.
628
+ */
629
+ readonly gapTo: number;
630
+ /**
631
+ The slice to insert.
632
+ */
633
+ readonly slice: Slice;
634
+ /**
635
+ The position in the slice where the preserved range should be
636
+ inserted.
637
+ */
638
+ readonly insert: number;
639
+ /**
640
+ Create a replace-around step with the given range and gap.
641
+ `insert` should be the point in the slice into which the content
642
+ of the gap should be moved. `structure` has the same meaning as
643
+ it has in the [`ReplaceStep`](https://prosemirror.net/docs/ref/#transform.ReplaceStep) class.
644
+ */
645
+ constructor(
646
+ /**
647
+ The start position of the replaced range.
648
+ */
649
+ from: number,
650
+ /**
651
+ The end position of the replaced range.
652
+ */
653
+ to: number,
654
+ /**
655
+ The start of preserved range.
656
+ */
657
+ gapFrom: number,
658
+ /**
659
+ The end of preserved range.
660
+ */
661
+ gapTo: number,
662
+ /**
663
+ The slice to insert.
664
+ */
665
+ slice: Slice,
666
+ /**
667
+ The position in the slice where the preserved range should be
668
+ inserted.
669
+ */
670
+ insert: number,
671
+ /**
672
+ @internal
673
+ */
674
+ structure?: boolean);
675
+ apply(doc: Node): StepResult;
676
+ getMap(): StepMap;
677
+ invert(doc: Node): ReplaceAroundStep;
678
+ map(mapping: Mappable): ReplaceAroundStep | null;
679
+ toJSON(): any;
680
+ }
681
+
682
+ /**
683
+ ‘Fit’ a slice into a given position in the document, producing a
684
+ [step](https://prosemirror.net/docs/ref/#transform.Step) that inserts it. Will return null if
685
+ there's no meaningful way to insert the slice here, or inserting it
686
+ would be a no-op (an empty slice over an empty range).
687
+ */
688
+ declare function replaceStep(doc: Node, from: number, to?: number, slice?: Slice): Step | null;
689
+
690
+ export { AddMarkStep, MapResult, Mappable, Mapping, RemoveMarkStep, ReplaceAroundStep, ReplaceStep, Step, StepMap, StepResult, Transform, canJoin, canSplit, dropPoint, findWrapping, insertPoint, joinPoint, liftTarget, replaceStep };