Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "Class/InstanceOf"

Index

Type aliases

Type aliases

InstanceOf

InstanceOf<C>: InstanceType<C>

Get the instance type of a class from a class object

Type parameters

  • C: object

    typeof class

returns

class

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

Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.