ts-function-types
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

ts-function-types

FunctionType

A type representing any function. TypeScript provides ReturnType<T>, a useful companion that provides the return type of a function.

FunctionTypeReturning<R>

A type representing any function that returns a specified type. TypeScript provides ReturnType<T>, a useful companion that provides the return type of a function.

FunctionMap

A type representing an object with functions as the values.

ClassType

A type representing any class. This type actually represents a constructor function, so it cannot represent any properties or functions on the class/constructor itself, i.e. static properties or functions. However, a union of this type with a type including the static properties and functions can be used to fully define the class type.

ClassTypeFor<T>

A type representing the class of a particular object. This type actually represents a constructor function that would produce the object, so it cannot represent any properties or functions on the class/constructor itself i.e., static properties. However, a union of this type with a type including the static properties and functions can be used to fully define the class type. TypeScript provides InstanceType<T>, a useful companion which does the reverse; given a class/constructor, it returns the produced object type.

Readme

Keywords

none

Package Sidebar

Install

npm i ts-function-types

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

8.33 kB

Total Files

10

Last publish

Collaborators

  • chadnorvell