flow-api-translator 0.37.0 → 0.327.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/TSDefToFlowDef.js +35 -279
- package/dist/TSDefToFlowDef.js.flow +16 -4
- package/dist/flowDefToTSDef.js +51 -377
- package/dist/flowDefToTSDef.js.flow +93 -12
- package/dist/flowImportTo.js +5 -16
- package/dist/flowImportTo.js.flow +3 -3
- package/dist/flowToFlowDef.js +134 -359
- package/dist/flowToFlowDef.js.flow +18 -12
- package/dist/flowToJS.js +3 -10
- package/dist/flowToJS.js.flow +5 -5
- package/dist/index.js +12 -28
- package/dist/index.js.flow +1 -1
- package/dist/src/TSDefToFlowDef.js +35 -279
- package/dist/src/flowDefToTSDef.js +51 -377
- package/dist/src/flowImportTo.js +5 -16
- package/dist/src/flowToFlowDef.js +134 -359
- package/dist/src/flowToJS.js +3 -10
- package/dist/src/index.js +12 -28
- package/dist/src/utils/DocblockUtils.js +4 -4
- package/dist/src/utils/ErrorUtils.js +3 -18
- package/dist/src/utils/FlowAnalyze.js +5 -16
- package/dist/src/utils/TSNodeUtils.js +28 -13
- package/dist/src/utils/TranslationUtils.js +0 -4
- package/dist/utils/DocblockUtils.js +4 -4
- package/dist/utils/DocblockUtils.js.flow +1 -1
- package/dist/utils/ErrorUtils.js +3 -18
- package/dist/utils/ErrorUtils.js.flow +3 -3
- package/dist/utils/FlowAnalyze.js +5 -16
- package/dist/utils/FlowAnalyze.js.flow +3 -3
- package/dist/utils/TSNodeUtils.js +28 -13
- package/dist/utils/TSNodeUtils.js.flow +35 -1
- package/dist/utils/TranslationUtils.js +0 -4
- package/dist/utils/TranslationUtils.js.flow +2 -2
- package/package.json +9 -9
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
import type {ObjectWithLoc} from '
|
|
13
|
+
import type {ObjectWithLoc} from 'flow-estree';
|
|
14
14
|
import type {TranslationOptions} from './utils/TranslationUtils';
|
|
15
15
|
|
|
16
|
-
import * as FlowESTree from '
|
|
16
|
+
import * as FlowESTree from 'flow-estree';
|
|
17
17
|
import * as TSESTree from './utils/ts-estree-ast-types';
|
|
18
|
-
import {makeCommentOwnLine as makeCommentOwnLineOriginal} from '
|
|
18
|
+
import {makeCommentOwnLine as makeCommentOwnLineOriginal} from 'flow-transform';
|
|
19
19
|
import {
|
|
20
20
|
buildCodeFrame,
|
|
21
21
|
translationError as translationErrorBase,
|
|
@@ -546,6 +546,7 @@ const getTransforms = (originalCode: string, opts: TranslationOptions) => {
|
|
|
546
546
|
},
|
|
547
547
|
optional: false,
|
|
548
548
|
},
|
|
549
|
+
implicitDeclare: false,
|
|
549
550
|
predicate: null,
|
|
550
551
|
});
|
|
551
552
|
}
|
|
@@ -873,6 +874,7 @@ const getTransforms = (originalCode: string, opts: TranslationOptions) => {
|
|
|
873
874
|
},
|
|
874
875
|
optional: false,
|
|
875
876
|
},
|
|
877
|
+
implicitDeclare: false,
|
|
876
878
|
predicate: null,
|
|
877
879
|
});
|
|
878
880
|
}
|
|
@@ -1325,8 +1327,11 @@ const getTransforms = (originalCode: string, opts: TranslationOptions) => {
|
|
|
1325
1327
|
}
|
|
1326
1328
|
return constructFlowNode<FlowESTree.DeclareNamespace>({
|
|
1327
1329
|
type: 'DeclareNamespace',
|
|
1330
|
+
global: false,
|
|
1328
1331
|
id: Transform.Identifier(node.id),
|
|
1329
1332
|
body,
|
|
1333
|
+
implicitDeclare: false,
|
|
1334
|
+
keyword: 'namespace',
|
|
1330
1335
|
});
|
|
1331
1336
|
}
|
|
1332
1337
|
|
|
@@ -2048,8 +2053,15 @@ const getTransforms = (originalCode: string, opts: TranslationOptions) => {
|
|
|
2048
2053
|
}
|
|
2049
2054
|
return constructFlowNode<FlowESTree.DeclareVariable>({
|
|
2050
2055
|
type: 'DeclareVariable',
|
|
2051
|
-
|
|
2056
|
+
declarations: [
|
|
2057
|
+
constructFlowNode<FlowESTree.VariableDeclarator>({
|
|
2058
|
+
type: 'VariableDeclarator',
|
|
2059
|
+
id,
|
|
2060
|
+
init: null,
|
|
2061
|
+
}),
|
|
2062
|
+
],
|
|
2052
2063
|
kind: node.kind,
|
|
2064
|
+
implicitDeclare: false,
|
|
2053
2065
|
});
|
|
2054
2066
|
});
|
|
2055
2067
|
}
|