These definitions mask errors in the other definitions and there are better
ways of extending these.
See https://github.com/tannerlinsley/react-table/pull/1597 for an
example of an existing prototype that was missing but harder to find
because of these definitions.
useTableState was an early and hasty abstraction that hasn't proved useful in many ways. Anything
you could do with useTableState, you could easily do using the same options (assuming they exist) in
the useTable hook. For this reason, state is now a first class citizen of the useTable hook, along
with more sane properties and option locations for anything pertaining to state.
* TypeScript updates
I've found that trying to get solid TypeScript typings for this library
are a bit of a challenge. The composable nature of the library means
that the types for the builtin functions are by their nature somewhat
minimal, and that the user needs to be able to extend those interfaces
to reflect the specific plugins that are in use.
With that in mind I propose something like this.
To get the best out of them, you then need to extend those interfaces
using declaration merging, see
https://www.typescriptlang.org/docs/handbook/declaration-merging.html
e.g.
```ts
declare module 'react-table-hooks' {
export interface TableInstance<D = any>
extends UseFiltersValues<D>,
UsePaginationValues<D>,
UseExpandedValues,
UseGroupByValues {}
export interface TableState<D = any>
extends UsePaginationState,
UseGroupByState,
UseSortbyState<D>,
UseFiltersState<D> {}
}
```
This also puts the ability to extend those types with any user defined
hooks completely in the users hands.
This gives the greatest flexibility, but I'll admit that it isn't
particularly obvious. Perhaps a typescript readme and example is needed.
* fix useExpanded type
* fix module name
* fix typo
* address review feedback
* add IdType, update Filters definition