@@ -37,7 +37,7 @@ function assignForwardedRef<T>(ref: React.ForwardedRef<T>, value: T | null) {
3737 else ref . current = value ;
3838}
3939
40- interface ChartBaseProps < T extends readonly ChartComponentType < any > [ ] > {
40+ interface ChartBaseProps < T extends readonly ChartComponentType [ ] > {
4141 className ?: string ;
4242 style ?: React . CSSProperties ;
4343 containerProps ?: React . HTMLAttributes < HTMLDivElement > ;
@@ -46,16 +46,19 @@ interface ChartBaseProps<T extends readonly ChartComponentType<any>[]> {
4646 children ?: React . ReactNode ;
4747}
4848
49- type InferChartComponentOption <
50- T extends readonly ChartComponentType < any > [ ] ,
51- U = T [ number ]
52- > = U extends ChartComponentType < infer P > ? P : never ;
49+ type ResolveComposeOption < T extends ComponentOption | ChartComponentType > = T extends ComponentOption
50+ ? T
51+ : T extends ChartComponentType < infer P >
52+ ? P
53+ : never ;
5354
54- interface ChartComponentType < T extends ComponentOption > {
55- < U extends readonly ChartComponentType < any > [ ] = [ ] > (
55+ interface ChartComponentType < in T extends ComponentOption = any > {
56+ < U extends readonly ChartComponentType [ ] = [ ] > (
5657 props : ChartBaseProps < U > &
5758 echarts . EChartsCoreOption &
58- Simplify < ComposeOption < T | InferChartComponentOption < U > > > & { ref ?: React . Ref < echarts . ECharts > }
59+ Simplify < ComposeOption < ResolveComposeOption < T | U [ number ] > > > & {
60+ ref ?: React . Ref < echarts . ECharts > ;
61+ }
5962 ) : React . JSX . Element ;
6063
6164 ext : EChartExt ;
0 commit comments