mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add typings for Reactable 0.14. Not complete but the stuff provided by the typings have been tested/used quite extensively by myself during the development of ReactPlayer! * Add two tests (very simple one and a quite sophisticated one which contains all the components i created typings for...)
61 lines
1.3 KiB
TypeScript
61 lines
1.3 KiB
TypeScript
// Type definitions for reactable 0.14
|
|
// Project: https://github.com/glittershark/reactable
|
|
// Definitions by: Christoph Spielmann <https://github.com/spielc>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
import * as React from 'react';
|
|
|
|
export interface KeyLabelObject {
|
|
key: string;
|
|
label: string;
|
|
}
|
|
|
|
export type ColumnsType = string | KeyLabelObject;
|
|
|
|
export type FilterMethodType = (text: string) => void;
|
|
|
|
export interface TableComponentProperties<T> {
|
|
data?: T[];
|
|
className?: string;
|
|
columns?: ColumnsType[];
|
|
id?: string;
|
|
sortable?: string[];
|
|
filterable?: string[];
|
|
filterBy?: string;
|
|
onFilter?: FilterMethodType;
|
|
}
|
|
|
|
export interface ThProperties {
|
|
column: string;
|
|
className?: string;
|
|
}
|
|
|
|
export interface TrProperties<T> {
|
|
data?: T;
|
|
className?: string;
|
|
}
|
|
|
|
export interface TdProperties {
|
|
column: string;
|
|
value?: any;
|
|
data?: any;
|
|
}
|
|
|
|
export class Table<T> extends React.Component<TableComponentProperties<T>, {}> {
|
|
}
|
|
|
|
export class Thead extends React.Component<{}, {}> {
|
|
}
|
|
|
|
export class Th extends React.Component<ThProperties, {}> {
|
|
}
|
|
|
|
export class Tr<T> extends React.Component<TrProperties<T>, {}> {
|
|
}
|
|
|
|
export class Td extends React.Component<TdProperties, {}> {
|
|
}
|
|
|
|
export class Tfoot extends React.Component<{}, {}> {
|
|
}
|