0.1.0 • Published 6 years ago

ts-function-types v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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.