flowmolio
Version:
[](https://github.com/vladvlasov256/flowmolio/actions/workflows/test.yml) [](htt
32 lines (31 loc) • 963 B
TypeScript
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;