Interface CmdBinderBuilder<C>

The binding builder API that already knows the type of UI command the bindings will produce

interface CmdBinderBuilder {
    catch(fn): CmdBinderBuilder<C>;
    configureRules(ruleName, severity): CmdBinderBuilder<C>;
    end(fn): CmdBinderBuilder<C>;
    first(fn): CmdBinderBuilder<C>;
    log(...level): CmdBinderBuilder<C>;
    name(name): CmdBinderBuilder<C>;
    on<W>(widget, ...widgets): CmdBinderBuilder<C>;
    onDynamic(node): CmdBinderBuilder<C>;
    preventDefault(): CmdBinderBuilder<C>;
    stopImmediatePropagation(): CmdBinderBuilder<C>;
    when(fn, mode?): CmdBinderBuilder<C>;
}

Type Parameters

  • C extends Command

    The type of the produced UI Commands

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 CmdBinderBuilder<C>

    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) => void)

      The callback method that initialises the command. This callback takes as arguments the command to configure.

        • (c): void
        • Parameters

          • c: C

          Returns void

    Returns CmdBinderBuilder<C>

    A clone of the current 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 CmdBinderBuilder<C>

    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: (() => boolean)

      The predicate that checks whether the command can be initialised, updated, or executed.

        • (): boolean
        • Returns boolean

    • Optional mode: WhenType

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

    Returns CmdBinderBuilder<C>

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

Generated using TypeDoc