types.d.ts 856 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * Free-form object with open properties.
  3. */
  4. export declare type AnyObject = {
  5. [property: string]: unknown;
  6. };
  7. /**
  8. * Makes specific field as optional.
  9. */
  10. export declare type PartialBy<T, K extends keyof T> = Omit<T, K> &
  11. Partial<Pick<T, K>>;
  12. /**
  13. * Model data.
  14. */
  15. export declare type ModelData = Record<string, unknown>;
  16. /**
  17. * Model id.
  18. */
  19. export declare type ModelId = unknown;
  20. /**
  21. * Flatten.
  22. */
  23. type Identity<T> = T;
  24. export declare type Flatten<T> = Identity<{[k in keyof T]: T[k]}>;
  25. /**
  26. * A callable type with the "new" operator
  27. * allows class and constructor.
  28. */
  29. export interface Constructor<T = unknown> {
  30. new (...args: any[]): T;
  31. }
  32. /**
  33. * Representing a value or promise. This type is used
  34. * to represent results of synchronous/asynchronous
  35. * resolution of values.
  36. */
  37. export type ValueOrPromise<T> = T | PromiseLike<T>;