3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class UserConfig extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.UserConfig_free(this.ptr);
21 public ChannelHandshakeConfig get_own_channel_config() {
22 number ret = bindings.UserConfig_get_own_channel_config(this.ptr);
23 const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret);
24 ret_hu_conv.ptrs_to.add(this);
28 public void set_own_channel_config(ChannelHandshakeConfig val) {
29 bindings.UserConfig_set_own_channel_config(this.ptr, val == null ? 0 : val.ptr & ~1);
32 public ChannelHandshakeLimits get_peer_channel_config_limits() {
33 number ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr);
34 const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret);
35 ret_hu_conv.ptrs_to.add(this);
39 public void set_peer_channel_config_limits(ChannelHandshakeLimits val) {
40 bindings.UserConfig_set_peer_channel_config_limits(this.ptr, val == null ? 0 : val.ptr & ~1);
43 public ChannelConfig get_channel_options() {
44 number ret = bindings.UserConfig_get_channel_options(this.ptr);
45 const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret);
46 ret_hu_conv.ptrs_to.add(this);
50 public void set_channel_options(ChannelConfig val) {
51 bindings.UserConfig_set_channel_options(this.ptr, val == null ? 0 : val.ptr & ~1);
54 public boolean get_accept_forwards_to_priv_channels() {
55 boolean ret = bindings.UserConfig_get_accept_forwards_to_priv_channels(this.ptr);
59 public void set_accept_forwards_to_priv_channels(boolean val) {
60 bindings.UserConfig_set_accept_forwards_to_priv_channels(this.ptr, val);
63 public static UserConfig constructor_new(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg, boolean accept_forwards_to_priv_channels_arg) {
64 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, accept_forwards_to_priv_channels_arg);
65 const ret_hu_conv: UserConfig = new UserConfig(null, ret);
66 ret_hu_conv.ptrs_to.add(ret_hu_conv);
70 public UserConfig clone() {
71 number ret = bindings.UserConfig_clone(this.ptr);
72 const ret_hu_conv: UserConfig = new UserConfig(null, ret);
73 ret_hu_conv.ptrs_to.add(this);
77 public static UserConfig constructor_default() {
78 number ret = bindings.UserConfig_default();
79 const ret_hu_conv: UserConfig = new UserConfig(null, ret);
80 ret_hu_conv.ptrs_to.add(ret_hu_conv);