Type alias Class<T>

Class<T>: (new (...args) => T)

Type Parameters

  • T

Type declaration

    • new (...args): T
    • Generic type for class.

      Example

      interface A {
      a: number
      }
      class B implements A {
      a = 1
      }

      // Store class in variable
      const c: Class<A> = B
      console.log(typeof c === Class<B>) // true

      // Passing class to function
      function f(p: Class<A>) {
      console.log(p)
      }
      f(B) // ok

      Parameters

      • Rest ...args: any[]

      Returns T

Generated using TypeDoc