- def map_function(self, argument_types, c_call_string, is_free, method_name, return_type_info, struct_meth, default_constructor_args, takes_self, args_known, has_out_java_struct: bool, type_mapping_generator):
+ def map_tuple(self, struct_name):
+ return self.map_opaque_struct(struct_name, "A Tuple")
+
+ def fn_call_body(self, method_name, return_c_ty, return_java_ty, method_argument_string, native_call_argument_string):
+ has_return_value = return_c_ty != 'void'
+ needs_decoding = return_c_ty in self.wasm_decoding_map
+ return_statement = 'return nativeResponseValue;'
+ if not has_return_value:
+ return_statement = '// debug statements here'
+ elif needs_decoding:
+ converter = self.wasm_decoding_map[return_c_ty]
+ return_statement = f"return {converter}(nativeResponseValue);"
+
+ return f"""\texport function {method_name}({method_argument_string}): {return_java_ty} {{
+ if(!isWasmInitialized) {{
+ throw new Error("initializeWasm() must be awaited first!");
+ }}
+ const nativeResponseValue = wasm.TS_{method_name}({native_call_argument_string});
+ {return_statement}
+ }}
+"""
+ def map_function(self, argument_types, c_call_string, method_name, meth_n, return_type_info, struct_meth, default_constructor_args, takes_self, takes_self_as_ref, args_known, type_mapping_generator, doc_comment):