Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Component<T>

Base component class combining View and View-Model. @

Type parameters

  • T

Hierarchy

  • { props: any; off: any; on: any; once: any } & ViewModel<any, this> & Commandable<this>
    • Component

Implements

  • Commandable
  • ViewModel<T>
  • View<Elements>

Index

Properties

Methods

Properties

Readonly props

props: T

Component properties. This is the Model that is used by View-Model.

Static Readonly props

props: any

Methods

off

  • off<M>(command: M, listener: Listener<this, M>, capture?: undefined | false | true): this
  • Removes a command listener.

    Type parameters

    • M: MethodOf<this>

    Parameters

    • command: M

      The command name

    • listener: Listener<this, M>

      The command listener.

    • Optional capture: undefined | false | true

    Returns this

on

  • on<M>(command: M, listener: Listener<this, M>, capture?: undefined | false | true): this
  • Adds a command listener.

    Type parameters

    • M: MethodOf<this>

    Parameters

    • command: M

      The command name

    • listener: Listener<this, M>

      The command listener.

    • Optional capture: undefined | false | true

    Returns this

once

  • once<M>(command: M, listener: Listener<this, M>, capture?: undefined | false | true): this
  • Adds a command listener, which will be removed after the first call.

    Type parameters

    • M: MethodOf<this>

    Parameters

    • command: M

      The command name

    • listener: Listener<this, M>

      The command listener.

    • Optional capture: undefined | false | true

    Returns this

Abstract render

  • Renders the component node. This method will be called upon the Model change.

    Returns Children

    Rendered elements.

Static off

  • off<M_2>(command: M_2, listener: <U_3>(object: U_3, ...args: ArgumentsOf<any[M_2]>) => unknown, capture?: boolean | undefined): any
  • Type parameters

    • M_2: "on" | "once" | "off" | "props"

    Parameters

    • command: M_2
    • listener: <U_3>(object: U_3, ...args: ArgumentsOf<any[M_2]>) => unknown
        • <U_3>(object: U_3, ...args: ArgumentsOf<any[M_2]>): unknown
        • Type parameters

          • U_3: any

          Parameters

          • object: U_3
          • Rest ...args: ArgumentsOf<any[M_2]>

          Returns unknown

    • Optional capture: boolean | undefined

    Returns any

Static on

  • on<M>(command: M, listener: <U_1>(object: U_1, ...args: ArgumentsOf<any[M]>) => unknown, capture?: boolean | undefined): any
  • Type parameters

    • M: "on" | "once" | "off" | "props"

    Parameters

    • command: M
    • listener: <U_1>(object: U_1, ...args: ArgumentsOf<any[M]>) => unknown
        • <U_1>(object: U_1, ...args: ArgumentsOf<any[M]>): unknown
        • Type parameters

          • U_1: any

          Parameters

          • object: U_1
          • Rest ...args: ArgumentsOf<any[M]>

          Returns unknown

    • Optional capture: boolean | undefined

    Returns any

Static once

  • once<M_1>(command: M_1, listener: <U_2>(object: U_2, ...args: ArgumentsOf<any[M_1]>) => unknown, capture?: boolean | undefined): any
  • Type parameters

    • M_1: "on" | "once" | "off" | "props"

    Parameters

    • command: M_1
    • listener: <U_2>(object: U_2, ...args: ArgumentsOf<any[M_1]>) => unknown
        • <U_2>(object: U_2, ...args: ArgumentsOf<any[M_1]>): unknown
        • Type parameters

          • U_2: any

          Parameters

          • object: U_2
          • Rest ...args: ArgumentsOf<any[M_1]>

          Returns unknown

    • Optional capture: boolean | undefined

    Returns any