shared-types.ts 655 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * A recursive implementation of the Partial<T> type.
  3. */
  4. export type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]> };
  5. /**
  6. * Creates a type based on T, but with all properties non-optional
  7. * and readonly.
  8. */
  9. export type ReadOnlyRequired<T> = { +readonly [K in keyof T]-?: T[K] };
  10. // tslint:disable:ban-types
  11. /**
  12. * A type representing the type rather than instance of a class.
  13. */
  14. export type Type<T> = {
  15. new (): T;
  16. } & Function;
  17. /**
  18. * A type describing the shape of a paginated list response
  19. */
  20. export type PaginatedList<T> = {
  21. items: T[];
  22. totalItems: number;
  23. };
  24. /**
  25. * An entity ID
  26. */
  27. export type ID = string | number;