1 module libwasm.bindings.FeaturePolicy;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 import libwasm.bindings.Reporting;
7 
8 @safe:
9 nothrow:
10 
11 struct FeaturePolicyViolationReportBody {
12   nothrow:
13   libwasm.bindings.Reporting.ReportBody _parent;
14   alias _parent this;
15   this(Handle h) {
16     _parent = .ReportBody(h);
17   }
18   string featureId()() {
19     return Object_Getter__string(this._parent, "featureId");
20   }
21   Optional!(string) sourceFile()() {
22     return Object_Getter__OptionalString(this._parent, "sourceFile");
23   }
24   Optional!(int) lineNumber()() {
25     return FeaturePolicyViolationReportBody_lineNumber_Get(this._parent);
26   }
27   Optional!(int) columnNumber()() {
28     return FeaturePolicyViolationReportBody_columnNumber_Get(this._parent);
29   }
30   string disposition()() {
31     return Object_Getter__string(this._parent, "disposition");
32   }
33 }
34 struct Policy {
35   nothrow:
36   JsHandle handle;
37   alias handle this;
38   this(Handle h) {
39     this.handle = JsHandle(h);
40   }
41   bool allowsFeature()(string feature, string origin) {
42     return Serialize_Object_VarArgCall!bool(this.handle, "allowsFeature", "string;string", tuple(feature, origin));
43   }
44   bool allowsFeature()(string feature) {
45     return Object_Call_string__bool(this.handle, "allowsFeature", feature);
46   }
47   auto allowedFeatures()() {
48     return Sequence!(string)(Object_Getter__Handle(this.handle, "allowedFeatures"));
49   }
50   auto getAllowlistForFeature()(string feature) {
51     return Sequence!(string)(Object_Call_string__Handle(this.handle, "getAllowlistForFeature", feature));
52   }
53 }
54 
55 
56 extern (C) Optional!(int) FeaturePolicyViolationReportBody_lineNumber_Get(Handle);
57 extern (C) Optional!(int) FeaturePolicyViolationReportBody_columnNumber_Get(Handle);