Interface BaseBinder

The base interface for building bindings with routines for defining the UI command and the user interaction to use.

interface BaseBinder {
    catch(fn): BaseBinder;
    configureRules(ruleName, severity): BaseBinder;
    end(fn): BaseBinder;
    log(...level): BaseBinder;
    name(name): BaseBinder;
    on<W>(widget, ...widgets): BaseBinder;
    onDynamic(node): BaseBinder;
    preventDefault(): BaseBinderBuilder;
    stopImmediatePropagation(): BaseBinderBuilder;
    toProduce<C>(fn): CmdBinder<C>;
    toProduceAnon(fn): CmdBinder<Command>;
    usingInteraction<I, A, D>(fn): InteractionBinder<I, A, D>;
    when(whenPredicate, mode?): BaseBinder;
}

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 BaseBinder

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

  • Defines actions to perform when a binding ends. A binder can have several cummulative 'end' routines.

    Parameters

    • fn: (() => void)

      The command to execute on each binding end.

        • (): void
        • Returns void

    Returns BaseBinder

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

  • Specifies the logging level to use. A binder can have several cummulative 'log' routines, eg: log(LogLevel.INTERACTION).log(LogLevel.COMMAND)

    Parameters

    • Rest ...level: readonly LogLevel[]

      The logging level to use.

    Returns BaseBinder

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

  • Specifies the name of the Interacto binding. This name will be used in the logging system. It should be unique, but no mechanism will check that.

    Parameters

    • name: string

      The name of the binding

    Returns BaseBinder

    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 BaseBinder

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

  • Specifies the node the binding will observe its children. The binding observes its children list, so that additions and removals from it are managed by the binding.

    Parameters

    • node: Widget<Node>

      The binding will observe the children of this node.

    Returns BaseBinder

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

  • Defines how to create the UI command that the binding will produce.

    Type Parameters

    • C extends Command

      The type of the UI command

    Parameters

    • fn: (() => C)

      The supplier that will return a new UI command on each call.

        • (): C
        • Returns C

    Returns CmdBinder<C>

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

  • Defines the anonymous command function to run on command execution

    Parameters

    • fn: (() => void)

      The anonymous command.

        • (): void
        • Returns void

    Returns CmdBinder<Command>

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

  • Defines how to create the user interaction that the binding will use to create UI commands.

    Type Parameters

    Parameters

    • fn: (() => I)

      The supplier that will return an instance of the user interaction to use. Called once.

        • (): I
        • Returns I

    Returns InteractionBinder<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

    • whenPredicate: (() => 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 BaseBinder

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

Generated using TypeDoc