@@ -64,6 +64,13 @@ export interface RowOutlet {
64
64
viewContainer : ViewContainerRef ;
65
65
}
66
66
67
+ /**
68
+ * Union of the types that can be set as the data source for a `CdkTable`.
69
+ * @docs -private
70
+ */
71
+ type CdkTableDataSourceInput < T > = DataSource < T > | Observable < ReadonlyArray < T > | T [ ] > |
72
+ ReadonlyArray < T > | T [ ] ;
73
+
67
74
/**
68
75
* Provides a handle for the table to grab the view container's ng-container to insert data rows.
69
76
* @docs -private
@@ -310,13 +317,13 @@ export class CdkTable<T> implements AfterContentChecked, CollectionViewer, OnDes
310
317
* subscriptions registered during the connect process).
311
318
*/
312
319
@Input ( )
313
- get dataSource ( ) : DataSource < T > | Observable < T [ ] > | T [ ] { return this . _dataSource ; }
314
- set dataSource ( dataSource : DataSource < T > | Observable < T [ ] > | T [ ] ) {
320
+ get dataSource ( ) : CdkTableDataSourceInput < T > { return this . _dataSource ; }
321
+ set dataSource ( dataSource : CdkTableDataSourceInput < T > ) {
315
322
if ( this . _dataSource !== dataSource ) {
316
323
this . _switchDataSource ( dataSource ) ;
317
324
}
318
325
}
319
- private _dataSource : DataSource < T > | Observable < T [ ] > | T [ ] | T [ ] ;
326
+ private _dataSource : CdkTableDataSourceInput < T > ;
320
327
321
328
/**
322
329
* Whether to allow multiple rows per data object by evaluating which rows evaluate their 'when'
@@ -759,7 +766,7 @@ export class CdkTable<T> implements AfterContentChecked, CollectionViewer, OnDes
759
766
* render change subscription if one exists. If the data source is null, interpret this by
760
767
* clearing the row outlet. Otherwise start listening for new data.
761
768
*/
762
- private _switchDataSource ( dataSource : DataSource < T > | Observable < T [ ] > | T [ ] ) {
769
+ private _switchDataSource ( dataSource : CdkTableDataSourceInput < T > ) {
763
770
this . _data = [ ] ;
764
771
765
772
if ( this . dataSource instanceof DataSource ) {
0 commit comments