Interface KeyInteractionCmdBinder<C, I, A, D>

The binder API for key-based user interactions, that already knows the type of the user interaction to use and the type of command the binding will produce.

interface KeyInteractionCmdBinder {
    bind(): Binding<C, I, A, D>;
    catch(fn): KeyInteractionCmdBinder<C, I, A, D>;
    configureRules(ruleName, severity): KeyInteractionCmdBinder<C, I, A, D>;
    end(fn): KeyInteractionCmdBinder<C, I, A, D>;
    first(fn): KeyInteractionCmdBinder<C, I, A, D>;
    ifCannotExecute(fn): KeyInteractionCmdBinder<C, I, A, D>;
    ifHadEffects(fn): KeyInteractionCmdBinder<C, I, A, D>;
    ifHadNoEffect(fn): KeyInteractionCmdBinder<C, I, A, D>;
    log(...level): KeyInteractionCmdBinder<C, I, A, D>;
    name(name): KeyInteractionCmdBinder<C, I, A, D>;
    on<W>(widget, ...widgets): KeyInteractionCmdBinder<C, I, A, D>;
    onDynamic(node): KeyInteractionCmdBinder<C, I, A, D>;
    preventDefault(): KeyInteractionCmdBinder<C, I, A, D>;
    stopImmediatePropagation(): KeyInteractionCmdBinder<C, I, A, D>;
    when(fn, mode?): KeyInteractionCmdBinder<C, I, A, D>;
    with(isCode, ...keysOrCodes): KeyInteractionCmdBinder<C, I, A, D>;
}

Type Parameters

Hierarchy

Methods

  • Allows the processing of errors during the execution of the binding. Errors reported here are errors thrown in arrow functions provided to the the different routines of the binder and errors triggered by the command. A binder can have several cummulative 'catch' routines.

    Parameters

    • fn: ((ex) => void)

      The function to process the error caught by the binding during its execution

        • (ex): void
        • Parameters

          • ex: unknown

          Returns void

    Returns KeyInteractionCmdBinder<C, I, A, D>

    A clone of the current binder to chain the building configuration.

  • Specifies the initialisation of the command when the interaction starts. Each time the interaction starts, an instance of the command is created and configured by the given callback. A binder can have several cummulative 'first' routines.

    Parameters

    • fn: ((c, i, acc) => void)

      The callback method that initialises the command. This callback takes as arguments both the command and interaction data involved in the binding.

        • (c, i, acc): void
        • Parameters

          • c: C
          • i: D
          • acc: A

          Returns void

    Returns KeyInteractionCmdBinder<C, I, A, D>

    The binder to chain the building configuration.

  • Specifies what to do end when an interaction ends (after the end/endOrCancel routines) and the command has produced an effect. A binder can have several cummulative 'ifHadEffects' routines.

    Parameters

    • fn: ((c, i, acc) => void)

      The callback method to specify what to do when an interaction ends and the command produced an effect.

        • (c, i, acc): void
        • Parameters

          • c: C
          • i: D
          • acc: A

          Returns void

    Returns KeyInteractionCmdBinder<C, I, A, D>

    The binder to chain the building configuration.

  • Specifies what to do end when an interaction ends (after the end/endOrCancel routines) and the command did not produce an effect. A binder can have several cummulative 'ifHadNoEffect' routines.

    Parameters

    • fn: ((c, i, acc) => void)

      The callback method to specify what to do when an interaction ends and the command did not produce an effect.

        • (c, i, acc): void
        • Parameters

          • c: C
          • i: D
          • acc: A

          Returns void

    Returns KeyInteractionCmdBinder<C, I, A, D>

    The binder to chain the building configuration.

  • Specifies the widgets on which the binding will operate. When a widget is added to this list, this widget is binded to this binding. When widget is removed from this list, this widget is unbinded from this binding.

    Type Parameters

    • W

    Parameters

    • widget: Widget<W> | readonly Widget<W>[]

      The mandatory first widget

    • Rest ...widgets: readonly Widget<W>[]

      The list of the widgets involved in the bindings.

    Returns KeyInteractionCmdBinder<C, I, A, D>

    A clone of the current binder to chain the building configuration.

  • Specifies the conditions to fulfill to initialise, update, or execute the command while the interaction is running. A binder can have several cummulative 'when' routines.

    Parameters

    • fn: ((i, acc) => boolean)

      The predicate that checks whether the command can be initialised, updated, or executed. This predicate takes as arguments the data of the ongoing user interaction involved in the binding.

        • (i, acc): boolean
        • Parameters

          • i: D
          • acc: Readonly<A>

          Returns boolean

    • Optional mode: WhenType

    Returns KeyInteractionCmdBinder<C, I, A, D>

    A clone of the current binder to chain the building configuration.

Generated using TypeDoc