Update auto-generated TypeScript Bindings
[ldk-java] / ts / structs / Option_FilterZ.mts
index 31c42608abe3fae8d16f62cfa358669a486ba8ef..51cd2b5c651fbb75b912902eb1a5993d552c0c8b 100644 (file)
@@ -279,20 +279,18 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor
 
 import CommonBase from './CommonBase.mjs';
 import * as bindings from '../bindings.mjs'
-import * as InternalUtils from '../InternalUtils.mjs'
 
 export class Option_FilterZ extends CommonBase {
        protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_FilterZ_free); }
        /* @internal */
        public static constr_from_ptr(ptr: number): Option_FilterZ {
-               const raw_val: bindings.LDKCOption_FilterZ = bindings.LDKCOption_FilterZ_ref_from_ptr(ptr);
-               if (raw_val instanceof bindings.LDKCOption_FilterZ_Some) {
-                       return new Option_FilterZ_Some(ptr, raw_val);
+               const raw_ty: number = bindings.LDKCOption_FilterZ_ty_from_ptr(ptr);
+               switch (raw_ty) {
+                       case 0: return new Option_FilterZ_Some(ptr);
+                       case 1: return new Option_FilterZ_None(ptr);
+                       default:
+                               throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
                }
-               if (raw_val instanceof bindings.LDKCOption_FilterZ_None) {
-                       return new Option_FilterZ_None(ptr, raw_val);
-               }
-               throw new Error('oops, this should be unreachable'); // Unreachable without extending the (internal) bindings interface
        }
 
        public static constructor_some(o: Filter): Option_FilterZ {
@@ -314,9 +312,9 @@ export class Option_FilterZ extends CommonBase {
 export class Option_FilterZ_Some extends Option_FilterZ {
        public some: Filter;
        /* @internal */
-       public constructor(ptr: number, obj: bindings.LDKCOption_FilterZ_Some) {
+       public constructor(ptr: number) {
                super(null, ptr);
-               const some: number = obj.some;
+               const some: number = bindings.LDKCOption_FilterZ_Some_get_some(ptr);
                const ret_hu_conv: Filter = new Filter(null, some);
                        CommonBase.add_ref_from(ret_hu_conv, this);
                this.some = ret_hu_conv;
@@ -324,7 +322,7 @@ export class Option_FilterZ_Some extends Option_FilterZ {
 }
 export class Option_FilterZ_None extends Option_FilterZ {
        /* @internal */
-       public constructor(ptr: number, obj: bindings.LDKCOption_FilterZ_None) {
+       public constructor(ptr: number) {
                super(null, ptr);
        }
 }