[TS] Update auto-generated TypeScript Bindings
[ldk-java] / ts / structs / Type.mts
index 97ee7c2e99448b44b96fb98b45333462503c79df..5c59cfb3900330c0e43280d6e27ce8a39aba5bff 100644 (file)
@@ -280,13 +280,19 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor
 
 import CommonBase from './CommonBase.mjs';
 import * as bindings from '../bindings.mjs'
-import * as InternalUtils from '../InternalUtils.mjs'
 
 
 
+/** An implementation of Type */
 export interface TypeInterface {
+       /**Returns the type identifying the message payload.
+        */
        type_id(): number;
-       debug_str(): String;
+       /**Return a human-readable "debug" string describing this object
+        */
+       debug_str(): string;
+       /**Serialize the object into a byte array
+        */
        write(): Uint8Array;
 }
 
@@ -294,6 +300,11 @@ class LDKTypeHolder {
        held: Type;
 }
 
+/**
+ * Defines a type identifier for sending messages over the wire.
+ * 
+ * Messages implementing this trait specify a type and must be [`Writeable`].
+ */
 export class Type extends CommonBase {
        /* @internal */
        public bindings_instance?: bindings.LDKType;
@@ -304,20 +315,23 @@ export class Type extends CommonBase {
                this.bindings_instance = null;
        }
 
-       static new_impl(arg: TypeInterface): Type {
+       /** Creates a new instance of Type from a given implementation */
+       public static new_impl(arg: TypeInterface): Type {
                const impl_holder: LDKTypeHolder = new LDKTypeHolder();
                let structImplementation = {
                        type_id (): number {
                                const ret: number = arg.type_id();
                                return ret;
                        },
-                       debug_str (): String {
-                               const ret: String = arg.debug_str();
-                               return ret;
+                       debug_str (): number {
+                               const ret: string = arg.debug_str();
+                               const result: number = bindings.encodeString(ret);
+                               return result;
                        },
-                       write (): Uint8Array {
+                       write (): number {
                                const ret: Uint8Array = arg.write();
-                               return ret;
+                               const result: number = bindings.encodeUint8Array(ret);
+                               return result;
                        },
                } as bindings.LDKType;
                const ptr: number = bindings.LDKType_new(structImplementation);
@@ -326,19 +340,31 @@ export class Type extends CommonBase {
                impl_holder.held.bindings_instance = structImplementation;
                return impl_holder.held;
        }
+
+       /**
+        * Returns the type identifying the message payload.
+        */
        public type_id(): number {
                const ret: number = bindings.Type_type_id(this.ptr);
                return ret;
        }
 
-       public debug_str(): String {
-               const ret: String = bindings.Type_debug_str(this.ptr);
-               return ret;
+       /**
+        * Return a human-readable "debug" string describing this object
+        */
+       public debug_str(): string {
+               const ret: number = bindings.Type_debug_str(this.ptr);
+               const ret_conv: string = bindings.decodeString(ret);
+               return ret_conv;
        }
 
+       /**
+        * Serialize the object into a byte array
+        */
        public write(): Uint8Array {
-               const ret: Uint8Array = bindings.Type_write(this.ptr);
-               return ret;
+               const ret: number = bindings.Type_write(this.ptr);
+               const ret_conv: Uint8Array = bindings.decodeUint8Array(ret);
+               return ret_conv;
        }
 
        public clone_ptr(): number {
@@ -346,6 +372,9 @@ export class Type extends CommonBase {
                return ret;
        }
 
+       /**
+        * Creates a copy of a Type
+        */
        public clone(): Type {
                const ret: number = bindings.Type_clone(this.ptr);
                const ret_hu_conv: Type = new Type(null, ret);