index.d.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { GUI } from '../../core';
  2. import { Group } from '../../shapes';
  3. import type { ButtonOptions, ButtonStyleProps } from './types';
  4. export type { ButtonStyleProps, ButtonOptions };
  5. export declare class Button extends GUI<ButtonStyleProps> {
  6. /**
  7. * 组件类型
  8. */
  9. static tag: string;
  10. /**
  11. * 文本
  12. */
  13. private textShape;
  14. private state;
  15. private get markerSize();
  16. private get textAvailableWidth();
  17. private get buttonHeight();
  18. constructor(options: ButtonOptions);
  19. /**
  20. * 根据size、type属性生成实际渲染的属性
  21. */
  22. private getStyle;
  23. render(attributes: Required<ButtonStyleProps>, container: Group): void;
  24. /**
  25. * 组件的更新
  26. */
  27. update(attr?: Partial<ButtonStyleProps>): void;
  28. /** 更新状态 (不需要走 update) */
  29. setState(state: 'disabled' | 'active' | 'default'): void;
  30. hide(): void;
  31. show(): void;
  32. private clickEvents;
  33. private mouseenterEvent;
  34. private mouseleaveEvent;
  35. bindEvents(): void;
  36. }