-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtyping.d.ts
28 lines (27 loc) · 983 Bytes
/
typing.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
declare module 'react-pivot' {
class ReactPivot<Row, Reduced> extends React.Component<ReactPivot.PivotProps<Row, Reduced>, {}> {
constructor(props: ReactPivot.PivotProps<Row, Reduced>);
}
namespace ReactPivot {
type Dimension<Row> = {
value: (row: Row) => number | string | boolean,
title: string
}
type Calculation<Row, Reduced> = {
title: string,
value: (row: Reduced) => number,
template?: (val: number, row: Reduced) => string | number;
}
interface PivotProps<Row, Reduced> {
rows: Row[];
dimensions: Dimension<Row>[];
activeDimensions: string[];
hiddenColumns?: string[];
sortBy?: string;
solo?: {title: string, value: string}
calculations: Calculation<Row, Reduced>[];
reduce<T>(row: Row, reduced: Reduced): Reduced;
}
}
export = ReactPivot;
}