graph-event.d.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import { IShape } from '../interfaces';
  2. import { LooseObject } from '../types';
  3. declare class GraphEvent {
  4. /**
  5. * 事件类型
  6. * @type {string}
  7. */
  8. type: string;
  9. /**
  10. * 事件名称
  11. * @type {string}
  12. */
  13. name: string;
  14. /**
  15. * 画布上的位置 x
  16. * @type {number}
  17. */
  18. x: number;
  19. /**
  20. * 画布上的位置 y
  21. * @type {number}
  22. */
  23. y: number;
  24. /**
  25. * 窗口上的位置 x
  26. * @type {number}
  27. */
  28. clientX: number;
  29. /**
  30. * 窗口上的位置 y
  31. * @type {number}
  32. */
  33. clientY: number;
  34. /**
  35. * 是否允许冒泡
  36. * @type {boolean}
  37. */
  38. bubbles: boolean;
  39. /**
  40. * 触发对象
  41. * @type {object}
  42. */
  43. target: LooseObject;
  44. /**
  45. * 监听对象
  46. * @type {object}
  47. */
  48. currentTarget: LooseObject;
  49. /**
  50. * 委托对象
  51. * @type {object}
  52. */
  53. delegateTarget: LooseObject;
  54. /**
  55. * 委托事件监听对象的代理对象,即 ev.delegateObject = ev.currentTarget.get('delegateObject')
  56. * @type {object}
  57. */
  58. delegateObject: object;
  59. /**
  60. * 是否阻止了原生事件
  61. * @type {boolean}
  62. */
  63. defaultPrevented: boolean;
  64. /**
  65. * 是否阻止传播(向上冒泡)
  66. * @type {boolean}
  67. */
  68. propagationStopped: boolean;
  69. /**
  70. * 触发事件的图形
  71. * @type {IShape}
  72. */
  73. shape: IShape;
  74. /**
  75. * 开始触发事件的图形
  76. * @type {IShape}
  77. */
  78. fromShape: IShape;
  79. /**
  80. * 事件结束时的触发图形
  81. * @type {IShape}
  82. */
  83. toShape: IShape;
  84. /**
  85. * 触发时的时间
  86. * @type {number}
  87. */
  88. timeStamp: number;
  89. /**
  90. * 触发时的对象
  91. * @type {object}
  92. */
  93. originalEvent: Event;
  94. propagationPath: any[];
  95. constructor(type: any, event: any);
  96. /**
  97. * 阻止浏览器默认的行为
  98. */
  99. preventDefault(): void;
  100. /**
  101. * 阻止冒泡
  102. */
  103. stopPropagation(): void;
  104. toString(): string;
  105. save(): void;
  106. restore(): void;
  107. }
  108. export default GraphEvent;