UNPKG

1.11 kBTypeScriptView Raw
1import Displayable, { DisplayableProps, DisplayableStatePropNames } from './Displayable';
2import BoundingRect from '../core/BoundingRect';
3import { PathStyleProps } from './Path';
4import { FontStyle, FontWeight } from '../core/types';
5export 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}
17export declare const DEFAULT_TSPAN_STYLE: TSpanStyleProps;
18export interface TSpanProps extends DisplayableProps {
19 style?: TSpanStyleProps;
20}
21export declare type TSpanState = Pick<TSpanProps, DisplayableStatePropNames>;
22declare 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}
31export default TSpan;