turbodombuilder - v0.9.22
    Preparing search index...

    Class TurboTool<ElementType, ViewType, ModelType, EmitterType>

    TurboTool

    Class representing a tool in MVC, bound to the provided element.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    • Type Parameters

      • ElementType extends object = object
      • 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>,
                >,
            >,
        >
      • 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>,
        >
      • 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>,
            >,
        >

      Returns TurboTool<ElementType, ViewType, ModelType, EmitterType>

    Properties

    element: ElementType

    The element it is bound to.

    view: ViewType

    The MVC view.

    model: ModelType

    The MVC model.

    emitter: EmitterType

    The MVC emitter.

    keyName: string

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

    toolName: string

    The name of the tool.

    embeddedTarget: Node

    The target of this tool. If defined, will embed the tool.

    The associated event manager. Defaults to TurboEventManager.instance.

    activationEvent: string = DefaultEventName.click

    Custom activation event to listen to. Defaults to the default click event name.

    clickMode: ClickMode = ClickMode.left

    Click mode that will hold this tool when activated. Defaults to ClickMode.left.

    key: string

    Optional keyboard key to map to this tool. When pressed, it will be set as the current key tool.

    Methods

    • Protected Function

      setupChangedCallbacks

      Returns void

      Setup method intended to initialize change listeners and callbacks.

    • Function

      initialize

      Returns void

      Initialization function that calls makeTool on this.element, sets it up, and attaches all the defined tool behaviors.

    • Function

      customActivation

      Parameters

      • element: Turbo<Element>

        The tool element itself.

      • Optionalmanager: TurboEventManager

        The event manager instance this tool should register against. Defaults to TurboEventManager.instance.

      Returns void

      Custom activation function.

    • Function

      onActivate

      Returns void

      Function to execute when the tool is activated.

    • Function

      onDeactivate

      Returns void

      Function to execute when the tool is deactivated.

    • Parameters

      Returns any

      Fired on click start

    • Parameters

      Returns any

      Fired on click

    • Parameters

      Returns any

      Fired on click end

    • Parameters

      Returns any

      Fired on pointer move

    • Parameters

      Returns any

      Fired on drag start

    • Parameters

      Returns any

      Fired on drag

    • Parameters

      Returns any

      Fired on drag end

    • Parameters

      Returns any

    • Parameters

      Returns any

    • Parameters

      Returns any