10
10
* governing permissions and limitations under the License.
11
11
*/
12
12
13
-
14
13
import { CardBase } from './CardBase' ;
15
- import { DOMRef } from '@react-types/shared' ;
14
+ import { DOMRef , DOMRefValue , ItemProps } from '@react-types/shared' ;
16
15
import { PartialNode } from '@react-stately/collections' ;
17
- import React , { forwardRef } from 'react' ;
16
+ import React , { forwardRef , ForwardRefExoticComponent , PropsWithoutRef , RefAttributes } from 'react' ;
18
17
import { SpectrumCardProps } from '@react-types/card' ;
19
18
import { useCardViewContext } from './CardViewContext' ;
20
19
20
+
21
21
let Card = forwardRef ( ( props : SpectrumCardProps , ref : DOMRef < HTMLDivElement > ) => {
22
22
let context = useCardViewContext ( ) ;
23
23
if ( context !== null ) {
@@ -29,10 +29,8 @@ let Card = forwardRef((props: SpectrumCardProps, ref: DOMRef<HTMLDivElement>) =>
29
29
}
30
30
} ) ;
31
31
32
- // TODO: Update the typescript for the below and the export
33
32
// @ts -ignore
34
- // eslint-disable-next-line
35
- Card . getCollectionNode = function * getCollectionNode < T > ( props , context : any ) : Generator < PartialNode < T > > {
33
+ Card . getCollectionNode = function * getCollectionNode < T > ( props : any ) : Generator < PartialNode < T > > {
36
34
let { children, textValue} = props ;
37
35
38
36
yield {
@@ -45,6 +43,5 @@ Card.getCollectionNode = function* getCollectionNode<T>(props, context: any): Ge
45
43
} ;
46
44
} ;
47
45
48
- // eslint-disable-next-line
49
- let _Card = Card as < T > ( props , ref ) => JSX . Element ;
46
+ let _Card = Card as ForwardRefExoticComponent < ItemProps < SpectrumCardProps > & PropsWithoutRef < SpectrumCardProps > & RefAttributes < DOMRefValue < HTMLDivElement > > > ;
50
47
export { _Card as Card } ;
0 commit comments