if (ts.isFunctionTypeNode(typeNode)) { let argument: Schemify.TypeAnnotation; this.checker .getSignaturesOfType(type, ts.SignatureKind.Call) /** * At this moment, react-native doesn't support more than one argument * (Event) passed back from the native side, however the implementation * I wrote was designed to support multiple parameters (just in case). * * That said, I assume the "getParameters" to always return an array * of one element (unless the schema in react-native is changed). * Otherwise, the latter one will override the first one */ .forEach(signature => { signature.getParameters().forEach(parameter => { const paramType = this.checker.getTypeOfSymbolAtLocation( parameter, this.sourceFile ); let type: ts.Type; (paramType).typeArguments.forEach((typeArgument: ts.Type) => { typeArgument.getSymbol().members.forEach((member: ts.Symbol) => { type = this.checker.getTypeOfSymbolAtLocation( member, member.valueDeclaration ); }); }); argument = this.getTypeAnnotation(type); }); }); return { type: 'FunctionTypeAnnotation', argument, }; }