On this page
  1. InstanceType
  2. Syntax & Overview
  3. Notes & Pitfalls
  4. Example

InstanceType

Prev: `ConstructorParameters` | Up: function_and_promise | Next: `ThisParameterType`
Rel: function_and_promise, Conditional & Mapped Types
Ref: TypeScript Docs — Utility Types
Tags: #public #web #typescript #utility-types #function_and_promise #tier/specialized


Syntax & Overview

InstanceType<Ctor>

Extracts the instance type constructed by a class constructor type.

Notes & Pitfalls

Example

class Client {
  ping() { return "pong"; }
}

type ClientInstance = InstanceType<typeof Client>; // Client

Linked from

Related notes