X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FUserConfig.ts;h=44c586570cb8ce2b8467e66e907cef35f1b8f88c;hb=22f5f4208b1f3b5542292250f1612b944f5cd7fd;hp=7a3d87e5c3fbc8ebfb1e1314a54c20baeb76aa68;hpb=56e9910ffaa7fccf2cb777dc9cf55e01a9681543;p=ldk-java diff --git a/ts/structs/UserConfig.ts b/ts/structs/UserConfig.ts index 7a3d87e5..44c58657 100644 --- a/ts/structs/UserConfig.ts +++ b/ts/structs/UserConfig.ts @@ -1,24 +1,32 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class UserConfig extends CommonBase { - UserConfig(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.UserConfig_free(ptr); } - } + + export default class UserConfig extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.UserConfig_free(this.ptr); + } + } public UserConfig clone() { - uint32_t ret = bindings.UserConfig_clone(this.ptr); - UserConfig ret_hu_conv = new UserConfig(null, ret); + number ret = bindings.UserConfig_clone(this.ptr); + const ret_hu_conv: UserConfig = new UserConfig(null, ret); return ret_hu_conv; } public ChannelHandshakeConfig get_own_channel_config() { - uint32_t ret = bindings.UserConfig_get_own_channel_config(this.ptr); - ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); + number ret = bindings.UserConfig_get_own_channel_config(this.ptr); + const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); return ret_hu_conv; } @@ -28,8 +36,8 @@ public class UserConfig extends CommonBase { } public ChannelHandshakeLimits get_peer_channel_config_limits() { - uint32_t ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr); - ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret); + number ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr); + const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret); return ret_hu_conv; } @@ -39,8 +47,8 @@ public class UserConfig extends CommonBase { } public ChannelConfig get_channel_options() { - uint32_t ret = bindings.UserConfig_get_channel_options(this.ptr); - ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + number ret = bindings.UserConfig_get_channel_options(this.ptr); + const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret); return ret_hu_conv; } @@ -50,8 +58,8 @@ public class UserConfig extends CommonBase { } public static UserConfig constructor_new(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg) { - uint32_t ret = bindings.UserConfig_new(own_channel_config_arg == null ? 0 : own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg == null ? 0 : peer_channel_config_limits_arg.ptr & ~1, channel_options_arg == null ? 0 : channel_options_arg.ptr & ~1); - UserConfig ret_hu_conv = new UserConfig(null, ret); + number ret = bindings.UserConfig_new(own_channel_config_arg == null ? 0 : own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg == null ? 0 : peer_channel_config_limits_arg.ptr & ~1, channel_options_arg == null ? 0 : channel_options_arg.ptr & ~1); + const ret_hu_conv: UserConfig = new UserConfig(null, ret); ret_hu_conv.ptrs_to.add(own_channel_config_arg); ret_hu_conv.ptrs_to.add(peer_channel_config_limits_arg); ret_hu_conv.ptrs_to.add(channel_options_arg); @@ -59,8 +67,8 @@ public class UserConfig extends CommonBase { } public static UserConfig constructor_default() { - uint32_t ret = bindings.UserConfig_default(); - UserConfig ret_hu_conv = new UserConfig(null, ret); + number ret = bindings.UserConfig_default(); + const ret_hu_conv: UserConfig = new UserConfig(null, ret); return ret_hu_conv; }