github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/declarativewebrequest/bindings/ffi_bindings.ts (about)

     1  import { importModule, Application, heap, Pointer } from "@ffi";
     2  
     3  importModule("plat/js/webext/declarativewebrequest", (A: Application) => {
     4    const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser;
     5  
     6    return {
     7      "store_RequestCookie": (ptr: Pointer, ref: heap.Ref<any>) => {
     8        const x = A.H.get<any>(ref);
     9  
    10        if (typeof x === "undefined") {
    11          A.store.Bool(ptr + 8, false);
    12          A.store.Ref(ptr + 0, undefined);
    13          A.store.Ref(ptr + 4, undefined);
    14        } else {
    15          A.store.Bool(ptr + 8, true);
    16          A.store.Ref(ptr + 0, x["name"]);
    17          A.store.Ref(ptr + 4, x["value"]);
    18        }
    19      },
    20      "load_RequestCookie": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    21        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    22  
    23        x["name"] = A.load.Ref(ptr + 0, undefined);
    24        x["value"] = A.load.Ref(ptr + 4, undefined);
    25        return create === A.H.TRUE ? A.H.push(x) : ref;
    26      },
    27      "constof_AddRequestCookieInstanceType": (ref: heap.Ref<string>): number => {
    28        const idx = ["declarativeWebRequest.AddRequestCookie"].indexOf(A.H.get(ref));
    29        return idx < 0 ? 0 : idx + 1;
    30      },
    31  
    32      "store_AddRequestCookie": (ptr: Pointer, ref: heap.Ref<any>) => {
    33        const x = A.H.get<any>(ref);
    34  
    35        if (typeof x === "undefined") {
    36          A.store.Bool(ptr + 16, false);
    37  
    38          A.store.Bool(ptr + 0 + 8, false);
    39          A.store.Ref(ptr + 0 + 0, undefined);
    40          A.store.Ref(ptr + 0 + 4, undefined);
    41          A.store.Enum(ptr + 12, -1);
    42        } else {
    43          A.store.Bool(ptr + 16, true);
    44  
    45          if (typeof x["cookie"] === "undefined") {
    46            A.store.Bool(ptr + 0 + 8, false);
    47            A.store.Ref(ptr + 0 + 0, undefined);
    48            A.store.Ref(ptr + 0 + 4, undefined);
    49          } else {
    50            A.store.Bool(ptr + 0 + 8, true);
    51            A.store.Ref(ptr + 0 + 0, x["cookie"]["name"]);
    52            A.store.Ref(ptr + 0 + 4, x["cookie"]["value"]);
    53          }
    54          A.store.Enum(ptr + 12, ["declarativeWebRequest.AddRequestCookie"].indexOf(x["instanceType"] as string));
    55        }
    56      },
    57      "load_AddRequestCookie": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    58        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    59  
    60        if (A.load.Bool(ptr + 0 + 8)) {
    61          x["cookie"] = {};
    62          x["cookie"]["name"] = A.load.Ref(ptr + 0 + 0, undefined);
    63          x["cookie"]["value"] = A.load.Ref(ptr + 0 + 4, undefined);
    64        } else {
    65          delete x["cookie"];
    66        }
    67        x["instanceType"] = A.load.Enum(ptr + 12, ["declarativeWebRequest.AddRequestCookie"]);
    68        return create === A.H.TRUE ? A.H.push(x) : ref;
    69      },
    70  
    71      "store_ResponseCookie": (ptr: Pointer, ref: heap.Ref<any>) => {
    72        const x = A.H.get<any>(ref);
    73  
    74        if (typeof x === "undefined") {
    75          A.store.Bool(ptr + 41, false);
    76          A.store.Ref(ptr + 0, undefined);
    77          A.store.Ref(ptr + 4, undefined);
    78          A.store.Ref(ptr + 8, undefined);
    79          A.store.Bool(ptr + 40, false);
    80          A.store.Float64(ptr + 16, 0);
    81          A.store.Ref(ptr + 24, undefined);
    82          A.store.Ref(ptr + 28, undefined);
    83          A.store.Ref(ptr + 32, undefined);
    84          A.store.Ref(ptr + 36, undefined);
    85        } else {
    86          A.store.Bool(ptr + 41, true);
    87          A.store.Ref(ptr + 0, x["domain"]);
    88          A.store.Ref(ptr + 4, x["expires"]);
    89          A.store.Ref(ptr + 8, x["httpOnly"]);
    90          A.store.Bool(ptr + 40, "maxAge" in x ? true : false);
    91          A.store.Float64(ptr + 16, x["maxAge"] === undefined ? 0 : (x["maxAge"] as number));
    92          A.store.Ref(ptr + 24, x["name"]);
    93          A.store.Ref(ptr + 28, x["path"]);
    94          A.store.Ref(ptr + 32, x["secure"]);
    95          A.store.Ref(ptr + 36, x["value"]);
    96        }
    97      },
    98      "load_ResponseCookie": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    99        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   100  
   101        x["domain"] = A.load.Ref(ptr + 0, undefined);
   102        x["expires"] = A.load.Ref(ptr + 4, undefined);
   103        x["httpOnly"] = A.load.Ref(ptr + 8, undefined);
   104        if (A.load.Bool(ptr + 40)) {
   105          x["maxAge"] = A.load.Float64(ptr + 16);
   106        } else {
   107          delete x["maxAge"];
   108        }
   109        x["name"] = A.load.Ref(ptr + 24, undefined);
   110        x["path"] = A.load.Ref(ptr + 28, undefined);
   111        x["secure"] = A.load.Ref(ptr + 32, undefined);
   112        x["value"] = A.load.Ref(ptr + 36, undefined);
   113        return create === A.H.TRUE ? A.H.push(x) : ref;
   114      },
   115      "constof_AddResponseCookieInstanceType": (ref: heap.Ref<string>): number => {
   116        const idx = ["declarativeWebRequest.AddResponseCookie"].indexOf(A.H.get(ref));
   117        return idx < 0 ? 0 : idx + 1;
   118      },
   119  
   120      "store_AddResponseCookie": (ptr: Pointer, ref: heap.Ref<any>) => {
   121        const x = A.H.get<any>(ref);
   122  
   123        if (typeof x === "undefined") {
   124          A.store.Bool(ptr + 48, false);
   125  
   126          A.store.Bool(ptr + 0 + 41, false);
   127          A.store.Ref(ptr + 0 + 0, undefined);
   128          A.store.Ref(ptr + 0 + 4, undefined);
   129          A.store.Ref(ptr + 0 + 8, undefined);
   130          A.store.Bool(ptr + 0 + 40, false);
   131          A.store.Float64(ptr + 0 + 16, 0);
   132          A.store.Ref(ptr + 0 + 24, undefined);
   133          A.store.Ref(ptr + 0 + 28, undefined);
   134          A.store.Ref(ptr + 0 + 32, undefined);
   135          A.store.Ref(ptr + 0 + 36, undefined);
   136          A.store.Enum(ptr + 44, -1);
   137        } else {
   138          A.store.Bool(ptr + 48, true);
   139  
   140          if (typeof x["cookie"] === "undefined") {
   141            A.store.Bool(ptr + 0 + 41, false);
   142            A.store.Ref(ptr + 0 + 0, undefined);
   143            A.store.Ref(ptr + 0 + 4, undefined);
   144            A.store.Ref(ptr + 0 + 8, undefined);
   145            A.store.Bool(ptr + 0 + 40, false);
   146            A.store.Float64(ptr + 0 + 16, 0);
   147            A.store.Ref(ptr + 0 + 24, undefined);
   148            A.store.Ref(ptr + 0 + 28, undefined);
   149            A.store.Ref(ptr + 0 + 32, undefined);
   150            A.store.Ref(ptr + 0 + 36, undefined);
   151          } else {
   152            A.store.Bool(ptr + 0 + 41, true);
   153            A.store.Ref(ptr + 0 + 0, x["cookie"]["domain"]);
   154            A.store.Ref(ptr + 0 + 4, x["cookie"]["expires"]);
   155            A.store.Ref(ptr + 0 + 8, x["cookie"]["httpOnly"]);
   156            A.store.Bool(ptr + 0 + 40, "maxAge" in x["cookie"] ? true : false);
   157            A.store.Float64(ptr + 0 + 16, x["cookie"]["maxAge"] === undefined ? 0 : (x["cookie"]["maxAge"] as number));
   158            A.store.Ref(ptr + 0 + 24, x["cookie"]["name"]);
   159            A.store.Ref(ptr + 0 + 28, x["cookie"]["path"]);
   160            A.store.Ref(ptr + 0 + 32, x["cookie"]["secure"]);
   161            A.store.Ref(ptr + 0 + 36, x["cookie"]["value"]);
   162          }
   163          A.store.Enum(ptr + 44, ["declarativeWebRequest.AddResponseCookie"].indexOf(x["instanceType"] as string));
   164        }
   165      },
   166      "load_AddResponseCookie": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   167        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   168  
   169        if (A.load.Bool(ptr + 0 + 41)) {
   170          x["cookie"] = {};
   171          x["cookie"]["domain"] = A.load.Ref(ptr + 0 + 0, undefined);
   172          x["cookie"]["expires"] = A.load.Ref(ptr + 0 + 4, undefined);
   173          x["cookie"]["httpOnly"] = A.load.Ref(ptr + 0 + 8, undefined);
   174          if (A.load.Bool(ptr + 0 + 40)) {
   175            x["cookie"]["maxAge"] = A.load.Float64(ptr + 0 + 16);
   176          } else {
   177            delete x["cookie"]["maxAge"];
   178          }
   179          x["cookie"]["name"] = A.load.Ref(ptr + 0 + 24, undefined);
   180          x["cookie"]["path"] = A.load.Ref(ptr + 0 + 28, undefined);
   181          x["cookie"]["secure"] = A.load.Ref(ptr + 0 + 32, undefined);
   182          x["cookie"]["value"] = A.load.Ref(ptr + 0 + 36, undefined);
   183        } else {
   184          delete x["cookie"];
   185        }
   186        x["instanceType"] = A.load.Enum(ptr + 44, ["declarativeWebRequest.AddResponseCookie"]);
   187        return create === A.H.TRUE ? A.H.push(x) : ref;
   188      },
   189      "constof_AddResponseHeaderInstanceType": (ref: heap.Ref<string>): number => {
   190        const idx = ["declarativeWebRequest.AddResponseHeader"].indexOf(A.H.get(ref));
   191        return idx < 0 ? 0 : idx + 1;
   192      },
   193  
   194      "store_AddResponseHeader": (ptr: Pointer, ref: heap.Ref<any>) => {
   195        const x = A.H.get<any>(ref);
   196  
   197        if (typeof x === "undefined") {
   198          A.store.Bool(ptr + 12, false);
   199          A.store.Enum(ptr + 0, -1);
   200          A.store.Ref(ptr + 4, undefined);
   201          A.store.Ref(ptr + 8, undefined);
   202        } else {
   203          A.store.Bool(ptr + 12, true);
   204          A.store.Enum(ptr + 0, ["declarativeWebRequest.AddResponseHeader"].indexOf(x["instanceType"] as string));
   205          A.store.Ref(ptr + 4, x["name"]);
   206          A.store.Ref(ptr + 8, x["value"]);
   207        }
   208      },
   209      "load_AddResponseHeader": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   210        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   211  
   212        x["instanceType"] = A.load.Enum(ptr + 0, ["declarativeWebRequest.AddResponseHeader"]);
   213        x["name"] = A.load.Ref(ptr + 4, undefined);
   214        x["value"] = A.load.Ref(ptr + 8, undefined);
   215        return create === A.H.TRUE ? A.H.push(x) : ref;
   216      },
   217      "constof_CancelRequestInstanceType": (ref: heap.Ref<string>): number => {
   218        const idx = ["declarativeWebRequest.CancelRequest"].indexOf(A.H.get(ref));
   219        return idx < 0 ? 0 : idx + 1;
   220      },
   221  
   222      "store_CancelRequest": (ptr: Pointer, ref: heap.Ref<any>) => {
   223        const x = A.H.get<any>(ref);
   224  
   225        if (typeof x === "undefined") {
   226          A.store.Bool(ptr + 4, false);
   227          A.store.Enum(ptr + 0, -1);
   228        } else {
   229          A.store.Bool(ptr + 4, true);
   230          A.store.Enum(ptr + 0, ["declarativeWebRequest.CancelRequest"].indexOf(x["instanceType"] as string));
   231        }
   232      },
   233      "load_CancelRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   234        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   235  
   236        x["instanceType"] = A.load.Enum(ptr + 0, ["declarativeWebRequest.CancelRequest"]);
   237        return create === A.H.TRUE ? A.H.push(x) : ref;
   238      },
   239      "constof_EditRequestCookieInstanceType": (ref: heap.Ref<string>): number => {
   240        const idx = ["declarativeWebRequest.EditRequestCookie"].indexOf(A.H.get(ref));
   241        return idx < 0 ? 0 : idx + 1;
   242      },
   243  
   244      "store_EditRequestCookie": (ptr: Pointer, ref: heap.Ref<any>) => {
   245        const x = A.H.get<any>(ref);
   246  
   247        if (typeof x === "undefined") {
   248          A.store.Bool(ptr + 25, false);
   249  
   250          A.store.Bool(ptr + 0 + 8, false);
   251          A.store.Ref(ptr + 0 + 0, undefined);
   252          A.store.Ref(ptr + 0 + 4, undefined);
   253          A.store.Enum(ptr + 12, -1);
   254  
   255          A.store.Bool(ptr + 16 + 8, false);
   256          A.store.Ref(ptr + 16 + 0, undefined);
   257          A.store.Ref(ptr + 16 + 4, undefined);
   258        } else {
   259          A.store.Bool(ptr + 25, true);
   260  
   261          if (typeof x["filter"] === "undefined") {
   262            A.store.Bool(ptr + 0 + 8, false);
   263            A.store.Ref(ptr + 0 + 0, undefined);
   264            A.store.Ref(ptr + 0 + 4, undefined);
   265          } else {
   266            A.store.Bool(ptr + 0 + 8, true);
   267            A.store.Ref(ptr + 0 + 0, x["filter"]["name"]);
   268            A.store.Ref(ptr + 0 + 4, x["filter"]["value"]);
   269          }
   270          A.store.Enum(ptr + 12, ["declarativeWebRequest.EditRequestCookie"].indexOf(x["instanceType"] as string));
   271  
   272          if (typeof x["modification"] === "undefined") {
   273            A.store.Bool(ptr + 16 + 8, false);
   274            A.store.Ref(ptr + 16 + 0, undefined);
   275            A.store.Ref(ptr + 16 + 4, undefined);
   276          } else {
   277            A.store.Bool(ptr + 16 + 8, true);
   278            A.store.Ref(ptr + 16 + 0, x["modification"]["name"]);
   279            A.store.Ref(ptr + 16 + 4, x["modification"]["value"]);
   280          }
   281        }
   282      },
   283      "load_EditRequestCookie": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   284        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   285  
   286        if (A.load.Bool(ptr + 0 + 8)) {
   287          x["filter"] = {};
   288          x["filter"]["name"] = A.load.Ref(ptr + 0 + 0, undefined);
   289          x["filter"]["value"] = A.load.Ref(ptr + 0 + 4, undefined);
   290        } else {
   291          delete x["filter"];
   292        }
   293        x["instanceType"] = A.load.Enum(ptr + 12, ["declarativeWebRequest.EditRequestCookie"]);
   294        if (A.load.Bool(ptr + 16 + 8)) {
   295          x["modification"] = {};
   296          x["modification"]["name"] = A.load.Ref(ptr + 16 + 0, undefined);
   297          x["modification"]["value"] = A.load.Ref(ptr + 16 + 4, undefined);
   298        } else {
   299          delete x["modification"];
   300        }
   301        return create === A.H.TRUE ? A.H.push(x) : ref;
   302      },
   303  
   304      "store_FilterResponseCookie": (ptr: Pointer, ref: heap.Ref<any>) => {
   305        const x = A.H.get<any>(ref);
   306  
   307        if (typeof x === "undefined") {
   308          A.store.Bool(ptr + 64, false);
   309          A.store.Bool(ptr + 60, false);
   310          A.store.Int64(ptr + 0, 0);
   311          A.store.Bool(ptr + 61, false);
   312          A.store.Int64(ptr + 8, 0);
   313          A.store.Ref(ptr + 16, undefined);
   314          A.store.Ref(ptr + 20, undefined);
   315          A.store.Ref(ptr + 24, undefined);
   316          A.store.Bool(ptr + 62, false);
   317          A.store.Float64(ptr + 32, 0);
   318          A.store.Ref(ptr + 40, undefined);
   319          A.store.Ref(ptr + 44, undefined);
   320          A.store.Ref(ptr + 48, undefined);
   321          A.store.Bool(ptr + 63, false);
   322          A.store.Bool(ptr + 52, false);
   323          A.store.Ref(ptr + 56, undefined);
   324        } else {
   325          A.store.Bool(ptr + 64, true);
   326          A.store.Bool(ptr + 60, "ageLowerBound" in x ? true : false);
   327          A.store.Int64(ptr + 0, x["ageLowerBound"] === undefined ? 0 : (x["ageLowerBound"] as number));
   328          A.store.Bool(ptr + 61, "ageUpperBound" in x ? true : false);
   329          A.store.Int64(ptr + 8, x["ageUpperBound"] === undefined ? 0 : (x["ageUpperBound"] as number));
   330          A.store.Ref(ptr + 16, x["domain"]);
   331          A.store.Ref(ptr + 20, x["expires"]);
   332          A.store.Ref(ptr + 24, x["httpOnly"]);
   333          A.store.Bool(ptr + 62, "maxAge" in x ? true : false);
   334          A.store.Float64(ptr + 32, x["maxAge"] === undefined ? 0 : (x["maxAge"] as number));
   335          A.store.Ref(ptr + 40, x["name"]);
   336          A.store.Ref(ptr + 44, x["path"]);
   337          A.store.Ref(ptr + 48, x["secure"]);
   338          A.store.Bool(ptr + 63, "sessionCookie" in x ? true : false);
   339          A.store.Bool(ptr + 52, x["sessionCookie"] ? true : false);
   340          A.store.Ref(ptr + 56, x["value"]);
   341        }
   342      },
   343      "load_FilterResponseCookie": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   344        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   345  
   346        if (A.load.Bool(ptr + 60)) {
   347          x["ageLowerBound"] = A.load.Int64(ptr + 0);
   348        } else {
   349          delete x["ageLowerBound"];
   350        }
   351        if (A.load.Bool(ptr + 61)) {
   352          x["ageUpperBound"] = A.load.Int64(ptr + 8);
   353        } else {
   354          delete x["ageUpperBound"];
   355        }
   356        x["domain"] = A.load.Ref(ptr + 16, undefined);
   357        x["expires"] = A.load.Ref(ptr + 20, undefined);
   358        x["httpOnly"] = A.load.Ref(ptr + 24, undefined);
   359        if (A.load.Bool(ptr + 62)) {
   360          x["maxAge"] = A.load.Float64(ptr + 32);
   361        } else {
   362          delete x["maxAge"];
   363        }
   364        x["name"] = A.load.Ref(ptr + 40, undefined);
   365        x["path"] = A.load.Ref(ptr + 44, undefined);
   366        x["secure"] = A.load.Ref(ptr + 48, undefined);
   367        if (A.load.Bool(ptr + 63)) {
   368          x["sessionCookie"] = A.load.Bool(ptr + 52);
   369        } else {
   370          delete x["sessionCookie"];
   371        }
   372        x["value"] = A.load.Ref(ptr + 56, undefined);
   373        return create === A.H.TRUE ? A.H.push(x) : ref;
   374      },
   375      "constof_EditResponseCookieInstanceType": (ref: heap.Ref<string>): number => {
   376        const idx = ["declarativeWebRequest.EditResponseCookie"].indexOf(A.H.get(ref));
   377        return idx < 0 ? 0 : idx + 1;
   378      },
   379  
   380      "store_EditResponseCookie": (ptr: Pointer, ref: heap.Ref<any>) => {
   381        const x = A.H.get<any>(ref);
   382  
   383        if (typeof x === "undefined") {
   384          A.store.Bool(ptr + 114, false);
   385  
   386          A.store.Bool(ptr + 0 + 64, false);
   387          A.store.Bool(ptr + 0 + 60, false);
   388          A.store.Int64(ptr + 0 + 0, 0);
   389          A.store.Bool(ptr + 0 + 61, false);
   390          A.store.Int64(ptr + 0 + 8, 0);
   391          A.store.Ref(ptr + 0 + 16, undefined);
   392          A.store.Ref(ptr + 0 + 20, undefined);
   393          A.store.Ref(ptr + 0 + 24, undefined);
   394          A.store.Bool(ptr + 0 + 62, false);
   395          A.store.Float64(ptr + 0 + 32, 0);
   396          A.store.Ref(ptr + 0 + 40, undefined);
   397          A.store.Ref(ptr + 0 + 44, undefined);
   398          A.store.Ref(ptr + 0 + 48, undefined);
   399          A.store.Bool(ptr + 0 + 63, false);
   400          A.store.Bool(ptr + 0 + 52, false);
   401          A.store.Ref(ptr + 0 + 56, undefined);
   402          A.store.Enum(ptr + 68, -1);
   403  
   404          A.store.Bool(ptr + 72 + 41, false);
   405          A.store.Ref(ptr + 72 + 0, undefined);
   406          A.store.Ref(ptr + 72 + 4, undefined);
   407          A.store.Ref(ptr + 72 + 8, undefined);
   408          A.store.Bool(ptr + 72 + 40, false);
   409          A.store.Float64(ptr + 72 + 16, 0);
   410          A.store.Ref(ptr + 72 + 24, undefined);
   411          A.store.Ref(ptr + 72 + 28, undefined);
   412          A.store.Ref(ptr + 72 + 32, undefined);
   413          A.store.Ref(ptr + 72 + 36, undefined);
   414        } else {
   415          A.store.Bool(ptr + 114, true);
   416  
   417          if (typeof x["filter"] === "undefined") {
   418            A.store.Bool(ptr + 0 + 64, false);
   419            A.store.Bool(ptr + 0 + 60, false);
   420            A.store.Int64(ptr + 0 + 0, 0);
   421            A.store.Bool(ptr + 0 + 61, false);
   422            A.store.Int64(ptr + 0 + 8, 0);
   423            A.store.Ref(ptr + 0 + 16, undefined);
   424            A.store.Ref(ptr + 0 + 20, undefined);
   425            A.store.Ref(ptr + 0 + 24, undefined);
   426            A.store.Bool(ptr + 0 + 62, false);
   427            A.store.Float64(ptr + 0 + 32, 0);
   428            A.store.Ref(ptr + 0 + 40, undefined);
   429            A.store.Ref(ptr + 0 + 44, undefined);
   430            A.store.Ref(ptr + 0 + 48, undefined);
   431            A.store.Bool(ptr + 0 + 63, false);
   432            A.store.Bool(ptr + 0 + 52, false);
   433            A.store.Ref(ptr + 0 + 56, undefined);
   434          } else {
   435            A.store.Bool(ptr + 0 + 64, true);
   436            A.store.Bool(ptr + 0 + 60, "ageLowerBound" in x["filter"] ? true : false);
   437            A.store.Int64(
   438              ptr + 0 + 0,
   439              x["filter"]["ageLowerBound"] === undefined ? 0 : (x["filter"]["ageLowerBound"] as number)
   440            );
   441            A.store.Bool(ptr + 0 + 61, "ageUpperBound" in x["filter"] ? true : false);
   442            A.store.Int64(
   443              ptr + 0 + 8,
   444              x["filter"]["ageUpperBound"] === undefined ? 0 : (x["filter"]["ageUpperBound"] as number)
   445            );
   446            A.store.Ref(ptr + 0 + 16, x["filter"]["domain"]);
   447            A.store.Ref(ptr + 0 + 20, x["filter"]["expires"]);
   448            A.store.Ref(ptr + 0 + 24, x["filter"]["httpOnly"]);
   449            A.store.Bool(ptr + 0 + 62, "maxAge" in x["filter"] ? true : false);
   450            A.store.Float64(ptr + 0 + 32, x["filter"]["maxAge"] === undefined ? 0 : (x["filter"]["maxAge"] as number));
   451            A.store.Ref(ptr + 0 + 40, x["filter"]["name"]);
   452            A.store.Ref(ptr + 0 + 44, x["filter"]["path"]);
   453            A.store.Ref(ptr + 0 + 48, x["filter"]["secure"]);
   454            A.store.Bool(ptr + 0 + 63, "sessionCookie" in x["filter"] ? true : false);
   455            A.store.Bool(ptr + 0 + 52, x["filter"]["sessionCookie"] ? true : false);
   456            A.store.Ref(ptr + 0 + 56, x["filter"]["value"]);
   457          }
   458          A.store.Enum(ptr + 68, ["declarativeWebRequest.EditResponseCookie"].indexOf(x["instanceType"] as string));
   459  
   460          if (typeof x["modification"] === "undefined") {
   461            A.store.Bool(ptr + 72 + 41, false);
   462            A.store.Ref(ptr + 72 + 0, undefined);
   463            A.store.Ref(ptr + 72 + 4, undefined);
   464            A.store.Ref(ptr + 72 + 8, undefined);
   465            A.store.Bool(ptr + 72 + 40, false);
   466            A.store.Float64(ptr + 72 + 16, 0);
   467            A.store.Ref(ptr + 72 + 24, undefined);
   468            A.store.Ref(ptr + 72 + 28, undefined);
   469            A.store.Ref(ptr + 72 + 32, undefined);
   470            A.store.Ref(ptr + 72 + 36, undefined);
   471          } else {
   472            A.store.Bool(ptr + 72 + 41, true);
   473            A.store.Ref(ptr + 72 + 0, x["modification"]["domain"]);
   474            A.store.Ref(ptr + 72 + 4, x["modification"]["expires"]);
   475            A.store.Ref(ptr + 72 + 8, x["modification"]["httpOnly"]);
   476            A.store.Bool(ptr + 72 + 40, "maxAge" in x["modification"] ? true : false);
   477            A.store.Float64(
   478              ptr + 72 + 16,
   479              x["modification"]["maxAge"] === undefined ? 0 : (x["modification"]["maxAge"] as number)
   480            );
   481            A.store.Ref(ptr + 72 + 24, x["modification"]["name"]);
   482            A.store.Ref(ptr + 72 + 28, x["modification"]["path"]);
   483            A.store.Ref(ptr + 72 + 32, x["modification"]["secure"]);
   484            A.store.Ref(ptr + 72 + 36, x["modification"]["value"]);
   485          }
   486        }
   487      },
   488      "load_EditResponseCookie": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   489        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   490  
   491        if (A.load.Bool(ptr + 0 + 64)) {
   492          x["filter"] = {};
   493          if (A.load.Bool(ptr + 0 + 60)) {
   494            x["filter"]["ageLowerBound"] = A.load.Int64(ptr + 0 + 0);
   495          } else {
   496            delete x["filter"]["ageLowerBound"];
   497          }
   498          if (A.load.Bool(ptr + 0 + 61)) {
   499            x["filter"]["ageUpperBound"] = A.load.Int64(ptr + 0 + 8);
   500          } else {
   501            delete x["filter"]["ageUpperBound"];
   502          }
   503          x["filter"]["domain"] = A.load.Ref(ptr + 0 + 16, undefined);
   504          x["filter"]["expires"] = A.load.Ref(ptr + 0 + 20, undefined);
   505          x["filter"]["httpOnly"] = A.load.Ref(ptr + 0 + 24, undefined);
   506          if (A.load.Bool(ptr + 0 + 62)) {
   507            x["filter"]["maxAge"] = A.load.Float64(ptr + 0 + 32);
   508          } else {
   509            delete x["filter"]["maxAge"];
   510          }
   511          x["filter"]["name"] = A.load.Ref(ptr + 0 + 40, undefined);
   512          x["filter"]["path"] = A.load.Ref(ptr + 0 + 44, undefined);
   513          x["filter"]["secure"] = A.load.Ref(ptr + 0 + 48, undefined);
   514          if (A.load.Bool(ptr + 0 + 63)) {
   515            x["filter"]["sessionCookie"] = A.load.Bool(ptr + 0 + 52);
   516          } else {
   517            delete x["filter"]["sessionCookie"];
   518          }
   519          x["filter"]["value"] = A.load.Ref(ptr + 0 + 56, undefined);
   520        } else {
   521          delete x["filter"];
   522        }
   523        x["instanceType"] = A.load.Enum(ptr + 68, ["declarativeWebRequest.EditResponseCookie"]);
   524        if (A.load.Bool(ptr + 72 + 41)) {
   525          x["modification"] = {};
   526          x["modification"]["domain"] = A.load.Ref(ptr + 72 + 0, undefined);
   527          x["modification"]["expires"] = A.load.Ref(ptr + 72 + 4, undefined);
   528          x["modification"]["httpOnly"] = A.load.Ref(ptr + 72 + 8, undefined);
   529          if (A.load.Bool(ptr + 72 + 40)) {
   530            x["modification"]["maxAge"] = A.load.Float64(ptr + 72 + 16);
   531          } else {
   532            delete x["modification"]["maxAge"];
   533          }
   534          x["modification"]["name"] = A.load.Ref(ptr + 72 + 24, undefined);
   535          x["modification"]["path"] = A.load.Ref(ptr + 72 + 28, undefined);
   536          x["modification"]["secure"] = A.load.Ref(ptr + 72 + 32, undefined);
   537          x["modification"]["value"] = A.load.Ref(ptr + 72 + 36, undefined);
   538        } else {
   539          delete x["modification"];
   540        }
   541        return create === A.H.TRUE ? A.H.push(x) : ref;
   542      },
   543  
   544      "store_HeaderFilter": (ptr: Pointer, ref: heap.Ref<any>) => {
   545        const x = A.H.get<any>(ref);
   546  
   547        if (typeof x === "undefined") {
   548          A.store.Bool(ptr + 32, false);
   549          A.store.Ref(ptr + 0, undefined);
   550          A.store.Ref(ptr + 4, undefined);
   551          A.store.Ref(ptr + 8, undefined);
   552          A.store.Ref(ptr + 12, undefined);
   553          A.store.Ref(ptr + 16, undefined);
   554          A.store.Ref(ptr + 20, undefined);
   555          A.store.Ref(ptr + 24, undefined);
   556          A.store.Ref(ptr + 28, undefined);
   557        } else {
   558          A.store.Bool(ptr + 32, true);
   559          A.store.Ref(ptr + 0, x["nameContains"]);
   560          A.store.Ref(ptr + 4, x["nameEquals"]);
   561          A.store.Ref(ptr + 8, x["namePrefix"]);
   562          A.store.Ref(ptr + 12, x["nameSuffix"]);
   563          A.store.Ref(ptr + 16, x["valueContains"]);
   564          A.store.Ref(ptr + 20, x["valueEquals"]);
   565          A.store.Ref(ptr + 24, x["valuePrefix"]);
   566          A.store.Ref(ptr + 28, x["valueSuffix"]);
   567        }
   568      },
   569      "load_HeaderFilter": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   570        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   571  
   572        x["nameContains"] = A.load.Ref(ptr + 0, undefined);
   573        x["nameEquals"] = A.load.Ref(ptr + 4, undefined);
   574        x["namePrefix"] = A.load.Ref(ptr + 8, undefined);
   575        x["nameSuffix"] = A.load.Ref(ptr + 12, undefined);
   576        x["valueContains"] = A.load.Ref(ptr + 16, undefined);
   577        x["valueEquals"] = A.load.Ref(ptr + 20, undefined);
   578        x["valuePrefix"] = A.load.Ref(ptr + 24, undefined);
   579        x["valueSuffix"] = A.load.Ref(ptr + 28, undefined);
   580        return create === A.H.TRUE ? A.H.push(x) : ref;
   581      },
   582      "constof_IgnoreRulesInstanceType": (ref: heap.Ref<string>): number => {
   583        const idx = ["declarativeWebRequest.IgnoreRules"].indexOf(A.H.get(ref));
   584        return idx < 0 ? 0 : idx + 1;
   585      },
   586  
   587      "store_IgnoreRules": (ptr: Pointer, ref: heap.Ref<any>) => {
   588        const x = A.H.get<any>(ref);
   589  
   590        if (typeof x === "undefined") {
   591          A.store.Bool(ptr + 17, false);
   592          A.store.Ref(ptr + 0, undefined);
   593          A.store.Enum(ptr + 4, -1);
   594          A.store.Bool(ptr + 16, false);
   595          A.store.Int64(ptr + 8, 0);
   596        } else {
   597          A.store.Bool(ptr + 17, true);
   598          A.store.Ref(ptr + 0, x["hasTag"]);
   599          A.store.Enum(ptr + 4, ["declarativeWebRequest.IgnoreRules"].indexOf(x["instanceType"] as string));
   600          A.store.Bool(ptr + 16, "lowerPriorityThan" in x ? true : false);
   601          A.store.Int64(ptr + 8, x["lowerPriorityThan"] === undefined ? 0 : (x["lowerPriorityThan"] as number));
   602        }
   603      },
   604      "load_IgnoreRules": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   605        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   606  
   607        x["hasTag"] = A.load.Ref(ptr + 0, undefined);
   608        x["instanceType"] = A.load.Enum(ptr + 4, ["declarativeWebRequest.IgnoreRules"]);
   609        if (A.load.Bool(ptr + 16)) {
   610          x["lowerPriorityThan"] = A.load.Int64(ptr + 8);
   611        } else {
   612          delete x["lowerPriorityThan"];
   613        }
   614        return create === A.H.TRUE ? A.H.push(x) : ref;
   615      },
   616      "constof_Stage": (ref: heap.Ref<string>): number => {
   617        const idx = ["onBeforeRequest", "onBeforeSendHeaders", "onHeadersReceived", "onAuthRequired"].indexOf(
   618          A.H.get(ref)
   619        );
   620        return idx < 0 ? 0 : idx + 1;
   621      },
   622  
   623      "store_OnMessageArgDetails": (ptr: Pointer, ref: heap.Ref<any>) => {
   624        const x = A.H.get<any>(ref);
   625  
   626        if (typeof x === "undefined") {
   627          A.store.Bool(ptr + 72, false);
   628          A.store.Ref(ptr + 0, undefined);
   629          A.store.Enum(ptr + 4, -1);
   630          A.store.Int64(ptr + 8, 0);
   631          A.store.Enum(ptr + 16, -1);
   632          A.store.Ref(ptr + 20, undefined);
   633          A.store.Ref(ptr + 24, undefined);
   634          A.store.Ref(ptr + 28, undefined);
   635          A.store.Int64(ptr + 32, 0);
   636          A.store.Ref(ptr + 40, undefined);
   637          A.store.Enum(ptr + 44, -1);
   638          A.store.Int64(ptr + 48, 0);
   639          A.store.Float64(ptr + 56, 0);
   640          A.store.Enum(ptr + 64, -1);
   641          A.store.Ref(ptr + 68, undefined);
   642        } else {
   643          A.store.Bool(ptr + 72, true);
   644          A.store.Ref(ptr + 0, x["documentId"]);
   645          A.store.Enum(
   646            ptr + 4,
   647            ["prerender", "active", "cached", "pending_deletion"].indexOf(x["documentLifecycle"] as string)
   648          );
   649          A.store.Int64(ptr + 8, x["frameId"] === undefined ? 0 : (x["frameId"] as number));
   650          A.store.Enum(ptr + 16, ["outermost_frame", "fenced_frame", "sub_frame"].indexOf(x["frameType"] as string));
   651          A.store.Ref(ptr + 20, x["message"]);
   652          A.store.Ref(ptr + 24, x["method"]);
   653          A.store.Ref(ptr + 28, x["parentDocumentId"]);
   654          A.store.Int64(ptr + 32, x["parentFrameId"] === undefined ? 0 : (x["parentFrameId"] as number));
   655          A.store.Ref(ptr + 40, x["requestId"]);
   656          A.store.Enum(
   657            ptr + 44,
   658            ["onBeforeRequest", "onBeforeSendHeaders", "onHeadersReceived", "onAuthRequired"].indexOf(
   659              x["stage"] as string
   660            )
   661          );
   662          A.store.Int64(ptr + 48, x["tabId"] === undefined ? 0 : (x["tabId"] as number));
   663          A.store.Float64(ptr + 56, x["timeStamp"] === undefined ? 0 : (x["timeStamp"] as number));
   664          A.store.Enum(
   665            ptr + 64,
   666            [
   667              "main_frame",
   668              "sub_frame",
   669              "stylesheet",
   670              "script",
   671              "image",
   672              "font",
   673              "object",
   674              "xmlhttprequest",
   675              "ping",
   676              "csp_report",
   677              "media",
   678              "websocket",
   679              "webbundle",
   680              "other",
   681            ].indexOf(x["type"] as string)
   682          );
   683          A.store.Ref(ptr + 68, x["url"]);
   684        }
   685      },
   686      "load_OnMessageArgDetails": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   687        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   688  
   689        x["documentId"] = A.load.Ref(ptr + 0, undefined);
   690        x["documentLifecycle"] = A.load.Enum(ptr + 4, ["prerender", "active", "cached", "pending_deletion"]);
   691        x["frameId"] = A.load.Int64(ptr + 8);
   692        x["frameType"] = A.load.Enum(ptr + 16, ["outermost_frame", "fenced_frame", "sub_frame"]);
   693        x["message"] = A.load.Ref(ptr + 20, undefined);
   694        x["method"] = A.load.Ref(ptr + 24, undefined);
   695        x["parentDocumentId"] = A.load.Ref(ptr + 28, undefined);
   696        x["parentFrameId"] = A.load.Int64(ptr + 32);
   697        x["requestId"] = A.load.Ref(ptr + 40, undefined);
   698        x["stage"] = A.load.Enum(ptr + 44, [
   699          "onBeforeRequest",
   700          "onBeforeSendHeaders",
   701          "onHeadersReceived",
   702          "onAuthRequired",
   703        ]);
   704        x["tabId"] = A.load.Int64(ptr + 48);
   705        x["timeStamp"] = A.load.Float64(ptr + 56);
   706        x["type"] = A.load.Enum(ptr + 64, [
   707          "main_frame",
   708          "sub_frame",
   709          "stylesheet",
   710          "script",
   711          "image",
   712          "font",
   713          "object",
   714          "xmlhttprequest",
   715          "ping",
   716          "csp_report",
   717          "media",
   718          "websocket",
   719          "webbundle",
   720          "other",
   721        ]);
   722        x["url"] = A.load.Ref(ptr + 68, undefined);
   723        return create === A.H.TRUE ? A.H.push(x) : ref;
   724      },
   725      "constof_RedirectByRegExInstanceType": (ref: heap.Ref<string>): number => {
   726        const idx = ["declarativeWebRequest.RedirectByRegEx"].indexOf(A.H.get(ref));
   727        return idx < 0 ? 0 : idx + 1;
   728      },
   729  
   730      "store_RedirectByRegEx": (ptr: Pointer, ref: heap.Ref<any>) => {
   731        const x = A.H.get<any>(ref);
   732  
   733        if (typeof x === "undefined") {
   734          A.store.Bool(ptr + 12, false);
   735          A.store.Ref(ptr + 0, undefined);
   736          A.store.Enum(ptr + 4, -1);
   737          A.store.Ref(ptr + 8, undefined);
   738        } else {
   739          A.store.Bool(ptr + 12, true);
   740          A.store.Ref(ptr + 0, x["from"]);
   741          A.store.Enum(ptr + 4, ["declarativeWebRequest.RedirectByRegEx"].indexOf(x["instanceType"] as string));
   742          A.store.Ref(ptr + 8, x["to"]);
   743        }
   744      },
   745      "load_RedirectByRegEx": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   746        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   747  
   748        x["from"] = A.load.Ref(ptr + 0, undefined);
   749        x["instanceType"] = A.load.Enum(ptr + 4, ["declarativeWebRequest.RedirectByRegEx"]);
   750        x["to"] = A.load.Ref(ptr + 8, undefined);
   751        return create === A.H.TRUE ? A.H.push(x) : ref;
   752      },
   753      "constof_RedirectRequestInstanceType": (ref: heap.Ref<string>): number => {
   754        const idx = ["declarativeWebRequest.RedirectRequest"].indexOf(A.H.get(ref));
   755        return idx < 0 ? 0 : idx + 1;
   756      },
   757  
   758      "store_RedirectRequest": (ptr: Pointer, ref: heap.Ref<any>) => {
   759        const x = A.H.get<any>(ref);
   760  
   761        if (typeof x === "undefined") {
   762          A.store.Bool(ptr + 8, false);
   763          A.store.Enum(ptr + 0, -1);
   764          A.store.Ref(ptr + 4, undefined);
   765        } else {
   766          A.store.Bool(ptr + 8, true);
   767          A.store.Enum(ptr + 0, ["declarativeWebRequest.RedirectRequest"].indexOf(x["instanceType"] as string));
   768          A.store.Ref(ptr + 4, x["redirectUrl"]);
   769        }
   770      },
   771      "load_RedirectRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   772        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   773  
   774        x["instanceType"] = A.load.Enum(ptr + 0, ["declarativeWebRequest.RedirectRequest"]);
   775        x["redirectUrl"] = A.load.Ref(ptr + 4, undefined);
   776        return create === A.H.TRUE ? A.H.push(x) : ref;
   777      },
   778      "constof_RedirectToEmptyDocumentInstanceType": (ref: heap.Ref<string>): number => {
   779        const idx = ["declarativeWebRequest.RedirectToEmptyDocument"].indexOf(A.H.get(ref));
   780        return idx < 0 ? 0 : idx + 1;
   781      },
   782  
   783      "store_RedirectToEmptyDocument": (ptr: Pointer, ref: heap.Ref<any>) => {
   784        const x = A.H.get<any>(ref);
   785  
   786        if (typeof x === "undefined") {
   787          A.store.Bool(ptr + 4, false);
   788          A.store.Enum(ptr + 0, -1);
   789        } else {
   790          A.store.Bool(ptr + 4, true);
   791          A.store.Enum(ptr + 0, ["declarativeWebRequest.RedirectToEmptyDocument"].indexOf(x["instanceType"] as string));
   792        }
   793      },
   794      "load_RedirectToEmptyDocument": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   795        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   796  
   797        x["instanceType"] = A.load.Enum(ptr + 0, ["declarativeWebRequest.RedirectToEmptyDocument"]);
   798        return create === A.H.TRUE ? A.H.push(x) : ref;
   799      },
   800      "constof_RedirectToTransparentImageInstanceType": (ref: heap.Ref<string>): number => {
   801        const idx = ["declarativeWebRequest.RedirectToTransparentImage"].indexOf(A.H.get(ref));
   802        return idx < 0 ? 0 : idx + 1;
   803      },
   804  
   805      "store_RedirectToTransparentImage": (ptr: Pointer, ref: heap.Ref<any>) => {
   806        const x = A.H.get<any>(ref);
   807  
   808        if (typeof x === "undefined") {
   809          A.store.Bool(ptr + 4, false);
   810          A.store.Enum(ptr + 0, -1);
   811        } else {
   812          A.store.Bool(ptr + 4, true);
   813          A.store.Enum(
   814            ptr + 0,
   815            ["declarativeWebRequest.RedirectToTransparentImage"].indexOf(x["instanceType"] as string)
   816          );
   817        }
   818      },
   819      "load_RedirectToTransparentImage": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   820        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   821  
   822        x["instanceType"] = A.load.Enum(ptr + 0, ["declarativeWebRequest.RedirectToTransparentImage"]);
   823        return create === A.H.TRUE ? A.H.push(x) : ref;
   824      },
   825      "constof_RemoveRequestCookieInstanceType": (ref: heap.Ref<string>): number => {
   826        const idx = ["declarativeWebRequest.RemoveRequestCookie"].indexOf(A.H.get(ref));
   827        return idx < 0 ? 0 : idx + 1;
   828      },
   829  
   830      "store_RemoveRequestCookie": (ptr: Pointer, ref: heap.Ref<any>) => {
   831        const x = A.H.get<any>(ref);
   832  
   833        if (typeof x === "undefined") {
   834          A.store.Bool(ptr + 16, false);
   835  
   836          A.store.Bool(ptr + 0 + 8, false);
   837          A.store.Ref(ptr + 0 + 0, undefined);
   838          A.store.Ref(ptr + 0 + 4, undefined);
   839          A.store.Enum(ptr + 12, -1);
   840        } else {
   841          A.store.Bool(ptr + 16, true);
   842  
   843          if (typeof x["filter"] === "undefined") {
   844            A.store.Bool(ptr + 0 + 8, false);
   845            A.store.Ref(ptr + 0 + 0, undefined);
   846            A.store.Ref(ptr + 0 + 4, undefined);
   847          } else {
   848            A.store.Bool(ptr + 0 + 8, true);
   849            A.store.Ref(ptr + 0 + 0, x["filter"]["name"]);
   850            A.store.Ref(ptr + 0 + 4, x["filter"]["value"]);
   851          }
   852          A.store.Enum(ptr + 12, ["declarativeWebRequest.RemoveRequestCookie"].indexOf(x["instanceType"] as string));
   853        }
   854      },
   855      "load_RemoveRequestCookie": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   856        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   857  
   858        if (A.load.Bool(ptr + 0 + 8)) {
   859          x["filter"] = {};
   860          x["filter"]["name"] = A.load.Ref(ptr + 0 + 0, undefined);
   861          x["filter"]["value"] = A.load.Ref(ptr + 0 + 4, undefined);
   862        } else {
   863          delete x["filter"];
   864        }
   865        x["instanceType"] = A.load.Enum(ptr + 12, ["declarativeWebRequest.RemoveRequestCookie"]);
   866        return create === A.H.TRUE ? A.H.push(x) : ref;
   867      },
   868      "constof_RemoveRequestHeaderInstanceType": (ref: heap.Ref<string>): number => {
   869        const idx = ["declarativeWebRequest.RemoveRequestHeader"].indexOf(A.H.get(ref));
   870        return idx < 0 ? 0 : idx + 1;
   871      },
   872  
   873      "store_RemoveRequestHeader": (ptr: Pointer, ref: heap.Ref<any>) => {
   874        const x = A.H.get<any>(ref);
   875  
   876        if (typeof x === "undefined") {
   877          A.store.Bool(ptr + 8, false);
   878          A.store.Enum(ptr + 0, -1);
   879          A.store.Ref(ptr + 4, undefined);
   880        } else {
   881          A.store.Bool(ptr + 8, true);
   882          A.store.Enum(ptr + 0, ["declarativeWebRequest.RemoveRequestHeader"].indexOf(x["instanceType"] as string));
   883          A.store.Ref(ptr + 4, x["name"]);
   884        }
   885      },
   886      "load_RemoveRequestHeader": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   887        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   888  
   889        x["instanceType"] = A.load.Enum(ptr + 0, ["declarativeWebRequest.RemoveRequestHeader"]);
   890        x["name"] = A.load.Ref(ptr + 4, undefined);
   891        return create === A.H.TRUE ? A.H.push(x) : ref;
   892      },
   893      "constof_RemoveResponseCookieInstanceType": (ref: heap.Ref<string>): number => {
   894        const idx = ["declarativeWebRequest.RemoveResponseCookie"].indexOf(A.H.get(ref));
   895        return idx < 0 ? 0 : idx + 1;
   896      },
   897  
   898      "store_RemoveResponseCookie": (ptr: Pointer, ref: heap.Ref<any>) => {
   899        const x = A.H.get<any>(ref);
   900  
   901        if (typeof x === "undefined") {
   902          A.store.Bool(ptr + 72, false);
   903  
   904          A.store.Bool(ptr + 0 + 64, false);
   905          A.store.Bool(ptr + 0 + 60, false);
   906          A.store.Int64(ptr + 0 + 0, 0);
   907          A.store.Bool(ptr + 0 + 61, false);
   908          A.store.Int64(ptr + 0 + 8, 0);
   909          A.store.Ref(ptr + 0 + 16, undefined);
   910          A.store.Ref(ptr + 0 + 20, undefined);
   911          A.store.Ref(ptr + 0 + 24, undefined);
   912          A.store.Bool(ptr + 0 + 62, false);
   913          A.store.Float64(ptr + 0 + 32, 0);
   914          A.store.Ref(ptr + 0 + 40, undefined);
   915          A.store.Ref(ptr + 0 + 44, undefined);
   916          A.store.Ref(ptr + 0 + 48, undefined);
   917          A.store.Bool(ptr + 0 + 63, false);
   918          A.store.Bool(ptr + 0 + 52, false);
   919          A.store.Ref(ptr + 0 + 56, undefined);
   920          A.store.Enum(ptr + 68, -1);
   921        } else {
   922          A.store.Bool(ptr + 72, true);
   923  
   924          if (typeof x["filter"] === "undefined") {
   925            A.store.Bool(ptr + 0 + 64, false);
   926            A.store.Bool(ptr + 0 + 60, false);
   927            A.store.Int64(ptr + 0 + 0, 0);
   928            A.store.Bool(ptr + 0 + 61, false);
   929            A.store.Int64(ptr + 0 + 8, 0);
   930            A.store.Ref(ptr + 0 + 16, undefined);
   931            A.store.Ref(ptr + 0 + 20, undefined);
   932            A.store.Ref(ptr + 0 + 24, undefined);
   933            A.store.Bool(ptr + 0 + 62, false);
   934            A.store.Float64(ptr + 0 + 32, 0);
   935            A.store.Ref(ptr + 0 + 40, undefined);
   936            A.store.Ref(ptr + 0 + 44, undefined);
   937            A.store.Ref(ptr + 0 + 48, undefined);
   938            A.store.Bool(ptr + 0 + 63, false);
   939            A.store.Bool(ptr + 0 + 52, false);
   940            A.store.Ref(ptr + 0 + 56, undefined);
   941          } else {
   942            A.store.Bool(ptr + 0 + 64, true);
   943            A.store.Bool(ptr + 0 + 60, "ageLowerBound" in x["filter"] ? true : false);
   944            A.store.Int64(
   945              ptr + 0 + 0,
   946              x["filter"]["ageLowerBound"] === undefined ? 0 : (x["filter"]["ageLowerBound"] as number)
   947            );
   948            A.store.Bool(ptr + 0 + 61, "ageUpperBound" in x["filter"] ? true : false);
   949            A.store.Int64(
   950              ptr + 0 + 8,
   951              x["filter"]["ageUpperBound"] === undefined ? 0 : (x["filter"]["ageUpperBound"] as number)
   952            );
   953            A.store.Ref(ptr + 0 + 16, x["filter"]["domain"]);
   954            A.store.Ref(ptr + 0 + 20, x["filter"]["expires"]);
   955            A.store.Ref(ptr + 0 + 24, x["filter"]["httpOnly"]);
   956            A.store.Bool(ptr + 0 + 62, "maxAge" in x["filter"] ? true : false);
   957            A.store.Float64(ptr + 0 + 32, x["filter"]["maxAge"] === undefined ? 0 : (x["filter"]["maxAge"] as number));
   958            A.store.Ref(ptr + 0 + 40, x["filter"]["name"]);
   959            A.store.Ref(ptr + 0 + 44, x["filter"]["path"]);
   960            A.store.Ref(ptr + 0 + 48, x["filter"]["secure"]);
   961            A.store.Bool(ptr + 0 + 63, "sessionCookie" in x["filter"] ? true : false);
   962            A.store.Bool(ptr + 0 + 52, x["filter"]["sessionCookie"] ? true : false);
   963            A.store.Ref(ptr + 0 + 56, x["filter"]["value"]);
   964          }
   965          A.store.Enum(ptr + 68, ["declarativeWebRequest.RemoveResponseCookie"].indexOf(x["instanceType"] as string));
   966        }
   967      },
   968      "load_RemoveResponseCookie": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   969        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   970  
   971        if (A.load.Bool(ptr + 0 + 64)) {
   972          x["filter"] = {};
   973          if (A.load.Bool(ptr + 0 + 60)) {
   974            x["filter"]["ageLowerBound"] = A.load.Int64(ptr + 0 + 0);
   975          } else {
   976            delete x["filter"]["ageLowerBound"];
   977          }
   978          if (A.load.Bool(ptr + 0 + 61)) {
   979            x["filter"]["ageUpperBound"] = A.load.Int64(ptr + 0 + 8);
   980          } else {
   981            delete x["filter"]["ageUpperBound"];
   982          }
   983          x["filter"]["domain"] = A.load.Ref(ptr + 0 + 16, undefined);
   984          x["filter"]["expires"] = A.load.Ref(ptr + 0 + 20, undefined);
   985          x["filter"]["httpOnly"] = A.load.Ref(ptr + 0 + 24, undefined);
   986          if (A.load.Bool(ptr + 0 + 62)) {
   987            x["filter"]["maxAge"] = A.load.Float64(ptr + 0 + 32);
   988          } else {
   989            delete x["filter"]["maxAge"];
   990          }
   991          x["filter"]["name"] = A.load.Ref(ptr + 0 + 40, undefined);
   992          x["filter"]["path"] = A.load.Ref(ptr + 0 + 44, undefined);
   993          x["filter"]["secure"] = A.load.Ref(ptr + 0 + 48, undefined);
   994          if (A.load.Bool(ptr + 0 + 63)) {
   995            x["filter"]["sessionCookie"] = A.load.Bool(ptr + 0 + 52);
   996          } else {
   997            delete x["filter"]["sessionCookie"];
   998          }
   999          x["filter"]["value"] = A.load.Ref(ptr + 0 + 56, undefined);
  1000        } else {
  1001          delete x["filter"];
  1002        }
  1003        x["instanceType"] = A.load.Enum(ptr + 68, ["declarativeWebRequest.RemoveResponseCookie"]);
  1004        return create === A.H.TRUE ? A.H.push(x) : ref;
  1005      },
  1006      "constof_RemoveResponseHeaderInstanceType": (ref: heap.Ref<string>): number => {
  1007        const idx = ["declarativeWebRequest.RemoveResponseHeader"].indexOf(A.H.get(ref));
  1008        return idx < 0 ? 0 : idx + 1;
  1009      },
  1010  
  1011      "store_RemoveResponseHeader": (ptr: Pointer, ref: heap.Ref<any>) => {
  1012        const x = A.H.get<any>(ref);
  1013  
  1014        if (typeof x === "undefined") {
  1015          A.store.Bool(ptr + 12, false);
  1016          A.store.Enum(ptr + 0, -1);
  1017          A.store.Ref(ptr + 4, undefined);
  1018          A.store.Ref(ptr + 8, undefined);
  1019        } else {
  1020          A.store.Bool(ptr + 12, true);
  1021          A.store.Enum(ptr + 0, ["declarativeWebRequest.RemoveResponseHeader"].indexOf(x["instanceType"] as string));
  1022          A.store.Ref(ptr + 4, x["name"]);
  1023          A.store.Ref(ptr + 8, x["value"]);
  1024        }
  1025      },
  1026      "load_RemoveResponseHeader": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1027        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1028  
  1029        x["instanceType"] = A.load.Enum(ptr + 0, ["declarativeWebRequest.RemoveResponseHeader"]);
  1030        x["name"] = A.load.Ref(ptr + 4, undefined);
  1031        x["value"] = A.load.Ref(ptr + 8, undefined);
  1032        return create === A.H.TRUE ? A.H.push(x) : ref;
  1033      },
  1034      "constof_RequestMatcherInstanceType": (ref: heap.Ref<string>): number => {
  1035        const idx = ["declarativeWebRequest.RequestMatcher"].indexOf(A.H.get(ref));
  1036        return idx < 0 ? 0 : idx + 1;
  1037      },
  1038  
  1039      "store_RequestMatcher": (ptr: Pointer, ref: heap.Ref<any>) => {
  1040        const x = A.H.get<any>(ref);
  1041  
  1042        if (typeof x === "undefined") {
  1043          A.store.Bool(ptr + 206, false);
  1044          A.store.Ref(ptr + 0, undefined);
  1045          A.store.Ref(ptr + 4, undefined);
  1046          A.store.Ref(ptr + 8, undefined);
  1047          A.store.Ref(ptr + 12, undefined);
  1048  
  1049          A.store.Bool(ptr + 16 + 0, false);
  1050          A.store.Ref(ptr + 16 + 0, undefined);
  1051          A.store.Ref(ptr + 16 + 0, undefined);
  1052          A.store.Ref(ptr + 16 + 0, undefined);
  1053          A.store.Ref(ptr + 16 + 0, undefined);
  1054          A.store.Ref(ptr + 16 + 0, undefined);
  1055          A.store.Ref(ptr + 16 + 0, undefined);
  1056          A.store.Ref(ptr + 16 + 0, undefined);
  1057          A.store.Ref(ptr + 16 + 0, undefined);
  1058          A.store.Ref(ptr + 16 + 0, undefined);
  1059          A.store.Ref(ptr + 16 + 0, undefined);
  1060          A.store.Ref(ptr + 16 + 0, undefined);
  1061          A.store.Ref(ptr + 16 + 0, undefined);
  1062          A.store.Ref(ptr + 16 + 0, undefined);
  1063          A.store.Ref(ptr + 16 + 0, undefined);
  1064          A.store.Ref(ptr + 16 + 0, undefined);
  1065          A.store.Ref(ptr + 16 + 0, undefined);
  1066          A.store.Ref(ptr + 16 + 0, undefined);
  1067          A.store.Ref(ptr + 16 + 0, undefined);
  1068          A.store.Ref(ptr + 16 + 0, undefined);
  1069          A.store.Ref(ptr + 16 + 0, undefined);
  1070          A.store.Enum(ptr + 100, -1);
  1071          A.store.Ref(ptr + 104, undefined);
  1072          A.store.Ref(ptr + 108, undefined);
  1073          A.store.Ref(ptr + 112, undefined);
  1074          A.store.Ref(ptr + 116, undefined);
  1075          A.store.Bool(ptr + 205, false);
  1076          A.store.Bool(ptr + 120, false);
  1077  
  1078          A.store.Bool(ptr + 124 + 0, false);
  1079          A.store.Ref(ptr + 124 + 0, undefined);
  1080          A.store.Ref(ptr + 124 + 0, undefined);
  1081          A.store.Ref(ptr + 124 + 0, undefined);
  1082          A.store.Ref(ptr + 124 + 0, undefined);
  1083          A.store.Ref(ptr + 124 + 0, undefined);
  1084          A.store.Ref(ptr + 124 + 0, undefined);
  1085          A.store.Ref(ptr + 124 + 0, undefined);
  1086          A.store.Ref(ptr + 124 + 0, undefined);
  1087          A.store.Ref(ptr + 124 + 0, undefined);
  1088          A.store.Ref(ptr + 124 + 0, undefined);
  1089          A.store.Ref(ptr + 124 + 0, undefined);
  1090          A.store.Ref(ptr + 124 + 0, undefined);
  1091          A.store.Ref(ptr + 124 + 0, undefined);
  1092          A.store.Ref(ptr + 124 + 0, undefined);
  1093          A.store.Ref(ptr + 124 + 0, undefined);
  1094          A.store.Ref(ptr + 124 + 0, undefined);
  1095          A.store.Ref(ptr + 124 + 0, undefined);
  1096          A.store.Ref(ptr + 124 + 0, undefined);
  1097          A.store.Ref(ptr + 124 + 0, undefined);
  1098          A.store.Ref(ptr + 124 + 0, undefined);
  1099        } else {
  1100          A.store.Bool(ptr + 206, true);
  1101          A.store.Ref(ptr + 0, x["contentType"]);
  1102          A.store.Ref(ptr + 4, x["excludeContentType"]);
  1103          A.store.Ref(ptr + 8, x["excludeRequestHeaders"]);
  1104          A.store.Ref(ptr + 12, x["excludeResponseHeaders"]);
  1105  
  1106          if (typeof x["firstPartyForCookiesUrl"] === "undefined") {
  1107            A.store.Bool(ptr + 16 + 0, false);
  1108            A.store.Ref(ptr + 16 + 0, undefined);
  1109            A.store.Ref(ptr + 16 + 0, undefined);
  1110            A.store.Ref(ptr + 16 + 0, undefined);
  1111            A.store.Ref(ptr + 16 + 0, undefined);
  1112            A.store.Ref(ptr + 16 + 0, undefined);
  1113            A.store.Ref(ptr + 16 + 0, undefined);
  1114            A.store.Ref(ptr + 16 + 0, undefined);
  1115            A.store.Ref(ptr + 16 + 0, undefined);
  1116            A.store.Ref(ptr + 16 + 0, undefined);
  1117            A.store.Ref(ptr + 16 + 0, undefined);
  1118            A.store.Ref(ptr + 16 + 0, undefined);
  1119            A.store.Ref(ptr + 16 + 0, undefined);
  1120            A.store.Ref(ptr + 16 + 0, undefined);
  1121            A.store.Ref(ptr + 16 + 0, undefined);
  1122            A.store.Ref(ptr + 16 + 0, undefined);
  1123            A.store.Ref(ptr + 16 + 0, undefined);
  1124            A.store.Ref(ptr + 16 + 0, undefined);
  1125            A.store.Ref(ptr + 16 + 0, undefined);
  1126            A.store.Ref(ptr + 16 + 0, undefined);
  1127            A.store.Ref(ptr + 16 + 0, undefined);
  1128          } else {
  1129            A.store.Bool(ptr + 16 + 0, true);
  1130            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["hostContains"]);
  1131            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["hostEquals"]);
  1132            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["hostPrefix"]);
  1133            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["hostSuffix"]);
  1134            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["originAndPathMatches"]);
  1135            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["pathContains"]);
  1136            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["pathEquals"]);
  1137            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["pathPrefix"]);
  1138            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["pathSuffix"]);
  1139            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["ports"]);
  1140            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["queryContains"]);
  1141            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["queryEquals"]);
  1142            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["queryPrefix"]);
  1143            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["querySuffix"]);
  1144            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["schemes"]);
  1145            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["urlContains"]);
  1146            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["urlEquals"]);
  1147            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["urlMatches"]);
  1148            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["urlPrefix"]);
  1149            A.store.Ref(ptr + 16 + 0, x["firstPartyForCookiesUrl"]["urlSuffix"]);
  1150          }
  1151          A.store.Enum(ptr + 100, ["declarativeWebRequest.RequestMatcher"].indexOf(x["instanceType"] as string));
  1152          A.store.Ref(ptr + 104, x["requestHeaders"]);
  1153          A.store.Ref(ptr + 108, x["resourceType"]);
  1154          A.store.Ref(ptr + 112, x["responseHeaders"]);
  1155          A.store.Ref(ptr + 116, x["stages"]);
  1156          A.store.Bool(ptr + 205, "thirdPartyForCookies" in x ? true : false);
  1157          A.store.Bool(ptr + 120, x["thirdPartyForCookies"] ? true : false);
  1158  
  1159          if (typeof x["url"] === "undefined") {
  1160            A.store.Bool(ptr + 124 + 0, false);
  1161            A.store.Ref(ptr + 124 + 0, undefined);
  1162            A.store.Ref(ptr + 124 + 0, undefined);
  1163            A.store.Ref(ptr + 124 + 0, undefined);
  1164            A.store.Ref(ptr + 124 + 0, undefined);
  1165            A.store.Ref(ptr + 124 + 0, undefined);
  1166            A.store.Ref(ptr + 124 + 0, undefined);
  1167            A.store.Ref(ptr + 124 + 0, undefined);
  1168            A.store.Ref(ptr + 124 + 0, undefined);
  1169            A.store.Ref(ptr + 124 + 0, undefined);
  1170            A.store.Ref(ptr + 124 + 0, undefined);
  1171            A.store.Ref(ptr + 124 + 0, undefined);
  1172            A.store.Ref(ptr + 124 + 0, undefined);
  1173            A.store.Ref(ptr + 124 + 0, undefined);
  1174            A.store.Ref(ptr + 124 + 0, undefined);
  1175            A.store.Ref(ptr + 124 + 0, undefined);
  1176            A.store.Ref(ptr + 124 + 0, undefined);
  1177            A.store.Ref(ptr + 124 + 0, undefined);
  1178            A.store.Ref(ptr + 124 + 0, undefined);
  1179            A.store.Ref(ptr + 124 + 0, undefined);
  1180            A.store.Ref(ptr + 124 + 0, undefined);
  1181          } else {
  1182            A.store.Bool(ptr + 124 + 0, true);
  1183            A.store.Ref(ptr + 124 + 0, x["url"]["hostContains"]);
  1184            A.store.Ref(ptr + 124 + 0, x["url"]["hostEquals"]);
  1185            A.store.Ref(ptr + 124 + 0, x["url"]["hostPrefix"]);
  1186            A.store.Ref(ptr + 124 + 0, x["url"]["hostSuffix"]);
  1187            A.store.Ref(ptr + 124 + 0, x["url"]["originAndPathMatches"]);
  1188            A.store.Ref(ptr + 124 + 0, x["url"]["pathContains"]);
  1189            A.store.Ref(ptr + 124 + 0, x["url"]["pathEquals"]);
  1190            A.store.Ref(ptr + 124 + 0, x["url"]["pathPrefix"]);
  1191            A.store.Ref(ptr + 124 + 0, x["url"]["pathSuffix"]);
  1192            A.store.Ref(ptr + 124 + 0, x["url"]["ports"]);
  1193            A.store.Ref(ptr + 124 + 0, x["url"]["queryContains"]);
  1194            A.store.Ref(ptr + 124 + 0, x["url"]["queryEquals"]);
  1195            A.store.Ref(ptr + 124 + 0, x["url"]["queryPrefix"]);
  1196            A.store.Ref(ptr + 124 + 0, x["url"]["querySuffix"]);
  1197            A.store.Ref(ptr + 124 + 0, x["url"]["schemes"]);
  1198            A.store.Ref(ptr + 124 + 0, x["url"]["urlContains"]);
  1199            A.store.Ref(ptr + 124 + 0, x["url"]["urlEquals"]);
  1200            A.store.Ref(ptr + 124 + 0, x["url"]["urlMatches"]);
  1201            A.store.Ref(ptr + 124 + 0, x["url"]["urlPrefix"]);
  1202            A.store.Ref(ptr + 124 + 0, x["url"]["urlSuffix"]);
  1203          }
  1204        }
  1205      },
  1206      "load_RequestMatcher": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1207        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1208  
  1209        x["contentType"] = A.load.Ref(ptr + 0, undefined);
  1210        x["excludeContentType"] = A.load.Ref(ptr + 4, undefined);
  1211        x["excludeRequestHeaders"] = A.load.Ref(ptr + 8, undefined);
  1212        x["excludeResponseHeaders"] = A.load.Ref(ptr + 12, undefined);
  1213        if (A.load.Bool(ptr + 16 + 0)) {
  1214          x["firstPartyForCookiesUrl"] = {};
  1215          x["firstPartyForCookiesUrl"]["hostContains"] = A.load.Ref(ptr + 16 + 0, undefined);
  1216          x["firstPartyForCookiesUrl"]["hostEquals"] = A.load.Ref(ptr + 16 + 0, undefined);
  1217          x["firstPartyForCookiesUrl"]["hostPrefix"] = A.load.Ref(ptr + 16 + 0, undefined);
  1218          x["firstPartyForCookiesUrl"]["hostSuffix"] = A.load.Ref(ptr + 16 + 0, undefined);
  1219          x["firstPartyForCookiesUrl"]["originAndPathMatches"] = A.load.Ref(ptr + 16 + 0, undefined);
  1220          x["firstPartyForCookiesUrl"]["pathContains"] = A.load.Ref(ptr + 16 + 0, undefined);
  1221          x["firstPartyForCookiesUrl"]["pathEquals"] = A.load.Ref(ptr + 16 + 0, undefined);
  1222          x["firstPartyForCookiesUrl"]["pathPrefix"] = A.load.Ref(ptr + 16 + 0, undefined);
  1223          x["firstPartyForCookiesUrl"]["pathSuffix"] = A.load.Ref(ptr + 16 + 0, undefined);
  1224          x["firstPartyForCookiesUrl"]["ports"] = A.load.Ref(ptr + 16 + 0, undefined);
  1225          x["firstPartyForCookiesUrl"]["queryContains"] = A.load.Ref(ptr + 16 + 0, undefined);
  1226          x["firstPartyForCookiesUrl"]["queryEquals"] = A.load.Ref(ptr + 16 + 0, undefined);
  1227          x["firstPartyForCookiesUrl"]["queryPrefix"] = A.load.Ref(ptr + 16 + 0, undefined);
  1228          x["firstPartyForCookiesUrl"]["querySuffix"] = A.load.Ref(ptr + 16 + 0, undefined);
  1229          x["firstPartyForCookiesUrl"]["schemes"] = A.load.Ref(ptr + 16 + 0, undefined);
  1230          x["firstPartyForCookiesUrl"]["urlContains"] = A.load.Ref(ptr + 16 + 0, undefined);
  1231          x["firstPartyForCookiesUrl"]["urlEquals"] = A.load.Ref(ptr + 16 + 0, undefined);
  1232          x["firstPartyForCookiesUrl"]["urlMatches"] = A.load.Ref(ptr + 16 + 0, undefined);
  1233          x["firstPartyForCookiesUrl"]["urlPrefix"] = A.load.Ref(ptr + 16 + 0, undefined);
  1234          x["firstPartyForCookiesUrl"]["urlSuffix"] = A.load.Ref(ptr + 16 + 0, undefined);
  1235        } else {
  1236          delete x["firstPartyForCookiesUrl"];
  1237        }
  1238        x["instanceType"] = A.load.Enum(ptr + 100, ["declarativeWebRequest.RequestMatcher"]);
  1239        x["requestHeaders"] = A.load.Ref(ptr + 104, undefined);
  1240        x["resourceType"] = A.load.Ref(ptr + 108, undefined);
  1241        x["responseHeaders"] = A.load.Ref(ptr + 112, undefined);
  1242        x["stages"] = A.load.Ref(ptr + 116, undefined);
  1243        if (A.load.Bool(ptr + 205)) {
  1244          x["thirdPartyForCookies"] = A.load.Bool(ptr + 120);
  1245        } else {
  1246          delete x["thirdPartyForCookies"];
  1247        }
  1248        if (A.load.Bool(ptr + 124 + 0)) {
  1249          x["url"] = {};
  1250          x["url"]["hostContains"] = A.load.Ref(ptr + 124 + 0, undefined);
  1251          x["url"]["hostEquals"] = A.load.Ref(ptr + 124 + 0, undefined);
  1252          x["url"]["hostPrefix"] = A.load.Ref(ptr + 124 + 0, undefined);
  1253          x["url"]["hostSuffix"] = A.load.Ref(ptr + 124 + 0, undefined);
  1254          x["url"]["originAndPathMatches"] = A.load.Ref(ptr + 124 + 0, undefined);
  1255          x["url"]["pathContains"] = A.load.Ref(ptr + 124 + 0, undefined);
  1256          x["url"]["pathEquals"] = A.load.Ref(ptr + 124 + 0, undefined);
  1257          x["url"]["pathPrefix"] = A.load.Ref(ptr + 124 + 0, undefined);
  1258          x["url"]["pathSuffix"] = A.load.Ref(ptr + 124 + 0, undefined);
  1259          x["url"]["ports"] = A.load.Ref(ptr + 124 + 0, undefined);
  1260          x["url"]["queryContains"] = A.load.Ref(ptr + 124 + 0, undefined);
  1261          x["url"]["queryEquals"] = A.load.Ref(ptr + 124 + 0, undefined);
  1262          x["url"]["queryPrefix"] = A.load.Ref(ptr + 124 + 0, undefined);
  1263          x["url"]["querySuffix"] = A.load.Ref(ptr + 124 + 0, undefined);
  1264          x["url"]["schemes"] = A.load.Ref(ptr + 124 + 0, undefined);
  1265          x["url"]["urlContains"] = A.load.Ref(ptr + 124 + 0, undefined);
  1266          x["url"]["urlEquals"] = A.load.Ref(ptr + 124 + 0, undefined);
  1267          x["url"]["urlMatches"] = A.load.Ref(ptr + 124 + 0, undefined);
  1268          x["url"]["urlPrefix"] = A.load.Ref(ptr + 124 + 0, undefined);
  1269          x["url"]["urlSuffix"] = A.load.Ref(ptr + 124 + 0, undefined);
  1270        } else {
  1271          delete x["url"];
  1272        }
  1273        return create === A.H.TRUE ? A.H.push(x) : ref;
  1274      },
  1275      "constof_SendMessageToExtensionInstanceType": (ref: heap.Ref<string>): number => {
  1276        const idx = ["declarativeWebRequest.SendMessageToExtension"].indexOf(A.H.get(ref));
  1277        return idx < 0 ? 0 : idx + 1;
  1278      },
  1279  
  1280      "store_SendMessageToExtension": (ptr: Pointer, ref: heap.Ref<any>) => {
  1281        const x = A.H.get<any>(ref);
  1282  
  1283        if (typeof x === "undefined") {
  1284          A.store.Bool(ptr + 8, false);
  1285          A.store.Enum(ptr + 0, -1);
  1286          A.store.Ref(ptr + 4, undefined);
  1287        } else {
  1288          A.store.Bool(ptr + 8, true);
  1289          A.store.Enum(ptr + 0, ["declarativeWebRequest.SendMessageToExtension"].indexOf(x["instanceType"] as string));
  1290          A.store.Ref(ptr + 4, x["message"]);
  1291        }
  1292      },
  1293      "load_SendMessageToExtension": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1294        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1295  
  1296        x["instanceType"] = A.load.Enum(ptr + 0, ["declarativeWebRequest.SendMessageToExtension"]);
  1297        x["message"] = A.load.Ref(ptr + 4, undefined);
  1298        return create === A.H.TRUE ? A.H.push(x) : ref;
  1299      },
  1300      "constof_SetRequestHeaderInstanceType": (ref: heap.Ref<string>): number => {
  1301        const idx = ["declarativeWebRequest.SetRequestHeader"].indexOf(A.H.get(ref));
  1302        return idx < 0 ? 0 : idx + 1;
  1303      },
  1304  
  1305      "store_SetRequestHeader": (ptr: Pointer, ref: heap.Ref<any>) => {
  1306        const x = A.H.get<any>(ref);
  1307  
  1308        if (typeof x === "undefined") {
  1309          A.store.Bool(ptr + 12, false);
  1310          A.store.Enum(ptr + 0, -1);
  1311          A.store.Ref(ptr + 4, undefined);
  1312          A.store.Ref(ptr + 8, undefined);
  1313        } else {
  1314          A.store.Bool(ptr + 12, true);
  1315          A.store.Enum(ptr + 0, ["declarativeWebRequest.SetRequestHeader"].indexOf(x["instanceType"] as string));
  1316          A.store.Ref(ptr + 4, x["name"]);
  1317          A.store.Ref(ptr + 8, x["value"]);
  1318        }
  1319      },
  1320      "load_SetRequestHeader": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1321        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1322  
  1323        x["instanceType"] = A.load.Enum(ptr + 0, ["declarativeWebRequest.SetRequestHeader"]);
  1324        x["name"] = A.load.Ref(ptr + 4, undefined);
  1325        x["value"] = A.load.Ref(ptr + 8, undefined);
  1326        return create === A.H.TRUE ? A.H.push(x) : ref;
  1327      },
  1328      "has_OnMessage": (): heap.Ref<boolean> => {
  1329        if (WEBEXT?.declarativeWebRequest?.onMessage && "addListener" in WEBEXT?.declarativeWebRequest?.onMessage) {
  1330          return A.H.TRUE;
  1331        }
  1332        return A.H.FALSE;
  1333      },
  1334      "func_OnMessage": (fn: Pointer): void => {
  1335        A.store.Ref(fn, WEBEXT.declarativeWebRequest.onMessage.addListener);
  1336      },
  1337      "call_OnMessage": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1338        const _ret = WEBEXT.declarativeWebRequest.onMessage.addListener(A.H.get<object>(callback));
  1339      },
  1340      "try_OnMessage": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1341        try {
  1342          const _ret = WEBEXT.declarativeWebRequest.onMessage.addListener(A.H.get<object>(callback));
  1343          return A.H.TRUE;
  1344        } catch (err: any) {
  1345          A.store.Ref(errPtr, err);
  1346          return A.H.FALSE;
  1347        }
  1348      },
  1349      "has_OffMessage": (): heap.Ref<boolean> => {
  1350        if (WEBEXT?.declarativeWebRequest?.onMessage && "removeListener" in WEBEXT?.declarativeWebRequest?.onMessage) {
  1351          return A.H.TRUE;
  1352        }
  1353        return A.H.FALSE;
  1354      },
  1355      "func_OffMessage": (fn: Pointer): void => {
  1356        A.store.Ref(fn, WEBEXT.declarativeWebRequest.onMessage.removeListener);
  1357      },
  1358      "call_OffMessage": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1359        const _ret = WEBEXT.declarativeWebRequest.onMessage.removeListener(A.H.get<object>(callback));
  1360      },
  1361      "try_OffMessage": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1362        try {
  1363          const _ret = WEBEXT.declarativeWebRequest.onMessage.removeListener(A.H.get<object>(callback));
  1364          return A.H.TRUE;
  1365        } catch (err: any) {
  1366          A.store.Ref(errPtr, err);
  1367          return A.H.FALSE;
  1368        }
  1369      },
  1370      "has_HasOnMessage": (): heap.Ref<boolean> => {
  1371        if (WEBEXT?.declarativeWebRequest?.onMessage && "hasListener" in WEBEXT?.declarativeWebRequest?.onMessage) {
  1372          return A.H.TRUE;
  1373        }
  1374        return A.H.FALSE;
  1375      },
  1376      "func_HasOnMessage": (fn: Pointer): void => {
  1377        A.store.Ref(fn, WEBEXT.declarativeWebRequest.onMessage.hasListener);
  1378      },
  1379      "call_HasOnMessage": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1380        const _ret = WEBEXT.declarativeWebRequest.onMessage.hasListener(A.H.get<object>(callback));
  1381        A.store.Bool(retPtr, _ret);
  1382      },
  1383      "try_HasOnMessage": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1384        try {
  1385          const _ret = WEBEXT.declarativeWebRequest.onMessage.hasListener(A.H.get<object>(callback));
  1386          A.store.Bool(retPtr, _ret);
  1387          return A.H.TRUE;
  1388        } catch (err: any) {
  1389          A.store.Ref(errPtr, err);
  1390          return A.H.FALSE;
  1391        }
  1392      },
  1393      "has_OnRequest": (): heap.Ref<boolean> => {
  1394        if (WEBEXT?.declarativeWebRequest?.onRequest && "addListener" in WEBEXT?.declarativeWebRequest?.onRequest) {
  1395          return A.H.TRUE;
  1396        }
  1397        return A.H.FALSE;
  1398      },
  1399      "func_OnRequest": (fn: Pointer): void => {
  1400        A.store.Ref(fn, WEBEXT.declarativeWebRequest.onRequest.addListener);
  1401      },
  1402      "call_OnRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1403        const _ret = WEBEXT.declarativeWebRequest.onRequest.addListener(A.H.get<object>(callback));
  1404      },
  1405      "try_OnRequest": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1406        try {
  1407          const _ret = WEBEXT.declarativeWebRequest.onRequest.addListener(A.H.get<object>(callback));
  1408          return A.H.TRUE;
  1409        } catch (err: any) {
  1410          A.store.Ref(errPtr, err);
  1411          return A.H.FALSE;
  1412        }
  1413      },
  1414      "has_OffRequest": (): heap.Ref<boolean> => {
  1415        if (WEBEXT?.declarativeWebRequest?.onRequest && "removeListener" in WEBEXT?.declarativeWebRequest?.onRequest) {
  1416          return A.H.TRUE;
  1417        }
  1418        return A.H.FALSE;
  1419      },
  1420      "func_OffRequest": (fn: Pointer): void => {
  1421        A.store.Ref(fn, WEBEXT.declarativeWebRequest.onRequest.removeListener);
  1422      },
  1423      "call_OffRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1424        const _ret = WEBEXT.declarativeWebRequest.onRequest.removeListener(A.H.get<object>(callback));
  1425      },
  1426      "try_OffRequest": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1427        try {
  1428          const _ret = WEBEXT.declarativeWebRequest.onRequest.removeListener(A.H.get<object>(callback));
  1429          return A.H.TRUE;
  1430        } catch (err: any) {
  1431          A.store.Ref(errPtr, err);
  1432          return A.H.FALSE;
  1433        }
  1434      },
  1435      "has_HasOnRequest": (): heap.Ref<boolean> => {
  1436        if (WEBEXT?.declarativeWebRequest?.onRequest && "hasListener" in WEBEXT?.declarativeWebRequest?.onRequest) {
  1437          return A.H.TRUE;
  1438        }
  1439        return A.H.FALSE;
  1440      },
  1441      "func_HasOnRequest": (fn: Pointer): void => {
  1442        A.store.Ref(fn, WEBEXT.declarativeWebRequest.onRequest.hasListener);
  1443      },
  1444      "call_HasOnRequest": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  1445        const _ret = WEBEXT.declarativeWebRequest.onRequest.hasListener(A.H.get<object>(callback));
  1446        A.store.Bool(retPtr, _ret);
  1447      },
  1448      "try_HasOnRequest": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  1449        try {
  1450          const _ret = WEBEXT.declarativeWebRequest.onRequest.hasListener(A.H.get<object>(callback));
  1451          A.store.Bool(retPtr, _ret);
  1452          return A.H.TRUE;
  1453        } catch (err: any) {
  1454          A.store.Ref(errPtr, err);
  1455          return A.H.FALSE;
  1456        }
  1457      },
  1458    };
  1459  });