index.d.ts 824 B

1234567891011121314151617181920212223
  1. import { GUI } from '../../core';
  2. import { DisplayObject, type Group } from '../../shapes';
  3. import type { TitleOptions, TitleStyleProps } from './types';
  4. export type { TitleOptions, TitleStyleProps };
  5. /**
  6. * @example
  7. * lt -> ['l', 't']
  8. * left-top -> ['l', 't']
  9. * inner -> i
  10. */
  11. export declare function parsePosition(position: string): string[];
  12. /**
  13. * calculate the actual bbox of the element with title
  14. * @example a legend with width x, height y, but the real bbox is x1 < x, y1 < y
  15. */
  16. export declare function getBBox(title: Title, content: DisplayObject): DOMRect;
  17. export declare class Title extends GUI<TitleStyleProps> {
  18. private title;
  19. constructor(options: TitleOptions);
  20. getAvailableSpace(): DOMRect;
  21. getBBox(): DOMRect;
  22. render(attributes: Required<TitleStyleProps>, container: Group): void;
  23. }