handle.d.ts 1.0 KB

12345678910111213141516171819202122232425
  1. import { ComponentOptions, GUI, PrefixStyleProps } from '../../core';
  2. import type { DisplayObject, GroupStyleProps, PathStyleProps, TextStyleProps } from '../../shapes';
  3. import { Group } from '../../shapes';
  4. export type IconStyleProps = PathStyleProps & {
  5. size?: number;
  6. radius?: number;
  7. shape?: string | (() => DisplayObject);
  8. orientation?: 'horizontal' | 'vertical';
  9. };
  10. export type LabelStyleProps = Partial<TextStyleProps>;
  11. export type HandleStyleProps = GroupStyleProps & PrefixStyleProps<LabelStyleProps, 'label'> & PrefixStyleProps<IconStyleProps, 'icon'> & {
  12. orientation?: IconStyleProps['orientation'];
  13. showLabel?: boolean;
  14. spacing?: number;
  15. type?: 'start' | 'end';
  16. };
  17. export type HandleOptions = ComponentOptions<HandleStyleProps>;
  18. export declare class Handle extends GUI<HandleStyleProps> {
  19. private label;
  20. private icon;
  21. constructor(options: HandleOptions);
  22. private renderLabel;
  23. private renderIcon;
  24. render(attributes: HandleStyleProps, container: Group): void;
  25. }