element.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. class element {
  2. #pictures;
  3. #mesh;
  4. #name;
  5. #description;
  6. #params;
  7. #links;
  8. #thumbnail;
  9. constructor(name) {
  10. if (typeof(name) !== "string") {
  11. throw "Name must be an string.";
  12. }
  13. this.#name = name;
  14. this.#description = "";
  15. this.#mesh = "";
  16. this.#thumbnail = "";
  17. this.#pictures = new Set();
  18. this.#params = new Map();
  19. this.#links = new Map();
  20. }
  21. get name() {
  22. return this.#name;
  23. }
  24. get description() {
  25. return this.#description;
  26. }
  27. set description(content) {
  28. if (typeof(content) !== "string") {
  29. throw "Description must be an string.";
  30. }
  31. this.#description = content;
  32. }
  33. get mesh() {
  34. return this.#mesh;
  35. }
  36. set mesh(content) {
  37. if (typeof(content) !== "string") {
  38. throw "Mesh URL must be string.";
  39. }
  40. this.#mesh = content;
  41. }
  42. get thumbnail() {
  43. return this.#thumbnail;
  44. }
  45. set thumbnail(content) {
  46. if (typeof(content) !== "string") {
  47. throw "Thumbnail URL must be string.";
  48. }
  49. }
  50. get links() {
  51. return this.#links;
  52. }
  53. get params() {
  54. return this.#params;
  55. }
  56. get pictures() {
  57. return this.#pictures;
  58. }
  59. }
  60. export { element };