Class BindingImpl<C, I, A, D>

The base class to do bindings, i.e. bindings between user interactions and (undoable) commands.

Type Parameters

  • C extends Command

    The type of the command that will produce this binding.

  • I extends Interaction<D>

    The type of the interaction that will use this binding.

  • A

    The type of the accumulator.

  • D extends InteractionData = InteractionDataType<I>

    The interaction data type (infered from the interaction type)

Hierarchy

Implements

Constructors

  • Creates a binding.

    Type Parameters

    Parameters

    • continuousExecution: boolean

      Specifies whether the command must be executed on each step of the interaction.

    • interaction: I

      The user interaction of the binding.

    • cmdProducer: ((i?) => C)

      The type of the command that will be created. Used to instantiate the command by reflexivity. The class must be public and must have a constructor with no parameter.

        • (i?): C
        • Parameters

          • Optional i: D

          Returns C

    • widgets: readonly unknown[]

      The widgets on which the binding will operate.

    • undoHistory: UndoHistoryBase

      The undo/redo history.

    • logger: Logger

      The logger to use

    • linterRules: ReadonlyMap<RuleName, Severity>

      The linting rules to use

    • Optional name: string

      The optional name of the binding. If not provided, computed based on the interaction and command names

    • Optional accInit: A

      The initial accumulator to use during the binding execution.

    Returns BindingImpl<C, I, A, D>

Properties

_activated: boolean
_cmd: undefined | C

The current action in progress.

_interaction: I

The source interaction.

_name: undefined | string
_timeCancelled: number
_timeEnded: number
accumulator: A

The accumulator used during the binding.

accumulatorInit: undefined | A
cmdProducer: ((i?) => C)

Type declaration

    • (i?): C
    • The command class to instantiate.

      Parameters

      • Optional i: D

      Returns C

cmdsProduced: Subject<C>
continuousCmdExecution: boolean

States whether the command must be executed on each step of the interaction (and not only at the end of the interaction execution).

linterRules: ReadonlyMap<RuleName, Severity>

The linter rules specific to this binding.

logBinding: boolean

Logs (or not) binding execution information.

logCmd: boolean

Logs binding usage information, to perform data analysis on usage

logUsage: boolean

Logs (or not) usage information of the binding for usage analysis

logger: Logger
undoHistory: UndoHistoryBase

Accessors

Methods

  • Called when an error appeared during the execution of the binding. To override.

    Parameters

    • _err: unknown

      The error.

    Returns void

  • creates the command of the binding. If the attribute 'cmd' is not null, nothing will be done.

    Returns undefined | C

    The created command or undefined if an error occurred

Generated using TypeDoc