@@ -66,6 +66,7 @@ import type {
6666 UserState ,
6767} from './types' ;
6868import { resolvePaginate , syncPaging } from './utils/paging' ;
69+ import { getRefreshOptions } from './utils/refresh' ;
6970import { generateRowValues } from './utils/row_values' ;
7071
7172export class DataController extends DataHelperMixin ( modules . Controller ) {
@@ -1658,7 +1659,7 @@ export class DataController extends DataHelperMixin(modules.Controller) {
16581659 }
16591660
16601661 public isCustomLoading ( ) : boolean {
1661- return ! ! ( this . _isCustomLoading || this . _dataSource ?. isCustomLoading ( ) ) ;
1662+ return this . _isCustomLoading || ! ! this . _dataSource ?. isCustomLoading ( ) ;
16621663 }
16631664
16641665 public beginCustomLoading ( messageText ?: string ) : void {
@@ -1677,12 +1678,7 @@ export class DataController extends DataHelperMixin(modules.Controller) {
16771678 * @extended : virtual_scrolling, selection
16781679 */
16791680 public refresh ( options ?: boolean | RefreshOptions ) : DeferredObj < unknown > {
1680- let refreshOptions : RefreshOptions = { reload : true , lookup : true } ;
1681- if ( options === true ) {
1682- refreshOptions = { reload : true , changesOnly : true } ;
1683- } else if ( options ) {
1684- refreshOptions = options ;
1685- }
1681+ const refreshOptions = getRefreshOptions ( options ) ;
16861682
16871683 const dataSource = this . getDataSource ( ) ;
16881684 const { changesOnly } = refreshOptions ;
@@ -1736,7 +1732,7 @@ export class DataController extends DataHelperMixin(modules.Controller) {
17361732 /**
17371733 * @extended editing
17381734 */
1739- public repaintRows ( rowIndexes : number | ( number | undefined ) [ ] , changesOnly ?: boolean ) : void {
1735+ public repaintRows ( rowIndexes : number | ( number | undefined ) [ ] | undefined , changesOnly ?: boolean ) : void {
17401736 const rowIndices = Array . isArray ( rowIndexes ) ? rowIndexes : [ rowIndexes ] ;
17411737
17421738 if ( rowIndices . length > 1 || isDefined ( rowIndices [ 0 ] ) ) {
@@ -1763,8 +1759,8 @@ export class DataController extends DataHelperMixin(modules.Controller) {
17631759 } ;
17641760 }
17651761
1766- public getCachedStoreData ( ) : unknown {
1767- return this . _dataSource ?. getCachedStoreData ( ) ;
1762+ public getCachedStoreData ( ) : RawItemData [ ] | undefined {
1763+ return this . _dataSource ?. getCachedStoreData ( ) as RawItemData [ ] | undefined ;
17681764 }
17691765
17701766 /**
@@ -1777,42 +1773,42 @@ export class DataController extends DataHelperMixin(modules.Controller) {
17771773 }
17781774
17791775 public load ( ) : DeferredObj < unknown > {
1780- return this . _dataSource ?. load ( ) ;
1776+ return this . _dataSource ?. load ( ) as DeferredObj < unknown > ;
17811777 }
17821778
17831779 /**
17841780 * @extended : editing, virtual_scrolling
17851781 */
17861782
17871783 public reload ( reload ?: boolean , changesOnly ?: boolean ) : DeferredObj < unknown > {
1788- return this . _dataSource ?. reload ( reload , changesOnly ) ;
1784+ return this . _dataSource ?. reload ( reload , changesOnly ) as DeferredObj < unknown > ;
17891785 }
17901786
17911787 public push ( ...args : unknown [ ] ) : unknown {
17921788 return this . _dataSource ?. push ( ...args ) ;
17931789 }
17941790
17951791 private itemsCount ( ) : number {
1796- return this . _dataSource ? this . _dataSource . itemsCount ( ) : 0 ;
1792+ return ( this . _dataSource ? this . _dataSource . itemsCount ( ) : 0 ) as number ;
17971793 }
17981794
17991795 public totalItemsCount ( ) : number {
1800- return this . _dataSource ? this . _dataSource . totalItemsCount ( ) : 0 ;
1796+ return ( this . _dataSource ? this . _dataSource . totalItemsCount ( ) : 0 ) as number ;
18011797 }
18021798
18031799 public hasKnownLastPage ( ) : boolean {
1804- return this . _dataSource ? this . _dataSource . hasKnownLastPage ( ) : true ;
1800+ return ( this . _dataSource ? this . _dataSource . hasKnownLastPage ( ) : true ) as boolean ;
18051801 }
18061802
18071803 /**
18081804 * @extended : state_storing
18091805 */
18101806 public isLoaded ( ) : boolean {
1811- return this . _dataSource ? this . _dataSource . isLoaded ( ) : true ;
1807+ return ( this . _dataSource ? this . _dataSource . isLoaded ( ) : true ) as boolean ;
18121808 }
18131809
18141810 public totalCount ( ) : number {
1815- return this . _dataSource ? this . _dataSource . totalCount ( ) : 0 ;
1811+ return ( this . _dataSource ? this . _dataSource . totalCount ( ) : 0 ) as number ;
18161812 }
18171813
18181814 public hasLoadOperation ( ) : boolean {
0 commit comments