Interface CmdUpdateBinder<C>

The binder API that already knows the type of UI command the bindings will produce. Routines related to interactions that can be updated are provided ('then').

interface CmdUpdateBinder {
    catch(fn): CmdUpdateBinder<C>;
    configureRules(ruleName, severity): CmdUpdateBinder<C>;
    continuousExecution(): CmdUpdateBinder<C>;
    end(fn): CmdUpdateBinder<C>;
    first(fn): CmdUpdateBinder<C>;
    log(...level): CmdUpdateBinder<C>;
    name(name): CmdUpdateBinder<C>;
    on<W>(widget, ...widgets): CmdUpdateBinder<C>;
    onDynamic(node): CmdUpdateBinder<C>;
    preventDefault(): CmdUpdateBinder<C>;
    stopImmediatePropagation(): CmdUpdateBinder<C>;
    then(fn): CmdUpdateBinder<C>;
    throttle(timeout): CmdUpdateBinder<C>;
    usingInteraction<I, A, D>(fn): InteractionCmdUpdateBinder<C, I, A, D>;
    when(fn, mode?): CmdUpdateBinder<C>;
}

Type Parameters

  • C extends Command

    The type of the produced UI commands

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

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

  • Permits to update the command on each interaction update. A binder can have several cummulative 'then' routines. This routine is called only if 'when' returns true (ie only if the condition for producing the command is respected). See 'ifCannotExecute' for a 'then' when this condition is not respected.

    Parameters

    • fn: ((c) => void)

      The callback method that updates the command. This callback takes as arguments the command to update.

        • (c): void
        • Parameters

          • c: C

          Returns void

    Returns CmdUpdateBinder<C>

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

  • Backpressure operation. Instead of emitting all the events, successive events of the same type are factorized modulo a timeout. The timeout is used to send at max one event of the same type in a given duration (the timeout). For example with three mouse moves and a time out of 10ms. The first move is received and processed. The timer starts. A second mouse moves is received at T+5ms. It is for the moment not processed. A third mouse move is received at T+8ms. The second move is finally ignored and this third one not processed yet. At T+10s the third event is finally processed. Based on our own experiments, the given timeout value should be greater than 10ms to throttle some UI events.

    Parameters

    • timeout: number

      The timeout used by the throttle operation. In ms.

    Returns CmdUpdateBinder<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 CmdUpdateBinder<C>

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

Generated using TypeDoc