import { CollectionViewer, DataSource, ListRange } from '@angular/cdk/collections'; import { AfterContentChecked, EventEmitter, OnDestroy, OnInit, TrackByFunction } from '@angular/core'; import { BooleanInput } from '@ngx-simple/core/coercion'; import { Observable } from 'rxjs'; declare class SelectionChange { } declare type SelectAllState = 'all' | 'none' | 'partial'; declare type TableDataSource = DataSource | Observable | T[]> | ReadonlyArray | T[]; /** * 管理项目的选择状态,并提供检查和更新选择状态的方法。 * 如果应用了`simSelectionToggle`、`simSelectAll`、`simRowSelection`和`simSelectionColumn`,则必须将其应用于父元素。 */ export declare class SimSelectionDirective implements OnInit, AfterContentChecked, OnDestroy, CollectionViewer { static ngAcceptInputType_multiple: BooleanInput; /** 是否支持多选择 */ get multiple(): boolean; set multiple(multiple: boolean); private _multiple; /** 选择更改时发出 */ change: EventEmitter>; viewChange: Observable; get dataSource(): TableDataSource; set dataSource(dataSource: TableDataSource); private _dataSource; trackBy: TrackByFunction; /** 数据源提供的最新数据 */ private _data; /** 侦听数据源提供的数据的订阅 */ private _renderChangeSubscription; private _destroyed; private _selection; private _switchDataSource; private _observeRenderChanges; ngOnInit(): void; ngAfterContentChecked(): void; ngOnDestroy(): void; /** 切换给定值的选择。如果使用“trackBy”,则需要使用“index” */ toggleSelection(value: T, index?: number): void; /** * 切换选择所有。如果没有选择值,则选择所有值。如果选择了所有值或部分值,取消选择所有值。 */ toggleSelectAll(): void; /** 检查是否选择了某个值。如果使用“trackBy”,则需要使用“index”。 */ isSelected(value: T, index?: number): boolean; /** 检查是否选择了所有值 */ isAllSelected(): boolean; /** 检查是否部分选中 */ isPartialSelected(): boolean; /** 全部选中 */ private _selectAll; /** 清除全部选中 */ private _clearAll; /** 更新全选状态 */ private _updateSelectAllState; /** * 全选状态 * - all 全选 * - partial 部分选 * - none 不选 */ selectAllState: SelectAllState; } export {};