[TS] Properly export unitary enums such that they're in *.d.mjs
[ldk-java] / typescript_strings.py
index 1e6b1e80cc8412381ce3554fb558e589cba05eec..5ae728f9866a8871cf537c7792d9768262568645 100644 (file)
@@ -107,7 +107,7 @@ async function finishInitializeWasm(wasmInstance: WebAssembly.Instance) {
        }
 
        if (decodeString(wasm.TS_get_lib_version_string()) !== version.get_ldk_java_bindings_version())
-               throw new Error(\"Compiled LDK library and LDK class failes do not match\");
+               throw new Error(\"Compiled LDK library and LDK class files do not match\");
        // Fetching the LDK versions from C also checks that the header and binaries match
        const c_bindings_ver: number = wasm.TS_get_ldk_c_bindings_version();
        const ldk_ver: number = wasm.TS_get_ldk_version();
@@ -779,8 +779,12 @@ import * as bindings from '../bindings.mjs'
         out_c = out_c + "\t}\n"
         out_c = out_c + "}\n"
 
+        # Note that this is *not* marked /* @internal */ as we re-expose it directly in enums/
+        enum_comment_formatted = enum_doc_comment.replace("\n", "\n * ")
         out_typescript = f"""
-/* @internal */
+/**
+ * {enum_comment_formatted}
+ */
 export enum {struct_name} {{
        {out_typescript_enum_fields}
 }}