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

     1  import { importModule, Application, heap, Pointer } from "@ffi";
     2  
     3  importModule("plat/js/webext/history", (A: Application) => {
     4    const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser;
     5  
     6    return {
     7      "store_DeleteRangeArgRange": (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 + 16, false);
    12          A.store.Float64(ptr + 0, 0);
    13          A.store.Float64(ptr + 8, 0);
    14        } else {
    15          A.store.Bool(ptr + 16, true);
    16          A.store.Float64(ptr + 0, x["endTime"] === undefined ? 0 : (x["endTime"] as number));
    17          A.store.Float64(ptr + 8, x["startTime"] === undefined ? 0 : (x["startTime"] as number));
    18        }
    19      },
    20      "load_DeleteRangeArgRange": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    21        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    22  
    23        x["endTime"] = A.load.Float64(ptr + 0);
    24        x["startTime"] = A.load.Float64(ptr + 8);
    25        return create === A.H.TRUE ? A.H.push(x) : ref;
    26      },
    27  
    28      "store_HistoryItem": (ptr: Pointer, ref: heap.Ref<any>) => {
    29        const x = A.H.get<any>(ref);
    30  
    31        if (typeof x === "undefined") {
    32          A.store.Bool(ptr + 51, false);
    33          A.store.Ref(ptr + 0, undefined);
    34          A.store.Bool(ptr + 48, false);
    35          A.store.Float64(ptr + 8, 0);
    36          A.store.Ref(ptr + 16, undefined);
    37          A.store.Bool(ptr + 49, false);
    38          A.store.Int64(ptr + 24, 0);
    39          A.store.Ref(ptr + 32, undefined);
    40          A.store.Bool(ptr + 50, false);
    41          A.store.Int64(ptr + 40, 0);
    42        } else {
    43          A.store.Bool(ptr + 51, true);
    44          A.store.Ref(ptr + 0, x["id"]);
    45          A.store.Bool(ptr + 48, "lastVisitTime" in x ? true : false);
    46          A.store.Float64(ptr + 8, x["lastVisitTime"] === undefined ? 0 : (x["lastVisitTime"] as number));
    47          A.store.Ref(ptr + 16, x["title"]);
    48          A.store.Bool(ptr + 49, "typedCount" in x ? true : false);
    49          A.store.Int64(ptr + 24, x["typedCount"] === undefined ? 0 : (x["typedCount"] as number));
    50          A.store.Ref(ptr + 32, x["url"]);
    51          A.store.Bool(ptr + 50, "visitCount" in x ? true : false);
    52          A.store.Int64(ptr + 40, x["visitCount"] === undefined ? 0 : (x["visitCount"] as number));
    53        }
    54      },
    55      "load_HistoryItem": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    56        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    57  
    58        x["id"] = A.load.Ref(ptr + 0, undefined);
    59        if (A.load.Bool(ptr + 48)) {
    60          x["lastVisitTime"] = A.load.Float64(ptr + 8);
    61        } else {
    62          delete x["lastVisitTime"];
    63        }
    64        x["title"] = A.load.Ref(ptr + 16, undefined);
    65        if (A.load.Bool(ptr + 49)) {
    66          x["typedCount"] = A.load.Int64(ptr + 24);
    67        } else {
    68          delete x["typedCount"];
    69        }
    70        x["url"] = A.load.Ref(ptr + 32, undefined);
    71        if (A.load.Bool(ptr + 50)) {
    72          x["visitCount"] = A.load.Int64(ptr + 40);
    73        } else {
    74          delete x["visitCount"];
    75        }
    76        return create === A.H.TRUE ? A.H.push(x) : ref;
    77      },
    78  
    79      "store_OnVisitRemovedArgRemoved": (ptr: Pointer, ref: heap.Ref<any>) => {
    80        const x = A.H.get<any>(ref);
    81  
    82        if (typeof x === "undefined") {
    83          A.store.Bool(ptr + 8, false);
    84          A.store.Bool(ptr + 0, false);
    85          A.store.Ref(ptr + 4, undefined);
    86        } else {
    87          A.store.Bool(ptr + 8, true);
    88          A.store.Bool(ptr + 0, x["allHistory"] ? true : false);
    89          A.store.Ref(ptr + 4, x["urls"]);
    90        }
    91      },
    92      "load_OnVisitRemovedArgRemoved": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    93        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    94  
    95        x["allHistory"] = A.load.Bool(ptr + 0);
    96        x["urls"] = A.load.Ref(ptr + 4, undefined);
    97        return create === A.H.TRUE ? A.H.push(x) : ref;
    98      },
    99  
   100      "store_SearchArgQuery": (ptr: Pointer, ref: heap.Ref<any>) => {
   101        const x = A.H.get<any>(ref);
   102  
   103        if (typeof x === "undefined") {
   104          A.store.Bool(ptr + 31, false);
   105          A.store.Bool(ptr + 28, false);
   106          A.store.Float64(ptr + 0, 0);
   107          A.store.Bool(ptr + 29, false);
   108          A.store.Int64(ptr + 8, 0);
   109          A.store.Bool(ptr + 30, false);
   110          A.store.Float64(ptr + 16, 0);
   111          A.store.Ref(ptr + 24, undefined);
   112        } else {
   113          A.store.Bool(ptr + 31, true);
   114          A.store.Bool(ptr + 28, "endTime" in x ? true : false);
   115          A.store.Float64(ptr + 0, x["endTime"] === undefined ? 0 : (x["endTime"] as number));
   116          A.store.Bool(ptr + 29, "maxResults" in x ? true : false);
   117          A.store.Int64(ptr + 8, x["maxResults"] === undefined ? 0 : (x["maxResults"] as number));
   118          A.store.Bool(ptr + 30, "startTime" in x ? true : false);
   119          A.store.Float64(ptr + 16, x["startTime"] === undefined ? 0 : (x["startTime"] as number));
   120          A.store.Ref(ptr + 24, x["text"]);
   121        }
   122      },
   123      "load_SearchArgQuery": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   124        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   125  
   126        if (A.load.Bool(ptr + 28)) {
   127          x["endTime"] = A.load.Float64(ptr + 0);
   128        } else {
   129          delete x["endTime"];
   130        }
   131        if (A.load.Bool(ptr + 29)) {
   132          x["maxResults"] = A.load.Int64(ptr + 8);
   133        } else {
   134          delete x["maxResults"];
   135        }
   136        if (A.load.Bool(ptr + 30)) {
   137          x["startTime"] = A.load.Float64(ptr + 16);
   138        } else {
   139          delete x["startTime"];
   140        }
   141        x["text"] = A.load.Ref(ptr + 24, undefined);
   142        return create === A.H.TRUE ? A.H.push(x) : ref;
   143      },
   144      "constof_TransitionType": (ref: heap.Ref<string>): number => {
   145        const idx = [
   146          "link",
   147          "typed",
   148          "auto_bookmark",
   149          "auto_subframe",
   150          "manual_subframe",
   151          "generated",
   152          "auto_toplevel",
   153          "form_submit",
   154          "reload",
   155          "keyword",
   156          "keyword_generated",
   157        ].indexOf(A.H.get(ref));
   158        return idx < 0 ? 0 : idx + 1;
   159      },
   160  
   161      "store_UrlDetails": (ptr: Pointer, ref: heap.Ref<any>) => {
   162        const x = A.H.get<any>(ref);
   163  
   164        if (typeof x === "undefined") {
   165          A.store.Bool(ptr + 4, false);
   166          A.store.Ref(ptr + 0, undefined);
   167        } else {
   168          A.store.Bool(ptr + 4, true);
   169          A.store.Ref(ptr + 0, x["url"]);
   170        }
   171      },
   172      "load_UrlDetails": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   173        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   174  
   175        x["url"] = A.load.Ref(ptr + 0, undefined);
   176        return create === A.H.TRUE ? A.H.push(x) : ref;
   177      },
   178  
   179      "store_VisitItem": (ptr: Pointer, ref: heap.Ref<any>) => {
   180        const x = A.H.get<any>(ref);
   181  
   182        if (typeof x === "undefined") {
   183          A.store.Bool(ptr + 33, false);
   184          A.store.Ref(ptr + 0, undefined);
   185          A.store.Bool(ptr + 4, false);
   186          A.store.Ref(ptr + 8, undefined);
   187          A.store.Enum(ptr + 12, -1);
   188          A.store.Ref(ptr + 16, undefined);
   189          A.store.Bool(ptr + 32, false);
   190          A.store.Float64(ptr + 24, 0);
   191        } else {
   192          A.store.Bool(ptr + 33, true);
   193          A.store.Ref(ptr + 0, x["id"]);
   194          A.store.Bool(ptr + 4, x["isLocal"] ? true : false);
   195          A.store.Ref(ptr + 8, x["referringVisitId"]);
   196          A.store.Enum(
   197            ptr + 12,
   198            [
   199              "link",
   200              "typed",
   201              "auto_bookmark",
   202              "auto_subframe",
   203              "manual_subframe",
   204              "generated",
   205              "auto_toplevel",
   206              "form_submit",
   207              "reload",
   208              "keyword",
   209              "keyword_generated",
   210            ].indexOf(x["transition"] as string)
   211          );
   212          A.store.Ref(ptr + 16, x["visitId"]);
   213          A.store.Bool(ptr + 32, "visitTime" in x ? true : false);
   214          A.store.Float64(ptr + 24, x["visitTime"] === undefined ? 0 : (x["visitTime"] as number));
   215        }
   216      },
   217      "load_VisitItem": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   218        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   219  
   220        x["id"] = A.load.Ref(ptr + 0, undefined);
   221        x["isLocal"] = A.load.Bool(ptr + 4);
   222        x["referringVisitId"] = A.load.Ref(ptr + 8, undefined);
   223        x["transition"] = A.load.Enum(ptr + 12, [
   224          "link",
   225          "typed",
   226          "auto_bookmark",
   227          "auto_subframe",
   228          "manual_subframe",
   229          "generated",
   230          "auto_toplevel",
   231          "form_submit",
   232          "reload",
   233          "keyword",
   234          "keyword_generated",
   235        ]);
   236        x["visitId"] = A.load.Ref(ptr + 16, undefined);
   237        if (A.load.Bool(ptr + 32)) {
   238          x["visitTime"] = A.load.Float64(ptr + 24);
   239        } else {
   240          delete x["visitTime"];
   241        }
   242        return create === A.H.TRUE ? A.H.push(x) : ref;
   243      },
   244      "has_AddUrl": (): heap.Ref<boolean> => {
   245        if (WEBEXT?.history && "addUrl" in WEBEXT?.history) {
   246          return A.H.TRUE;
   247        }
   248        return A.H.FALSE;
   249      },
   250      "func_AddUrl": (fn: Pointer): void => {
   251        A.store.Ref(fn, WEBEXT.history.addUrl);
   252      },
   253      "call_AddUrl": (retPtr: Pointer, details: Pointer): void => {
   254        const details_ffi = {};
   255  
   256        details_ffi["url"] = A.load.Ref(details + 0, undefined);
   257  
   258        const _ret = WEBEXT.history.addUrl(details_ffi);
   259        A.store.Ref(retPtr, _ret);
   260      },
   261      "try_AddUrl": (retPtr: Pointer, errPtr: Pointer, details: Pointer): heap.Ref<boolean> => {
   262        try {
   263          const details_ffi = {};
   264  
   265          details_ffi["url"] = A.load.Ref(details + 0, undefined);
   266  
   267          const _ret = WEBEXT.history.addUrl(details_ffi);
   268          A.store.Ref(retPtr, _ret);
   269          return A.H.TRUE;
   270        } catch (err: any) {
   271          A.store.Ref(errPtr, err);
   272          return A.H.FALSE;
   273        }
   274      },
   275      "has_DeleteAll": (): heap.Ref<boolean> => {
   276        if (WEBEXT?.history && "deleteAll" in WEBEXT?.history) {
   277          return A.H.TRUE;
   278        }
   279        return A.H.FALSE;
   280      },
   281      "func_DeleteAll": (fn: Pointer): void => {
   282        A.store.Ref(fn, WEBEXT.history.deleteAll);
   283      },
   284      "call_DeleteAll": (retPtr: Pointer): void => {
   285        const _ret = WEBEXT.history.deleteAll();
   286        A.store.Ref(retPtr, _ret);
   287      },
   288      "try_DeleteAll": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   289        try {
   290          const _ret = WEBEXT.history.deleteAll();
   291          A.store.Ref(retPtr, _ret);
   292          return A.H.TRUE;
   293        } catch (err: any) {
   294          A.store.Ref(errPtr, err);
   295          return A.H.FALSE;
   296        }
   297      },
   298      "has_DeleteRange": (): heap.Ref<boolean> => {
   299        if (WEBEXT?.history && "deleteRange" in WEBEXT?.history) {
   300          return A.H.TRUE;
   301        }
   302        return A.H.FALSE;
   303      },
   304      "func_DeleteRange": (fn: Pointer): void => {
   305        A.store.Ref(fn, WEBEXT.history.deleteRange);
   306      },
   307      "call_DeleteRange": (retPtr: Pointer, range: Pointer): void => {
   308        const range_ffi = {};
   309  
   310        range_ffi["endTime"] = A.load.Float64(range + 0);
   311        range_ffi["startTime"] = A.load.Float64(range + 8);
   312  
   313        const _ret = WEBEXT.history.deleteRange(range_ffi);
   314        A.store.Ref(retPtr, _ret);
   315      },
   316      "try_DeleteRange": (retPtr: Pointer, errPtr: Pointer, range: Pointer): heap.Ref<boolean> => {
   317        try {
   318          const range_ffi = {};
   319  
   320          range_ffi["endTime"] = A.load.Float64(range + 0);
   321          range_ffi["startTime"] = A.load.Float64(range + 8);
   322  
   323          const _ret = WEBEXT.history.deleteRange(range_ffi);
   324          A.store.Ref(retPtr, _ret);
   325          return A.H.TRUE;
   326        } catch (err: any) {
   327          A.store.Ref(errPtr, err);
   328          return A.H.FALSE;
   329        }
   330      },
   331      "has_DeleteUrl": (): heap.Ref<boolean> => {
   332        if (WEBEXT?.history && "deleteUrl" in WEBEXT?.history) {
   333          return A.H.TRUE;
   334        }
   335        return A.H.FALSE;
   336      },
   337      "func_DeleteUrl": (fn: Pointer): void => {
   338        A.store.Ref(fn, WEBEXT.history.deleteUrl);
   339      },
   340      "call_DeleteUrl": (retPtr: Pointer, details: Pointer): void => {
   341        const details_ffi = {};
   342  
   343        details_ffi["url"] = A.load.Ref(details + 0, undefined);
   344  
   345        const _ret = WEBEXT.history.deleteUrl(details_ffi);
   346        A.store.Ref(retPtr, _ret);
   347      },
   348      "try_DeleteUrl": (retPtr: Pointer, errPtr: Pointer, details: Pointer): heap.Ref<boolean> => {
   349        try {
   350          const details_ffi = {};
   351  
   352          details_ffi["url"] = A.load.Ref(details + 0, undefined);
   353  
   354          const _ret = WEBEXT.history.deleteUrl(details_ffi);
   355          A.store.Ref(retPtr, _ret);
   356          return A.H.TRUE;
   357        } catch (err: any) {
   358          A.store.Ref(errPtr, err);
   359          return A.H.FALSE;
   360        }
   361      },
   362      "has_GetVisits": (): heap.Ref<boolean> => {
   363        if (WEBEXT?.history && "getVisits" in WEBEXT?.history) {
   364          return A.H.TRUE;
   365        }
   366        return A.H.FALSE;
   367      },
   368      "func_GetVisits": (fn: Pointer): void => {
   369        A.store.Ref(fn, WEBEXT.history.getVisits);
   370      },
   371      "call_GetVisits": (retPtr: Pointer, details: Pointer): void => {
   372        const details_ffi = {};
   373  
   374        details_ffi["url"] = A.load.Ref(details + 0, undefined);
   375  
   376        const _ret = WEBEXT.history.getVisits(details_ffi);
   377        A.store.Ref(retPtr, _ret);
   378      },
   379      "try_GetVisits": (retPtr: Pointer, errPtr: Pointer, details: Pointer): heap.Ref<boolean> => {
   380        try {
   381          const details_ffi = {};
   382  
   383          details_ffi["url"] = A.load.Ref(details + 0, undefined);
   384  
   385          const _ret = WEBEXT.history.getVisits(details_ffi);
   386          A.store.Ref(retPtr, _ret);
   387          return A.H.TRUE;
   388        } catch (err: any) {
   389          A.store.Ref(errPtr, err);
   390          return A.H.FALSE;
   391        }
   392      },
   393      "has_OnVisitRemoved": (): heap.Ref<boolean> => {
   394        if (WEBEXT?.history?.onVisitRemoved && "addListener" in WEBEXT?.history?.onVisitRemoved) {
   395          return A.H.TRUE;
   396        }
   397        return A.H.FALSE;
   398      },
   399      "func_OnVisitRemoved": (fn: Pointer): void => {
   400        A.store.Ref(fn, WEBEXT.history.onVisitRemoved.addListener);
   401      },
   402      "call_OnVisitRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   403        const _ret = WEBEXT.history.onVisitRemoved.addListener(A.H.get<object>(callback));
   404      },
   405      "try_OnVisitRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   406        try {
   407          const _ret = WEBEXT.history.onVisitRemoved.addListener(A.H.get<object>(callback));
   408          return A.H.TRUE;
   409        } catch (err: any) {
   410          A.store.Ref(errPtr, err);
   411          return A.H.FALSE;
   412        }
   413      },
   414      "has_OffVisitRemoved": (): heap.Ref<boolean> => {
   415        if (WEBEXT?.history?.onVisitRemoved && "removeListener" in WEBEXT?.history?.onVisitRemoved) {
   416          return A.H.TRUE;
   417        }
   418        return A.H.FALSE;
   419      },
   420      "func_OffVisitRemoved": (fn: Pointer): void => {
   421        A.store.Ref(fn, WEBEXT.history.onVisitRemoved.removeListener);
   422      },
   423      "call_OffVisitRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   424        const _ret = WEBEXT.history.onVisitRemoved.removeListener(A.H.get<object>(callback));
   425      },
   426      "try_OffVisitRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   427        try {
   428          const _ret = WEBEXT.history.onVisitRemoved.removeListener(A.H.get<object>(callback));
   429          return A.H.TRUE;
   430        } catch (err: any) {
   431          A.store.Ref(errPtr, err);
   432          return A.H.FALSE;
   433        }
   434      },
   435      "has_HasOnVisitRemoved": (): heap.Ref<boolean> => {
   436        if (WEBEXT?.history?.onVisitRemoved && "hasListener" in WEBEXT?.history?.onVisitRemoved) {
   437          return A.H.TRUE;
   438        }
   439        return A.H.FALSE;
   440      },
   441      "func_HasOnVisitRemoved": (fn: Pointer): void => {
   442        A.store.Ref(fn, WEBEXT.history.onVisitRemoved.hasListener);
   443      },
   444      "call_HasOnVisitRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   445        const _ret = WEBEXT.history.onVisitRemoved.hasListener(A.H.get<object>(callback));
   446        A.store.Bool(retPtr, _ret);
   447      },
   448      "try_HasOnVisitRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   449        try {
   450          const _ret = WEBEXT.history.onVisitRemoved.hasListener(A.H.get<object>(callback));
   451          A.store.Bool(retPtr, _ret);
   452          return A.H.TRUE;
   453        } catch (err: any) {
   454          A.store.Ref(errPtr, err);
   455          return A.H.FALSE;
   456        }
   457      },
   458      "has_OnVisited": (): heap.Ref<boolean> => {
   459        if (WEBEXT?.history?.onVisited && "addListener" in WEBEXT?.history?.onVisited) {
   460          return A.H.TRUE;
   461        }
   462        return A.H.FALSE;
   463      },
   464      "func_OnVisited": (fn: Pointer): void => {
   465        A.store.Ref(fn, WEBEXT.history.onVisited.addListener);
   466      },
   467      "call_OnVisited": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   468        const _ret = WEBEXT.history.onVisited.addListener(A.H.get<object>(callback));
   469      },
   470      "try_OnVisited": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   471        try {
   472          const _ret = WEBEXT.history.onVisited.addListener(A.H.get<object>(callback));
   473          return A.H.TRUE;
   474        } catch (err: any) {
   475          A.store.Ref(errPtr, err);
   476          return A.H.FALSE;
   477        }
   478      },
   479      "has_OffVisited": (): heap.Ref<boolean> => {
   480        if (WEBEXT?.history?.onVisited && "removeListener" in WEBEXT?.history?.onVisited) {
   481          return A.H.TRUE;
   482        }
   483        return A.H.FALSE;
   484      },
   485      "func_OffVisited": (fn: Pointer): void => {
   486        A.store.Ref(fn, WEBEXT.history.onVisited.removeListener);
   487      },
   488      "call_OffVisited": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   489        const _ret = WEBEXT.history.onVisited.removeListener(A.H.get<object>(callback));
   490      },
   491      "try_OffVisited": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   492        try {
   493          const _ret = WEBEXT.history.onVisited.removeListener(A.H.get<object>(callback));
   494          return A.H.TRUE;
   495        } catch (err: any) {
   496          A.store.Ref(errPtr, err);
   497          return A.H.FALSE;
   498        }
   499      },
   500      "has_HasOnVisited": (): heap.Ref<boolean> => {
   501        if (WEBEXT?.history?.onVisited && "hasListener" in WEBEXT?.history?.onVisited) {
   502          return A.H.TRUE;
   503        }
   504        return A.H.FALSE;
   505      },
   506      "func_HasOnVisited": (fn: Pointer): void => {
   507        A.store.Ref(fn, WEBEXT.history.onVisited.hasListener);
   508      },
   509      "call_HasOnVisited": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   510        const _ret = WEBEXT.history.onVisited.hasListener(A.H.get<object>(callback));
   511        A.store.Bool(retPtr, _ret);
   512      },
   513      "try_HasOnVisited": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   514        try {
   515          const _ret = WEBEXT.history.onVisited.hasListener(A.H.get<object>(callback));
   516          A.store.Bool(retPtr, _ret);
   517          return A.H.TRUE;
   518        } catch (err: any) {
   519          A.store.Ref(errPtr, err);
   520          return A.H.FALSE;
   521        }
   522      },
   523      "has_Search": (): heap.Ref<boolean> => {
   524        if (WEBEXT?.history && "search" in WEBEXT?.history) {
   525          return A.H.TRUE;
   526        }
   527        return A.H.FALSE;
   528      },
   529      "func_Search": (fn: Pointer): void => {
   530        A.store.Ref(fn, WEBEXT.history.search);
   531      },
   532      "call_Search": (retPtr: Pointer, query: Pointer): void => {
   533        const query_ffi = {};
   534  
   535        if (A.load.Bool(query + 28)) {
   536          query_ffi["endTime"] = A.load.Float64(query + 0);
   537        }
   538        if (A.load.Bool(query + 29)) {
   539          query_ffi["maxResults"] = A.load.Int64(query + 8);
   540        }
   541        if (A.load.Bool(query + 30)) {
   542          query_ffi["startTime"] = A.load.Float64(query + 16);
   543        }
   544        query_ffi["text"] = A.load.Ref(query + 24, undefined);
   545  
   546        const _ret = WEBEXT.history.search(query_ffi);
   547        A.store.Ref(retPtr, _ret);
   548      },
   549      "try_Search": (retPtr: Pointer, errPtr: Pointer, query: Pointer): heap.Ref<boolean> => {
   550        try {
   551          const query_ffi = {};
   552  
   553          if (A.load.Bool(query + 28)) {
   554            query_ffi["endTime"] = A.load.Float64(query + 0);
   555          }
   556          if (A.load.Bool(query + 29)) {
   557            query_ffi["maxResults"] = A.load.Int64(query + 8);
   558          }
   559          if (A.load.Bool(query + 30)) {
   560            query_ffi["startTime"] = A.load.Float64(query + 16);
   561          }
   562          query_ffi["text"] = A.load.Ref(query + 24, undefined);
   563  
   564          const _ret = WEBEXT.history.search(query_ffi);
   565          A.store.Ref(retPtr, _ret);
   566          return A.H.TRUE;
   567        } catch (err: any) {
   568          A.store.Ref(errPtr, err);
   569          return A.H.FALSE;
   570        }
   571      },
   572    };
   573  });