models.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // @ts-check
  2. // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
  3. // This file is automatically generated. DO NOT EDIT
  4. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  5. // @ts-ignore: Unused imports
  6. import { Create as $Create } from "@wailsio/runtime";
  7. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  8. // @ts-ignore: Unused imports
  9. import * as color$0 from "../../../../../../../image/color/models.js";
  10. /**
  11. * BadgeOptions represents options for customizing badge appearance
  12. */
  13. export class BadgeOptions {
  14. /**
  15. * Creates a new BadgeOptions instance.
  16. * @param {Partial<BadgeOptions>} [$$source = {}] - The source object to create the BadgeOptions.
  17. */
  18. constructor($$source = {}) {
  19. if (!("TextColour" in $$source)) {
  20. /**
  21. * @member
  22. * @type {color$0.RGBA}
  23. */
  24. this["TextColour"] = (new color$0.RGBA());
  25. }
  26. if (!("BackgroundColour" in $$source)) {
  27. /**
  28. * @member
  29. * @type {color$0.RGBA}
  30. */
  31. this["BackgroundColour"] = (new color$0.RGBA());
  32. }
  33. if (!("FontName" in $$source)) {
  34. /**
  35. * @member
  36. * @type {string}
  37. */
  38. this["FontName"] = "";
  39. }
  40. if (!("FontSize" in $$source)) {
  41. /**
  42. * @member
  43. * @type {number}
  44. */
  45. this["FontSize"] = 0;
  46. }
  47. if (!("SmallFontSize" in $$source)) {
  48. /**
  49. * @member
  50. * @type {number}
  51. */
  52. this["SmallFontSize"] = 0;
  53. }
  54. Object.assign(this, $$source);
  55. }
  56. /**
  57. * Creates a new BadgeOptions instance from a string or object.
  58. * @param {any} [$$source = {}]
  59. * @returns {BadgeOptions}
  60. */
  61. static createFrom($$source = {}) {
  62. const $$createField0_0 = $$createType0;
  63. const $$createField1_0 = $$createType0;
  64. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  65. if ("TextColour" in $$parsedSource) {
  66. $$parsedSource["TextColour"] = $$createField0_0($$parsedSource["TextColour"]);
  67. }
  68. if ("BackgroundColour" in $$parsedSource) {
  69. $$parsedSource["BackgroundColour"] = $$createField1_0($$parsedSource["BackgroundColour"]);
  70. }
  71. return new BadgeOptions(/** @type {Partial<BadgeOptions>} */($$parsedSource));
  72. }
  73. }
  74. // Private type creation functions
  75. const $$createType0 = color$0.RGBA.createFrom;