Class Binder<C, I, A, D>Abstract

The base class that defines the concept of binding builder (called binder).

Type Parameters

Hierarchy

Implements

Constructors

Properties

accInit: undefined | A
bindingName: undefined | string
cannotExecFn?: ((c, i, acc) => void)

Type declaration

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

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

      Returns void

cannotExecFnArray: ((c, i, acc) => void)[] = []

Type declaration

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

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

      Returns void

dynamicNodes: readonly Node[]
endFn?: ((c, i, acc) => void)

Type declaration

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

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

      Returns void

endFnArray: ((c, i, acc) => void)[] = []

Type declaration

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

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

      Returns void

firstFn?: ((c, i, acc) => void)

Type declaration

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

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

      Returns void

firstFnArray: ((c, i, acc) => void)[] = []

Type declaration

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

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

      Returns void

hadEffectsFn?: ((c, i, acc) => void)

Type declaration

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

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

      Returns void

hadEffectsFnArray: ((c, i, acc) => void)[] = []

Type declaration

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

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

      Returns void

hadNoEffectFn?: ((c, i, acc) => void)

Type declaration

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

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

      Returns void

hadNoEffectFnArray: ((c, i, acc) => void)[] = []

Type declaration

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

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

      Returns void

linterRules: Map<RuleName, Severity>
logLevels: readonly LogLevel[]
logger: Logger
observer: undefined | BindingsObserver
onErrFn?: ((ex) => void)

Type declaration

    • (ex): void
    • Parameters

      • ex: unknown

      Returns void

onErrFnArray: ((ex) => void)[] = []

Type declaration

    • (ex): void
    • Parameters

      • ex: unknown

      Returns void

prevDefault: boolean
produceFn?: ((i) => C)

Type declaration

    • (i): C
    • Parameters

      • i: undefined | D

      Returns C

stopPropagation: boolean
undoHistory: UndoHistoryBase
usingFn?: (() => I)

Type declaration

    • (): I
    • Returns I

whenFnArray: When<D, A>[] = []
widgets: readonly unknown[]

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

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

  • Clones the arrays containing the routine functions after a binder is copied.

    Returns void

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

    Parameters

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

      The command to execute on each binding end.

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

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

          Returns void

    Returns Binder<C, I, A, D>

    A clone of the current builder 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 the command to configure.

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

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

          Returns void

    Returns Binder<C, I, A, D>

    A clone of the current 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 Binder<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 Binder<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 Binder<C, I, A, D>

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

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

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

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

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

      The supplier that will return a new user interaction.

        • (): I2
        • Returns I2

    Returns Binder<C, I2, A2, D2>

    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

    • mode: WhenType = "nonStrict"

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

    Returns Binder<C, I, A, D>

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

Generated using TypeDoc