handle.d.ts 1.0 KB

12345678910111213141516171819202122
  1. import { GUI, type ComponentOptions, type PrefixStyleProps } from '../../../core';
  2. import { Group, type GroupStyleProps, type TextStyleProps } from '../../../shapes';
  3. import type { PrefixObject } from '../../../types';
  4. import { MarkerStyleProps } from '../../marker';
  5. export type HandleStyleProps<T = any> = GroupStyleProps & PrefixObject<TextStyleProps, 'label'> & PrefixStyleProps<Omit<MarkerStyleProps, 'x' | 'y'>, 'marker'> & {
  6. showLabel?: boolean;
  7. formatter?: (val: T) => string;
  8. orientation: 'vertical' | 'horizontal';
  9. /** spacing between marker and label */
  10. spacing?: number;
  11. shape?: 'basic' | 'slider';
  12. };
  13. export type HandleOptions = ComponentOptions<HandleStyleProps>;
  14. export type HandleType = 'start' | 'end';
  15. export declare const DEFAULT_HANDLE_CFG: Partial<HandleStyleProps>;
  16. export declare class Handle extends GUI<HandleStyleProps> {
  17. constructor(options: HandleOptions);
  18. private marker;
  19. render(attributes: Required<HandleStyleProps>, container: Group): void;
  20. private renderMarker;
  21. private renderLabel;
  22. }