react-table.d.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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<D extends object = {}>
  53. extends UseExpandedOptions<D>,
  54. UseFiltersOptions<D>,
  55. UseGlobalFiltersOptions<D>,
  56. UseGroupByOptions<D>,
  57. UsePaginationOptions<D>,
  58. UseResizeColumnsOptions<D>,
  59. UseRowSelectOptions<D>,
  60. UseRowStateOptions<D>,
  61. UseSortByOptions<D>,
  62. // note that having Record here allows you to add anything to the options, this matches the spirit of the
  63. // underlying js library, but might be cleaner if it's replaced by a more specific type that matches your
  64. // feature set, this is a safe default.
  65. Record<string, any> {}
  66. export interface Hooks<D extends object = {}>
  67. extends UseExpandedHooks<D>,
  68. UseGroupByHooks<D>,
  69. UseRowSelectHooks<D>,
  70. UseSortByHooks<D> {}
  71. export interface TableInstance<D extends object = {}>
  72. extends UseColumnOrderInstanceProps<D>,
  73. UseExpandedInstanceProps<D>,
  74. UseFiltersInstanceProps<D>,
  75. UseGlobalFiltersInstanceProps<D>,
  76. UseGroupByInstanceProps<D>,
  77. UsePaginationInstanceProps<D>,
  78. UseRowSelectInstanceProps<D>,
  79. UseRowStateInstanceProps<D>,
  80. UseSortByInstanceProps<D> {}
  81. export interface TableState<D extends object = {}>
  82. extends UseColumnOrderState<D>,
  83. UseExpandedState<D>,
  84. UseFiltersState<D>,
  85. UseGlobalFiltersState<D>,
  86. UseGroupByState<D>,
  87. UsePaginationState<D>,
  88. UseResizeColumnsState<D>,
  89. UseRowSelectState<D>,
  90. UseRowStateState<D>,
  91. UseSortByState<D> {}
  92. export interface ColumnInterface<D extends object = {}>
  93. extends UseFiltersColumnOptions<D>,
  94. UseGlobalFiltersColumnOptions<D>,
  95. UseGroupByColumnOptions<D>,
  96. UseResizeColumnsColumnOptions<D>,
  97. UseSortByColumnOptions<D> {}
  98. export interface ColumnInstance<D extends object = {}>
  99. extends UseFiltersColumnProps<D>,
  100. UseGroupByColumnProps<D>,
  101. UseResizeColumnsColumnProps<D>,
  102. UseSortByColumnProps<D> {}
  103. export interface Cell<D extends object = {}, V = any>
  104. extends UseGroupByCellProps<D>,
  105. UseRowStateCellProps<D> {}
  106. export interface Row<D extends object = {}>
  107. extends UseExpandedRowProps<D>,
  108. UseGroupByRowProps<D>,
  109. UseRowSelectRowProps<D>,
  110. UseRowStateRowProps<D> {}
  111. }