UNPKG

650 BTypeScriptView Raw
1import { SortDirection } from '../sorting';
2export declare type Grouping<T> = IGroupValues | IGroupingFunc<T>;
3export declare type GroupSort = SortDirection | '';
4/**
5 * Signature of a function that should return the name of the group
6 * that the `item` should be placed within
7 */
8export interface IGroupingFunc<T> {
9 (item: T): string;
10 /**
11 * leave undefined to let the value of `ISettings.groupOptions.defaultSort` apply
12 */
13 sortDirection?: GroupSort;
14 title?: string;
15}
16/**
17 * Map of the names of fields on a data row and the corrosponding sort direction
18 */
19export interface IGroupValues {
20 [name: string]: GroupSort;
21}