/** * SVG Path to FCM Outline converter * * Converts SVG path `d` attribute strings into FCM Outline format. * * @example * ```ts * const parser = new SvgPathParser({ dpi: 96 }); * const paths = parser.parse("M 0,0 L 100,0 L 100,100 Z"); * ``` */ import { Outline } from "./outline.js"; import { PathShape } from "./path-shape.js"; import { Point } from "./point.js"; /** Configuration for SVG to FCM conversion */ export interface SvgConfig { /** DPI of the SVG (default 96 for web, 72 for Illustrator) */ dpi: number; /** Scale factor (1.0 = no scaling) */ scale: number; /** X offset in mm */ offsetXMm: number; /** Y offset in mm */ offsetYMm: number; } /** Represents a parsed SVG subpath */ export interface ParsedSubpath { start: Point; outline: Outline; closed: boolean; } /** Error from SVG parsing */ export declare class SvgParseError extends Error { position: number; constructor(message: string, position: number); } /** SVG Path parser and converter */ export declare class SvgPathParser { private config; constructor(config?: Partial); /** Convert SVG coordinate to FCM units (hundredths of mm) */ toFcm(svgValue: number): number; /** Convert SVG point to FCM Point */ pointToFcm(x: number, y: number): Point; /** Parse an SVG path `d` attribute into FCM PathShapes */ parse(d: string): PathShape[]; /** Parse SVG path into subpaths (more detailed output) */ parseToSubpaths(d: string): ParsedSubpath[]; private parseTokens; private readNumber; private readPoint; private buildSubpath; }