github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/languagesettingsprivate/bindings/ffi_bindings.ts (about) 1 import { importModule, Application, heap, Pointer } from "@ffi"; 2 3 importModule("plat/js/webext/languagesettingsprivate", (A: Application) => { 4 const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser; 5 6 return { 7 "store_InputMethod": (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 + 22, false); 12 A.store.Ref(ptr + 0, undefined); 13 A.store.Ref(ptr + 4, undefined); 14 A.store.Ref(ptr + 8, undefined); 15 A.store.Ref(ptr + 12, undefined); 16 A.store.Bool(ptr + 19, false); 17 A.store.Bool(ptr + 16, false); 18 A.store.Bool(ptr + 20, false); 19 A.store.Bool(ptr + 17, false); 20 A.store.Bool(ptr + 21, false); 21 A.store.Bool(ptr + 18, false); 22 } else { 23 A.store.Bool(ptr + 22, true); 24 A.store.Ref(ptr + 0, x["id"]); 25 A.store.Ref(ptr + 4, x["displayName"]); 26 A.store.Ref(ptr + 8, x["languageCodes"]); 27 A.store.Ref(ptr + 12, x["tags"]); 28 A.store.Bool(ptr + 19, "enabled" in x ? true : false); 29 A.store.Bool(ptr + 16, x["enabled"] ? true : false); 30 A.store.Bool(ptr + 20, "hasOptionsPage" in x ? true : false); 31 A.store.Bool(ptr + 17, x["hasOptionsPage"] ? true : false); 32 A.store.Bool(ptr + 21, "isProhibitedByPolicy" in x ? true : false); 33 A.store.Bool(ptr + 18, x["isProhibitedByPolicy"] ? true : false); 34 } 35 }, 36 "load_InputMethod": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 37 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 38 39 x["id"] = A.load.Ref(ptr + 0, undefined); 40 x["displayName"] = A.load.Ref(ptr + 4, undefined); 41 x["languageCodes"] = A.load.Ref(ptr + 8, undefined); 42 x["tags"] = A.load.Ref(ptr + 12, undefined); 43 if (A.load.Bool(ptr + 19)) { 44 x["enabled"] = A.load.Bool(ptr + 16); 45 } else { 46 delete x["enabled"]; 47 } 48 if (A.load.Bool(ptr + 20)) { 49 x["hasOptionsPage"] = A.load.Bool(ptr + 17); 50 } else { 51 delete x["hasOptionsPage"]; 52 } 53 if (A.load.Bool(ptr + 21)) { 54 x["isProhibitedByPolicy"] = A.load.Bool(ptr + 18); 55 } else { 56 delete x["isProhibitedByPolicy"]; 57 } 58 return create === A.H.TRUE ? A.H.push(x) : ref; 59 }, 60 61 "store_InputMethodLists": (ptr: Pointer, ref: heap.Ref<any>) => { 62 const x = A.H.get<any>(ref); 63 64 if (typeof x === "undefined") { 65 A.store.Bool(ptr + 8, false); 66 A.store.Ref(ptr + 0, undefined); 67 A.store.Ref(ptr + 4, undefined); 68 } else { 69 A.store.Bool(ptr + 8, true); 70 A.store.Ref(ptr + 0, x["componentExtensionImes"]); 71 A.store.Ref(ptr + 4, x["thirdPartyExtensionImes"]); 72 } 73 }, 74 "load_InputMethodLists": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 75 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 76 77 x["componentExtensionImes"] = A.load.Ref(ptr + 0, undefined); 78 x["thirdPartyExtensionImes"] = A.load.Ref(ptr + 4, undefined); 79 return create === A.H.TRUE ? A.H.push(x) : ref; 80 }, 81 82 "store_Language": (ptr: Pointer, ref: heap.Ref<any>) => { 83 const x = A.H.get<any>(ref); 84 85 if (typeof x === "undefined") { 86 A.store.Bool(ptr + 20, false); 87 A.store.Ref(ptr + 0, undefined); 88 A.store.Ref(ptr + 4, undefined); 89 A.store.Ref(ptr + 8, undefined); 90 A.store.Bool(ptr + 16, false); 91 A.store.Bool(ptr + 12, false); 92 A.store.Bool(ptr + 17, false); 93 A.store.Bool(ptr + 13, false); 94 A.store.Bool(ptr + 18, false); 95 A.store.Bool(ptr + 14, false); 96 A.store.Bool(ptr + 19, false); 97 A.store.Bool(ptr + 15, false); 98 } else { 99 A.store.Bool(ptr + 20, true); 100 A.store.Ref(ptr + 0, x["code"]); 101 A.store.Ref(ptr + 4, x["displayName"]); 102 A.store.Ref(ptr + 8, x["nativeDisplayName"]); 103 A.store.Bool(ptr + 16, "supportsUI" in x ? true : false); 104 A.store.Bool(ptr + 12, x["supportsUI"] ? true : false); 105 A.store.Bool(ptr + 17, "supportsSpellcheck" in x ? true : false); 106 A.store.Bool(ptr + 13, x["supportsSpellcheck"] ? true : false); 107 A.store.Bool(ptr + 18, "supportsTranslate" in x ? true : false); 108 A.store.Bool(ptr + 14, x["supportsTranslate"] ? true : false); 109 A.store.Bool(ptr + 19, "isProhibitedLanguage" in x ? true : false); 110 A.store.Bool(ptr + 15, x["isProhibitedLanguage"] ? true : false); 111 } 112 }, 113 "load_Language": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 114 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 115 116 x["code"] = A.load.Ref(ptr + 0, undefined); 117 x["displayName"] = A.load.Ref(ptr + 4, undefined); 118 x["nativeDisplayName"] = A.load.Ref(ptr + 8, undefined); 119 if (A.load.Bool(ptr + 16)) { 120 x["supportsUI"] = A.load.Bool(ptr + 12); 121 } else { 122 delete x["supportsUI"]; 123 } 124 if (A.load.Bool(ptr + 17)) { 125 x["supportsSpellcheck"] = A.load.Bool(ptr + 13); 126 } else { 127 delete x["supportsSpellcheck"]; 128 } 129 if (A.load.Bool(ptr + 18)) { 130 x["supportsTranslate"] = A.load.Bool(ptr + 14); 131 } else { 132 delete x["supportsTranslate"]; 133 } 134 if (A.load.Bool(ptr + 19)) { 135 x["isProhibitedLanguage"] = A.load.Bool(ptr + 15); 136 } else { 137 delete x["isProhibitedLanguage"]; 138 } 139 return create === A.H.TRUE ? A.H.push(x) : ref; 140 }, 141 142 "store_SpellcheckDictionaryStatus": (ptr: Pointer, ref: heap.Ref<any>) => { 143 const x = A.H.get<any>(ref); 144 145 if (typeof x === "undefined") { 146 A.store.Bool(ptr + 10, false); 147 A.store.Ref(ptr + 0, undefined); 148 A.store.Bool(ptr + 7, false); 149 A.store.Bool(ptr + 4, false); 150 A.store.Bool(ptr + 8, false); 151 A.store.Bool(ptr + 5, false); 152 A.store.Bool(ptr + 9, false); 153 A.store.Bool(ptr + 6, false); 154 } else { 155 A.store.Bool(ptr + 10, true); 156 A.store.Ref(ptr + 0, x["languageCode"]); 157 A.store.Bool(ptr + 7, "isReady" in x ? true : false); 158 A.store.Bool(ptr + 4, x["isReady"] ? true : false); 159 A.store.Bool(ptr + 8, "isDownloading" in x ? true : false); 160 A.store.Bool(ptr + 5, x["isDownloading"] ? true : false); 161 A.store.Bool(ptr + 9, "downloadFailed" in x ? true : false); 162 A.store.Bool(ptr + 6, x["downloadFailed"] ? true : false); 163 } 164 }, 165 "load_SpellcheckDictionaryStatus": (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["languageCode"] = A.load.Ref(ptr + 0, undefined); 169 if (A.load.Bool(ptr + 7)) { 170 x["isReady"] = A.load.Bool(ptr + 4); 171 } else { 172 delete x["isReady"]; 173 } 174 if (A.load.Bool(ptr + 8)) { 175 x["isDownloading"] = A.load.Bool(ptr + 5); 176 } else { 177 delete x["isDownloading"]; 178 } 179 if (A.load.Bool(ptr + 9)) { 180 x["downloadFailed"] = A.load.Bool(ptr + 6); 181 } else { 182 delete x["downloadFailed"]; 183 } 184 return create === A.H.TRUE ? A.H.push(x) : ref; 185 }, 186 "constof_MoveType": (ref: heap.Ref<string>): number => { 187 const idx = ["TOP", "UP", "DOWN", "UNKNOWN"].indexOf(A.H.get(ref)); 188 return idx < 0 ? 0 : idx + 1; 189 }, 190 "has_AddInputMethod": (): heap.Ref<boolean> => { 191 if (WEBEXT?.languageSettingsPrivate && "addInputMethod" in WEBEXT?.languageSettingsPrivate) { 192 return A.H.TRUE; 193 } 194 return A.H.FALSE; 195 }, 196 "func_AddInputMethod": (fn: Pointer): void => { 197 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.addInputMethod); 198 }, 199 "call_AddInputMethod": (retPtr: Pointer, inputMethodId: heap.Ref<object>): void => { 200 const _ret = WEBEXT.languageSettingsPrivate.addInputMethod(A.H.get<object>(inputMethodId)); 201 }, 202 "try_AddInputMethod": (retPtr: Pointer, errPtr: Pointer, inputMethodId: heap.Ref<object>): heap.Ref<boolean> => { 203 try { 204 const _ret = WEBEXT.languageSettingsPrivate.addInputMethod(A.H.get<object>(inputMethodId)); 205 return A.H.TRUE; 206 } catch (err: any) { 207 A.store.Ref(errPtr, err); 208 return A.H.FALSE; 209 } 210 }, 211 "has_AddSpellcheckWord": (): heap.Ref<boolean> => { 212 if (WEBEXT?.languageSettingsPrivate && "addSpellcheckWord" in WEBEXT?.languageSettingsPrivate) { 213 return A.H.TRUE; 214 } 215 return A.H.FALSE; 216 }, 217 "func_AddSpellcheckWord": (fn: Pointer): void => { 218 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.addSpellcheckWord); 219 }, 220 "call_AddSpellcheckWord": (retPtr: Pointer, word: heap.Ref<object>): void => { 221 const _ret = WEBEXT.languageSettingsPrivate.addSpellcheckWord(A.H.get<object>(word)); 222 }, 223 "try_AddSpellcheckWord": (retPtr: Pointer, errPtr: Pointer, word: heap.Ref<object>): heap.Ref<boolean> => { 224 try { 225 const _ret = WEBEXT.languageSettingsPrivate.addSpellcheckWord(A.H.get<object>(word)); 226 return A.H.TRUE; 227 } catch (err: any) { 228 A.store.Ref(errPtr, err); 229 return A.H.FALSE; 230 } 231 }, 232 "has_DisableLanguage": (): heap.Ref<boolean> => { 233 if (WEBEXT?.languageSettingsPrivate && "disableLanguage" in WEBEXT?.languageSettingsPrivate) { 234 return A.H.TRUE; 235 } 236 return A.H.FALSE; 237 }, 238 "func_DisableLanguage": (fn: Pointer): void => { 239 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.disableLanguage); 240 }, 241 "call_DisableLanguage": (retPtr: Pointer, languageCode: heap.Ref<object>): void => { 242 const _ret = WEBEXT.languageSettingsPrivate.disableLanguage(A.H.get<object>(languageCode)); 243 }, 244 "try_DisableLanguage": (retPtr: Pointer, errPtr: Pointer, languageCode: heap.Ref<object>): heap.Ref<boolean> => { 245 try { 246 const _ret = WEBEXT.languageSettingsPrivate.disableLanguage(A.H.get<object>(languageCode)); 247 return A.H.TRUE; 248 } catch (err: any) { 249 A.store.Ref(errPtr, err); 250 return A.H.FALSE; 251 } 252 }, 253 "has_EnableLanguage": (): heap.Ref<boolean> => { 254 if (WEBEXT?.languageSettingsPrivate && "enableLanguage" in WEBEXT?.languageSettingsPrivate) { 255 return A.H.TRUE; 256 } 257 return A.H.FALSE; 258 }, 259 "func_EnableLanguage": (fn: Pointer): void => { 260 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.enableLanguage); 261 }, 262 "call_EnableLanguage": (retPtr: Pointer, languageCode: heap.Ref<object>): void => { 263 const _ret = WEBEXT.languageSettingsPrivate.enableLanguage(A.H.get<object>(languageCode)); 264 }, 265 "try_EnableLanguage": (retPtr: Pointer, errPtr: Pointer, languageCode: heap.Ref<object>): heap.Ref<boolean> => { 266 try { 267 const _ret = WEBEXT.languageSettingsPrivate.enableLanguage(A.H.get<object>(languageCode)); 268 return A.H.TRUE; 269 } catch (err: any) { 270 A.store.Ref(errPtr, err); 271 return A.H.FALSE; 272 } 273 }, 274 "has_GetAlwaysTranslateLanguages": (): heap.Ref<boolean> => { 275 if (WEBEXT?.languageSettingsPrivate && "getAlwaysTranslateLanguages" in WEBEXT?.languageSettingsPrivate) { 276 return A.H.TRUE; 277 } 278 return A.H.FALSE; 279 }, 280 "func_GetAlwaysTranslateLanguages": (fn: Pointer): void => { 281 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.getAlwaysTranslateLanguages); 282 }, 283 "call_GetAlwaysTranslateLanguages": (retPtr: Pointer): void => { 284 const _ret = WEBEXT.languageSettingsPrivate.getAlwaysTranslateLanguages(); 285 A.store.Ref(retPtr, _ret); 286 }, 287 "try_GetAlwaysTranslateLanguages": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 288 try { 289 const _ret = WEBEXT.languageSettingsPrivate.getAlwaysTranslateLanguages(); 290 A.store.Ref(retPtr, _ret); 291 return A.H.TRUE; 292 } catch (err: any) { 293 A.store.Ref(errPtr, err); 294 return A.H.FALSE; 295 } 296 }, 297 "has_GetInputMethodLists": (): heap.Ref<boolean> => { 298 if (WEBEXT?.languageSettingsPrivate && "getInputMethodLists" in WEBEXT?.languageSettingsPrivate) { 299 return A.H.TRUE; 300 } 301 return A.H.FALSE; 302 }, 303 "func_GetInputMethodLists": (fn: Pointer): void => { 304 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.getInputMethodLists); 305 }, 306 "call_GetInputMethodLists": (retPtr: Pointer): void => { 307 const _ret = WEBEXT.languageSettingsPrivate.getInputMethodLists(); 308 A.store.Ref(retPtr, _ret); 309 }, 310 "try_GetInputMethodLists": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 311 try { 312 const _ret = WEBEXT.languageSettingsPrivate.getInputMethodLists(); 313 A.store.Ref(retPtr, _ret); 314 return A.H.TRUE; 315 } catch (err: any) { 316 A.store.Ref(errPtr, err); 317 return A.H.FALSE; 318 } 319 }, 320 "has_GetLanguageList": (): heap.Ref<boolean> => { 321 if (WEBEXT?.languageSettingsPrivate && "getLanguageList" in WEBEXT?.languageSettingsPrivate) { 322 return A.H.TRUE; 323 } 324 return A.H.FALSE; 325 }, 326 "func_GetLanguageList": (fn: Pointer): void => { 327 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.getLanguageList); 328 }, 329 "call_GetLanguageList": (retPtr: Pointer): void => { 330 const _ret = WEBEXT.languageSettingsPrivate.getLanguageList(); 331 A.store.Ref(retPtr, _ret); 332 }, 333 "try_GetLanguageList": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 334 try { 335 const _ret = WEBEXT.languageSettingsPrivate.getLanguageList(); 336 A.store.Ref(retPtr, _ret); 337 return A.H.TRUE; 338 } catch (err: any) { 339 A.store.Ref(errPtr, err); 340 return A.H.FALSE; 341 } 342 }, 343 "has_GetNeverTranslateLanguages": (): heap.Ref<boolean> => { 344 if (WEBEXT?.languageSettingsPrivate && "getNeverTranslateLanguages" in WEBEXT?.languageSettingsPrivate) { 345 return A.H.TRUE; 346 } 347 return A.H.FALSE; 348 }, 349 "func_GetNeverTranslateLanguages": (fn: Pointer): void => { 350 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.getNeverTranslateLanguages); 351 }, 352 "call_GetNeverTranslateLanguages": (retPtr: Pointer): void => { 353 const _ret = WEBEXT.languageSettingsPrivate.getNeverTranslateLanguages(); 354 A.store.Ref(retPtr, _ret); 355 }, 356 "try_GetNeverTranslateLanguages": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 357 try { 358 const _ret = WEBEXT.languageSettingsPrivate.getNeverTranslateLanguages(); 359 A.store.Ref(retPtr, _ret); 360 return A.H.TRUE; 361 } catch (err: any) { 362 A.store.Ref(errPtr, err); 363 return A.H.FALSE; 364 } 365 }, 366 "has_GetSpellcheckDictionaryStatuses": (): heap.Ref<boolean> => { 367 if (WEBEXT?.languageSettingsPrivate && "getSpellcheckDictionaryStatuses" in WEBEXT?.languageSettingsPrivate) { 368 return A.H.TRUE; 369 } 370 return A.H.FALSE; 371 }, 372 "func_GetSpellcheckDictionaryStatuses": (fn: Pointer): void => { 373 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.getSpellcheckDictionaryStatuses); 374 }, 375 "call_GetSpellcheckDictionaryStatuses": (retPtr: Pointer): void => { 376 const _ret = WEBEXT.languageSettingsPrivate.getSpellcheckDictionaryStatuses(); 377 A.store.Ref(retPtr, _ret); 378 }, 379 "try_GetSpellcheckDictionaryStatuses": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 380 try { 381 const _ret = WEBEXT.languageSettingsPrivate.getSpellcheckDictionaryStatuses(); 382 A.store.Ref(retPtr, _ret); 383 return A.H.TRUE; 384 } catch (err: any) { 385 A.store.Ref(errPtr, err); 386 return A.H.FALSE; 387 } 388 }, 389 "has_GetSpellcheckWords": (): heap.Ref<boolean> => { 390 if (WEBEXT?.languageSettingsPrivate && "getSpellcheckWords" in WEBEXT?.languageSettingsPrivate) { 391 return A.H.TRUE; 392 } 393 return A.H.FALSE; 394 }, 395 "func_GetSpellcheckWords": (fn: Pointer): void => { 396 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.getSpellcheckWords); 397 }, 398 "call_GetSpellcheckWords": (retPtr: Pointer): void => { 399 const _ret = WEBEXT.languageSettingsPrivate.getSpellcheckWords(); 400 A.store.Ref(retPtr, _ret); 401 }, 402 "try_GetSpellcheckWords": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 403 try { 404 const _ret = WEBEXT.languageSettingsPrivate.getSpellcheckWords(); 405 A.store.Ref(retPtr, _ret); 406 return A.H.TRUE; 407 } catch (err: any) { 408 A.store.Ref(errPtr, err); 409 return A.H.FALSE; 410 } 411 }, 412 "has_GetTranslateTargetLanguage": (): heap.Ref<boolean> => { 413 if (WEBEXT?.languageSettingsPrivate && "getTranslateTargetLanguage" in WEBEXT?.languageSettingsPrivate) { 414 return A.H.TRUE; 415 } 416 return A.H.FALSE; 417 }, 418 "func_GetTranslateTargetLanguage": (fn: Pointer): void => { 419 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.getTranslateTargetLanguage); 420 }, 421 "call_GetTranslateTargetLanguage": (retPtr: Pointer): void => { 422 const _ret = WEBEXT.languageSettingsPrivate.getTranslateTargetLanguage(); 423 A.store.Ref(retPtr, _ret); 424 }, 425 "try_GetTranslateTargetLanguage": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 426 try { 427 const _ret = WEBEXT.languageSettingsPrivate.getTranslateTargetLanguage(); 428 A.store.Ref(retPtr, _ret); 429 return A.H.TRUE; 430 } catch (err: any) { 431 A.store.Ref(errPtr, err); 432 return A.H.FALSE; 433 } 434 }, 435 "has_MoveLanguage": (): heap.Ref<boolean> => { 436 if (WEBEXT?.languageSettingsPrivate && "moveLanguage" in WEBEXT?.languageSettingsPrivate) { 437 return A.H.TRUE; 438 } 439 return A.H.FALSE; 440 }, 441 "func_MoveLanguage": (fn: Pointer): void => { 442 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.moveLanguage); 443 }, 444 "call_MoveLanguage": (retPtr: Pointer, languageCode: heap.Ref<object>, moveType: number): void => { 445 const _ret = WEBEXT.languageSettingsPrivate.moveLanguage( 446 A.H.get<object>(languageCode), 447 moveType > 0 && moveType <= 4 ? ["TOP", "UP", "DOWN", "UNKNOWN"][moveType - 1] : undefined 448 ); 449 }, 450 "try_MoveLanguage": ( 451 retPtr: Pointer, 452 errPtr: Pointer, 453 languageCode: heap.Ref<object>, 454 moveType: number 455 ): heap.Ref<boolean> => { 456 try { 457 const _ret = WEBEXT.languageSettingsPrivate.moveLanguage( 458 A.H.get<object>(languageCode), 459 moveType > 0 && moveType <= 4 ? ["TOP", "UP", "DOWN", "UNKNOWN"][moveType - 1] : undefined 460 ); 461 return A.H.TRUE; 462 } catch (err: any) { 463 A.store.Ref(errPtr, err); 464 return A.H.FALSE; 465 } 466 }, 467 "has_OnCustomDictionaryChanged": (): heap.Ref<boolean> => { 468 if ( 469 WEBEXT?.languageSettingsPrivate?.onCustomDictionaryChanged && 470 "addListener" in WEBEXT?.languageSettingsPrivate?.onCustomDictionaryChanged 471 ) { 472 return A.H.TRUE; 473 } 474 return A.H.FALSE; 475 }, 476 "func_OnCustomDictionaryChanged": (fn: Pointer): void => { 477 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.onCustomDictionaryChanged.addListener); 478 }, 479 "call_OnCustomDictionaryChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => { 480 const _ret = WEBEXT.languageSettingsPrivate.onCustomDictionaryChanged.addListener(A.H.get<object>(callback)); 481 }, 482 "try_OnCustomDictionaryChanged": ( 483 retPtr: Pointer, 484 errPtr: Pointer, 485 callback: heap.Ref<object> 486 ): heap.Ref<boolean> => { 487 try { 488 const _ret = WEBEXT.languageSettingsPrivate.onCustomDictionaryChanged.addListener(A.H.get<object>(callback)); 489 return A.H.TRUE; 490 } catch (err: any) { 491 A.store.Ref(errPtr, err); 492 return A.H.FALSE; 493 } 494 }, 495 "has_OffCustomDictionaryChanged": (): heap.Ref<boolean> => { 496 if ( 497 WEBEXT?.languageSettingsPrivate?.onCustomDictionaryChanged && 498 "removeListener" in WEBEXT?.languageSettingsPrivate?.onCustomDictionaryChanged 499 ) { 500 return A.H.TRUE; 501 } 502 return A.H.FALSE; 503 }, 504 "func_OffCustomDictionaryChanged": (fn: Pointer): void => { 505 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.onCustomDictionaryChanged.removeListener); 506 }, 507 "call_OffCustomDictionaryChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => { 508 const _ret = WEBEXT.languageSettingsPrivate.onCustomDictionaryChanged.removeListener(A.H.get<object>(callback)); 509 }, 510 "try_OffCustomDictionaryChanged": ( 511 retPtr: Pointer, 512 errPtr: Pointer, 513 callback: heap.Ref<object> 514 ): heap.Ref<boolean> => { 515 try { 516 const _ret = WEBEXT.languageSettingsPrivate.onCustomDictionaryChanged.removeListener(A.H.get<object>(callback)); 517 return A.H.TRUE; 518 } catch (err: any) { 519 A.store.Ref(errPtr, err); 520 return A.H.FALSE; 521 } 522 }, 523 "has_HasOnCustomDictionaryChanged": (): heap.Ref<boolean> => { 524 if ( 525 WEBEXT?.languageSettingsPrivate?.onCustomDictionaryChanged && 526 "hasListener" in WEBEXT?.languageSettingsPrivate?.onCustomDictionaryChanged 527 ) { 528 return A.H.TRUE; 529 } 530 return A.H.FALSE; 531 }, 532 "func_HasOnCustomDictionaryChanged": (fn: Pointer): void => { 533 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.onCustomDictionaryChanged.hasListener); 534 }, 535 "call_HasOnCustomDictionaryChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => { 536 const _ret = WEBEXT.languageSettingsPrivate.onCustomDictionaryChanged.hasListener(A.H.get<object>(callback)); 537 A.store.Bool(retPtr, _ret); 538 }, 539 "try_HasOnCustomDictionaryChanged": ( 540 retPtr: Pointer, 541 errPtr: Pointer, 542 callback: heap.Ref<object> 543 ): heap.Ref<boolean> => { 544 try { 545 const _ret = WEBEXT.languageSettingsPrivate.onCustomDictionaryChanged.hasListener(A.H.get<object>(callback)); 546 A.store.Bool(retPtr, _ret); 547 return A.H.TRUE; 548 } catch (err: any) { 549 A.store.Ref(errPtr, err); 550 return A.H.FALSE; 551 } 552 }, 553 "has_OnInputMethodAdded": (): heap.Ref<boolean> => { 554 if ( 555 WEBEXT?.languageSettingsPrivate?.onInputMethodAdded && 556 "addListener" in WEBEXT?.languageSettingsPrivate?.onInputMethodAdded 557 ) { 558 return A.H.TRUE; 559 } 560 return A.H.FALSE; 561 }, 562 "func_OnInputMethodAdded": (fn: Pointer): void => { 563 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.onInputMethodAdded.addListener); 564 }, 565 "call_OnInputMethodAdded": (retPtr: Pointer, callback: heap.Ref<object>): void => { 566 const _ret = WEBEXT.languageSettingsPrivate.onInputMethodAdded.addListener(A.H.get<object>(callback)); 567 }, 568 "try_OnInputMethodAdded": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 569 try { 570 const _ret = WEBEXT.languageSettingsPrivate.onInputMethodAdded.addListener(A.H.get<object>(callback)); 571 return A.H.TRUE; 572 } catch (err: any) { 573 A.store.Ref(errPtr, err); 574 return A.H.FALSE; 575 } 576 }, 577 "has_OffInputMethodAdded": (): heap.Ref<boolean> => { 578 if ( 579 WEBEXT?.languageSettingsPrivate?.onInputMethodAdded && 580 "removeListener" in WEBEXT?.languageSettingsPrivate?.onInputMethodAdded 581 ) { 582 return A.H.TRUE; 583 } 584 return A.H.FALSE; 585 }, 586 "func_OffInputMethodAdded": (fn: Pointer): void => { 587 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.onInputMethodAdded.removeListener); 588 }, 589 "call_OffInputMethodAdded": (retPtr: Pointer, callback: heap.Ref<object>): void => { 590 const _ret = WEBEXT.languageSettingsPrivate.onInputMethodAdded.removeListener(A.H.get<object>(callback)); 591 }, 592 "try_OffInputMethodAdded": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 593 try { 594 const _ret = WEBEXT.languageSettingsPrivate.onInputMethodAdded.removeListener(A.H.get<object>(callback)); 595 return A.H.TRUE; 596 } catch (err: any) { 597 A.store.Ref(errPtr, err); 598 return A.H.FALSE; 599 } 600 }, 601 "has_HasOnInputMethodAdded": (): heap.Ref<boolean> => { 602 if ( 603 WEBEXT?.languageSettingsPrivate?.onInputMethodAdded && 604 "hasListener" in WEBEXT?.languageSettingsPrivate?.onInputMethodAdded 605 ) { 606 return A.H.TRUE; 607 } 608 return A.H.FALSE; 609 }, 610 "func_HasOnInputMethodAdded": (fn: Pointer): void => { 611 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.onInputMethodAdded.hasListener); 612 }, 613 "call_HasOnInputMethodAdded": (retPtr: Pointer, callback: heap.Ref<object>): void => { 614 const _ret = WEBEXT.languageSettingsPrivate.onInputMethodAdded.hasListener(A.H.get<object>(callback)); 615 A.store.Bool(retPtr, _ret); 616 }, 617 "try_HasOnInputMethodAdded": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 618 try { 619 const _ret = WEBEXT.languageSettingsPrivate.onInputMethodAdded.hasListener(A.H.get<object>(callback)); 620 A.store.Bool(retPtr, _ret); 621 return A.H.TRUE; 622 } catch (err: any) { 623 A.store.Ref(errPtr, err); 624 return A.H.FALSE; 625 } 626 }, 627 "has_OnInputMethodRemoved": (): heap.Ref<boolean> => { 628 if ( 629 WEBEXT?.languageSettingsPrivate?.onInputMethodRemoved && 630 "addListener" in WEBEXT?.languageSettingsPrivate?.onInputMethodRemoved 631 ) { 632 return A.H.TRUE; 633 } 634 return A.H.FALSE; 635 }, 636 "func_OnInputMethodRemoved": (fn: Pointer): void => { 637 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.onInputMethodRemoved.addListener); 638 }, 639 "call_OnInputMethodRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => { 640 const _ret = WEBEXT.languageSettingsPrivate.onInputMethodRemoved.addListener(A.H.get<object>(callback)); 641 }, 642 "try_OnInputMethodRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 643 try { 644 const _ret = WEBEXT.languageSettingsPrivate.onInputMethodRemoved.addListener(A.H.get<object>(callback)); 645 return A.H.TRUE; 646 } catch (err: any) { 647 A.store.Ref(errPtr, err); 648 return A.H.FALSE; 649 } 650 }, 651 "has_OffInputMethodRemoved": (): heap.Ref<boolean> => { 652 if ( 653 WEBEXT?.languageSettingsPrivate?.onInputMethodRemoved && 654 "removeListener" in WEBEXT?.languageSettingsPrivate?.onInputMethodRemoved 655 ) { 656 return A.H.TRUE; 657 } 658 return A.H.FALSE; 659 }, 660 "func_OffInputMethodRemoved": (fn: Pointer): void => { 661 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.onInputMethodRemoved.removeListener); 662 }, 663 "call_OffInputMethodRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => { 664 const _ret = WEBEXT.languageSettingsPrivate.onInputMethodRemoved.removeListener(A.H.get<object>(callback)); 665 }, 666 "try_OffInputMethodRemoved": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 667 try { 668 const _ret = WEBEXT.languageSettingsPrivate.onInputMethodRemoved.removeListener(A.H.get<object>(callback)); 669 return A.H.TRUE; 670 } catch (err: any) { 671 A.store.Ref(errPtr, err); 672 return A.H.FALSE; 673 } 674 }, 675 "has_HasOnInputMethodRemoved": (): heap.Ref<boolean> => { 676 if ( 677 WEBEXT?.languageSettingsPrivate?.onInputMethodRemoved && 678 "hasListener" in WEBEXT?.languageSettingsPrivate?.onInputMethodRemoved 679 ) { 680 return A.H.TRUE; 681 } 682 return A.H.FALSE; 683 }, 684 "func_HasOnInputMethodRemoved": (fn: Pointer): void => { 685 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.onInputMethodRemoved.hasListener); 686 }, 687 "call_HasOnInputMethodRemoved": (retPtr: Pointer, callback: heap.Ref<object>): void => { 688 const _ret = WEBEXT.languageSettingsPrivate.onInputMethodRemoved.hasListener(A.H.get<object>(callback)); 689 A.store.Bool(retPtr, _ret); 690 }, 691 "try_HasOnInputMethodRemoved": ( 692 retPtr: Pointer, 693 errPtr: Pointer, 694 callback: heap.Ref<object> 695 ): heap.Ref<boolean> => { 696 try { 697 const _ret = WEBEXT.languageSettingsPrivate.onInputMethodRemoved.hasListener(A.H.get<object>(callback)); 698 A.store.Bool(retPtr, _ret); 699 return A.H.TRUE; 700 } catch (err: any) { 701 A.store.Ref(errPtr, err); 702 return A.H.FALSE; 703 } 704 }, 705 "has_OnSpellcheckDictionariesChanged": (): heap.Ref<boolean> => { 706 if ( 707 WEBEXT?.languageSettingsPrivate?.onSpellcheckDictionariesChanged && 708 "addListener" in WEBEXT?.languageSettingsPrivate?.onSpellcheckDictionariesChanged 709 ) { 710 return A.H.TRUE; 711 } 712 return A.H.FALSE; 713 }, 714 "func_OnSpellcheckDictionariesChanged": (fn: Pointer): void => { 715 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.onSpellcheckDictionariesChanged.addListener); 716 }, 717 "call_OnSpellcheckDictionariesChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => { 718 const _ret = WEBEXT.languageSettingsPrivate.onSpellcheckDictionariesChanged.addListener( 719 A.H.get<object>(callback) 720 ); 721 }, 722 "try_OnSpellcheckDictionariesChanged": ( 723 retPtr: Pointer, 724 errPtr: Pointer, 725 callback: heap.Ref<object> 726 ): heap.Ref<boolean> => { 727 try { 728 const _ret = WEBEXT.languageSettingsPrivate.onSpellcheckDictionariesChanged.addListener( 729 A.H.get<object>(callback) 730 ); 731 return A.H.TRUE; 732 } catch (err: any) { 733 A.store.Ref(errPtr, err); 734 return A.H.FALSE; 735 } 736 }, 737 "has_OffSpellcheckDictionariesChanged": (): heap.Ref<boolean> => { 738 if ( 739 WEBEXT?.languageSettingsPrivate?.onSpellcheckDictionariesChanged && 740 "removeListener" in WEBEXT?.languageSettingsPrivate?.onSpellcheckDictionariesChanged 741 ) { 742 return A.H.TRUE; 743 } 744 return A.H.FALSE; 745 }, 746 "func_OffSpellcheckDictionariesChanged": (fn: Pointer): void => { 747 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.onSpellcheckDictionariesChanged.removeListener); 748 }, 749 "call_OffSpellcheckDictionariesChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => { 750 const _ret = WEBEXT.languageSettingsPrivate.onSpellcheckDictionariesChanged.removeListener( 751 A.H.get<object>(callback) 752 ); 753 }, 754 "try_OffSpellcheckDictionariesChanged": ( 755 retPtr: Pointer, 756 errPtr: Pointer, 757 callback: heap.Ref<object> 758 ): heap.Ref<boolean> => { 759 try { 760 const _ret = WEBEXT.languageSettingsPrivate.onSpellcheckDictionariesChanged.removeListener( 761 A.H.get<object>(callback) 762 ); 763 return A.H.TRUE; 764 } catch (err: any) { 765 A.store.Ref(errPtr, err); 766 return A.H.FALSE; 767 } 768 }, 769 "has_HasOnSpellcheckDictionariesChanged": (): heap.Ref<boolean> => { 770 if ( 771 WEBEXT?.languageSettingsPrivate?.onSpellcheckDictionariesChanged && 772 "hasListener" in WEBEXT?.languageSettingsPrivate?.onSpellcheckDictionariesChanged 773 ) { 774 return A.H.TRUE; 775 } 776 return A.H.FALSE; 777 }, 778 "func_HasOnSpellcheckDictionariesChanged": (fn: Pointer): void => { 779 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.onSpellcheckDictionariesChanged.hasListener); 780 }, 781 "call_HasOnSpellcheckDictionariesChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => { 782 const _ret = WEBEXT.languageSettingsPrivate.onSpellcheckDictionariesChanged.hasListener( 783 A.H.get<object>(callback) 784 ); 785 A.store.Bool(retPtr, _ret); 786 }, 787 "try_HasOnSpellcheckDictionariesChanged": ( 788 retPtr: Pointer, 789 errPtr: Pointer, 790 callback: heap.Ref<object> 791 ): heap.Ref<boolean> => { 792 try { 793 const _ret = WEBEXT.languageSettingsPrivate.onSpellcheckDictionariesChanged.hasListener( 794 A.H.get<object>(callback) 795 ); 796 A.store.Bool(retPtr, _ret); 797 return A.H.TRUE; 798 } catch (err: any) { 799 A.store.Ref(errPtr, err); 800 return A.H.FALSE; 801 } 802 }, 803 "has_RemoveInputMethod": (): heap.Ref<boolean> => { 804 if (WEBEXT?.languageSettingsPrivate && "removeInputMethod" in WEBEXT?.languageSettingsPrivate) { 805 return A.H.TRUE; 806 } 807 return A.H.FALSE; 808 }, 809 "func_RemoveInputMethod": (fn: Pointer): void => { 810 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.removeInputMethod); 811 }, 812 "call_RemoveInputMethod": (retPtr: Pointer, inputMethodId: heap.Ref<object>): void => { 813 const _ret = WEBEXT.languageSettingsPrivate.removeInputMethod(A.H.get<object>(inputMethodId)); 814 }, 815 "try_RemoveInputMethod": (retPtr: Pointer, errPtr: Pointer, inputMethodId: heap.Ref<object>): heap.Ref<boolean> => { 816 try { 817 const _ret = WEBEXT.languageSettingsPrivate.removeInputMethod(A.H.get<object>(inputMethodId)); 818 return A.H.TRUE; 819 } catch (err: any) { 820 A.store.Ref(errPtr, err); 821 return A.H.FALSE; 822 } 823 }, 824 "has_RemoveSpellcheckWord": (): heap.Ref<boolean> => { 825 if (WEBEXT?.languageSettingsPrivate && "removeSpellcheckWord" in WEBEXT?.languageSettingsPrivate) { 826 return A.H.TRUE; 827 } 828 return A.H.FALSE; 829 }, 830 "func_RemoveSpellcheckWord": (fn: Pointer): void => { 831 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.removeSpellcheckWord); 832 }, 833 "call_RemoveSpellcheckWord": (retPtr: Pointer, word: heap.Ref<object>): void => { 834 const _ret = WEBEXT.languageSettingsPrivate.removeSpellcheckWord(A.H.get<object>(word)); 835 }, 836 "try_RemoveSpellcheckWord": (retPtr: Pointer, errPtr: Pointer, word: heap.Ref<object>): heap.Ref<boolean> => { 837 try { 838 const _ret = WEBEXT.languageSettingsPrivate.removeSpellcheckWord(A.H.get<object>(word)); 839 return A.H.TRUE; 840 } catch (err: any) { 841 A.store.Ref(errPtr, err); 842 return A.H.FALSE; 843 } 844 }, 845 "has_RetryDownloadDictionary": (): heap.Ref<boolean> => { 846 if (WEBEXT?.languageSettingsPrivate && "retryDownloadDictionary" in WEBEXT?.languageSettingsPrivate) { 847 return A.H.TRUE; 848 } 849 return A.H.FALSE; 850 }, 851 "func_RetryDownloadDictionary": (fn: Pointer): void => { 852 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.retryDownloadDictionary); 853 }, 854 "call_RetryDownloadDictionary": (retPtr: Pointer, languageCode: heap.Ref<object>): void => { 855 const _ret = WEBEXT.languageSettingsPrivate.retryDownloadDictionary(A.H.get<object>(languageCode)); 856 }, 857 "try_RetryDownloadDictionary": ( 858 retPtr: Pointer, 859 errPtr: Pointer, 860 languageCode: heap.Ref<object> 861 ): heap.Ref<boolean> => { 862 try { 863 const _ret = WEBEXT.languageSettingsPrivate.retryDownloadDictionary(A.H.get<object>(languageCode)); 864 return A.H.TRUE; 865 } catch (err: any) { 866 A.store.Ref(errPtr, err); 867 return A.H.FALSE; 868 } 869 }, 870 "has_SetEnableTranslationForLanguage": (): heap.Ref<boolean> => { 871 if (WEBEXT?.languageSettingsPrivate && "setEnableTranslationForLanguage" in WEBEXT?.languageSettingsPrivate) { 872 return A.H.TRUE; 873 } 874 return A.H.FALSE; 875 }, 876 "func_SetEnableTranslationForLanguage": (fn: Pointer): void => { 877 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.setEnableTranslationForLanguage); 878 }, 879 "call_SetEnableTranslationForLanguage": ( 880 retPtr: Pointer, 881 languageCode: heap.Ref<object>, 882 enable: heap.Ref<boolean> 883 ): void => { 884 const _ret = WEBEXT.languageSettingsPrivate.setEnableTranslationForLanguage( 885 A.H.get<object>(languageCode), 886 enable === A.H.TRUE 887 ); 888 }, 889 "try_SetEnableTranslationForLanguage": ( 890 retPtr: Pointer, 891 errPtr: Pointer, 892 languageCode: heap.Ref<object>, 893 enable: heap.Ref<boolean> 894 ): heap.Ref<boolean> => { 895 try { 896 const _ret = WEBEXT.languageSettingsPrivate.setEnableTranslationForLanguage( 897 A.H.get<object>(languageCode), 898 enable === A.H.TRUE 899 ); 900 return A.H.TRUE; 901 } catch (err: any) { 902 A.store.Ref(errPtr, err); 903 return A.H.FALSE; 904 } 905 }, 906 "has_SetLanguageAlwaysTranslateState": (): heap.Ref<boolean> => { 907 if (WEBEXT?.languageSettingsPrivate && "setLanguageAlwaysTranslateState" in WEBEXT?.languageSettingsPrivate) { 908 return A.H.TRUE; 909 } 910 return A.H.FALSE; 911 }, 912 "func_SetLanguageAlwaysTranslateState": (fn: Pointer): void => { 913 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.setLanguageAlwaysTranslateState); 914 }, 915 "call_SetLanguageAlwaysTranslateState": ( 916 retPtr: Pointer, 917 languageCode: heap.Ref<object>, 918 alwaysTranslate: heap.Ref<boolean> 919 ): void => { 920 const _ret = WEBEXT.languageSettingsPrivate.setLanguageAlwaysTranslateState( 921 A.H.get<object>(languageCode), 922 alwaysTranslate === A.H.TRUE 923 ); 924 }, 925 "try_SetLanguageAlwaysTranslateState": ( 926 retPtr: Pointer, 927 errPtr: Pointer, 928 languageCode: heap.Ref<object>, 929 alwaysTranslate: heap.Ref<boolean> 930 ): heap.Ref<boolean> => { 931 try { 932 const _ret = WEBEXT.languageSettingsPrivate.setLanguageAlwaysTranslateState( 933 A.H.get<object>(languageCode), 934 alwaysTranslate === A.H.TRUE 935 ); 936 return A.H.TRUE; 937 } catch (err: any) { 938 A.store.Ref(errPtr, err); 939 return A.H.FALSE; 940 } 941 }, 942 "has_SetTranslateTargetLanguage": (): heap.Ref<boolean> => { 943 if (WEBEXT?.languageSettingsPrivate && "setTranslateTargetLanguage" in WEBEXT?.languageSettingsPrivate) { 944 return A.H.TRUE; 945 } 946 return A.H.FALSE; 947 }, 948 "func_SetTranslateTargetLanguage": (fn: Pointer): void => { 949 A.store.Ref(fn, WEBEXT.languageSettingsPrivate.setTranslateTargetLanguage); 950 }, 951 "call_SetTranslateTargetLanguage": (retPtr: Pointer, languageCode: heap.Ref<object>): void => { 952 const _ret = WEBEXT.languageSettingsPrivate.setTranslateTargetLanguage(A.H.get<object>(languageCode)); 953 }, 954 "try_SetTranslateTargetLanguage": ( 955 retPtr: Pointer, 956 errPtr: Pointer, 957 languageCode: heap.Ref<object> 958 ): heap.Ref<boolean> => { 959 try { 960 const _ret = WEBEXT.languageSettingsPrivate.setTranslateTargetLanguage(A.H.get<object>(languageCode)); 961 return A.H.TRUE; 962 } catch (err: any) { 963 A.store.Ref(errPtr, err); 964 return A.H.FALSE; 965 } 966 }, 967 }; 968 });