[TS] Update auto-generated TypeScript Bindings
[ldk-java] / ts / structs / CustomMessageReader.mts
index 4189b3348ab736d83af6835551e25b6007a19c97..4f31381980091a1fc269978058c6c1cfec8d5ae8 100644 (file)
@@ -283,7 +283,13 @@ import * as bindings from '../bindings.mjs'
 
 
 
+/** An implementation of CustomMessageReader */
 export interface CustomMessageReaderInterface {
+       /**Decodes a custom message to `CustomMessageType`. If the given message type is known to the
+        * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
+        * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
+        * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
+        */
        read(message_type: number, buffer: Uint8Array): Result_COption_TypeZDecodeErrorZ;
 }
 
@@ -291,6 +297,10 @@ class LDKCustomMessageReaderHolder {
        held: CustomMessageReader;
 }
 
+/**
+ * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
+ * decoders.
+ */
 export class CustomMessageReader extends CommonBase {
        /* @internal */
        public bindings_instance?: bindings.LDKCustomMessageReader;
@@ -301,7 +311,8 @@ export class CustomMessageReader extends CommonBase {
                this.bindings_instance = null;
        }
 
-       static new_impl(arg: CustomMessageReaderInterface): CustomMessageReader {
+       /** Creates a new instance of CustomMessageReader from a given implementation */
+       public static new_impl(arg: CustomMessageReaderInterface): CustomMessageReader {
                const impl_holder: LDKCustomMessageReaderHolder = new LDKCustomMessageReaderHolder();
                let structImplementation = {
                        read (message_type: number, buffer: number): number {
@@ -317,6 +328,13 @@ export class CustomMessageReader extends CommonBase {
                impl_holder.held.bindings_instance = structImplementation;
                return impl_holder.held;
        }
+
+       /**
+        * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
+        * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
+        * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
+        * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
+        */
        public read(message_type: number, buffer: Uint8Array): Result_COption_TypeZDecodeErrorZ {
                const ret: number = bindings.CustomMessageReader_read(this.ptr, message_type, bindings.encodeUint8Array(buffer));
                const ret_hu_conv: Result_COption_TypeZDecodeErrorZ = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret);