+ def constr_hu_array(self, ty_info, arr_len):
+ return "new Array(" + arr_len + ").fill(null)"
+
+ def var_decl_statement(self, ty_string, var_name, statement):
+ return "const " + var_name + ": " + ty_string + " = " + statement
+
+ def for_n_in_range(self, n, minimum, maximum):
+ return "for (var " + n + " = " + minimum + "; " + n + " < " + maximum + "; " + n + "++) {"
+ def for_n_in_arr(self, n, arr_name, arr_elem_ty):
+ return (arr_name + ".forEach((" + n + ": " + arr_elem_ty.java_hu_ty + ") => { ", " })")
+
+ def get_ptr(self, var):
+ return "CommonBase.get_ptr_of(" + var + ")"
+ def set_null_skip_free(self, var):
+ return "CommonBase.set_null_skip_free(" + var + ");"
+
+ def add_ref(self, holder, referent):
+ return "CommonBase.add_ref_from(" + holder + ", " + referent + ")"
+
+ def obj_defined(self, struct_names, folder):
+ with open(self.outdir + "/index.mts", 'a') as index:
+ index.write(f"export * from './{folder}/{struct_names[0]}.mjs';\n")
+ with open(self.outdir + "/imports.mts.part", 'a') as imports:
+ imports.write(f"import {{ {', '.join(struct_names)} }} from '../{folder}/{struct_names[0]}.mjs';\n")
+
+ def native_c_unitary_enum_map(self, struct_name, variants, enum_doc_comment):
+ out_c = "static inline LDK" + struct_name + " LDK" + struct_name + "_from_js(int32_t ord) {\n"