types.d.ts 867 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 = {
  16. [property: string]: unknown;
  17. };
  18. /**
  19. * Model id.
  20. */
  21. export declare type ModelId = unknown;
  22. /**
  23. * Flatten.
  24. */
  25. type Identity<T> = T;
  26. export declare type Flatten<T> = Identity<{[k in keyof T]: T[k]}>;
  27. /**
  28. * A callable type with the "new" operator
  29. * allows class and constructor.
  30. */
  31. export interface Constructor<T = unknown> {
  32. new (...args: any[]): T;
  33. }
  34. /**
  35. * Representing a value or promise. This type is used
  36. * to represent results of synchronous/asynchronous
  37. * resolution of values.
  38. */
  39. export type ValueOrPromise<T> = T | PromiseLike<T>;