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

Remarks

Since 1.5.0

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

Type Parameters

  • Model extends object

  • Real

  • CheckAsync extends boolean = false

Hierarchy

  • ICommand<Model, Real, Promise<void>, CheckAsync>
    • AsyncCommand

Methods

  • Check if the model is in the right state to apply the command

    WARNING: does not change the model

    Parameters

    • m: Readonly<Model>

      Model, simplified or schematic representation of real system

    Returns CheckAsync extends false
        ? boolean
        : Promise<boolean>

    Remarks

    Since 1.5.0

  • 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>

    Remarks

    Since 1.5.0

Generated using TypeDoc