UNPKG

1.86 kBTypeScriptView Raw
1import { RenderingContext2D } from '../types';
2import BoundingBox from '../BoundingBox';
3import Document from './Document';
4import Element from './Element';
5import FontElement from './FontElement';
6import GlyphElement from './GlyphElement';
7import RenderedElement from './RenderedElement';
8export default class TextElement extends RenderedElement {
9 type: string;
10 protected x: number;
11 protected y: number;
12 private measureCache;
13 constructor(document: Document, node: HTMLElement, captureTextNodes?: boolean);
14 setContext(ctx: RenderingContext2D, fromMeasure?: boolean): void;
15 protected initializeCoordinates(ctx: RenderingContext2D): void;
16 getBoundingBox(ctx: RenderingContext2D): BoundingBox;
17 protected getFontSize(): number;
18 protected getTElementBoundingBox(ctx: RenderingContext2D): BoundingBox;
19 getGlyph(font: FontElement, text: string, i: number): GlyphElement;
20 getText(): string;
21 protected getTextFromNode(node?: ChildNode): string;
22 renderChildren(ctx: RenderingContext2D): void;
23 protected renderTElementChildren(ctx: RenderingContext2D): void;
24 protected getAnchorDelta(ctx: RenderingContext2D, parent: Element, startI: number): number;
25 protected adjustChildCoordinates(ctx: RenderingContext2D, textParent: TextElement, parent: Element, i: number): TextElement;
26 protected getChildBoundingBox(ctx: RenderingContext2D, textParent: TextElement, parent: Element, i: number): BoundingBox;
27 protected renderChild(ctx: RenderingContext2D, textParent: TextElement, parent: Element, i: number): void;
28 protected measureTextRecursive(ctx: RenderingContext2D): number;
29 protected measureText(ctx: RenderingContext2D): number;
30 protected measureTargetText(ctx: RenderingContext2D, targetText: string): number;
31}
32//# sourceMappingURL=TextElement.d.ts.map
\No newline at end of file