import * as fontkit from 'fontkit';
import SVGPathCommander from 'svg-path-commander';
export declare function ensureNumber(value: string | undefined): number | undefined;
export declare function ensureCSSValue(value: string | undefined): number | undefined;
export declare function getSVGValue(element: Element, propertyName: string): string | undefined;
export type TextFragment = {
    glyphs: Glyph[];
    bbox: fontkit.Glyph['bbox'];
    descent: number;
    ascent: number;
    unitsPerEm: number;
};
type Glyph = {
    path?: SVGPathCommander;
    bbox: fontkit.Glyph['bbox'];
    cbox: fontkit.Glyph['cbox'];
    xAdvance: number;
    advanceWidth: number;
    letterSpacing: number;
    isLigature: boolean;
    isMark: boolean;
};
export type TextFormat = {
    fontFamily: string;
    fontWeight: number;
    fontStyle: string;
    fontSize: number;
    letterSpacing: number;
};
export declare function getTextFormat(text: SVGTextElement | SVGTSpanElement, inherit?: TextFormat): TextFormat;
export declare function getFont(fontData: Uint8Array, concreteWeight?: number | string): fontkit.Font;
export declare function textToPath(text: string, fontData: Uint8Array, fontSize: number, letterSpacing: number, alignmentBaseline: 'hanging' | 'middle' | 'baseline', concreteWeight?: number | string): {
    glyphs: Glyph[];
    ascent: number;
    descent: number;
    unitsPerEm: number;
    fontBBox: fontkit.BBOX;
};
export declare function combineBBoxes(bboxes: {
    x: number;
    y: number;
    width: number;
    height: number;
}[]): {
    x: number;
    y: number;
    width: number;
    height: number;
};
export type SpanDescriptor = {
    format: TextFormat;
    text: string;
    dx?: number;
    dy?: number;
    x?: number;
    y?: number;
    style?: string;
    tspan?: SVGTSpanElement;
};
export declare function textToSpans(text: SVGTextElement): {
    spans: SpanDescriptor[];
    x: number;
    y: number;
};
export declare function renderTextSpans(stylesheet: string, spans: SpanDescriptor[], baseX: number, baseY: number): Promise<{
    glyphBBoxes: {
        x: number;
        y: number;
        width: number;
        height: number;
    }[];
    bbox: {
        x: number;
        y: number;
        width: number;
        height: number;
    };
    paths: SVGPathCommander[];
    style: string | undefined;
    text: string;
    ascent: number;
    descent: number;
    unitsPerEm: number;
    fontBBox: fontkit.BBOX;
}[]>;
export declare function textElementToPath(text: SVGTextElement, rootSVG: SVGSVGElement): Promise<{
    paths: {
        paths: SVGPathCommander[];
        style: string | undefined;
    }[];
    text: string;
}>;
export declare function getElementClipPath(element: Element): string | undefined;
export declare function getElementMask(element: Element): string | undefined;
export declare function createInlineStyle(values: {
    [k: string]: string | undefined;
}): string;
export declare function getStyleObjectFromInlineStyle(styleAttr: string | null): {
    [k: string]: string;
};
export {};
