UNPKG

flowmolio

Version:

[![Tests](https://github.com/vladvlasov256/flowmolio/actions/workflows/test.yml/badge.svg)](https://github.com/vladvlasov256/flowmolio/actions/workflows/test.yml) [![Coverage](https://codecov.io/gh/vladvlasov256/flowmolio/branch/main/graph/badge.svg)](htt

32 lines (31 loc) 963 B
import { SVGElementNode } from '../types'; /** * Represents a line in text layout with its position */ export interface Line { y: number; x: number; } /** * Array of lines, sorted by y-coordinate with unique y-values */ export type Lines = Line[]; /** * Extracts lines from tspan elements, handling multiple tspans on the same line */ export declare function extractLinesFromTspans(tspanStrings: string[]): Lines; /** * Extracts lines from a text element's innerHTML */ export declare function extractLinesFromElement(element: SVGElementNode): Lines; /** * Calculates the height of a text element based on its lines */ export declare function calculateTextElementHeight(element: SVGElementNode, oldLineHeight?: number): { height: number; lineHeight: number; }; /** * Shifts elements whose top is below the given y-coordinate */ export declare function shiftElementsBelow(svgTree: SVGElementNode, belowY: number, deltaY: number): void;