1 module libwasm.bindings.NativeOSFileInternals;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 @safe:
7 nothrow:
8 
9 struct NativeOSFileReadOptions {
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 NativeOSFileReadOptions(libwasm_add__object());
18   }
19   void encoding(T0)(scope auto ref Optional!(T0) encoding) if (isTOrPointer!(T0, string)) {
20     Serialize_Object_VarArgCall!void(this.handle, "encoding", "Optional!(string)", tuple(!encoding.empty, encoding.front));
21   }
22   Optional!(string) encoding()() {
23     return Object_Getter__OptionalString(this.handle, "encoding");
24   }
25   void bytes(T0)(scope auto ref Optional!(T0) bytes) if (isTOrPointer!(T0, uint)) {
26     Serialize_Object_VarArgCall!void(this.handle, "bytes", "Optional!(uint)", tuple(!bytes.empty, bytes.front));
27   }
28   Optional!(uint) bytes()() {
29     return Object_Getter__OptionalUint(this.handle, "bytes");
30   }
31 }
32 struct NativeOSFileWriteAtomicOptions {
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 NativeOSFileWriteAtomicOptions(libwasm_add__object());
41   }
42   void bytes(T0)(scope auto ref Optional!(T0) bytes) if (isTOrPointer!(T0, uint)) {
43     Serialize_Object_VarArgCall!void(this.handle, "bytes", "Optional!(uint)", tuple(!bytes.empty, bytes.front));
44   }
45   Optional!(uint) bytes()() {
46     return Object_Getter__OptionalUint(this.handle, "bytes");
47   }
48   void tmpPath(T0)(scope auto ref Optional!(T0) tmpPath) if (isTOrPointer!(T0, string)) {
49     Serialize_Object_VarArgCall!void(this.handle, "tmpPath", "Optional!(string)", tuple(!tmpPath.empty, tmpPath.front));
50   }
51   Optional!(string) tmpPath()() {
52     return Object_Getter__OptionalString(this.handle, "tmpPath");
53   }
54   void noOverwrite()(bool noOverwrite) {
55     Object_Call_bool__void(this.handle, "noOverwrite", noOverwrite);
56   }
57   bool noOverwrite()() {
58     return Object_Getter__bool(this.handle, "noOverwrite");
59   }
60   void flush()(bool flush) {
61     Object_Call_bool__void(this.handle, "flush", flush);
62   }
63   bool flush()() {
64     return Object_Getter__bool(this.handle, "flush");
65   }
66   void backupTo(T0)(scope auto ref Optional!(T0) backupTo) if (isTOrPointer!(T0, string)) {
67     Serialize_Object_VarArgCall!void(this.handle, "backupTo", "Optional!(string)", tuple(!backupTo.empty, backupTo.front));
68   }
69   Optional!(string) backupTo()() {
70     return Object_Getter__OptionalString(this.handle, "backupTo");
71   }
72 }
73 
74