]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/Option_u64Z.ts
Update auto-generate bindings (incl new RL clone methods)
[ldk-java] / ts / structs / Option_u64Z.ts
1
2 import CommonBase from './CommonBase';
3 import * as bindings from '../bindings' // TODO: figure out location
4
5 export default class COption_u64Z extends CommonBase {
6         protected constructor(_dummy: object, ptr: number) { super(ptr); }
7         protected finalize() {
8                 super.finalize();
9                 if (this.ptr != 0) { bindings.COption_u64Z_free(this.ptr); }
10         }
11         static constr_from_ptr(ptr: number): COption_u64Z {
12                 const raw_val: bindings.LDKCOption_u64Z = bindings.LDKCOption_u64Z_ref_from_ptr(ptr);
13                 if (raw_val instanceof bindings.LDKCOption_u64Z.Some) {
14                         return new Some(this.ptr, raw_val);
15                 }
16                 if (raw_val instanceof bindings.LDKCOption_u64Z.None) {
17                         return new None(this.ptr, raw_val);
18                 }
19                 throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
20         }
21
22 }
23 export class Some extends COption_u64Z {
24         public some: number;
25         private constructor(ptr: number, obj: bindings.LDKCOption_u64Z.Some) {
26                 super(null, ptr);
27                 this.some = obj.some;
28         }
29 }
30 export class None extends COption_u64Z {
31         private constructor(ptr: number, obj: bindings.LDKCOption_u64Z.None) {
32                 super(null, ptr);
33         }
34 }
35         public static Option_u64Z constructor_some(number o) {
36                 number ret = bindings.COption_u64Z_some(o);
37                 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
38                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
39                 return ret_hu_conv;
40         }
41
42         public static Option_u64Z constructor_none() {
43                 number ret = bindings.COption_u64Z_none();
44                 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
45                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
46                 return ret_hu_conv;
47         }
48
49         public Option_u64Z clone() {
50                 number ret = bindings.COption_u64Z_clone(this.ptr);
51                 Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
52                 ret_hu_conv.ptrs_to.add(this);
53                 return ret_hu_conv;
54         }
55
56 }