2
0

react-table.d.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. import {
  2. UseColumnOrderInstanceProps,
  3. UseColumnOrderState,
  4. UseExpandedHooks,
  5. UseExpandedInstanceProps,
  6. UseExpandedOptions,
  7. UseExpandedRowProps,
  8. UseExpandedState,
  9. UseFiltersColumnOptions,
  10. UseFiltersColumnProps,
  11. UseFiltersInstanceProps,
  12. UseFiltersOptions,
  13. UseFiltersState,
  14. UseGlobalFiltersColumnOptions,
  15. UseGlobalFiltersInstanceProps,
  16. UseGlobalFiltersOptions,
  17. UseGlobalFiltersState,
  18. UseGroupByCellProps,
  19. UseGroupByColumnOptions,
  20. UseGroupByColumnProps,
  21. UseGroupByHooks,
  22. UseGroupByInstanceProps,
  23. UseGroupByOptions,
  24. UseGroupByRowProps,
  25. UseGroupByState,
  26. UsePaginationInstanceProps,
  27. UsePaginationOptions,
  28. UsePaginationState,
  29. UseResizeColumnsColumnOptions,
  30. UseResizeColumnsColumnProps,
  31. UseResizeColumnsOptions,
  32. UseResizeColumnsState,
  33. UseRowSelectHooks,
  34. UseRowSelectInstanceProps,
  35. UseRowSelectOptions,
  36. UseRowSelectRowProps,
  37. UseRowSelectState,
  38. UseRowStateCellProps,
  39. UseRowStateInstanceProps,
  40. UseRowStateOptions,
  41. UseRowStateRowProps,
  42. UseRowStateState,
  43. UseSortByColumnOptions,
  44. UseSortByColumnProps,
  45. UseSortByHooks,
  46. UseSortByInstanceProps,
  47. UseSortByOptions,
  48. UseSortByState,
  49. } from "react-table";
  50. declare module "react-table" {
  51. // take this file as-is, or comment out the sections that don't apply to your plugin configuration
  52. export interface TableOptions<
  53. D extends object = {}
  54. > extends UseExpandedOptions<D>,
  55. UseFiltersOptions<D>,
  56. UseGlobalFiltersOptions<D>,
  57. UseGroupByOptions<D>,
  58. UsePaginationOptions<D>,
  59. UseResizeColumnsOptions<D>,
  60. UseRowSelectOptions<D>,
  61. UseRowStateOptions<D>,
  62. UseSortByOptions<D>,
  63. // note that having Record here allows you to add anything to the options, this matches the spirit of the
  64. // underlying js library, but might be cleaner if it's replaced by a more specific type that matches your
  65. // feature set, this is a safe default.
  66. Record<string, any> {}
  67. export interface Hooks<D extends object = {}>
  68. extends UseExpandedHooks<D>,
  69. UseGroupByHooks<D>,
  70. UseRowSelectHooks<D>,
  71. UseSortByHooks<D> {}
  72. export interface TableInstance<D extends object = {}>
  73. extends UseColumnOrderInstanceProps<D>,
  74. UseExpandedInstanceProps<D>,
  75. UseFiltersInstanceProps<D>,
  76. UseGlobalFiltersInstanceProps<D>,
  77. UseGroupByInstanceProps<D>,
  78. UsePaginationInstanceProps<D>,
  79. UseRowSelectInstanceProps<D>,
  80. UseRowStateInstanceProps<D>,
  81. UseSortByInstanceProps<D> {}
  82. export interface TableState<D extends object = {}>
  83. extends UseColumnOrderState<D>,
  84. UseExpandedState<D>,
  85. UseFiltersState<D>,
  86. UseGlobalFiltersState<D>,
  87. UseGroupByState<D>,
  88. UsePaginationState<D>,
  89. UseResizeColumnsState<D>,
  90. UseRowSelectState<D>,
  91. UseRowStateState<D>,
  92. UseSortByState<D> {}
  93. export interface ColumnInterface<D extends object = {}>
  94. extends UseFiltersColumnOptions<D>,
  95. UseGlobalFiltersColumnOptions<D>,
  96. UseGroupByColumnOptions<D>,
  97. UseResizeColumnsColumnOptions<D>,
  98. UseSortByColumnOptions<D> {}
  99. export interface ColumnInstance<D extends object = {}>
  100. extends UseFiltersColumnProps<D>,
  101. UseGroupByColumnProps<D>,
  102. UseResizeColumnsColumnProps<D>,
  103. UseSortByColumnProps<D> {}
  104. export interface Cell<D extends object = {}, V = any>
  105. extends UseGroupByCellProps<D>,
  106. UseRowStateCellProps<D> {}
  107. export interface Row<D extends object = {}>
  108. extends UseExpandedRowProps<D>,
  109. UseGroupByRowProps<D>,
  110. UseRowSelectRowProps<D>,
  111. UseRowStateRowProps<D> {}
  112. }