types.d.ts 467 B

12345678910111213141516171819
  1. /**
  2. * A callable type with the "new" operator
  3. * allows class and constructor.
  4. */
  5. export interface Constructor<T = unknown> {
  6. new (...args: any[]): T;
  7. }
  8. /**
  9. * A function type without class and constructor.
  10. */
  11. export type Callable<T = unknown> = (...args: any[]) => T;
  12. /**
  13. * Representing a value or promise. This type is used
  14. * to represent results of synchronous/asynchronous
  15. * resolution of values.
  16. */
  17. export type ValueOrPromise<T> = T | PromiseLike<T>;