github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/chromeos/diagnostics/bindings/ffi_bindings.ts (about) 1 import { importModule, Application, heap, Pointer } from "@ffi"; 2 3 importModule("plat/js/webext/chromeos/diagnostics", (A: Application) => { 4 const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser; 5 6 return { 7 "constof_AcPowerStatus": (ref: heap.Ref<string>): number => { 8 const idx = ["connected", "disconnected"].indexOf(A.H.get(ref)); 9 return idx < 0 ? 0 : idx + 1; 10 }, 11 12 "store_CancelRoutineRequest": (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 + 4, false); 17 A.store.Ref(ptr + 0, undefined); 18 } else { 19 A.store.Bool(ptr + 4, true); 20 A.store.Ref(ptr + 0, x["uuid"]); 21 } 22 }, 23 "load_CancelRoutineRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 24 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 25 26 x["uuid"] = A.load.Ref(ptr + 0, undefined); 27 return create === A.H.TRUE ? A.H.push(x) : ref; 28 }, 29 30 "store_CreateMemoryRoutineResponse": (ptr: Pointer, ref: heap.Ref<any>) => { 31 const x = A.H.get<any>(ref); 32 33 if (typeof x === "undefined") { 34 A.store.Bool(ptr + 4, false); 35 A.store.Ref(ptr + 0, undefined); 36 } else { 37 A.store.Bool(ptr + 4, true); 38 A.store.Ref(ptr + 0, x["uuid"]); 39 } 40 }, 41 "load_CreateMemoryRoutineResponse": ( 42 ptr: Pointer, 43 create: heap.Ref<boolean>, 44 ref: heap.Ref<any> 45 ): heap.Ref<any> => { 46 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 47 48 x["uuid"] = A.load.Ref(ptr + 0, undefined); 49 return create === A.H.TRUE ? A.H.push(x) : ref; 50 }, 51 "constof_DiskReadRoutineType": (ref: heap.Ref<string>): number => { 52 const idx = ["linear", "random"].indexOf(A.H.get(ref)); 53 return idx < 0 ? 0 : idx + 1; 54 }, 55 "constof_ExceptionReason": (ref: heap.Ref<string>): number => { 56 const idx = ["unknown", "unexpected", "unsupported", "app_ui_closed"].indexOf(A.H.get(ref)); 57 return idx < 0 ? 0 : idx + 1; 58 }, 59 60 "store_ExceptionInfo": (ptr: Pointer, ref: heap.Ref<any>) => { 61 const x = A.H.get<any>(ref); 62 63 if (typeof x === "undefined") { 64 A.store.Bool(ptr + 12, false); 65 A.store.Ref(ptr + 0, undefined); 66 A.store.Enum(ptr + 4, -1); 67 A.store.Ref(ptr + 8, undefined); 68 } else { 69 A.store.Bool(ptr + 12, true); 70 A.store.Ref(ptr + 0, x["uuid"]); 71 A.store.Enum(ptr + 4, ["unknown", "unexpected", "unsupported", "app_ui_closed"].indexOf(x["reason"] as string)); 72 A.store.Ref(ptr + 8, x["debugMessage"]); 73 } 74 }, 75 "load_ExceptionInfo": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 76 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 77 78 x["uuid"] = A.load.Ref(ptr + 0, undefined); 79 x["reason"] = A.load.Enum(ptr + 4, ["unknown", "unexpected", "unsupported", "app_ui_closed"]); 80 x["debugMessage"] = A.load.Ref(ptr + 8, undefined); 81 return create === A.H.TRUE ? A.H.push(x) : ref; 82 }, 83 "constof_RoutineType": (ref: heap.Ref<string>): number => { 84 const idx = [ 85 "ac_power", 86 "battery_capacity", 87 "battery_charge", 88 "battery_discharge", 89 "battery_health", 90 "cpu_cache", 91 "cpu_floating_point_accuracy", 92 "cpu_prime_search", 93 "cpu_stress", 94 "disk_read", 95 "dns_resolution", 96 "memory", 97 "nvme_wear_level", 98 "smartctl_check", 99 "lan_connectivity", 100 "signal_strength", 101 "dns_resolver_present", 102 "gateway_can_be_pinged", 103 "sensitive_sensor", 104 "nvme_self_test", 105 "fingerprint_alive", 106 "smartctl_check_with_percentage_used", 107 "emmc_lifetime", 108 "bluetooth_power", 109 "ufs_lifetime", 110 "power_button", 111 "audio_driver", 112 "bluetooth_discovery", 113 "bluetooth_scanning", 114 "bluetooth_pairing", 115 ].indexOf(A.H.get(ref)); 116 return idx < 0 ? 0 : idx + 1; 117 }, 118 119 "store_GetAvailableRoutinesResponse": (ptr: Pointer, ref: heap.Ref<any>) => { 120 const x = A.H.get<any>(ref); 121 122 if (typeof x === "undefined") { 123 A.store.Bool(ptr + 4, false); 124 A.store.Ref(ptr + 0, undefined); 125 } else { 126 A.store.Bool(ptr + 4, true); 127 A.store.Ref(ptr + 0, x["routines"]); 128 } 129 }, 130 "load_GetAvailableRoutinesResponse": ( 131 ptr: Pointer, 132 create: heap.Ref<boolean>, 133 ref: heap.Ref<any> 134 ): heap.Ref<any> => { 135 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 136 137 x["routines"] = A.load.Ref(ptr + 0, undefined); 138 return create === A.H.TRUE ? A.H.push(x) : ref; 139 }, 140 "constof_RoutineStatus": (ref: heap.Ref<string>): number => { 141 const idx = [ 142 "unknown", 143 "ready", 144 "running", 145 "waiting_user_action", 146 "passed", 147 "failed", 148 "error", 149 "cancelled", 150 "failed_to_start", 151 "removed", 152 "cancelling", 153 "unsupported", 154 "not_run", 155 ].indexOf(A.H.get(ref)); 156 return idx < 0 ? 0 : idx + 1; 157 }, 158 "constof_UserMessageType": (ref: heap.Ref<string>): number => { 159 const idx = ["unknown", "unplug_ac_power", "plug_in_ac_power", "press_power_button"].indexOf(A.H.get(ref)); 160 return idx < 0 ? 0 : idx + 1; 161 }, 162 163 "store_GetRoutineUpdateResponse": (ptr: Pointer, ref: heap.Ref<any>) => { 164 const x = A.H.get<any>(ref); 165 166 if (typeof x === "undefined") { 167 A.store.Bool(ptr + 21, false); 168 A.store.Bool(ptr + 20, false); 169 A.store.Int32(ptr + 0, 0); 170 A.store.Ref(ptr + 4, undefined); 171 A.store.Enum(ptr + 8, -1); 172 A.store.Ref(ptr + 12, undefined); 173 A.store.Enum(ptr + 16, -1); 174 } else { 175 A.store.Bool(ptr + 21, true); 176 A.store.Bool(ptr + 20, "progress_percent" in x ? true : false); 177 A.store.Int32(ptr + 0, x["progress_percent"] === undefined ? 0 : (x["progress_percent"] as number)); 178 A.store.Ref(ptr + 4, x["output"]); 179 A.store.Enum( 180 ptr + 8, 181 [ 182 "unknown", 183 "ready", 184 "running", 185 "waiting_user_action", 186 "passed", 187 "failed", 188 "error", 189 "cancelled", 190 "failed_to_start", 191 "removed", 192 "cancelling", 193 "unsupported", 194 "not_run", 195 ].indexOf(x["status"] as string) 196 ); 197 A.store.Ref(ptr + 12, x["status_message"]); 198 A.store.Enum( 199 ptr + 16, 200 ["unknown", "unplug_ac_power", "plug_in_ac_power", "press_power_button"].indexOf(x["user_message"] as string) 201 ); 202 } 203 }, 204 "load_GetRoutineUpdateResponse": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 205 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 206 207 if (A.load.Bool(ptr + 20)) { 208 x["progress_percent"] = A.load.Int32(ptr + 0); 209 } else { 210 delete x["progress_percent"]; 211 } 212 x["output"] = A.load.Ref(ptr + 4, undefined); 213 x["status"] = A.load.Enum(ptr + 8, [ 214 "unknown", 215 "ready", 216 "running", 217 "waiting_user_action", 218 "passed", 219 "failed", 220 "error", 221 "cancelled", 222 "failed_to_start", 223 "removed", 224 "cancelling", 225 "unsupported", 226 "not_run", 227 ]); 228 x["status_message"] = A.load.Ref(ptr + 12, undefined); 229 x["user_message"] = A.load.Enum(ptr + 16, [ 230 "unknown", 231 "unplug_ac_power", 232 "plug_in_ac_power", 233 "press_power_button", 234 ]); 235 return create === A.H.TRUE ? A.H.push(x) : ref; 236 }, 237 "constof_RoutineCommandType": (ref: heap.Ref<string>): number => { 238 const idx = ["cancel", "remove", "resume", "status"].indexOf(A.H.get(ref)); 239 return idx < 0 ? 0 : idx + 1; 240 }, 241 242 "store_GetRoutineUpdateRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 243 const x = A.H.get<any>(ref); 244 245 if (typeof x === "undefined") { 246 A.store.Bool(ptr + 9, false); 247 A.store.Bool(ptr + 8, false); 248 A.store.Int32(ptr + 0, 0); 249 A.store.Enum(ptr + 4, -1); 250 } else { 251 A.store.Bool(ptr + 9, true); 252 A.store.Bool(ptr + 8, "id" in x ? true : false); 253 A.store.Int32(ptr + 0, x["id"] === undefined ? 0 : (x["id"] as number)); 254 A.store.Enum(ptr + 4, ["cancel", "remove", "resume", "status"].indexOf(x["command"] as string)); 255 } 256 }, 257 "load_GetRoutineUpdateRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 258 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 259 260 if (A.load.Bool(ptr + 8)) { 261 x["id"] = A.load.Int32(ptr + 0); 262 } else { 263 delete x["id"]; 264 } 265 x["command"] = A.load.Enum(ptr + 4, ["cancel", "remove", "resume", "status"]); 266 return create === A.H.TRUE ? A.H.push(x) : ref; 267 }, 268 "constof_MemtesterTestItemEnum": (ref: heap.Ref<string>): number => { 269 const idx = [ 270 "unknown", 271 "stuck_address", 272 "compare_and", 273 "compare_div", 274 "compare_mul", 275 "compare_or", 276 "compare_sub", 277 "compare_xor", 278 "sequential_increment", 279 "bit_flip", 280 "bit_spread", 281 "block_sequential", 282 "checkerboard", 283 "random_value", 284 "solid_bits", 285 "walking_ones", 286 "walking_zeroes", 287 "eight_bit_writes", 288 "sixteen_bit_writes", 289 ].indexOf(A.H.get(ref)); 290 return idx < 0 ? 0 : idx + 1; 291 }, 292 293 "store_MemtesterResult": (ptr: Pointer, ref: heap.Ref<any>) => { 294 const x = A.H.get<any>(ref); 295 296 if (typeof x === "undefined") { 297 A.store.Bool(ptr + 8, false); 298 A.store.Ref(ptr + 0, undefined); 299 A.store.Ref(ptr + 4, undefined); 300 } else { 301 A.store.Bool(ptr + 8, true); 302 A.store.Ref(ptr + 0, x["passed_items"]); 303 A.store.Ref(ptr + 4, x["failed_items"]); 304 } 305 }, 306 "load_MemtesterResult": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 307 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 308 309 x["passed_items"] = A.load.Ref(ptr + 0, undefined); 310 x["failed_items"] = A.load.Ref(ptr + 4, undefined); 311 return create === A.H.TRUE ? A.H.push(x) : ref; 312 }, 313 314 "store_MemoryRoutineFinishedInfo": (ptr: Pointer, ref: heap.Ref<any>) => { 315 const x = A.H.get<any>(ref); 316 317 if (typeof x === "undefined") { 318 A.store.Bool(ptr + 27, false); 319 A.store.Ref(ptr + 0, undefined); 320 A.store.Bool(ptr + 25, false); 321 A.store.Bool(ptr + 4, false); 322 A.store.Bool(ptr + 26, false); 323 A.store.Float64(ptr + 8, 0); 324 325 A.store.Bool(ptr + 16 + 8, false); 326 A.store.Ref(ptr + 16 + 0, undefined); 327 A.store.Ref(ptr + 16 + 4, undefined); 328 } else { 329 A.store.Bool(ptr + 27, true); 330 A.store.Ref(ptr + 0, x["uuid"]); 331 A.store.Bool(ptr + 25, "has_passed" in x ? true : false); 332 A.store.Bool(ptr + 4, x["has_passed"] ? true : false); 333 A.store.Bool(ptr + 26, "bytesTested" in x ? true : false); 334 A.store.Float64(ptr + 8, x["bytesTested"] === undefined ? 0 : (x["bytesTested"] as number)); 335 336 if (typeof x["result"] === "undefined") { 337 A.store.Bool(ptr + 16 + 8, false); 338 A.store.Ref(ptr + 16 + 0, undefined); 339 A.store.Ref(ptr + 16 + 4, undefined); 340 } else { 341 A.store.Bool(ptr + 16 + 8, true); 342 A.store.Ref(ptr + 16 + 0, x["result"]["passed_items"]); 343 A.store.Ref(ptr + 16 + 4, x["result"]["failed_items"]); 344 } 345 } 346 }, 347 "load_MemoryRoutineFinishedInfo": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 348 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 349 350 x["uuid"] = A.load.Ref(ptr + 0, undefined); 351 if (A.load.Bool(ptr + 25)) { 352 x["has_passed"] = A.load.Bool(ptr + 4); 353 } else { 354 delete x["has_passed"]; 355 } 356 if (A.load.Bool(ptr + 26)) { 357 x["bytesTested"] = A.load.Float64(ptr + 8); 358 } else { 359 delete x["bytesTested"]; 360 } 361 if (A.load.Bool(ptr + 16 + 8)) { 362 x["result"] = {}; 363 x["result"]["passed_items"] = A.load.Ref(ptr + 16 + 0, undefined); 364 x["result"]["failed_items"] = A.load.Ref(ptr + 16 + 4, undefined); 365 } else { 366 delete x["result"]; 367 } 368 return create === A.H.TRUE ? A.H.push(x) : ref; 369 }, 370 "constof_NvmeSelfTestType": (ref: heap.Ref<string>): number => { 371 const idx = ["short_test", "long_test"].indexOf(A.H.get(ref)); 372 return idx < 0 ? 0 : idx + 1; 373 }, 374 375 "store_RoutineInitializedInfo": (ptr: Pointer, ref: heap.Ref<any>) => { 376 const x = A.H.get<any>(ref); 377 378 if (typeof x === "undefined") { 379 A.store.Bool(ptr + 4, false); 380 A.store.Ref(ptr + 0, undefined); 381 } else { 382 A.store.Bool(ptr + 4, true); 383 A.store.Ref(ptr + 0, x["uuid"]); 384 } 385 }, 386 "load_RoutineInitializedInfo": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 387 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 388 389 x["uuid"] = A.load.Ref(ptr + 0, undefined); 390 return create === A.H.TRUE ? A.H.push(x) : ref; 391 }, 392 393 "store_RoutineRunningInfo": (ptr: Pointer, ref: heap.Ref<any>) => { 394 const x = A.H.get<any>(ref); 395 396 if (typeof x === "undefined") { 397 A.store.Bool(ptr + 9, false); 398 A.store.Ref(ptr + 0, undefined); 399 A.store.Bool(ptr + 8, false); 400 A.store.Int32(ptr + 4, 0); 401 } else { 402 A.store.Bool(ptr + 9, true); 403 A.store.Ref(ptr + 0, x["uuid"]); 404 A.store.Bool(ptr + 8, "percentage" in x ? true : false); 405 A.store.Int32(ptr + 4, x["percentage"] === undefined ? 0 : (x["percentage"] as number)); 406 } 407 }, 408 "load_RoutineRunningInfo": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 409 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 410 411 x["uuid"] = A.load.Ref(ptr + 0, undefined); 412 if (A.load.Bool(ptr + 8)) { 413 x["percentage"] = A.load.Int32(ptr + 4); 414 } else { 415 delete x["percentage"]; 416 } 417 return create === A.H.TRUE ? A.H.push(x) : ref; 418 }, 419 "constof_RoutineSupportStatus": (ref: heap.Ref<string>): number => { 420 const idx = ["supported", "unsupported"].indexOf(A.H.get(ref)); 421 return idx < 0 ? 0 : idx + 1; 422 }, 423 424 "store_RoutineSupportStatusInfo": (ptr: Pointer, ref: heap.Ref<any>) => { 425 const x = A.H.get<any>(ref); 426 427 if (typeof x === "undefined") { 428 A.store.Bool(ptr + 4, false); 429 A.store.Enum(ptr + 0, -1); 430 } else { 431 A.store.Bool(ptr + 4, true); 432 A.store.Enum(ptr + 0, ["supported", "unsupported"].indexOf(x["status"] as string)); 433 } 434 }, 435 "load_RoutineSupportStatusInfo": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 436 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 437 438 x["status"] = A.load.Enum(ptr + 0, ["supported", "unsupported"]); 439 return create === A.H.TRUE ? A.H.push(x) : ref; 440 }, 441 "constof_RoutineWaitingReason": (ref: heap.Ref<string>): number => { 442 const idx = ["waiting_to_be_scheduled", "waiting_user_input"].indexOf(A.H.get(ref)); 443 return idx < 0 ? 0 : idx + 1; 444 }, 445 446 "store_RoutineWaitingInfo": (ptr: Pointer, ref: heap.Ref<any>) => { 447 const x = A.H.get<any>(ref); 448 449 if (typeof x === "undefined") { 450 A.store.Bool(ptr + 17, false); 451 A.store.Ref(ptr + 0, undefined); 452 A.store.Bool(ptr + 16, false); 453 A.store.Int32(ptr + 4, 0); 454 A.store.Enum(ptr + 8, -1); 455 A.store.Ref(ptr + 12, undefined); 456 } else { 457 A.store.Bool(ptr + 17, true); 458 A.store.Ref(ptr + 0, x["uuid"]); 459 A.store.Bool(ptr + 16, "percentage" in x ? true : false); 460 A.store.Int32(ptr + 4, x["percentage"] === undefined ? 0 : (x["percentage"] as number)); 461 A.store.Enum(ptr + 8, ["waiting_to_be_scheduled", "waiting_user_input"].indexOf(x["reason"] as string)); 462 A.store.Ref(ptr + 12, x["message"]); 463 } 464 }, 465 "load_RoutineWaitingInfo": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 466 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 467 468 x["uuid"] = A.load.Ref(ptr + 0, undefined); 469 if (A.load.Bool(ptr + 16)) { 470 x["percentage"] = A.load.Int32(ptr + 4); 471 } else { 472 delete x["percentage"]; 473 } 474 x["reason"] = A.load.Enum(ptr + 8, ["waiting_to_be_scheduled", "waiting_user_input"]); 475 x["message"] = A.load.Ref(ptr + 12, undefined); 476 return create === A.H.TRUE ? A.H.push(x) : ref; 477 }, 478 479 "store_RunAcPowerRoutineRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 480 const x = A.H.get<any>(ref); 481 482 if (typeof x === "undefined") { 483 A.store.Bool(ptr + 8, false); 484 A.store.Enum(ptr + 0, -1); 485 A.store.Ref(ptr + 4, undefined); 486 } else { 487 A.store.Bool(ptr + 8, true); 488 A.store.Enum(ptr + 0, ["connected", "disconnected"].indexOf(x["expected_status"] as string)); 489 A.store.Ref(ptr + 4, x["expected_power_type"]); 490 } 491 }, 492 "load_RunAcPowerRoutineRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 493 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 494 495 x["expected_status"] = A.load.Enum(ptr + 0, ["connected", "disconnected"]); 496 x["expected_power_type"] = A.load.Ref(ptr + 4, undefined); 497 return create === A.H.TRUE ? A.H.push(x) : ref; 498 }, 499 500 "store_RunBatteryChargeRoutineRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 501 const x = A.H.get<any>(ref); 502 503 if (typeof x === "undefined") { 504 A.store.Bool(ptr + 10, false); 505 A.store.Bool(ptr + 8, false); 506 A.store.Int32(ptr + 0, 0); 507 A.store.Bool(ptr + 9, false); 508 A.store.Int32(ptr + 4, 0); 509 } else { 510 A.store.Bool(ptr + 10, true); 511 A.store.Bool(ptr + 8, "length_seconds" in x ? true : false); 512 A.store.Int32(ptr + 0, x["length_seconds"] === undefined ? 0 : (x["length_seconds"] as number)); 513 A.store.Bool(ptr + 9, "minimum_charge_percent_required" in x ? true : false); 514 A.store.Int32( 515 ptr + 4, 516 x["minimum_charge_percent_required"] === undefined ? 0 : (x["minimum_charge_percent_required"] as number) 517 ); 518 } 519 }, 520 "load_RunBatteryChargeRoutineRequest": ( 521 ptr: Pointer, 522 create: heap.Ref<boolean>, 523 ref: heap.Ref<any> 524 ): heap.Ref<any> => { 525 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 526 527 if (A.load.Bool(ptr + 8)) { 528 x["length_seconds"] = A.load.Int32(ptr + 0); 529 } else { 530 delete x["length_seconds"]; 531 } 532 if (A.load.Bool(ptr + 9)) { 533 x["minimum_charge_percent_required"] = A.load.Int32(ptr + 4); 534 } else { 535 delete x["minimum_charge_percent_required"]; 536 } 537 return create === A.H.TRUE ? A.H.push(x) : ref; 538 }, 539 540 "store_RunBatteryDischargeRoutineRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 541 const x = A.H.get<any>(ref); 542 543 if (typeof x === "undefined") { 544 A.store.Bool(ptr + 10, false); 545 A.store.Bool(ptr + 8, false); 546 A.store.Int32(ptr + 0, 0); 547 A.store.Bool(ptr + 9, false); 548 A.store.Int32(ptr + 4, 0); 549 } else { 550 A.store.Bool(ptr + 10, true); 551 A.store.Bool(ptr + 8, "length_seconds" in x ? true : false); 552 A.store.Int32(ptr + 0, x["length_seconds"] === undefined ? 0 : (x["length_seconds"] as number)); 553 A.store.Bool(ptr + 9, "maximum_discharge_percent_allowed" in x ? true : false); 554 A.store.Int32( 555 ptr + 4, 556 x["maximum_discharge_percent_allowed"] === undefined ? 0 : (x["maximum_discharge_percent_allowed"] as number) 557 ); 558 } 559 }, 560 "load_RunBatteryDischargeRoutineRequest": ( 561 ptr: Pointer, 562 create: heap.Ref<boolean>, 563 ref: heap.Ref<any> 564 ): heap.Ref<any> => { 565 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 566 567 if (A.load.Bool(ptr + 8)) { 568 x["length_seconds"] = A.load.Int32(ptr + 0); 569 } else { 570 delete x["length_seconds"]; 571 } 572 if (A.load.Bool(ptr + 9)) { 573 x["maximum_discharge_percent_allowed"] = A.load.Int32(ptr + 4); 574 } else { 575 delete x["maximum_discharge_percent_allowed"]; 576 } 577 return create === A.H.TRUE ? A.H.push(x) : ref; 578 }, 579 580 "store_RunBluetoothPairingRoutineRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 581 const x = A.H.get<any>(ref); 582 583 if (typeof x === "undefined") { 584 A.store.Bool(ptr + 4, false); 585 A.store.Ref(ptr + 0, undefined); 586 } else { 587 A.store.Bool(ptr + 4, true); 588 A.store.Ref(ptr + 0, x["peripheral_id"]); 589 } 590 }, 591 "load_RunBluetoothPairingRoutineRequest": ( 592 ptr: Pointer, 593 create: heap.Ref<boolean>, 594 ref: heap.Ref<any> 595 ): heap.Ref<any> => { 596 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 597 598 x["peripheral_id"] = A.load.Ref(ptr + 0, undefined); 599 return create === A.H.TRUE ? A.H.push(x) : ref; 600 }, 601 602 "store_RunBluetoothScanningRoutineRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 603 const x = A.H.get<any>(ref); 604 605 if (typeof x === "undefined") { 606 A.store.Bool(ptr + 5, false); 607 A.store.Bool(ptr + 4, false); 608 A.store.Int32(ptr + 0, 0); 609 } else { 610 A.store.Bool(ptr + 5, true); 611 A.store.Bool(ptr + 4, "length_seconds" in x ? true : false); 612 A.store.Int32(ptr + 0, x["length_seconds"] === undefined ? 0 : (x["length_seconds"] as number)); 613 } 614 }, 615 "load_RunBluetoothScanningRoutineRequest": ( 616 ptr: Pointer, 617 create: heap.Ref<boolean>, 618 ref: heap.Ref<any> 619 ): heap.Ref<any> => { 620 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 621 622 if (A.load.Bool(ptr + 4)) { 623 x["length_seconds"] = A.load.Int32(ptr + 0); 624 } else { 625 delete x["length_seconds"]; 626 } 627 return create === A.H.TRUE ? A.H.push(x) : ref; 628 }, 629 630 "store_RunCpuRoutineRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 631 const x = A.H.get<any>(ref); 632 633 if (typeof x === "undefined") { 634 A.store.Bool(ptr + 5, false); 635 A.store.Bool(ptr + 4, false); 636 A.store.Int32(ptr + 0, 0); 637 } else { 638 A.store.Bool(ptr + 5, true); 639 A.store.Bool(ptr + 4, "length_seconds" in x ? true : false); 640 A.store.Int32(ptr + 0, x["length_seconds"] === undefined ? 0 : (x["length_seconds"] as number)); 641 } 642 }, 643 "load_RunCpuRoutineRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 644 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 645 646 if (A.load.Bool(ptr + 4)) { 647 x["length_seconds"] = A.load.Int32(ptr + 0); 648 } else { 649 delete x["length_seconds"]; 650 } 651 return create === A.H.TRUE ? A.H.push(x) : ref; 652 }, 653 654 "store_RunDiskReadRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 655 const x = A.H.get<any>(ref); 656 657 if (typeof x === "undefined") { 658 A.store.Bool(ptr + 14, false); 659 A.store.Enum(ptr + 0, -1); 660 A.store.Bool(ptr + 12, false); 661 A.store.Int32(ptr + 4, 0); 662 A.store.Bool(ptr + 13, false); 663 A.store.Int32(ptr + 8, 0); 664 } else { 665 A.store.Bool(ptr + 14, true); 666 A.store.Enum(ptr + 0, ["linear", "random"].indexOf(x["type"] as string)); 667 A.store.Bool(ptr + 12, "length_seconds" in x ? true : false); 668 A.store.Int32(ptr + 4, x["length_seconds"] === undefined ? 0 : (x["length_seconds"] as number)); 669 A.store.Bool(ptr + 13, "file_size_mb" in x ? true : false); 670 A.store.Int32(ptr + 8, x["file_size_mb"] === undefined ? 0 : (x["file_size_mb"] as number)); 671 } 672 }, 673 "load_RunDiskReadRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 674 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 675 676 x["type"] = A.load.Enum(ptr + 0, ["linear", "random"]); 677 if (A.load.Bool(ptr + 12)) { 678 x["length_seconds"] = A.load.Int32(ptr + 4); 679 } else { 680 delete x["length_seconds"]; 681 } 682 if (A.load.Bool(ptr + 13)) { 683 x["file_size_mb"] = A.load.Int32(ptr + 8); 684 } else { 685 delete x["file_size_mb"]; 686 } 687 return create === A.H.TRUE ? A.H.push(x) : ref; 688 }, 689 690 "store_RunMemoryRoutineArguments": (ptr: Pointer, ref: heap.Ref<any>) => { 691 const x = A.H.get<any>(ref); 692 693 if (typeof x === "undefined") { 694 A.store.Bool(ptr + 5, false); 695 A.store.Bool(ptr + 4, false); 696 A.store.Int32(ptr + 0, 0); 697 } else { 698 A.store.Bool(ptr + 5, true); 699 A.store.Bool(ptr + 4, "maxTestingMemKib" in x ? true : false); 700 A.store.Int32(ptr + 0, x["maxTestingMemKib"] === undefined ? 0 : (x["maxTestingMemKib"] as number)); 701 } 702 }, 703 "load_RunMemoryRoutineArguments": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 704 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 705 706 if (A.load.Bool(ptr + 4)) { 707 x["maxTestingMemKib"] = A.load.Int32(ptr + 0); 708 } else { 709 delete x["maxTestingMemKib"]; 710 } 711 return create === A.H.TRUE ? A.H.push(x) : ref; 712 }, 713 714 "store_RunNvmeSelfTestRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 715 const x = A.H.get<any>(ref); 716 717 if (typeof x === "undefined") { 718 A.store.Bool(ptr + 4, false); 719 A.store.Enum(ptr + 0, -1); 720 } else { 721 A.store.Bool(ptr + 4, true); 722 A.store.Enum(ptr + 0, ["short_test", "long_test"].indexOf(x["test_type"] as string)); 723 } 724 }, 725 "load_RunNvmeSelfTestRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 726 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 727 728 x["test_type"] = A.load.Enum(ptr + 0, ["short_test", "long_test"]); 729 return create === A.H.TRUE ? A.H.push(x) : ref; 730 }, 731 732 "store_RunNvmeWearLevelRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 733 const x = A.H.get<any>(ref); 734 735 if (typeof x === "undefined") { 736 A.store.Bool(ptr + 5, false); 737 A.store.Bool(ptr + 4, false); 738 A.store.Int32(ptr + 0, 0); 739 } else { 740 A.store.Bool(ptr + 5, true); 741 A.store.Bool(ptr + 4, "wear_level_threshold" in x ? true : false); 742 A.store.Int32(ptr + 0, x["wear_level_threshold"] === undefined ? 0 : (x["wear_level_threshold"] as number)); 743 } 744 }, 745 "load_RunNvmeWearLevelRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 746 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 747 748 if (A.load.Bool(ptr + 4)) { 749 x["wear_level_threshold"] = A.load.Int32(ptr + 0); 750 } else { 751 delete x["wear_level_threshold"]; 752 } 753 return create === A.H.TRUE ? A.H.push(x) : ref; 754 }, 755 756 "store_RunPowerButtonRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 757 const x = A.H.get<any>(ref); 758 759 if (typeof x === "undefined") { 760 A.store.Bool(ptr + 5, false); 761 A.store.Bool(ptr + 4, false); 762 A.store.Int32(ptr + 0, 0); 763 } else { 764 A.store.Bool(ptr + 5, true); 765 A.store.Bool(ptr + 4, "timeout_seconds" in x ? true : false); 766 A.store.Int32(ptr + 0, x["timeout_seconds"] === undefined ? 0 : (x["timeout_seconds"] as number)); 767 } 768 }, 769 "load_RunPowerButtonRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 770 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 771 772 if (A.load.Bool(ptr + 4)) { 773 x["timeout_seconds"] = A.load.Int32(ptr + 0); 774 } else { 775 delete x["timeout_seconds"]; 776 } 777 return create === A.H.TRUE ? A.H.push(x) : ref; 778 }, 779 780 "store_RunRoutineResponse": (ptr: Pointer, ref: heap.Ref<any>) => { 781 const x = A.H.get<any>(ref); 782 783 if (typeof x === "undefined") { 784 A.store.Bool(ptr + 9, false); 785 A.store.Bool(ptr + 8, false); 786 A.store.Int32(ptr + 0, 0); 787 A.store.Enum(ptr + 4, -1); 788 } else { 789 A.store.Bool(ptr + 9, true); 790 A.store.Bool(ptr + 8, "id" in x ? true : false); 791 A.store.Int32(ptr + 0, x["id"] === undefined ? 0 : (x["id"] as number)); 792 A.store.Enum( 793 ptr + 4, 794 [ 795 "unknown", 796 "ready", 797 "running", 798 "waiting_user_action", 799 "passed", 800 "failed", 801 "error", 802 "cancelled", 803 "failed_to_start", 804 "removed", 805 "cancelling", 806 "unsupported", 807 "not_run", 808 ].indexOf(x["status"] as string) 809 ); 810 } 811 }, 812 "load_RunRoutineResponse": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 813 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 814 815 if (A.load.Bool(ptr + 8)) { 816 x["id"] = A.load.Int32(ptr + 0); 817 } else { 818 delete x["id"]; 819 } 820 x["status"] = A.load.Enum(ptr + 4, [ 821 "unknown", 822 "ready", 823 "running", 824 "waiting_user_action", 825 "passed", 826 "failed", 827 "error", 828 "cancelled", 829 "failed_to_start", 830 "removed", 831 "cancelling", 832 "unsupported", 833 "not_run", 834 ]); 835 return create === A.H.TRUE ? A.H.push(x) : ref; 836 }, 837 838 "store_RunSmartctlCheckRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 839 const x = A.H.get<any>(ref); 840 841 if (typeof x === "undefined") { 842 A.store.Bool(ptr + 5, false); 843 A.store.Bool(ptr + 4, false); 844 A.store.Int32(ptr + 0, 0); 845 } else { 846 A.store.Bool(ptr + 5, true); 847 A.store.Bool(ptr + 4, "percentage_used_threshold" in x ? true : false); 848 A.store.Int32( 849 ptr + 0, 850 x["percentage_used_threshold"] === undefined ? 0 : (x["percentage_used_threshold"] as number) 851 ); 852 } 853 }, 854 "load_RunSmartctlCheckRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 855 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 856 857 if (A.load.Bool(ptr + 4)) { 858 x["percentage_used_threshold"] = A.load.Int32(ptr + 0); 859 } else { 860 delete x["percentage_used_threshold"]; 861 } 862 return create === A.H.TRUE ? A.H.push(x) : ref; 863 }, 864 865 "store_StartRoutineRequest": (ptr: Pointer, ref: heap.Ref<any>) => { 866 const x = A.H.get<any>(ref); 867 868 if (typeof x === "undefined") { 869 A.store.Bool(ptr + 4, false); 870 A.store.Ref(ptr + 0, undefined); 871 } else { 872 A.store.Bool(ptr + 4, true); 873 A.store.Ref(ptr + 0, x["uuid"]); 874 } 875 }, 876 "load_StartRoutineRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 877 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 878 879 x["uuid"] = A.load.Ref(ptr + 0, undefined); 880 return create === A.H.TRUE ? A.H.push(x) : ref; 881 }, 882 "has_CancelRoutine": (): heap.Ref<boolean> => { 883 if (WEBEXT?.os?.diagnostics && "cancelRoutine" in WEBEXT?.os?.diagnostics) { 884 return A.H.TRUE; 885 } 886 return A.H.FALSE; 887 }, 888 "func_CancelRoutine": (fn: Pointer): void => { 889 A.store.Ref(fn, WEBEXT.os.diagnostics.cancelRoutine); 890 }, 891 "call_CancelRoutine": (retPtr: Pointer, request: Pointer): void => { 892 const request_ffi = {}; 893 894 request_ffi["uuid"] = A.load.Ref(request + 0, undefined); 895 896 const _ret = WEBEXT.os.diagnostics.cancelRoutine(request_ffi); 897 A.store.Ref(retPtr, _ret); 898 }, 899 "try_CancelRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 900 try { 901 const request_ffi = {}; 902 903 request_ffi["uuid"] = A.load.Ref(request + 0, undefined); 904 905 const _ret = WEBEXT.os.diagnostics.cancelRoutine(request_ffi); 906 A.store.Ref(retPtr, _ret); 907 return A.H.TRUE; 908 } catch (err: any) { 909 A.store.Ref(errPtr, err); 910 return A.H.FALSE; 911 } 912 }, 913 "has_CreateMemoryRoutine": (): heap.Ref<boolean> => { 914 if (WEBEXT?.os?.diagnostics && "createMemoryRoutine" in WEBEXT?.os?.diagnostics) { 915 return A.H.TRUE; 916 } 917 return A.H.FALSE; 918 }, 919 "func_CreateMemoryRoutine": (fn: Pointer): void => { 920 A.store.Ref(fn, WEBEXT.os.diagnostics.createMemoryRoutine); 921 }, 922 "call_CreateMemoryRoutine": (retPtr: Pointer, args: Pointer): void => { 923 const args_ffi = {}; 924 925 if (A.load.Bool(args + 4)) { 926 args_ffi["maxTestingMemKib"] = A.load.Int32(args + 0); 927 } 928 929 const _ret = WEBEXT.os.diagnostics.createMemoryRoutine(args_ffi); 930 A.store.Ref(retPtr, _ret); 931 }, 932 "try_CreateMemoryRoutine": (retPtr: Pointer, errPtr: Pointer, args: Pointer): heap.Ref<boolean> => { 933 try { 934 const args_ffi = {}; 935 936 if (A.load.Bool(args + 4)) { 937 args_ffi["maxTestingMemKib"] = A.load.Int32(args + 0); 938 } 939 940 const _ret = WEBEXT.os.diagnostics.createMemoryRoutine(args_ffi); 941 A.store.Ref(retPtr, _ret); 942 return A.H.TRUE; 943 } catch (err: any) { 944 A.store.Ref(errPtr, err); 945 return A.H.FALSE; 946 } 947 }, 948 "has_GetAvailableRoutines": (): heap.Ref<boolean> => { 949 if (WEBEXT?.os?.diagnostics && "getAvailableRoutines" in WEBEXT?.os?.diagnostics) { 950 return A.H.TRUE; 951 } 952 return A.H.FALSE; 953 }, 954 "func_GetAvailableRoutines": (fn: Pointer): void => { 955 A.store.Ref(fn, WEBEXT.os.diagnostics.getAvailableRoutines); 956 }, 957 "call_GetAvailableRoutines": (retPtr: Pointer): void => { 958 const _ret = WEBEXT.os.diagnostics.getAvailableRoutines(); 959 A.store.Ref(retPtr, _ret); 960 }, 961 "try_GetAvailableRoutines": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 962 try { 963 const _ret = WEBEXT.os.diagnostics.getAvailableRoutines(); 964 A.store.Ref(retPtr, _ret); 965 return A.H.TRUE; 966 } catch (err: any) { 967 A.store.Ref(errPtr, err); 968 return A.H.FALSE; 969 } 970 }, 971 "has_GetRoutineUpdate": (): heap.Ref<boolean> => { 972 if (WEBEXT?.os?.diagnostics && "getRoutineUpdate" in WEBEXT?.os?.diagnostics) { 973 return A.H.TRUE; 974 } 975 return A.H.FALSE; 976 }, 977 "func_GetRoutineUpdate": (fn: Pointer): void => { 978 A.store.Ref(fn, WEBEXT.os.diagnostics.getRoutineUpdate); 979 }, 980 "call_GetRoutineUpdate": (retPtr: Pointer, request: Pointer): void => { 981 const request_ffi = {}; 982 983 if (A.load.Bool(request + 8)) { 984 request_ffi["id"] = A.load.Int32(request + 0); 985 } 986 request_ffi["command"] = A.load.Enum(request + 4, ["cancel", "remove", "resume", "status"]); 987 988 const _ret = WEBEXT.os.diagnostics.getRoutineUpdate(request_ffi); 989 A.store.Ref(retPtr, _ret); 990 }, 991 "try_GetRoutineUpdate": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 992 try { 993 const request_ffi = {}; 994 995 if (A.load.Bool(request + 8)) { 996 request_ffi["id"] = A.load.Int32(request + 0); 997 } 998 request_ffi["command"] = A.load.Enum(request + 4, ["cancel", "remove", "resume", "status"]); 999 1000 const _ret = WEBEXT.os.diagnostics.getRoutineUpdate(request_ffi); 1001 A.store.Ref(retPtr, _ret); 1002 return A.H.TRUE; 1003 } catch (err: any) { 1004 A.store.Ref(errPtr, err); 1005 return A.H.FALSE; 1006 } 1007 }, 1008 "has_IsMemoryRoutineArgumentSupported": (): heap.Ref<boolean> => { 1009 if (WEBEXT?.os?.diagnostics && "isMemoryRoutineArgumentSupported" in WEBEXT?.os?.diagnostics) { 1010 return A.H.TRUE; 1011 } 1012 return A.H.FALSE; 1013 }, 1014 "func_IsMemoryRoutineArgumentSupported": (fn: Pointer): void => { 1015 A.store.Ref(fn, WEBEXT.os.diagnostics.isMemoryRoutineArgumentSupported); 1016 }, 1017 "call_IsMemoryRoutineArgumentSupported": (retPtr: Pointer, args: Pointer): void => { 1018 const args_ffi = {}; 1019 1020 if (A.load.Bool(args + 4)) { 1021 args_ffi["maxTestingMemKib"] = A.load.Int32(args + 0); 1022 } 1023 1024 const _ret = WEBEXT.os.diagnostics.isMemoryRoutineArgumentSupported(args_ffi); 1025 A.store.Ref(retPtr, _ret); 1026 }, 1027 "try_IsMemoryRoutineArgumentSupported": (retPtr: Pointer, errPtr: Pointer, args: Pointer): heap.Ref<boolean> => { 1028 try { 1029 const args_ffi = {}; 1030 1031 if (A.load.Bool(args + 4)) { 1032 args_ffi["maxTestingMemKib"] = A.load.Int32(args + 0); 1033 } 1034 1035 const _ret = WEBEXT.os.diagnostics.isMemoryRoutineArgumentSupported(args_ffi); 1036 A.store.Ref(retPtr, _ret); 1037 return A.H.TRUE; 1038 } catch (err: any) { 1039 A.store.Ref(errPtr, err); 1040 return A.H.FALSE; 1041 } 1042 }, 1043 "has_OnMemoryRoutineFinished": (): heap.Ref<boolean> => { 1044 if ( 1045 WEBEXT?.os?.diagnostics?.onMemoryRoutineFinished && 1046 "addListener" in WEBEXT?.os?.diagnostics?.onMemoryRoutineFinished 1047 ) { 1048 return A.H.TRUE; 1049 } 1050 return A.H.FALSE; 1051 }, 1052 "func_OnMemoryRoutineFinished": (fn: Pointer): void => { 1053 A.store.Ref(fn, WEBEXT.os.diagnostics.onMemoryRoutineFinished.addListener); 1054 }, 1055 "call_OnMemoryRoutineFinished": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1056 const _ret = WEBEXT.os.diagnostics.onMemoryRoutineFinished.addListener(A.H.get<object>(callback)); 1057 }, 1058 "try_OnMemoryRoutineFinished": ( 1059 retPtr: Pointer, 1060 errPtr: Pointer, 1061 callback: heap.Ref<object> 1062 ): heap.Ref<boolean> => { 1063 try { 1064 const _ret = WEBEXT.os.diagnostics.onMemoryRoutineFinished.addListener(A.H.get<object>(callback)); 1065 return A.H.TRUE; 1066 } catch (err: any) { 1067 A.store.Ref(errPtr, err); 1068 return A.H.FALSE; 1069 } 1070 }, 1071 "has_OffMemoryRoutineFinished": (): heap.Ref<boolean> => { 1072 if ( 1073 WEBEXT?.os?.diagnostics?.onMemoryRoutineFinished && 1074 "removeListener" in WEBEXT?.os?.diagnostics?.onMemoryRoutineFinished 1075 ) { 1076 return A.H.TRUE; 1077 } 1078 return A.H.FALSE; 1079 }, 1080 "func_OffMemoryRoutineFinished": (fn: Pointer): void => { 1081 A.store.Ref(fn, WEBEXT.os.diagnostics.onMemoryRoutineFinished.removeListener); 1082 }, 1083 "call_OffMemoryRoutineFinished": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1084 const _ret = WEBEXT.os.diagnostics.onMemoryRoutineFinished.removeListener(A.H.get<object>(callback)); 1085 }, 1086 "try_OffMemoryRoutineFinished": ( 1087 retPtr: Pointer, 1088 errPtr: Pointer, 1089 callback: heap.Ref<object> 1090 ): heap.Ref<boolean> => { 1091 try { 1092 const _ret = WEBEXT.os.diagnostics.onMemoryRoutineFinished.removeListener(A.H.get<object>(callback)); 1093 return A.H.TRUE; 1094 } catch (err: any) { 1095 A.store.Ref(errPtr, err); 1096 return A.H.FALSE; 1097 } 1098 }, 1099 "has_HasOnMemoryRoutineFinished": (): heap.Ref<boolean> => { 1100 if ( 1101 WEBEXT?.os?.diagnostics?.onMemoryRoutineFinished && 1102 "hasListener" in WEBEXT?.os?.diagnostics?.onMemoryRoutineFinished 1103 ) { 1104 return A.H.TRUE; 1105 } 1106 return A.H.FALSE; 1107 }, 1108 "func_HasOnMemoryRoutineFinished": (fn: Pointer): void => { 1109 A.store.Ref(fn, WEBEXT.os.diagnostics.onMemoryRoutineFinished.hasListener); 1110 }, 1111 "call_HasOnMemoryRoutineFinished": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1112 const _ret = WEBEXT.os.diagnostics.onMemoryRoutineFinished.hasListener(A.H.get<object>(callback)); 1113 A.store.Bool(retPtr, _ret); 1114 }, 1115 "try_HasOnMemoryRoutineFinished": ( 1116 retPtr: Pointer, 1117 errPtr: Pointer, 1118 callback: heap.Ref<object> 1119 ): heap.Ref<boolean> => { 1120 try { 1121 const _ret = WEBEXT.os.diagnostics.onMemoryRoutineFinished.hasListener(A.H.get<object>(callback)); 1122 A.store.Bool(retPtr, _ret); 1123 return A.H.TRUE; 1124 } catch (err: any) { 1125 A.store.Ref(errPtr, err); 1126 return A.H.FALSE; 1127 } 1128 }, 1129 "has_OnRoutineException": (): heap.Ref<boolean> => { 1130 if (WEBEXT?.os?.diagnostics?.onRoutineException && "addListener" in WEBEXT?.os?.diagnostics?.onRoutineException) { 1131 return A.H.TRUE; 1132 } 1133 return A.H.FALSE; 1134 }, 1135 "func_OnRoutineException": (fn: Pointer): void => { 1136 A.store.Ref(fn, WEBEXT.os.diagnostics.onRoutineException.addListener); 1137 }, 1138 "call_OnRoutineException": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1139 const _ret = WEBEXT.os.diagnostics.onRoutineException.addListener(A.H.get<object>(callback)); 1140 }, 1141 "try_OnRoutineException": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 1142 try { 1143 const _ret = WEBEXT.os.diagnostics.onRoutineException.addListener(A.H.get<object>(callback)); 1144 return A.H.TRUE; 1145 } catch (err: any) { 1146 A.store.Ref(errPtr, err); 1147 return A.H.FALSE; 1148 } 1149 }, 1150 "has_OffRoutineException": (): heap.Ref<boolean> => { 1151 if ( 1152 WEBEXT?.os?.diagnostics?.onRoutineException && 1153 "removeListener" in WEBEXT?.os?.diagnostics?.onRoutineException 1154 ) { 1155 return A.H.TRUE; 1156 } 1157 return A.H.FALSE; 1158 }, 1159 "func_OffRoutineException": (fn: Pointer): void => { 1160 A.store.Ref(fn, WEBEXT.os.diagnostics.onRoutineException.removeListener); 1161 }, 1162 "call_OffRoutineException": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1163 const _ret = WEBEXT.os.diagnostics.onRoutineException.removeListener(A.H.get<object>(callback)); 1164 }, 1165 "try_OffRoutineException": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 1166 try { 1167 const _ret = WEBEXT.os.diagnostics.onRoutineException.removeListener(A.H.get<object>(callback)); 1168 return A.H.TRUE; 1169 } catch (err: any) { 1170 A.store.Ref(errPtr, err); 1171 return A.H.FALSE; 1172 } 1173 }, 1174 "has_HasOnRoutineException": (): heap.Ref<boolean> => { 1175 if (WEBEXT?.os?.diagnostics?.onRoutineException && "hasListener" in WEBEXT?.os?.diagnostics?.onRoutineException) { 1176 return A.H.TRUE; 1177 } 1178 return A.H.FALSE; 1179 }, 1180 "func_HasOnRoutineException": (fn: Pointer): void => { 1181 A.store.Ref(fn, WEBEXT.os.diagnostics.onRoutineException.hasListener); 1182 }, 1183 "call_HasOnRoutineException": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1184 const _ret = WEBEXT.os.diagnostics.onRoutineException.hasListener(A.H.get<object>(callback)); 1185 A.store.Bool(retPtr, _ret); 1186 }, 1187 "try_HasOnRoutineException": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 1188 try { 1189 const _ret = WEBEXT.os.diagnostics.onRoutineException.hasListener(A.H.get<object>(callback)); 1190 A.store.Bool(retPtr, _ret); 1191 return A.H.TRUE; 1192 } catch (err: any) { 1193 A.store.Ref(errPtr, err); 1194 return A.H.FALSE; 1195 } 1196 }, 1197 "has_OnRoutineInitialized": (): heap.Ref<boolean> => { 1198 if ( 1199 WEBEXT?.os?.diagnostics?.onRoutineInitialized && 1200 "addListener" in WEBEXT?.os?.diagnostics?.onRoutineInitialized 1201 ) { 1202 return A.H.TRUE; 1203 } 1204 return A.H.FALSE; 1205 }, 1206 "func_OnRoutineInitialized": (fn: Pointer): void => { 1207 A.store.Ref(fn, WEBEXT.os.diagnostics.onRoutineInitialized.addListener); 1208 }, 1209 "call_OnRoutineInitialized": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1210 const _ret = WEBEXT.os.diagnostics.onRoutineInitialized.addListener(A.H.get<object>(callback)); 1211 }, 1212 "try_OnRoutineInitialized": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 1213 try { 1214 const _ret = WEBEXT.os.diagnostics.onRoutineInitialized.addListener(A.H.get<object>(callback)); 1215 return A.H.TRUE; 1216 } catch (err: any) { 1217 A.store.Ref(errPtr, err); 1218 return A.H.FALSE; 1219 } 1220 }, 1221 "has_OffRoutineInitialized": (): heap.Ref<boolean> => { 1222 if ( 1223 WEBEXT?.os?.diagnostics?.onRoutineInitialized && 1224 "removeListener" in WEBEXT?.os?.diagnostics?.onRoutineInitialized 1225 ) { 1226 return A.H.TRUE; 1227 } 1228 return A.H.FALSE; 1229 }, 1230 "func_OffRoutineInitialized": (fn: Pointer): void => { 1231 A.store.Ref(fn, WEBEXT.os.diagnostics.onRoutineInitialized.removeListener); 1232 }, 1233 "call_OffRoutineInitialized": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1234 const _ret = WEBEXT.os.diagnostics.onRoutineInitialized.removeListener(A.H.get<object>(callback)); 1235 }, 1236 "try_OffRoutineInitialized": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 1237 try { 1238 const _ret = WEBEXT.os.diagnostics.onRoutineInitialized.removeListener(A.H.get<object>(callback)); 1239 return A.H.TRUE; 1240 } catch (err: any) { 1241 A.store.Ref(errPtr, err); 1242 return A.H.FALSE; 1243 } 1244 }, 1245 "has_HasOnRoutineInitialized": (): heap.Ref<boolean> => { 1246 if ( 1247 WEBEXT?.os?.diagnostics?.onRoutineInitialized && 1248 "hasListener" in WEBEXT?.os?.diagnostics?.onRoutineInitialized 1249 ) { 1250 return A.H.TRUE; 1251 } 1252 return A.H.FALSE; 1253 }, 1254 "func_HasOnRoutineInitialized": (fn: Pointer): void => { 1255 A.store.Ref(fn, WEBEXT.os.diagnostics.onRoutineInitialized.hasListener); 1256 }, 1257 "call_HasOnRoutineInitialized": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1258 const _ret = WEBEXT.os.diagnostics.onRoutineInitialized.hasListener(A.H.get<object>(callback)); 1259 A.store.Bool(retPtr, _ret); 1260 }, 1261 "try_HasOnRoutineInitialized": ( 1262 retPtr: Pointer, 1263 errPtr: Pointer, 1264 callback: heap.Ref<object> 1265 ): heap.Ref<boolean> => { 1266 try { 1267 const _ret = WEBEXT.os.diagnostics.onRoutineInitialized.hasListener(A.H.get<object>(callback)); 1268 A.store.Bool(retPtr, _ret); 1269 return A.H.TRUE; 1270 } catch (err: any) { 1271 A.store.Ref(errPtr, err); 1272 return A.H.FALSE; 1273 } 1274 }, 1275 "has_OnRoutineRunning": (): heap.Ref<boolean> => { 1276 if (WEBEXT?.os?.diagnostics?.onRoutineRunning && "addListener" in WEBEXT?.os?.diagnostics?.onRoutineRunning) { 1277 return A.H.TRUE; 1278 } 1279 return A.H.FALSE; 1280 }, 1281 "func_OnRoutineRunning": (fn: Pointer): void => { 1282 A.store.Ref(fn, WEBEXT.os.diagnostics.onRoutineRunning.addListener); 1283 }, 1284 "call_OnRoutineRunning": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1285 const _ret = WEBEXT.os.diagnostics.onRoutineRunning.addListener(A.H.get<object>(callback)); 1286 }, 1287 "try_OnRoutineRunning": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 1288 try { 1289 const _ret = WEBEXT.os.diagnostics.onRoutineRunning.addListener(A.H.get<object>(callback)); 1290 return A.H.TRUE; 1291 } catch (err: any) { 1292 A.store.Ref(errPtr, err); 1293 return A.H.FALSE; 1294 } 1295 }, 1296 "has_OffRoutineRunning": (): heap.Ref<boolean> => { 1297 if (WEBEXT?.os?.diagnostics?.onRoutineRunning && "removeListener" in WEBEXT?.os?.diagnostics?.onRoutineRunning) { 1298 return A.H.TRUE; 1299 } 1300 return A.H.FALSE; 1301 }, 1302 "func_OffRoutineRunning": (fn: Pointer): void => { 1303 A.store.Ref(fn, WEBEXT.os.diagnostics.onRoutineRunning.removeListener); 1304 }, 1305 "call_OffRoutineRunning": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1306 const _ret = WEBEXT.os.diagnostics.onRoutineRunning.removeListener(A.H.get<object>(callback)); 1307 }, 1308 "try_OffRoutineRunning": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 1309 try { 1310 const _ret = WEBEXT.os.diagnostics.onRoutineRunning.removeListener(A.H.get<object>(callback)); 1311 return A.H.TRUE; 1312 } catch (err: any) { 1313 A.store.Ref(errPtr, err); 1314 return A.H.FALSE; 1315 } 1316 }, 1317 "has_HasOnRoutineRunning": (): heap.Ref<boolean> => { 1318 if (WEBEXT?.os?.diagnostics?.onRoutineRunning && "hasListener" in WEBEXT?.os?.diagnostics?.onRoutineRunning) { 1319 return A.H.TRUE; 1320 } 1321 return A.H.FALSE; 1322 }, 1323 "func_HasOnRoutineRunning": (fn: Pointer): void => { 1324 A.store.Ref(fn, WEBEXT.os.diagnostics.onRoutineRunning.hasListener); 1325 }, 1326 "call_HasOnRoutineRunning": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1327 const _ret = WEBEXT.os.diagnostics.onRoutineRunning.hasListener(A.H.get<object>(callback)); 1328 A.store.Bool(retPtr, _ret); 1329 }, 1330 "try_HasOnRoutineRunning": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 1331 try { 1332 const _ret = WEBEXT.os.diagnostics.onRoutineRunning.hasListener(A.H.get<object>(callback)); 1333 A.store.Bool(retPtr, _ret); 1334 return A.H.TRUE; 1335 } catch (err: any) { 1336 A.store.Ref(errPtr, err); 1337 return A.H.FALSE; 1338 } 1339 }, 1340 "has_OnRoutineWaiting": (): heap.Ref<boolean> => { 1341 if (WEBEXT?.os?.diagnostics?.onRoutineWaiting && "addListener" in WEBEXT?.os?.diagnostics?.onRoutineWaiting) { 1342 return A.H.TRUE; 1343 } 1344 return A.H.FALSE; 1345 }, 1346 "func_OnRoutineWaiting": (fn: Pointer): void => { 1347 A.store.Ref(fn, WEBEXT.os.diagnostics.onRoutineWaiting.addListener); 1348 }, 1349 "call_OnRoutineWaiting": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1350 const _ret = WEBEXT.os.diagnostics.onRoutineWaiting.addListener(A.H.get<object>(callback)); 1351 }, 1352 "try_OnRoutineWaiting": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 1353 try { 1354 const _ret = WEBEXT.os.diagnostics.onRoutineWaiting.addListener(A.H.get<object>(callback)); 1355 return A.H.TRUE; 1356 } catch (err: any) { 1357 A.store.Ref(errPtr, err); 1358 return A.H.FALSE; 1359 } 1360 }, 1361 "has_OffRoutineWaiting": (): heap.Ref<boolean> => { 1362 if (WEBEXT?.os?.diagnostics?.onRoutineWaiting && "removeListener" in WEBEXT?.os?.diagnostics?.onRoutineWaiting) { 1363 return A.H.TRUE; 1364 } 1365 return A.H.FALSE; 1366 }, 1367 "func_OffRoutineWaiting": (fn: Pointer): void => { 1368 A.store.Ref(fn, WEBEXT.os.diagnostics.onRoutineWaiting.removeListener); 1369 }, 1370 "call_OffRoutineWaiting": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1371 const _ret = WEBEXT.os.diagnostics.onRoutineWaiting.removeListener(A.H.get<object>(callback)); 1372 }, 1373 "try_OffRoutineWaiting": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 1374 try { 1375 const _ret = WEBEXT.os.diagnostics.onRoutineWaiting.removeListener(A.H.get<object>(callback)); 1376 return A.H.TRUE; 1377 } catch (err: any) { 1378 A.store.Ref(errPtr, err); 1379 return A.H.FALSE; 1380 } 1381 }, 1382 "has_HasOnRoutineWaiting": (): heap.Ref<boolean> => { 1383 if (WEBEXT?.os?.diagnostics?.onRoutineWaiting && "hasListener" in WEBEXT?.os?.diagnostics?.onRoutineWaiting) { 1384 return A.H.TRUE; 1385 } 1386 return A.H.FALSE; 1387 }, 1388 "func_HasOnRoutineWaiting": (fn: Pointer): void => { 1389 A.store.Ref(fn, WEBEXT.os.diagnostics.onRoutineWaiting.hasListener); 1390 }, 1391 "call_HasOnRoutineWaiting": (retPtr: Pointer, callback: heap.Ref<object>): void => { 1392 const _ret = WEBEXT.os.diagnostics.onRoutineWaiting.hasListener(A.H.get<object>(callback)); 1393 A.store.Bool(retPtr, _ret); 1394 }, 1395 "try_HasOnRoutineWaiting": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 1396 try { 1397 const _ret = WEBEXT.os.diagnostics.onRoutineWaiting.hasListener(A.H.get<object>(callback)); 1398 A.store.Bool(retPtr, _ret); 1399 return A.H.TRUE; 1400 } catch (err: any) { 1401 A.store.Ref(errPtr, err); 1402 return A.H.FALSE; 1403 } 1404 }, 1405 "has_RunAcPowerRoutine": (): heap.Ref<boolean> => { 1406 if (WEBEXT?.os?.diagnostics && "runAcPowerRoutine" in WEBEXT?.os?.diagnostics) { 1407 return A.H.TRUE; 1408 } 1409 return A.H.FALSE; 1410 }, 1411 "func_RunAcPowerRoutine": (fn: Pointer): void => { 1412 A.store.Ref(fn, WEBEXT.os.diagnostics.runAcPowerRoutine); 1413 }, 1414 "call_RunAcPowerRoutine": (retPtr: Pointer, request: Pointer): void => { 1415 const request_ffi = {}; 1416 1417 request_ffi["expected_status"] = A.load.Enum(request + 0, ["connected", "disconnected"]); 1418 request_ffi["expected_power_type"] = A.load.Ref(request + 4, undefined); 1419 1420 const _ret = WEBEXT.os.diagnostics.runAcPowerRoutine(request_ffi); 1421 A.store.Ref(retPtr, _ret); 1422 }, 1423 "try_RunAcPowerRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 1424 try { 1425 const request_ffi = {}; 1426 1427 request_ffi["expected_status"] = A.load.Enum(request + 0, ["connected", "disconnected"]); 1428 request_ffi["expected_power_type"] = A.load.Ref(request + 4, undefined); 1429 1430 const _ret = WEBEXT.os.diagnostics.runAcPowerRoutine(request_ffi); 1431 A.store.Ref(retPtr, _ret); 1432 return A.H.TRUE; 1433 } catch (err: any) { 1434 A.store.Ref(errPtr, err); 1435 return A.H.FALSE; 1436 } 1437 }, 1438 "has_RunAudioDriverRoutine": (): heap.Ref<boolean> => { 1439 if (WEBEXT?.os?.diagnostics && "runAudioDriverRoutine" in WEBEXT?.os?.diagnostics) { 1440 return A.H.TRUE; 1441 } 1442 return A.H.FALSE; 1443 }, 1444 "func_RunAudioDriverRoutine": (fn: Pointer): void => { 1445 A.store.Ref(fn, WEBEXT.os.diagnostics.runAudioDriverRoutine); 1446 }, 1447 "call_RunAudioDriverRoutine": (retPtr: Pointer): void => { 1448 const _ret = WEBEXT.os.diagnostics.runAudioDriverRoutine(); 1449 A.store.Ref(retPtr, _ret); 1450 }, 1451 "try_RunAudioDriverRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 1452 try { 1453 const _ret = WEBEXT.os.diagnostics.runAudioDriverRoutine(); 1454 A.store.Ref(retPtr, _ret); 1455 return A.H.TRUE; 1456 } catch (err: any) { 1457 A.store.Ref(errPtr, err); 1458 return A.H.FALSE; 1459 } 1460 }, 1461 "has_RunBatteryCapacityRoutine": (): heap.Ref<boolean> => { 1462 if (WEBEXT?.os?.diagnostics && "runBatteryCapacityRoutine" in WEBEXT?.os?.diagnostics) { 1463 return A.H.TRUE; 1464 } 1465 return A.H.FALSE; 1466 }, 1467 "func_RunBatteryCapacityRoutine": (fn: Pointer): void => { 1468 A.store.Ref(fn, WEBEXT.os.diagnostics.runBatteryCapacityRoutine); 1469 }, 1470 "call_RunBatteryCapacityRoutine": (retPtr: Pointer): void => { 1471 const _ret = WEBEXT.os.diagnostics.runBatteryCapacityRoutine(); 1472 A.store.Ref(retPtr, _ret); 1473 }, 1474 "try_RunBatteryCapacityRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 1475 try { 1476 const _ret = WEBEXT.os.diagnostics.runBatteryCapacityRoutine(); 1477 A.store.Ref(retPtr, _ret); 1478 return A.H.TRUE; 1479 } catch (err: any) { 1480 A.store.Ref(errPtr, err); 1481 return A.H.FALSE; 1482 } 1483 }, 1484 "has_RunBatteryChargeRoutine": (): heap.Ref<boolean> => { 1485 if (WEBEXT?.os?.diagnostics && "runBatteryChargeRoutine" in WEBEXT?.os?.diagnostics) { 1486 return A.H.TRUE; 1487 } 1488 return A.H.FALSE; 1489 }, 1490 "func_RunBatteryChargeRoutine": (fn: Pointer): void => { 1491 A.store.Ref(fn, WEBEXT.os.diagnostics.runBatteryChargeRoutine); 1492 }, 1493 "call_RunBatteryChargeRoutine": (retPtr: Pointer, request: Pointer): void => { 1494 const request_ffi = {}; 1495 1496 if (A.load.Bool(request + 8)) { 1497 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1498 } 1499 if (A.load.Bool(request + 9)) { 1500 request_ffi["minimum_charge_percent_required"] = A.load.Int32(request + 4); 1501 } 1502 1503 const _ret = WEBEXT.os.diagnostics.runBatteryChargeRoutine(request_ffi); 1504 A.store.Ref(retPtr, _ret); 1505 }, 1506 "try_RunBatteryChargeRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 1507 try { 1508 const request_ffi = {}; 1509 1510 if (A.load.Bool(request + 8)) { 1511 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1512 } 1513 if (A.load.Bool(request + 9)) { 1514 request_ffi["minimum_charge_percent_required"] = A.load.Int32(request + 4); 1515 } 1516 1517 const _ret = WEBEXT.os.diagnostics.runBatteryChargeRoutine(request_ffi); 1518 A.store.Ref(retPtr, _ret); 1519 return A.H.TRUE; 1520 } catch (err: any) { 1521 A.store.Ref(errPtr, err); 1522 return A.H.FALSE; 1523 } 1524 }, 1525 "has_RunBatteryDischargeRoutine": (): heap.Ref<boolean> => { 1526 if (WEBEXT?.os?.diagnostics && "runBatteryDischargeRoutine" in WEBEXT?.os?.diagnostics) { 1527 return A.H.TRUE; 1528 } 1529 return A.H.FALSE; 1530 }, 1531 "func_RunBatteryDischargeRoutine": (fn: Pointer): void => { 1532 A.store.Ref(fn, WEBEXT.os.diagnostics.runBatteryDischargeRoutine); 1533 }, 1534 "call_RunBatteryDischargeRoutine": (retPtr: Pointer, request: Pointer): void => { 1535 const request_ffi = {}; 1536 1537 if (A.load.Bool(request + 8)) { 1538 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1539 } 1540 if (A.load.Bool(request + 9)) { 1541 request_ffi["maximum_discharge_percent_allowed"] = A.load.Int32(request + 4); 1542 } 1543 1544 const _ret = WEBEXT.os.diagnostics.runBatteryDischargeRoutine(request_ffi); 1545 A.store.Ref(retPtr, _ret); 1546 }, 1547 "try_RunBatteryDischargeRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 1548 try { 1549 const request_ffi = {}; 1550 1551 if (A.load.Bool(request + 8)) { 1552 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1553 } 1554 if (A.load.Bool(request + 9)) { 1555 request_ffi["maximum_discharge_percent_allowed"] = A.load.Int32(request + 4); 1556 } 1557 1558 const _ret = WEBEXT.os.diagnostics.runBatteryDischargeRoutine(request_ffi); 1559 A.store.Ref(retPtr, _ret); 1560 return A.H.TRUE; 1561 } catch (err: any) { 1562 A.store.Ref(errPtr, err); 1563 return A.H.FALSE; 1564 } 1565 }, 1566 "has_RunBatteryHealthRoutine": (): heap.Ref<boolean> => { 1567 if (WEBEXT?.os?.diagnostics && "runBatteryHealthRoutine" in WEBEXT?.os?.diagnostics) { 1568 return A.H.TRUE; 1569 } 1570 return A.H.FALSE; 1571 }, 1572 "func_RunBatteryHealthRoutine": (fn: Pointer): void => { 1573 A.store.Ref(fn, WEBEXT.os.diagnostics.runBatteryHealthRoutine); 1574 }, 1575 "call_RunBatteryHealthRoutine": (retPtr: Pointer): void => { 1576 const _ret = WEBEXT.os.diagnostics.runBatteryHealthRoutine(); 1577 A.store.Ref(retPtr, _ret); 1578 }, 1579 "try_RunBatteryHealthRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 1580 try { 1581 const _ret = WEBEXT.os.diagnostics.runBatteryHealthRoutine(); 1582 A.store.Ref(retPtr, _ret); 1583 return A.H.TRUE; 1584 } catch (err: any) { 1585 A.store.Ref(errPtr, err); 1586 return A.H.FALSE; 1587 } 1588 }, 1589 "has_RunBluetoothDiscoveryRoutine": (): heap.Ref<boolean> => { 1590 if (WEBEXT?.os?.diagnostics && "runBluetoothDiscoveryRoutine" in WEBEXT?.os?.diagnostics) { 1591 return A.H.TRUE; 1592 } 1593 return A.H.FALSE; 1594 }, 1595 "func_RunBluetoothDiscoveryRoutine": (fn: Pointer): void => { 1596 A.store.Ref(fn, WEBEXT.os.diagnostics.runBluetoothDiscoveryRoutine); 1597 }, 1598 "call_RunBluetoothDiscoveryRoutine": (retPtr: Pointer): void => { 1599 const _ret = WEBEXT.os.diagnostics.runBluetoothDiscoveryRoutine(); 1600 A.store.Ref(retPtr, _ret); 1601 }, 1602 "try_RunBluetoothDiscoveryRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 1603 try { 1604 const _ret = WEBEXT.os.diagnostics.runBluetoothDiscoveryRoutine(); 1605 A.store.Ref(retPtr, _ret); 1606 return A.H.TRUE; 1607 } catch (err: any) { 1608 A.store.Ref(errPtr, err); 1609 return A.H.FALSE; 1610 } 1611 }, 1612 "has_RunBluetoothPairingRoutine": (): heap.Ref<boolean> => { 1613 if (WEBEXT?.os?.diagnostics && "runBluetoothPairingRoutine" in WEBEXT?.os?.diagnostics) { 1614 return A.H.TRUE; 1615 } 1616 return A.H.FALSE; 1617 }, 1618 "func_RunBluetoothPairingRoutine": (fn: Pointer): void => { 1619 A.store.Ref(fn, WEBEXT.os.diagnostics.runBluetoothPairingRoutine); 1620 }, 1621 "call_RunBluetoothPairingRoutine": (retPtr: Pointer, request: Pointer): void => { 1622 const request_ffi = {}; 1623 1624 request_ffi["peripheral_id"] = A.load.Ref(request + 0, undefined); 1625 1626 const _ret = WEBEXT.os.diagnostics.runBluetoothPairingRoutine(request_ffi); 1627 A.store.Ref(retPtr, _ret); 1628 }, 1629 "try_RunBluetoothPairingRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 1630 try { 1631 const request_ffi = {}; 1632 1633 request_ffi["peripheral_id"] = A.load.Ref(request + 0, undefined); 1634 1635 const _ret = WEBEXT.os.diagnostics.runBluetoothPairingRoutine(request_ffi); 1636 A.store.Ref(retPtr, _ret); 1637 return A.H.TRUE; 1638 } catch (err: any) { 1639 A.store.Ref(errPtr, err); 1640 return A.H.FALSE; 1641 } 1642 }, 1643 "has_RunBluetoothPowerRoutine": (): heap.Ref<boolean> => { 1644 if (WEBEXT?.os?.diagnostics && "runBluetoothPowerRoutine" in WEBEXT?.os?.diagnostics) { 1645 return A.H.TRUE; 1646 } 1647 return A.H.FALSE; 1648 }, 1649 "func_RunBluetoothPowerRoutine": (fn: Pointer): void => { 1650 A.store.Ref(fn, WEBEXT.os.diagnostics.runBluetoothPowerRoutine); 1651 }, 1652 "call_RunBluetoothPowerRoutine": (retPtr: Pointer): void => { 1653 const _ret = WEBEXT.os.diagnostics.runBluetoothPowerRoutine(); 1654 A.store.Ref(retPtr, _ret); 1655 }, 1656 "try_RunBluetoothPowerRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 1657 try { 1658 const _ret = WEBEXT.os.diagnostics.runBluetoothPowerRoutine(); 1659 A.store.Ref(retPtr, _ret); 1660 return A.H.TRUE; 1661 } catch (err: any) { 1662 A.store.Ref(errPtr, err); 1663 return A.H.FALSE; 1664 } 1665 }, 1666 "has_RunBluetoothScanningRoutine": (): heap.Ref<boolean> => { 1667 if (WEBEXT?.os?.diagnostics && "runBluetoothScanningRoutine" in WEBEXT?.os?.diagnostics) { 1668 return A.H.TRUE; 1669 } 1670 return A.H.FALSE; 1671 }, 1672 "func_RunBluetoothScanningRoutine": (fn: Pointer): void => { 1673 A.store.Ref(fn, WEBEXT.os.diagnostics.runBluetoothScanningRoutine); 1674 }, 1675 "call_RunBluetoothScanningRoutine": (retPtr: Pointer, request: Pointer): void => { 1676 const request_ffi = {}; 1677 1678 if (A.load.Bool(request + 4)) { 1679 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1680 } 1681 1682 const _ret = WEBEXT.os.diagnostics.runBluetoothScanningRoutine(request_ffi); 1683 A.store.Ref(retPtr, _ret); 1684 }, 1685 "try_RunBluetoothScanningRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 1686 try { 1687 const request_ffi = {}; 1688 1689 if (A.load.Bool(request + 4)) { 1690 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1691 } 1692 1693 const _ret = WEBEXT.os.diagnostics.runBluetoothScanningRoutine(request_ffi); 1694 A.store.Ref(retPtr, _ret); 1695 return A.H.TRUE; 1696 } catch (err: any) { 1697 A.store.Ref(errPtr, err); 1698 return A.H.FALSE; 1699 } 1700 }, 1701 "has_RunCpuCacheRoutine": (): heap.Ref<boolean> => { 1702 if (WEBEXT?.os?.diagnostics && "runCpuCacheRoutine" in WEBEXT?.os?.diagnostics) { 1703 return A.H.TRUE; 1704 } 1705 return A.H.FALSE; 1706 }, 1707 "func_RunCpuCacheRoutine": (fn: Pointer): void => { 1708 A.store.Ref(fn, WEBEXT.os.diagnostics.runCpuCacheRoutine); 1709 }, 1710 "call_RunCpuCacheRoutine": (retPtr: Pointer, request: Pointer): void => { 1711 const request_ffi = {}; 1712 1713 if (A.load.Bool(request + 4)) { 1714 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1715 } 1716 1717 const _ret = WEBEXT.os.diagnostics.runCpuCacheRoutine(request_ffi); 1718 A.store.Ref(retPtr, _ret); 1719 }, 1720 "try_RunCpuCacheRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 1721 try { 1722 const request_ffi = {}; 1723 1724 if (A.load.Bool(request + 4)) { 1725 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1726 } 1727 1728 const _ret = WEBEXT.os.diagnostics.runCpuCacheRoutine(request_ffi); 1729 A.store.Ref(retPtr, _ret); 1730 return A.H.TRUE; 1731 } catch (err: any) { 1732 A.store.Ref(errPtr, err); 1733 return A.H.FALSE; 1734 } 1735 }, 1736 "has_RunCpuFloatingPointAccuracyRoutine": (): heap.Ref<boolean> => { 1737 if (WEBEXT?.os?.diagnostics && "runCpuFloatingPointAccuracyRoutine" in WEBEXT?.os?.diagnostics) { 1738 return A.H.TRUE; 1739 } 1740 return A.H.FALSE; 1741 }, 1742 "func_RunCpuFloatingPointAccuracyRoutine": (fn: Pointer): void => { 1743 A.store.Ref(fn, WEBEXT.os.diagnostics.runCpuFloatingPointAccuracyRoutine); 1744 }, 1745 "call_RunCpuFloatingPointAccuracyRoutine": (retPtr: Pointer, request: Pointer): void => { 1746 const request_ffi = {}; 1747 1748 if (A.load.Bool(request + 4)) { 1749 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1750 } 1751 1752 const _ret = WEBEXT.os.diagnostics.runCpuFloatingPointAccuracyRoutine(request_ffi); 1753 A.store.Ref(retPtr, _ret); 1754 }, 1755 "try_RunCpuFloatingPointAccuracyRoutine": ( 1756 retPtr: Pointer, 1757 errPtr: Pointer, 1758 request: Pointer 1759 ): heap.Ref<boolean> => { 1760 try { 1761 const request_ffi = {}; 1762 1763 if (A.load.Bool(request + 4)) { 1764 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1765 } 1766 1767 const _ret = WEBEXT.os.diagnostics.runCpuFloatingPointAccuracyRoutine(request_ffi); 1768 A.store.Ref(retPtr, _ret); 1769 return A.H.TRUE; 1770 } catch (err: any) { 1771 A.store.Ref(errPtr, err); 1772 return A.H.FALSE; 1773 } 1774 }, 1775 "has_RunCpuPrimeSearchRoutine": (): heap.Ref<boolean> => { 1776 if (WEBEXT?.os?.diagnostics && "runCpuPrimeSearchRoutine" in WEBEXT?.os?.diagnostics) { 1777 return A.H.TRUE; 1778 } 1779 return A.H.FALSE; 1780 }, 1781 "func_RunCpuPrimeSearchRoutine": (fn: Pointer): void => { 1782 A.store.Ref(fn, WEBEXT.os.diagnostics.runCpuPrimeSearchRoutine); 1783 }, 1784 "call_RunCpuPrimeSearchRoutine": (retPtr: Pointer, request: Pointer): void => { 1785 const request_ffi = {}; 1786 1787 if (A.load.Bool(request + 4)) { 1788 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1789 } 1790 1791 const _ret = WEBEXT.os.diagnostics.runCpuPrimeSearchRoutine(request_ffi); 1792 A.store.Ref(retPtr, _ret); 1793 }, 1794 "try_RunCpuPrimeSearchRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 1795 try { 1796 const request_ffi = {}; 1797 1798 if (A.load.Bool(request + 4)) { 1799 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1800 } 1801 1802 const _ret = WEBEXT.os.diagnostics.runCpuPrimeSearchRoutine(request_ffi); 1803 A.store.Ref(retPtr, _ret); 1804 return A.H.TRUE; 1805 } catch (err: any) { 1806 A.store.Ref(errPtr, err); 1807 return A.H.FALSE; 1808 } 1809 }, 1810 "has_RunCpuStressRoutine": (): heap.Ref<boolean> => { 1811 if (WEBEXT?.os?.diagnostics && "runCpuStressRoutine" in WEBEXT?.os?.diagnostics) { 1812 return A.H.TRUE; 1813 } 1814 return A.H.FALSE; 1815 }, 1816 "func_RunCpuStressRoutine": (fn: Pointer): void => { 1817 A.store.Ref(fn, WEBEXT.os.diagnostics.runCpuStressRoutine); 1818 }, 1819 "call_RunCpuStressRoutine": (retPtr: Pointer, request: Pointer): void => { 1820 const request_ffi = {}; 1821 1822 if (A.load.Bool(request + 4)) { 1823 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1824 } 1825 1826 const _ret = WEBEXT.os.diagnostics.runCpuStressRoutine(request_ffi); 1827 A.store.Ref(retPtr, _ret); 1828 }, 1829 "try_RunCpuStressRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 1830 try { 1831 const request_ffi = {}; 1832 1833 if (A.load.Bool(request + 4)) { 1834 request_ffi["length_seconds"] = A.load.Int32(request + 0); 1835 } 1836 1837 const _ret = WEBEXT.os.diagnostics.runCpuStressRoutine(request_ffi); 1838 A.store.Ref(retPtr, _ret); 1839 return A.H.TRUE; 1840 } catch (err: any) { 1841 A.store.Ref(errPtr, err); 1842 return A.H.FALSE; 1843 } 1844 }, 1845 "has_RunDiskReadRoutine": (): heap.Ref<boolean> => { 1846 if (WEBEXT?.os?.diagnostics && "runDiskReadRoutine" in WEBEXT?.os?.diagnostics) { 1847 return A.H.TRUE; 1848 } 1849 return A.H.FALSE; 1850 }, 1851 "func_RunDiskReadRoutine": (fn: Pointer): void => { 1852 A.store.Ref(fn, WEBEXT.os.diagnostics.runDiskReadRoutine); 1853 }, 1854 "call_RunDiskReadRoutine": (retPtr: Pointer, request: Pointer): void => { 1855 const request_ffi = {}; 1856 1857 request_ffi["type"] = A.load.Enum(request + 0, ["linear", "random"]); 1858 if (A.load.Bool(request + 12)) { 1859 request_ffi["length_seconds"] = A.load.Int32(request + 4); 1860 } 1861 if (A.load.Bool(request + 13)) { 1862 request_ffi["file_size_mb"] = A.load.Int32(request + 8); 1863 } 1864 1865 const _ret = WEBEXT.os.diagnostics.runDiskReadRoutine(request_ffi); 1866 A.store.Ref(retPtr, _ret); 1867 }, 1868 "try_RunDiskReadRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 1869 try { 1870 const request_ffi = {}; 1871 1872 request_ffi["type"] = A.load.Enum(request + 0, ["linear", "random"]); 1873 if (A.load.Bool(request + 12)) { 1874 request_ffi["length_seconds"] = A.load.Int32(request + 4); 1875 } 1876 if (A.load.Bool(request + 13)) { 1877 request_ffi["file_size_mb"] = A.load.Int32(request + 8); 1878 } 1879 1880 const _ret = WEBEXT.os.diagnostics.runDiskReadRoutine(request_ffi); 1881 A.store.Ref(retPtr, _ret); 1882 return A.H.TRUE; 1883 } catch (err: any) { 1884 A.store.Ref(errPtr, err); 1885 return A.H.FALSE; 1886 } 1887 }, 1888 "has_RunDnsResolutionRoutine": (): heap.Ref<boolean> => { 1889 if (WEBEXT?.os?.diagnostics && "runDnsResolutionRoutine" in WEBEXT?.os?.diagnostics) { 1890 return A.H.TRUE; 1891 } 1892 return A.H.FALSE; 1893 }, 1894 "func_RunDnsResolutionRoutine": (fn: Pointer): void => { 1895 A.store.Ref(fn, WEBEXT.os.diagnostics.runDnsResolutionRoutine); 1896 }, 1897 "call_RunDnsResolutionRoutine": (retPtr: Pointer): void => { 1898 const _ret = WEBEXT.os.diagnostics.runDnsResolutionRoutine(); 1899 A.store.Ref(retPtr, _ret); 1900 }, 1901 "try_RunDnsResolutionRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 1902 try { 1903 const _ret = WEBEXT.os.diagnostics.runDnsResolutionRoutine(); 1904 A.store.Ref(retPtr, _ret); 1905 return A.H.TRUE; 1906 } catch (err: any) { 1907 A.store.Ref(errPtr, err); 1908 return A.H.FALSE; 1909 } 1910 }, 1911 "has_RunDnsResolverPresentRoutine": (): heap.Ref<boolean> => { 1912 if (WEBEXT?.os?.diagnostics && "runDnsResolverPresentRoutine" in WEBEXT?.os?.diagnostics) { 1913 return A.H.TRUE; 1914 } 1915 return A.H.FALSE; 1916 }, 1917 "func_RunDnsResolverPresentRoutine": (fn: Pointer): void => { 1918 A.store.Ref(fn, WEBEXT.os.diagnostics.runDnsResolverPresentRoutine); 1919 }, 1920 "call_RunDnsResolverPresentRoutine": (retPtr: Pointer): void => { 1921 const _ret = WEBEXT.os.diagnostics.runDnsResolverPresentRoutine(); 1922 A.store.Ref(retPtr, _ret); 1923 }, 1924 "try_RunDnsResolverPresentRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 1925 try { 1926 const _ret = WEBEXT.os.diagnostics.runDnsResolverPresentRoutine(); 1927 A.store.Ref(retPtr, _ret); 1928 return A.H.TRUE; 1929 } catch (err: any) { 1930 A.store.Ref(errPtr, err); 1931 return A.H.FALSE; 1932 } 1933 }, 1934 "has_RunEmmcLifetimeRoutine": (): heap.Ref<boolean> => { 1935 if (WEBEXT?.os?.diagnostics && "runEmmcLifetimeRoutine" in WEBEXT?.os?.diagnostics) { 1936 return A.H.TRUE; 1937 } 1938 return A.H.FALSE; 1939 }, 1940 "func_RunEmmcLifetimeRoutine": (fn: Pointer): void => { 1941 A.store.Ref(fn, WEBEXT.os.diagnostics.runEmmcLifetimeRoutine); 1942 }, 1943 "call_RunEmmcLifetimeRoutine": (retPtr: Pointer): void => { 1944 const _ret = WEBEXT.os.diagnostics.runEmmcLifetimeRoutine(); 1945 A.store.Ref(retPtr, _ret); 1946 }, 1947 "try_RunEmmcLifetimeRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 1948 try { 1949 const _ret = WEBEXT.os.diagnostics.runEmmcLifetimeRoutine(); 1950 A.store.Ref(retPtr, _ret); 1951 return A.H.TRUE; 1952 } catch (err: any) { 1953 A.store.Ref(errPtr, err); 1954 return A.H.FALSE; 1955 } 1956 }, 1957 "has_RunFingerprintAliveRoutine": (): heap.Ref<boolean> => { 1958 if (WEBEXT?.os?.diagnostics && "runFingerprintAliveRoutine" in WEBEXT?.os?.diagnostics) { 1959 return A.H.TRUE; 1960 } 1961 return A.H.FALSE; 1962 }, 1963 "func_RunFingerprintAliveRoutine": (fn: Pointer): void => { 1964 A.store.Ref(fn, WEBEXT.os.diagnostics.runFingerprintAliveRoutine); 1965 }, 1966 "call_RunFingerprintAliveRoutine": (retPtr: Pointer): void => { 1967 const _ret = WEBEXT.os.diagnostics.runFingerprintAliveRoutine(); 1968 A.store.Ref(retPtr, _ret); 1969 }, 1970 "try_RunFingerprintAliveRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 1971 try { 1972 const _ret = WEBEXT.os.diagnostics.runFingerprintAliveRoutine(); 1973 A.store.Ref(retPtr, _ret); 1974 return A.H.TRUE; 1975 } catch (err: any) { 1976 A.store.Ref(errPtr, err); 1977 return A.H.FALSE; 1978 } 1979 }, 1980 "has_RunGatewayCanBePingedRoutine": (): heap.Ref<boolean> => { 1981 if (WEBEXT?.os?.diagnostics && "runGatewayCanBePingedRoutine" in WEBEXT?.os?.diagnostics) { 1982 return A.H.TRUE; 1983 } 1984 return A.H.FALSE; 1985 }, 1986 "func_RunGatewayCanBePingedRoutine": (fn: Pointer): void => { 1987 A.store.Ref(fn, WEBEXT.os.diagnostics.runGatewayCanBePingedRoutine); 1988 }, 1989 "call_RunGatewayCanBePingedRoutine": (retPtr: Pointer): void => { 1990 const _ret = WEBEXT.os.diagnostics.runGatewayCanBePingedRoutine(); 1991 A.store.Ref(retPtr, _ret); 1992 }, 1993 "try_RunGatewayCanBePingedRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 1994 try { 1995 const _ret = WEBEXT.os.diagnostics.runGatewayCanBePingedRoutine(); 1996 A.store.Ref(retPtr, _ret); 1997 return A.H.TRUE; 1998 } catch (err: any) { 1999 A.store.Ref(errPtr, err); 2000 return A.H.FALSE; 2001 } 2002 }, 2003 "has_RunLanConnectivityRoutine": (): heap.Ref<boolean> => { 2004 if (WEBEXT?.os?.diagnostics && "runLanConnectivityRoutine" in WEBEXT?.os?.diagnostics) { 2005 return A.H.TRUE; 2006 } 2007 return A.H.FALSE; 2008 }, 2009 "func_RunLanConnectivityRoutine": (fn: Pointer): void => { 2010 A.store.Ref(fn, WEBEXT.os.diagnostics.runLanConnectivityRoutine); 2011 }, 2012 "call_RunLanConnectivityRoutine": (retPtr: Pointer): void => { 2013 const _ret = WEBEXT.os.diagnostics.runLanConnectivityRoutine(); 2014 A.store.Ref(retPtr, _ret); 2015 }, 2016 "try_RunLanConnectivityRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 2017 try { 2018 const _ret = WEBEXT.os.diagnostics.runLanConnectivityRoutine(); 2019 A.store.Ref(retPtr, _ret); 2020 return A.H.TRUE; 2021 } catch (err: any) { 2022 A.store.Ref(errPtr, err); 2023 return A.H.FALSE; 2024 } 2025 }, 2026 "has_RunMemoryRoutine": (): heap.Ref<boolean> => { 2027 if (WEBEXT?.os?.diagnostics && "runMemoryRoutine" in WEBEXT?.os?.diagnostics) { 2028 return A.H.TRUE; 2029 } 2030 return A.H.FALSE; 2031 }, 2032 "func_RunMemoryRoutine": (fn: Pointer): void => { 2033 A.store.Ref(fn, WEBEXT.os.diagnostics.runMemoryRoutine); 2034 }, 2035 "call_RunMemoryRoutine": (retPtr: Pointer): void => { 2036 const _ret = WEBEXT.os.diagnostics.runMemoryRoutine(); 2037 A.store.Ref(retPtr, _ret); 2038 }, 2039 "try_RunMemoryRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 2040 try { 2041 const _ret = WEBEXT.os.diagnostics.runMemoryRoutine(); 2042 A.store.Ref(retPtr, _ret); 2043 return A.H.TRUE; 2044 } catch (err: any) { 2045 A.store.Ref(errPtr, err); 2046 return A.H.FALSE; 2047 } 2048 }, 2049 "has_RunNvmeSelfTestRoutine": (): heap.Ref<boolean> => { 2050 if (WEBEXT?.os?.diagnostics && "runNvmeSelfTestRoutine" in WEBEXT?.os?.diagnostics) { 2051 return A.H.TRUE; 2052 } 2053 return A.H.FALSE; 2054 }, 2055 "func_RunNvmeSelfTestRoutine": (fn: Pointer): void => { 2056 A.store.Ref(fn, WEBEXT.os.diagnostics.runNvmeSelfTestRoutine); 2057 }, 2058 "call_RunNvmeSelfTestRoutine": (retPtr: Pointer, request: Pointer): void => { 2059 const request_ffi = {}; 2060 2061 request_ffi["test_type"] = A.load.Enum(request + 0, ["short_test", "long_test"]); 2062 2063 const _ret = WEBEXT.os.diagnostics.runNvmeSelfTestRoutine(request_ffi); 2064 A.store.Ref(retPtr, _ret); 2065 }, 2066 "try_RunNvmeSelfTestRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 2067 try { 2068 const request_ffi = {}; 2069 2070 request_ffi["test_type"] = A.load.Enum(request + 0, ["short_test", "long_test"]); 2071 2072 const _ret = WEBEXT.os.diagnostics.runNvmeSelfTestRoutine(request_ffi); 2073 A.store.Ref(retPtr, _ret); 2074 return A.H.TRUE; 2075 } catch (err: any) { 2076 A.store.Ref(errPtr, err); 2077 return A.H.FALSE; 2078 } 2079 }, 2080 "has_RunNvmeWearLevelRoutine": (): heap.Ref<boolean> => { 2081 if (WEBEXT?.os?.diagnostics && "runNvmeWearLevelRoutine" in WEBEXT?.os?.diagnostics) { 2082 return A.H.TRUE; 2083 } 2084 return A.H.FALSE; 2085 }, 2086 "func_RunNvmeWearLevelRoutine": (fn: Pointer): void => { 2087 A.store.Ref(fn, WEBEXT.os.diagnostics.runNvmeWearLevelRoutine); 2088 }, 2089 "call_RunNvmeWearLevelRoutine": (retPtr: Pointer, request: Pointer): void => { 2090 const request_ffi = {}; 2091 2092 if (A.load.Bool(request + 4)) { 2093 request_ffi["wear_level_threshold"] = A.load.Int32(request + 0); 2094 } 2095 2096 const _ret = WEBEXT.os.diagnostics.runNvmeWearLevelRoutine(request_ffi); 2097 A.store.Ref(retPtr, _ret); 2098 }, 2099 "try_RunNvmeWearLevelRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 2100 try { 2101 const request_ffi = {}; 2102 2103 if (A.load.Bool(request + 4)) { 2104 request_ffi["wear_level_threshold"] = A.load.Int32(request + 0); 2105 } 2106 2107 const _ret = WEBEXT.os.diagnostics.runNvmeWearLevelRoutine(request_ffi); 2108 A.store.Ref(retPtr, _ret); 2109 return A.H.TRUE; 2110 } catch (err: any) { 2111 A.store.Ref(errPtr, err); 2112 return A.H.FALSE; 2113 } 2114 }, 2115 "has_RunPowerButtonRoutine": (): heap.Ref<boolean> => { 2116 if (WEBEXT?.os?.diagnostics && "runPowerButtonRoutine" in WEBEXT?.os?.diagnostics) { 2117 return A.H.TRUE; 2118 } 2119 return A.H.FALSE; 2120 }, 2121 "func_RunPowerButtonRoutine": (fn: Pointer): void => { 2122 A.store.Ref(fn, WEBEXT.os.diagnostics.runPowerButtonRoutine); 2123 }, 2124 "call_RunPowerButtonRoutine": (retPtr: Pointer, request: Pointer): void => { 2125 const request_ffi = {}; 2126 2127 if (A.load.Bool(request + 4)) { 2128 request_ffi["timeout_seconds"] = A.load.Int32(request + 0); 2129 } 2130 2131 const _ret = WEBEXT.os.diagnostics.runPowerButtonRoutine(request_ffi); 2132 A.store.Ref(retPtr, _ret); 2133 }, 2134 "try_RunPowerButtonRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 2135 try { 2136 const request_ffi = {}; 2137 2138 if (A.load.Bool(request + 4)) { 2139 request_ffi["timeout_seconds"] = A.load.Int32(request + 0); 2140 } 2141 2142 const _ret = WEBEXT.os.diagnostics.runPowerButtonRoutine(request_ffi); 2143 A.store.Ref(retPtr, _ret); 2144 return A.H.TRUE; 2145 } catch (err: any) { 2146 A.store.Ref(errPtr, err); 2147 return A.H.FALSE; 2148 } 2149 }, 2150 "has_RunSensitiveSensorRoutine": (): heap.Ref<boolean> => { 2151 if (WEBEXT?.os?.diagnostics && "runSensitiveSensorRoutine" in WEBEXT?.os?.diagnostics) { 2152 return A.H.TRUE; 2153 } 2154 return A.H.FALSE; 2155 }, 2156 "func_RunSensitiveSensorRoutine": (fn: Pointer): void => { 2157 A.store.Ref(fn, WEBEXT.os.diagnostics.runSensitiveSensorRoutine); 2158 }, 2159 "call_RunSensitiveSensorRoutine": (retPtr: Pointer): void => { 2160 const _ret = WEBEXT.os.diagnostics.runSensitiveSensorRoutine(); 2161 A.store.Ref(retPtr, _ret); 2162 }, 2163 "try_RunSensitiveSensorRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 2164 try { 2165 const _ret = WEBEXT.os.diagnostics.runSensitiveSensorRoutine(); 2166 A.store.Ref(retPtr, _ret); 2167 return A.H.TRUE; 2168 } catch (err: any) { 2169 A.store.Ref(errPtr, err); 2170 return A.H.FALSE; 2171 } 2172 }, 2173 "has_RunSignalStrengthRoutine": (): heap.Ref<boolean> => { 2174 if (WEBEXT?.os?.diagnostics && "runSignalStrengthRoutine" in WEBEXT?.os?.diagnostics) { 2175 return A.H.TRUE; 2176 } 2177 return A.H.FALSE; 2178 }, 2179 "func_RunSignalStrengthRoutine": (fn: Pointer): void => { 2180 A.store.Ref(fn, WEBEXT.os.diagnostics.runSignalStrengthRoutine); 2181 }, 2182 "call_RunSignalStrengthRoutine": (retPtr: Pointer): void => { 2183 const _ret = WEBEXT.os.diagnostics.runSignalStrengthRoutine(); 2184 A.store.Ref(retPtr, _ret); 2185 }, 2186 "try_RunSignalStrengthRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 2187 try { 2188 const _ret = WEBEXT.os.diagnostics.runSignalStrengthRoutine(); 2189 A.store.Ref(retPtr, _ret); 2190 return A.H.TRUE; 2191 } catch (err: any) { 2192 A.store.Ref(errPtr, err); 2193 return A.H.FALSE; 2194 } 2195 }, 2196 "has_RunSmartctlCheckRoutine": (): heap.Ref<boolean> => { 2197 if (WEBEXT?.os?.diagnostics && "runSmartctlCheckRoutine" in WEBEXT?.os?.diagnostics) { 2198 return A.H.TRUE; 2199 } 2200 return A.H.FALSE; 2201 }, 2202 "func_RunSmartctlCheckRoutine": (fn: Pointer): void => { 2203 A.store.Ref(fn, WEBEXT.os.diagnostics.runSmartctlCheckRoutine); 2204 }, 2205 "call_RunSmartctlCheckRoutine": (retPtr: Pointer, request: Pointer): void => { 2206 const request_ffi = {}; 2207 2208 if (A.load.Bool(request + 4)) { 2209 request_ffi["percentage_used_threshold"] = A.load.Int32(request + 0); 2210 } 2211 2212 const _ret = WEBEXT.os.diagnostics.runSmartctlCheckRoutine(request_ffi); 2213 A.store.Ref(retPtr, _ret); 2214 }, 2215 "try_RunSmartctlCheckRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 2216 try { 2217 const request_ffi = {}; 2218 2219 if (A.load.Bool(request + 4)) { 2220 request_ffi["percentage_used_threshold"] = A.load.Int32(request + 0); 2221 } 2222 2223 const _ret = WEBEXT.os.diagnostics.runSmartctlCheckRoutine(request_ffi); 2224 A.store.Ref(retPtr, _ret); 2225 return A.H.TRUE; 2226 } catch (err: any) { 2227 A.store.Ref(errPtr, err); 2228 return A.H.FALSE; 2229 } 2230 }, 2231 "has_RunUfsLifetimeRoutine": (): heap.Ref<boolean> => { 2232 if (WEBEXT?.os?.diagnostics && "runUfsLifetimeRoutine" in WEBEXT?.os?.diagnostics) { 2233 return A.H.TRUE; 2234 } 2235 return A.H.FALSE; 2236 }, 2237 "func_RunUfsLifetimeRoutine": (fn: Pointer): void => { 2238 A.store.Ref(fn, WEBEXT.os.diagnostics.runUfsLifetimeRoutine); 2239 }, 2240 "call_RunUfsLifetimeRoutine": (retPtr: Pointer): void => { 2241 const _ret = WEBEXT.os.diagnostics.runUfsLifetimeRoutine(); 2242 A.store.Ref(retPtr, _ret); 2243 }, 2244 "try_RunUfsLifetimeRoutine": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 2245 try { 2246 const _ret = WEBEXT.os.diagnostics.runUfsLifetimeRoutine(); 2247 A.store.Ref(retPtr, _ret); 2248 return A.H.TRUE; 2249 } catch (err: any) { 2250 A.store.Ref(errPtr, err); 2251 return A.H.FALSE; 2252 } 2253 }, 2254 "has_StartRoutine": (): heap.Ref<boolean> => { 2255 if (WEBEXT?.os?.diagnostics && "startRoutine" in WEBEXT?.os?.diagnostics) { 2256 return A.H.TRUE; 2257 } 2258 return A.H.FALSE; 2259 }, 2260 "func_StartRoutine": (fn: Pointer): void => { 2261 A.store.Ref(fn, WEBEXT.os.diagnostics.startRoutine); 2262 }, 2263 "call_StartRoutine": (retPtr: Pointer, request: Pointer): void => { 2264 const request_ffi = {}; 2265 2266 request_ffi["uuid"] = A.load.Ref(request + 0, undefined); 2267 2268 const _ret = WEBEXT.os.diagnostics.startRoutine(request_ffi); 2269 A.store.Ref(retPtr, _ret); 2270 }, 2271 "try_StartRoutine": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => { 2272 try { 2273 const request_ffi = {}; 2274 2275 request_ffi["uuid"] = A.load.Ref(request + 0, undefined); 2276 2277 const _ret = WEBEXT.os.diagnostics.startRoutine(request_ffi); 2278 A.store.Ref(retPtr, _ret); 2279 return A.H.TRUE; 2280 } catch (err: any) { 2281 A.store.Ref(errPtr, err); 2282 return A.H.FALSE; 2283 } 2284 }, 2285 }; 2286 });