Interface InteractionCmdBinder<C, I, A, D>

The binder API that already knows the type of UI command and the user interaction to use.

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

Type Parameters

Hierarchy

Implemented by

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 InteractionCmdBinder<C, I, A, D>

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

  • Specifies what to do end when an interaction ends (when the last event of the interaction has occurred, but just after the interaction is reinitialised and the command finally executed and discarded / saved). A binder can have several cummulative 'end' routines.

    Parameters

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

      The callback method to specify what to do when an interaction ends.

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

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

          Returns void

    Returns InteractionCmdBinder<C, I, A, D>

    The 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 InteractionCmdBinder<C, I, A, D>

    The binder to chain the building configuration.

  • Specifies what to do end when an interaction ends and the command could not be executed. A binder can have several cummulative 'ifCannotExecute' routines.

    Parameters

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

      The callback method to specify what to do when an interaction ends and the command could not be executed.

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

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

          Returns void

    Returns InteractionCmdBinder<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 InteractionCmdBinder<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 InteractionCmdBinder<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 InteractionCmdBinder<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.

        • (i, acc): boolean
        • Parameters

          • i: D
          • acc: Readonly<A>

          Returns boolean

    • Optional mode: WhenType

      The execution mode of the 'when' predicate. If not defined, the non-strict mode will be used.

    Returns InteractionCmdBinder<C, I, A, D>

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

Generated using TypeDoc