1 module libwasm.bindings.IntlUtils; 2 3 import libwasm.types; 4 5 import memutils.ct: tuple; 6 @safe: 7 nothrow: 8 9 struct DisplayNameOptions { 10 nothrow: 11 JsHandle handle; 12 alias handle this; 13 this(Handle h) { 14 this.handle = JsHandle(h); 15 } 16 static auto create() { 17 return DisplayNameOptions(libwasm_add__object()); 18 } 19 void style()(string style) { 20 Object_Call_string__void(this.handle, "style", style); 21 } 22 string style()() { 23 return Object_Getter__string(this.handle, "style"); 24 } 25 void keys()(scope ref Sequence!(string) keys) { 26 Object_Call_Handle__void(this.handle, "keys", keys.handle); 27 } 28 auto keys()() { 29 return Sequence!(string)(Object_Getter__Handle(this.handle, "keys")); 30 } 31 } 32 struct DisplayNameResult { 33 nothrow: 34 JsHandle handle; 35 alias handle this; 36 this(Handle h) { 37 this.handle = JsHandle(h); 38 } 39 static auto create() { 40 return DisplayNameResult(libwasm_add__object()); 41 } 42 void locale()(string locale) { 43 Object_Call_string__void(this.handle, "locale", locale); 44 } 45 string locale()() { 46 return Object_Getter__string(this.handle, "locale"); 47 } 48 void style()(string style) { 49 Object_Call_string__void(this.handle, "style", style); 50 } 51 string style()() { 52 return Object_Getter__string(this.handle, "style"); 53 } 54 void values()(scope ref Record!(string, string) values) { 55 Object_Call_Handle__void(this.handle, "values", values.handle); 56 } 57 auto values()() { 58 return Record!(string, string)(Object_Getter__Handle(this.handle, "values")); 59 } 60 } 61 struct IntlUtils { 62 nothrow: 63 JsHandle handle; 64 alias handle this; 65 this(Handle h) { 66 this.handle = JsHandle(h); 67 } 68 auto getDisplayNames()(scope ref Sequence!(string) locales, scope ref DisplayNameOptions options) { 69 return DisplayNameResult(Serialize_Object_VarArgCall!Handle(this.handle, "getDisplayNames", "Handle;Handle", tuple(cast(Handle)locales.handle, cast(Handle)options.handle))); 70 } 71 auto getDisplayNames()(scope ref Sequence!(string) locales) { 72 return DisplayNameResult(Object_Call_Handle__Handle(this.handle, "getDisplayNames", locales.handle)); 73 } 74 auto getLocaleInfo()(scope ref Sequence!(string) locales) { 75 return LocaleInfo(Object_Call_Handle__Handle(this.handle, "getLocaleInfo", locales.handle)); 76 } 77 } 78 struct LocaleInfo { 79 nothrow: 80 JsHandle handle; 81 alias handle this; 82 this(Handle h) { 83 this.handle = JsHandle(h); 84 } 85 static auto create() { 86 return LocaleInfo(libwasm_add__object()); 87 } 88 void locale()(string locale) { 89 Object_Call_string__void(this.handle, "locale", locale); 90 } 91 string locale()() { 92 return Object_Getter__string(this.handle, "locale"); 93 } 94 void direction()(string direction) { 95 Object_Call_string__void(this.handle, "direction", direction); 96 } 97 string direction()() { 98 return Object_Getter__string(this.handle, "direction"); 99 } 100 } 101 102