TSpan.d.ts 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. import Displayable, { DisplayableProps, DisplayableStatePropNames } from './Displayable';
  2. import BoundingRect from '../core/BoundingRect';
  3. import { PathStyleProps } from './Path';
  4. import { FontStyle, FontWeight } from '../core/types';
  5. export interface TSpanStyleProps extends PathStyleProps {
  6. x?: number;
  7. y?: number;
  8. text?: string;
  9. font?: string;
  10. fontSize?: number;
  11. fontWeight?: FontWeight;
  12. fontStyle?: FontStyle;
  13. fontFamily?: string;
  14. textAlign?: CanvasTextAlign;
  15. textBaseline?: CanvasTextBaseline;
  16. }
  17. export declare const DEFAULT_TSPAN_STYLE: TSpanStyleProps;
  18. export interface TSpanProps extends DisplayableProps {
  19. style?: TSpanStyleProps;
  20. }
  21. export declare type TSpanState = Pick<TSpanProps, DisplayableStatePropNames>;
  22. declare class TSpan extends Displayable<TSpanProps> {
  23. style: TSpanStyleProps;
  24. hasStroke(): boolean;
  25. hasFill(): boolean;
  26. createStyle(obj?: TSpanStyleProps): TSpanStyleProps;
  27. setBoundingRect(rect: BoundingRect): void;
  28. getBoundingRect(): BoundingRect;
  29. protected static initDefaultProps: void;
  30. }
  31. export default TSpan;