3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export class MessageSendEventsProvider extends CommonBase {
10 bindings_instance?: bindings.LDKMessageSendEventsProvider;
12 constructor(ptr?: number, arg?: bindings.LDKMessageSendEventsProvider) {
13 if (Number.isFinite(ptr)) {
15 this.bindings_instance = null;
17 // TODO: private constructor instantiation
18 super(bindings.LDKMessageSendEventsProvider_new(arg));
19 this.ptrs_to.push(arg);
24 protected finalize() {
26 bindings.MessageSendEventsProvider_free(this.ptr);
31 static new_impl(arg: MessageSendEventsProviderInterface): MessageSendEventsProvider {
32 const impl_holder: LDKMessageSendEventsProviderHolder = new LDKMessageSendEventsProviderHolder();
33 let structImplementation = <bindings.LDKMessageSendEventsProvider>{
34 // todo: in-line interface filling
35 get_and_clear_pending_msg_events (): number[] {
36 MessageSendEvent[] ret = arg.get_and_clear_pending_msg_events();
37 result: number[] = Arrays.stream(ret).map(ret_conv_18 -> ret_conv_18.ptr).toArray(number[]::new);
38 /* TODO 2 MessageSendEvent */;
44 impl_holder.held = new MessageSendEventsProvider (null, structImplementation);
48 export interface MessageSendEventsProviderInterface {
49 get_and_clear_pending_msg_events(): MessageSendEvent[];
53 class LDKMessageSendEventsProviderHolder {
54 held: MessageSendEventsProvider;
56 public MessageSendEvent[] get_and_clear_pending_msg_events() {
57 number[] ret = bindings.MessageSendEventsProvider_get_and_clear_pending_msg_events(this.ptr);
58 MessageSendEvent[] ret_conv_18_arr = new MessageSendEvent[ret.length];
59 for (int s = 0; s < ret.length; s++) {
60 number ret_conv_18 = ret[s];
61 MessageSendEvent ret_conv_18_hu_conv = MessageSendEvent.constr_from_ptr(ret_conv_18);
62 ret_conv_18_hu_conv.ptrs_to.add(this);
63 ret_conv_18_arr[s] = ret_conv_18_hu_conv;
65 return ret_conv_18_arr;