github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/metricsprivate/apis_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package metricsprivate 5 6 import ( 7 "github.com/primecitizens/pcz/std/ffi/js" 8 "github.com/primecitizens/pcz/std/plat/js/webext/metricsprivate/bindings" 9 ) 10 11 type HistogramBucket struct { 12 // Count is "HistogramBucket.count" 13 // 14 // Required 15 Count int64 16 // Max is "HistogramBucket.max" 17 // 18 // Required 19 Max int64 20 // Min is "HistogramBucket.min" 21 // 22 // Required 23 Min int64 24 25 FFI_USE bool 26 } 27 28 // FromRef calls UpdateFrom and returns a HistogramBucket with all fields set. 29 func (p HistogramBucket) FromRef(ref js.Ref) HistogramBucket { 30 p.UpdateFrom(ref) 31 return p 32 } 33 34 // New creates a new HistogramBucket in the application heap. 35 func (p HistogramBucket) New() js.Ref { 36 return bindings.HistogramBucketJSLoad( 37 js.Pointer(&p), js.True, 0, 38 ) 39 } 40 41 // UpdateFrom copies value of all fields of the heap object to p. 42 func (p *HistogramBucket) UpdateFrom(ref js.Ref) { 43 bindings.HistogramBucketJSStore( 44 js.Pointer(p), ref, 45 ) 46 } 47 48 // Update writes all fields of the p to the heap object referenced by ref. 49 func (p *HistogramBucket) Update(ref js.Ref) { 50 bindings.HistogramBucketJSLoad( 51 js.Pointer(p), js.False, ref, 52 ) 53 } 54 55 // FreeMembers frees fields with heap reference, if recursive is true 56 // free all heap references reachable from p. 57 func (p *HistogramBucket) FreeMembers(recursive bool) { 58 } 59 60 type Histogram struct { 61 // Buckets is "Histogram.buckets" 62 // 63 // Required 64 Buckets js.Array[HistogramBucket] 65 // Sum is "Histogram.sum" 66 // 67 // Required 68 Sum float64 69 70 FFI_USE bool 71 } 72 73 // FromRef calls UpdateFrom and returns a Histogram with all fields set. 74 func (p Histogram) FromRef(ref js.Ref) Histogram { 75 p.UpdateFrom(ref) 76 return p 77 } 78 79 // New creates a new Histogram in the application heap. 80 func (p Histogram) New() js.Ref { 81 return bindings.HistogramJSLoad( 82 js.Pointer(&p), js.True, 0, 83 ) 84 } 85 86 // UpdateFrom copies value of all fields of the heap object to p. 87 func (p *Histogram) UpdateFrom(ref js.Ref) { 88 bindings.HistogramJSStore( 89 js.Pointer(p), ref, 90 ) 91 } 92 93 // Update writes all fields of the p to the heap object referenced by ref. 94 func (p *Histogram) Update(ref js.Ref) { 95 bindings.HistogramJSLoad( 96 js.Pointer(p), js.False, ref, 97 ) 98 } 99 100 // FreeMembers frees fields with heap reference, if recursive is true 101 // free all heap references reachable from p. 102 func (p *Histogram) FreeMembers(recursive bool) { 103 js.Free( 104 p.Buckets.Ref(), 105 ) 106 p.Buckets = p.Buckets.FromRef(js.Undefined) 107 } 108 109 type MetricTypeType uint32 110 111 const ( 112 _ MetricTypeType = iota 113 114 MetricTypeType_HISTOGRAM_LOG 115 MetricTypeType_HISTOGRAM_LINEAR 116 ) 117 118 func (MetricTypeType) FromRef(str js.Ref) MetricTypeType { 119 return MetricTypeType(bindings.ConstOfMetricTypeType(str)) 120 } 121 122 func (x MetricTypeType) String() (string, bool) { 123 switch x { 124 case MetricTypeType_HISTOGRAM_LOG: 125 return "histogram-log", true 126 case MetricTypeType_HISTOGRAM_LINEAR: 127 return "histogram-linear", true 128 default: 129 return "", false 130 } 131 } 132 133 type MetricType struct { 134 // Buckets is "MetricType.buckets" 135 // 136 // Required 137 Buckets int64 138 // Max is "MetricType.max" 139 // 140 // Required 141 Max int64 142 // MetricName is "MetricType.metricName" 143 // 144 // Required 145 MetricName js.String 146 // Min is "MetricType.min" 147 // 148 // Required 149 Min int64 150 // Type is "MetricType.type" 151 // 152 // Required 153 Type MetricTypeType 154 155 FFI_USE bool 156 } 157 158 // FromRef calls UpdateFrom and returns a MetricType with all fields set. 159 func (p MetricType) FromRef(ref js.Ref) MetricType { 160 p.UpdateFrom(ref) 161 return p 162 } 163 164 // New creates a new MetricType in the application heap. 165 func (p MetricType) New() js.Ref { 166 return bindings.MetricTypeJSLoad( 167 js.Pointer(&p), js.True, 0, 168 ) 169 } 170 171 // UpdateFrom copies value of all fields of the heap object to p. 172 func (p *MetricType) UpdateFrom(ref js.Ref) { 173 bindings.MetricTypeJSStore( 174 js.Pointer(p), ref, 175 ) 176 } 177 178 // Update writes all fields of the p to the heap object referenced by ref. 179 func (p *MetricType) Update(ref js.Ref) { 180 bindings.MetricTypeJSLoad( 181 js.Pointer(p), js.False, ref, 182 ) 183 } 184 185 // FreeMembers frees fields with heap reference, if recursive is true 186 // free all heap references reachable from p. 187 func (p *MetricType) FreeMembers(recursive bool) { 188 js.Free( 189 p.MetricName.Ref(), 190 ) 191 p.MetricName = p.MetricName.FromRef(js.Undefined) 192 } 193 194 // HasFuncGetFieldTrial returns true if the function "WEBEXT.metricsPrivate.getFieldTrial" exists. 195 func HasFuncGetFieldTrial() bool { 196 return js.True == bindings.HasFuncGetFieldTrial() 197 } 198 199 // FuncGetFieldTrial returns the function "WEBEXT.metricsPrivate.getFieldTrial". 200 func FuncGetFieldTrial() (fn js.Func[func(name js.String) js.Promise[js.String]]) { 201 bindings.FuncGetFieldTrial( 202 js.Pointer(&fn), 203 ) 204 return 205 } 206 207 // GetFieldTrial calls the function "WEBEXT.metricsPrivate.getFieldTrial" directly. 208 func GetFieldTrial(name js.String) (ret js.Promise[js.String]) { 209 bindings.CallGetFieldTrial( 210 js.Pointer(&ret), 211 name.Ref(), 212 ) 213 214 return 215 } 216 217 // TryGetFieldTrial calls the function "WEBEXT.metricsPrivate.getFieldTrial" 218 // in a try/catch block and returns (_, err, ok = false) when it went through 219 // the catch clause. 220 func TryGetFieldTrial(name js.String) (ret js.Promise[js.String], exception js.Any, ok bool) { 221 ok = js.True == bindings.TryGetFieldTrial( 222 js.Pointer(&ret), js.Pointer(&exception), 223 name.Ref(), 224 ) 225 226 return 227 } 228 229 // HasFuncGetHistogram returns true if the function "WEBEXT.metricsPrivate.getHistogram" exists. 230 func HasFuncGetHistogram() bool { 231 return js.True == bindings.HasFuncGetHistogram() 232 } 233 234 // FuncGetHistogram returns the function "WEBEXT.metricsPrivate.getHistogram". 235 func FuncGetHistogram() (fn js.Func[func(name js.String) js.Promise[Histogram]]) { 236 bindings.FuncGetHistogram( 237 js.Pointer(&fn), 238 ) 239 return 240 } 241 242 // GetHistogram calls the function "WEBEXT.metricsPrivate.getHistogram" directly. 243 func GetHistogram(name js.String) (ret js.Promise[Histogram]) { 244 bindings.CallGetHistogram( 245 js.Pointer(&ret), 246 name.Ref(), 247 ) 248 249 return 250 } 251 252 // TryGetHistogram calls the function "WEBEXT.metricsPrivate.getHistogram" 253 // in a try/catch block and returns (_, err, ok = false) when it went through 254 // the catch clause. 255 func TryGetHistogram(name js.String) (ret js.Promise[Histogram], exception js.Any, ok bool) { 256 ok = js.True == bindings.TryGetHistogram( 257 js.Pointer(&ret), js.Pointer(&exception), 258 name.Ref(), 259 ) 260 261 return 262 } 263 264 // HasFuncGetIsCrashReportingEnabled returns true if the function "WEBEXT.metricsPrivate.getIsCrashReportingEnabled" exists. 265 func HasFuncGetIsCrashReportingEnabled() bool { 266 return js.True == bindings.HasFuncGetIsCrashReportingEnabled() 267 } 268 269 // FuncGetIsCrashReportingEnabled returns the function "WEBEXT.metricsPrivate.getIsCrashReportingEnabled". 270 func FuncGetIsCrashReportingEnabled() (fn js.Func[func() js.Promise[js.Boolean]]) { 271 bindings.FuncGetIsCrashReportingEnabled( 272 js.Pointer(&fn), 273 ) 274 return 275 } 276 277 // GetIsCrashReportingEnabled calls the function "WEBEXT.metricsPrivate.getIsCrashReportingEnabled" directly. 278 func GetIsCrashReportingEnabled() (ret js.Promise[js.Boolean]) { 279 bindings.CallGetIsCrashReportingEnabled( 280 js.Pointer(&ret), 281 ) 282 283 return 284 } 285 286 // TryGetIsCrashReportingEnabled calls the function "WEBEXT.metricsPrivate.getIsCrashReportingEnabled" 287 // in a try/catch block and returns (_, err, ok = false) when it went through 288 // the catch clause. 289 func TryGetIsCrashReportingEnabled() (ret js.Promise[js.Boolean], exception js.Any, ok bool) { 290 ok = js.True == bindings.TryGetIsCrashReportingEnabled( 291 js.Pointer(&ret), js.Pointer(&exception), 292 ) 293 294 return 295 } 296 297 // HasFuncGetVariationParams returns true if the function "WEBEXT.metricsPrivate.getVariationParams" exists. 298 func HasFuncGetVariationParams() bool { 299 return js.True == bindings.HasFuncGetVariationParams() 300 } 301 302 // FuncGetVariationParams returns the function "WEBEXT.metricsPrivate.getVariationParams". 303 func FuncGetVariationParams() (fn js.Func[func(name js.String) js.Promise[js.String]]) { 304 bindings.FuncGetVariationParams( 305 js.Pointer(&fn), 306 ) 307 return 308 } 309 310 // GetVariationParams calls the function "WEBEXT.metricsPrivate.getVariationParams" directly. 311 func GetVariationParams(name js.String) (ret js.Promise[js.String]) { 312 bindings.CallGetVariationParams( 313 js.Pointer(&ret), 314 name.Ref(), 315 ) 316 317 return 318 } 319 320 // TryGetVariationParams calls the function "WEBEXT.metricsPrivate.getVariationParams" 321 // in a try/catch block and returns (_, err, ok = false) when it went through 322 // the catch clause. 323 func TryGetVariationParams(name js.String) (ret js.Promise[js.String], exception js.Any, ok bool) { 324 ok = js.True == bindings.TryGetVariationParams( 325 js.Pointer(&ret), js.Pointer(&exception), 326 name.Ref(), 327 ) 328 329 return 330 } 331 332 // HasFuncRecordBoolean returns true if the function "WEBEXT.metricsPrivate.recordBoolean" exists. 333 func HasFuncRecordBoolean() bool { 334 return js.True == bindings.HasFuncRecordBoolean() 335 } 336 337 // FuncRecordBoolean returns the function "WEBEXT.metricsPrivate.recordBoolean". 338 func FuncRecordBoolean() (fn js.Func[func(metricName js.String, value bool)]) { 339 bindings.FuncRecordBoolean( 340 js.Pointer(&fn), 341 ) 342 return 343 } 344 345 // RecordBoolean calls the function "WEBEXT.metricsPrivate.recordBoolean" directly. 346 func RecordBoolean(metricName js.String, value bool) (ret js.Void) { 347 bindings.CallRecordBoolean( 348 js.Pointer(&ret), 349 metricName.Ref(), 350 js.Bool(bool(value)), 351 ) 352 353 return 354 } 355 356 // TryRecordBoolean calls the function "WEBEXT.metricsPrivate.recordBoolean" 357 // in a try/catch block and returns (_, err, ok = false) when it went through 358 // the catch clause. 359 func TryRecordBoolean(metricName js.String, value bool) (ret js.Void, exception js.Any, ok bool) { 360 ok = js.True == bindings.TryRecordBoolean( 361 js.Pointer(&ret), js.Pointer(&exception), 362 metricName.Ref(), 363 js.Bool(bool(value)), 364 ) 365 366 return 367 } 368 369 // HasFuncRecordCount returns true if the function "WEBEXT.metricsPrivate.recordCount" exists. 370 func HasFuncRecordCount() bool { 371 return js.True == bindings.HasFuncRecordCount() 372 } 373 374 // FuncRecordCount returns the function "WEBEXT.metricsPrivate.recordCount". 375 func FuncRecordCount() (fn js.Func[func(metricName js.String, value int64)]) { 376 bindings.FuncRecordCount( 377 js.Pointer(&fn), 378 ) 379 return 380 } 381 382 // RecordCount calls the function "WEBEXT.metricsPrivate.recordCount" directly. 383 func RecordCount(metricName js.String, value int64) (ret js.Void) { 384 bindings.CallRecordCount( 385 js.Pointer(&ret), 386 metricName.Ref(), 387 float64(value), 388 ) 389 390 return 391 } 392 393 // TryRecordCount calls the function "WEBEXT.metricsPrivate.recordCount" 394 // in a try/catch block and returns (_, err, ok = false) when it went through 395 // the catch clause. 396 func TryRecordCount(metricName js.String, value int64) (ret js.Void, exception js.Any, ok bool) { 397 ok = js.True == bindings.TryRecordCount( 398 js.Pointer(&ret), js.Pointer(&exception), 399 metricName.Ref(), 400 float64(value), 401 ) 402 403 return 404 } 405 406 // HasFuncRecordEnumerationValue returns true if the function "WEBEXT.metricsPrivate.recordEnumerationValue" exists. 407 func HasFuncRecordEnumerationValue() bool { 408 return js.True == bindings.HasFuncRecordEnumerationValue() 409 } 410 411 // FuncRecordEnumerationValue returns the function "WEBEXT.metricsPrivate.recordEnumerationValue". 412 func FuncRecordEnumerationValue() (fn js.Func[func(metricName js.String, value int64, enumSize int64)]) { 413 bindings.FuncRecordEnumerationValue( 414 js.Pointer(&fn), 415 ) 416 return 417 } 418 419 // RecordEnumerationValue calls the function "WEBEXT.metricsPrivate.recordEnumerationValue" directly. 420 func RecordEnumerationValue(metricName js.String, value int64, enumSize int64) (ret js.Void) { 421 bindings.CallRecordEnumerationValue( 422 js.Pointer(&ret), 423 metricName.Ref(), 424 float64(value), 425 float64(enumSize), 426 ) 427 428 return 429 } 430 431 // TryRecordEnumerationValue calls the function "WEBEXT.metricsPrivate.recordEnumerationValue" 432 // in a try/catch block and returns (_, err, ok = false) when it went through 433 // the catch clause. 434 func TryRecordEnumerationValue(metricName js.String, value int64, enumSize int64) (ret js.Void, exception js.Any, ok bool) { 435 ok = js.True == bindings.TryRecordEnumerationValue( 436 js.Pointer(&ret), js.Pointer(&exception), 437 metricName.Ref(), 438 float64(value), 439 float64(enumSize), 440 ) 441 442 return 443 } 444 445 // HasFuncRecordLongTime returns true if the function "WEBEXT.metricsPrivate.recordLongTime" exists. 446 func HasFuncRecordLongTime() bool { 447 return js.True == bindings.HasFuncRecordLongTime() 448 } 449 450 // FuncRecordLongTime returns the function "WEBEXT.metricsPrivate.recordLongTime". 451 func FuncRecordLongTime() (fn js.Func[func(metricName js.String, value int64)]) { 452 bindings.FuncRecordLongTime( 453 js.Pointer(&fn), 454 ) 455 return 456 } 457 458 // RecordLongTime calls the function "WEBEXT.metricsPrivate.recordLongTime" directly. 459 func RecordLongTime(metricName js.String, value int64) (ret js.Void) { 460 bindings.CallRecordLongTime( 461 js.Pointer(&ret), 462 metricName.Ref(), 463 float64(value), 464 ) 465 466 return 467 } 468 469 // TryRecordLongTime calls the function "WEBEXT.metricsPrivate.recordLongTime" 470 // in a try/catch block and returns (_, err, ok = false) when it went through 471 // the catch clause. 472 func TryRecordLongTime(metricName js.String, value int64) (ret js.Void, exception js.Any, ok bool) { 473 ok = js.True == bindings.TryRecordLongTime( 474 js.Pointer(&ret), js.Pointer(&exception), 475 metricName.Ref(), 476 float64(value), 477 ) 478 479 return 480 } 481 482 // HasFuncRecordMediumCount returns true if the function "WEBEXT.metricsPrivate.recordMediumCount" exists. 483 func HasFuncRecordMediumCount() bool { 484 return js.True == bindings.HasFuncRecordMediumCount() 485 } 486 487 // FuncRecordMediumCount returns the function "WEBEXT.metricsPrivate.recordMediumCount". 488 func FuncRecordMediumCount() (fn js.Func[func(metricName js.String, value int64)]) { 489 bindings.FuncRecordMediumCount( 490 js.Pointer(&fn), 491 ) 492 return 493 } 494 495 // RecordMediumCount calls the function "WEBEXT.metricsPrivate.recordMediumCount" directly. 496 func RecordMediumCount(metricName js.String, value int64) (ret js.Void) { 497 bindings.CallRecordMediumCount( 498 js.Pointer(&ret), 499 metricName.Ref(), 500 float64(value), 501 ) 502 503 return 504 } 505 506 // TryRecordMediumCount calls the function "WEBEXT.metricsPrivate.recordMediumCount" 507 // in a try/catch block and returns (_, err, ok = false) when it went through 508 // the catch clause. 509 func TryRecordMediumCount(metricName js.String, value int64) (ret js.Void, exception js.Any, ok bool) { 510 ok = js.True == bindings.TryRecordMediumCount( 511 js.Pointer(&ret), js.Pointer(&exception), 512 metricName.Ref(), 513 float64(value), 514 ) 515 516 return 517 } 518 519 // HasFuncRecordMediumTime returns true if the function "WEBEXT.metricsPrivate.recordMediumTime" exists. 520 func HasFuncRecordMediumTime() bool { 521 return js.True == bindings.HasFuncRecordMediumTime() 522 } 523 524 // FuncRecordMediumTime returns the function "WEBEXT.metricsPrivate.recordMediumTime". 525 func FuncRecordMediumTime() (fn js.Func[func(metricName js.String, value int64)]) { 526 bindings.FuncRecordMediumTime( 527 js.Pointer(&fn), 528 ) 529 return 530 } 531 532 // RecordMediumTime calls the function "WEBEXT.metricsPrivate.recordMediumTime" directly. 533 func RecordMediumTime(metricName js.String, value int64) (ret js.Void) { 534 bindings.CallRecordMediumTime( 535 js.Pointer(&ret), 536 metricName.Ref(), 537 float64(value), 538 ) 539 540 return 541 } 542 543 // TryRecordMediumTime calls the function "WEBEXT.metricsPrivate.recordMediumTime" 544 // in a try/catch block and returns (_, err, ok = false) when it went through 545 // the catch clause. 546 func TryRecordMediumTime(metricName js.String, value int64) (ret js.Void, exception js.Any, ok bool) { 547 ok = js.True == bindings.TryRecordMediumTime( 548 js.Pointer(&ret), js.Pointer(&exception), 549 metricName.Ref(), 550 float64(value), 551 ) 552 553 return 554 } 555 556 // HasFuncRecordPercentage returns true if the function "WEBEXT.metricsPrivate.recordPercentage" exists. 557 func HasFuncRecordPercentage() bool { 558 return js.True == bindings.HasFuncRecordPercentage() 559 } 560 561 // FuncRecordPercentage returns the function "WEBEXT.metricsPrivate.recordPercentage". 562 func FuncRecordPercentage() (fn js.Func[func(metricName js.String, value int64)]) { 563 bindings.FuncRecordPercentage( 564 js.Pointer(&fn), 565 ) 566 return 567 } 568 569 // RecordPercentage calls the function "WEBEXT.metricsPrivate.recordPercentage" directly. 570 func RecordPercentage(metricName js.String, value int64) (ret js.Void) { 571 bindings.CallRecordPercentage( 572 js.Pointer(&ret), 573 metricName.Ref(), 574 float64(value), 575 ) 576 577 return 578 } 579 580 // TryRecordPercentage calls the function "WEBEXT.metricsPrivate.recordPercentage" 581 // in a try/catch block and returns (_, err, ok = false) when it went through 582 // the catch clause. 583 func TryRecordPercentage(metricName js.String, value int64) (ret js.Void, exception js.Any, ok bool) { 584 ok = js.True == bindings.TryRecordPercentage( 585 js.Pointer(&ret), js.Pointer(&exception), 586 metricName.Ref(), 587 float64(value), 588 ) 589 590 return 591 } 592 593 // HasFuncRecordSmallCount returns true if the function "WEBEXT.metricsPrivate.recordSmallCount" exists. 594 func HasFuncRecordSmallCount() bool { 595 return js.True == bindings.HasFuncRecordSmallCount() 596 } 597 598 // FuncRecordSmallCount returns the function "WEBEXT.metricsPrivate.recordSmallCount". 599 func FuncRecordSmallCount() (fn js.Func[func(metricName js.String, value int64)]) { 600 bindings.FuncRecordSmallCount( 601 js.Pointer(&fn), 602 ) 603 return 604 } 605 606 // RecordSmallCount calls the function "WEBEXT.metricsPrivate.recordSmallCount" directly. 607 func RecordSmallCount(metricName js.String, value int64) (ret js.Void) { 608 bindings.CallRecordSmallCount( 609 js.Pointer(&ret), 610 metricName.Ref(), 611 float64(value), 612 ) 613 614 return 615 } 616 617 // TryRecordSmallCount calls the function "WEBEXT.metricsPrivate.recordSmallCount" 618 // in a try/catch block and returns (_, err, ok = false) when it went through 619 // the catch clause. 620 func TryRecordSmallCount(metricName js.String, value int64) (ret js.Void, exception js.Any, ok bool) { 621 ok = js.True == bindings.TryRecordSmallCount( 622 js.Pointer(&ret), js.Pointer(&exception), 623 metricName.Ref(), 624 float64(value), 625 ) 626 627 return 628 } 629 630 // HasFuncRecordSparseValue returns true if the function "WEBEXT.metricsPrivate.recordSparseValue" exists. 631 func HasFuncRecordSparseValue() bool { 632 return js.True == bindings.HasFuncRecordSparseValue() 633 } 634 635 // FuncRecordSparseValue returns the function "WEBEXT.metricsPrivate.recordSparseValue". 636 func FuncRecordSparseValue() (fn js.Func[func(metricName js.String, value int64)]) { 637 bindings.FuncRecordSparseValue( 638 js.Pointer(&fn), 639 ) 640 return 641 } 642 643 // RecordSparseValue calls the function "WEBEXT.metricsPrivate.recordSparseValue" directly. 644 func RecordSparseValue(metricName js.String, value int64) (ret js.Void) { 645 bindings.CallRecordSparseValue( 646 js.Pointer(&ret), 647 metricName.Ref(), 648 float64(value), 649 ) 650 651 return 652 } 653 654 // TryRecordSparseValue calls the function "WEBEXT.metricsPrivate.recordSparseValue" 655 // in a try/catch block and returns (_, err, ok = false) when it went through 656 // the catch clause. 657 func TryRecordSparseValue(metricName js.String, value int64) (ret js.Void, exception js.Any, ok bool) { 658 ok = js.True == bindings.TryRecordSparseValue( 659 js.Pointer(&ret), js.Pointer(&exception), 660 metricName.Ref(), 661 float64(value), 662 ) 663 664 return 665 } 666 667 // HasFuncRecordSparseValueWithHashMetricName returns true if the function "WEBEXT.metricsPrivate.recordSparseValueWithHashMetricName" exists. 668 func HasFuncRecordSparseValueWithHashMetricName() bool { 669 return js.True == bindings.HasFuncRecordSparseValueWithHashMetricName() 670 } 671 672 // FuncRecordSparseValueWithHashMetricName returns the function "WEBEXT.metricsPrivate.recordSparseValueWithHashMetricName". 673 func FuncRecordSparseValueWithHashMetricName() (fn js.Func[func(metricName js.String, value js.String)]) { 674 bindings.FuncRecordSparseValueWithHashMetricName( 675 js.Pointer(&fn), 676 ) 677 return 678 } 679 680 // RecordSparseValueWithHashMetricName calls the function "WEBEXT.metricsPrivate.recordSparseValueWithHashMetricName" directly. 681 func RecordSparseValueWithHashMetricName(metricName js.String, value js.String) (ret js.Void) { 682 bindings.CallRecordSparseValueWithHashMetricName( 683 js.Pointer(&ret), 684 metricName.Ref(), 685 value.Ref(), 686 ) 687 688 return 689 } 690 691 // TryRecordSparseValueWithHashMetricName calls the function "WEBEXT.metricsPrivate.recordSparseValueWithHashMetricName" 692 // in a try/catch block and returns (_, err, ok = false) when it went through 693 // the catch clause. 694 func TryRecordSparseValueWithHashMetricName(metricName js.String, value js.String) (ret js.Void, exception js.Any, ok bool) { 695 ok = js.True == bindings.TryRecordSparseValueWithHashMetricName( 696 js.Pointer(&ret), js.Pointer(&exception), 697 metricName.Ref(), 698 value.Ref(), 699 ) 700 701 return 702 } 703 704 // HasFuncRecordSparseValueWithPersistentHash returns true if the function "WEBEXT.metricsPrivate.recordSparseValueWithPersistentHash" exists. 705 func HasFuncRecordSparseValueWithPersistentHash() bool { 706 return js.True == bindings.HasFuncRecordSparseValueWithPersistentHash() 707 } 708 709 // FuncRecordSparseValueWithPersistentHash returns the function "WEBEXT.metricsPrivate.recordSparseValueWithPersistentHash". 710 func FuncRecordSparseValueWithPersistentHash() (fn js.Func[func(metricName js.String, value js.String)]) { 711 bindings.FuncRecordSparseValueWithPersistentHash( 712 js.Pointer(&fn), 713 ) 714 return 715 } 716 717 // RecordSparseValueWithPersistentHash calls the function "WEBEXT.metricsPrivate.recordSparseValueWithPersistentHash" directly. 718 func RecordSparseValueWithPersistentHash(metricName js.String, value js.String) (ret js.Void) { 719 bindings.CallRecordSparseValueWithPersistentHash( 720 js.Pointer(&ret), 721 metricName.Ref(), 722 value.Ref(), 723 ) 724 725 return 726 } 727 728 // TryRecordSparseValueWithPersistentHash calls the function "WEBEXT.metricsPrivate.recordSparseValueWithPersistentHash" 729 // in a try/catch block and returns (_, err, ok = false) when it went through 730 // the catch clause. 731 func TryRecordSparseValueWithPersistentHash(metricName js.String, value js.String) (ret js.Void, exception js.Any, ok bool) { 732 ok = js.True == bindings.TryRecordSparseValueWithPersistentHash( 733 js.Pointer(&ret), js.Pointer(&exception), 734 metricName.Ref(), 735 value.Ref(), 736 ) 737 738 return 739 } 740 741 // HasFuncRecordTime returns true if the function "WEBEXT.metricsPrivate.recordTime" exists. 742 func HasFuncRecordTime() bool { 743 return js.True == bindings.HasFuncRecordTime() 744 } 745 746 // FuncRecordTime returns the function "WEBEXT.metricsPrivate.recordTime". 747 func FuncRecordTime() (fn js.Func[func(metricName js.String, value int64)]) { 748 bindings.FuncRecordTime( 749 js.Pointer(&fn), 750 ) 751 return 752 } 753 754 // RecordTime calls the function "WEBEXT.metricsPrivate.recordTime" directly. 755 func RecordTime(metricName js.String, value int64) (ret js.Void) { 756 bindings.CallRecordTime( 757 js.Pointer(&ret), 758 metricName.Ref(), 759 float64(value), 760 ) 761 762 return 763 } 764 765 // TryRecordTime calls the function "WEBEXT.metricsPrivate.recordTime" 766 // in a try/catch block and returns (_, err, ok = false) when it went through 767 // the catch clause. 768 func TryRecordTime(metricName js.String, value int64) (ret js.Void, exception js.Any, ok bool) { 769 ok = js.True == bindings.TryRecordTime( 770 js.Pointer(&ret), js.Pointer(&exception), 771 metricName.Ref(), 772 float64(value), 773 ) 774 775 return 776 } 777 778 // HasFuncRecordUserAction returns true if the function "WEBEXT.metricsPrivate.recordUserAction" exists. 779 func HasFuncRecordUserAction() bool { 780 return js.True == bindings.HasFuncRecordUserAction() 781 } 782 783 // FuncRecordUserAction returns the function "WEBEXT.metricsPrivate.recordUserAction". 784 func FuncRecordUserAction() (fn js.Func[func(name js.String)]) { 785 bindings.FuncRecordUserAction( 786 js.Pointer(&fn), 787 ) 788 return 789 } 790 791 // RecordUserAction calls the function "WEBEXT.metricsPrivate.recordUserAction" directly. 792 func RecordUserAction(name js.String) (ret js.Void) { 793 bindings.CallRecordUserAction( 794 js.Pointer(&ret), 795 name.Ref(), 796 ) 797 798 return 799 } 800 801 // TryRecordUserAction calls the function "WEBEXT.metricsPrivate.recordUserAction" 802 // in a try/catch block and returns (_, err, ok = false) when it went through 803 // the catch clause. 804 func TryRecordUserAction(name js.String) (ret js.Void, exception js.Any, ok bool) { 805 ok = js.True == bindings.TryRecordUserAction( 806 js.Pointer(&ret), js.Pointer(&exception), 807 name.Ref(), 808 ) 809 810 return 811 } 812 813 // HasFuncRecordValue returns true if the function "WEBEXT.metricsPrivate.recordValue" exists. 814 func HasFuncRecordValue() bool { 815 return js.True == bindings.HasFuncRecordValue() 816 } 817 818 // FuncRecordValue returns the function "WEBEXT.metricsPrivate.recordValue". 819 func FuncRecordValue() (fn js.Func[func(metric MetricType, value int64)]) { 820 bindings.FuncRecordValue( 821 js.Pointer(&fn), 822 ) 823 return 824 } 825 826 // RecordValue calls the function "WEBEXT.metricsPrivate.recordValue" directly. 827 func RecordValue(metric MetricType, value int64) (ret js.Void) { 828 bindings.CallRecordValue( 829 js.Pointer(&ret), 830 js.Pointer(&metric), 831 float64(value), 832 ) 833 834 return 835 } 836 837 // TryRecordValue calls the function "WEBEXT.metricsPrivate.recordValue" 838 // in a try/catch block and returns (_, err, ok = false) when it went through 839 // the catch clause. 840 func TryRecordValue(metric MetricType, value int64) (ret js.Void, exception js.Any, ok bool) { 841 ok = js.True == bindings.TryRecordValue( 842 js.Pointer(&ret), js.Pointer(&exception), 843 js.Pointer(&metric), 844 float64(value), 845 ) 846 847 return 848 }