github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/notifications/bindings/ffi_bindings.ts (about) 1 import { importModule, Application, heap, Pointer } from "@ffi"; 2 3 importModule("plat/js/webext/notifications", (A: Application) => { 4 const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser; 5 6 return { 7 "store_NotificationBitmap": (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 + 14, false); 12 A.store.Bool(ptr + 12, false); 13 A.store.Int32(ptr + 0, 0); 14 A.store.Bool(ptr + 13, false); 15 A.store.Int32(ptr + 4, 0); 16 A.store.Ref(ptr + 8, undefined); 17 } else { 18 A.store.Bool(ptr + 14, true); 19 A.store.Bool(ptr + 12, "width" in x ? true : false); 20 A.store.Int32(ptr + 0, x["width"] === undefined ? 0 : (x["width"] as number)); 21 A.store.Bool(ptr + 13, "height" in x ? true : false); 22 A.store.Int32(ptr + 4, x["height"] === undefined ? 0 : (x["height"] as number)); 23 A.store.Ref(ptr + 8, x["data"]); 24 } 25 }, 26 "load_NotificationBitmap": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 27 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 28 29 if (A.load.Bool(ptr + 12)) { 30 x["width"] = A.load.Int32(ptr + 0); 31 } else { 32 delete x["width"]; 33 } 34 if (A.load.Bool(ptr + 13)) { 35 x["height"] = A.load.Int32(ptr + 4); 36 } else { 37 delete x["height"]; 38 } 39 x["data"] = A.load.Ref(ptr + 8, undefined); 40 return create === A.H.TRUE ? A.H.push(x) : ref; 41 }, 42 43 "store_NotificationButton": (ptr: Pointer, ref: heap.Ref<any>) => { 44 const x = A.H.get<any>(ref); 45 46 if (typeof x === "undefined") { 47 A.store.Bool(ptr + 23, false); 48 A.store.Ref(ptr + 0, undefined); 49 A.store.Ref(ptr + 4, undefined); 50 51 A.store.Bool(ptr + 8 + 14, false); 52 A.store.Bool(ptr + 8 + 12, false); 53 A.store.Int32(ptr + 8 + 0, 0); 54 A.store.Bool(ptr + 8 + 13, false); 55 A.store.Int32(ptr + 8 + 4, 0); 56 A.store.Ref(ptr + 8 + 8, undefined); 57 } else { 58 A.store.Bool(ptr + 23, true); 59 A.store.Ref(ptr + 0, x["title"]); 60 A.store.Ref(ptr + 4, x["iconUrl"]); 61 62 if (typeof x["iconBitmap"] === "undefined") { 63 A.store.Bool(ptr + 8 + 14, false); 64 A.store.Bool(ptr + 8 + 12, false); 65 A.store.Int32(ptr + 8 + 0, 0); 66 A.store.Bool(ptr + 8 + 13, false); 67 A.store.Int32(ptr + 8 + 4, 0); 68 A.store.Ref(ptr + 8 + 8, undefined); 69 } else { 70 A.store.Bool(ptr + 8 + 14, true); 71 A.store.Bool(ptr + 8 + 12, "width" in x["iconBitmap"] ? true : false); 72 A.store.Int32(ptr + 8 + 0, x["iconBitmap"]["width"] === undefined ? 0 : (x["iconBitmap"]["width"] as number)); 73 A.store.Bool(ptr + 8 + 13, "height" in x["iconBitmap"] ? true : false); 74 A.store.Int32( 75 ptr + 8 + 4, 76 x["iconBitmap"]["height"] === undefined ? 0 : (x["iconBitmap"]["height"] as number) 77 ); 78 A.store.Ref(ptr + 8 + 8, x["iconBitmap"]["data"]); 79 } 80 } 81 }, 82 "load_NotificationButton": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 83 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 84 85 x["title"] = A.load.Ref(ptr + 0, undefined); 86 x["iconUrl"] = A.load.Ref(ptr + 4, undefined); 87 if (A.load.Bool(ptr + 8 + 14)) { 88 x["iconBitmap"] = {}; 89 if (A.load.Bool(ptr + 8 + 12)) { 90 x["iconBitmap"]["width"] = A.load.Int32(ptr + 8 + 0); 91 } else { 92 delete x["iconBitmap"]["width"]; 93 } 94 if (A.load.Bool(ptr + 8 + 13)) { 95 x["iconBitmap"]["height"] = A.load.Int32(ptr + 8 + 4); 96 } else { 97 delete x["iconBitmap"]["height"]; 98 } 99 x["iconBitmap"]["data"] = A.load.Ref(ptr + 8 + 8, undefined); 100 } else { 101 delete x["iconBitmap"]; 102 } 103 return create === A.H.TRUE ? A.H.push(x) : ref; 104 }, 105 106 "store_NotificationItem": (ptr: Pointer, ref: heap.Ref<any>) => { 107 const x = A.H.get<any>(ref); 108 109 if (typeof x === "undefined") { 110 A.store.Bool(ptr + 8, false); 111 A.store.Ref(ptr + 0, undefined); 112 A.store.Ref(ptr + 4, undefined); 113 } else { 114 A.store.Bool(ptr + 8, true); 115 A.store.Ref(ptr + 0, x["title"]); 116 A.store.Ref(ptr + 4, x["message"]); 117 } 118 }, 119 "load_NotificationItem": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 120 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 121 122 x["title"] = A.load.Ref(ptr + 0, undefined); 123 x["message"] = A.load.Ref(ptr + 4, undefined); 124 return create === A.H.TRUE ? A.H.push(x) : ref; 125 }, 126 "constof_TemplateType": (ref: heap.Ref<string>): number => { 127 const idx = ["basic", "image", "list", "progress"].indexOf(A.H.get(ref)); 128 return idx < 0 ? 0 : idx + 1; 129 }, 130 131 "store_NotificationOptions": (ptr: Pointer, ref: heap.Ref<any>) => { 132 const x = A.H.get<any>(ref); 133 134 if (typeof x === "undefined") { 135 A.store.Bool(ptr + 117, false); 136 A.store.Enum(ptr + 0, -1); 137 A.store.Ref(ptr + 4, undefined); 138 139 A.store.Bool(ptr + 8 + 14, false); 140 A.store.Bool(ptr + 8 + 12, false); 141 A.store.Int32(ptr + 8 + 0, 0); 142 A.store.Bool(ptr + 8 + 13, false); 143 A.store.Int32(ptr + 8 + 4, 0); 144 A.store.Ref(ptr + 8 + 8, undefined); 145 A.store.Ref(ptr + 24, undefined); 146 147 A.store.Bool(ptr + 28 + 14, false); 148 A.store.Bool(ptr + 28 + 12, false); 149 A.store.Int32(ptr + 28 + 0, 0); 150 A.store.Bool(ptr + 28 + 13, false); 151 A.store.Int32(ptr + 28 + 4, 0); 152 A.store.Ref(ptr + 28 + 8, undefined); 153 A.store.Ref(ptr + 44, undefined); 154 A.store.Ref(ptr + 48, undefined); 155 A.store.Ref(ptr + 52, undefined); 156 A.store.Bool(ptr + 111, false); 157 A.store.Int32(ptr + 56, 0); 158 A.store.Bool(ptr + 112, false); 159 A.store.Float64(ptr + 64, 0); 160 A.store.Ref(ptr + 72, undefined); 161 A.store.Ref(ptr + 76, undefined); 162 A.store.Ref(ptr + 80, undefined); 163 164 A.store.Bool(ptr + 84 + 14, false); 165 A.store.Bool(ptr + 84 + 12, false); 166 A.store.Int32(ptr + 84 + 0, 0); 167 A.store.Bool(ptr + 84 + 13, false); 168 A.store.Int32(ptr + 84 + 4, 0); 169 A.store.Ref(ptr + 84 + 8, undefined); 170 A.store.Ref(ptr + 100, undefined); 171 A.store.Bool(ptr + 113, false); 172 A.store.Int32(ptr + 104, 0); 173 A.store.Bool(ptr + 114, false); 174 A.store.Bool(ptr + 108, false); 175 A.store.Bool(ptr + 115, false); 176 A.store.Bool(ptr + 109, false); 177 A.store.Bool(ptr + 116, false); 178 A.store.Bool(ptr + 110, false); 179 } else { 180 A.store.Bool(ptr + 117, true); 181 A.store.Enum(ptr + 0, ["basic", "image", "list", "progress"].indexOf(x["type"] as string)); 182 A.store.Ref(ptr + 4, x["iconUrl"]); 183 184 if (typeof x["iconBitmap"] === "undefined") { 185 A.store.Bool(ptr + 8 + 14, false); 186 A.store.Bool(ptr + 8 + 12, false); 187 A.store.Int32(ptr + 8 + 0, 0); 188 A.store.Bool(ptr + 8 + 13, false); 189 A.store.Int32(ptr + 8 + 4, 0); 190 A.store.Ref(ptr + 8 + 8, undefined); 191 } else { 192 A.store.Bool(ptr + 8 + 14, true); 193 A.store.Bool(ptr + 8 + 12, "width" in x["iconBitmap"] ? true : false); 194 A.store.Int32(ptr + 8 + 0, x["iconBitmap"]["width"] === undefined ? 0 : (x["iconBitmap"]["width"] as number)); 195 A.store.Bool(ptr + 8 + 13, "height" in x["iconBitmap"] ? true : false); 196 A.store.Int32( 197 ptr + 8 + 4, 198 x["iconBitmap"]["height"] === undefined ? 0 : (x["iconBitmap"]["height"] as number) 199 ); 200 A.store.Ref(ptr + 8 + 8, x["iconBitmap"]["data"]); 201 } 202 A.store.Ref(ptr + 24, x["appIconMaskUrl"]); 203 204 if (typeof x["appIconMaskBitmap"] === "undefined") { 205 A.store.Bool(ptr + 28 + 14, false); 206 A.store.Bool(ptr + 28 + 12, false); 207 A.store.Int32(ptr + 28 + 0, 0); 208 A.store.Bool(ptr + 28 + 13, false); 209 A.store.Int32(ptr + 28 + 4, 0); 210 A.store.Ref(ptr + 28 + 8, undefined); 211 } else { 212 A.store.Bool(ptr + 28 + 14, true); 213 A.store.Bool(ptr + 28 + 12, "width" in x["appIconMaskBitmap"] ? true : false); 214 A.store.Int32( 215 ptr + 28 + 0, 216 x["appIconMaskBitmap"]["width"] === undefined ? 0 : (x["appIconMaskBitmap"]["width"] as number) 217 ); 218 A.store.Bool(ptr + 28 + 13, "height" in x["appIconMaskBitmap"] ? true : false); 219 A.store.Int32( 220 ptr + 28 + 4, 221 x["appIconMaskBitmap"]["height"] === undefined ? 0 : (x["appIconMaskBitmap"]["height"] as number) 222 ); 223 A.store.Ref(ptr + 28 + 8, x["appIconMaskBitmap"]["data"]); 224 } 225 A.store.Ref(ptr + 44, x["title"]); 226 A.store.Ref(ptr + 48, x["message"]); 227 A.store.Ref(ptr + 52, x["contextMessage"]); 228 A.store.Bool(ptr + 111, "priority" in x ? true : false); 229 A.store.Int32(ptr + 56, x["priority"] === undefined ? 0 : (x["priority"] as number)); 230 A.store.Bool(ptr + 112, "eventTime" in x ? true : false); 231 A.store.Float64(ptr + 64, x["eventTime"] === undefined ? 0 : (x["eventTime"] as number)); 232 A.store.Ref(ptr + 72, x["buttons"]); 233 A.store.Ref(ptr + 76, x["expandedMessage"]); 234 A.store.Ref(ptr + 80, x["imageUrl"]); 235 236 if (typeof x["imageBitmap"] === "undefined") { 237 A.store.Bool(ptr + 84 + 14, false); 238 A.store.Bool(ptr + 84 + 12, false); 239 A.store.Int32(ptr + 84 + 0, 0); 240 A.store.Bool(ptr + 84 + 13, false); 241 A.store.Int32(ptr + 84 + 4, 0); 242 A.store.Ref(ptr + 84 + 8, undefined); 243 } else { 244 A.store.Bool(ptr + 84 + 14, true); 245 A.store.Bool(ptr + 84 + 12, "width" in x["imageBitmap"] ? true : false); 246 A.store.Int32( 247 ptr + 84 + 0, 248 x["imageBitmap"]["width"] === undefined ? 0 : (x["imageBitmap"]["width"] as number) 249 ); 250 A.store.Bool(ptr + 84 + 13, "height" in x["imageBitmap"] ? true : false); 251 A.store.Int32( 252 ptr + 84 + 4, 253 x["imageBitmap"]["height"] === undefined ? 0 : (x["imageBitmap"]["height"] as number) 254 ); 255 A.store.Ref(ptr + 84 + 8, x["imageBitmap"]["data"]); 256 } 257 A.store.Ref(ptr + 100, x["items"]); 258 A.store.Bool(ptr + 113, "progress" in x ? true : false); 259 A.store.Int32(ptr + 104, x["progress"] === undefined ? 0 : (x["progress"] as number)); 260 A.store.Bool(ptr + 114, "isClickable" in x ? true : false); 261 A.store.Bool(ptr + 108, x["isClickable"] ? true : false); 262 A.store.Bool(ptr + 115, "requireInteraction" in x ? true : false); 263 A.store.Bool(ptr + 109, x["requireInteraction"] ? true : false); 264 A.store.Bool(ptr + 116, "silent" in x ? true : false); 265 A.store.Bool(ptr + 110, x["silent"] ? true : false); 266 } 267 }, 268 "load_NotificationOptions": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => { 269 const x = create === A.H.TRUE ? {} : A.H.get<any>(ref); 270 271 x["type"] = A.load.Enum(ptr + 0, ["basic", "image", "list", "progress"]); 272 x["iconUrl"] = A.load.Ref(ptr + 4, undefined); 273 if (A.load.Bool(ptr + 8 + 14)) { 274 x["iconBitmap"] = {}; 275 if (A.load.Bool(ptr + 8 + 12)) { 276 x["iconBitmap"]["width"] = A.load.Int32(ptr + 8 + 0); 277 } else { 278 delete x["iconBitmap"]["width"]; 279 } 280 if (A.load.Bool(ptr + 8 + 13)) { 281 x["iconBitmap"]["height"] = A.load.Int32(ptr + 8 + 4); 282 } else { 283 delete x["iconBitmap"]["height"]; 284 } 285 x["iconBitmap"]["data"] = A.load.Ref(ptr + 8 + 8, undefined); 286 } else { 287 delete x["iconBitmap"]; 288 } 289 x["appIconMaskUrl"] = A.load.Ref(ptr + 24, undefined); 290 if (A.load.Bool(ptr + 28 + 14)) { 291 x["appIconMaskBitmap"] = {}; 292 if (A.load.Bool(ptr + 28 + 12)) { 293 x["appIconMaskBitmap"]["width"] = A.load.Int32(ptr + 28 + 0); 294 } else { 295 delete x["appIconMaskBitmap"]["width"]; 296 } 297 if (A.load.Bool(ptr + 28 + 13)) { 298 x["appIconMaskBitmap"]["height"] = A.load.Int32(ptr + 28 + 4); 299 } else { 300 delete x["appIconMaskBitmap"]["height"]; 301 } 302 x["appIconMaskBitmap"]["data"] = A.load.Ref(ptr + 28 + 8, undefined); 303 } else { 304 delete x["appIconMaskBitmap"]; 305 } 306 x["title"] = A.load.Ref(ptr + 44, undefined); 307 x["message"] = A.load.Ref(ptr + 48, undefined); 308 x["contextMessage"] = A.load.Ref(ptr + 52, undefined); 309 if (A.load.Bool(ptr + 111)) { 310 x["priority"] = A.load.Int32(ptr + 56); 311 } else { 312 delete x["priority"]; 313 } 314 if (A.load.Bool(ptr + 112)) { 315 x["eventTime"] = A.load.Float64(ptr + 64); 316 } else { 317 delete x["eventTime"]; 318 } 319 x["buttons"] = A.load.Ref(ptr + 72, undefined); 320 x["expandedMessage"] = A.load.Ref(ptr + 76, undefined); 321 x["imageUrl"] = A.load.Ref(ptr + 80, undefined); 322 if (A.load.Bool(ptr + 84 + 14)) { 323 x["imageBitmap"] = {}; 324 if (A.load.Bool(ptr + 84 + 12)) { 325 x["imageBitmap"]["width"] = A.load.Int32(ptr + 84 + 0); 326 } else { 327 delete x["imageBitmap"]["width"]; 328 } 329 if (A.load.Bool(ptr + 84 + 13)) { 330 x["imageBitmap"]["height"] = A.load.Int32(ptr + 84 + 4); 331 } else { 332 delete x["imageBitmap"]["height"]; 333 } 334 x["imageBitmap"]["data"] = A.load.Ref(ptr + 84 + 8, undefined); 335 } else { 336 delete x["imageBitmap"]; 337 } 338 x["items"] = A.load.Ref(ptr + 100, undefined); 339 if (A.load.Bool(ptr + 113)) { 340 x["progress"] = A.load.Int32(ptr + 104); 341 } else { 342 delete x["progress"]; 343 } 344 if (A.load.Bool(ptr + 114)) { 345 x["isClickable"] = A.load.Bool(ptr + 108); 346 } else { 347 delete x["isClickable"]; 348 } 349 if (A.load.Bool(ptr + 115)) { 350 x["requireInteraction"] = A.load.Bool(ptr + 109); 351 } else { 352 delete x["requireInteraction"]; 353 } 354 if (A.load.Bool(ptr + 116)) { 355 x["silent"] = A.load.Bool(ptr + 110); 356 } else { 357 delete x["silent"]; 358 } 359 return create === A.H.TRUE ? A.H.push(x) : ref; 360 }, 361 "constof_PermissionLevel": (ref: heap.Ref<string>): number => { 362 const idx = ["granted", "denied"].indexOf(A.H.get(ref)); 363 return idx < 0 ? 0 : idx + 1; 364 }, 365 "has_Clear": (): heap.Ref<boolean> => { 366 if (WEBEXT?.notifications && "clear" in WEBEXT?.notifications) { 367 return A.H.TRUE; 368 } 369 return A.H.FALSE; 370 }, 371 "func_Clear": (fn: Pointer): void => { 372 A.store.Ref(fn, WEBEXT.notifications.clear); 373 }, 374 "call_Clear": (retPtr: Pointer, notificationId: heap.Ref<object>): void => { 375 const _ret = WEBEXT.notifications.clear(A.H.get<object>(notificationId)); 376 A.store.Ref(retPtr, _ret); 377 }, 378 "try_Clear": (retPtr: Pointer, errPtr: Pointer, notificationId: heap.Ref<object>): heap.Ref<boolean> => { 379 try { 380 const _ret = WEBEXT.notifications.clear(A.H.get<object>(notificationId)); 381 A.store.Ref(retPtr, _ret); 382 return A.H.TRUE; 383 } catch (err: any) { 384 A.store.Ref(errPtr, err); 385 return A.H.FALSE; 386 } 387 }, 388 "has_Create": (): heap.Ref<boolean> => { 389 if (WEBEXT?.notifications && "create" in WEBEXT?.notifications) { 390 return A.H.TRUE; 391 } 392 return A.H.FALSE; 393 }, 394 "func_Create": (fn: Pointer): void => { 395 A.store.Ref(fn, WEBEXT.notifications.create); 396 }, 397 "call_Create": (retPtr: Pointer, notificationId: heap.Ref<object>, options: Pointer): void => { 398 const options_ffi = {}; 399 400 options_ffi["type"] = A.load.Enum(options + 0, ["basic", "image", "list", "progress"]); 401 options_ffi["iconUrl"] = A.load.Ref(options + 4, undefined); 402 if (A.load.Bool(options + 8 + 14)) { 403 options_ffi["iconBitmap"] = {}; 404 if (A.load.Bool(options + 8 + 12)) { 405 options_ffi["iconBitmap"]["width"] = A.load.Int32(options + 8 + 0); 406 } 407 if (A.load.Bool(options + 8 + 13)) { 408 options_ffi["iconBitmap"]["height"] = A.load.Int32(options + 8 + 4); 409 } 410 options_ffi["iconBitmap"]["data"] = A.load.Ref(options + 8 + 8, undefined); 411 } 412 options_ffi["appIconMaskUrl"] = A.load.Ref(options + 24, undefined); 413 if (A.load.Bool(options + 28 + 14)) { 414 options_ffi["appIconMaskBitmap"] = {}; 415 if (A.load.Bool(options + 28 + 12)) { 416 options_ffi["appIconMaskBitmap"]["width"] = A.load.Int32(options + 28 + 0); 417 } 418 if (A.load.Bool(options + 28 + 13)) { 419 options_ffi["appIconMaskBitmap"]["height"] = A.load.Int32(options + 28 + 4); 420 } 421 options_ffi["appIconMaskBitmap"]["data"] = A.load.Ref(options + 28 + 8, undefined); 422 } 423 options_ffi["title"] = A.load.Ref(options + 44, undefined); 424 options_ffi["message"] = A.load.Ref(options + 48, undefined); 425 options_ffi["contextMessage"] = A.load.Ref(options + 52, undefined); 426 if (A.load.Bool(options + 111)) { 427 options_ffi["priority"] = A.load.Int32(options + 56); 428 } 429 if (A.load.Bool(options + 112)) { 430 options_ffi["eventTime"] = A.load.Float64(options + 64); 431 } 432 options_ffi["buttons"] = A.load.Ref(options + 72, undefined); 433 options_ffi["expandedMessage"] = A.load.Ref(options + 76, undefined); 434 options_ffi["imageUrl"] = A.load.Ref(options + 80, undefined); 435 if (A.load.Bool(options + 84 + 14)) { 436 options_ffi["imageBitmap"] = {}; 437 if (A.load.Bool(options + 84 + 12)) { 438 options_ffi["imageBitmap"]["width"] = A.load.Int32(options + 84 + 0); 439 } 440 if (A.load.Bool(options + 84 + 13)) { 441 options_ffi["imageBitmap"]["height"] = A.load.Int32(options + 84 + 4); 442 } 443 options_ffi["imageBitmap"]["data"] = A.load.Ref(options + 84 + 8, undefined); 444 } 445 options_ffi["items"] = A.load.Ref(options + 100, undefined); 446 if (A.load.Bool(options + 113)) { 447 options_ffi["progress"] = A.load.Int32(options + 104); 448 } 449 if (A.load.Bool(options + 114)) { 450 options_ffi["isClickable"] = A.load.Bool(options + 108); 451 } 452 if (A.load.Bool(options + 115)) { 453 options_ffi["requireInteraction"] = A.load.Bool(options + 109); 454 } 455 if (A.load.Bool(options + 116)) { 456 options_ffi["silent"] = A.load.Bool(options + 110); 457 } 458 459 const _ret = WEBEXT.notifications.create(A.H.get<object>(notificationId), options_ffi); 460 A.store.Ref(retPtr, _ret); 461 }, 462 "try_Create": ( 463 retPtr: Pointer, 464 errPtr: Pointer, 465 notificationId: heap.Ref<object>, 466 options: Pointer 467 ): heap.Ref<boolean> => { 468 try { 469 const options_ffi = {}; 470 471 options_ffi["type"] = A.load.Enum(options + 0, ["basic", "image", "list", "progress"]); 472 options_ffi["iconUrl"] = A.load.Ref(options + 4, undefined); 473 if (A.load.Bool(options + 8 + 14)) { 474 options_ffi["iconBitmap"] = {}; 475 if (A.load.Bool(options + 8 + 12)) { 476 options_ffi["iconBitmap"]["width"] = A.load.Int32(options + 8 + 0); 477 } 478 if (A.load.Bool(options + 8 + 13)) { 479 options_ffi["iconBitmap"]["height"] = A.load.Int32(options + 8 + 4); 480 } 481 options_ffi["iconBitmap"]["data"] = A.load.Ref(options + 8 + 8, undefined); 482 } 483 options_ffi["appIconMaskUrl"] = A.load.Ref(options + 24, undefined); 484 if (A.load.Bool(options + 28 + 14)) { 485 options_ffi["appIconMaskBitmap"] = {}; 486 if (A.load.Bool(options + 28 + 12)) { 487 options_ffi["appIconMaskBitmap"]["width"] = A.load.Int32(options + 28 + 0); 488 } 489 if (A.load.Bool(options + 28 + 13)) { 490 options_ffi["appIconMaskBitmap"]["height"] = A.load.Int32(options + 28 + 4); 491 } 492 options_ffi["appIconMaskBitmap"]["data"] = A.load.Ref(options + 28 + 8, undefined); 493 } 494 options_ffi["title"] = A.load.Ref(options + 44, undefined); 495 options_ffi["message"] = A.load.Ref(options + 48, undefined); 496 options_ffi["contextMessage"] = A.load.Ref(options + 52, undefined); 497 if (A.load.Bool(options + 111)) { 498 options_ffi["priority"] = A.load.Int32(options + 56); 499 } 500 if (A.load.Bool(options + 112)) { 501 options_ffi["eventTime"] = A.load.Float64(options + 64); 502 } 503 options_ffi["buttons"] = A.load.Ref(options + 72, undefined); 504 options_ffi["expandedMessage"] = A.load.Ref(options + 76, undefined); 505 options_ffi["imageUrl"] = A.load.Ref(options + 80, undefined); 506 if (A.load.Bool(options + 84 + 14)) { 507 options_ffi["imageBitmap"] = {}; 508 if (A.load.Bool(options + 84 + 12)) { 509 options_ffi["imageBitmap"]["width"] = A.load.Int32(options + 84 + 0); 510 } 511 if (A.load.Bool(options + 84 + 13)) { 512 options_ffi["imageBitmap"]["height"] = A.load.Int32(options + 84 + 4); 513 } 514 options_ffi["imageBitmap"]["data"] = A.load.Ref(options + 84 + 8, undefined); 515 } 516 options_ffi["items"] = A.load.Ref(options + 100, undefined); 517 if (A.load.Bool(options + 113)) { 518 options_ffi["progress"] = A.load.Int32(options + 104); 519 } 520 if (A.load.Bool(options + 114)) { 521 options_ffi["isClickable"] = A.load.Bool(options + 108); 522 } 523 if (A.load.Bool(options + 115)) { 524 options_ffi["requireInteraction"] = A.load.Bool(options + 109); 525 } 526 if (A.load.Bool(options + 116)) { 527 options_ffi["silent"] = A.load.Bool(options + 110); 528 } 529 530 const _ret = WEBEXT.notifications.create(A.H.get<object>(notificationId), options_ffi); 531 A.store.Ref(retPtr, _ret); 532 return A.H.TRUE; 533 } catch (err: any) { 534 A.store.Ref(errPtr, err); 535 return A.H.FALSE; 536 } 537 }, 538 "has_GetAll": (): heap.Ref<boolean> => { 539 if (WEBEXT?.notifications && "getAll" in WEBEXT?.notifications) { 540 return A.H.TRUE; 541 } 542 return A.H.FALSE; 543 }, 544 "func_GetAll": (fn: Pointer): void => { 545 A.store.Ref(fn, WEBEXT.notifications.getAll); 546 }, 547 "call_GetAll": (retPtr: Pointer): void => { 548 const _ret = WEBEXT.notifications.getAll(); 549 A.store.Ref(retPtr, _ret); 550 }, 551 "try_GetAll": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 552 try { 553 const _ret = WEBEXT.notifications.getAll(); 554 A.store.Ref(retPtr, _ret); 555 return A.H.TRUE; 556 } catch (err: any) { 557 A.store.Ref(errPtr, err); 558 return A.H.FALSE; 559 } 560 }, 561 "has_GetPermissionLevel": (): heap.Ref<boolean> => { 562 if (WEBEXT?.notifications && "getPermissionLevel" in WEBEXT?.notifications) { 563 return A.H.TRUE; 564 } 565 return A.H.FALSE; 566 }, 567 "func_GetPermissionLevel": (fn: Pointer): void => { 568 A.store.Ref(fn, WEBEXT.notifications.getPermissionLevel); 569 }, 570 "call_GetPermissionLevel": (retPtr: Pointer): void => { 571 const _ret = WEBEXT.notifications.getPermissionLevel(); 572 A.store.Ref(retPtr, _ret); 573 }, 574 "try_GetPermissionLevel": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => { 575 try { 576 const _ret = WEBEXT.notifications.getPermissionLevel(); 577 A.store.Ref(retPtr, _ret); 578 return A.H.TRUE; 579 } catch (err: any) { 580 A.store.Ref(errPtr, err); 581 return A.H.FALSE; 582 } 583 }, 584 "has_OnButtonClicked": (): heap.Ref<boolean> => { 585 if (WEBEXT?.notifications?.onButtonClicked && "addListener" in WEBEXT?.notifications?.onButtonClicked) { 586 return A.H.TRUE; 587 } 588 return A.H.FALSE; 589 }, 590 "func_OnButtonClicked": (fn: Pointer): void => { 591 A.store.Ref(fn, WEBEXT.notifications.onButtonClicked.addListener); 592 }, 593 "call_OnButtonClicked": (retPtr: Pointer, callback: heap.Ref<object>): void => { 594 const _ret = WEBEXT.notifications.onButtonClicked.addListener(A.H.get<object>(callback)); 595 }, 596 "try_OnButtonClicked": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 597 try { 598 const _ret = WEBEXT.notifications.onButtonClicked.addListener(A.H.get<object>(callback)); 599 return A.H.TRUE; 600 } catch (err: any) { 601 A.store.Ref(errPtr, err); 602 return A.H.FALSE; 603 } 604 }, 605 "has_OffButtonClicked": (): heap.Ref<boolean> => { 606 if (WEBEXT?.notifications?.onButtonClicked && "removeListener" in WEBEXT?.notifications?.onButtonClicked) { 607 return A.H.TRUE; 608 } 609 return A.H.FALSE; 610 }, 611 "func_OffButtonClicked": (fn: Pointer): void => { 612 A.store.Ref(fn, WEBEXT.notifications.onButtonClicked.removeListener); 613 }, 614 "call_OffButtonClicked": (retPtr: Pointer, callback: heap.Ref<object>): void => { 615 const _ret = WEBEXT.notifications.onButtonClicked.removeListener(A.H.get<object>(callback)); 616 }, 617 "try_OffButtonClicked": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 618 try { 619 const _ret = WEBEXT.notifications.onButtonClicked.removeListener(A.H.get<object>(callback)); 620 return A.H.TRUE; 621 } catch (err: any) { 622 A.store.Ref(errPtr, err); 623 return A.H.FALSE; 624 } 625 }, 626 "has_HasOnButtonClicked": (): heap.Ref<boolean> => { 627 if (WEBEXT?.notifications?.onButtonClicked && "hasListener" in WEBEXT?.notifications?.onButtonClicked) { 628 return A.H.TRUE; 629 } 630 return A.H.FALSE; 631 }, 632 "func_HasOnButtonClicked": (fn: Pointer): void => { 633 A.store.Ref(fn, WEBEXT.notifications.onButtonClicked.hasListener); 634 }, 635 "call_HasOnButtonClicked": (retPtr: Pointer, callback: heap.Ref<object>): void => { 636 const _ret = WEBEXT.notifications.onButtonClicked.hasListener(A.H.get<object>(callback)); 637 A.store.Bool(retPtr, _ret); 638 }, 639 "try_HasOnButtonClicked": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 640 try { 641 const _ret = WEBEXT.notifications.onButtonClicked.hasListener(A.H.get<object>(callback)); 642 A.store.Bool(retPtr, _ret); 643 return A.H.TRUE; 644 } catch (err: any) { 645 A.store.Ref(errPtr, err); 646 return A.H.FALSE; 647 } 648 }, 649 "has_OnClicked": (): heap.Ref<boolean> => { 650 if (WEBEXT?.notifications?.onClicked && "addListener" in WEBEXT?.notifications?.onClicked) { 651 return A.H.TRUE; 652 } 653 return A.H.FALSE; 654 }, 655 "func_OnClicked": (fn: Pointer): void => { 656 A.store.Ref(fn, WEBEXT.notifications.onClicked.addListener); 657 }, 658 "call_OnClicked": (retPtr: Pointer, callback: heap.Ref<object>): void => { 659 const _ret = WEBEXT.notifications.onClicked.addListener(A.H.get<object>(callback)); 660 }, 661 "try_OnClicked": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 662 try { 663 const _ret = WEBEXT.notifications.onClicked.addListener(A.H.get<object>(callback)); 664 return A.H.TRUE; 665 } catch (err: any) { 666 A.store.Ref(errPtr, err); 667 return A.H.FALSE; 668 } 669 }, 670 "has_OffClicked": (): heap.Ref<boolean> => { 671 if (WEBEXT?.notifications?.onClicked && "removeListener" in WEBEXT?.notifications?.onClicked) { 672 return A.H.TRUE; 673 } 674 return A.H.FALSE; 675 }, 676 "func_OffClicked": (fn: Pointer): void => { 677 A.store.Ref(fn, WEBEXT.notifications.onClicked.removeListener); 678 }, 679 "call_OffClicked": (retPtr: Pointer, callback: heap.Ref<object>): void => { 680 const _ret = WEBEXT.notifications.onClicked.removeListener(A.H.get<object>(callback)); 681 }, 682 "try_OffClicked": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 683 try { 684 const _ret = WEBEXT.notifications.onClicked.removeListener(A.H.get<object>(callback)); 685 return A.H.TRUE; 686 } catch (err: any) { 687 A.store.Ref(errPtr, err); 688 return A.H.FALSE; 689 } 690 }, 691 "has_HasOnClicked": (): heap.Ref<boolean> => { 692 if (WEBEXT?.notifications?.onClicked && "hasListener" in WEBEXT?.notifications?.onClicked) { 693 return A.H.TRUE; 694 } 695 return A.H.FALSE; 696 }, 697 "func_HasOnClicked": (fn: Pointer): void => { 698 A.store.Ref(fn, WEBEXT.notifications.onClicked.hasListener); 699 }, 700 "call_HasOnClicked": (retPtr: Pointer, callback: heap.Ref<object>): void => { 701 const _ret = WEBEXT.notifications.onClicked.hasListener(A.H.get<object>(callback)); 702 A.store.Bool(retPtr, _ret); 703 }, 704 "try_HasOnClicked": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 705 try { 706 const _ret = WEBEXT.notifications.onClicked.hasListener(A.H.get<object>(callback)); 707 A.store.Bool(retPtr, _ret); 708 return A.H.TRUE; 709 } catch (err: any) { 710 A.store.Ref(errPtr, err); 711 return A.H.FALSE; 712 } 713 }, 714 "has_OnClosed": (): heap.Ref<boolean> => { 715 if (WEBEXT?.notifications?.onClosed && "addListener" in WEBEXT?.notifications?.onClosed) { 716 return A.H.TRUE; 717 } 718 return A.H.FALSE; 719 }, 720 "func_OnClosed": (fn: Pointer): void => { 721 A.store.Ref(fn, WEBEXT.notifications.onClosed.addListener); 722 }, 723 "call_OnClosed": (retPtr: Pointer, callback: heap.Ref<object>): void => { 724 const _ret = WEBEXT.notifications.onClosed.addListener(A.H.get<object>(callback)); 725 }, 726 "try_OnClosed": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 727 try { 728 const _ret = WEBEXT.notifications.onClosed.addListener(A.H.get<object>(callback)); 729 return A.H.TRUE; 730 } catch (err: any) { 731 A.store.Ref(errPtr, err); 732 return A.H.FALSE; 733 } 734 }, 735 "has_OffClosed": (): heap.Ref<boolean> => { 736 if (WEBEXT?.notifications?.onClosed && "removeListener" in WEBEXT?.notifications?.onClosed) { 737 return A.H.TRUE; 738 } 739 return A.H.FALSE; 740 }, 741 "func_OffClosed": (fn: Pointer): void => { 742 A.store.Ref(fn, WEBEXT.notifications.onClosed.removeListener); 743 }, 744 "call_OffClosed": (retPtr: Pointer, callback: heap.Ref<object>): void => { 745 const _ret = WEBEXT.notifications.onClosed.removeListener(A.H.get<object>(callback)); 746 }, 747 "try_OffClosed": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 748 try { 749 const _ret = WEBEXT.notifications.onClosed.removeListener(A.H.get<object>(callback)); 750 return A.H.TRUE; 751 } catch (err: any) { 752 A.store.Ref(errPtr, err); 753 return A.H.FALSE; 754 } 755 }, 756 "has_HasOnClosed": (): heap.Ref<boolean> => { 757 if (WEBEXT?.notifications?.onClosed && "hasListener" in WEBEXT?.notifications?.onClosed) { 758 return A.H.TRUE; 759 } 760 return A.H.FALSE; 761 }, 762 "func_HasOnClosed": (fn: Pointer): void => { 763 A.store.Ref(fn, WEBEXT.notifications.onClosed.hasListener); 764 }, 765 "call_HasOnClosed": (retPtr: Pointer, callback: heap.Ref<object>): void => { 766 const _ret = WEBEXT.notifications.onClosed.hasListener(A.H.get<object>(callback)); 767 A.store.Bool(retPtr, _ret); 768 }, 769 "try_HasOnClosed": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 770 try { 771 const _ret = WEBEXT.notifications.onClosed.hasListener(A.H.get<object>(callback)); 772 A.store.Bool(retPtr, _ret); 773 return A.H.TRUE; 774 } catch (err: any) { 775 A.store.Ref(errPtr, err); 776 return A.H.FALSE; 777 } 778 }, 779 "has_OnPermissionLevelChanged": (): heap.Ref<boolean> => { 780 if ( 781 WEBEXT?.notifications?.onPermissionLevelChanged && 782 "addListener" in WEBEXT?.notifications?.onPermissionLevelChanged 783 ) { 784 return A.H.TRUE; 785 } 786 return A.H.FALSE; 787 }, 788 "func_OnPermissionLevelChanged": (fn: Pointer): void => { 789 A.store.Ref(fn, WEBEXT.notifications.onPermissionLevelChanged.addListener); 790 }, 791 "call_OnPermissionLevelChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => { 792 const _ret = WEBEXT.notifications.onPermissionLevelChanged.addListener(A.H.get<object>(callback)); 793 }, 794 "try_OnPermissionLevelChanged": ( 795 retPtr: Pointer, 796 errPtr: Pointer, 797 callback: heap.Ref<object> 798 ): heap.Ref<boolean> => { 799 try { 800 const _ret = WEBEXT.notifications.onPermissionLevelChanged.addListener(A.H.get<object>(callback)); 801 return A.H.TRUE; 802 } catch (err: any) { 803 A.store.Ref(errPtr, err); 804 return A.H.FALSE; 805 } 806 }, 807 "has_OffPermissionLevelChanged": (): heap.Ref<boolean> => { 808 if ( 809 WEBEXT?.notifications?.onPermissionLevelChanged && 810 "removeListener" in WEBEXT?.notifications?.onPermissionLevelChanged 811 ) { 812 return A.H.TRUE; 813 } 814 return A.H.FALSE; 815 }, 816 "func_OffPermissionLevelChanged": (fn: Pointer): void => { 817 A.store.Ref(fn, WEBEXT.notifications.onPermissionLevelChanged.removeListener); 818 }, 819 "call_OffPermissionLevelChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => { 820 const _ret = WEBEXT.notifications.onPermissionLevelChanged.removeListener(A.H.get<object>(callback)); 821 }, 822 "try_OffPermissionLevelChanged": ( 823 retPtr: Pointer, 824 errPtr: Pointer, 825 callback: heap.Ref<object> 826 ): heap.Ref<boolean> => { 827 try { 828 const _ret = WEBEXT.notifications.onPermissionLevelChanged.removeListener(A.H.get<object>(callback)); 829 return A.H.TRUE; 830 } catch (err: any) { 831 A.store.Ref(errPtr, err); 832 return A.H.FALSE; 833 } 834 }, 835 "has_HasOnPermissionLevelChanged": (): heap.Ref<boolean> => { 836 if ( 837 WEBEXT?.notifications?.onPermissionLevelChanged && 838 "hasListener" in WEBEXT?.notifications?.onPermissionLevelChanged 839 ) { 840 return A.H.TRUE; 841 } 842 return A.H.FALSE; 843 }, 844 "func_HasOnPermissionLevelChanged": (fn: Pointer): void => { 845 A.store.Ref(fn, WEBEXT.notifications.onPermissionLevelChanged.hasListener); 846 }, 847 "call_HasOnPermissionLevelChanged": (retPtr: Pointer, callback: heap.Ref<object>): void => { 848 const _ret = WEBEXT.notifications.onPermissionLevelChanged.hasListener(A.H.get<object>(callback)); 849 A.store.Bool(retPtr, _ret); 850 }, 851 "try_HasOnPermissionLevelChanged": ( 852 retPtr: Pointer, 853 errPtr: Pointer, 854 callback: heap.Ref<object> 855 ): heap.Ref<boolean> => { 856 try { 857 const _ret = WEBEXT.notifications.onPermissionLevelChanged.hasListener(A.H.get<object>(callback)); 858 A.store.Bool(retPtr, _ret); 859 return A.H.TRUE; 860 } catch (err: any) { 861 A.store.Ref(errPtr, err); 862 return A.H.FALSE; 863 } 864 }, 865 "has_OnShowSettings": (): heap.Ref<boolean> => { 866 if (WEBEXT?.notifications?.onShowSettings && "addListener" in WEBEXT?.notifications?.onShowSettings) { 867 return A.H.TRUE; 868 } 869 return A.H.FALSE; 870 }, 871 "func_OnShowSettings": (fn: Pointer): void => { 872 A.store.Ref(fn, WEBEXT.notifications.onShowSettings.addListener); 873 }, 874 "call_OnShowSettings": (retPtr: Pointer, callback: heap.Ref<object>): void => { 875 const _ret = WEBEXT.notifications.onShowSettings.addListener(A.H.get<object>(callback)); 876 }, 877 "try_OnShowSettings": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 878 try { 879 const _ret = WEBEXT.notifications.onShowSettings.addListener(A.H.get<object>(callback)); 880 return A.H.TRUE; 881 } catch (err: any) { 882 A.store.Ref(errPtr, err); 883 return A.H.FALSE; 884 } 885 }, 886 "has_OffShowSettings": (): heap.Ref<boolean> => { 887 if (WEBEXT?.notifications?.onShowSettings && "removeListener" in WEBEXT?.notifications?.onShowSettings) { 888 return A.H.TRUE; 889 } 890 return A.H.FALSE; 891 }, 892 "func_OffShowSettings": (fn: Pointer): void => { 893 A.store.Ref(fn, WEBEXT.notifications.onShowSettings.removeListener); 894 }, 895 "call_OffShowSettings": (retPtr: Pointer, callback: heap.Ref<object>): void => { 896 const _ret = WEBEXT.notifications.onShowSettings.removeListener(A.H.get<object>(callback)); 897 }, 898 "try_OffShowSettings": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 899 try { 900 const _ret = WEBEXT.notifications.onShowSettings.removeListener(A.H.get<object>(callback)); 901 return A.H.TRUE; 902 } catch (err: any) { 903 A.store.Ref(errPtr, err); 904 return A.H.FALSE; 905 } 906 }, 907 "has_HasOnShowSettings": (): heap.Ref<boolean> => { 908 if (WEBEXT?.notifications?.onShowSettings && "hasListener" in WEBEXT?.notifications?.onShowSettings) { 909 return A.H.TRUE; 910 } 911 return A.H.FALSE; 912 }, 913 "func_HasOnShowSettings": (fn: Pointer): void => { 914 A.store.Ref(fn, WEBEXT.notifications.onShowSettings.hasListener); 915 }, 916 "call_HasOnShowSettings": (retPtr: Pointer, callback: heap.Ref<object>): void => { 917 const _ret = WEBEXT.notifications.onShowSettings.hasListener(A.H.get<object>(callback)); 918 A.store.Bool(retPtr, _ret); 919 }, 920 "try_HasOnShowSettings": (retPtr: Pointer, errPtr: Pointer, callback: heap.Ref<object>): heap.Ref<boolean> => { 921 try { 922 const _ret = WEBEXT.notifications.onShowSettings.hasListener(A.H.get<object>(callback)); 923 A.store.Bool(retPtr, _ret); 924 return A.H.TRUE; 925 } catch (err: any) { 926 A.store.Ref(errPtr, err); 927 return A.H.FALSE; 928 } 929 }, 930 "has_Update": (): heap.Ref<boolean> => { 931 if (WEBEXT?.notifications && "update" in WEBEXT?.notifications) { 932 return A.H.TRUE; 933 } 934 return A.H.FALSE; 935 }, 936 "func_Update": (fn: Pointer): void => { 937 A.store.Ref(fn, WEBEXT.notifications.update); 938 }, 939 "call_Update": (retPtr: Pointer, notificationId: heap.Ref<object>, options: Pointer): void => { 940 const options_ffi = {}; 941 942 options_ffi["type"] = A.load.Enum(options + 0, ["basic", "image", "list", "progress"]); 943 options_ffi["iconUrl"] = A.load.Ref(options + 4, undefined); 944 if (A.load.Bool(options + 8 + 14)) { 945 options_ffi["iconBitmap"] = {}; 946 if (A.load.Bool(options + 8 + 12)) { 947 options_ffi["iconBitmap"]["width"] = A.load.Int32(options + 8 + 0); 948 } 949 if (A.load.Bool(options + 8 + 13)) { 950 options_ffi["iconBitmap"]["height"] = A.load.Int32(options + 8 + 4); 951 } 952 options_ffi["iconBitmap"]["data"] = A.load.Ref(options + 8 + 8, undefined); 953 } 954 options_ffi["appIconMaskUrl"] = A.load.Ref(options + 24, undefined); 955 if (A.load.Bool(options + 28 + 14)) { 956 options_ffi["appIconMaskBitmap"] = {}; 957 if (A.load.Bool(options + 28 + 12)) { 958 options_ffi["appIconMaskBitmap"]["width"] = A.load.Int32(options + 28 + 0); 959 } 960 if (A.load.Bool(options + 28 + 13)) { 961 options_ffi["appIconMaskBitmap"]["height"] = A.load.Int32(options + 28 + 4); 962 } 963 options_ffi["appIconMaskBitmap"]["data"] = A.load.Ref(options + 28 + 8, undefined); 964 } 965 options_ffi["title"] = A.load.Ref(options + 44, undefined); 966 options_ffi["message"] = A.load.Ref(options + 48, undefined); 967 options_ffi["contextMessage"] = A.load.Ref(options + 52, undefined); 968 if (A.load.Bool(options + 111)) { 969 options_ffi["priority"] = A.load.Int32(options + 56); 970 } 971 if (A.load.Bool(options + 112)) { 972 options_ffi["eventTime"] = A.load.Float64(options + 64); 973 } 974 options_ffi["buttons"] = A.load.Ref(options + 72, undefined); 975 options_ffi["expandedMessage"] = A.load.Ref(options + 76, undefined); 976 options_ffi["imageUrl"] = A.load.Ref(options + 80, undefined); 977 if (A.load.Bool(options + 84 + 14)) { 978 options_ffi["imageBitmap"] = {}; 979 if (A.load.Bool(options + 84 + 12)) { 980 options_ffi["imageBitmap"]["width"] = A.load.Int32(options + 84 + 0); 981 } 982 if (A.load.Bool(options + 84 + 13)) { 983 options_ffi["imageBitmap"]["height"] = A.load.Int32(options + 84 + 4); 984 } 985 options_ffi["imageBitmap"]["data"] = A.load.Ref(options + 84 + 8, undefined); 986 } 987 options_ffi["items"] = A.load.Ref(options + 100, undefined); 988 if (A.load.Bool(options + 113)) { 989 options_ffi["progress"] = A.load.Int32(options + 104); 990 } 991 if (A.load.Bool(options + 114)) { 992 options_ffi["isClickable"] = A.load.Bool(options + 108); 993 } 994 if (A.load.Bool(options + 115)) { 995 options_ffi["requireInteraction"] = A.load.Bool(options + 109); 996 } 997 if (A.load.Bool(options + 116)) { 998 options_ffi["silent"] = A.load.Bool(options + 110); 999 } 1000 1001 const _ret = WEBEXT.notifications.update(A.H.get<object>(notificationId), options_ffi); 1002 A.store.Ref(retPtr, _ret); 1003 }, 1004 "try_Update": ( 1005 retPtr: Pointer, 1006 errPtr: Pointer, 1007 notificationId: heap.Ref<object>, 1008 options: Pointer 1009 ): heap.Ref<boolean> => { 1010 try { 1011 const options_ffi = {}; 1012 1013 options_ffi["type"] = A.load.Enum(options + 0, ["basic", "image", "list", "progress"]); 1014 options_ffi["iconUrl"] = A.load.Ref(options + 4, undefined); 1015 if (A.load.Bool(options + 8 + 14)) { 1016 options_ffi["iconBitmap"] = {}; 1017 if (A.load.Bool(options + 8 + 12)) { 1018 options_ffi["iconBitmap"]["width"] = A.load.Int32(options + 8 + 0); 1019 } 1020 if (A.load.Bool(options + 8 + 13)) { 1021 options_ffi["iconBitmap"]["height"] = A.load.Int32(options + 8 + 4); 1022 } 1023 options_ffi["iconBitmap"]["data"] = A.load.Ref(options + 8 + 8, undefined); 1024 } 1025 options_ffi["appIconMaskUrl"] = A.load.Ref(options + 24, undefined); 1026 if (A.load.Bool(options + 28 + 14)) { 1027 options_ffi["appIconMaskBitmap"] = {}; 1028 if (A.load.Bool(options + 28 + 12)) { 1029 options_ffi["appIconMaskBitmap"]["width"] = A.load.Int32(options + 28 + 0); 1030 } 1031 if (A.load.Bool(options + 28 + 13)) { 1032 options_ffi["appIconMaskBitmap"]["height"] = A.load.Int32(options + 28 + 4); 1033 } 1034 options_ffi["appIconMaskBitmap"]["data"] = A.load.Ref(options + 28 + 8, undefined); 1035 } 1036 options_ffi["title"] = A.load.Ref(options + 44, undefined); 1037 options_ffi["message"] = A.load.Ref(options + 48, undefined); 1038 options_ffi["contextMessage"] = A.load.Ref(options + 52, undefined); 1039 if (A.load.Bool(options + 111)) { 1040 options_ffi["priority"] = A.load.Int32(options + 56); 1041 } 1042 if (A.load.Bool(options + 112)) { 1043 options_ffi["eventTime"] = A.load.Float64(options + 64); 1044 } 1045 options_ffi["buttons"] = A.load.Ref(options + 72, undefined); 1046 options_ffi["expandedMessage"] = A.load.Ref(options + 76, undefined); 1047 options_ffi["imageUrl"] = A.load.Ref(options + 80, undefined); 1048 if (A.load.Bool(options + 84 + 14)) { 1049 options_ffi["imageBitmap"] = {}; 1050 if (A.load.Bool(options + 84 + 12)) { 1051 options_ffi["imageBitmap"]["width"] = A.load.Int32(options + 84 + 0); 1052 } 1053 if (A.load.Bool(options + 84 + 13)) { 1054 options_ffi["imageBitmap"]["height"] = A.load.Int32(options + 84 + 4); 1055 } 1056 options_ffi["imageBitmap"]["data"] = A.load.Ref(options + 84 + 8, undefined); 1057 } 1058 options_ffi["items"] = A.load.Ref(options + 100, undefined); 1059 if (A.load.Bool(options + 113)) { 1060 options_ffi["progress"] = A.load.Int32(options + 104); 1061 } 1062 if (A.load.Bool(options + 114)) { 1063 options_ffi["isClickable"] = A.load.Bool(options + 108); 1064 } 1065 if (A.load.Bool(options + 115)) { 1066 options_ffi["requireInteraction"] = A.load.Bool(options + 109); 1067 } 1068 if (A.load.Bool(options + 116)) { 1069 options_ffi["silent"] = A.load.Bool(options + 110); 1070 } 1071 1072 const _ret = WEBEXT.notifications.update(A.H.get<object>(notificationId), options_ffi); 1073 A.store.Ref(retPtr, _ret); 1074 return A.H.TRUE; 1075 } catch (err: any) { 1076 A.store.Ref(errPtr, err); 1077 return A.H.FALSE; 1078 } 1079 }, 1080 }; 1081 });