import { type Scheduler } from '@underlying/core'; import type { Morph, MorphElement } from './morph'; /** The shape to morph toward: raw path data (`"M ..."`) or an element with a `d`. */ export type MorphCommandsTarget = string | { getAttribute(name: string): string | null; }; export interface MorphCommandsOptions { scheduler?: Scheduler; /** Initial morph fraction, 0..1 (0 = original shape, 1 = target). Default 0. */ from?: number; /** Spring to this fraction on creation. */ to?: number; } /** * Command-preserving morph. Unlike `morph()` (which resamples both outlines into * a polyline), this parses both `d` strings into cubic segments, subdivides the * sparser shape so the two match anchor-for-anchor (de Casteljau, so original * corners stay sharp), aligns closed rings by rotation and winding, and * interpolates each anchor and control. The result is real curves with crisp * corners. Elliptical arcs (A) are converted to cubics; segments are divided by * arc length, correspondence is matched on centroid/scale-normalized anchors, and * subpaths pair by similarity (surplus pieces shrink to / grow from a point). The * fraction is a live Animatable - spring it, scrub it, grab it mid-morph. * `revert()` restores the original `d`. For arbitrary blobby shapes where corner * preservation does not matter, `morph()` (resampling) is the simpler fallback. */ export declare function morphCommands(element: MorphElement, target: MorphCommandsTarget, options?: MorphCommandsOptions): Morph; //# sourceMappingURL=morph-commands.d.ts.map