Skip to content
This repository was archived by the owner on Jan 14, 2019. It is now read-only.

Commit 25a30d5

Browse files
committed
Add few more types
1 parent 6c119fb commit 25a30d5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/convert.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
112112

113113
/**
114114
* Converts a ts.Node's typeArguments ts.NodeArray to a flow-like typeParameters node
115-
* @param {ts.NodeArray} typeArguments ts.Node typeArguments
115+
* @param {ts.NodeArray<any>} typeArguments ts.Node typeArguments
116116
* @returns {ESTreeNode} TypeParameterInstantiation node
117117
*/
118118
function convertTypeArgumentsToTypeParameters(
@@ -239,10 +239,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
239239
/**
240240
* Converts a child into a class implements node. This creates an intermediary
241241
* ClassImplements node to match what Flow does.
242-
* @param {ts.Node} child The TypeScript AST node to convert.
242+
* @param {ts.ExpressionWithTypeArguments} child The TypeScript AST node to convert.
243243
* @returns {ESTreeNode} The type annotation node.
244244
*/
245-
function convertClassImplements(child: any): ESTreeNode {
245+
function convertClassImplements(child: ts.ExpressionWithTypeArguments): ESTreeNode {
246246
const id = convertChild(child.expression) as ESTreeNode;
247247
const classImplementsNode: ESTreeNode = {
248248
type: AST_NODE_TYPES.ClassImplements,
@@ -260,10 +260,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
260260

261261
/**
262262
* Converts a child into a interface heritage node.
263-
* @param {ts.Node} child The TypeScript AST node to convert.
263+
* @param {ts.ExpressionWithTypeArguments} child The TypeScript AST node to convert.
264264
* @returns {ESTreeNode} The type annotation node.
265265
*/
266-
function convertInterfaceHeritageClause(child: any): ESTreeNode {
266+
function convertInterfaceHeritageClause(child: ts.ExpressionWithTypeArguments): ESTreeNode {
267267
const id = convertChild(child.expression) as ESTreeNode;
268268
const classImplementsNode: ESTreeNode = {
269269
type: AST_NODE_TYPES.TSInterfaceHeritage,
@@ -332,7 +332,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
332332
const customType = `TS${SyntaxKind[node.kind]}`;
333333
/**
334334
* If the "errorOnUnknownASTType" option is set to true, throw an error,
335-
* otherwise fallback to just inlcuding the unknown type as-is.
335+
* otherwise fallback to just including the unknown type as-is.
336336
*/
337337
if (
338338
additionalOptions.errorOnUnknownASTType &&
@@ -387,10 +387,10 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
387387

388388
/**
389389
* Converts a TypeScript JSX node.tagName into an ESTree node.name
390-
* @param {Object} tagName the tagName object from a JSX ts.Node
390+
* @param {ts.JsxTagNameExpression} tagName the tagName object from a JSX ts.Node
391391
* @returns {Object} the converted ESTree name object
392392
*/
393-
function convertTypeScriptJSXTagNameToESTreeName(tagName: any): any {
393+
function convertTypeScriptJSXTagNameToESTreeName(tagName: ts.JsxTagNameExpression): ESTreeNode {
394394
const tagNameToken = nodeUtils.convertToken(tagName, ast);
395395

396396
if (tagNameToken.type === AST_NODE_TYPES.JSXMemberExpression) {
@@ -423,7 +423,7 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
423423

424424
/**
425425
* Applies the given TS modifiers to the given result object.
426-
* @param {ts.Node[]} modifiers original ts.Nodes from the node.modifiers array
426+
* @param {ts.ModifiersArray} modifiers original ts.Nodes from the node.modifiers array
427427
* @returns {void} (the current result object will be mutated)
428428
*/
429429
function applyModifiersToResult(modifiers?: ts.ModifiersArray): void {

0 commit comments

Comments
 (0)