X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=typescript_strings.py;h=670eb2ae73124346a41e919247f43d601e12a63f;hb=1ef2dc8b8a3e0e244ad82ac08e286df489eca4b7;hp=102d2256798cc7d3d80ccc46459c7ff7867b682e;hpb=0fcde6be16ac8c2d63bd5398d5396da5890461d7;p=ldk-java diff --git a/typescript_strings.py b/typescript_strings.py index 102d2256..670eb2ae 100644 --- a/typescript_strings.py +++ b/typescript_strings.py @@ -326,6 +326,10 @@ export class UInt5 { return this.val; } } + +export class UnqualifiedError { + public constructor(val: number) {} +} """ self.txout_defn = """export class TxOut extends CommonBase { @@ -592,7 +596,7 @@ jstring __attribute__((export_name("TS_get_ldk_version"))) get_ldk_version() { }""" self.hu_struct_file_prefix = """ -import { CommonBase, UInt5 } from './CommonBase.mjs'; +import { CommonBase, UInt5, UnqualifiedError } from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' """ @@ -722,6 +726,9 @@ import * as bindings from '../bindings.mjs' 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 fully_qualified_hu_ty_path(self, ty): + return ty.java_hu_ty + 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" out_c = out_c + "\tswitch (ord) {\n"