html-component.d.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import { BBox, ComponentCfg, HtmlComponentCfg } from '../types';
  2. import Component from './component';
  3. declare abstract class HtmlComponent<T extends ComponentCfg = HtmlComponentCfg> extends Component<T> {
  4. getDefaultCfg(): {
  5. container: any;
  6. containerTpl: string;
  7. updateAutoRender: boolean;
  8. containerClassName: string;
  9. parent: any;
  10. id: string;
  11. name: string;
  12. type: string;
  13. locationType: string;
  14. offsetX: number;
  15. offsetY: number;
  16. animate: boolean;
  17. capture: boolean;
  18. animateOption: {
  19. appear: any;
  20. update: {
  21. duration: number;
  22. easing: string;
  23. };
  24. enter: {
  25. duration: number;
  26. easing: string;
  27. };
  28. leave: {
  29. duration: number;
  30. easing: string;
  31. };
  32. };
  33. events: any;
  34. defaultCfg: {};
  35. visible: boolean;
  36. };
  37. getContainer(): HTMLElement;
  38. /**
  39. * 显示组件
  40. */
  41. show(): void;
  42. /**
  43. * 隐藏组件
  44. */
  45. hide(): void;
  46. /**
  47. * 是否允许捕捉事件
  48. * @param capture 事件捕捉
  49. */
  50. setCapture(capture: any): void;
  51. getBBox(): BBox;
  52. clear(): void;
  53. destroy(): void;
  54. /**
  55. * 复写 init,主要是初始化 DOM 和事件
  56. */
  57. init(): void;
  58. protected initCapture(): void;
  59. protected initVisible(): void;
  60. protected initDom(): void;
  61. protected initContainer(): void;
  62. protected resetStyles(): void;
  63. protected applyStyles(): void;
  64. protected applyChildrenStyles(element: any, styles: any): void;
  65. protected applyStyle(cssName: any, dom: any): void;
  66. /**
  67. * @protected
  68. */
  69. protected createDom(): any;
  70. /**
  71. * @protected
  72. * 初始化事件
  73. */
  74. protected initEvent(): void;
  75. /**
  76. * @protected
  77. * 清理 DOM
  78. */
  79. protected removeDom(): void;
  80. /**
  81. * @protected
  82. * 清理事件
  83. */
  84. protected removeEvent(): void;
  85. protected updateInner(cfg: any): void;
  86. protected resetPosition(): void;
  87. }
  88. export default HtmlComponent;