You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
1.4 KiB

/**
* @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 { Observable } from 'rxjs';
import { CollectionViewer } from './collection-viewer';
export declare abstract class DataSource<T> {
/**
* Connects a collection viewer (such as a data-table) to this data source. Note that
* the stream provided will be accessed during change detection and should not directly change
* values that are bound in template views.
* @param collectionViewer The component that exposes a view over the data provided by this
* data source.
* @returns Observable that emits a new value when the data changes.
*/
abstract connect(collectionViewer: CollectionViewer): Observable<readonly T[]>;
/**
* Disconnects a collection viewer (such as a data-table) from this data source. Can be used
* to perform any clean-up or tear-down operations when a view is being destroyed.
*
* @param collectionViewer The component that exposes a view over the data provided by this
* data source.
*/
abstract disconnect(collectionViewer: CollectionViewer): void;
}
/** Checks whether an object is a data source. */
export declare function isDataSource(value: any): value is DataSource<any>;