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

     1  import { importModule, Application, heap, Pointer } from "@ffi";
     2  
     3  importModule("plat/js/webext/wmdesksprivate", (A: Application) => {
     4    const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser;
     5  
     6    return {
     7      "store_Desk": (ptr: Pointer, ref: heap.Ref<any>) => {
     8        const x = A.H.get<any>(ref);
     9  
    10        if (typeof x === "undefined") {
    11          A.store.Bool(ptr + 8, false);
    12          A.store.Ref(ptr + 0, undefined);
    13          A.store.Ref(ptr + 4, undefined);
    14        } else {
    15          A.store.Bool(ptr + 8, true);
    16          A.store.Ref(ptr + 0, x["deskUuid"]);
    17          A.store.Ref(ptr + 4, x["deskName"]);
    18        }
    19      },
    20      "load_Desk": (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["deskUuid"] = A.load.Ref(ptr + 0, undefined);
    24        x["deskName"] = A.load.Ref(ptr + 4, undefined);
    25        return create === A.H.TRUE ? A.H.push(x) : ref;
    26      },
    27      "constof_SavedDeskType": (ref: heap.Ref<string>): number => {
    28        const idx = ["kTemplate", "kSaveAndRecall", "kUnknown"].indexOf(A.H.get(ref));
    29        return idx < 0 ? 0 : idx + 1;
    30      },
    31  
    32      "store_SavedDesk": (ptr: Pointer, ref: heap.Ref<any>) => {
    33        const x = A.H.get<any>(ref);
    34  
    35        if (typeof x === "undefined") {
    36          A.store.Bool(ptr + 12, false);
    37          A.store.Ref(ptr + 0, undefined);
    38          A.store.Ref(ptr + 4, undefined);
    39          A.store.Enum(ptr + 8, -1);
    40        } else {
    41          A.store.Bool(ptr + 12, true);
    42          A.store.Ref(ptr + 0, x["savedDeskUuid"]);
    43          A.store.Ref(ptr + 4, x["savedDeskName"]);
    44          A.store.Enum(ptr + 8, ["kTemplate", "kSaveAndRecall", "kUnknown"].indexOf(x["savedDeskType"] as string));
    45        }
    46      },
    47      "load_SavedDesk": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    48        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    49  
    50        x["savedDeskUuid"] = A.load.Ref(ptr + 0, undefined);
    51        x["savedDeskName"] = A.load.Ref(ptr + 4, undefined);
    52        x["savedDeskType"] = A.load.Enum(ptr + 8, ["kTemplate", "kSaveAndRecall", "kUnknown"]);
    53        return create === A.H.TRUE ? A.H.push(x) : ref;
    54      },
    55  
    56      "store_LaunchOptions": (ptr: Pointer, ref: heap.Ref<any>) => {
    57        const x = A.H.get<any>(ref);
    58  
    59        if (typeof x === "undefined") {
    60          A.store.Bool(ptr + 4, false);
    61          A.store.Ref(ptr + 0, undefined);
    62        } else {
    63          A.store.Bool(ptr + 4, true);
    64          A.store.Ref(ptr + 0, x["deskName"]);
    65        }
    66      },
    67      "load_LaunchOptions": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    68        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    69  
    70        x["deskName"] = A.load.Ref(ptr + 0, undefined);
    71        return create === A.H.TRUE ? A.H.push(x) : ref;
    72      },
    73      "has_OnDeskAdded": (): heap.Ref<boolean> => {
    74        if (WEBEXT?.wmDesksPrivate?.OnDeskAdded && "addListener" in WEBEXT?.wmDesksPrivate?.OnDeskAdded) {
    75          return A.H.TRUE;
    76        }
    77        return A.H.FALSE;
    78      },
    79      "func_OnDeskAdded": (fn: Pointer): void => {
    80        A.store.Ref(fn, WEBEXT.wmDesksPrivate.OnDeskAdded.addListener);
    81      },
    82      "call_OnDeskAdded": (retPtr: Pointer, callback: heap.Ref<object>): void => {
    83        const _ret = WEBEXT.wmDesksPrivate.OnDeskAdded.addListener(A.H.get<object>(callback));
    84      },
    85      "try_OnDeskAdded": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
    86        try {
    87          const _ret = WEBEXT.wmDesksPrivate.OnDeskAdded.addListener(A.H.get<object>(callback));
    88          return A.H.TRUE;
    89        } catch (err: any) {
    90          A.store.Ref(errPtr, err);
    91          return A.H.FALSE;
    92        }
    93      },
    94      "has_OffDeskAdded": (): heap.Ref<boolean> => {
    95        if (WEBEXT?.wmDesksPrivate?.OnDeskAdded && "removeListener" in WEBEXT?.wmDesksPrivate?.OnDeskAdded) {
    96          return A.H.TRUE;
    97        }
    98        return A.H.FALSE;
    99      },
   100      "func_OffDeskAdded": (fn: Pointer): void => {
   101        A.store.Ref(fn, WEBEXT.wmDesksPrivate.OnDeskAdded.removeListener);
   102      },
   103      "call_OffDeskAdded": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   104        const _ret = WEBEXT.wmDesksPrivate.OnDeskAdded.removeListener(A.H.get<object>(callback));
   105      },
   106      "try_OffDeskAdded": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   107        try {
   108          const _ret = WEBEXT.wmDesksPrivate.OnDeskAdded.removeListener(A.H.get<object>(callback));
   109          return A.H.TRUE;
   110        } catch (err: any) {
   111          A.store.Ref(errPtr, err);
   112          return A.H.FALSE;
   113        }
   114      },
   115      "has_HasOnDeskAdded": (): heap.Ref<boolean> => {
   116        if (WEBEXT?.wmDesksPrivate?.OnDeskAdded && "hasListener" in WEBEXT?.wmDesksPrivate?.OnDeskAdded) {
   117          return A.H.TRUE;
   118        }
   119        return A.H.FALSE;
   120      },
   121      "func_HasOnDeskAdded": (fn: Pointer): void => {
   122        A.store.Ref(fn, WEBEXT.wmDesksPrivate.OnDeskAdded.hasListener);
   123      },
   124      "call_HasOnDeskAdded": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   125        const _ret = WEBEXT.wmDesksPrivate.OnDeskAdded.hasListener(A.H.get<object>(callback));
   126        A.store.Bool(retPtr, _ret);
   127      },
   128      "try_HasOnDeskAdded": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   129        try {
   130          const _ret = WEBEXT.wmDesksPrivate.OnDeskAdded.hasListener(A.H.get<object>(callback));
   131          A.store.Bool(retPtr, _ret);
   132          return A.H.TRUE;
   133        } catch (err: any) {
   134          A.store.Ref(errPtr, err);
   135          return A.H.FALSE;
   136        }
   137      },
   138      "has_OnDeskRemoved": (): heap.Ref<boolean> => {
   139        if (WEBEXT?.wmDesksPrivate?.OnDeskRemoved && "addListener" in WEBEXT?.wmDesksPrivate?.OnDeskRemoved) {
   140          return A.H.TRUE;
   141        }
   142        return A.H.FALSE;
   143      },
   144      "func_OnDeskRemoved": (fn: Pointer): void => {
   145        A.store.Ref(fn, WEBEXT.wmDesksPrivate.OnDeskRemoved.addListener);
   146      },
   147      "call_OnDeskRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   148        const _ret = WEBEXT.wmDesksPrivate.OnDeskRemoved.addListener(A.H.get<object>(callback));
   149      },
   150      "try_OnDeskRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   151        try {
   152          const _ret = WEBEXT.wmDesksPrivate.OnDeskRemoved.addListener(A.H.get<object>(callback));
   153          return A.H.TRUE;
   154        } catch (err: any) {
   155          A.store.Ref(errPtr, err);
   156          return A.H.FALSE;
   157        }
   158      },
   159      "has_OffDeskRemoved": (): heap.Ref<boolean> => {
   160        if (WEBEXT?.wmDesksPrivate?.OnDeskRemoved && "removeListener" in WEBEXT?.wmDesksPrivate?.OnDeskRemoved) {
   161          return A.H.TRUE;
   162        }
   163        return A.H.FALSE;
   164      },
   165      "func_OffDeskRemoved": (fn: Pointer): void => {
   166        A.store.Ref(fn, WEBEXT.wmDesksPrivate.OnDeskRemoved.removeListener);
   167      },
   168      "call_OffDeskRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   169        const _ret = WEBEXT.wmDesksPrivate.OnDeskRemoved.removeListener(A.H.get<object>(callback));
   170      },
   171      "try_OffDeskRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   172        try {
   173          const _ret = WEBEXT.wmDesksPrivate.OnDeskRemoved.removeListener(A.H.get<object>(callback));
   174          return A.H.TRUE;
   175        } catch (err: any) {
   176          A.store.Ref(errPtr, err);
   177          return A.H.FALSE;
   178        }
   179      },
   180      "has_HasOnDeskRemoved": (): heap.Ref<boolean> => {
   181        if (WEBEXT?.wmDesksPrivate?.OnDeskRemoved && "hasListener" in WEBEXT?.wmDesksPrivate?.OnDeskRemoved) {
   182          return A.H.TRUE;
   183        }
   184        return A.H.FALSE;
   185      },
   186      "func_HasOnDeskRemoved": (fn: Pointer): void => {
   187        A.store.Ref(fn, WEBEXT.wmDesksPrivate.OnDeskRemoved.hasListener);
   188      },
   189      "call_HasOnDeskRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   190        const _ret = WEBEXT.wmDesksPrivate.OnDeskRemoved.hasListener(A.H.get<object>(callback));
   191        A.store.Bool(retPtr, _ret);
   192      },
   193      "try_HasOnDeskRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   194        try {
   195          const _ret = WEBEXT.wmDesksPrivate.OnDeskRemoved.hasListener(A.H.get<object>(callback));
   196          A.store.Bool(retPtr, _ret);
   197          return A.H.TRUE;
   198        } catch (err: any) {
   199          A.store.Ref(errPtr, err);
   200          return A.H.FALSE;
   201        }
   202      },
   203      "has_OnDeskSwitched": (): heap.Ref<boolean> => {
   204        if (WEBEXT?.wmDesksPrivate?.OnDeskSwitched && "addListener" in WEBEXT?.wmDesksPrivate?.OnDeskSwitched) {
   205          return A.H.TRUE;
   206        }
   207        return A.H.FALSE;
   208      },
   209      "func_OnDeskSwitched": (fn: Pointer): void => {
   210        A.store.Ref(fn, WEBEXT.wmDesksPrivate.OnDeskSwitched.addListener);
   211      },
   212      "call_OnDeskSwitched": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   213        const _ret = WEBEXT.wmDesksPrivate.OnDeskSwitched.addListener(A.H.get<object>(callback));
   214      },
   215      "try_OnDeskSwitched": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   216        try {
   217          const _ret = WEBEXT.wmDesksPrivate.OnDeskSwitched.addListener(A.H.get<object>(callback));
   218          return A.H.TRUE;
   219        } catch (err: any) {
   220          A.store.Ref(errPtr, err);
   221          return A.H.FALSE;
   222        }
   223      },
   224      "has_OffDeskSwitched": (): heap.Ref<boolean> => {
   225        if (WEBEXT?.wmDesksPrivate?.OnDeskSwitched && "removeListener" in WEBEXT?.wmDesksPrivate?.OnDeskSwitched) {
   226          return A.H.TRUE;
   227        }
   228        return A.H.FALSE;
   229      },
   230      "func_OffDeskSwitched": (fn: Pointer): void => {
   231        A.store.Ref(fn, WEBEXT.wmDesksPrivate.OnDeskSwitched.removeListener);
   232      },
   233      "call_OffDeskSwitched": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   234        const _ret = WEBEXT.wmDesksPrivate.OnDeskSwitched.removeListener(A.H.get<object>(callback));
   235      },
   236      "try_OffDeskSwitched": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   237        try {
   238          const _ret = WEBEXT.wmDesksPrivate.OnDeskSwitched.removeListener(A.H.get<object>(callback));
   239          return A.H.TRUE;
   240        } catch (err: any) {
   241          A.store.Ref(errPtr, err);
   242          return A.H.FALSE;
   243        }
   244      },
   245      "has_HasOnDeskSwitched": (): heap.Ref<boolean> => {
   246        if (WEBEXT?.wmDesksPrivate?.OnDeskSwitched && "hasListener" in WEBEXT?.wmDesksPrivate?.OnDeskSwitched) {
   247          return A.H.TRUE;
   248        }
   249        return A.H.FALSE;
   250      },
   251      "func_HasOnDeskSwitched": (fn: Pointer): void => {
   252        A.store.Ref(fn, WEBEXT.wmDesksPrivate.OnDeskSwitched.hasListener);
   253      },
   254      "call_HasOnDeskSwitched": (retPtr: Pointer, callback: heap.Ref<object>): void => {
   255        const _ret = WEBEXT.wmDesksPrivate.OnDeskSwitched.hasListener(A.H.get<object>(callback));
   256        A.store.Bool(retPtr, _ret);
   257      },
   258      "try_HasOnDeskSwitched": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => {
   259        try {
   260          const _ret = WEBEXT.wmDesksPrivate.OnDeskSwitched.hasListener(A.H.get<object>(callback));
   261          A.store.Bool(retPtr, _ret);
   262          return A.H.TRUE;
   263        } catch (err: any) {
   264          A.store.Ref(errPtr, err);
   265          return A.H.FALSE;
   266        }
   267      },
   268  
   269      "store_RemoveDeskOptions": (ptr: Pointer, ref: heap.Ref<any>) => {
   270        const x = A.H.get<any>(ref);
   271  
   272        if (typeof x === "undefined") {
   273          A.store.Bool(ptr + 4, false);
   274          A.store.Bool(ptr + 2, false);
   275          A.store.Bool(ptr + 0, false);
   276          A.store.Bool(ptr + 3, false);
   277          A.store.Bool(ptr + 1, false);
   278        } else {
   279          A.store.Bool(ptr + 4, true);
   280          A.store.Bool(ptr + 2, "combineDesks" in x ? true : false);
   281          A.store.Bool(ptr + 0, x["combineDesks"] ? true : false);
   282          A.store.Bool(ptr + 3, "allowUndo" in x ? true : false);
   283          A.store.Bool(ptr + 1, x["allowUndo"] ? true : false);
   284        }
   285      },
   286      "load_RemoveDeskOptions": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   287        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   288  
   289        if (A.load.Bool(ptr + 2)) {
   290          x["combineDesks"] = A.load.Bool(ptr + 0);
   291        } else {
   292          delete x["combineDesks"];
   293        }
   294        if (A.load.Bool(ptr + 3)) {
   295          x["allowUndo"] = A.load.Bool(ptr + 1);
   296        } else {
   297          delete x["allowUndo"];
   298        }
   299        return create === A.H.TRUE ? A.H.push(x) : ref;
   300      },
   301  
   302      "store_WindowProperties": (ptr: Pointer, ref: heap.Ref<any>) => {
   303        const x = A.H.get<any>(ref);
   304  
   305        if (typeof x === "undefined") {
   306          A.store.Bool(ptr + 2, false);
   307          A.store.Bool(ptr + 1, false);
   308          A.store.Bool(ptr + 0, false);
   309        } else {
   310          A.store.Bool(ptr + 2, true);
   311          A.store.Bool(ptr + 1, "allDesks" in x ? true : false);
   312          A.store.Bool(ptr + 0, x["allDesks"] ? true : false);
   313        }
   314      },
   315      "load_WindowProperties": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   316        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   317  
   318        if (A.load.Bool(ptr + 1)) {
   319          x["allDesks"] = A.load.Bool(ptr + 0);
   320        } else {
   321          delete x["allDesks"];
   322        }
   323        return create === A.H.TRUE ? A.H.push(x) : ref;
   324      },
   325      "has_DeleteSavedDesk": (): heap.Ref<boolean> => {
   326        if (WEBEXT?.wmDesksPrivate && "deleteSavedDesk" in WEBEXT?.wmDesksPrivate) {
   327          return A.H.TRUE;
   328        }
   329        return A.H.FALSE;
   330      },
   331      "func_DeleteSavedDesk": (fn: Pointer): void => {
   332        A.store.Ref(fn, WEBEXT.wmDesksPrivate.deleteSavedDesk);
   333      },
   334      "call_DeleteSavedDesk": (retPtr: Pointer, savedDeskUuid: heap.Ref<object>): void => {
   335        const _ret = WEBEXT.wmDesksPrivate.deleteSavedDesk(A.H.get<object>(savedDeskUuid));
   336        A.store.Ref(retPtr, _ret);
   337      },
   338      "try_DeleteSavedDesk": (retPtr: Pointer, errPtr: Pointer, savedDeskUuid: heap.Ref<object>): heap.Ref<boolean> => {
   339        try {
   340          const _ret = WEBEXT.wmDesksPrivate.deleteSavedDesk(A.H.get<object>(savedDeskUuid));
   341          A.store.Ref(retPtr, _ret);
   342          return A.H.TRUE;
   343        } catch (err: any) {
   344          A.store.Ref(errPtr, err);
   345          return A.H.FALSE;
   346        }
   347      },
   348      "has_GetActiveDesk": (): heap.Ref<boolean> => {
   349        if (WEBEXT?.wmDesksPrivate && "getActiveDesk" in WEBEXT?.wmDesksPrivate) {
   350          return A.H.TRUE;
   351        }
   352        return A.H.FALSE;
   353      },
   354      "func_GetActiveDesk": (fn: Pointer): void => {
   355        A.store.Ref(fn, WEBEXT.wmDesksPrivate.getActiveDesk);
   356      },
   357      "call_GetActiveDesk": (retPtr: Pointer): void => {
   358        const _ret = WEBEXT.wmDesksPrivate.getActiveDesk();
   359        A.store.Ref(retPtr, _ret);
   360      },
   361      "try_GetActiveDesk": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   362        try {
   363          const _ret = WEBEXT.wmDesksPrivate.getActiveDesk();
   364          A.store.Ref(retPtr, _ret);
   365          return A.H.TRUE;
   366        } catch (err: any) {
   367          A.store.Ref(errPtr, err);
   368          return A.H.FALSE;
   369        }
   370      },
   371      "has_GetAllDesks": (): heap.Ref<boolean> => {
   372        if (WEBEXT?.wmDesksPrivate && "getAllDesks" in WEBEXT?.wmDesksPrivate) {
   373          return A.H.TRUE;
   374        }
   375        return A.H.FALSE;
   376      },
   377      "func_GetAllDesks": (fn: Pointer): void => {
   378        A.store.Ref(fn, WEBEXT.wmDesksPrivate.getAllDesks);
   379      },
   380      "call_GetAllDesks": (retPtr: Pointer): void => {
   381        const _ret = WEBEXT.wmDesksPrivate.getAllDesks();
   382        A.store.Ref(retPtr, _ret);
   383      },
   384      "try_GetAllDesks": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   385        try {
   386          const _ret = WEBEXT.wmDesksPrivate.getAllDesks();
   387          A.store.Ref(retPtr, _ret);
   388          return A.H.TRUE;
   389        } catch (err: any) {
   390          A.store.Ref(errPtr, err);
   391          return A.H.FALSE;
   392        }
   393      },
   394      "has_GetDeskByID": (): heap.Ref<boolean> => {
   395        if (WEBEXT?.wmDesksPrivate && "getDeskByID" in WEBEXT?.wmDesksPrivate) {
   396          return A.H.TRUE;
   397        }
   398        return A.H.FALSE;
   399      },
   400      "func_GetDeskByID": (fn: Pointer): void => {
   401        A.store.Ref(fn, WEBEXT.wmDesksPrivate.getDeskByID);
   402      },
   403      "call_GetDeskByID": (retPtr: Pointer, deskUuid: heap.Ref<object>): void => {
   404        const _ret = WEBEXT.wmDesksPrivate.getDeskByID(A.H.get<object>(deskUuid));
   405        A.store.Ref(retPtr, _ret);
   406      },
   407      "try_GetDeskByID": (retPtr: Pointer, errPtr: Pointer, deskUuid: heap.Ref<object>): heap.Ref<boolean> => {
   408        try {
   409          const _ret = WEBEXT.wmDesksPrivate.getDeskByID(A.H.get<object>(deskUuid));
   410          A.store.Ref(retPtr, _ret);
   411          return A.H.TRUE;
   412        } catch (err: any) {
   413          A.store.Ref(errPtr, err);
   414          return A.H.FALSE;
   415        }
   416      },
   417      "has_GetDeskTemplateJson": (): heap.Ref<boolean> => {
   418        if (WEBEXT?.wmDesksPrivate && "getDeskTemplateJson" in WEBEXT?.wmDesksPrivate) {
   419          return A.H.TRUE;
   420        }
   421        return A.H.FALSE;
   422      },
   423      "func_GetDeskTemplateJson": (fn: Pointer): void => {
   424        A.store.Ref(fn, WEBEXT.wmDesksPrivate.getDeskTemplateJson);
   425      },
   426      "call_GetDeskTemplateJson": (retPtr: Pointer, templateUuid: heap.Ref<object>): void => {
   427        const _ret = WEBEXT.wmDesksPrivate.getDeskTemplateJson(A.H.get<object>(templateUuid));
   428        A.store.Ref(retPtr, _ret);
   429      },
   430      "try_GetDeskTemplateJson": (
   431        retPtr: Pointer,
   432        errPtr: Pointer,
   433        templateUuid: heap.Ref<object>
   434      ): heap.Ref<boolean> => {
   435        try {
   436          const _ret = WEBEXT.wmDesksPrivate.getDeskTemplateJson(A.H.get<object>(templateUuid));
   437          A.store.Ref(retPtr, _ret);
   438          return A.H.TRUE;
   439        } catch (err: any) {
   440          A.store.Ref(errPtr, err);
   441          return A.H.FALSE;
   442        }
   443      },
   444      "has_GetSavedDesks": (): heap.Ref<boolean> => {
   445        if (WEBEXT?.wmDesksPrivate && "getSavedDesks" in WEBEXT?.wmDesksPrivate) {
   446          return A.H.TRUE;
   447        }
   448        return A.H.FALSE;
   449      },
   450      "func_GetSavedDesks": (fn: Pointer): void => {
   451        A.store.Ref(fn, WEBEXT.wmDesksPrivate.getSavedDesks);
   452      },
   453      "call_GetSavedDesks": (retPtr: Pointer): void => {
   454        const _ret = WEBEXT.wmDesksPrivate.getSavedDesks();
   455        A.store.Ref(retPtr, _ret);
   456      },
   457      "try_GetSavedDesks": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   458        try {
   459          const _ret = WEBEXT.wmDesksPrivate.getSavedDesks();
   460          A.store.Ref(retPtr, _ret);
   461          return A.H.TRUE;
   462        } catch (err: any) {
   463          A.store.Ref(errPtr, err);
   464          return A.H.FALSE;
   465        }
   466      },
   467      "has_LaunchDesk": (): heap.Ref<boolean> => {
   468        if (WEBEXT?.wmDesksPrivate && "launchDesk" in WEBEXT?.wmDesksPrivate) {
   469          return A.H.TRUE;
   470        }
   471        return A.H.FALSE;
   472      },
   473      "func_LaunchDesk": (fn: Pointer): void => {
   474        A.store.Ref(fn, WEBEXT.wmDesksPrivate.launchDesk);
   475      },
   476      "call_LaunchDesk": (retPtr: Pointer, launchOptions: Pointer): void => {
   477        const launchOptions_ffi = {};
   478  
   479        launchOptions_ffi["deskName"] = A.load.Ref(launchOptions + 0, undefined);
   480  
   481        const _ret = WEBEXT.wmDesksPrivate.launchDesk(launchOptions_ffi);
   482        A.store.Ref(retPtr, _ret);
   483      },
   484      "try_LaunchDesk": (retPtr: Pointer, errPtr: Pointer, launchOptions: Pointer): heap.Ref<boolean> => {
   485        try {
   486          const launchOptions_ffi = {};
   487  
   488          launchOptions_ffi["deskName"] = A.load.Ref(launchOptions + 0, undefined);
   489  
   490          const _ret = WEBEXT.wmDesksPrivate.launchDesk(launchOptions_ffi);
   491          A.store.Ref(retPtr, _ret);
   492          return A.H.TRUE;
   493        } catch (err: any) {
   494          A.store.Ref(errPtr, err);
   495          return A.H.FALSE;
   496        }
   497      },
   498      "has_RecallSavedDesk": (): heap.Ref<boolean> => {
   499        if (WEBEXT?.wmDesksPrivate && "recallSavedDesk" in WEBEXT?.wmDesksPrivate) {
   500          return A.H.TRUE;
   501        }
   502        return A.H.FALSE;
   503      },
   504      "func_RecallSavedDesk": (fn: Pointer): void => {
   505        A.store.Ref(fn, WEBEXT.wmDesksPrivate.recallSavedDesk);
   506      },
   507      "call_RecallSavedDesk": (retPtr: Pointer, savedDeskUuid: heap.Ref<object>): void => {
   508        const _ret = WEBEXT.wmDesksPrivate.recallSavedDesk(A.H.get<object>(savedDeskUuid));
   509        A.store.Ref(retPtr, _ret);
   510      },
   511      "try_RecallSavedDesk": (retPtr: Pointer, errPtr: Pointer, savedDeskUuid: heap.Ref<object>): heap.Ref<boolean> => {
   512        try {
   513          const _ret = WEBEXT.wmDesksPrivate.recallSavedDesk(A.H.get<object>(savedDeskUuid));
   514          A.store.Ref(retPtr, _ret);
   515          return A.H.TRUE;
   516        } catch (err: any) {
   517          A.store.Ref(errPtr, err);
   518          return A.H.FALSE;
   519        }
   520      },
   521      "has_RemoveDesk": (): heap.Ref<boolean> => {
   522        if (WEBEXT?.wmDesksPrivate && "removeDesk" in WEBEXT?.wmDesksPrivate) {
   523          return A.H.TRUE;
   524        }
   525        return A.H.FALSE;
   526      },
   527      "func_RemoveDesk": (fn: Pointer): void => {
   528        A.store.Ref(fn, WEBEXT.wmDesksPrivate.removeDesk);
   529      },
   530      "call_RemoveDesk": (retPtr: Pointer, deskId: heap.Ref<object>, removeDeskOptions: Pointer): void => {
   531        const removeDeskOptions_ffi = {};
   532  
   533        if (A.load.Bool(removeDeskOptions + 2)) {
   534          removeDeskOptions_ffi["combineDesks"] = A.load.Bool(removeDeskOptions + 0);
   535        }
   536        if (A.load.Bool(removeDeskOptions + 3)) {
   537          removeDeskOptions_ffi["allowUndo"] = A.load.Bool(removeDeskOptions + 1);
   538        }
   539  
   540        const _ret = WEBEXT.wmDesksPrivate.removeDesk(A.H.get<object>(deskId), removeDeskOptions_ffi);
   541        A.store.Ref(retPtr, _ret);
   542      },
   543      "try_RemoveDesk": (
   544        retPtr: Pointer,
   545        errPtr: Pointer,
   546        deskId: heap.Ref<object>,
   547        removeDeskOptions: Pointer
   548      ): heap.Ref<boolean> => {
   549        try {
   550          const removeDeskOptions_ffi = {};
   551  
   552          if (A.load.Bool(removeDeskOptions + 2)) {
   553            removeDeskOptions_ffi["combineDesks"] = A.load.Bool(removeDeskOptions + 0);
   554          }
   555          if (A.load.Bool(removeDeskOptions + 3)) {
   556            removeDeskOptions_ffi["allowUndo"] = A.load.Bool(removeDeskOptions + 1);
   557          }
   558  
   559          const _ret = WEBEXT.wmDesksPrivate.removeDesk(A.H.get<object>(deskId), removeDeskOptions_ffi);
   560          A.store.Ref(retPtr, _ret);
   561          return A.H.TRUE;
   562        } catch (err: any) {
   563          A.store.Ref(errPtr, err);
   564          return A.H.FALSE;
   565        }
   566      },
   567      "has_SaveActiveDesk": (): heap.Ref<boolean> => {
   568        if (WEBEXT?.wmDesksPrivate && "saveActiveDesk" in WEBEXT?.wmDesksPrivate) {
   569          return A.H.TRUE;
   570        }
   571        return A.H.FALSE;
   572      },
   573      "func_SaveActiveDesk": (fn: Pointer): void => {
   574        A.store.Ref(fn, WEBEXT.wmDesksPrivate.saveActiveDesk);
   575      },
   576      "call_SaveActiveDesk": (retPtr: Pointer): void => {
   577        const _ret = WEBEXT.wmDesksPrivate.saveActiveDesk();
   578        A.store.Ref(retPtr, _ret);
   579      },
   580      "try_SaveActiveDesk": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   581        try {
   582          const _ret = WEBEXT.wmDesksPrivate.saveActiveDesk();
   583          A.store.Ref(retPtr, _ret);
   584          return A.H.TRUE;
   585        } catch (err: any) {
   586          A.store.Ref(errPtr, err);
   587          return A.H.FALSE;
   588        }
   589      },
   590      "has_SetWindowProperties": (): heap.Ref<boolean> => {
   591        if (WEBEXT?.wmDesksPrivate && "setWindowProperties" in WEBEXT?.wmDesksPrivate) {
   592          return A.H.TRUE;
   593        }
   594        return A.H.FALSE;
   595      },
   596      "func_SetWindowProperties": (fn: Pointer): void => {
   597        A.store.Ref(fn, WEBEXT.wmDesksPrivate.setWindowProperties);
   598      },
   599      "call_SetWindowProperties": (retPtr: Pointer, windowId: number, windowProperties: Pointer): void => {
   600        const windowProperties_ffi = {};
   601  
   602        if (A.load.Bool(windowProperties + 1)) {
   603          windowProperties_ffi["allDesks"] = A.load.Bool(windowProperties + 0);
   604        }
   605  
   606        const _ret = WEBEXT.wmDesksPrivate.setWindowProperties(windowId, windowProperties_ffi);
   607        A.store.Ref(retPtr, _ret);
   608      },
   609      "try_SetWindowProperties": (
   610        retPtr: Pointer,
   611        errPtr: Pointer,
   612        windowId: number,
   613        windowProperties: Pointer
   614      ): heap.Ref<boolean> => {
   615        try {
   616          const windowProperties_ffi = {};
   617  
   618          if (A.load.Bool(windowProperties + 1)) {
   619            windowProperties_ffi["allDesks"] = A.load.Bool(windowProperties + 0);
   620          }
   621  
   622          const _ret = WEBEXT.wmDesksPrivate.setWindowProperties(windowId, windowProperties_ffi);
   623          A.store.Ref(retPtr, _ret);
   624          return A.H.TRUE;
   625        } catch (err: any) {
   626          A.store.Ref(errPtr, err);
   627          return A.H.FALSE;
   628        }
   629      },
   630      "has_SwitchDesk": (): heap.Ref<boolean> => {
   631        if (WEBEXT?.wmDesksPrivate && "switchDesk" in WEBEXT?.wmDesksPrivate) {
   632          return A.H.TRUE;
   633        }
   634        return A.H.FALSE;
   635      },
   636      "func_SwitchDesk": (fn: Pointer): void => {
   637        A.store.Ref(fn, WEBEXT.wmDesksPrivate.switchDesk);
   638      },
   639      "call_SwitchDesk": (retPtr: Pointer, deskUuid: heap.Ref<object>): void => {
   640        const _ret = WEBEXT.wmDesksPrivate.switchDesk(A.H.get<object>(deskUuid));
   641        A.store.Ref(retPtr, _ret);
   642      },
   643      "try_SwitchDesk": (retPtr: Pointer, errPtr: Pointer, deskUuid: heap.Ref<object>): heap.Ref<boolean> => {
   644        try {
   645          const _ret = WEBEXT.wmDesksPrivate.switchDesk(A.H.get<object>(deskUuid));
   646          A.store.Ref(retPtr, _ret);
   647          return A.H.TRUE;
   648        } catch (err: any) {
   649          A.store.Ref(errPtr, err);
   650          return A.H.FALSE;
   651        }
   652      },
   653    };
   654  });