/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { BooleanInput } from '@angular/cdk/coercion'; import { EventEmitter, InjectionToken, OnChanges, OnDestroy, OnInit } from '@angular/core'; import { CanDisable, HasInitialized } from '@angular/material/core'; import { Subject } from 'rxjs'; import { SortDirection } from './sort-direction'; /** Interface for a directive that holds sorting state consumed by `MatSortHeader`. */ export interface MatSortable { /** 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; } /** Default options for `mat-sort`. */ export interface MatSortDefaultOptions { /** Whether to disable clearing the sorting state. */ disableClear?: boolean; } /** Injection token to be used to override the default options for `mat-sort`. */ export declare const MAT_SORT_DEFAULT_OPTIONS: InjectionToken; /** @docs-private */ declare const _MatSortBase: import("@angular/material/core").HasInitializedCtor & import("@angular/material/core/common-behaviors/constructor").Constructor & import("@angular/material/core/common-behaviors/constructor").AbstractConstructor & { new (): {}; }; /** Container for MatSortables to manage the sort state and provide default sort parameters. */ export declare class MatSort extends _MatSortBase implements CanDisable, HasInitialized, OnChanges, OnDestroy, OnInit { private _defaultOptions?; /** 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 MatSortable. */ active: string; /** * The direction to set when an MatSortable is initially sorted. * May be overriden by the MatSortable's sort start. */ start: 'asc' | 'desc'; /** The sort direction of the currently active MatSortable. */ get direction(): SortDirection; set direction(direction: SortDirection); private _direction; /** * Whether to disable the user from clearing the sort by finishing the sort direction cycle. * May be overriden by the MatSortable's disable clear input. */ get disableClear(): boolean; set disableClear(v: boolean); private _disableClear; /** Event emitted when the user changes either the active sort or sort direction. */ readonly sortChange: EventEmitter; constructor(_defaultOptions?: MatSortDefaultOptions | undefined); /** * Register function to be used by the contained MatSortables. Adds the MatSortable to the * collection of MatSortables. */ register(sortable: MatSortable): void; /** * Unregister function to be used by the contained MatSortables. Removes the MatSortable from the * collection of contained MatSortables. */ deregister(sortable: MatSortable): void; /** Sets the active sort id and determines the new sort direction. */ sort(sortable: MatSortable): void; /** Returns the next sort direction of the active sortable, checking for potential overrides. */ getNextSortDirection(sortable: MatSortable): SortDirection; ngOnInit(): void; ngOnChanges(): void; ngOnDestroy(): void; static ngAcceptInputType_disableClear: BooleanInput; static ngAcceptInputType_disabled: BooleanInput; } export {};