import type { ShapeType, CanvasElement } from '../types'; /** Build a `d` string for a shape type, fitted to a w×h box (origin 0,0). */ export declare function shapeToPath(type: ShapeType, w: number, h: number, borderRadius?: number): string; /** * Extract drawable path `d` strings from raw SVG markup. Returns an array of * subpath `d` strings (one per primitive). Empty when nothing is drawable. */ export declare function extractPaths(svgContent: string): string[]; /** * Like extractPaths, but pairs each subpath with its own fill color so a * multi-color SVG morphs per-piece (one `` per subpath) instead of * flattening to a single representative color. Primitives without their own * fill inherit the root `` (default black, matching the * browser), which is exactly the black outline strokes on icon SVGs. */ export declare function extractPathsWithFill(svgContent: string): Array<{ d: string; fill: string; }>; /** Single combined `d` (all subpaths concatenated) — for simple morphs. */ export declare function extractCombinedPath(svgContent: string): string | null; /** * Pick a representative fill color from SVG markup — the first non-"none" * `fill` attribute. Used to color the flattened morph path (which loses * per-subpath fills). Returns null if none found. */ export declare function extractFill(svgContent: string): string | null; /** * Re-fit a path `d` from its own viewBox into a target W×H box (origin 0,0). * Morph stops must share a coordinate space or flubber produces scale jumps; * authoring normalizes every stop into the element's box via this. Parses to * absolute cubics, scales anchors + handles, re-serializes. */ export declare function fitPathToBox(d: string, sourceViewBox: string, targetW: number, targetH: number): string; /** * Resolve any vector element (shape / svg / draw) to its current geometry as * a path `d` plus the viewBox that `d` lives in. Single source of truth for * both the morph engine and the "snapshot current" authoring action. */ export declare function resolveElementPath(el: CanvasElement): { d: string; viewBox: string; } | null; /** * Like resolveElementPath but keeps subpaths SEPARATE, each with its own fill, * so multi-color SVGs morph per-piece. Shapes/draws return a single part. */ export declare function resolveElementPathParts(el: CanvasElement): { parts: Array<{ d: string; fill: string; }>; viewBox: string; } | null; export type PathInterpolator = (t: number) => string; /** One morphing piece: a `d` interpolator plus the color it lerps across. */ export interface MorphPart { interp: PathInterpolator; fromColor: string; toColor: string; } /** * Build per-piece morph parts between two fill-tagged subpath lists. Each `d` * MUST already be in the same coordinate space (caller fits the source into * the target viewBox). Picks the right flubber routine by count so 1↔many and * many↔1 map correctly, and pairs colors per piece so multi-color SVGs keep * their colors instead of flattening to one. */ export declare function makeMorphParts(from: Array<{ d: string; fill: string; }>, to: Array<{ d: string; fill: string; }>): MorphPart[]; /** * Build an interpolator between two `d` strings. Handles differing subpath * counts via flubber's many-to-many interpolation, falling back to a simple * single-path interpolate. Always returns a function (t:0..1) => d. */ export declare function makePathInterpolator(fromD: string, toD: string): PathInterpolator; /** * Build a single interpolator that morphs through an ordered list of `d` * stops. `t` runs 0..1 across the whole sequence; the segment is picked by * scaling `t` across (stops.length - 1) and interpolating within it. Used by * the within-slide multi-target morph (circle → star → hexagon → …). * When `loop` is true the sequence wraps back to the first stop. */ export declare function makeSequenceInterpolator(stops: string[], loop?: boolean): PathInterpolator;