Skip to content

Instantly share code, notes, and snippets.

@geowarin
Created May 23, 2017 22:17
Show Gist options
  • Save geowarin/204b0d3526ade379d41c70d2005c8847 to your computer and use it in GitHub Desktop.
Save geowarin/204b0d3526ade379d41c70d2005c8847 to your computer and use it in GitHub Desktop.
declare module 'react-table' {
import * as React from "react";
interface SortMethod {
id: string;
desc: boolean
}
export type ColumnAccessor<T> = (o: T) => any
export type CellRenderer<T> = (row: Row<T>) => React.ReactElement<any>
export interface Row<T> {
index: number
value: any
original: T
column: Column<T>
}
export interface Column<T> {
width?: number
Header?: string
Cell?: CellRenderer<T>
id?: string
minWidth?: number,
className?: string
accessor?: ColumnAccessor<T> | keyof T
sortMethod?: (a: any, b: any) => number
}
interface TableProps {
defaultSorted?: SortMethod[]
className?: string
data: any
columns: Column[]
defaultPageSize?: number
showPagination?: boolean
}
class ReactTable extends React.Component<TableProps, any> {
}
export default ReactTable;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment