Interface KeyInteractionUpdateBinder<I, A, D>

The binder API for key-based user interactions, that already knows the type of the user interaction to use (for user interactions that can be updated).

interface KeyInteractionUpdateBinder {
    cancel(fn): KeyInteractionUpdateBinder<I, A, D>;
    catch(fn): KeyInteractionUpdateBinder<I, A, D>;
    configureRules(ruleName, severity): KeyInteractionUpdateBinder<I, A, D>;
    continuousExecution(): KeyInteractionUpdateBinder<I, A, D>;
    end(fn): InteractionUpdateBinderBuilder<I, A, D>;
    endOrCancel(fn): KeyInteractionUpdateBinder<I, A, D>;
    log(...level): KeyInteractionUpdateBinder<I, A, D>;
    name(name): KeyInteractionUpdateBinder<I, A, D>;
    on<W>(widget, ...widgets): KeyInteractionUpdateBinder<I, A, D>;
    onDynamic(node): KeyInteractionUpdateBinder<I, A, D>;
    preventDefault(): KeyInteractionUpdateBinder<I, A, D>;
    stopImmediatePropagation(): KeyInteractionUpdateBinder<I, A, D>;
    throttle(timeout): KeyInteractionUpdateBinder<I, A, D>;
    toProduce<C>(fn): KeyInteractionCmdUpdateBinder<C, I, A, D>;
    toProduceAnon(fn): KeyInteractionCmdUpdateBinder<Command, I, A, D>;
    when(fn, mode?): KeyInteractionUpdateBinder<I, A, D>;
    with(isCode, ...keysOrCodes): KeyInteractionUpdateBinder<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 KeyInteractionUpdateBinder<I, A, D>

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

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

Generated using TypeDoc