Merge pull request #46 from TheBlueMatt/main
[ldk-java] / typescript_strings.py
index f3a7f29adcd6fa5879a23e532aacbece19e65dbd..c097921f7d43de5ebc733be09392e1b24e19a6e4 100644 (file)
@@ -71,6 +71,8 @@ public static native long new_empty_slice_vec();
 
 """
 
+        self.bindings_version_file = ""
+
         self.bindings_footer = """
         export async function initializeWasm(allowDoubleInitialization: boolean = false): Promise<void> {
             if(isWasmInitialized && !allowDoubleInitialization) {
@@ -261,6 +263,8 @@ void __attribute__((visibility("default"))) TS_free(uint32_t ptr) {
 }
 """
 
+        self.c_version_file = ""
+
         self.hu_struct_file_prefix = f"""
 import CommonBase from './CommonBase';
 import * as bindings from '../bindings' // TODO: figure out location
@@ -935,7 +939,10 @@ const decodeString = (stringPointer, free = true) => {
 """
         return out_opaque_struct_human
 
-    def map_function(self, argument_types, c_call_string, method_name, return_type_info, struct_meth, default_constructor_args, takes_self, takes_self_as_ref, args_known, type_mapping_generator, doc_comment):
+    def map_tuple(self, struct_name):
+        return self.map_opaque_struct(struct_name, "A Tuple")
+
+    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):
         out_java = ""
         out_c = ""
         out_java_struct = None
@@ -988,7 +995,6 @@ const decodeString = (stringPointer, free = true) => {
         if not args_known:
             out_java_struct += ("\t// Skipped " + method_name + "\n")
         else:
-            meth_n = method_name[len(struct_meth) + 1:]
             if not takes_self:
                 out_java_struct += (
                         "\tpublic static " + return_type_info.java_hu_ty + " constructor_" + meth_n + "(")