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

     1  import { importModule, Application, heap, Pointer } from "@ffi";
     2  
     3  importModule("plat/js/webext/declarativenetrequest", (A: Application) => {
     4    const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser;
     5  
     6    return {
     7      "store_Ruleset": (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 + 10, false);
    12          A.store.Ref(ptr + 0, undefined);
    13          A.store.Ref(ptr + 4, undefined);
    14          A.store.Bool(ptr + 9, false);
    15          A.store.Bool(ptr + 8, false);
    16        } else {
    17          A.store.Bool(ptr + 10, true);
    18          A.store.Ref(ptr + 0, x["id"]);
    19          A.store.Ref(ptr + 4, x["path"]);
    20          A.store.Bool(ptr + 9, "enabled" in x ? true : false);
    21          A.store.Bool(ptr + 8, x["enabled"] ? true : false);
    22        }
    23      },
    24      "load_Ruleset": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    25        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    26  
    27        x["id"] = A.load.Ref(ptr + 0, undefined);
    28        x["path"] = A.load.Ref(ptr + 4, undefined);
    29        if (A.load.Bool(ptr + 9)) {
    30          x["enabled"] = A.load.Bool(ptr + 8);
    31        } else {
    32          delete x["enabled"];
    33        }
    34        return create === A.H.TRUE ? A.H.push(x) : ref;
    35      },
    36  
    37      "store_DNRInfo": (ptr: Pointer, ref: heap.Ref<any>) => {
    38        const x = A.H.get<any>(ref);
    39  
    40        if (typeof x === "undefined") {
    41          A.store.Bool(ptr + 4, false);
    42          A.store.Ref(ptr + 0, undefined);
    43        } else {
    44          A.store.Bool(ptr + 4, true);
    45          A.store.Ref(ptr + 0, x["rule_resources"]);
    46        }
    47      },
    48      "load_DNRInfo": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    49        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    50  
    51        x["rule_resources"] = A.load.Ref(ptr + 0, undefined);
    52        return create === A.H.TRUE ? A.H.push(x) : ref;
    53      },
    54      "constof_DomainType": (ref: heap.Ref<string>): number => {
    55        const idx = ["firstParty", "thirdParty"].indexOf(A.H.get(ref));
    56        return idx < 0 ? 0 : idx + 1;
    57      },
    58  
    59      "store_TabActionCountUpdate": (ptr: Pointer, ref: heap.Ref<any>) => {
    60        const x = A.H.get<any>(ref);
    61  
    62        if (typeof x === "undefined") {
    63          A.store.Bool(ptr + 10, false);
    64          A.store.Bool(ptr + 8, false);
    65          A.store.Int32(ptr + 0, 0);
    66          A.store.Bool(ptr + 9, false);
    67          A.store.Int32(ptr + 4, 0);
    68        } else {
    69          A.store.Bool(ptr + 10, true);
    70          A.store.Bool(ptr + 8, "tabId" in x ? true : false);
    71          A.store.Int32(ptr + 0, x["tabId"] === undefined ? 0 : (x["tabId"] as number));
    72          A.store.Bool(ptr + 9, "increment" in x ? true : false);
    73          A.store.Int32(ptr + 4, x["increment"] === undefined ? 0 : (x["increment"] as number));
    74        }
    75      },
    76      "load_TabActionCountUpdate": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    77        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    78  
    79        if (A.load.Bool(ptr + 8)) {
    80          x["tabId"] = A.load.Int32(ptr + 0);
    81        } else {
    82          delete x["tabId"];
    83        }
    84        if (A.load.Bool(ptr + 9)) {
    85          x["increment"] = A.load.Int32(ptr + 4);
    86        } else {
    87          delete x["increment"];
    88        }
    89        return create === A.H.TRUE ? A.H.push(x) : ref;
    90      },
    91  
    92      "store_ExtensionActionOptions": (ptr: Pointer, ref: heap.Ref<any>) => {
    93        const x = A.H.get<any>(ref);
    94  
    95        if (typeof x === "undefined") {
    96          A.store.Bool(ptr + 16, false);
    97          A.store.Bool(ptr + 15, false);
    98          A.store.Bool(ptr + 0, false);
    99  
   100          A.store.Bool(ptr + 4 + 10, false);
   101          A.store.Bool(ptr + 4 + 8, false);
   102          A.store.Int32(ptr + 4 + 0, 0);
   103          A.store.Bool(ptr + 4 + 9, false);
   104          A.store.Int32(ptr + 4 + 4, 0);
   105        } else {
   106          A.store.Bool(ptr + 16, true);
   107          A.store.Bool(ptr + 15, "displayActionCountAsBadgeText" in x ? true : false);
   108          A.store.Bool(ptr + 0, x["displayActionCountAsBadgeText"] ? true : false);
   109  
   110          if (typeof x["tabUpdate"] === "undefined") {
   111            A.store.Bool(ptr + 4 + 10, false);
   112            A.store.Bool(ptr + 4 + 8, false);
   113            A.store.Int32(ptr + 4 + 0, 0);
   114            A.store.Bool(ptr + 4 + 9, false);
   115            A.store.Int32(ptr + 4 + 4, 0);
   116          } else {
   117            A.store.Bool(ptr + 4 + 10, true);
   118            A.store.Bool(ptr + 4 + 8, "tabId" in x["tabUpdate"] ? true : false);
   119            A.store.Int32(ptr + 4 + 0, x["tabUpdate"]["tabId"] === undefined ? 0 : (x["tabUpdate"]["tabId"] as number));
   120            A.store.Bool(ptr + 4 + 9, "increment" in x["tabUpdate"] ? true : false);
   121            A.store.Int32(
   122              ptr + 4 + 4,
   123              x["tabUpdate"]["increment"] === undefined ? 0 : (x["tabUpdate"]["increment"] as number)
   124            );
   125          }
   126        }
   127      },
   128      "load_ExtensionActionOptions": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   129        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   130  
   131        if (A.load.Bool(ptr + 15)) {
   132          x["displayActionCountAsBadgeText"] = A.load.Bool(ptr + 0);
   133        } else {
   134          delete x["displayActionCountAsBadgeText"];
   135        }
   136        if (A.load.Bool(ptr + 4 + 10)) {
   137          x["tabUpdate"] = {};
   138          if (A.load.Bool(ptr + 4 + 8)) {
   139            x["tabUpdate"]["tabId"] = A.load.Int32(ptr + 4 + 0);
   140          } else {
   141            delete x["tabUpdate"]["tabId"];
   142          }
   143          if (A.load.Bool(ptr + 4 + 9)) {
   144            x["tabUpdate"]["increment"] = A.load.Int32(ptr + 4 + 4);
   145          } else {
   146            delete x["tabUpdate"]["increment"];
   147          }
   148        } else {
   149          delete x["tabUpdate"];
   150        }
   151        return create === A.H.TRUE ? A.H.push(x) : ref;
   152      },
   153  
   154      "store_GetDisabledRuleIdsOptions": (ptr: Pointer, ref: heap.Ref<any>) => {
   155        const x = A.H.get<any>(ref);
   156  
   157        if (typeof x === "undefined") {
   158          A.store.Bool(ptr + 4, false);
   159          A.store.Ref(ptr + 0, undefined);
   160        } else {
   161          A.store.Bool(ptr + 4, true);
   162          A.store.Ref(ptr + 0, x["rulesetId"]);
   163        }
   164      },
   165      "load_GetDisabledRuleIdsOptions": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   166        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   167  
   168        x["rulesetId"] = A.load.Ref(ptr + 0, undefined);
   169        return create === A.H.TRUE ? A.H.push(x) : ref;
   170      },
   171  
   172      "store_MatchedRule": (ptr: Pointer, ref: heap.Ref<any>) => {
   173        const x = A.H.get<any>(ref);
   174  
   175        if (typeof x === "undefined") {
   176          A.store.Bool(ptr + 9, false);
   177          A.store.Bool(ptr + 8, false);
   178          A.store.Int32(ptr + 0, 0);
   179          A.store.Ref(ptr + 4, undefined);
   180        } else {
   181          A.store.Bool(ptr + 9, true);
   182          A.store.Bool(ptr + 8, "ruleId" in x ? true : false);
   183          A.store.Int32(ptr + 0, x["ruleId"] === undefined ? 0 : (x["ruleId"] as number));
   184          A.store.Ref(ptr + 4, x["rulesetId"]);
   185        }
   186      },
   187      "load_MatchedRule": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   188        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   189  
   190        if (A.load.Bool(ptr + 8)) {
   191          x["ruleId"] = A.load.Int32(ptr + 0);
   192        } else {
   193          delete x["ruleId"];
   194        }
   195        x["rulesetId"] = A.load.Ref(ptr + 4, undefined);
   196        return create === A.H.TRUE ? A.H.push(x) : ref;
   197      },
   198  
   199      "store_MatchedRuleInfo": (ptr: Pointer, ref: heap.Ref<any>) => {
   200        const x = A.H.get<any>(ref);
   201  
   202        if (typeof x === "undefined") {
   203          A.store.Bool(ptr + 30, false);
   204  
   205          A.store.Bool(ptr + 0 + 9, false);
   206          A.store.Bool(ptr + 0 + 8, false);
   207          A.store.Int32(ptr + 0 + 0, 0);
   208          A.store.Ref(ptr + 0 + 4, undefined);
   209          A.store.Bool(ptr + 28, false);
   210          A.store.Float64(ptr + 16, 0);
   211          A.store.Bool(ptr + 29, false);
   212          A.store.Int32(ptr + 24, 0);
   213        } else {
   214          A.store.Bool(ptr + 30, true);
   215  
   216          if (typeof x["rule"] === "undefined") {
   217            A.store.Bool(ptr + 0 + 9, false);
   218            A.store.Bool(ptr + 0 + 8, false);
   219            A.store.Int32(ptr + 0 + 0, 0);
   220            A.store.Ref(ptr + 0 + 4, undefined);
   221          } else {
   222            A.store.Bool(ptr + 0 + 9, true);
   223            A.store.Bool(ptr + 0 + 8, "ruleId" in x["rule"] ? true : false);
   224            A.store.Int32(ptr + 0 + 0, x["rule"]["ruleId"] === undefined ? 0 : (x["rule"]["ruleId"] as number));
   225            A.store.Ref(ptr + 0 + 4, x["rule"]["rulesetId"]);
   226          }
   227          A.store.Bool(ptr + 28, "timeStamp" in x ? true : false);
   228          A.store.Float64(ptr + 16, x["timeStamp"] === undefined ? 0 : (x["timeStamp"] as number));
   229          A.store.Bool(ptr + 29, "tabId" in x ? true : false);
   230          A.store.Int32(ptr + 24, x["tabId"] === undefined ? 0 : (x["tabId"] as number));
   231        }
   232      },
   233      "load_MatchedRuleInfo": (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        if (A.load.Bool(ptr + 0 + 9)) {
   237          x["rule"] = {};
   238          if (A.load.Bool(ptr + 0 + 8)) {
   239            x["rule"]["ruleId"] = A.load.Int32(ptr + 0 + 0);
   240          } else {
   241            delete x["rule"]["ruleId"];
   242          }
   243          x["rule"]["rulesetId"] = A.load.Ref(ptr + 0 + 4, undefined);
   244        } else {
   245          delete x["rule"];
   246        }
   247        if (A.load.Bool(ptr + 28)) {
   248          x["timeStamp"] = A.load.Float64(ptr + 16);
   249        } else {
   250          delete x["timeStamp"];
   251        }
   252        if (A.load.Bool(ptr + 29)) {
   253          x["tabId"] = A.load.Int32(ptr + 24);
   254        } else {
   255          delete x["tabId"];
   256        }
   257        return create === A.H.TRUE ? A.H.push(x) : ref;
   258      },
   259  
   260      "store_RulesMatchedDetails": (ptr: Pointer, ref: heap.Ref<any>) => {
   261        const x = A.H.get<any>(ref);
   262  
   263        if (typeof x === "undefined") {
   264          A.store.Bool(ptr + 4, false);
   265          A.store.Ref(ptr + 0, undefined);
   266        } else {
   267          A.store.Bool(ptr + 4, true);
   268          A.store.Ref(ptr + 0, x["rulesMatchedInfo"]);
   269        }
   270      },
   271      "load_RulesMatchedDetails": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   272        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   273  
   274        x["rulesMatchedInfo"] = A.load.Ref(ptr + 0, undefined);
   275        return create === A.H.TRUE ? A.H.push(x) : ref;
   276      },
   277      "constof_ResourceType": (ref: heap.Ref<string>): number => {
   278        const idx = [
   279          "main_frame",
   280          "sub_frame",
   281          "stylesheet",
   282          "script",
   283          "image",
   284          "font",
   285          "object",
   286          "xmlhttprequest",
   287          "ping",
   288          "csp_report",
   289          "media",
   290          "websocket",
   291          "webtransport",
   292          "webbundle",
   293          "other",
   294        ].indexOf(A.H.get(ref));
   295        return idx < 0 ? 0 : idx + 1;
   296      },
   297      "constof_RequestMethod": (ref: heap.Ref<string>): number => {
   298        const idx = ["connect", "delete", "get", "head", "options", "patch", "post", "put", "other"].indexOf(
   299          A.H.get(ref)
   300        );
   301        return idx < 0 ? 0 : idx + 1;
   302      },
   303  
   304      "store_RuleCondition": (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 + 65, false);
   309          A.store.Ref(ptr + 0, undefined);
   310          A.store.Ref(ptr + 4, undefined);
   311          A.store.Bool(ptr + 64, false);
   312          A.store.Bool(ptr + 8, false);
   313          A.store.Ref(ptr + 12, undefined);
   314          A.store.Ref(ptr + 16, undefined);
   315          A.store.Ref(ptr + 20, undefined);
   316          A.store.Ref(ptr + 24, undefined);
   317          A.store.Ref(ptr + 28, undefined);
   318          A.store.Ref(ptr + 32, undefined);
   319          A.store.Ref(ptr + 36, undefined);
   320          A.store.Ref(ptr + 40, undefined);
   321          A.store.Ref(ptr + 44, undefined);
   322          A.store.Ref(ptr + 48, undefined);
   323          A.store.Enum(ptr + 52, -1);
   324          A.store.Ref(ptr + 56, undefined);
   325          A.store.Ref(ptr + 60, undefined);
   326        } else {
   327          A.store.Bool(ptr + 65, true);
   328          A.store.Ref(ptr + 0, x["urlFilter"]);
   329          A.store.Ref(ptr + 4, x["regexFilter"]);
   330          A.store.Bool(ptr + 64, "isUrlFilterCaseSensitive" in x ? true : false);
   331          A.store.Bool(ptr + 8, x["isUrlFilterCaseSensitive"] ? true : false);
   332          A.store.Ref(ptr + 12, x["initiatorDomains"]);
   333          A.store.Ref(ptr + 16, x["excludedInitiatorDomains"]);
   334          A.store.Ref(ptr + 20, x["requestDomains"]);
   335          A.store.Ref(ptr + 24, x["excludedRequestDomains"]);
   336          A.store.Ref(ptr + 28, x["domains"]);
   337          A.store.Ref(ptr + 32, x["excludedDomains"]);
   338          A.store.Ref(ptr + 36, x["resourceTypes"]);
   339          A.store.Ref(ptr + 40, x["excludedResourceTypes"]);
   340          A.store.Ref(ptr + 44, x["requestMethods"]);
   341          A.store.Ref(ptr + 48, x["excludedRequestMethods"]);
   342          A.store.Enum(ptr + 52, ["firstParty", "thirdParty"].indexOf(x["domainType"] as string));
   343          A.store.Ref(ptr + 56, x["tabIds"]);
   344          A.store.Ref(ptr + 60, x["excludedTabIds"]);
   345        }
   346      },
   347      "load_RuleCondition": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   348        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   349  
   350        x["urlFilter"] = A.load.Ref(ptr + 0, undefined);
   351        x["regexFilter"] = A.load.Ref(ptr + 4, undefined);
   352        if (A.load.Bool(ptr + 64)) {
   353          x["isUrlFilterCaseSensitive"] = A.load.Bool(ptr + 8);
   354        } else {
   355          delete x["isUrlFilterCaseSensitive"];
   356        }
   357        x["initiatorDomains"] = A.load.Ref(ptr + 12, undefined);
   358        x["excludedInitiatorDomains"] = A.load.Ref(ptr + 16, undefined);
   359        x["requestDomains"] = A.load.Ref(ptr + 20, undefined);
   360        x["excludedRequestDomains"] = A.load.Ref(ptr + 24, undefined);
   361        x["domains"] = A.load.Ref(ptr + 28, undefined);
   362        x["excludedDomains"] = A.load.Ref(ptr + 32, undefined);
   363        x["resourceTypes"] = A.load.Ref(ptr + 36, undefined);
   364        x["excludedResourceTypes"] = A.load.Ref(ptr + 40, undefined);
   365        x["requestMethods"] = A.load.Ref(ptr + 44, undefined);
   366        x["excludedRequestMethods"] = A.load.Ref(ptr + 48, undefined);
   367        x["domainType"] = A.load.Enum(ptr + 52, ["firstParty", "thirdParty"]);
   368        x["tabIds"] = A.load.Ref(ptr + 56, undefined);
   369        x["excludedTabIds"] = A.load.Ref(ptr + 60, undefined);
   370        return create === A.H.TRUE ? A.H.push(x) : ref;
   371      },
   372      "constof_RuleActionType": (ref: heap.Ref<string>): number => {
   373        const idx = ["block", "redirect", "allow", "upgradeScheme", "modifyHeaders", "allowAllRequests"].indexOf(
   374          A.H.get(ref)
   375        );
   376        return idx < 0 ? 0 : idx + 1;
   377      },
   378  
   379      "store_QueryKeyValue": (ptr: Pointer, ref: heap.Ref<any>) => {
   380        const x = A.H.get<any>(ref);
   381  
   382        if (typeof x === "undefined") {
   383          A.store.Bool(ptr + 10, false);
   384          A.store.Ref(ptr + 0, undefined);
   385          A.store.Ref(ptr + 4, undefined);
   386          A.store.Bool(ptr + 9, false);
   387          A.store.Bool(ptr + 8, false);
   388        } else {
   389          A.store.Bool(ptr + 10, true);
   390          A.store.Ref(ptr + 0, x["key"]);
   391          A.store.Ref(ptr + 4, x["value"]);
   392          A.store.Bool(ptr + 9, "replaceOnly" in x ? true : false);
   393          A.store.Bool(ptr + 8, x["replaceOnly"] ? true : false);
   394        }
   395      },
   396      "load_QueryKeyValue": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   397        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   398  
   399        x["key"] = A.load.Ref(ptr + 0, undefined);
   400        x["value"] = A.load.Ref(ptr + 4, undefined);
   401        if (A.load.Bool(ptr + 9)) {
   402          x["replaceOnly"] = A.load.Bool(ptr + 8);
   403        } else {
   404          delete x["replaceOnly"];
   405        }
   406        return create === A.H.TRUE ? A.H.push(x) : ref;
   407      },
   408  
   409      "store_QueryTransform": (ptr: Pointer, ref: heap.Ref<any>) => {
   410        const x = A.H.get<any>(ref);
   411  
   412        if (typeof x === "undefined") {
   413          A.store.Bool(ptr + 8, false);
   414          A.store.Ref(ptr + 0, undefined);
   415          A.store.Ref(ptr + 4, undefined);
   416        } else {
   417          A.store.Bool(ptr + 8, true);
   418          A.store.Ref(ptr + 0, x["removeParams"]);
   419          A.store.Ref(ptr + 4, x["addOrReplaceParams"]);
   420        }
   421      },
   422      "load_QueryTransform": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   423        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   424  
   425        x["removeParams"] = A.load.Ref(ptr + 0, undefined);
   426        x["addOrReplaceParams"] = A.load.Ref(ptr + 4, undefined);
   427        return create === A.H.TRUE ? A.H.push(x) : ref;
   428      },
   429  
   430      "store_URLTransform": (ptr: Pointer, ref: heap.Ref<any>) => {
   431        const x = A.H.get<any>(ref);
   432  
   433        if (typeof x === "undefined") {
   434          A.store.Bool(ptr + 44, false);
   435          A.store.Ref(ptr + 0, undefined);
   436          A.store.Ref(ptr + 4, undefined);
   437          A.store.Ref(ptr + 8, undefined);
   438          A.store.Ref(ptr + 12, undefined);
   439          A.store.Ref(ptr + 16, undefined);
   440  
   441          A.store.Bool(ptr + 20 + 8, false);
   442          A.store.Ref(ptr + 20 + 0, undefined);
   443          A.store.Ref(ptr + 20 + 4, undefined);
   444          A.store.Ref(ptr + 32, undefined);
   445          A.store.Ref(ptr + 36, undefined);
   446          A.store.Ref(ptr + 40, undefined);
   447        } else {
   448          A.store.Bool(ptr + 44, true);
   449          A.store.Ref(ptr + 0, x["scheme"]);
   450          A.store.Ref(ptr + 4, x["host"]);
   451          A.store.Ref(ptr + 8, x["port"]);
   452          A.store.Ref(ptr + 12, x["path"]);
   453          A.store.Ref(ptr + 16, x["query"]);
   454  
   455          if (typeof x["queryTransform"] === "undefined") {
   456            A.store.Bool(ptr + 20 + 8, false);
   457            A.store.Ref(ptr + 20 + 0, undefined);
   458            A.store.Ref(ptr + 20 + 4, undefined);
   459          } else {
   460            A.store.Bool(ptr + 20 + 8, true);
   461            A.store.Ref(ptr + 20 + 0, x["queryTransform"]["removeParams"]);
   462            A.store.Ref(ptr + 20 + 4, x["queryTransform"]["addOrReplaceParams"]);
   463          }
   464          A.store.Ref(ptr + 32, x["fragment"]);
   465          A.store.Ref(ptr + 36, x["username"]);
   466          A.store.Ref(ptr + 40, x["password"]);
   467        }
   468      },
   469      "load_URLTransform": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   470        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   471  
   472        x["scheme"] = A.load.Ref(ptr + 0, undefined);
   473        x["host"] = A.load.Ref(ptr + 4, undefined);
   474        x["port"] = A.load.Ref(ptr + 8, undefined);
   475        x["path"] = A.load.Ref(ptr + 12, undefined);
   476        x["query"] = A.load.Ref(ptr + 16, undefined);
   477        if (A.load.Bool(ptr + 20 + 8)) {
   478          x["queryTransform"] = {};
   479          x["queryTransform"]["removeParams"] = A.load.Ref(ptr + 20 + 0, undefined);
   480          x["queryTransform"]["addOrReplaceParams"] = A.load.Ref(ptr + 20 + 4, undefined);
   481        } else {
   482          delete x["queryTransform"];
   483        }
   484        x["fragment"] = A.load.Ref(ptr + 32, undefined);
   485        x["username"] = A.load.Ref(ptr + 36, undefined);
   486        x["password"] = A.load.Ref(ptr + 40, undefined);
   487        return create === A.H.TRUE ? A.H.push(x) : ref;
   488      },
   489  
   490      "store_Redirect": (ptr: Pointer, ref: heap.Ref<any>) => {
   491        const x = A.H.get<any>(ref);
   492  
   493        if (typeof x === "undefined") {
   494          A.store.Bool(ptr + 60, false);
   495          A.store.Ref(ptr + 0, undefined);
   496  
   497          A.store.Bool(ptr + 4 + 44, false);
   498          A.store.Ref(ptr + 4 + 0, undefined);
   499          A.store.Ref(ptr + 4 + 4, undefined);
   500          A.store.Ref(ptr + 4 + 8, undefined);
   501          A.store.Ref(ptr + 4 + 12, undefined);
   502          A.store.Ref(ptr + 4 + 16, undefined);
   503  
   504          A.store.Bool(ptr + 4 + 20 + 8, false);
   505          A.store.Ref(ptr + 4 + 20 + 0, undefined);
   506          A.store.Ref(ptr + 4 + 20 + 4, undefined);
   507          A.store.Ref(ptr + 4 + 32, undefined);
   508          A.store.Ref(ptr + 4 + 36, undefined);
   509          A.store.Ref(ptr + 4 + 40, undefined);
   510          A.store.Ref(ptr + 52, undefined);
   511          A.store.Ref(ptr + 56, undefined);
   512        } else {
   513          A.store.Bool(ptr + 60, true);
   514          A.store.Ref(ptr + 0, x["extensionPath"]);
   515  
   516          if (typeof x["transform"] === "undefined") {
   517            A.store.Bool(ptr + 4 + 44, false);
   518            A.store.Ref(ptr + 4 + 0, undefined);
   519            A.store.Ref(ptr + 4 + 4, undefined);
   520            A.store.Ref(ptr + 4 + 8, undefined);
   521            A.store.Ref(ptr + 4 + 12, undefined);
   522            A.store.Ref(ptr + 4 + 16, undefined);
   523  
   524            A.store.Bool(ptr + 4 + 20 + 8, false);
   525            A.store.Ref(ptr + 4 + 20 + 0, undefined);
   526            A.store.Ref(ptr + 4 + 20 + 4, undefined);
   527            A.store.Ref(ptr + 4 + 32, undefined);
   528            A.store.Ref(ptr + 4 + 36, undefined);
   529            A.store.Ref(ptr + 4 + 40, undefined);
   530          } else {
   531            A.store.Bool(ptr + 4 + 44, true);
   532            A.store.Ref(ptr + 4 + 0, x["transform"]["scheme"]);
   533            A.store.Ref(ptr + 4 + 4, x["transform"]["host"]);
   534            A.store.Ref(ptr + 4 + 8, x["transform"]["port"]);
   535            A.store.Ref(ptr + 4 + 12, x["transform"]["path"]);
   536            A.store.Ref(ptr + 4 + 16, x["transform"]["query"]);
   537  
   538            if (typeof x["transform"]["queryTransform"] === "undefined") {
   539              A.store.Bool(ptr + 4 + 20 + 8, false);
   540              A.store.Ref(ptr + 4 + 20 + 0, undefined);
   541              A.store.Ref(ptr + 4 + 20 + 4, undefined);
   542            } else {
   543              A.store.Bool(ptr + 4 + 20 + 8, true);
   544              A.store.Ref(ptr + 4 + 20 + 0, x["transform"]["queryTransform"]["removeParams"]);
   545              A.store.Ref(ptr + 4 + 20 + 4, x["transform"]["queryTransform"]["addOrReplaceParams"]);
   546            }
   547            A.store.Ref(ptr + 4 + 32, x["transform"]["fragment"]);
   548            A.store.Ref(ptr + 4 + 36, x["transform"]["username"]);
   549            A.store.Ref(ptr + 4 + 40, x["transform"]["password"]);
   550          }
   551          A.store.Ref(ptr + 52, x["url"]);
   552          A.store.Ref(ptr + 56, x["regexSubstitution"]);
   553        }
   554      },
   555      "load_Redirect": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   556        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   557  
   558        x["extensionPath"] = A.load.Ref(ptr + 0, undefined);
   559        if (A.load.Bool(ptr + 4 + 44)) {
   560          x["transform"] = {};
   561          x["transform"]["scheme"] = A.load.Ref(ptr + 4 + 0, undefined);
   562          x["transform"]["host"] = A.load.Ref(ptr + 4 + 4, undefined);
   563          x["transform"]["port"] = A.load.Ref(ptr + 4 + 8, undefined);
   564          x["transform"]["path"] = A.load.Ref(ptr + 4 + 12, undefined);
   565          x["transform"]["query"] = A.load.Ref(ptr + 4 + 16, undefined);
   566          if (A.load.Bool(ptr + 4 + 20 + 8)) {
   567            x["transform"]["queryTransform"] = {};
   568            x["transform"]["queryTransform"]["removeParams"] = A.load.Ref(ptr + 4 + 20 + 0, undefined);
   569            x["transform"]["queryTransform"]["addOrReplaceParams"] = A.load.Ref(ptr + 4 + 20 + 4, undefined);
   570          } else {
   571            delete x["transform"]["queryTransform"];
   572          }
   573          x["transform"]["fragment"] = A.load.Ref(ptr + 4 + 32, undefined);
   574          x["transform"]["username"] = A.load.Ref(ptr + 4 + 36, undefined);
   575          x["transform"]["password"] = A.load.Ref(ptr + 4 + 40, undefined);
   576        } else {
   577          delete x["transform"];
   578        }
   579        x["url"] = A.load.Ref(ptr + 52, undefined);
   580        x["regexSubstitution"] = A.load.Ref(ptr + 56, undefined);
   581        return create === A.H.TRUE ? A.H.push(x) : ref;
   582      },
   583      "constof_HeaderOperation": (ref: heap.Ref<string>): number => {
   584        const idx = ["append", "set", "remove"].indexOf(A.H.get(ref));
   585        return idx < 0 ? 0 : idx + 1;
   586      },
   587  
   588      "store_ModifyHeaderInfo": (ptr: Pointer, ref: heap.Ref<any>) => {
   589        const x = A.H.get<any>(ref);
   590  
   591        if (typeof x === "undefined") {
   592          A.store.Bool(ptr + 12, false);
   593          A.store.Ref(ptr + 0, undefined);
   594          A.store.Enum(ptr + 4, -1);
   595          A.store.Ref(ptr + 8, undefined);
   596        } else {
   597          A.store.Bool(ptr + 12, true);
   598          A.store.Ref(ptr + 0, x["header"]);
   599          A.store.Enum(ptr + 4, ["append", "set", "remove"].indexOf(x["operation"] as string));
   600          A.store.Ref(ptr + 8, x["value"]);
   601        }
   602      },
   603      "load_ModifyHeaderInfo": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   604        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   605  
   606        x["header"] = A.load.Ref(ptr + 0, undefined);
   607        x["operation"] = A.load.Enum(ptr + 4, ["append", "set", "remove"]);
   608        x["value"] = A.load.Ref(ptr + 8, undefined);
   609        return create === A.H.TRUE ? A.H.push(x) : ref;
   610      },
   611  
   612      "store_RuleAction": (ptr: Pointer, ref: heap.Ref<any>) => {
   613        const x = A.H.get<any>(ref);
   614  
   615        if (typeof x === "undefined") {
   616          A.store.Bool(ptr + 76, false);
   617          A.store.Enum(ptr + 0, -1);
   618  
   619          A.store.Bool(ptr + 4 + 60, false);
   620          A.store.Ref(ptr + 4 + 0, undefined);
   621  
   622          A.store.Bool(ptr + 4 + 4 + 44, false);
   623          A.store.Ref(ptr + 4 + 4 + 0, undefined);
   624          A.store.Ref(ptr + 4 + 4 + 4, undefined);
   625          A.store.Ref(ptr + 4 + 4 + 8, undefined);
   626          A.store.Ref(ptr + 4 + 4 + 12, undefined);
   627          A.store.Ref(ptr + 4 + 4 + 16, undefined);
   628  
   629          A.store.Bool(ptr + 4 + 4 + 20 + 8, false);
   630          A.store.Ref(ptr + 4 + 4 + 20 + 0, undefined);
   631          A.store.Ref(ptr + 4 + 4 + 20 + 4, undefined);
   632          A.store.Ref(ptr + 4 + 4 + 32, undefined);
   633          A.store.Ref(ptr + 4 + 4 + 36, undefined);
   634          A.store.Ref(ptr + 4 + 4 + 40, undefined);
   635          A.store.Ref(ptr + 4 + 52, undefined);
   636          A.store.Ref(ptr + 4 + 56, undefined);
   637          A.store.Ref(ptr + 68, undefined);
   638          A.store.Ref(ptr + 72, undefined);
   639        } else {
   640          A.store.Bool(ptr + 76, true);
   641          A.store.Enum(
   642            ptr + 0,
   643            ["block", "redirect", "allow", "upgradeScheme", "modifyHeaders", "allowAllRequests"].indexOf(
   644              x["type"] as string
   645            )
   646          );
   647  
   648          if (typeof x["redirect"] === "undefined") {
   649            A.store.Bool(ptr + 4 + 60, false);
   650            A.store.Ref(ptr + 4 + 0, undefined);
   651  
   652            A.store.Bool(ptr + 4 + 4 + 44, false);
   653            A.store.Ref(ptr + 4 + 4 + 0, undefined);
   654            A.store.Ref(ptr + 4 + 4 + 4, undefined);
   655            A.store.Ref(ptr + 4 + 4 + 8, undefined);
   656            A.store.Ref(ptr + 4 + 4 + 12, undefined);
   657            A.store.Ref(ptr + 4 + 4 + 16, undefined);
   658  
   659            A.store.Bool(ptr + 4 + 4 + 20 + 8, false);
   660            A.store.Ref(ptr + 4 + 4 + 20 + 0, undefined);
   661            A.store.Ref(ptr + 4 + 4 + 20 + 4, undefined);
   662            A.store.Ref(ptr + 4 + 4 + 32, undefined);
   663            A.store.Ref(ptr + 4 + 4 + 36, undefined);
   664            A.store.Ref(ptr + 4 + 4 + 40, undefined);
   665            A.store.Ref(ptr + 4 + 52, undefined);
   666            A.store.Ref(ptr + 4 + 56, undefined);
   667          } else {
   668            A.store.Bool(ptr + 4 + 60, true);
   669            A.store.Ref(ptr + 4 + 0, x["redirect"]["extensionPath"]);
   670  
   671            if (typeof x["redirect"]["transform"] === "undefined") {
   672              A.store.Bool(ptr + 4 + 4 + 44, false);
   673              A.store.Ref(ptr + 4 + 4 + 0, undefined);
   674              A.store.Ref(ptr + 4 + 4 + 4, undefined);
   675              A.store.Ref(ptr + 4 + 4 + 8, undefined);
   676              A.store.Ref(ptr + 4 + 4 + 12, undefined);
   677              A.store.Ref(ptr + 4 + 4 + 16, undefined);
   678  
   679              A.store.Bool(ptr + 4 + 4 + 20 + 8, false);
   680              A.store.Ref(ptr + 4 + 4 + 20 + 0, undefined);
   681              A.store.Ref(ptr + 4 + 4 + 20 + 4, undefined);
   682              A.store.Ref(ptr + 4 + 4 + 32, undefined);
   683              A.store.Ref(ptr + 4 + 4 + 36, undefined);
   684              A.store.Ref(ptr + 4 + 4 + 40, undefined);
   685            } else {
   686              A.store.Bool(ptr + 4 + 4 + 44, true);
   687              A.store.Ref(ptr + 4 + 4 + 0, x["redirect"]["transform"]["scheme"]);
   688              A.store.Ref(ptr + 4 + 4 + 4, x["redirect"]["transform"]["host"]);
   689              A.store.Ref(ptr + 4 + 4 + 8, x["redirect"]["transform"]["port"]);
   690              A.store.Ref(ptr + 4 + 4 + 12, x["redirect"]["transform"]["path"]);
   691              A.store.Ref(ptr + 4 + 4 + 16, x["redirect"]["transform"]["query"]);
   692  
   693              if (typeof x["redirect"]["transform"]["queryTransform"] === "undefined") {
   694                A.store.Bool(ptr + 4 + 4 + 20 + 8, false);
   695                A.store.Ref(ptr + 4 + 4 + 20 + 0, undefined);
   696                A.store.Ref(ptr + 4 + 4 + 20 + 4, undefined);
   697              } else {
   698                A.store.Bool(ptr + 4 + 4 + 20 + 8, true);
   699                A.store.Ref(ptr + 4 + 4 + 20 + 0, x["redirect"]["transform"]["queryTransform"]["removeParams"]);
   700                A.store.Ref(ptr + 4 + 4 + 20 + 4, x["redirect"]["transform"]["queryTransform"]["addOrReplaceParams"]);
   701              }
   702              A.store.Ref(ptr + 4 + 4 + 32, x["redirect"]["transform"]["fragment"]);
   703              A.store.Ref(ptr + 4 + 4 + 36, x["redirect"]["transform"]["username"]);
   704              A.store.Ref(ptr + 4 + 4 + 40, x["redirect"]["transform"]["password"]);
   705            }
   706            A.store.Ref(ptr + 4 + 52, x["redirect"]["url"]);
   707            A.store.Ref(ptr + 4 + 56, x["redirect"]["regexSubstitution"]);
   708          }
   709          A.store.Ref(ptr + 68, x["requestHeaders"]);
   710          A.store.Ref(ptr + 72, x["responseHeaders"]);
   711        }
   712      },
   713      "load_RuleAction": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   714        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   715  
   716        x["type"] = A.load.Enum(ptr + 0, [
   717          "block",
   718          "redirect",
   719          "allow",
   720          "upgradeScheme",
   721          "modifyHeaders",
   722          "allowAllRequests",
   723        ]);
   724        if (A.load.Bool(ptr + 4 + 60)) {
   725          x["redirect"] = {};
   726          x["redirect"]["extensionPath"] = A.load.Ref(ptr + 4 + 0, undefined);
   727          if (A.load.Bool(ptr + 4 + 4 + 44)) {
   728            x["redirect"]["transform"] = {};
   729            x["redirect"]["transform"]["scheme"] = A.load.Ref(ptr + 4 + 4 + 0, undefined);
   730            x["redirect"]["transform"]["host"] = A.load.Ref(ptr + 4 + 4 + 4, undefined);
   731            x["redirect"]["transform"]["port"] = A.load.Ref(ptr + 4 + 4 + 8, undefined);
   732            x["redirect"]["transform"]["path"] = A.load.Ref(ptr + 4 + 4 + 12, undefined);
   733            x["redirect"]["transform"]["query"] = A.load.Ref(ptr + 4 + 4 + 16, undefined);
   734            if (A.load.Bool(ptr + 4 + 4 + 20 + 8)) {
   735              x["redirect"]["transform"]["queryTransform"] = {};
   736              x["redirect"]["transform"]["queryTransform"]["removeParams"] = A.load.Ref(ptr + 4 + 4 + 20 + 0, undefined);
   737              x["redirect"]["transform"]["queryTransform"]["addOrReplaceParams"] = A.load.Ref(
   738                ptr + 4 + 4 + 20 + 4,
   739                undefined
   740              );
   741            } else {
   742              delete x["redirect"]["transform"]["queryTransform"];
   743            }
   744            x["redirect"]["transform"]["fragment"] = A.load.Ref(ptr + 4 + 4 + 32, undefined);
   745            x["redirect"]["transform"]["username"] = A.load.Ref(ptr + 4 + 4 + 36, undefined);
   746            x["redirect"]["transform"]["password"] = A.load.Ref(ptr + 4 + 4 + 40, undefined);
   747          } else {
   748            delete x["redirect"]["transform"];
   749          }
   750          x["redirect"]["url"] = A.load.Ref(ptr + 4 + 52, undefined);
   751          x["redirect"]["regexSubstitution"] = A.load.Ref(ptr + 4 + 56, undefined);
   752        } else {
   753          delete x["redirect"];
   754        }
   755        x["requestHeaders"] = A.load.Ref(ptr + 68, undefined);
   756        x["responseHeaders"] = A.load.Ref(ptr + 72, undefined);
   757        return create === A.H.TRUE ? A.H.push(x) : ref;
   758      },
   759  
   760      "store_Rule": (ptr: Pointer, ref: heap.Ref<any>) => {
   761        const x = A.H.get<any>(ref);
   762  
   763        if (typeof x === "undefined") {
   764          A.store.Bool(ptr + 155, false);
   765          A.store.Bool(ptr + 153, false);
   766          A.store.Int32(ptr + 0, 0);
   767          A.store.Bool(ptr + 154, false);
   768          A.store.Int32(ptr + 4, 0);
   769  
   770          A.store.Bool(ptr + 8 + 65, false);
   771          A.store.Ref(ptr + 8 + 0, undefined);
   772          A.store.Ref(ptr + 8 + 4, undefined);
   773          A.store.Bool(ptr + 8 + 64, false);
   774          A.store.Bool(ptr + 8 + 8, false);
   775          A.store.Ref(ptr + 8 + 12, undefined);
   776          A.store.Ref(ptr + 8 + 16, undefined);
   777          A.store.Ref(ptr + 8 + 20, undefined);
   778          A.store.Ref(ptr + 8 + 24, undefined);
   779          A.store.Ref(ptr + 8 + 28, undefined);
   780          A.store.Ref(ptr + 8 + 32, undefined);
   781          A.store.Ref(ptr + 8 + 36, undefined);
   782          A.store.Ref(ptr + 8 + 40, undefined);
   783          A.store.Ref(ptr + 8 + 44, undefined);
   784          A.store.Ref(ptr + 8 + 48, undefined);
   785          A.store.Enum(ptr + 8 + 52, -1);
   786          A.store.Ref(ptr + 8 + 56, undefined);
   787          A.store.Ref(ptr + 8 + 60, undefined);
   788  
   789          A.store.Bool(ptr + 76 + 76, false);
   790          A.store.Enum(ptr + 76 + 0, -1);
   791  
   792          A.store.Bool(ptr + 76 + 4 + 60, false);
   793          A.store.Ref(ptr + 76 + 4 + 0, undefined);
   794  
   795          A.store.Bool(ptr + 76 + 4 + 4 + 44, false);
   796          A.store.Ref(ptr + 76 + 4 + 4 + 0, undefined);
   797          A.store.Ref(ptr + 76 + 4 + 4 + 4, undefined);
   798          A.store.Ref(ptr + 76 + 4 + 4 + 8, undefined);
   799          A.store.Ref(ptr + 76 + 4 + 4 + 12, undefined);
   800          A.store.Ref(ptr + 76 + 4 + 4 + 16, undefined);
   801  
   802          A.store.Bool(ptr + 76 + 4 + 4 + 20 + 8, false);
   803          A.store.Ref(ptr + 76 + 4 + 4 + 20 + 0, undefined);
   804          A.store.Ref(ptr + 76 + 4 + 4 + 20 + 4, undefined);
   805          A.store.Ref(ptr + 76 + 4 + 4 + 32, undefined);
   806          A.store.Ref(ptr + 76 + 4 + 4 + 36, undefined);
   807          A.store.Ref(ptr + 76 + 4 + 4 + 40, undefined);
   808          A.store.Ref(ptr + 76 + 4 + 52, undefined);
   809          A.store.Ref(ptr + 76 + 4 + 56, undefined);
   810          A.store.Ref(ptr + 76 + 68, undefined);
   811          A.store.Ref(ptr + 76 + 72, undefined);
   812        } else {
   813          A.store.Bool(ptr + 155, true);
   814          A.store.Bool(ptr + 153, "id" in x ? true : false);
   815          A.store.Int32(ptr + 0, x["id"] === undefined ? 0 : (x["id"] as number));
   816          A.store.Bool(ptr + 154, "priority" in x ? true : false);
   817          A.store.Int32(ptr + 4, x["priority"] === undefined ? 0 : (x["priority"] as number));
   818  
   819          if (typeof x["condition"] === "undefined") {
   820            A.store.Bool(ptr + 8 + 65, false);
   821            A.store.Ref(ptr + 8 + 0, undefined);
   822            A.store.Ref(ptr + 8 + 4, undefined);
   823            A.store.Bool(ptr + 8 + 64, false);
   824            A.store.Bool(ptr + 8 + 8, false);
   825            A.store.Ref(ptr + 8 + 12, undefined);
   826            A.store.Ref(ptr + 8 + 16, undefined);
   827            A.store.Ref(ptr + 8 + 20, undefined);
   828            A.store.Ref(ptr + 8 + 24, undefined);
   829            A.store.Ref(ptr + 8 + 28, undefined);
   830            A.store.Ref(ptr + 8 + 32, undefined);
   831            A.store.Ref(ptr + 8 + 36, undefined);
   832            A.store.Ref(ptr + 8 + 40, undefined);
   833            A.store.Ref(ptr + 8 + 44, undefined);
   834            A.store.Ref(ptr + 8 + 48, undefined);
   835            A.store.Enum(ptr + 8 + 52, -1);
   836            A.store.Ref(ptr + 8 + 56, undefined);
   837            A.store.Ref(ptr + 8 + 60, undefined);
   838          } else {
   839            A.store.Bool(ptr + 8 + 65, true);
   840            A.store.Ref(ptr + 8 + 0, x["condition"]["urlFilter"]);
   841            A.store.Ref(ptr + 8 + 4, x["condition"]["regexFilter"]);
   842            A.store.Bool(ptr + 8 + 64, "isUrlFilterCaseSensitive" in x["condition"] ? true : false);
   843            A.store.Bool(ptr + 8 + 8, x["condition"]["isUrlFilterCaseSensitive"] ? true : false);
   844            A.store.Ref(ptr + 8 + 12, x["condition"]["initiatorDomains"]);
   845            A.store.Ref(ptr + 8 + 16, x["condition"]["excludedInitiatorDomains"]);
   846            A.store.Ref(ptr + 8 + 20, x["condition"]["requestDomains"]);
   847            A.store.Ref(ptr + 8 + 24, x["condition"]["excludedRequestDomains"]);
   848            A.store.Ref(ptr + 8 + 28, x["condition"]["domains"]);
   849            A.store.Ref(ptr + 8 + 32, x["condition"]["excludedDomains"]);
   850            A.store.Ref(ptr + 8 + 36, x["condition"]["resourceTypes"]);
   851            A.store.Ref(ptr + 8 + 40, x["condition"]["excludedResourceTypes"]);
   852            A.store.Ref(ptr + 8 + 44, x["condition"]["requestMethods"]);
   853            A.store.Ref(ptr + 8 + 48, x["condition"]["excludedRequestMethods"]);
   854            A.store.Enum(ptr + 8 + 52, ["firstParty", "thirdParty"].indexOf(x["condition"]["domainType"] as string));
   855            A.store.Ref(ptr + 8 + 56, x["condition"]["tabIds"]);
   856            A.store.Ref(ptr + 8 + 60, x["condition"]["excludedTabIds"]);
   857          }
   858  
   859          if (typeof x["action"] === "undefined") {
   860            A.store.Bool(ptr + 76 + 76, false);
   861            A.store.Enum(ptr + 76 + 0, -1);
   862  
   863            A.store.Bool(ptr + 76 + 4 + 60, false);
   864            A.store.Ref(ptr + 76 + 4 + 0, undefined);
   865  
   866            A.store.Bool(ptr + 76 + 4 + 4 + 44, false);
   867            A.store.Ref(ptr + 76 + 4 + 4 + 0, undefined);
   868            A.store.Ref(ptr + 76 + 4 + 4 + 4, undefined);
   869            A.store.Ref(ptr + 76 + 4 + 4 + 8, undefined);
   870            A.store.Ref(ptr + 76 + 4 + 4 + 12, undefined);
   871            A.store.Ref(ptr + 76 + 4 + 4 + 16, undefined);
   872  
   873            A.store.Bool(ptr + 76 + 4 + 4 + 20 + 8, false);
   874            A.store.Ref(ptr + 76 + 4 + 4 + 20 + 0, undefined);
   875            A.store.Ref(ptr + 76 + 4 + 4 + 20 + 4, undefined);
   876            A.store.Ref(ptr + 76 + 4 + 4 + 32, undefined);
   877            A.store.Ref(ptr + 76 + 4 + 4 + 36, undefined);
   878            A.store.Ref(ptr + 76 + 4 + 4 + 40, undefined);
   879            A.store.Ref(ptr + 76 + 4 + 52, undefined);
   880            A.store.Ref(ptr + 76 + 4 + 56, undefined);
   881            A.store.Ref(ptr + 76 + 68, undefined);
   882            A.store.Ref(ptr + 76 + 72, undefined);
   883          } else {
   884            A.store.Bool(ptr + 76 + 76, true);
   885            A.store.Enum(
   886              ptr + 76 + 0,
   887              ["block", "redirect", "allow", "upgradeScheme", "modifyHeaders", "allowAllRequests"].indexOf(
   888                x["action"]["type"] as string
   889              )
   890            );
   891  
   892            if (typeof x["action"]["redirect"] === "undefined") {
   893              A.store.Bool(ptr + 76 + 4 + 60, false);
   894              A.store.Ref(ptr + 76 + 4 + 0, undefined);
   895  
   896              A.store.Bool(ptr + 76 + 4 + 4 + 44, false);
   897              A.store.Ref(ptr + 76 + 4 + 4 + 0, undefined);
   898              A.store.Ref(ptr + 76 + 4 + 4 + 4, undefined);
   899              A.store.Ref(ptr + 76 + 4 + 4 + 8, undefined);
   900              A.store.Ref(ptr + 76 + 4 + 4 + 12, undefined);
   901              A.store.Ref(ptr + 76 + 4 + 4 + 16, undefined);
   902  
   903              A.store.Bool(ptr + 76 + 4 + 4 + 20 + 8, false);
   904              A.store.Ref(ptr + 76 + 4 + 4 + 20 + 0, undefined);
   905              A.store.Ref(ptr + 76 + 4 + 4 + 20 + 4, undefined);
   906              A.store.Ref(ptr + 76 + 4 + 4 + 32, undefined);
   907              A.store.Ref(ptr + 76 + 4 + 4 + 36, undefined);
   908              A.store.Ref(ptr + 76 + 4 + 4 + 40, undefined);
   909              A.store.Ref(ptr + 76 + 4 + 52, undefined);
   910              A.store.Ref(ptr + 76 + 4 + 56, undefined);
   911            } else {
   912              A.store.Bool(ptr + 76 + 4 + 60, true);
   913              A.store.Ref(ptr + 76 + 4 + 0, x["action"]["redirect"]["extensionPath"]);
   914  
   915              if (typeof x["action"]["redirect"]["transform"] === "undefined") {
   916                A.store.Bool(ptr + 76 + 4 + 4 + 44, false);
   917                A.store.Ref(ptr + 76 + 4 + 4 + 0, undefined);
   918                A.store.Ref(ptr + 76 + 4 + 4 + 4, undefined);
   919                A.store.Ref(ptr + 76 + 4 + 4 + 8, undefined);
   920                A.store.Ref(ptr + 76 + 4 + 4 + 12, undefined);
   921                A.store.Ref(ptr + 76 + 4 + 4 + 16, undefined);
   922  
   923                A.store.Bool(ptr + 76 + 4 + 4 + 20 + 8, false);
   924                A.store.Ref(ptr + 76 + 4 + 4 + 20 + 0, undefined);
   925                A.store.Ref(ptr + 76 + 4 + 4 + 20 + 4, undefined);
   926                A.store.Ref(ptr + 76 + 4 + 4 + 32, undefined);
   927                A.store.Ref(ptr + 76 + 4 + 4 + 36, undefined);
   928                A.store.Ref(ptr + 76 + 4 + 4 + 40, undefined);
   929              } else {
   930                A.store.Bool(ptr + 76 + 4 + 4 + 44, true);
   931                A.store.Ref(ptr + 76 + 4 + 4 + 0, x["action"]["redirect"]["transform"]["scheme"]);
   932                A.store.Ref(ptr + 76 + 4 + 4 + 4, x["action"]["redirect"]["transform"]["host"]);
   933                A.store.Ref(ptr + 76 + 4 + 4 + 8, x["action"]["redirect"]["transform"]["port"]);
   934                A.store.Ref(ptr + 76 + 4 + 4 + 12, x["action"]["redirect"]["transform"]["path"]);
   935                A.store.Ref(ptr + 76 + 4 + 4 + 16, x["action"]["redirect"]["transform"]["query"]);
   936  
   937                if (typeof x["action"]["redirect"]["transform"]["queryTransform"] === "undefined") {
   938                  A.store.Bool(ptr + 76 + 4 + 4 + 20 + 8, false);
   939                  A.store.Ref(ptr + 76 + 4 + 4 + 20 + 0, undefined);
   940                  A.store.Ref(ptr + 76 + 4 + 4 + 20 + 4, undefined);
   941                } else {
   942                  A.store.Bool(ptr + 76 + 4 + 4 + 20 + 8, true);
   943                  A.store.Ref(
   944                    ptr + 76 + 4 + 4 + 20 + 0,
   945                    x["action"]["redirect"]["transform"]["queryTransform"]["removeParams"]
   946                  );
   947                  A.store.Ref(
   948                    ptr + 76 + 4 + 4 + 20 + 4,
   949                    x["action"]["redirect"]["transform"]["queryTransform"]["addOrReplaceParams"]
   950                  );
   951                }
   952                A.store.Ref(ptr + 76 + 4 + 4 + 32, x["action"]["redirect"]["transform"]["fragment"]);
   953                A.store.Ref(ptr + 76 + 4 + 4 + 36, x["action"]["redirect"]["transform"]["username"]);
   954                A.store.Ref(ptr + 76 + 4 + 4 + 40, x["action"]["redirect"]["transform"]["password"]);
   955              }
   956              A.store.Ref(ptr + 76 + 4 + 52, x["action"]["redirect"]["url"]);
   957              A.store.Ref(ptr + 76 + 4 + 56, x["action"]["redirect"]["regexSubstitution"]);
   958            }
   959            A.store.Ref(ptr + 76 + 68, x["action"]["requestHeaders"]);
   960            A.store.Ref(ptr + 76 + 72, x["action"]["responseHeaders"]);
   961          }
   962        }
   963      },
   964      "load_Rule": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   965        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   966  
   967        if (A.load.Bool(ptr + 153)) {
   968          x["id"] = A.load.Int32(ptr + 0);
   969        } else {
   970          delete x["id"];
   971        }
   972        if (A.load.Bool(ptr + 154)) {
   973          x["priority"] = A.load.Int32(ptr + 4);
   974        } else {
   975          delete x["priority"];
   976        }
   977        if (A.load.Bool(ptr + 8 + 65)) {
   978          x["condition"] = {};
   979          x["condition"]["urlFilter"] = A.load.Ref(ptr + 8 + 0, undefined);
   980          x["condition"]["regexFilter"] = A.load.Ref(ptr + 8 + 4, undefined);
   981          if (A.load.Bool(ptr + 8 + 64)) {
   982            x["condition"]["isUrlFilterCaseSensitive"] = A.load.Bool(ptr + 8 + 8);
   983          } else {
   984            delete x["condition"]["isUrlFilterCaseSensitive"];
   985          }
   986          x["condition"]["initiatorDomains"] = A.load.Ref(ptr + 8 + 12, undefined);
   987          x["condition"]["excludedInitiatorDomains"] = A.load.Ref(ptr + 8 + 16, undefined);
   988          x["condition"]["requestDomains"] = A.load.Ref(ptr + 8 + 20, undefined);
   989          x["condition"]["excludedRequestDomains"] = A.load.Ref(ptr + 8 + 24, undefined);
   990          x["condition"]["domains"] = A.load.Ref(ptr + 8 + 28, undefined);
   991          x["condition"]["excludedDomains"] = A.load.Ref(ptr + 8 + 32, undefined);
   992          x["condition"]["resourceTypes"] = A.load.Ref(ptr + 8 + 36, undefined);
   993          x["condition"]["excludedResourceTypes"] = A.load.Ref(ptr + 8 + 40, undefined);
   994          x["condition"]["requestMethods"] = A.load.Ref(ptr + 8 + 44, undefined);
   995          x["condition"]["excludedRequestMethods"] = A.load.Ref(ptr + 8 + 48, undefined);
   996          x["condition"]["domainType"] = A.load.Enum(ptr + 8 + 52, ["firstParty", "thirdParty"]);
   997          x["condition"]["tabIds"] = A.load.Ref(ptr + 8 + 56, undefined);
   998          x["condition"]["excludedTabIds"] = A.load.Ref(ptr + 8 + 60, undefined);
   999        } else {
  1000          delete x["condition"];
  1001        }
  1002        if (A.load.Bool(ptr + 76 + 76)) {
  1003          x["action"] = {};
  1004          x["action"]["type"] = A.load.Enum(ptr + 76 + 0, [
  1005            "block",
  1006            "redirect",
  1007            "allow",
  1008            "upgradeScheme",
  1009            "modifyHeaders",
  1010            "allowAllRequests",
  1011          ]);
  1012          if (A.load.Bool(ptr + 76 + 4 + 60)) {
  1013            x["action"]["redirect"] = {};
  1014            x["action"]["redirect"]["extensionPath"] = A.load.Ref(ptr + 76 + 4 + 0, undefined);
  1015            if (A.load.Bool(ptr + 76 + 4 + 4 + 44)) {
  1016              x["action"]["redirect"]["transform"] = {};
  1017              x["action"]["redirect"]["transform"]["scheme"] = A.load.Ref(ptr + 76 + 4 + 4 + 0, undefined);
  1018              x["action"]["redirect"]["transform"]["host"] = A.load.Ref(ptr + 76 + 4 + 4 + 4, undefined);
  1019              x["action"]["redirect"]["transform"]["port"] = A.load.Ref(ptr + 76 + 4 + 4 + 8, undefined);
  1020              x["action"]["redirect"]["transform"]["path"] = A.load.Ref(ptr + 76 + 4 + 4 + 12, undefined);
  1021              x["action"]["redirect"]["transform"]["query"] = A.load.Ref(ptr + 76 + 4 + 4 + 16, undefined);
  1022              if (A.load.Bool(ptr + 76 + 4 + 4 + 20 + 8)) {
  1023                x["action"]["redirect"]["transform"]["queryTransform"] = {};
  1024                x["action"]["redirect"]["transform"]["queryTransform"]["removeParams"] = A.load.Ref(
  1025                  ptr + 76 + 4 + 4 + 20 + 0,
  1026                  undefined
  1027                );
  1028                x["action"]["redirect"]["transform"]["queryTransform"]["addOrReplaceParams"] = A.load.Ref(
  1029                  ptr + 76 + 4 + 4 + 20 + 4,
  1030                  undefined
  1031                );
  1032              } else {
  1033                delete x["action"]["redirect"]["transform"]["queryTransform"];
  1034              }
  1035              x["action"]["redirect"]["transform"]["fragment"] = A.load.Ref(ptr + 76 + 4 + 4 + 32, undefined);
  1036              x["action"]["redirect"]["transform"]["username"] = A.load.Ref(ptr + 76 + 4 + 4 + 36, undefined);
  1037              x["action"]["redirect"]["transform"]["password"] = A.load.Ref(ptr + 76 + 4 + 4 + 40, undefined);
  1038            } else {
  1039              delete x["action"]["redirect"]["transform"];
  1040            }
  1041            x["action"]["redirect"]["url"] = A.load.Ref(ptr + 76 + 4 + 52, undefined);
  1042            x["action"]["redirect"]["regexSubstitution"] = A.load.Ref(ptr + 76 + 4 + 56, undefined);
  1043          } else {
  1044            delete x["action"]["redirect"];
  1045          }
  1046          x["action"]["requestHeaders"] = A.load.Ref(ptr + 76 + 68, undefined);
  1047          x["action"]["responseHeaders"] = A.load.Ref(ptr + 76 + 72, undefined);
  1048        } else {
  1049          delete x["action"];
  1050        }
  1051        return create === A.H.TRUE ? A.H.push(x) : ref;
  1052      },
  1053  
  1054      "store_GetRulesFilter": (ptr: Pointer, ref: heap.Ref<any>) => {
  1055        const x = A.H.get<any>(ref);
  1056  
  1057        if (typeof x === "undefined") {
  1058          A.store.Bool(ptr + 4, false);
  1059          A.store.Ref(ptr + 0, undefined);
  1060        } else {
  1061          A.store.Bool(ptr + 4, true);
  1062          A.store.Ref(ptr + 0, x["ruleIds"]);
  1063        }
  1064      },
  1065      "load_GetRulesFilter": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1066        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1067  
  1068        x["ruleIds"] = A.load.Ref(ptr + 0, undefined);
  1069        return create === A.H.TRUE ? A.H.push(x) : ref;
  1070      },
  1071      "constof_UnsupportedRegexReason": (ref: heap.Ref<string>): number => {
  1072        const idx = ["syntaxError", "memoryLimitExceeded"].indexOf(A.H.get(ref));
  1073        return idx < 0 ? 0 : idx + 1;
  1074      },
  1075  
  1076      "store_IsRegexSupportedResult": (ptr: Pointer, ref: heap.Ref<any>) => {
  1077        const x = A.H.get<any>(ref);
  1078  
  1079        if (typeof x === "undefined") {
  1080          A.store.Bool(ptr + 9, false);
  1081          A.store.Bool(ptr + 8, false);
  1082          A.store.Bool(ptr + 0, false);
  1083          A.store.Enum(ptr + 4, -1);
  1084        } else {
  1085          A.store.Bool(ptr + 9, true);
  1086          A.store.Bool(ptr + 8, "isSupported" in x ? true : false);
  1087          A.store.Bool(ptr + 0, x["isSupported"] ? true : false);
  1088          A.store.Enum(ptr + 4, ["syntaxError", "memoryLimitExceeded"].indexOf(x["reason"] as string));
  1089        }
  1090      },
  1091      "load_IsRegexSupportedResult": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1092        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1093  
  1094        if (A.load.Bool(ptr + 8)) {
  1095          x["isSupported"] = A.load.Bool(ptr + 0);
  1096        } else {
  1097          delete x["isSupported"];
  1098        }
  1099        x["reason"] = A.load.Enum(ptr + 4, ["syntaxError", "memoryLimitExceeded"]);
  1100        return create === A.H.TRUE ? A.H.push(x) : ref;
  1101      },
  1102  
  1103      "store_ManifestKeys": (ptr: Pointer, ref: heap.Ref<any>) => {
  1104        const x = A.H.get<any>(ref);
  1105  
  1106        if (typeof x === "undefined") {
  1107          A.store.Bool(ptr + 5, false);
  1108  
  1109          A.store.Bool(ptr + 0 + 4, false);
  1110          A.store.Ref(ptr + 0 + 0, undefined);
  1111        } else {
  1112          A.store.Bool(ptr + 5, true);
  1113  
  1114          if (typeof x["declarative_net_request"] === "undefined") {
  1115            A.store.Bool(ptr + 0 + 4, false);
  1116            A.store.Ref(ptr + 0 + 0, undefined);
  1117          } else {
  1118            A.store.Bool(ptr + 0 + 4, true);
  1119            A.store.Ref(ptr + 0 + 0, x["declarative_net_request"]["rule_resources"]);
  1120          }
  1121        }
  1122      },
  1123      "load_ManifestKeys": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1124        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1125  
  1126        if (A.load.Bool(ptr + 0 + 4)) {
  1127          x["declarative_net_request"] = {};
  1128          x["declarative_net_request"]["rule_resources"] = A.load.Ref(ptr + 0 + 0, undefined);
  1129        } else {
  1130          delete x["declarative_net_request"];
  1131        }
  1132        return create === A.H.TRUE ? A.H.push(x) : ref;
  1133      },
  1134  
  1135      "store_RequestDetails": (ptr: Pointer, ref: heap.Ref<any>) => {
  1136        const x = A.H.get<any>(ref);
  1137  
  1138        if (typeof x === "undefined") {
  1139          A.store.Bool(ptr + 51, false);
  1140          A.store.Ref(ptr + 0, undefined);
  1141          A.store.Ref(ptr + 4, undefined);
  1142          A.store.Ref(ptr + 8, undefined);
  1143          A.store.Ref(ptr + 12, undefined);
  1144          A.store.Bool(ptr + 48, false);
  1145          A.store.Int32(ptr + 16, 0);
  1146          A.store.Ref(ptr + 20, undefined);
  1147          A.store.Enum(ptr + 24, -1);
  1148          A.store.Enum(ptr + 28, -1);
  1149          A.store.Bool(ptr + 49, false);
  1150          A.store.Int32(ptr + 32, 0);
  1151          A.store.Ref(ptr + 36, undefined);
  1152          A.store.Bool(ptr + 50, false);
  1153          A.store.Int32(ptr + 40, 0);
  1154          A.store.Enum(ptr + 44, -1);
  1155        } else {
  1156          A.store.Bool(ptr + 51, true);
  1157          A.store.Ref(ptr + 0, x["requestId"]);
  1158          A.store.Ref(ptr + 4, x["url"]);
  1159          A.store.Ref(ptr + 8, x["initiator"]);
  1160          A.store.Ref(ptr + 12, x["method"]);
  1161          A.store.Bool(ptr + 48, "frameId" in x ? true : false);
  1162          A.store.Int32(ptr + 16, x["frameId"] === undefined ? 0 : (x["frameId"] as number));
  1163          A.store.Ref(ptr + 20, x["documentId"]);
  1164          A.store.Enum(ptr + 24, ["outermost_frame", "fenced_frame", "sub_frame"].indexOf(x["frameType"] as string));
  1165          A.store.Enum(
  1166            ptr + 28,
  1167            ["prerender", "active", "cached", "pending_deletion"].indexOf(x["documentLifecycle"] as string)
  1168          );
  1169          A.store.Bool(ptr + 49, "parentFrameId" in x ? true : false);
  1170          A.store.Int32(ptr + 32, x["parentFrameId"] === undefined ? 0 : (x["parentFrameId"] as number));
  1171          A.store.Ref(ptr + 36, x["parentDocumentId"]);
  1172          A.store.Bool(ptr + 50, "tabId" in x ? true : false);
  1173          A.store.Int32(ptr + 40, x["tabId"] === undefined ? 0 : (x["tabId"] as number));
  1174          A.store.Enum(
  1175            ptr + 44,
  1176            [
  1177              "main_frame",
  1178              "sub_frame",
  1179              "stylesheet",
  1180              "script",
  1181              "image",
  1182              "font",
  1183              "object",
  1184              "xmlhttprequest",
  1185              "ping",
  1186              "csp_report",
  1187              "media",
  1188              "websocket",
  1189              "webtransport",
  1190              "webbundle",
  1191              "other",
  1192            ].indexOf(x["type"] as string)
  1193          );
  1194        }
  1195      },
  1196      "load_RequestDetails": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1197        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1198  
  1199        x["requestId"] = A.load.Ref(ptr + 0, undefined);
  1200        x["url"] = A.load.Ref(ptr + 4, undefined);
  1201        x["initiator"] = A.load.Ref(ptr + 8, undefined);
  1202        x["method"] = A.load.Ref(ptr + 12, undefined);
  1203        if (A.load.Bool(ptr + 48)) {
  1204          x["frameId"] = A.load.Int32(ptr + 16);
  1205        } else {
  1206          delete x["frameId"];
  1207        }
  1208        x["documentId"] = A.load.Ref(ptr + 20, undefined);
  1209        x["frameType"] = A.load.Enum(ptr + 24, ["outermost_frame", "fenced_frame", "sub_frame"]);
  1210        x["documentLifecycle"] = A.load.Enum(ptr + 28, ["prerender", "active", "cached", "pending_deletion"]);
  1211        if (A.load.Bool(ptr + 49)) {
  1212          x["parentFrameId"] = A.load.Int32(ptr + 32);
  1213        } else {
  1214          delete x["parentFrameId"];
  1215        }
  1216        x["parentDocumentId"] = A.load.Ref(ptr + 36, undefined);
  1217        if (A.load.Bool(ptr + 50)) {
  1218          x["tabId"] = A.load.Int32(ptr + 40);
  1219        } else {
  1220          delete x["tabId"];
  1221        }
  1222        x["type"] = A.load.Enum(ptr + 44, [
  1223          "main_frame",
  1224          "sub_frame",
  1225          "stylesheet",
  1226          "script",
  1227          "image",
  1228          "font",
  1229          "object",
  1230          "xmlhttprequest",
  1231          "ping",
  1232          "csp_report",
  1233          "media",
  1234          "websocket",
  1235          "webtransport",
  1236          "webbundle",
  1237          "other",
  1238        ]);
  1239        return create === A.H.TRUE ? A.H.push(x) : ref;
  1240      },
  1241  
  1242      "store_MatchedRuleInfoDebug": (ptr: Pointer, ref: heap.Ref<any>) => {
  1243        const x = A.H.get<any>(ref);
  1244  
  1245        if (typeof x === "undefined") {
  1246          A.store.Bool(ptr + 64, false);
  1247  
  1248          A.store.Bool(ptr + 0 + 9, false);
  1249          A.store.Bool(ptr + 0 + 8, false);
  1250          A.store.Int32(ptr + 0 + 0, 0);
  1251          A.store.Ref(ptr + 0 + 4, undefined);
  1252  
  1253          A.store.Bool(ptr + 12 + 51, false);
  1254          A.store.Ref(ptr + 12 + 0, undefined);
  1255          A.store.Ref(ptr + 12 + 4, undefined);
  1256          A.store.Ref(ptr + 12 + 8, undefined);
  1257          A.store.Ref(ptr + 12 + 12, undefined);
  1258          A.store.Bool(ptr + 12 + 48, false);
  1259          A.store.Int32(ptr + 12 + 16, 0);
  1260          A.store.Ref(ptr + 12 + 20, undefined);
  1261          A.store.Enum(ptr + 12 + 24, -1);
  1262          A.store.Enum(ptr + 12 + 28, -1);
  1263          A.store.Bool(ptr + 12 + 49, false);
  1264          A.store.Int32(ptr + 12 + 32, 0);
  1265          A.store.Ref(ptr + 12 + 36, undefined);
  1266          A.store.Bool(ptr + 12 + 50, false);
  1267          A.store.Int32(ptr + 12 + 40, 0);
  1268          A.store.Enum(ptr + 12 + 44, -1);
  1269        } else {
  1270          A.store.Bool(ptr + 64, true);
  1271  
  1272          if (typeof x["rule"] === "undefined") {
  1273            A.store.Bool(ptr + 0 + 9, false);
  1274            A.store.Bool(ptr + 0 + 8, false);
  1275            A.store.Int32(ptr + 0 + 0, 0);
  1276            A.store.Ref(ptr + 0 + 4, undefined);
  1277          } else {
  1278            A.store.Bool(ptr + 0 + 9, true);
  1279            A.store.Bool(ptr + 0 + 8, "ruleId" in x["rule"] ? true : false);
  1280            A.store.Int32(ptr + 0 + 0, x["rule"]["ruleId"] === undefined ? 0 : (x["rule"]["ruleId"] as number));
  1281            A.store.Ref(ptr + 0 + 4, x["rule"]["rulesetId"]);
  1282          }
  1283  
  1284          if (typeof x["request"] === "undefined") {
  1285            A.store.Bool(ptr + 12 + 51, false);
  1286            A.store.Ref(ptr + 12 + 0, undefined);
  1287            A.store.Ref(ptr + 12 + 4, undefined);
  1288            A.store.Ref(ptr + 12 + 8, undefined);
  1289            A.store.Ref(ptr + 12 + 12, undefined);
  1290            A.store.Bool(ptr + 12 + 48, false);
  1291            A.store.Int32(ptr + 12 + 16, 0);
  1292            A.store.Ref(ptr + 12 + 20, undefined);
  1293            A.store.Enum(ptr + 12 + 24, -1);
  1294            A.store.Enum(ptr + 12 + 28, -1);
  1295            A.store.Bool(ptr + 12 + 49, false);
  1296            A.store.Int32(ptr + 12 + 32, 0);
  1297            A.store.Ref(ptr + 12 + 36, undefined);
  1298            A.store.Bool(ptr + 12 + 50, false);
  1299            A.store.Int32(ptr + 12 + 40, 0);
  1300            A.store.Enum(ptr + 12 + 44, -1);
  1301          } else {
  1302            A.store.Bool(ptr + 12 + 51, true);
  1303            A.store.Ref(ptr + 12 + 0, x["request"]["requestId"]);
  1304            A.store.Ref(ptr + 12 + 4, x["request"]["url"]);
  1305            A.store.Ref(ptr + 12 + 8, x["request"]["initiator"]);
  1306            A.store.Ref(ptr + 12 + 12, x["request"]["method"]);
  1307            A.store.Bool(ptr + 12 + 48, "frameId" in x["request"] ? true : false);
  1308            A.store.Int32(ptr + 12 + 16, x["request"]["frameId"] === undefined ? 0 : (x["request"]["frameId"] as number));
  1309            A.store.Ref(ptr + 12 + 20, x["request"]["documentId"]);
  1310            A.store.Enum(
  1311              ptr + 12 + 24,
  1312              ["outermost_frame", "fenced_frame", "sub_frame"].indexOf(x["request"]["frameType"] as string)
  1313            );
  1314            A.store.Enum(
  1315              ptr + 12 + 28,
  1316              ["prerender", "active", "cached", "pending_deletion"].indexOf(x["request"]["documentLifecycle"] as string)
  1317            );
  1318            A.store.Bool(ptr + 12 + 49, "parentFrameId" in x["request"] ? true : false);
  1319            A.store.Int32(
  1320              ptr + 12 + 32,
  1321              x["request"]["parentFrameId"] === undefined ? 0 : (x["request"]["parentFrameId"] as number)
  1322            );
  1323            A.store.Ref(ptr + 12 + 36, x["request"]["parentDocumentId"]);
  1324            A.store.Bool(ptr + 12 + 50, "tabId" in x["request"] ? true : false);
  1325            A.store.Int32(ptr + 12 + 40, x["request"]["tabId"] === undefined ? 0 : (x["request"]["tabId"] as number));
  1326            A.store.Enum(
  1327              ptr + 12 + 44,
  1328              [
  1329                "main_frame",
  1330                "sub_frame",
  1331                "stylesheet",
  1332                "script",
  1333                "image",
  1334                "font",
  1335                "object",
  1336                "xmlhttprequest",
  1337                "ping",
  1338                "csp_report",
  1339                "media",
  1340                "websocket",
  1341                "webtransport",
  1342                "webbundle",
  1343                "other",
  1344              ].indexOf(x["request"]["type"] as string)
  1345            );
  1346          }
  1347        }
  1348      },
  1349      "load_MatchedRuleInfoDebug": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1350        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1351  
  1352        if (A.load.Bool(ptr + 0 + 9)) {
  1353          x["rule"] = {};
  1354          if (A.load.Bool(ptr + 0 + 8)) {
  1355            x["rule"]["ruleId"] = A.load.Int32(ptr + 0 + 0);
  1356          } else {
  1357            delete x["rule"]["ruleId"];
  1358          }
  1359          x["rule"]["rulesetId"] = A.load.Ref(ptr + 0 + 4, undefined);
  1360        } else {
  1361          delete x["rule"];
  1362        }
  1363        if (A.load.Bool(ptr + 12 + 51)) {
  1364          x["request"] = {};
  1365          x["request"]["requestId"] = A.load.Ref(ptr + 12 + 0, undefined);
  1366          x["request"]["url"] = A.load.Ref(ptr + 12 + 4, undefined);
  1367          x["request"]["initiator"] = A.load.Ref(ptr + 12 + 8, undefined);
  1368          x["request"]["method"] = A.load.Ref(ptr + 12 + 12, undefined);
  1369          if (A.load.Bool(ptr + 12 + 48)) {
  1370            x["request"]["frameId"] = A.load.Int32(ptr + 12 + 16);
  1371          } else {
  1372            delete x["request"]["frameId"];
  1373          }
  1374          x["request"]["documentId"] = A.load.Ref(ptr + 12 + 20, undefined);
  1375          x["request"]["frameType"] = A.load.Enum(ptr + 12 + 24, ["outermost_frame", "fenced_frame", "sub_frame"]);
  1376          x["request"]["documentLifecycle"] = A.load.Enum(ptr + 12 + 28, [
  1377            "prerender",
  1378            "active",
  1379            "cached",
  1380            "pending_deletion",
  1381          ]);
  1382          if (A.load.Bool(ptr + 12 + 49)) {
  1383            x["request"]["parentFrameId"] = A.load.Int32(ptr + 12 + 32);
  1384          } else {
  1385            delete x["request"]["parentFrameId"];
  1386          }
  1387          x["request"]["parentDocumentId"] = A.load.Ref(ptr + 12 + 36, undefined);
  1388          if (A.load.Bool(ptr + 12 + 50)) {
  1389            x["request"]["tabId"] = A.load.Int32(ptr + 12 + 40);
  1390          } else {
  1391            delete x["request"]["tabId"];
  1392          }
  1393          x["request"]["type"] = A.load.Enum(ptr + 12 + 44, [
  1394            "main_frame",
  1395            "sub_frame",
  1396            "stylesheet",
  1397            "script",
  1398            "image",
  1399            "font",
  1400            "object",
  1401            "xmlhttprequest",
  1402            "ping",
  1403            "csp_report",
  1404            "media",
  1405            "websocket",
  1406            "webtransport",
  1407            "webbundle",
  1408            "other",
  1409          ]);
  1410        } else {
  1411          delete x["request"];
  1412        }
  1413        return create === A.H.TRUE ? A.H.push(x) : ref;
  1414      },
  1415  
  1416      "store_MatchedRulesFilter": (ptr: Pointer, ref: heap.Ref<any>) => {
  1417        const x = A.H.get<any>(ref);
  1418  
  1419        if (typeof x === "undefined") {
  1420          A.store.Bool(ptr + 18, false);
  1421          A.store.Bool(ptr + 16, false);
  1422          A.store.Int32(ptr + 0, 0);
  1423          A.store.Bool(ptr + 17, false);
  1424          A.store.Float64(ptr + 8, 0);
  1425        } else {
  1426          A.store.Bool(ptr + 18, true);
  1427          A.store.Bool(ptr + 16, "tabId" in x ? true : false);
  1428          A.store.Int32(ptr + 0, x["tabId"] === undefined ? 0 : (x["tabId"] as number));
  1429          A.store.Bool(ptr + 17, "minTimeStamp" in x ? true : false);
  1430          A.store.Float64(ptr + 8, x["minTimeStamp"] === undefined ? 0 : (x["minTimeStamp"] as number));
  1431        }
  1432      },
  1433      "load_MatchedRulesFilter": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1434        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1435  
  1436        if (A.load.Bool(ptr + 16)) {
  1437          x["tabId"] = A.load.Int32(ptr + 0);
  1438        } else {
  1439          delete x["tabId"];
  1440        }
  1441        if (A.load.Bool(ptr + 17)) {
  1442          x["minTimeStamp"] = A.load.Float64(ptr + 8);
  1443        } else {
  1444          delete x["minTimeStamp"];
  1445        }
  1446        return create === A.H.TRUE ? A.H.push(x) : ref;
  1447      },
  1448  
  1449      "has_Properties_GUARANTEED_MINIMUM_STATIC_RULES": (self: heap.Ref<any>): heap.Ref<boolean> => {
  1450        if (WEBEXT?.declarativeNetRequest && "GUARANTEED_MINIMUM_STATIC_RULES" in WEBEXT?.declarativeNetRequest) {
  1451          return A.H.TRUE;
  1452        }
  1453        return A.H.FALSE;
  1454      },
  1455      "func_Properties_GUARANTEED_MINIMUM_STATIC_RULES": (self: heap.Ref<any>, fn: Pointer): void => {
  1456        A.store.Ref(fn, WEBEXT.declarativeNetRequest.GUARANTEED_MINIMUM_STATIC_RULES);
  1457      },
  1458  
  1459      "call_Properties_GUARANTEED_MINIMUM_STATIC_RULES": (self: heap.Ref<object>, retPtr: Pointer): void => {
  1460        const thiz = A.H.get<any>(self);
  1461  
  1462        const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.GUARANTEED_MINIMUM_STATIC_RULES, thiz, []);
  1463        A.store.Int32(retPtr, _ret);
  1464      },
  1465      "try_Properties_GUARANTEED_MINIMUM_STATIC_RULES": (
  1466        self: heap.Ref<object>,
  1467        retPtr: Pointer,
  1468        errPtr: Pointer
  1469      ): heap.Ref<boolean> => {
  1470        try {
  1471          const thiz = A.H.get<any>(self);
  1472  
  1473          const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.GUARANTEED_MINIMUM_STATIC_RULES, thiz, []);
  1474          A.store.Int32(retPtr, _ret);
  1475          return A.H.TRUE;
  1476        } catch (err: any) {
  1477          A.store.Ref(errPtr, err);
  1478          return A.H.FALSE;
  1479        }
  1480      },
  1481      "has_Properties_MAX_NUMBER_OF_DYNAMIC_RULES": (self: heap.Ref<any>): heap.Ref<boolean> => {
  1482        if (WEBEXT?.declarativeNetRequest && "MAX_NUMBER_OF_DYNAMIC_RULES" in WEBEXT?.declarativeNetRequest) {
  1483          return A.H.TRUE;
  1484        }
  1485        return A.H.FALSE;
  1486      },
  1487      "func_Properties_MAX_NUMBER_OF_DYNAMIC_RULES": (self: heap.Ref<any>, fn: Pointer): void => {
  1488        A.store.Ref(fn, WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_DYNAMIC_RULES);
  1489      },
  1490  
  1491      "call_Properties_MAX_NUMBER_OF_DYNAMIC_RULES": (self: heap.Ref<object>, retPtr: Pointer): void => {
  1492        const thiz = A.H.get<any>(self);
  1493  
  1494        const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_DYNAMIC_RULES, thiz, []);
  1495        A.store.Int32(retPtr, _ret);
  1496      },
  1497      "try_Properties_MAX_NUMBER_OF_DYNAMIC_RULES": (
  1498        self: heap.Ref<object>,
  1499        retPtr: Pointer,
  1500        errPtr: Pointer
  1501      ): heap.Ref<boolean> => {
  1502        try {
  1503          const thiz = A.H.get<any>(self);
  1504  
  1505          const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_DYNAMIC_RULES, thiz, []);
  1506          A.store.Int32(retPtr, _ret);
  1507          return A.H.TRUE;
  1508        } catch (err: any) {
  1509          A.store.Ref(errPtr, err);
  1510          return A.H.FALSE;
  1511        }
  1512      },
  1513      "has_Properties_MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES": (self: heap.Ref<any>): heap.Ref<boolean> => {
  1514        if (WEBEXT?.declarativeNetRequest && "MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES" in WEBEXT?.declarativeNetRequest) {
  1515          return A.H.TRUE;
  1516        }
  1517        return A.H.FALSE;
  1518      },
  1519      "func_Properties_MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES": (self: heap.Ref<any>, fn: Pointer): void => {
  1520        A.store.Ref(fn, WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES);
  1521      },
  1522  
  1523      "call_Properties_MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES": (self: heap.Ref<object>, retPtr: Pointer): void => {
  1524        const thiz = A.H.get<any>(self);
  1525  
  1526        const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES, thiz, []);
  1527        A.store.Int32(retPtr, _ret);
  1528      },
  1529      "try_Properties_MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES": (
  1530        self: heap.Ref<object>,
  1531        retPtr: Pointer,
  1532        errPtr: Pointer
  1533      ): heap.Ref<boolean> => {
  1534        try {
  1535          const thiz = A.H.get<any>(self);
  1536  
  1537          const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_DYNAMIC_AND_SESSION_RULES, thiz, []);
  1538          A.store.Int32(retPtr, _ret);
  1539          return A.H.TRUE;
  1540        } catch (err: any) {
  1541          A.store.Ref(errPtr, err);
  1542          return A.H.FALSE;
  1543        }
  1544      },
  1545      "has_Properties_GETMATCHEDRULES_QUOTA_INTERVAL": (self: heap.Ref<any>): heap.Ref<boolean> => {
  1546        if (WEBEXT?.declarativeNetRequest && "GETMATCHEDRULES_QUOTA_INTERVAL" in WEBEXT?.declarativeNetRequest) {
  1547          return A.H.TRUE;
  1548        }
  1549        return A.H.FALSE;
  1550      },
  1551      "func_Properties_GETMATCHEDRULES_QUOTA_INTERVAL": (self: heap.Ref<any>, fn: Pointer): void => {
  1552        A.store.Ref(fn, WEBEXT.declarativeNetRequest.GETMATCHEDRULES_QUOTA_INTERVAL);
  1553      },
  1554  
  1555      "call_Properties_GETMATCHEDRULES_QUOTA_INTERVAL": (self: heap.Ref<object>, retPtr: Pointer): void => {
  1556        const thiz = A.H.get<any>(self);
  1557  
  1558        const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.GETMATCHEDRULES_QUOTA_INTERVAL, thiz, []);
  1559        A.store.Int32(retPtr, _ret);
  1560      },
  1561      "try_Properties_GETMATCHEDRULES_QUOTA_INTERVAL": (
  1562        self: heap.Ref<object>,
  1563        retPtr: Pointer,
  1564        errPtr: Pointer
  1565      ): heap.Ref<boolean> => {
  1566        try {
  1567          const thiz = A.H.get<any>(self);
  1568  
  1569          const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.GETMATCHEDRULES_QUOTA_INTERVAL, thiz, []);
  1570          A.store.Int32(retPtr, _ret);
  1571          return A.H.TRUE;
  1572        } catch (err: any) {
  1573          A.store.Ref(errPtr, err);
  1574          return A.H.FALSE;
  1575        }
  1576      },
  1577      "has_Properties_MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL": (self: heap.Ref<any>): heap.Ref<boolean> => {
  1578        if (WEBEXT?.declarativeNetRequest && "MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL" in WEBEXT?.declarativeNetRequest) {
  1579          return A.H.TRUE;
  1580        }
  1581        return A.H.FALSE;
  1582      },
  1583      "func_Properties_MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL": (self: heap.Ref<any>, fn: Pointer): void => {
  1584        A.store.Ref(fn, WEBEXT.declarativeNetRequest.MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL);
  1585      },
  1586  
  1587      "call_Properties_MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL": (self: heap.Ref<object>, retPtr: Pointer): void => {
  1588        const thiz = A.H.get<any>(self);
  1589  
  1590        const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL, thiz, []);
  1591        A.store.Int32(retPtr, _ret);
  1592      },
  1593      "try_Properties_MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL": (
  1594        self: heap.Ref<object>,
  1595        retPtr: Pointer,
  1596        errPtr: Pointer
  1597      ): heap.Ref<boolean> => {
  1598        try {
  1599          const thiz = A.H.get<any>(self);
  1600  
  1601          const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.MAX_GETMATCHEDRULES_CALLS_PER_INTERVAL, thiz, []);
  1602          A.store.Int32(retPtr, _ret);
  1603          return A.H.TRUE;
  1604        } catch (err: any) {
  1605          A.store.Ref(errPtr, err);
  1606          return A.H.FALSE;
  1607        }
  1608      },
  1609      "has_Properties_MAX_NUMBER_OF_REGEX_RULES": (self: heap.Ref<any>): heap.Ref<boolean> => {
  1610        if (WEBEXT?.declarativeNetRequest && "MAX_NUMBER_OF_REGEX_RULES" in WEBEXT?.declarativeNetRequest) {
  1611          return A.H.TRUE;
  1612        }
  1613        return A.H.FALSE;
  1614      },
  1615      "func_Properties_MAX_NUMBER_OF_REGEX_RULES": (self: heap.Ref<any>, fn: Pointer): void => {
  1616        A.store.Ref(fn, WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_REGEX_RULES);
  1617      },
  1618  
  1619      "call_Properties_MAX_NUMBER_OF_REGEX_RULES": (self: heap.Ref<object>, retPtr: Pointer): void => {
  1620        const thiz = A.H.get<any>(self);
  1621  
  1622        const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_REGEX_RULES, thiz, []);
  1623        A.store.Int32(retPtr, _ret);
  1624      },
  1625      "try_Properties_MAX_NUMBER_OF_REGEX_RULES": (
  1626        self: heap.Ref<object>,
  1627        retPtr: Pointer,
  1628        errPtr: Pointer
  1629      ): heap.Ref<boolean> => {
  1630        try {
  1631          const thiz = A.H.get<any>(self);
  1632  
  1633          const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_REGEX_RULES, thiz, []);
  1634          A.store.Int32(retPtr, _ret);
  1635          return A.H.TRUE;
  1636        } catch (err: any) {
  1637          A.store.Ref(errPtr, err);
  1638          return A.H.FALSE;
  1639        }
  1640      },
  1641      "has_Properties_MAX_NUMBER_OF_STATIC_RULESETS": (self: heap.Ref<any>): heap.Ref<boolean> => {
  1642        if (WEBEXT?.declarativeNetRequest && "MAX_NUMBER_OF_STATIC_RULESETS" in WEBEXT?.declarativeNetRequest) {
  1643          return A.H.TRUE;
  1644        }
  1645        return A.H.FALSE;
  1646      },
  1647      "func_Properties_MAX_NUMBER_OF_STATIC_RULESETS": (self: heap.Ref<any>, fn: Pointer): void => {
  1648        A.store.Ref(fn, WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_STATIC_RULESETS);
  1649      },
  1650  
  1651      "call_Properties_MAX_NUMBER_OF_STATIC_RULESETS": (self: heap.Ref<object>, retPtr: Pointer): void => {
  1652        const thiz = A.H.get<any>(self);
  1653  
  1654        const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_STATIC_RULESETS, thiz, []);
  1655        A.store.Int32(retPtr, _ret);
  1656      },
  1657      "try_Properties_MAX_NUMBER_OF_STATIC_RULESETS": (
  1658        self: heap.Ref<object>,
  1659        retPtr: Pointer,
  1660        errPtr: Pointer
  1661      ): heap.Ref<boolean> => {
  1662        try {
  1663          const thiz = A.H.get<any>(self);
  1664  
  1665          const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_STATIC_RULESETS, thiz, []);
  1666          A.store.Int32(retPtr, _ret);
  1667          return A.H.TRUE;
  1668        } catch (err: any) {
  1669          A.store.Ref(errPtr, err);
  1670          return A.H.FALSE;
  1671        }
  1672      },
  1673      "has_Properties_MAX_NUMBER_OF_ENABLED_STATIC_RULESETS": (self: heap.Ref<any>): heap.Ref<boolean> => {
  1674        if (WEBEXT?.declarativeNetRequest && "MAX_NUMBER_OF_ENABLED_STATIC_RULESETS" in WEBEXT?.declarativeNetRequest) {
  1675          return A.H.TRUE;
  1676        }
  1677        return A.H.FALSE;
  1678      },
  1679      "func_Properties_MAX_NUMBER_OF_ENABLED_STATIC_RULESETS": (self: heap.Ref<any>, fn: Pointer): void => {
  1680        A.store.Ref(fn, WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_ENABLED_STATIC_RULESETS);
  1681      },
  1682  
  1683      "call_Properties_MAX_NUMBER_OF_ENABLED_STATIC_RULESETS": (self: heap.Ref<object>, retPtr: Pointer): void => {
  1684        const thiz = A.H.get<any>(self);
  1685  
  1686        const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_ENABLED_STATIC_RULESETS, thiz, []);
  1687        A.store.Int32(retPtr, _ret);
  1688      },
  1689      "try_Properties_MAX_NUMBER_OF_ENABLED_STATIC_RULESETS": (
  1690        self: heap.Ref<object>,
  1691        retPtr: Pointer,
  1692        errPtr: Pointer
  1693      ): heap.Ref<boolean> => {
  1694        try {
  1695          const thiz = A.H.get<any>(self);
  1696  
  1697          const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.MAX_NUMBER_OF_ENABLED_STATIC_RULESETS, thiz, []);
  1698          A.store.Int32(retPtr, _ret);
  1699          return A.H.TRUE;
  1700        } catch (err: any) {
  1701          A.store.Ref(errPtr, err);
  1702          return A.H.FALSE;
  1703        }
  1704      },
  1705      "has_Properties_DYNAMIC_RULESET_ID": (self: heap.Ref<any>): heap.Ref<boolean> => {
  1706        if (WEBEXT?.declarativeNetRequest && "DYNAMIC_RULESET_ID" in WEBEXT?.declarativeNetRequest) {
  1707          return A.H.TRUE;
  1708        }
  1709        return A.H.FALSE;
  1710      },
  1711      "func_Properties_DYNAMIC_RULESET_ID": (self: heap.Ref<any>, fn: Pointer): void => {
  1712        A.store.Ref(fn, WEBEXT.declarativeNetRequest.DYNAMIC_RULESET_ID);
  1713      },
  1714  
  1715      "call_Properties_DYNAMIC_RULESET_ID": (self: heap.Ref<object>, retPtr: Pointer): void => {
  1716        const thiz = A.H.get<any>(self);
  1717  
  1718        const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.DYNAMIC_RULESET_ID, thiz, []);
  1719        A.store.Ref(retPtr, _ret);
  1720      },
  1721      "try_Properties_DYNAMIC_RULESET_ID": (
  1722        self: heap.Ref<object>,
  1723        retPtr: Pointer,
  1724        errPtr: Pointer
  1725      ): heap.Ref<boolean> => {
  1726        try {
  1727          const thiz = A.H.get<any>(self);
  1728  
  1729          const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.DYNAMIC_RULESET_ID, thiz, []);
  1730          A.store.Ref(retPtr, _ret);
  1731          return A.H.TRUE;
  1732        } catch (err: any) {
  1733          A.store.Ref(errPtr, err);
  1734          return A.H.FALSE;
  1735        }
  1736      },
  1737      "has_Properties_SESSION_RULESET_ID": (self: heap.Ref<any>): heap.Ref<boolean> => {
  1738        if (WEBEXT?.declarativeNetRequest && "SESSION_RULESET_ID" in WEBEXT?.declarativeNetRequest) {
  1739          return A.H.TRUE;
  1740        }
  1741        return A.H.FALSE;
  1742      },
  1743      "func_Properties_SESSION_RULESET_ID": (self: heap.Ref<any>, fn: Pointer): void => {
  1744        A.store.Ref(fn, WEBEXT.declarativeNetRequest.SESSION_RULESET_ID);
  1745      },
  1746  
  1747      "call_Properties_SESSION_RULESET_ID": (self: heap.Ref<object>, retPtr: Pointer): void => {
  1748        const thiz = A.H.get<any>(self);
  1749  
  1750        const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.SESSION_RULESET_ID, thiz, []);
  1751        A.store.Ref(retPtr, _ret);
  1752      },
  1753      "try_Properties_SESSION_RULESET_ID": (
  1754        self: heap.Ref<object>,
  1755        retPtr: Pointer,
  1756        errPtr: Pointer
  1757      ): heap.Ref<boolean> => {
  1758        try {
  1759          const thiz = A.H.get<any>(self);
  1760  
  1761          const _ret = Reflect.apply(WEBEXT.declarativeNetRequest.SESSION_RULESET_ID, thiz, []);
  1762          A.store.Ref(retPtr, _ret);
  1763          return A.H.TRUE;
  1764        } catch (err: any) {
  1765          A.store.Ref(errPtr, err);
  1766          return A.H.FALSE;
  1767        }
  1768      },
  1769  
  1770      "store_RegexOptions": (ptr: Pointer, ref: heap.Ref<any>) => {
  1771        const x = A.H.get<any>(ref);
  1772  
  1773        if (typeof x === "undefined") {
  1774          A.store.Bool(ptr + 8, false);
  1775          A.store.Ref(ptr + 0, undefined);
  1776          A.store.Bool(ptr + 6, false);
  1777          A.store.Bool(ptr + 4, false);
  1778          A.store.Bool(ptr + 7, false);
  1779          A.store.Bool(ptr + 5, false);
  1780        } else {
  1781          A.store.Bool(ptr + 8, true);
  1782          A.store.Ref(ptr + 0, x["regex"]);
  1783          A.store.Bool(ptr + 6, "isCaseSensitive" in x ? true : false);
  1784          A.store.Bool(ptr + 4, x["isCaseSensitive"] ? true : false);
  1785          A.store.Bool(ptr + 7, "requireCapturing" in x ? true : false);
  1786          A.store.Bool(ptr + 5, x["requireCapturing"] ? true : false);
  1787        }
  1788      },
  1789      "load_RegexOptions": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1790        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1791  
  1792        x["regex"] = A.load.Ref(ptr + 0, undefined);
  1793        if (A.load.Bool(ptr + 6)) {
  1794          x["isCaseSensitive"] = A.load.Bool(ptr + 4);
  1795        } else {
  1796          delete x["isCaseSensitive"];
  1797        }
  1798        if (A.load.Bool(ptr + 7)) {
  1799          x["requireCapturing"] = A.load.Bool(ptr + 5);
  1800        } else {
  1801          delete x["requireCapturing"];
  1802        }
  1803        return create === A.H.TRUE ? A.H.push(x) : ref;
  1804      },
  1805  
  1806      "store_TestMatchOutcomeResult": (ptr: Pointer, ref: heap.Ref<any>) => {
  1807        const x = A.H.get<any>(ref);
  1808  
  1809        if (typeof x === "undefined") {
  1810          A.store.Bool(ptr + 4, false);
  1811          A.store.Ref(ptr + 0, undefined);
  1812        } else {
  1813          A.store.Bool(ptr + 4, true);
  1814          A.store.Ref(ptr + 0, x["matchedRules"]);
  1815        }
  1816      },
  1817      "load_TestMatchOutcomeResult": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1818        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1819  
  1820        x["matchedRules"] = A.load.Ref(ptr + 0, undefined);
  1821        return create === A.H.TRUE ? A.H.push(x) : ref;
  1822      },
  1823  
  1824      "store_TestMatchRequestDetails": (ptr: Pointer, ref: heap.Ref<any>) => {
  1825        const x = A.H.get<any>(ref);
  1826  
  1827        if (typeof x === "undefined") {
  1828          A.store.Bool(ptr + 21, false);
  1829          A.store.Ref(ptr + 0, undefined);
  1830          A.store.Ref(ptr + 4, undefined);
  1831          A.store.Enum(ptr + 8, -1);
  1832          A.store.Enum(ptr + 12, -1);
  1833          A.store.Bool(ptr + 20, false);
  1834          A.store.Int32(ptr + 16, 0);
  1835        } else {
  1836          A.store.Bool(ptr + 21, true);
  1837          A.store.Ref(ptr + 0, x["url"]);
  1838          A.store.Ref(ptr + 4, x["initiator"]);
  1839          A.store.Enum(
  1840            ptr + 8,
  1841            ["connect", "delete", "get", "head", "options", "patch", "post", "put", "other"].indexOf(
  1842              x["method"] as string
  1843            )
  1844          );
  1845          A.store.Enum(
  1846            ptr + 12,
  1847            [
  1848              "main_frame",
  1849              "sub_frame",
  1850              "stylesheet",
  1851              "script",
  1852              "image",
  1853              "font",
  1854              "object",
  1855              "xmlhttprequest",
  1856              "ping",
  1857              "csp_report",
  1858              "media",
  1859              "websocket",
  1860              "webtransport",
  1861              "webbundle",
  1862              "other",
  1863            ].indexOf(x["type"] as string)
  1864          );
  1865          A.store.Bool(ptr + 20, "tabId" in x ? true : false);
  1866          A.store.Int32(ptr + 16, x["tabId"] === undefined ? 0 : (x["tabId"] as number));
  1867        }
  1868      },
  1869      "load_TestMatchRequestDetails": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1870        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1871  
  1872        x["url"] = A.load.Ref(ptr + 0, undefined);
  1873        x["initiator"] = A.load.Ref(ptr + 4, undefined);
  1874        x["method"] = A.load.Enum(ptr + 8, [
  1875          "connect",
  1876          "delete",
  1877          "get",
  1878          "head",
  1879          "options",
  1880          "patch",
  1881          "post",
  1882          "put",
  1883          "other",
  1884        ]);
  1885        x["type"] = A.load.Enum(ptr + 12, [
  1886          "main_frame",
  1887          "sub_frame",
  1888          "stylesheet",
  1889          "script",
  1890          "image",
  1891          "font",
  1892          "object",
  1893          "xmlhttprequest",
  1894          "ping",
  1895          "csp_report",
  1896          "media",
  1897          "websocket",
  1898          "webtransport",
  1899          "webbundle",
  1900          "other",
  1901        ]);
  1902        if (A.load.Bool(ptr + 20)) {
  1903          x["tabId"] = A.load.Int32(ptr + 16);
  1904        } else {
  1905          delete x["tabId"];
  1906        }
  1907        return create === A.H.TRUE ? A.H.push(x) : ref;
  1908      },
  1909  
  1910      "store_UpdateRuleOptions": (ptr: Pointer, ref: heap.Ref<any>) => {
  1911        const x = A.H.get<any>(ref);
  1912  
  1913        if (typeof x === "undefined") {
  1914          A.store.Bool(ptr + 8, false);
  1915          A.store.Ref(ptr + 0, undefined);
  1916          A.store.Ref(ptr + 4, undefined);
  1917        } else {
  1918          A.store.Bool(ptr + 8, true);
  1919          A.store.Ref(ptr + 0, x["removeRuleIds"]);
  1920          A.store.Ref(ptr + 4, x["addRules"]);
  1921        }
  1922      },
  1923      "load_UpdateRuleOptions": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1924        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1925  
  1926        x["removeRuleIds"] = A.load.Ref(ptr + 0, undefined);
  1927        x["addRules"] = A.load.Ref(ptr + 4, undefined);
  1928        return create === A.H.TRUE ? A.H.push(x) : ref;
  1929      },
  1930  
  1931      "store_UpdateRulesetOptions": (ptr: Pointer, ref: heap.Ref<any>) => {
  1932        const x = A.H.get<any>(ref);
  1933  
  1934        if (typeof x === "undefined") {
  1935          A.store.Bool(ptr + 8, false);
  1936          A.store.Ref(ptr + 0, undefined);
  1937          A.store.Ref(ptr + 4, undefined);
  1938        } else {
  1939          A.store.Bool(ptr + 8, true);
  1940          A.store.Ref(ptr + 0, x["disableRulesetIds"]);
  1941          A.store.Ref(ptr + 4, x["enableRulesetIds"]);
  1942        }
  1943      },
  1944      "load_UpdateRulesetOptions": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1945        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1946  
  1947        x["disableRulesetIds"] = A.load.Ref(ptr + 0, undefined);
  1948        x["enableRulesetIds"] = A.load.Ref(ptr + 4, undefined);
  1949        return create === A.H.TRUE ? A.H.push(x) : ref;
  1950      },
  1951  
  1952      "store_UpdateStaticRulesOptions": (ptr: Pointer, ref: heap.Ref<any>) => {
  1953        const x = A.H.get<any>(ref);
  1954  
  1955        if (typeof x === "undefined") {
  1956          A.store.Bool(ptr + 12, false);
  1957          A.store.Ref(ptr + 0, undefined);
  1958          A.store.Ref(ptr + 4, undefined);
  1959          A.store.Ref(ptr + 8, undefined);
  1960        } else {
  1961          A.store.Bool(ptr + 12, true);
  1962          A.store.Ref(ptr + 0, x["rulesetId"]);
  1963          A.store.Ref(ptr + 4, x["disableRuleIds"]);
  1964          A.store.Ref(ptr + 8, x["enableRuleIds"]);
  1965        }
  1966      },
  1967      "load_UpdateStaticRulesOptions": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
  1968        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
  1969  
  1970        x["rulesetId"] = A.load.Ref(ptr + 0, undefined);
  1971        x["disableRuleIds"] = A.load.Ref(ptr + 4, undefined);
  1972        x["enableRuleIds"] = A.load.Ref(ptr + 8, undefined);
  1973        return create === A.H.TRUE ? A.H.push(x) : ref;
  1974      },
  1975      "has_GetAvailableStaticRuleCount": (): heap.Ref<boolean> => {
  1976        if (WEBEXT?.declarativeNetRequest && "getAvailableStaticRuleCount" in WEBEXT?.declarativeNetRequest) {
  1977          return A.H.TRUE;
  1978        }
  1979        return A.H.FALSE;
  1980      },
  1981      "func_GetAvailableStaticRuleCount": (fn: Pointer): void => {
  1982        A.store.Ref(fn, WEBEXT.declarativeNetRequest.getAvailableStaticRuleCount);
  1983      },
  1984      "call_GetAvailableStaticRuleCount": (retPtr: Pointer): void => {
  1985        const _ret = WEBEXT.declarativeNetRequest.getAvailableStaticRuleCount();
  1986        A.store.Ref(retPtr, _ret);
  1987      },
  1988      "try_GetAvailableStaticRuleCount": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
  1989        try {
  1990          const _ret = WEBEXT.declarativeNetRequest.getAvailableStaticRuleCount();
  1991          A.store.Ref(retPtr, _ret);
  1992          return A.H.TRUE;
  1993        } catch (err: any) {
  1994          A.store.Ref(errPtr, err);
  1995          return A.H.FALSE;
  1996        }
  1997      },
  1998      "has_GetDisabledRuleIds": (): heap.Ref<boolean> => {
  1999        if (WEBEXT?.declarativeNetRequest && "getDisabledRuleIds" in WEBEXT?.declarativeNetRequest) {
  2000          return A.H.TRUE;
  2001        }
  2002        return A.H.FALSE;
  2003      },
  2004      "func_GetDisabledRuleIds": (fn: Pointer): void => {
  2005        A.store.Ref(fn, WEBEXT.declarativeNetRequest.getDisabledRuleIds);
  2006      },
  2007      "call_GetDisabledRuleIds": (retPtr: Pointer, options: Pointer): void => {
  2008        const options_ffi = {};
  2009  
  2010        options_ffi["rulesetId"] = A.load.Ref(options + 0, undefined);
  2011  
  2012        const _ret = WEBEXT.declarativeNetRequest.getDisabledRuleIds(options_ffi);
  2013        A.store.Ref(retPtr, _ret);
  2014      },
  2015      "try_GetDisabledRuleIds": (retPtr: Pointer, errPtr: Pointer, options: Pointer): heap.Ref<boolean> => {
  2016        try {
  2017          const options_ffi = {};
  2018  
  2019          options_ffi["rulesetId"] = A.load.Ref(options + 0, undefined);
  2020  
  2021          const _ret = WEBEXT.declarativeNetRequest.getDisabledRuleIds(options_ffi);
  2022          A.store.Ref(retPtr, _ret);
  2023          return A.H.TRUE;
  2024        } catch (err: any) {
  2025          A.store.Ref(errPtr, err);
  2026          return A.H.FALSE;
  2027        }
  2028      },
  2029      "has_GetDynamicRules": (): heap.Ref<boolean> => {
  2030        if (WEBEXT?.declarativeNetRequest && "getDynamicRules" in WEBEXT?.declarativeNetRequest) {
  2031          return A.H.TRUE;
  2032        }
  2033        return A.H.FALSE;
  2034      },
  2035      "func_GetDynamicRules": (fn: Pointer): void => {
  2036        A.store.Ref(fn, WEBEXT.declarativeNetRequest.getDynamicRules);
  2037      },
  2038      "call_GetDynamicRules": (retPtr: Pointer, filter: Pointer): void => {
  2039        const filter_ffi = {};
  2040  
  2041        filter_ffi["ruleIds"] = A.load.Ref(filter + 0, undefined);
  2042  
  2043        const _ret = WEBEXT.declarativeNetRequest.getDynamicRules(filter_ffi);
  2044        A.store.Ref(retPtr, _ret);
  2045      },
  2046      "try_GetDynamicRules": (retPtr: Pointer, errPtr: Pointer, filter: Pointer): heap.Ref<boolean> => {
  2047        try {
  2048          const filter_ffi = {};
  2049  
  2050          filter_ffi["ruleIds"] = A.load.Ref(filter + 0, undefined);
  2051  
  2052          const _ret = WEBEXT.declarativeNetRequest.getDynamicRules(filter_ffi);
  2053          A.store.Ref(retPtr, _ret);
  2054          return A.H.TRUE;
  2055        } catch (err: any) {
  2056          A.store.Ref(errPtr, err);
  2057          return A.H.FALSE;
  2058        }
  2059      },
  2060      "has_GetEnabledRulesets": (): heap.Ref<boolean> => {
  2061        if (WEBEXT?.declarativeNetRequest && "getEnabledRulesets" in WEBEXT?.declarativeNetRequest) {
  2062          return A.H.TRUE;
  2063        }
  2064        return A.H.FALSE;
  2065      },
  2066      "func_GetEnabledRulesets": (fn: Pointer): void => {
  2067        A.store.Ref(fn, WEBEXT.declarativeNetRequest.getEnabledRulesets);
  2068      },
  2069      "call_GetEnabledRulesets": (retPtr: Pointer): void => {
  2070        const _ret = WEBEXT.declarativeNetRequest.getEnabledRulesets();
  2071        A.store.Ref(retPtr, _ret);
  2072      },
  2073      "try_GetEnabledRulesets": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
  2074        try {
  2075          const _ret = WEBEXT.declarativeNetRequest.getEnabledRulesets();
  2076          A.store.Ref(retPtr, _ret);
  2077          return A.H.TRUE;
  2078        } catch (err: any) {
  2079          A.store.Ref(errPtr, err);
  2080          return A.H.FALSE;
  2081        }
  2082      },
  2083      "has_GetMatchedRules": (): heap.Ref<boolean> => {
  2084        if (WEBEXT?.declarativeNetRequest && "getMatchedRules" in WEBEXT?.declarativeNetRequest) {
  2085          return A.H.TRUE;
  2086        }
  2087        return A.H.FALSE;
  2088      },
  2089      "func_GetMatchedRules": (fn: Pointer): void => {
  2090        A.store.Ref(fn, WEBEXT.declarativeNetRequest.getMatchedRules);
  2091      },
  2092      "call_GetMatchedRules": (retPtr: Pointer, filter: Pointer): void => {
  2093        const filter_ffi = {};
  2094  
  2095        if (A.load.Bool(filter + 16)) {
  2096          filter_ffi["tabId"] = A.load.Int32(filter + 0);
  2097        }
  2098        if (A.load.Bool(filter + 17)) {
  2099          filter_ffi["minTimeStamp"] = A.load.Float64(filter + 8);
  2100        }
  2101  
  2102        const _ret = WEBEXT.declarativeNetRequest.getMatchedRules(filter_ffi);
  2103        A.store.Ref(retPtr, _ret);
  2104      },
  2105      "try_GetMatchedRules": (retPtr: Pointer, errPtr: Pointer, filter: Pointer): heap.Ref<boolean> => {
  2106        try {
  2107          const filter_ffi = {};
  2108  
  2109          if (A.load.Bool(filter + 16)) {
  2110            filter_ffi["tabId"] = A.load.Int32(filter + 0);
  2111          }
  2112          if (A.load.Bool(filter + 17)) {
  2113            filter_ffi["minTimeStamp"] = A.load.Float64(filter + 8);
  2114          }
  2115  
  2116          const _ret = WEBEXT.declarativeNetRequest.getMatchedRules(filter_ffi);
  2117          A.store.Ref(retPtr, _ret);
  2118          return A.H.TRUE;
  2119        } catch (err: any) {
  2120          A.store.Ref(errPtr, err);
  2121          return A.H.FALSE;
  2122        }
  2123      },
  2124      "has_GetSessionRules": (): heap.Ref<boolean> => {
  2125        if (WEBEXT?.declarativeNetRequest && "getSessionRules" in WEBEXT?.declarativeNetRequest) {
  2126          return A.H.TRUE;
  2127        }
  2128        return A.H.FALSE;
  2129      },
  2130      "func_GetSessionRules": (fn: Pointer): void => {
  2131        A.store.Ref(fn, WEBEXT.declarativeNetRequest.getSessionRules);
  2132      },
  2133      "call_GetSessionRules": (retPtr: Pointer, filter: Pointer): void => {
  2134        const filter_ffi = {};
  2135  
  2136        filter_ffi["ruleIds"] = A.load.Ref(filter + 0, undefined);
  2137  
  2138        const _ret = WEBEXT.declarativeNetRequest.getSessionRules(filter_ffi);
  2139        A.store.Ref(retPtr, _ret);
  2140      },
  2141      "try_GetSessionRules": (retPtr: Pointer, errPtr: Pointer, filter: Pointer): heap.Ref<boolean> => {
  2142        try {
  2143          const filter_ffi = {};
  2144  
  2145          filter_ffi["ruleIds"] = A.load.Ref(filter + 0, undefined);
  2146  
  2147          const _ret = WEBEXT.declarativeNetRequest.getSessionRules(filter_ffi);
  2148          A.store.Ref(retPtr, _ret);
  2149          return A.H.TRUE;
  2150        } catch (err: any) {
  2151          A.store.Ref(errPtr, err);
  2152          return A.H.FALSE;
  2153        }
  2154      },
  2155      "has_IsRegexSupported": (): heap.Ref<boolean> => {
  2156        if (WEBEXT?.declarativeNetRequest && "isRegexSupported" in WEBEXT?.declarativeNetRequest) {
  2157          return A.H.TRUE;
  2158        }
  2159        return A.H.FALSE;
  2160      },
  2161      "func_IsRegexSupported": (fn: Pointer): void => {
  2162        A.store.Ref(fn, WEBEXT.declarativeNetRequest.isRegexSupported);
  2163      },
  2164      "call_IsRegexSupported": (retPtr: Pointer, regexOptions: Pointer): void => {
  2165        const regexOptions_ffi = {};
  2166  
  2167        regexOptions_ffi["regex"] = A.load.Ref(regexOptions + 0, undefined);
  2168        if (A.load.Bool(regexOptions + 6)) {
  2169          regexOptions_ffi["isCaseSensitive"] = A.load.Bool(regexOptions + 4);
  2170        }
  2171        if (A.load.Bool(regexOptions + 7)) {
  2172          regexOptions_ffi["requireCapturing"] = A.load.Bool(regexOptions + 5);
  2173        }
  2174  
  2175        const _ret = WEBEXT.declarativeNetRequest.isRegexSupported(regexOptions_ffi);
  2176        A.store.Ref(retPtr, _ret);
  2177      },
  2178      "try_IsRegexSupported": (retPtr: Pointer, errPtr: Pointer, regexOptions: Pointer): heap.Ref<boolean> => {
  2179        try {
  2180          const regexOptions_ffi = {};
  2181  
  2182          regexOptions_ffi["regex"] = A.load.Ref(regexOptions + 0, undefined);
  2183          if (A.load.Bool(regexOptions + 6)) {
  2184            regexOptions_ffi["isCaseSensitive"] = A.load.Bool(regexOptions + 4);
  2185          }
  2186          if (A.load.Bool(regexOptions + 7)) {
  2187            regexOptions_ffi["requireCapturing"] = A.load.Bool(regexOptions + 5);
  2188          }
  2189  
  2190          const _ret = WEBEXT.declarativeNetRequest.isRegexSupported(regexOptions_ffi);
  2191          A.store.Ref(retPtr, _ret);
  2192          return A.H.TRUE;
  2193        } catch (err: any) {
  2194          A.store.Ref(errPtr, err);
  2195          return A.H.FALSE;
  2196        }
  2197      },
  2198      "has_OnRuleMatchedDebug": (): heap.Ref<boolean> => {
  2199        if (
  2200          WEBEXT?.declarativeNetRequest?.onRuleMatchedDebug &&
  2201          "addListener" in WEBEXT?.declarativeNetRequest?.onRuleMatchedDebug
  2202        ) {
  2203          return A.H.TRUE;
  2204        }
  2205        return A.H.FALSE;
  2206      },
  2207      "func_OnRuleMatchedDebug": (fn: Pointer): void => {
  2208        A.store.Ref(fn, WEBEXT.declarativeNetRequest.onRuleMatchedDebug.addListener);
  2209      },
  2210      "call_OnRuleMatchedDebug": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  2211        const _ret = WEBEXT.declarativeNetRequest.onRuleMatchedDebug.addListener(A.H.get<object>(callback));
  2212      },
  2213      "try_OnRuleMatchedDebug": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  2214        try {
  2215          const _ret = WEBEXT.declarativeNetRequest.onRuleMatchedDebug.addListener(A.H.get<object>(callback));
  2216          return A.H.TRUE;
  2217        } catch (err: any) {
  2218          A.store.Ref(errPtr, err);
  2219          return A.H.FALSE;
  2220        }
  2221      },
  2222      "has_OffRuleMatchedDebug": (): heap.Ref<boolean> => {
  2223        if (
  2224          WEBEXT?.declarativeNetRequest?.onRuleMatchedDebug &&
  2225          "removeListener" in WEBEXT?.declarativeNetRequest?.onRuleMatchedDebug
  2226        ) {
  2227          return A.H.TRUE;
  2228        }
  2229        return A.H.FALSE;
  2230      },
  2231      "func_OffRuleMatchedDebug": (fn: Pointer): void => {
  2232        A.store.Ref(fn, WEBEXT.declarativeNetRequest.onRuleMatchedDebug.removeListener);
  2233      },
  2234      "call_OffRuleMatchedDebug": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  2235        const _ret = WEBEXT.declarativeNetRequest.onRuleMatchedDebug.removeListener(A.H.get<object>(callback));
  2236      },
  2237      "try_OffRuleMatchedDebug": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  2238        try {
  2239          const _ret = WEBEXT.declarativeNetRequest.onRuleMatchedDebug.removeListener(A.H.get<object>(callback));
  2240          return A.H.TRUE;
  2241        } catch (err: any) {
  2242          A.store.Ref(errPtr, err);
  2243          return A.H.FALSE;
  2244        }
  2245      },
  2246      "has_HasOnRuleMatchedDebug": (): heap.Ref<boolean> => {
  2247        if (
  2248          WEBEXT?.declarativeNetRequest?.onRuleMatchedDebug &&
  2249          "hasListener" in WEBEXT?.declarativeNetRequest?.onRuleMatchedDebug
  2250        ) {
  2251          return A.H.TRUE;
  2252        }
  2253        return A.H.FALSE;
  2254      },
  2255      "func_HasOnRuleMatchedDebug": (fn: Pointer): void => {
  2256        A.store.Ref(fn, WEBEXT.declarativeNetRequest.onRuleMatchedDebug.hasListener);
  2257      },
  2258      "call_HasOnRuleMatchedDebug": (retPtr: Pointer, callback: heap.Ref<object>): void => {
  2259        const _ret = WEBEXT.declarativeNetRequest.onRuleMatchedDebug.hasListener(A.H.get<object>(callback));
  2260        A.store.Bool(retPtr, _ret);
  2261      },
  2262      "try_HasOnRuleMatchedDebug": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
  2263        try {
  2264          const _ret = WEBEXT.declarativeNetRequest.onRuleMatchedDebug.hasListener(A.H.get<object>(callback));
  2265          A.store.Bool(retPtr, _ret);
  2266          return A.H.TRUE;
  2267        } catch (err: any) {
  2268          A.store.Ref(errPtr, err);
  2269          return A.H.FALSE;
  2270        }
  2271      },
  2272      "has_SetExtensionActionOptions": (): heap.Ref<boolean> => {
  2273        if (WEBEXT?.declarativeNetRequest && "setExtensionActionOptions" in WEBEXT?.declarativeNetRequest) {
  2274          return A.H.TRUE;
  2275        }
  2276        return A.H.FALSE;
  2277      },
  2278      "func_SetExtensionActionOptions": (fn: Pointer): void => {
  2279        A.store.Ref(fn, WEBEXT.declarativeNetRequest.setExtensionActionOptions);
  2280      },
  2281      "call_SetExtensionActionOptions": (retPtr: Pointer, options: Pointer): void => {
  2282        const options_ffi = {};
  2283  
  2284        if (A.load.Bool(options + 15)) {
  2285          options_ffi["displayActionCountAsBadgeText"] = A.load.Bool(options + 0);
  2286        }
  2287        if (A.load.Bool(options + 4 + 10)) {
  2288          options_ffi["tabUpdate"] = {};
  2289          if (A.load.Bool(options + 4 + 8)) {
  2290            options_ffi["tabUpdate"]["tabId"] = A.load.Int32(options + 4 + 0);
  2291          }
  2292          if (A.load.Bool(options + 4 + 9)) {
  2293            options_ffi["tabUpdate"]["increment"] = A.load.Int32(options + 4 + 4);
  2294          }
  2295        }
  2296  
  2297        const _ret = WEBEXT.declarativeNetRequest.setExtensionActionOptions(options_ffi);
  2298        A.store.Ref(retPtr, _ret);
  2299      },
  2300      "try_SetExtensionActionOptions": (retPtr: Pointer, errPtr: Pointer, options: Pointer): heap.Ref<boolean> => {
  2301        try {
  2302          const options_ffi = {};
  2303  
  2304          if (A.load.Bool(options + 15)) {
  2305            options_ffi["displayActionCountAsBadgeText"] = A.load.Bool(options + 0);
  2306          }
  2307          if (A.load.Bool(options + 4 + 10)) {
  2308            options_ffi["tabUpdate"] = {};
  2309            if (A.load.Bool(options + 4 + 8)) {
  2310              options_ffi["tabUpdate"]["tabId"] = A.load.Int32(options + 4 + 0);
  2311            }
  2312            if (A.load.Bool(options + 4 + 9)) {
  2313              options_ffi["tabUpdate"]["increment"] = A.load.Int32(options + 4 + 4);
  2314            }
  2315          }
  2316  
  2317          const _ret = WEBEXT.declarativeNetRequest.setExtensionActionOptions(options_ffi);
  2318          A.store.Ref(retPtr, _ret);
  2319          return A.H.TRUE;
  2320        } catch (err: any) {
  2321          A.store.Ref(errPtr, err);
  2322          return A.H.FALSE;
  2323        }
  2324      },
  2325      "has_TestMatchOutcome": (): heap.Ref<boolean> => {
  2326        if (WEBEXT?.declarativeNetRequest && "testMatchOutcome" in WEBEXT?.declarativeNetRequest) {
  2327          return A.H.TRUE;
  2328        }
  2329        return A.H.FALSE;
  2330      },
  2331      "func_TestMatchOutcome": (fn: Pointer): void => {
  2332        A.store.Ref(fn, WEBEXT.declarativeNetRequest.testMatchOutcome);
  2333      },
  2334      "call_TestMatchOutcome": (retPtr: Pointer, request: Pointer): void => {
  2335        const request_ffi = {};
  2336  
  2337        request_ffi["url"] = A.load.Ref(request + 0, undefined);
  2338        request_ffi["initiator"] = A.load.Ref(request + 4, undefined);
  2339        request_ffi["method"] = A.load.Enum(request + 8, [
  2340          "connect",
  2341          "delete",
  2342          "get",
  2343          "head",
  2344          "options",
  2345          "patch",
  2346          "post",
  2347          "put",
  2348          "other",
  2349        ]);
  2350        request_ffi["type"] = A.load.Enum(request + 12, [
  2351          "main_frame",
  2352          "sub_frame",
  2353          "stylesheet",
  2354          "script",
  2355          "image",
  2356          "font",
  2357          "object",
  2358          "xmlhttprequest",
  2359          "ping",
  2360          "csp_report",
  2361          "media",
  2362          "websocket",
  2363          "webtransport",
  2364          "webbundle",
  2365          "other",
  2366        ]);
  2367        if (A.load.Bool(request + 20)) {
  2368          request_ffi["tabId"] = A.load.Int32(request + 16);
  2369        }
  2370  
  2371        const _ret = WEBEXT.declarativeNetRequest.testMatchOutcome(request_ffi);
  2372        A.store.Ref(retPtr, _ret);
  2373      },
  2374      "try_TestMatchOutcome": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => {
  2375        try {
  2376          const request_ffi = {};
  2377  
  2378          request_ffi["url"] = A.load.Ref(request + 0, undefined);
  2379          request_ffi["initiator"] = A.load.Ref(request + 4, undefined);
  2380          request_ffi["method"] = A.load.Enum(request + 8, [
  2381            "connect",
  2382            "delete",
  2383            "get",
  2384            "head",
  2385            "options",
  2386            "patch",
  2387            "post",
  2388            "put",
  2389            "other",
  2390          ]);
  2391          request_ffi["type"] = A.load.Enum(request + 12, [
  2392            "main_frame",
  2393            "sub_frame",
  2394            "stylesheet",
  2395            "script",
  2396            "image",
  2397            "font",
  2398            "object",
  2399            "xmlhttprequest",
  2400            "ping",
  2401            "csp_report",
  2402            "media",
  2403            "websocket",
  2404            "webtransport",
  2405            "webbundle",
  2406            "other",
  2407          ]);
  2408          if (A.load.Bool(request + 20)) {
  2409            request_ffi["tabId"] = A.load.Int32(request + 16);
  2410          }
  2411  
  2412          const _ret = WEBEXT.declarativeNetRequest.testMatchOutcome(request_ffi);
  2413          A.store.Ref(retPtr, _ret);
  2414          return A.H.TRUE;
  2415        } catch (err: any) {
  2416          A.store.Ref(errPtr, err);
  2417          return A.H.FALSE;
  2418        }
  2419      },
  2420      "has_UpdateDynamicRules": (): heap.Ref<boolean> => {
  2421        if (WEBEXT?.declarativeNetRequest && "updateDynamicRules" in WEBEXT?.declarativeNetRequest) {
  2422          return A.H.TRUE;
  2423        }
  2424        return A.H.FALSE;
  2425      },
  2426      "func_UpdateDynamicRules": (fn: Pointer): void => {
  2427        A.store.Ref(fn, WEBEXT.declarativeNetRequest.updateDynamicRules);
  2428      },
  2429      "call_UpdateDynamicRules": (retPtr: Pointer, options: Pointer): void => {
  2430        const options_ffi = {};
  2431  
  2432        options_ffi["removeRuleIds"] = A.load.Ref(options + 0, undefined);
  2433        options_ffi["addRules"] = A.load.Ref(options + 4, undefined);
  2434  
  2435        const _ret = WEBEXT.declarativeNetRequest.updateDynamicRules(options_ffi);
  2436        A.store.Ref(retPtr, _ret);
  2437      },
  2438      "try_UpdateDynamicRules": (retPtr: Pointer, errPtr: Pointer, options: Pointer): heap.Ref<boolean> => {
  2439        try {
  2440          const options_ffi = {};
  2441  
  2442          options_ffi["removeRuleIds"] = A.load.Ref(options + 0, undefined);
  2443          options_ffi["addRules"] = A.load.Ref(options + 4, undefined);
  2444  
  2445          const _ret = WEBEXT.declarativeNetRequest.updateDynamicRules(options_ffi);
  2446          A.store.Ref(retPtr, _ret);
  2447          return A.H.TRUE;
  2448        } catch (err: any) {
  2449          A.store.Ref(errPtr, err);
  2450          return A.H.FALSE;
  2451        }
  2452      },
  2453      "has_UpdateEnabledRulesets": (): heap.Ref<boolean> => {
  2454        if (WEBEXT?.declarativeNetRequest && "updateEnabledRulesets" in WEBEXT?.declarativeNetRequest) {
  2455          return A.H.TRUE;
  2456        }
  2457        return A.H.FALSE;
  2458      },
  2459      "func_UpdateEnabledRulesets": (fn: Pointer): void => {
  2460        A.store.Ref(fn, WEBEXT.declarativeNetRequest.updateEnabledRulesets);
  2461      },
  2462      "call_UpdateEnabledRulesets": (retPtr: Pointer, options: Pointer): void => {
  2463        const options_ffi = {};
  2464  
  2465        options_ffi["disableRulesetIds"] = A.load.Ref(options + 0, undefined);
  2466        options_ffi["enableRulesetIds"] = A.load.Ref(options + 4, undefined);
  2467  
  2468        const _ret = WEBEXT.declarativeNetRequest.updateEnabledRulesets(options_ffi);
  2469        A.store.Ref(retPtr, _ret);
  2470      },
  2471      "try_UpdateEnabledRulesets": (retPtr: Pointer, errPtr: Pointer, options: Pointer): heap.Ref<boolean> => {
  2472        try {
  2473          const options_ffi = {};
  2474  
  2475          options_ffi["disableRulesetIds"] = A.load.Ref(options + 0, undefined);
  2476          options_ffi["enableRulesetIds"] = A.load.Ref(options + 4, undefined);
  2477  
  2478          const _ret = WEBEXT.declarativeNetRequest.updateEnabledRulesets(options_ffi);
  2479          A.store.Ref(retPtr, _ret);
  2480          return A.H.TRUE;
  2481        } catch (err: any) {
  2482          A.store.Ref(errPtr, err);
  2483          return A.H.FALSE;
  2484        }
  2485      },
  2486      "has_UpdateSessionRules": (): heap.Ref<boolean> => {
  2487        if (WEBEXT?.declarativeNetRequest && "updateSessionRules" in WEBEXT?.declarativeNetRequest) {
  2488          return A.H.TRUE;
  2489        }
  2490        return A.H.FALSE;
  2491      },
  2492      "func_UpdateSessionRules": (fn: Pointer): void => {
  2493        A.store.Ref(fn, WEBEXT.declarativeNetRequest.updateSessionRules);
  2494      },
  2495      "call_UpdateSessionRules": (retPtr: Pointer, options: Pointer): void => {
  2496        const options_ffi = {};
  2497  
  2498        options_ffi["removeRuleIds"] = A.load.Ref(options + 0, undefined);
  2499        options_ffi["addRules"] = A.load.Ref(options + 4, undefined);
  2500  
  2501        const _ret = WEBEXT.declarativeNetRequest.updateSessionRules(options_ffi);
  2502        A.store.Ref(retPtr, _ret);
  2503      },
  2504      "try_UpdateSessionRules": (retPtr: Pointer, errPtr: Pointer, options: Pointer): heap.Ref<boolean> => {
  2505        try {
  2506          const options_ffi = {};
  2507  
  2508          options_ffi["removeRuleIds"] = A.load.Ref(options + 0, undefined);
  2509          options_ffi["addRules"] = A.load.Ref(options + 4, undefined);
  2510  
  2511          const _ret = WEBEXT.declarativeNetRequest.updateSessionRules(options_ffi);
  2512          A.store.Ref(retPtr, _ret);
  2513          return A.H.TRUE;
  2514        } catch (err: any) {
  2515          A.store.Ref(errPtr, err);
  2516          return A.H.FALSE;
  2517        }
  2518      },
  2519      "has_UpdateStaticRules": (): heap.Ref<boolean> => {
  2520        if (WEBEXT?.declarativeNetRequest && "updateStaticRules" in WEBEXT?.declarativeNetRequest) {
  2521          return A.H.TRUE;
  2522        }
  2523        return A.H.FALSE;
  2524      },
  2525      "func_UpdateStaticRules": (fn: Pointer): void => {
  2526        A.store.Ref(fn, WEBEXT.declarativeNetRequest.updateStaticRules);
  2527      },
  2528      "call_UpdateStaticRules": (retPtr: Pointer, options: Pointer): void => {
  2529        const options_ffi = {};
  2530  
  2531        options_ffi["rulesetId"] = A.load.Ref(options + 0, undefined);
  2532        options_ffi["disableRuleIds"] = A.load.Ref(options + 4, undefined);
  2533        options_ffi["enableRuleIds"] = A.load.Ref(options + 8, undefined);
  2534  
  2535        const _ret = WEBEXT.declarativeNetRequest.updateStaticRules(options_ffi);
  2536        A.store.Ref(retPtr, _ret);
  2537      },
  2538      "try_UpdateStaticRules": (retPtr: Pointer, errPtr: Pointer, options: Pointer): heap.Ref<boolean> => {
  2539        try {
  2540          const options_ffi = {};
  2541  
  2542          options_ffi["rulesetId"] = A.load.Ref(options + 0, undefined);
  2543          options_ffi["disableRuleIds"] = A.load.Ref(options + 4, undefined);
  2544          options_ffi["enableRuleIds"] = A.load.Ref(options + 8, undefined);
  2545  
  2546          const _ret = WEBEXT.declarativeNetRequest.updateStaticRules(options_ffi);
  2547          A.store.Ref(retPtr, _ret);
  2548          return A.H.TRUE;
  2549        } catch (err: any) {
  2550          A.store.Ref(errPtr, err);
  2551          return A.H.FALSE;
  2552        }
  2553      },
  2554    };
  2555  });