turbodombuilder - v0.9.48
    Preparing search index...

    Class TurboInteractor<ElementType, ViewType, ModelType, EmitterType>

    TurboInteractor

    Class representing an MVC interactor. It holds event listeners to set up on the element itself, or the custom defined target.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    • Type Parameters

      • ElementType extends object = object

        The type of the main component.

      • ViewType extends TurboView<
            object,
            TurboModel<
                any,
                any,
                any,
                "map"
                | "array",
                TurboDataBlock<any, any, any, any, any>,
            >,
            TurboEmitter<
                TurboModel<
                    any,
                    any,
                    any,
                    "map"
                    | "array",
                    TurboDataBlock<any, any, any, any, any>,
                >,
            >,
        > = TurboView<
            any,
            any,
            TurboEmitter<
                TurboModel<
                    any,
                    any,
                    any,
                    "map"
                    | "array",
                    TurboDataBlock<any, any, any, any, any>,
                >,
            >,
        >

        The element's MVC view type.

      • ModelType extends TurboModel<
            any,
            any,
            any,
            "map"
            | "array",
            TurboDataBlock<any, any, any, any, any>,
        > = TurboModel<
            any,
            any,
            any,
            "map"
            | "array",
            TurboDataBlock<any, any, any, any, any>,
        >

        The element's MVC model type.

      • EmitterType extends TurboEmitter<
            TurboModel<
                any,
                any,
                any,
                "map"
                | "array",
                TurboDataBlock<any, any, any, any, any>,
            >,
        > = TurboEmitter<
            TurboModel<
                any,
                any,
                any,
                "map"
                | "array",
                TurboDataBlock<any, any, any, any, any>,
            >,
        >

        The element's MVC emitter type.

      Returns TurboInteractor<ElementType, ViewType, ModelType, EmitterType>

    Properties

    keyName: string

    The key of the interactor. Used to retrieve it in the main component. If not set, if the element's class name is MyElement and the interactor's class name is MyElementSomethingInteractor, the key would default to "something".

    toolName: string

    The name of the tool (if any) to listen for.

    The associated event manager. Defaults to TurboEventManager.instance.

    Optional custom options to define per event type.

    element: ElementType

    The element it is bound to.

    view: ViewType

    The MVC view.

    model: ModelType

    The MVC model.

    emitter: EmitterType

    The MVC emitter.

    Accessors

    target: Node

    The target of the event listeners. Defaults to the element itself.

    Methods

    • Protected Function

      setup

      Returns void

      Called in the constructor. Use for setup that should happen at instantiation, before this.initialize() is called.

    • Function

      initialize

      Returns void

      Initializes the controller. Specifically, it will set up the change callbacks.

    • Protected Function

      setupUIListeners

      Returns void

      Setup method for defining DOM and input event listeners.

    • Protected Function

      setupChangedCallbacks

      Returns void

      Setup method intended to initialize change listeners and callbacks.