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