import { Observable } from 'rxjs'; import * as i0 from '@angular/core'; import { OnInit, OnDestroy, Renderer2, ElementRef } from '@angular/core'; /** Defines the type of column sort directions. */ type TbxColumnSortDirection = "asc" | "desc" | ""; /** Defines the type of column sort directions. */ type TbxColumnSortDataType = "string" | "date" | "number" | ""; /** Defines the interface for when a column sort event occurs. */ interface TbxColumnSortedEvent { /** The name of column being sorted. */ sortColumn: string; /** The sort direction (asc, desc, none). */ sortDirection: TbxColumnSortDirection; /** The type of data the column stores (string, date, number, none). */ sortDataType: TbxColumnSortDataType; } /** * Allows communication between sort column components on the table sort status. */ declare class TbxSortableTableService { #private; /** Gets the column sort subscription for component to subscribe to sort events. */ get columnSorted(): Observable; /** * Notifies other subscribers that a column sort event occurred. * @param event The data for the event. */ onColumnSorted(event: TbxColumnSortedEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Allows communication between sort column components on the table sort status. */ declare class TbxSortableTableDirective implements OnInit, OnDestroy { #private; items: i0.ModelSignal; /** The event to emit when a column sort event occurs. */ tableSort: i0.OutputEmitterRef; ngOnInit(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[tbxSortableTable]", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; }, { "items": "itemsChange"; "tableSort": "tableSort"; }, never, never, true, never>; } /** * Displays the sort chevrons on the applied column. */ declare class TbxSortableColumnComponent implements OnInit, OnDestroy { private readonly renderer; private readonly elementRef; private readonly sortService; /** Gets or sets the column name to sort. */ columnName: i0.ModelSignal; /** Gets or sets the sort direction (asc or desc). */ sortDirection: i0.ModelSignal; /** Gets or sets the data type for the column for more accurate sort. */ sortDataType: i0.ModelSignal; /** The subscription to the sort service. */ private columnSortedSub; /** * Initializes a new instance of the {@link TbxSortableColumnComponent} class. * @param renderer The Angular screen renderer * @param elementRef The element on to which this directive is attached. * @param sortService The service that provides the sorting for the column. */ constructor(renderer: Renderer2, elementRef: ElementRef, sortService: TbxSortableTableService); /** Called when the user clicks on the column to sort. */ sort(): void; ngOnInit(): void; ngOnDestroy(): void; /** Sets the sort class depending on the set direction. */ protected setSortClass(): void; /** Resets the element to the default sort classes. */ protected resetSortClasses(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare const tbxTableSortCompareFn: (event: TbxColumnSortedEvent) => any; export { TbxSortableColumnComponent, TbxSortableTableDirective, TbxSortableTableService, tbxTableSortCompareFn }; export type { TbxColumnSortDataType, TbxColumnSortDirection, TbxColumnSortedEvent };