import { EventEmitter, OnChanges, OnDestroy, OnInit } from '@angular/core'; import { Subject } from 'rxjs'; import { CanDisable, HasInitialized } from 'vdl-angular/core'; import { MatSortDirection as SortDirection } from './mat-sort-direction'; /** Interface for a directive that holds sorting state consumed by `VdlSortHeader`. */ export interface VdlSortable { /** The id of the column being sorted. */ id: string; /** Starting sort direction. */ start: 'asc' | 'desc'; /** Whether to disable clearing the sorting state. */ disableClear: boolean; } /** The current sort state. */ export interface Sort { /** The id of the column being sorted. */ active: string; /** The sort direction. */ direction: SortDirection; } /** @docs-private */ export declare class VdlSortBase { } export declare const _VdlSortMixinBase: (new (...args: any[]) => HasInitialized) & (new (...args: any[]) => CanDisable) & typeof VdlSortBase; /** Container for VdlSortables to manage the sort state and provide default sort parameters. */ export declare class VdlSort extends _VdlSortMixinBase implements CanDisable, HasInitialized, OnChanges, OnDestroy, OnInit { /** Collection of all registered sortables that this directive manages. */ sortables: Map; /** Used to notify any child components listening to state changes. */ readonly _stateChanges: Subject; /** The id of the most recently sorted VdlSortable. */ active: string; /** * The direction to set when an VdlSortable is initially sorted. * May be overriden by the VdlSortable's sort start. */ start: 'asc' | 'desc'; /** The sort direction of the currently active VdlSortable. */ direction: SortDirection; private _direction; /** * Whether to disable the user from clearing the sort by finishing the sort direction cycle. * May be overriden by the VdlSortable's disable clear input. */ disableClear: boolean; private _disableClear; /** Event emitted when the user changes either the active sort or sort direction. */ readonly sortChange: EventEmitter; /** * Register function to be used by the contained VdlSortables. Adds the VdlSortable to the * collection of VdlSortables. */ register(sortable: VdlSortable): void; /** * Unregister function to be used by the contained VdlSortables. Removes the VdlSortable from the * collection of contained VdlSortables. */ deregister(sortable: VdlSortable): void; /** Sets the active sort id and determines the new sort direction. */ sort(sortable: VdlSortable): void; /** Returns the next sort direction of the active sortable, checking for potential overrides. */ getNextSortDirection(sortable: VdlSortable): SortDirection; ngOnInit(): void; ngOnChanges(): void; ngOnDestroy(): void; }