Interface that should be implemented in order to define an asynchronous command

Since 1.5.0

interface AsyncCommand<
    Model extends object,
    Real,
    CheckAsync extends boolean = false,
> {
    check(
        m: Readonly<Model>,
    ): CheckAsync extends false ? boolean : Promise<boolean>;
    run(m: Model, r: Real): Promise<void>;
    toString(): string;
}

Type Parameters

  • Model extends object
  • Real
  • CheckAsync extends boolean = false

Hierarchy (View Summary)

Methods

  • Receive the non-updated model and the real or system under test. Perform the checks post-execution - Throw in case of invalid state. Update the model accordingly

    Parameters

    • m: Model

      Model, simplified or schematic representation of real system

    • r: Real

      Sytem under test

    Returns Promise<void>

    Since 1.5.0