index.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { PropsWithChildren, SVGProps } from "react";
  2. export type IconSvgProps = SVGProps<SVGSVGElement> & {
  3. size?: number;
  4. };
  5. export type LocalPropsWithChildren<T = unknown> = {
  6. params: {
  7. local: string;
  8. };
  9. } & PropsWithChildren<T>;
  10. export interface Pagination {
  11. /**
  12. * 分页模式--当前页数
  13. */
  14. current_page: number;
  15. /**
  16. * 升序-降序
  17. */
  18. is_asc: boolean;
  19. /**
  20. * 是否已经没有数据
  21. */
  22. is_end: boolean;
  23. /**
  24. * 下一页的起始位,默认0
  25. */
  26. next_cursor: string;
  27. /**
  28. * 每页大小
  29. */
  30. page_size: number;
  31. /**
  32. * 如果是升序-那就是最大ID,如果是降序那就是最小ID
  33. */
  34. start_cursor: string;
  35. /**
  36. * 总数
  37. */
  38. total_count: number;
  39. /**
  40. * 是否使用分页----默认为下标模式
  41. */
  42. use_page: boolean;
  43. }
  44. export type Result<T> = {
  45. code: number;
  46. msg: string;
  47. data: T;
  48. };
  49. export type Response<T> = T extends any[] ? Result<T> & { page: Pagination } : Result<T>;