/** * Describes a function that is a constructor for something. * @typeParam TConstructed - The type this is a constructor for. */ export type ConstructorOf = new (...args: Array) => TConstructed; /** * Describes any function. */ export type AnyFunction = (...args: Array) => any; /** * Describes any asynchronous function. */ export type AnyAsyncFunction = (...args: Array) => Promise; /** * Any constructor */ export type AnyConstructor = new (...args: Array) => any; /** * Describes a function returning an instance of a given type. * @typeParam TReturned - The type of the item returned by the function. */ export type AnyFunctionReturning = (...args: Array) => TReturned; /** * Describes an async function returning an instance of a given type. * @typeParam TReturned - The type of the item returned by the function. */ export type AnyAsyncFunctionReturning = (...args: Array) => Promise; /** * Describes a class "mixin", which is a function that returns a dynamically * constructed class, based on the passed parameters. * * **Hint**: Don't use mixins. * @typeParam TTarget - The type of the classed this mixin is being * mixed in with. */ export type Mixin = InstanceType>; /** * Recursive definition of a regular JS object, which is a key-value hash * of strings to primitives, or another object of the same type. */ export type JsonObject = string | number | boolean | null | Array | { [key: string]: JsonObject; };