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

     1  import { importModule, Application, heap, Pointer } from "@ffi";
     2  
     3  importModule("plat/js/webext/tabgroups", (A: Application) => {
     4    const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser;
     5  
     6    return {
     7      "constof_Color": (ref: heap.Ref<string>): number => {
     8        const idx = ["grey", "blue", "red", "yellow", "green", "pink", "purple", "cyan", "orange"].indexOf(A.H.get(ref));
     9        return idx < 0 ? 0 : idx + 1;
    10      },
    11  
    12      "store_MoveArgMoveProperties": (ptr: Pointer, ref: heap.Ref<any>) => {
    13        const x = A.H.get<any>(ref);
    14  
    15        if (typeof x === "undefined") {
    16          A.store.Bool(ptr + 17, false);
    17          A.store.Int64(ptr + 0, 0);
    18          A.store.Bool(ptr + 16, false);
    19          A.store.Int64(ptr + 8, 0);
    20        } else {
    21          A.store.Bool(ptr + 17, true);
    22          A.store.Int64(ptr + 0, x["index"] === undefined ? 0 : (x["index"] as number));
    23          A.store.Bool(ptr + 16, "windowId" in x ? true : false);
    24          A.store.Int64(ptr + 8, x["windowId"] === undefined ? 0 : (x["windowId"] as number));
    25        }
    26      },
    27      "load_MoveArgMoveProperties": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    28        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    29  
    30        x["index"] = A.load.Int64(ptr + 0);
    31        if (A.load.Bool(ptr + 16)) {
    32          x["windowId"] = A.load.Int64(ptr + 8);
    33        } else {
    34          delete x["windowId"];
    35        }
    36        return create === A.H.TRUE ? A.H.push(x) : ref;
    37      },
    38  
    39      "store_QueryArgQueryInfo": (ptr: Pointer, ref: heap.Ref<any>) => {
    40        const x = A.H.get<any>(ref);
    41  
    42        if (typeof x === "undefined") {
    43          A.store.Bool(ptr + 26, false);
    44          A.store.Bool(ptr + 24, false);
    45          A.store.Bool(ptr + 0, false);
    46          A.store.Enum(ptr + 4, -1);
    47          A.store.Ref(ptr + 8, undefined);
    48          A.store.Bool(ptr + 25, false);
    49          A.store.Int64(ptr + 16, 0);
    50        } else {
    51          A.store.Bool(ptr + 26, true);
    52          A.store.Bool(ptr + 24, "collapsed" in x ? true : false);
    53          A.store.Bool(ptr + 0, x["collapsed"] ? true : false);
    54          A.store.Enum(
    55            ptr + 4,
    56            ["grey", "blue", "red", "yellow", "green", "pink", "purple", "cyan", "orange"].indexOf(x["color"] as string)
    57          );
    58          A.store.Ref(ptr + 8, x["title"]);
    59          A.store.Bool(ptr + 25, "windowId" in x ? true : false);
    60          A.store.Int64(ptr + 16, x["windowId"] === undefined ? 0 : (x["windowId"] as number));
    61        }
    62      },
    63      "load_QueryArgQueryInfo": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    64        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    65  
    66        if (A.load.Bool(ptr + 24)) {
    67          x["collapsed"] = A.load.Bool(ptr + 0);
    68        } else {
    69          delete x["collapsed"];
    70        }
    71        x["color"] = A.load.Enum(ptr + 4, ["grey", "blue", "red", "yellow", "green", "pink", "purple", "cyan", "orange"]);
    72        x["title"] = A.load.Ref(ptr + 8, undefined);
    73        if (A.load.Bool(ptr + 25)) {
    74          x["windowId"] = A.load.Int64(ptr + 16);
    75        } else {
    76          delete x["windowId"];
    77        }
    78        return create === A.H.TRUE ? A.H.push(x) : ref;
    79      },
    80      "get_TAB_GROUP_ID_NONE": (retPtr: Pointer): heap.Ref<boolean> => {
    81        if (WEBEXT?.tabGroups && "TAB_GROUP_ID_NONE" in WEBEXT?.tabGroups) {
    82          const val = WEBEXT.tabGroups.TAB_GROUP_ID_NONE;
    83          A.store.Ref(retPtr, val);
    84          return A.H.TRUE;
    85        }
    86  
    87        return A.H.FALSE;
    88      },
    89      "set_TAB_GROUP_ID_NONE": (val: heap.Ref<object>): heap.Ref<boolean> => {
    90        return Reflect.set(WEBEXT.tabGroups, "TAB_GROUP_ID_NONE", A.H.get<object>(val), WEBEXT.tabGroups)
    91          ? A.H.TRUE
    92          : A.H.FALSE;
    93      },
    94  
    95      "store_TabGroup": (ptr: Pointer, ref: heap.Ref<any>) => {
    96        const x = A.H.get<any>(ref);
    97  
    98        if (typeof x === "undefined") {
    99          A.store.Bool(ptr + 32, false);
   100          A.store.Bool(ptr + 0, false);
   101          A.store.Enum(ptr + 4, -1);
   102          A.store.Int64(ptr + 8, 0);
   103          A.store.Ref(ptr + 16, undefined);
   104          A.store.Int64(ptr + 24, 0);
   105        } else {
   106          A.store.Bool(ptr + 32, true);
   107          A.store.Bool(ptr + 0, x["collapsed"] ? true : false);
   108          A.store.Enum(
   109            ptr + 4,
   110            ["grey", "blue", "red", "yellow", "green", "pink", "purple", "cyan", "orange"].indexOf(x["color"] as string)
   111          );
   112          A.store.Int64(ptr + 8, x["id"] === undefined ? 0 : (x["id"] as number));
   113          A.store.Ref(ptr + 16, x["title"]);
   114          A.store.Int64(ptr + 24, x["windowId"] === undefined ? 0 : (x["windowId"] as number));
   115        }
   116      },
   117      "load_TabGroup": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   118        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   119  
   120        x["collapsed"] = A.load.Bool(ptr + 0);
   121        x["color"] = A.load.Enum(ptr + 4, ["grey", "blue", "red", "yellow", "green", "pink", "purple", "cyan", "orange"]);
   122        x["id"] = A.load.Int64(ptr + 8);
   123        x["title"] = A.load.Ref(ptr + 16, undefined);
   124        x["windowId"] = A.load.Int64(ptr + 24);
   125        return create === A.H.TRUE ? A.H.push(x) : ref;
   126      },
   127  
   128      "store_UpdateArgUpdateProperties": (ptr: Pointer, ref: heap.Ref<any>) => {
   129        const x = A.H.get<any>(ref);
   130  
   131        if (typeof x === "undefined") {
   132          A.store.Bool(ptr + 13, false);
   133          A.store.Bool(ptr + 12, false);
   134          A.store.Bool(ptr + 0, false);
   135          A.store.Enum(ptr + 4, -1);
   136          A.store.Ref(ptr + 8, undefined);
   137        } else {
   138          A.store.Bool(ptr + 13, true);
   139          A.store.Bool(ptr + 12, "collapsed" in x ? true : false);
   140          A.store.Bool(ptr + 0, x["collapsed"] ? true : false);
   141          A.store.Enum(
   142            ptr + 4,
   143            ["grey", "blue", "red", "yellow", "green", "pink", "purple", "cyan", "orange"].indexOf(x["color"] as string)
   144          );
   145          A.store.Ref(ptr + 8, x["title"]);
   146        }
   147      },
   148      "load_UpdateArgUpdateProperties": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   149        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   150  
   151        if (A.load.Bool(ptr + 12)) {
   152          x["collapsed"] = A.load.Bool(ptr + 0);
   153        } else {
   154          delete x["collapsed"];
   155        }
   156        x["color"] = A.load.Enum(ptr + 4, ["grey", "blue", "red", "yellow", "green", "pink", "purple", "cyan", "orange"]);
   157        x["title"] = A.load.Ref(ptr + 8, undefined);
   158        return create === A.H.TRUE ? A.H.push(x) : ref;
   159      },
   160      "has_Get": (): heap.Ref<boolean> => {
   161        if (WEBEXT?.tabGroups && "get" in WEBEXT?.tabGroups) {
   162          return A.H.TRUE;
   163        }
   164        return A.H.FALSE;
   165      },
   166      "func_Get": (fn: Pointer): void => {
   167        A.store.Ref(fn, WEBEXT.tabGroups.get);
   168      },
   169      "call_Get": (retPtr: Pointer, groupId: number): void => {
   170        const _ret = WEBEXT.tabGroups.get(groupId);
   171        A.store.Ref(retPtr, _ret);
   172      },
   173      "try_Get": (retPtr: Pointer, errPtr: Pointer, groupId: number): heap.Ref<boolean> => {
   174        try {
   175          const _ret = WEBEXT.tabGroups.get(groupId);
   176          A.store.Ref(retPtr, _ret);
   177          return A.H.TRUE;
   178        } catch (err: any) {
   179          A.store.Ref(errPtr, err);
   180          return A.H.FALSE;
   181        }
   182      },
   183      "has_Move": (): heap.Ref<boolean> => {
   184        if (WEBEXT?.tabGroups && "move" in WEBEXT?.tabGroups) {
   185          return A.H.TRUE;
   186        }
   187        return A.H.FALSE;
   188      },
   189      "func_Move": (fn: Pointer): void => {
   190        A.store.Ref(fn, WEBEXT.tabGroups.move);
   191      },
   192      "call_Move": (retPtr: Pointer, groupId: number, moveProperties: Pointer): void => {
   193        const moveProperties_ffi = {};
   194  
   195        moveProperties_ffi["index"] = A.load.Int64(moveProperties + 0);
   196        if (A.load.Bool(moveProperties + 16)) {
   197          moveProperties_ffi["windowId"] = A.load.Int64(moveProperties + 8);
   198        }
   199  
   200        const _ret = WEBEXT.tabGroups.move(groupId, moveProperties_ffi);
   201        A.store.Ref(retPtr, _ret);
   202      },
   203      "try_Move": (retPtr: Pointer, errPtr: Pointer, groupId: number, moveProperties: Pointer): heap.Ref<boolean> => {
   204        try {
   205          const moveProperties_ffi = {};
   206  
   207          moveProperties_ffi["index"] = A.load.Int64(moveProperties + 0);
   208          if (A.load.Bool(moveProperties + 16)) {
   209            moveProperties_ffi["windowId"] = A.load.Int64(moveProperties + 8);
   210          }
   211  
   212          const _ret = WEBEXT.tabGroups.move(groupId, moveProperties_ffi);
   213          A.store.Ref(retPtr, _ret);
   214          return A.H.TRUE;
   215        } catch (err: any) {
   216          A.store.Ref(errPtr, err);
   217          return A.H.FALSE;
   218        }
   219      },
   220      "has_OnCreated": (): heap.Ref<boolean> => {
   221        if (WEBEXT?.tabGroups?.onCreated && "addListener" in WEBEXT?.tabGroups?.onCreated) {
   222          return A.H.TRUE;
   223        }
   224        return A.H.FALSE;
   225      },
   226      "func_OnCreated": (fn: Pointer): void => {
   227        A.store.Ref(fn, WEBEXT.tabGroups.onCreated.addListener);
   228      },
   229      "call_OnCreated": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   230        const _ret = WEBEXT.tabGroups.onCreated.addListener(A.H.get<object>(callback));
   231      },
   232      "try_OnCreated": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   233        try {
   234          const _ret = WEBEXT.tabGroups.onCreated.addListener(A.H.get<object>(callback));
   235          return A.H.TRUE;
   236        } catch (err: any) {
   237          A.store.Ref(errPtr, err);
   238          return A.H.FALSE;
   239        }
   240      },
   241      "has_OffCreated": (): heap.Ref<boolean> => {
   242        if (WEBEXT?.tabGroups?.onCreated && "removeListener" in WEBEXT?.tabGroups?.onCreated) {
   243          return A.H.TRUE;
   244        }
   245        return A.H.FALSE;
   246      },
   247      "func_OffCreated": (fn: Pointer): void => {
   248        A.store.Ref(fn, WEBEXT.tabGroups.onCreated.removeListener);
   249      },
   250      "call_OffCreated": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   251        const _ret = WEBEXT.tabGroups.onCreated.removeListener(A.H.get<object>(callback));
   252      },
   253      "try_OffCreated": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   254        try {
   255          const _ret = WEBEXT.tabGroups.onCreated.removeListener(A.H.get<object>(callback));
   256          return A.H.TRUE;
   257        } catch (err: any) {
   258          A.store.Ref(errPtr, err);
   259          return A.H.FALSE;
   260        }
   261      },
   262      "has_HasOnCreated": (): heap.Ref<boolean> => {
   263        if (WEBEXT?.tabGroups?.onCreated && "hasListener" in WEBEXT?.tabGroups?.onCreated) {
   264          return A.H.TRUE;
   265        }
   266        return A.H.FALSE;
   267      },
   268      "func_HasOnCreated": (fn: Pointer): void => {
   269        A.store.Ref(fn, WEBEXT.tabGroups.onCreated.hasListener);
   270      },
   271      "call_HasOnCreated": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   272        const _ret = WEBEXT.tabGroups.onCreated.hasListener(A.H.get<object>(callback));
   273        A.store.Bool(retPtr, _ret);
   274      },
   275      "try_HasOnCreated": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   276        try {
   277          const _ret = WEBEXT.tabGroups.onCreated.hasListener(A.H.get<object>(callback));
   278          A.store.Bool(retPtr, _ret);
   279          return A.H.TRUE;
   280        } catch (err: any) {
   281          A.store.Ref(errPtr, err);
   282          return A.H.FALSE;
   283        }
   284      },
   285      "has_OnMoved": (): heap.Ref<boolean> => {
   286        if (WEBEXT?.tabGroups?.onMoved && "addListener" in WEBEXT?.tabGroups?.onMoved) {
   287          return A.H.TRUE;
   288        }
   289        return A.H.FALSE;
   290      },
   291      "func_OnMoved": (fn: Pointer): void => {
   292        A.store.Ref(fn, WEBEXT.tabGroups.onMoved.addListener);
   293      },
   294      "call_OnMoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   295        const _ret = WEBEXT.tabGroups.onMoved.addListener(A.H.get<object>(callback));
   296      },
   297      "try_OnMoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   298        try {
   299          const _ret = WEBEXT.tabGroups.onMoved.addListener(A.H.get<object>(callback));
   300          return A.H.TRUE;
   301        } catch (err: any) {
   302          A.store.Ref(errPtr, err);
   303          return A.H.FALSE;
   304        }
   305      },
   306      "has_OffMoved": (): heap.Ref<boolean> => {
   307        if (WEBEXT?.tabGroups?.onMoved && "removeListener" in WEBEXT?.tabGroups?.onMoved) {
   308          return A.H.TRUE;
   309        }
   310        return A.H.FALSE;
   311      },
   312      "func_OffMoved": (fn: Pointer): void => {
   313        A.store.Ref(fn, WEBEXT.tabGroups.onMoved.removeListener);
   314      },
   315      "call_OffMoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   316        const _ret = WEBEXT.tabGroups.onMoved.removeListener(A.H.get<object>(callback));
   317      },
   318      "try_OffMoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   319        try {
   320          const _ret = WEBEXT.tabGroups.onMoved.removeListener(A.H.get<object>(callback));
   321          return A.H.TRUE;
   322        } catch (err: any) {
   323          A.store.Ref(errPtr, err);
   324          return A.H.FALSE;
   325        }
   326      },
   327      "has_HasOnMoved": (): heap.Ref<boolean> => {
   328        if (WEBEXT?.tabGroups?.onMoved && "hasListener" in WEBEXT?.tabGroups?.onMoved) {
   329          return A.H.TRUE;
   330        }
   331        return A.H.FALSE;
   332      },
   333      "func_HasOnMoved": (fn: Pointer): void => {
   334        A.store.Ref(fn, WEBEXT.tabGroups.onMoved.hasListener);
   335      },
   336      "call_HasOnMoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   337        const _ret = WEBEXT.tabGroups.onMoved.hasListener(A.H.get<object>(callback));
   338        A.store.Bool(retPtr, _ret);
   339      },
   340      "try_HasOnMoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   341        try {
   342          const _ret = WEBEXT.tabGroups.onMoved.hasListener(A.H.get<object>(callback));
   343          A.store.Bool(retPtr, _ret);
   344          return A.H.TRUE;
   345        } catch (err: any) {
   346          A.store.Ref(errPtr, err);
   347          return A.H.FALSE;
   348        }
   349      },
   350      "has_OnRemoved": (): heap.Ref<boolean> => {
   351        if (WEBEXT?.tabGroups?.onRemoved && "addListener" in WEBEXT?.tabGroups?.onRemoved) {
   352          return A.H.TRUE;
   353        }
   354        return A.H.FALSE;
   355      },
   356      "func_OnRemoved": (fn: Pointer): void => {
   357        A.store.Ref(fn, WEBEXT.tabGroups.onRemoved.addListener);
   358      },
   359      "call_OnRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   360        const _ret = WEBEXT.tabGroups.onRemoved.addListener(A.H.get<object>(callback));
   361      },
   362      "try_OnRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   363        try {
   364          const _ret = WEBEXT.tabGroups.onRemoved.addListener(A.H.get<object>(callback));
   365          return A.H.TRUE;
   366        } catch (err: any) {
   367          A.store.Ref(errPtr, err);
   368          return A.H.FALSE;
   369        }
   370      },
   371      "has_OffRemoved": (): heap.Ref<boolean> => {
   372        if (WEBEXT?.tabGroups?.onRemoved && "removeListener" in WEBEXT?.tabGroups?.onRemoved) {
   373          return A.H.TRUE;
   374        }
   375        return A.H.FALSE;
   376      },
   377      "func_OffRemoved": (fn: Pointer): void => {
   378        A.store.Ref(fn, WEBEXT.tabGroups.onRemoved.removeListener);
   379      },
   380      "call_OffRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   381        const _ret = WEBEXT.tabGroups.onRemoved.removeListener(A.H.get<object>(callback));
   382      },
   383      "try_OffRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   384        try {
   385          const _ret = WEBEXT.tabGroups.onRemoved.removeListener(A.H.get<object>(callback));
   386          return A.H.TRUE;
   387        } catch (err: any) {
   388          A.store.Ref(errPtr, err);
   389          return A.H.FALSE;
   390        }
   391      },
   392      "has_HasOnRemoved": (): heap.Ref<boolean> => {
   393        if (WEBEXT?.tabGroups?.onRemoved && "hasListener" in WEBEXT?.tabGroups?.onRemoved) {
   394          return A.H.TRUE;
   395        }
   396        return A.H.FALSE;
   397      },
   398      "func_HasOnRemoved": (fn: Pointer): void => {
   399        A.store.Ref(fn, WEBEXT.tabGroups.onRemoved.hasListener);
   400      },
   401      "call_HasOnRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   402        const _ret = WEBEXT.tabGroups.onRemoved.hasListener(A.H.get<object>(callback));
   403        A.store.Bool(retPtr, _ret);
   404      },
   405      "try_HasOnRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   406        try {
   407          const _ret = WEBEXT.tabGroups.onRemoved.hasListener(A.H.get<object>(callback));
   408          A.store.Bool(retPtr, _ret);
   409          return A.H.TRUE;
   410        } catch (err: any) {
   411          A.store.Ref(errPtr, err);
   412          return A.H.FALSE;
   413        }
   414      },
   415      "has_OnUpdated": (): heap.Ref<boolean> => {
   416        if (WEBEXT?.tabGroups?.onUpdated && "addListener" in WEBEXT?.tabGroups?.onUpdated) {
   417          return A.H.TRUE;
   418        }
   419        return A.H.FALSE;
   420      },
   421      "func_OnUpdated": (fn: Pointer): void => {
   422        A.store.Ref(fn, WEBEXT.tabGroups.onUpdated.addListener);
   423      },
   424      "call_OnUpdated": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   425        const _ret = WEBEXT.tabGroups.onUpdated.addListener(A.H.get<object>(callback));
   426      },
   427      "try_OnUpdated": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   428        try {
   429          const _ret = WEBEXT.tabGroups.onUpdated.addListener(A.H.get<object>(callback));
   430          return A.H.TRUE;
   431        } catch (err: any) {
   432          A.store.Ref(errPtr, err);
   433          return A.H.FALSE;
   434        }
   435      },
   436      "has_OffUpdated": (): heap.Ref<boolean> => {
   437        if (WEBEXT?.tabGroups?.onUpdated && "removeListener" in WEBEXT?.tabGroups?.onUpdated) {
   438          return A.H.TRUE;
   439        }
   440        return A.H.FALSE;
   441      },
   442      "func_OffUpdated": (fn: Pointer): void => {
   443        A.store.Ref(fn, WEBEXT.tabGroups.onUpdated.removeListener);
   444      },
   445      "call_OffUpdated": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   446        const _ret = WEBEXT.tabGroups.onUpdated.removeListener(A.H.get<object>(callback));
   447      },
   448      "try_OffUpdated": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   449        try {
   450          const _ret = WEBEXT.tabGroups.onUpdated.removeListener(A.H.get<object>(callback));
   451          return A.H.TRUE;
   452        } catch (err: any) {
   453          A.store.Ref(errPtr, err);
   454          return A.H.FALSE;
   455        }
   456      },
   457      "has_HasOnUpdated": (): heap.Ref<boolean> => {
   458        if (WEBEXT?.tabGroups?.onUpdated && "hasListener" in WEBEXT?.tabGroups?.onUpdated) {
   459          return A.H.TRUE;
   460        }
   461        return A.H.FALSE;
   462      },
   463      "func_HasOnUpdated": (fn: Pointer): void => {
   464        A.store.Ref(fn, WEBEXT.tabGroups.onUpdated.hasListener);
   465      },
   466      "call_HasOnUpdated": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   467        const _ret = WEBEXT.tabGroups.onUpdated.hasListener(A.H.get<object>(callback));
   468        A.store.Bool(retPtr, _ret);
   469      },
   470      "try_HasOnUpdated": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   471        try {
   472          const _ret = WEBEXT.tabGroups.onUpdated.hasListener(A.H.get<object>(callback));
   473          A.store.Bool(retPtr, _ret);
   474          return A.H.TRUE;
   475        } catch (err: any) {
   476          A.store.Ref(errPtr, err);
   477          return A.H.FALSE;
   478        }
   479      },
   480      "has_Query": (): heap.Ref<boolean> => {
   481        if (WEBEXT?.tabGroups && "query" in WEBEXT?.tabGroups) {
   482          return A.H.TRUE;
   483        }
   484        return A.H.FALSE;
   485      },
   486      "func_Query": (fn: Pointer): void => {
   487        A.store.Ref(fn, WEBEXT.tabGroups.query);
   488      },
   489      "call_Query": (retPtr: Pointer, queryInfo: Pointer): void => {
   490        const queryInfo_ffi = {};
   491  
   492        if (A.load.Bool(queryInfo + 24)) {
   493          queryInfo_ffi["collapsed"] = A.load.Bool(queryInfo + 0);
   494        }
   495        queryInfo_ffi["color"] = A.load.Enum(queryInfo + 4, [
   496          "grey",
   497          "blue",
   498          "red",
   499          "yellow",
   500          "green",
   501          "pink",
   502          "purple",
   503          "cyan",
   504          "orange",
   505        ]);
   506        queryInfo_ffi["title"] = A.load.Ref(queryInfo + 8, undefined);
   507        if (A.load.Bool(queryInfo + 25)) {
   508          queryInfo_ffi["windowId"] = A.load.Int64(queryInfo + 16);
   509        }
   510  
   511        const _ret = WEBEXT.tabGroups.query(queryInfo_ffi);
   512        A.store.Ref(retPtr, _ret);
   513      },
   514      "try_Query": (retPtr: Pointer, errPtr: Pointer, queryInfo: Pointer): heap.Ref<boolean> => {
   515        try {
   516          const queryInfo_ffi = {};
   517  
   518          if (A.load.Bool(queryInfo + 24)) {
   519            queryInfo_ffi["collapsed"] = A.load.Bool(queryInfo + 0);
   520          }
   521          queryInfo_ffi["color"] = A.load.Enum(queryInfo + 4, [
   522            "grey",
   523            "blue",
   524            "red",
   525            "yellow",
   526            "green",
   527            "pink",
   528            "purple",
   529            "cyan",
   530            "orange",
   531          ]);
   532          queryInfo_ffi["title"] = A.load.Ref(queryInfo + 8, undefined);
   533          if (A.load.Bool(queryInfo + 25)) {
   534            queryInfo_ffi["windowId"] = A.load.Int64(queryInfo + 16);
   535          }
   536  
   537          const _ret = WEBEXT.tabGroups.query(queryInfo_ffi);
   538          A.store.Ref(retPtr, _ret);
   539          return A.H.TRUE;
   540        } catch (err: any) {
   541          A.store.Ref(errPtr, err);
   542          return A.H.FALSE;
   543        }
   544      },
   545      "has_Update": (): heap.Ref<boolean> => {
   546        if (WEBEXT?.tabGroups && "update" in WEBEXT?.tabGroups) {
   547          return A.H.TRUE;
   548        }
   549        return A.H.FALSE;
   550      },
   551      "func_Update": (fn: Pointer): void => {
   552        A.store.Ref(fn, WEBEXT.tabGroups.update);
   553      },
   554      "call_Update": (retPtr: Pointer, groupId: number, updateProperties: Pointer): void => {
   555        const updateProperties_ffi = {};
   556  
   557        if (A.load.Bool(updateProperties + 12)) {
   558          updateProperties_ffi["collapsed"] = A.load.Bool(updateProperties + 0);
   559        }
   560        updateProperties_ffi["color"] = A.load.Enum(updateProperties + 4, [
   561          "grey",
   562          "blue",
   563          "red",
   564          "yellow",
   565          "green",
   566          "pink",
   567          "purple",
   568          "cyan",
   569          "orange",
   570        ]);
   571        updateProperties_ffi["title"] = A.load.Ref(updateProperties + 8, undefined);
   572  
   573        const _ret = WEBEXT.tabGroups.update(groupId, updateProperties_ffi);
   574        A.store.Ref(retPtr, _ret);
   575      },
   576      "try_Update": (retPtr: Pointer, errPtr: Pointer, groupId: number, updateProperties: Pointer): heap.Ref<boolean> => {
   577        try {
   578          const updateProperties_ffi = {};
   579  
   580          if (A.load.Bool(updateProperties + 12)) {
   581            updateProperties_ffi["collapsed"] = A.load.Bool(updateProperties + 0);
   582          }
   583          updateProperties_ffi["color"] = A.load.Enum(updateProperties + 4, [
   584            "grey",
   585            "blue",
   586            "red",
   587            "yellow",
   588            "green",
   589            "pink",
   590            "purple",
   591            "cyan",
   592            "orange",
   593          ]);
   594          updateProperties_ffi["title"] = A.load.Ref(updateProperties + 8, undefined);
   595  
   596          const _ret = WEBEXT.tabGroups.update(groupId, updateProperties_ffi);
   597          A.store.Ref(retPtr, _ret);
   598          return A.H.TRUE;
   599        } catch (err: any) {
   600          A.store.Ref(errPtr, err);
   601          return A.H.FALSE;
   602        }
   603      },
   604    };
   605  });