File tree Expand file tree Collapse file tree 5 files changed +72
-1
lines changed Expand file tree Collapse file tree 5 files changed +72
-1
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "releases" : [{ "name" : " extract-react-types" , "type" : " minor" }],
3+ "dependents" : [
4+ {
5+ "name" : " babel-plugin-extract-react-types" ,
6+ "type" : " patch" ,
7+ "dependencies" : [" extract-react-types" ]
8+ },
9+ {
10+ "name" : " pretty-proptypes" ,
11+ "type" : " patch" ,
12+ "dependencies" : [" kind2string" , " extract-react-types" ]
13+ },
14+ {
15+ "name" : " extract-react-types-loader" ,
16+ "type" : " patch" ,
17+ "dependencies" : [" extract-react-types" ]
18+ },
19+ { "name" : " kind2string" , "type" : " patch" , "dependencies" : [" extract-react-types" ] }
20+ ]
21+ }
Original file line number Diff line number Diff line change 1+ Implement stub for TSConditionalType
Original file line number Diff line number Diff line change @@ -3955,6 +3955,39 @@ Object {
39553955}
39563956` ;
39573957
3958+ exports [` ts custom prop 2` ] = `
3959+ Object {
3960+ " component" : Object {
3961+ " key" : Object {
3962+ " kind" : " any" ,
3963+ },
3964+ " kind" : " generic" ,
3965+ " name" : Object {
3966+ " kind" : " id" ,
3967+ " name" : " Component" ,
3968+ " type" : null ,
3969+ },
3970+ " typeParams" : Object {
3971+ " kind" : " typeParams" ,
3972+ " params" : Array [
3973+ Object {
3974+ " kind" : " string" ,
3975+ },
3976+ Object {
3977+ " kind" : " object" ,
3978+ " members" : Array [],
3979+ },
3980+ ],
3981+ },
3982+ " value" : Object {
3983+ " kind" : " any" ,
3984+ " referenceIdName" : " Foo" ,
3985+ },
3986+ },
3987+ " kind" : " program" ,
3988+ }
3989+ ` ;
3990+
39583991exports [` ts decorators 1` ] = `
39593992Object {
39603993 " component" : Object {
Original file line number Diff line number Diff line change @@ -1396,6 +1396,12 @@ converters.ImportSpecifier = (path, context): K.Import => {
13961396 return importConverterGeneral ( path , context ) ;
13971397} ;
13981398
1399+ converters . TSConditionalType = ( ) : K . Any => {
1400+ return {
1401+ kind : 'any'
1402+ } ;
1403+ } ;
1404+
13991405function convertMethodCall ( path , context ) : K . Func {
14001406 const parameters = path . get ( 'parameters' ) . map ( p => convertParameter ( p , context ) ) ;
14011407 const returnType = convert ( path . get ( 'typeAnnotation' ) , context ) ;
Original file line number Diff line number Diff line change @@ -1609,7 +1609,17 @@ const TESTS = [
16091609 }
16101610 }
16111611 `
1612- }
1612+ } ,
1613+ {
1614+ name : 'ts custom prop' ,
1615+ typeSystem : 'typescript' ,
1616+ code : `
1617+ type Foo<T, U> = T extends object ? T : U;
1618+
1619+ class Component extends React.Component<Foo<string, {}>> {
1620+ }
1621+ `
1622+ } ,
16131623] ;
16141624
16151625cases (
You can’t perform that action at this time.
0 commit comments