flow-api-translator 0.23.1 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/flowDefToTSDef.js +12 -35
- package/dist/flowDefToTSDef.js.flow +12 -41
- package/package.json +5 -5
package/dist/flowDefToTSDef.js
CHANGED
|
@@ -2596,51 +2596,28 @@ const getTransforms = (originalCode, scopeManager, opts) => {
|
|
|
2596
2596
|
}
|
|
2597
2597
|
};
|
|
2598
2598
|
}
|
|
2599
|
-
// React.
|
|
2600
|
-
// React$
|
|
2599
|
+
// React.RefSetter<C> -> React.Ref<C>
|
|
2600
|
+
// React$RefSetter<C> -> React.Ref<C>
|
|
2601
2601
|
|
|
2602
|
-
case 'React.
|
|
2603
|
-
case 'React$
|
|
2602
|
+
case 'React.RefSetter':
|
|
2603
|
+
case 'React$RefSetter':
|
|
2604
2604
|
return {
|
|
2605
2605
|
type: 'TSTypeReference',
|
|
2606
2606
|
loc: DUMMY_LOC,
|
|
2607
2607
|
typeName: {
|
|
2608
|
-
type: '
|
|
2608
|
+
type: 'TSQualifiedName',
|
|
2609
2609
|
loc: DUMMY_LOC,
|
|
2610
|
-
|
|
2610
|
+
left: getReactIdentifier(hasReactImport),
|
|
2611
|
+
right: {
|
|
2612
|
+
type: 'Identifier',
|
|
2613
|
+
loc: DUMMY_LOC,
|
|
2614
|
+
name: 'Ref'
|
|
2615
|
+
}
|
|
2611
2616
|
},
|
|
2612
2617
|
typeParameters: {
|
|
2613
2618
|
type: 'TSTypeParameterInstantiation',
|
|
2614
2619
|
loc: DUMMY_LOC,
|
|
2615
|
-
params:
|
|
2616
|
-
type: 'TSUnionType',
|
|
2617
|
-
loc: DUMMY_LOC,
|
|
2618
|
-
types: [{
|
|
2619
|
-
type: 'TSTypeReference',
|
|
2620
|
-
loc: DUMMY_LOC,
|
|
2621
|
-
typeName: {
|
|
2622
|
-
type: 'TSQualifiedName',
|
|
2623
|
-
loc: DUMMY_LOC,
|
|
2624
|
-
left: getReactIdentifier(hasReactImport),
|
|
2625
|
-
right: {
|
|
2626
|
-
type: 'Identifier',
|
|
2627
|
-
loc: DUMMY_LOC,
|
|
2628
|
-
name: 'Ref'
|
|
2629
|
-
}
|
|
2630
|
-
},
|
|
2631
|
-
typeParameters: {
|
|
2632
|
-
type: 'TSTypeParameterInstantiation',
|
|
2633
|
-
loc: DUMMY_LOC,
|
|
2634
|
-
params: assertHasExactlyNTypeParameters(1)
|
|
2635
|
-
}
|
|
2636
|
-
}, {
|
|
2637
|
-
type: 'TSStringKeyword',
|
|
2638
|
-
loc: DUMMY_LOC
|
|
2639
|
-
}, {
|
|
2640
|
-
type: 'TSNumberKeyword',
|
|
2641
|
-
loc: DUMMY_LOC
|
|
2642
|
-
}]
|
|
2643
|
-
}]
|
|
2620
|
+
params: assertHasExactlyNTypeParameters(1)
|
|
2644
2621
|
}
|
|
2645
2622
|
};
|
|
2646
2623
|
|
|
@@ -2792,56 +2792,27 @@ const getTransforms = (
|
|
|
2792
2792
|
},
|
|
2793
2793
|
};
|
|
2794
2794
|
}
|
|
2795
|
-
// React.
|
|
2796
|
-
// React$
|
|
2797
|
-
case 'React.
|
|
2798
|
-
case 'React$
|
|
2795
|
+
// React.RefSetter<C> -> React.Ref<C>
|
|
2796
|
+
// React$RefSetter<C> -> React.Ref<C>
|
|
2797
|
+
case 'React.RefSetter':
|
|
2798
|
+
case 'React$RefSetter':
|
|
2799
2799
|
return {
|
|
2800
2800
|
type: 'TSTypeReference',
|
|
2801
2801
|
loc: DUMMY_LOC,
|
|
2802
2802
|
typeName: {
|
|
2803
|
-
type: '
|
|
2803
|
+
type: 'TSQualifiedName',
|
|
2804
2804
|
loc: DUMMY_LOC,
|
|
2805
|
-
|
|
2805
|
+
left: getReactIdentifier(hasReactImport),
|
|
2806
|
+
right: {
|
|
2807
|
+
type: 'Identifier',
|
|
2808
|
+
loc: DUMMY_LOC,
|
|
2809
|
+
name: 'Ref',
|
|
2810
|
+
},
|
|
2806
2811
|
},
|
|
2807
2812
|
typeParameters: {
|
|
2808
2813
|
type: 'TSTypeParameterInstantiation',
|
|
2809
2814
|
loc: DUMMY_LOC,
|
|
2810
|
-
params:
|
|
2811
|
-
{
|
|
2812
|
-
type: 'TSUnionType',
|
|
2813
|
-
loc: DUMMY_LOC,
|
|
2814
|
-
types: [
|
|
2815
|
-
{
|
|
2816
|
-
type: 'TSTypeReference',
|
|
2817
|
-
loc: DUMMY_LOC,
|
|
2818
|
-
typeName: {
|
|
2819
|
-
type: 'TSQualifiedName',
|
|
2820
|
-
loc: DUMMY_LOC,
|
|
2821
|
-
left: getReactIdentifier(hasReactImport),
|
|
2822
|
-
right: {
|
|
2823
|
-
type: 'Identifier',
|
|
2824
|
-
loc: DUMMY_LOC,
|
|
2825
|
-
name: 'Ref',
|
|
2826
|
-
},
|
|
2827
|
-
},
|
|
2828
|
-
typeParameters: {
|
|
2829
|
-
type: 'TSTypeParameterInstantiation',
|
|
2830
|
-
loc: DUMMY_LOC,
|
|
2831
|
-
params: assertHasExactlyNTypeParameters(1),
|
|
2832
|
-
},
|
|
2833
|
-
},
|
|
2834
|
-
{
|
|
2835
|
-
type: 'TSStringKeyword',
|
|
2836
|
-
loc: DUMMY_LOC,
|
|
2837
|
-
},
|
|
2838
|
-
{
|
|
2839
|
-
type: 'TSNumberKeyword',
|
|
2840
|
-
loc: DUMMY_LOC,
|
|
2841
|
-
},
|
|
2842
|
-
],
|
|
2843
|
-
},
|
|
2844
|
-
],
|
|
2815
|
+
params: assertHasExactlyNTypeParameters(1),
|
|
2845
2816
|
},
|
|
2846
2817
|
};
|
|
2847
2818
|
default:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flow-api-translator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "Toolkit for creating Flow and TypeScript compatible libraries from Flow source code.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"@typescript-eslint/parser": "7.2.0",
|
|
14
14
|
"@typescript-eslint/visitor-keys": "7.2.0",
|
|
15
15
|
"flow-enums-runtime": "^0.0.6",
|
|
16
|
-
"hermes-eslint": "0.
|
|
17
|
-
"hermes-estree": "0.
|
|
18
|
-
"hermes-parser": "0.
|
|
19
|
-
"hermes-transform": "0.
|
|
16
|
+
"hermes-eslint": "0.25.0",
|
|
17
|
+
"hermes-estree": "0.25.0",
|
|
18
|
+
"hermes-parser": "0.25.0",
|
|
19
|
+
"hermes-transform": "0.25.0",
|
|
20
20
|
"typescript": "5.3.2"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|