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

StepResult

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

class StepResult {
readonly doc: Node | null;
readonly failed: string | null;
 
static fail(message: string): StepResult;
static fromReplace(
doc: Node,
from: number,
to: number,
slice: Slice,
): StepResult;
static ok(doc: Node): StepResult;
}

§Properties

§
doc: Node | null
[src]

The transformed document, if successful.

§
failed: string | null
[src]

The failure message, if unsuccessful.

§Static Methods

§
fail(message: string): StepResult
[src]

Create a failed step result.

§
fromReplace(doc: Node, from: number, to: number, slice: Slice): StepResult
[src]

Call Node.replace with the given arguments. Create a successful result if it succeeds, and a failed one if it throws a ReplaceError.

§

Create a successful step result.