Interface ValueWidget

Widget with value

interface ValueWidget {
    listeners: {
        [key: string]: Function[];
    };
    ref: HTMLElement;
    value: any;
    view: View;
    _init(): void;
    addClass(...classes): this;
    bind(obj, prop): void;
    destroy(): void;
    getRef(): HTMLElement;
    getValue(): any;
    off(event, callback): void;
    on(event, callback): void;
    onClick(f): this;
    removeClass(...classes): this;
    setContent(value): this;
    setText(value): this;
    setValue(value): ValueWidget;
    trigger(event, ...args): void;
}

Hierarchy (view full)

Implemented by

Properties

listeners: {
    [key: string]: Function[];
}

Type declaration

  • [key: string]: Function[]
ref: HTMLElement
value: any
view: View

Methods

  • Parameters

    • event: string
    • callback: Function

    Returns void

  • Add a click event listener to the widget.

    Parameters

    • f: Function

      The function to call when the widget is clicked.

    Returns this

  • Set the content of the widget.

    Parameters

    • value: string

      The value to set the content to.

    Returns this

  • Set the text of the widget.

    Parameters

    • value: string

      The value to set the text to.

    Returns this