@@ -46,7 +46,7 @@ TKey = any,
4646 _defaultOptionsRules ( ) : DefaultOptionsRule < TProperties > [ ] {
4747 return super . _defaultOptionsRules ( ) . concat ( [
4848 {
49- device ( ) {
49+ device ( ) : boolean {
5050 return devices . real ( ) . deviceType === 'desktop' && ! devices . isSimulator ( ) ;
5151 } ,
5252 // @ts -expect-error ts-error
@@ -57,22 +57,22 @@ TKey = any,
5757 ] ) ;
5858 }
5959
60- _init ( ) {
60+ _init ( ) : void {
6161 super . _init ( ) ;
6262
6363 this . _initAccessors ( ) ;
6464 this . _initDataAdapter ( ) ;
6565 this . _initDynamicTemplates ( ) ;
6666 }
6767
68- _initDataSource ( ) {
68+ _initDataSource ( ) : void {
6969 // @ts -expect-error ts-error
7070 super . _initDataSource ( ) ;
7171 // @ts -expect-error ts-error
72- this . _dataSource && this . _dataSource . paginate ( false ) ;
72+ this . _dataSource ? .paginate ( false ) ;
7373 }
7474
75- _initDataAdapter ( ) {
75+ _initDataAdapter ( ) : void {
7676 const accessors = this . _createDataAdapterAccessors ( ) ;
7777
7878 this . _dataAdapter = new HierarchicalDataAdapter (
@@ -86,9 +86,9 @@ TKey = any,
8686 ) ;
8787 }
8888
89- _getDataAdapterOptions ( ) { }
89+ _getDataAdapterOptions ( ) : void { }
9090
91- // @ts -expect-error
91+ // @ts -expect-error ts-error
9292 _getItemExtraPropNames ( ) : string [ ] { }
9393
9494 _initDynamicTemplates ( ) {
@@ -97,59 +97,60 @@ TKey = any,
9797 this . _templateManager . addDefaultTemplates ( {
9898 item : new BindableTemplate ( this . _addContent . bind ( this ) , fields , this . option ( 'integrationOptions.watchMethod' ) , {
9999 text : this . _displayGetter ,
100- // @ts -expect-error
100+ // @ts -expect-error ts-error
101101 items : this . _itemsGetter ,
102102 } ) ,
103103 } ) ;
104104 }
105105
106106 _addContent ( $container : dxElementWrapper , itemData : TItem ) : void {
107107 $container
108- // @ts -expect-error
108+ // @ts -expect-error ts-error
109109 . html ( itemData . html )
110- // @ts -expect-error
110+ // @ts -expect-error ts-error
111111 . append ( this . _getIconContainer ( itemData ) )
112112 . append ( this . _getTextContainer ( itemData ) ) ;
113113 }
114114
115115 _getLinkContainer (
116- iconContainer : dxElementWrapper ,
116+ iconContainer : dxElementWrapper | undefined | null ,
117117 textContainer : dxElementWrapper ,
118118 itemData : TItem ,
119119 ) : dxElementWrapper {
120- // @ts -expect-error
120+ // @ts -expect-error ts-error
121121 const { linkAttr, url } = itemData ;
122122
123123 const linkAttributes = isObject ( linkAttr ) ? linkAttr : { } ;
124124 return $ ( '<a>' )
125125 . addClass ( ITEM_URL_CLASS )
126- // @ts -expect-error
126+ // @ts -expect-error ts-error
127127 . attr ( { ...linkAttributes , href : url } )
128+ // @ts -expect-error ts-error
128129 . append ( iconContainer )
129130 . append ( textContainer ) ;
130131 }
131132
132133 _getIconContainer ( itemData : TItem ) : dxElementWrapper | undefined | null {
133- // @ts -expect-error
134+ // @ts -expect-error ts-error
134135 if ( ! itemData . icon ) {
135136 return undefined ;
136137 }
137- // @ts -expect-error
138+ // @ts -expect-error ts-error
138139 const $imageContainer = getImageContainer ( itemData . icon ) ;
139- // @ts -expect-error
140+ // @ts -expect-error ts-error
140141 if ( $imageContainer . is ( 'img' ) ) {
141142 const componentName = this . NAME ?. startsWith ( 'dxPrivateComponent' )
142143 ? ''
143144 : `${ this . NAME } ` ;
144- // @ts -expect-error
145+ // @ts -expect-error ts-error
145146 $imageContainer . attr ( 'alt' , `${ componentName } item icon` ) ;
146147 }
147148
148149 return $imageContainer ;
149150 }
150151
151152 _getTextContainer ( itemData : TItem ) : dxElementWrapper {
152- // @ts -expect-error
153+ // @ts -expect-error ts-error
153154 return $ ( '<span>' ) . text ( itemData . text ) ;
154155 }
155156
@@ -162,7 +163,7 @@ TKey = any,
162163 this . _compileDisplayGetter ( ) ;
163164 }
164165
165- _getAccessors ( ) {
166+ _getAccessors ( ) : string [ ] {
166167 return [ 'key' , 'selected' , 'items' , 'disabled' , 'parentId' , 'expanded' ] ;
167168 }
168169
@@ -178,12 +179,12 @@ TKey = any,
178179 return arr ;
179180 }
180181
181- _hasChildren ( node : TItem ) : number | undefined {
182- // @ts -expect-error
182+ _hasChildren ( node : TItem ) : number | boolean | undefined {
183+ // @ts -expect-error ts-error
183184 return node && node . internalFields . childrenKeys . length ;
184185 }
185186
186- _compileAccessor ( optionName ) {
187+ _compileAccessor ( optionName ) : void {
187188 const getter = `_${ optionName } Getter` ;
188189 const setter = `_${ optionName } Setter` ;
189190 const optionExpr = this . option ( `${ optionName } Expr` ) ;
@@ -197,9 +198,9 @@ TKey = any,
197198 this [ getter ] = function ( obj ) { return obj [ optionExpr ( ) ] ; } ;
198199 return ;
199200 }
200- // @ts -expect-error
201+ // @ts -expect-error ts-error
201202 this [ getter ] = compileGetter ( optionExpr ) ;
202- // @ts -expect-error
203+ // @ts -expect-error ts-error
203204 this [ setter ] = compileSetter ( optionExpr ) ;
204205 }
205206
@@ -234,6 +235,7 @@ TKey = any,
234235 }
235236
236237 // @ts -expect-error ts-error
238+ // eslint-disable-next-line class-methods-use-this
237239 _widgetClass ( ) : string { }
238240
239241 _renderItemFrame (
0 commit comments