Options
All
  • Public
  • Public/Protected
  • All
Menu

Type aliases

Type aliases

Instance

Instance<C>: C extends Class<any[], infer R> ? R : any

Get the instance type of a class from a class object

Type parameters

  • C: Class
    • *typeof** class

returns

Object

example

import {C} from 'ts-toolbelt'

/// `create` takes an instance constructor and creates an instance of it
declare function create<C extends (new (...args: any[]) => any)>(c: C): C.InstanceOf<C>

class A {}
class B {}

let a = create(A) // A
let b = create(B) // B

  • Inherited
  • Protected
  • Private
  • Static
  • Module
  • Object
  • Property
  • Function
  • Variable
  • Index
  • Type
  • Class
  • Interface
  • Enum
  • Constructor
  • Getter/Setter
Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.