You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.3 KiB

  1. export class LinkTypeItem {
  2. constructor(
  3. public id: number,
  4. public name: string,
  5. public color: string = '#1f1f1f'
  6. ) {
  7. }
  8. static valueOf(
  9. {id, name, color}:
  10. { id: number, name: string, color: string }
  11. ): LinkTypeItem {
  12. return new LinkTypeItem(id, name, color)
  13. }
  14. toObject(): Object {
  15. return {
  16. id: this.id,
  17. name: this.name,
  18. color: this.color
  19. }
  20. }
  21. }
  22. export class LinkItem {
  23. constructor(
  24. public id: number,
  25. public annotation_id_1: number,
  26. public annotation_id_2: number,
  27. public type: number,
  28. public user: number,
  29. public timestamp: string
  30. ) {
  31. }
  32. static valueOf(
  33. {id, annotation_id_1, annotation_id_2, type, user, timestamp}:
  34. { id: number, annotation_id_1: number, annotation_id_2: number, type: number, user:number, timestamp:string }
  35. ): LinkItem {
  36. return new LinkItem(id, annotation_id_1, annotation_id_2, type, user, timestamp)
  37. }
  38. toObject(): Object {
  39. return {
  40. id: this.id,
  41. annotation_id_1: this.annotation_id_1,
  42. annotation_id_2: this.annotation_id_2,
  43. type: this.type,
  44. user: this.user,
  45. timestamp: this.timestamp
  46. }
  47. }
  48. }