UNPKG

@porscheinformatik/clr-addons

Version:
29 lines (28 loc) 1.18 kB
import { ClrTreetableComparatorInterface } from '../interfaces/comparator.interface'; import * as i0 from "@angular/core"; export interface TreetableSortState<T extends object> { comparator: ClrTreetableComparatorInterface<T> | null; reverse: boolean; } export declare class Sort<T extends object> { private readonly _comparator; private readonly _reverse; readonly sortState: import("@angular/core").Signal<TreetableSortState<T>>; readonly changes$: import("rxjs").Observable<TreetableSortState<T>>; /** * Sets a comparator as the current one, or toggles reverse if the comparator is already used. The * optional forceReverse input parameter allows to override that toggling behavior by sorting in * reverse order if `true`. */ toggle(sortBy: ClrTreetableComparatorInterface<T>, forceReverse?: boolean): void; /** * Clears the current comparator */ clear(): void; /** * Compares two items using the current comparator and reverse flag */ compare(a: T, b: T): number; static ɵfac: i0.ɵɵFactoryDeclaration<Sort<any>, never>; static ɵprov: i0.ɵɵInjectableDeclaration<Sort<any>>; }