ribbon.d.ts 1.0 KB

12345678910111213141516171819202122
  1. import { GUI, type ComponentOptions, type PrefixStyleProps } from '../../../core';
  2. import { Group, type GroupStyleProps, type PathStyleProps, type RectStyleProps } from '../../../shapes';
  3. export type Interpolate<T = string> = (val: number) => T;
  4. export type RibbonStyleProps = GroupStyleProps & PrefixStyleProps<PathStyleProps, 'selection'> & PrefixStyleProps<RectStyleProps, 'track'> & {
  5. block?: boolean;
  6. color: string[] | Interpolate;
  7. length: number;
  8. orientation?: 'horizontal' | 'vertical';
  9. /** partition of the block ,the length of it is the block count */
  10. partition?: number[];
  11. /** select area, 0~1 */
  12. range?: [number, number];
  13. size: number;
  14. type?: 'size' | 'color';
  15. };
  16. export type RibbonOptions = ComponentOptions<RibbonStyleProps>;
  17. type RequiredRibbonStyleProps = Required<RibbonStyleProps>;
  18. export declare class Ribbon extends GUI<RibbonStyleProps> {
  19. constructor(options: RibbonOptions);
  20. render(attribute: RequiredRibbonStyleProps, container: Group): void;
  21. }
  22. export {};