import { ThSortType } from '@patternfly/react-table/dist/esm/components/Table/base'; import { Field, SortType } from '../types'; import { Column } from './types'; /** * Compares all types by converting them to string. * Nullish entities are converted to empty string. * @see localeCompare * @param locale to be used by string comparator */ export declare const universalComparator: (a: any, b: any, locale: string) => number; /** * Creates a comparator function based on provided current sort definition. * If there is no sort defined then comparator considers all entities equal. * * @see universalComparator * @param currentSort * @param locale defaults to "en" * @param fieldComparator (optional) custom field comparator. Defaults to universal string based comparator. * @returns comparator function */ export declare function compareWith(currentSort: SortType, locale: string, fieldComparator: (a: any, b: any, locale: string) => number): (a: any, b: any) => number; /** * Hook for maintaining sort state. Supported features: * 1) by default sort by the first identity column or by the first column available if there is no identity column * 2) build comparator based on the current active sort definition * * @param fields (read only) field metadata * @returns [activeSort, setActiveSort, comparator] */ export declare const useSort: (fields: Field[]) => [SortType, (sort: SortType) => void, (a: any, b: any) => number]; /** * Builds table specific sort definition based on provided active sort definition. * @see ThSortType */ export declare const buildSort: ({ columnIndex, columns, activeSort, setActiveSort, }: { columnIndex: number; columns: Column[]; activeSort: SortType; setActiveSort: (sort: SortType) => void; }) => ThSortType;