@svgsketch/core 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -97,12 +97,13 @@ type CycleBehavior = 'restart' | 'alternate';
97
97
  * A single keyframe in an animation track.
98
98
  *
99
99
  * - `time` — Absolute time in seconds within the track.
100
- * - `value` — The property value at this point (number for numeric, string for colors/paths).
100
+ * - `value` — The property value at this point (number for numeric, string
101
+ * for colors/paths, or a 6-number matrix for `transformMatrix`).
101
102
  * - `easing` — The easing curve *leading into* this keyframe (from the previous keyframe).
102
103
  */
103
104
  interface AnimationKeyframe {
104
105
  time: number;
105
- value: number | string;
106
+ value: number | string | number[];
106
107
  easing: EasingType;
107
108
  /** Custom cubic-bezier control points [x1, y1, x2, y2] when easing is CUSTOM_BEZIER. */
108
109
  customBezier?: [number, number, number, number];
@@ -340,7 +341,7 @@ interface SerializedAnimationTimeline {
340
341
  calcMode?: 'linear' | 'discrete' | 'paced' | 'spline';
341
342
  keyframes: {
342
343
  time: number;
343
- value: number | string;
344
+ value: number | string | number[];
344
345
  easing: string;
345
346
  customBezier?: [number, number, number, number];
346
347
  linearPoints?: {
@@ -1532,6 +1533,68 @@ interface Measurement {
1532
1533
  opacity?: number;
1533
1534
  }
1534
1535
 
1536
+ /** SVG affine matrix in `[a,b,c,d,e,f]` order. */
1537
+ type AffineTransformMatrix = number[];
1538
+ /**
1539
+ * Persisted/editor-facing transform state shared by document serialization,
1540
+ * editor shape state, and public plugin geometry types.
1541
+ */
1542
+ interface ShapeTransformState {
1543
+ /**
1544
+ * Canonical local affine transform mapping shape-local geometry into the
1545
+ * parent frame. This matrix is the definitive transform state when present.
1546
+ */
1547
+ transformMatrix?: AffineTransformMatrix | null;
1548
+ /** @deprecated Use `transformMatrix`; retained as a decomposed compatibility projection. */
1549
+ scaleX?: number;
1550
+ /** @deprecated Use `transformMatrix`; retained as a decomposed compatibility projection. */
1551
+ scaleY?: number;
1552
+ /** @deprecated Use `transformMatrix`; retained as a decomposed compatibility projection. */
1553
+ translateX?: number;
1554
+ /** @deprecated Use `transformMatrix`; retained as a decomposed compatibility projection. */
1555
+ translateY?: number;
1556
+ /** @deprecated Legacy text resize anchor; fold into `transformMatrix` on read. */
1557
+ scaleAnchor?: Point | null;
1558
+ /** @deprecated Use `transformMatrix`; retained as a decomposed compatibility projection. */
1559
+ rotation?: number;
1560
+ /** @deprecated Use `transformMatrix`; retained as a decomposed compatibility projection. */
1561
+ skewX?: number;
1562
+ /** @deprecated Use `transformMatrix`; retained as a decomposed compatibility projection. */
1563
+ skewY?: number;
1564
+ customPivot?: Point | null;
1565
+ /** @deprecated Use `transformMatrix`; retained only for legacy/source-fidelity imports. */
1566
+ rawTransform?: string;
1567
+ /** @deprecated Legacy v2 import field. Fold into `transformMatrix` on read; never use at runtime. */
1568
+ ancestorTransform?: AffineTransformMatrix;
1569
+ }
1570
+ declare const SHAPE_TRANSFORM_STATE_KEYS: readonly ["transformMatrix", "scaleX", "scaleY", "translateX", "translateY", "rotation", "skewX", "skewY", "customPivot", "rawTransform"];
1571
+ declare const NUMERIC_SHAPE_TRANSFORM_STATE_KEYS: readonly ["transformMatrix", "scaleX", "scaleY", "translateX", "translateY", "rotation", "skewX", "skewY"];
1572
+ /**
1573
+ * Runtime scene-node transform state after schema defaults are applied.
1574
+ * Unlike serialized shape state, these properties are always present.
1575
+ */
1576
+ interface CommonTransformNodeProps {
1577
+ /**
1578
+ * Canonical local transform matrix in SVG affine order `[a,b,c,d,e,f]`.
1579
+ * This maps shape-local geometry into the parent scene-node frame.
1580
+ */
1581
+ transformMatrix: AffineTransformMatrix | null;
1582
+ /** @deprecated Use `transformMatrix`; retained as a decomposed compatibility projection. */
1583
+ translateX: number;
1584
+ /** @deprecated Use `transformMatrix`; retained as a decomposed compatibility projection. */
1585
+ translateY: number;
1586
+ /** @deprecated Use `transformMatrix`; retained as a decomposed compatibility projection. */
1587
+ rotation: number;
1588
+ /** @deprecated Use `transformMatrix`; retained as a decomposed compatibility projection. */
1589
+ skewX: number;
1590
+ /** @deprecated Use `transformMatrix`; retained as a decomposed compatibility projection. */
1591
+ skewY: number;
1592
+ customPivot: Point | null;
1593
+ /** @deprecated Use `transformMatrix`; retained only for legacy/source-fidelity imports. */
1594
+ rawTransform: string | null;
1595
+ }
1596
+ declare const COMMON_TRANSFORM_NODE_DEFAULTS: CommonTransformNodeProps;
1597
+
1535
1598
  /**
1536
1599
  * @svgsketch/core — Serialized document types.
1537
1600
  *
@@ -1540,114 +1603,108 @@ interface Measurement {
1540
1603
  * SVGSketch documents.
1541
1604
  */
1542
1605
 
1606
+ type SerializedShapeState = ShapeTransformState & {
1607
+ [key: string]: unknown;
1608
+ x?: number;
1609
+ y?: number;
1610
+ width?: number;
1611
+ height?: number;
1612
+ radius?: number;
1613
+ rx?: number;
1614
+ ry?: number;
1615
+ cornerRadius?: number;
1616
+ cornerShape?: 'round' | 'notch' | 'bevel' | 'scoop';
1617
+ cornerMode?: 'uniform' | 'non-uniform';
1618
+ cornerRadiusTL?: number;
1619
+ cornerRadiusTR?: number;
1620
+ cornerRadiusBL?: number;
1621
+ cornerRadiusBR?: number;
1622
+ cornerShapeTL?: 'round' | 'notch' | 'bevel' | 'scoop';
1623
+ cornerShapeTR?: 'round' | 'notch' | 'bevel' | 'scoop';
1624
+ cornerShapeBL?: 'round' | 'notch' | 'bevel' | 'scoop';
1625
+ cornerShapeBR?: 'round' | 'notch' | 'bevel' | 'scoop';
1626
+ fontSize?: number;
1627
+ text?: string;
1628
+ fontFamily?: string;
1629
+ fontWeight?: string;
1630
+ fontStyle?: string;
1631
+ fontVariant?: string;
1632
+ fontVariantLigatures?: string;
1633
+ fontVariantPosition?: string;
1634
+ fontVariantCaps?: string;
1635
+ fontVariantNumeric?: string;
1636
+ fontVariantEastAsian?: string;
1637
+ textDecoration?: {
1638
+ underline?: boolean;
1639
+ strikethrough?: boolean;
1640
+ overline?: boolean;
1641
+ };
1642
+ textTransform?: string;
1643
+ baselineShift?: string;
1644
+ dominantBaseline?: string;
1645
+ writingMode?: 'horizontal-tb' | 'vertical-rl' | 'vertical-lr';
1646
+ textAnchor?: string;
1647
+ letterSpacing?: number;
1648
+ wordSpacing?: number;
1649
+ lineHeight?: number;
1650
+ inlineSize?: number;
1651
+ overflowWrap?: 'normal' | 'break-word' | 'anywhere';
1652
+ whiteSpace?: 'normal' | 'nowrap' | 'pre' | 'pre-wrap' | 'pre-line' | 'break-spaces';
1653
+ textDirection?: 'ltr' | 'rtl';
1654
+ unicodeBidi?: 'normal' | 'embed' | 'bidi-override' | 'isolate' | 'isolate-override' | 'plaintext';
1655
+ fontVariationSettings?: Record<string, number>;
1656
+ /**
1657
+ * Per-glyph positioning data, mirroring SVG 2 §11.2's five attribute
1658
+ * lists (`x`, `y`, `dx`, `dy`, `rotate`).
1659
+ *
1660
+ * - `x`/`y` are absolute user coordinates; `null` means "no
1661
+ * override at this glyph — the cursor advances naturally".
1662
+ * - `dx`/`dy` are additive shifts on top of natural advance.
1663
+ * - `rotate` is per-glyph rotation in degrees.
1664
+ *
1665
+ * For backward compatibility, the legacy three-field shape
1666
+ * `{x, y, rotate}` (produced before the spec-aligned model shipped)
1667
+ * is still accepted on read; its `x`/`y` are interpreted as the
1668
+ * additive shifts (`dx`/`dy`).
1669
+ */
1670
+ charOffsets?: ({
1671
+ x: number | null;
1672
+ y: number | null;
1673
+ dx: number;
1674
+ dy: number;
1675
+ rotate: number;
1676
+ } | {
1677
+ x: number;
1678
+ y: number;
1679
+ rotate: number;
1680
+ })[];
1681
+ linePositions?: {
1682
+ x: number;
1683
+ dy: number;
1684
+ }[];
1685
+ textLength?: number;
1686
+ lengthAdjust?: 'spacing' | 'spacingAndGlyphs';
1687
+ /**
1688
+ * Whether this text element uses the rich-text model (styled runs with
1689
+ * per-character formatting) versus the plain-text model. When true,
1690
+ * `richTextData` is the authoritative source for text content and
1691
+ * formatting; when false/absent, `text` is authoritative.
1692
+ */
1693
+ useRichText?: boolean;
1694
+ richTextData?: RichTextData;
1695
+ textX?: number;
1696
+ textY?: number;
1697
+ fillColor?: string;
1698
+ fillOpacity?: number;
1699
+ borderColor?: string;
1700
+ borderWidth?: number | string;
1701
+ strokeOpacity?: number;
1702
+ };
1543
1703
  interface SerializedShape {
1544
1704
  id: string;
1545
1705
  /** Shape type identifier. Built-in types: 'circle', 'rectangle', etc. Plugin shapes use custom ids. */
1546
1706
  type: string;
1547
- state: {
1548
- x?: number;
1549
- y?: number;
1550
- width?: number;
1551
- height?: number;
1552
- radius?: number;
1553
- rx?: number;
1554
- ry?: number;
1555
- cornerRadius?: number;
1556
- cornerShape?: 'round' | 'notch' | 'bevel' | 'scoop';
1557
- cornerMode?: 'uniform' | 'non-uniform';
1558
- cornerRadiusTL?: number;
1559
- cornerRadiusTR?: number;
1560
- cornerRadiusBL?: number;
1561
- cornerRadiusBR?: number;
1562
- cornerShapeTL?: 'round' | 'notch' | 'bevel' | 'scoop';
1563
- cornerShapeTR?: 'round' | 'notch' | 'bevel' | 'scoop';
1564
- cornerShapeBL?: 'round' | 'notch' | 'bevel' | 'scoop';
1565
- cornerShapeBR?: 'round' | 'notch' | 'bevel' | 'scoop';
1566
- fontSize?: number;
1567
- text?: string;
1568
- fontFamily?: string;
1569
- fontWeight?: string;
1570
- fontStyle?: string;
1571
- fontVariant?: string;
1572
- fontVariantLigatures?: string;
1573
- fontVariantPosition?: string;
1574
- fontVariantCaps?: string;
1575
- fontVariantNumeric?: string;
1576
- fontVariantEastAsian?: string;
1577
- textDecoration?: {
1578
- underline?: boolean;
1579
- strikethrough?: boolean;
1580
- overline?: boolean;
1581
- };
1582
- textTransform?: string;
1583
- baselineShift?: string;
1584
- dominantBaseline?: string;
1585
- writingMode?: 'horizontal-tb' | 'vertical-rl' | 'vertical-lr';
1586
- textAnchor?: string;
1587
- letterSpacing?: number;
1588
- wordSpacing?: number;
1589
- lineHeight?: number;
1590
- inlineSize?: number;
1591
- overflowWrap?: 'normal' | 'break-word' | 'anywhere';
1592
- whiteSpace?: 'normal' | 'nowrap' | 'pre' | 'pre-wrap' | 'pre-line' | 'break-spaces';
1593
- textDirection?: 'ltr' | 'rtl';
1594
- unicodeBidi?: 'normal' | 'embed' | 'bidi-override' | 'isolate' | 'isolate-override' | 'plaintext';
1595
- fontVariationSettings?: Record<string, number>;
1596
- /**
1597
- * Per-glyph positioning data, mirroring SVG 2 §11.2's five attribute
1598
- * lists (`x`, `y`, `dx`, `dy`, `rotate`).
1599
- *
1600
- * - `x`/`y` are absolute user coordinates; `null` means "no
1601
- * override at this glyph — the cursor advances naturally".
1602
- * - `dx`/`dy` are additive shifts on top of natural advance.
1603
- * - `rotate` is per-glyph rotation in degrees.
1604
- *
1605
- * For backward compatibility, the legacy three-field shape
1606
- * `{x, y, rotate}` (produced before the spec-aligned model shipped)
1607
- * is still accepted on read; its `x`/`y` are interpreted as the
1608
- * additive shifts (`dx`/`dy`).
1609
- */
1610
- charOffsets?: ({
1611
- x: number | null;
1612
- y: number | null;
1613
- dx: number;
1614
- dy: number;
1615
- rotate: number;
1616
- } | {
1617
- x: number;
1618
- y: number;
1619
- rotate: number;
1620
- })[];
1621
- linePositions?: {
1622
- x: number;
1623
- dy: number;
1624
- }[];
1625
- textLength?: number;
1626
- lengthAdjust?: 'spacing' | 'spacingAndGlyphs';
1627
- /**
1628
- * Whether this text element uses the rich-text model (styled runs with
1629
- * per-character formatting) versus the plain-text model. When true,
1630
- * `richTextData` is the authoritative source for text content and
1631
- * formatting; when false/absent, `text` is authoritative.
1632
- */
1633
- useRichText?: boolean;
1634
- richTextData?: RichTextData;
1635
- scaleX?: number;
1636
- scaleY?: number;
1637
- translateX?: number;
1638
- translateY?: number;
1639
- textX?: number;
1640
- textY?: number;
1641
- scaleAnchor?: Point | null;
1642
- rotation?: number;
1643
- skewX?: number;
1644
- skewY?: number;
1645
- customPivot?: Point | null;
1646
- fillColor?: string;
1647
- fillOpacity?: number;
1648
- borderColor?: string;
1649
- borderWidth?: number | string;
1650
- strokeOpacity?: number;
1707
+ state: SerializedShapeState & {
1651
1708
  /**
1652
1709
  * Inherit `fill` from the ancestor cascade rather than emit an explicit
1653
1710
  * attribute. Set at import for shapes inside `<defs>`/`<symbol>` that
@@ -1790,8 +1847,6 @@ interface SerializedShape {
1790
1847
  filterWidth?: string;
1791
1848
  /** @deprecated v2 — see `filterX`. */
1792
1849
  filterHeight?: string;
1793
- rawTransform?: string;
1794
- ancestorTransform?: number[];
1795
1850
  pathPoints?: PathPoint[];
1796
1851
  pathCurveType?: PathCurveType;
1797
1852
  pathClosed?: boolean;
@@ -2133,6 +2188,26 @@ interface SerializedShape {
2133
2188
  };
2134
2189
  }
2135
2190
  type SerializedViewbox = Viewbox;
2191
+ /**
2192
+ * Scene-graph placement for a node in the document tree.
2193
+ *
2194
+ * This is intentionally independent of SVG DOM serialization: `parentId`
2195
+ * identifies the scene parent (`null` means the document root) and `index`
2196
+ * is the sibling slot inside that parent.
2197
+ */
2198
+ interface SerializedSceneNodePlacement {
2199
+ id: string;
2200
+ parentId: string | null;
2201
+ index: number;
2202
+ updatedAt?: number;
2203
+ clientId?: string;
2204
+ }
2205
+ interface SerializedPaintServerDef {
2206
+ id: string;
2207
+ type: 'mask' | 'clipPath' | 'filter' | 'linearGradient' | 'radialGradient' | 'pattern' | 'symbol';
2208
+ /** Serialized SVG element markup for this def. */
2209
+ markup: string;
2210
+ }
2136
2211
  /**
2137
2212
  * Schema version for the HistorySnapshot format.
2138
2213
  *
@@ -2154,7 +2229,7 @@ type SerializedViewbox = Viewbox;
2154
2229
  * (version - 1) snapshots into the new format.
2155
2230
  * c. Register it in the migrateSnapshot() chain.
2156
2231
  */
2157
- declare const CURRENT_SCHEMA_VERSION = 2;
2232
+ declare const CURRENT_SCHEMA_VERSION = 4;
2158
2233
  interface HistorySnapshot {
2159
2234
  /**
2160
2235
  * Schema version — written on save, read on load to trigger migrations.
@@ -2165,6 +2240,12 @@ interface HistorySnapshot {
2165
2240
  viewboxes: SerializedViewbox[];
2166
2241
  guides?: Guide[];
2167
2242
  measurements?: Measurement[];
2243
+ /**
2244
+ * Canonical scene-graph hierarchy/order. Optional for backward
2245
+ * compatibility with older snapshots that encoded structure only through
2246
+ * container-owned `state.children` and legacy group side channels.
2247
+ */
2248
+ sceneTree?: SerializedSceneNodePlacement[];
2168
2249
  /** Group structure: array of group IDs with their parent group ID (null for top-level) */
2169
2250
  groups?: SerializedGroup[];
2170
2251
  /** Clip/mask group structure for undo/redo support */
@@ -2203,6 +2284,12 @@ interface HistorySnapshot {
2203
2284
  * `innerHTML`-append into editor defs on restore.
2204
2285
  */
2205
2286
  rawPaintServerDefs?: string[];
2287
+ /**
2288
+ * Typed paint-server/defs fragments that are not yet represented by the
2289
+ * structured `library` records. This supersedes `rawPaintServerDefs` for
2290
+ * new writers while the legacy string array remains for older clients.
2291
+ */
2292
+ paintServerDefs?: SerializedPaintServerDef[];
2206
2293
  /** @deprecated v2 — use `library`. Read-only: v1 docs migrate into `library`. */
2207
2294
  customPatterns?: CustomPatternDef[];
2208
2295
  /** @deprecated v2 — use `library`. Read-only: v1 docs migrate into `library`. */
@@ -2472,6 +2559,20 @@ interface SymbolLibraryDef extends LibraryDefBase {
2472
2559
  */
2473
2560
  defKind?: 'symbol' | 'group';
2474
2561
  viewBox: string;
2562
+ /**
2563
+ * Source `overflow` value, captured when explicitly set on the source
2564
+ * `<symbol>` (either as `overflow="visible"` or `style="overflow:visible"`).
2565
+ * Per SVG 2 §15.4.3 / §5.5.2, `<symbol>` is one of the elements whose UA
2566
+ * style sheet defaults `overflow` to `hidden` because it establishes a new
2567
+ * viewport — content drawn outside the use's `width`/`height` viewport
2568
+ * gets clipped. Inkscape and Cairo emit text-converted-to-glyph symbols
2569
+ * as `<symbol style="overflow:visible">` referenced by `<use width="1"
2570
+ * height="1">`, relying on `overflow:visible` to let the glyph paths
2571
+ * (with native coords ~0–7) spill the 1×1 viewport. Round-tripping the
2572
+ * value preserves that contract; emitting nothing falls back to the UA
2573
+ * `hidden` and silently clips the glyphs to invisible 1×1 boxes.
2574
+ */
2575
+ overflow?: 'visible' | 'hidden';
2475
2576
  /**
2476
2577
  * Wrapper attributes from the source `<g id="X">` def root that apply to
2477
2578
  * the def's contents (transform, opacity, fill cascade, mask, filter,
@@ -2617,19 +2718,13 @@ type LibraryDefOfKind<K extends LibraryKind> = Extract<LibraryDef, {
2617
2718
  * - Serialization format for the `.svgs` document format
2618
2719
  */
2619
2720
 
2620
- interface CommonNodeProps {
2721
+ interface CommonNodeProps extends CommonTransformNodeProps {
2621
2722
  fillColor: string;
2622
2723
  borderColor: string;
2623
2724
  borderWidth: number;
2624
2725
  opacity: number;
2625
2726
  fillOpacity: number;
2626
2727
  strokeOpacity: number;
2627
- translateX: number;
2628
- translateY: number;
2629
- rotation: number;
2630
- skewX: number;
2631
- skewY: number;
2632
- customPivot: Point | null;
2633
2728
  locked: boolean;
2634
2729
  visible: boolean;
2635
2730
  fillType: string;
@@ -2654,8 +2749,6 @@ interface CommonNodeProps {
2654
2749
  filterY: string | null;
2655
2750
  filterWidth: string | null;
2656
2751
  filterHeight: string | null;
2657
- rawTransform: string | null;
2658
- ancestorTransform: number[] | null;
2659
2752
  metadata: unknown | null;
2660
2753
  cssClipPath: string | null;
2661
2754
  cssMaskProperties: Record<string, string> | null;
@@ -2736,6 +2829,7 @@ interface TextNodeProps extends CommonNodeProps {
2736
2829
  unicodeBidi: string;
2737
2830
  scaleX: number;
2738
2831
  scaleY: number;
2832
+ /** @deprecated Runtime-only legacy text anchor; persisted transforms use transformMatrix. */
2739
2833
  scaleAnchor: Point | null;
2740
2834
  useRichText: boolean;
2741
2835
  richTextData: unknown | null;
@@ -3225,6 +3319,33 @@ declare function roundSerializedShape(shape: SerializedShape, precision: number)
3225
3319
  */
3226
3320
  declare function roundSnapshot(snapshot: HistorySnapshot, precision: number): HistorySnapshot;
3227
3321
 
3322
+ type Affine2D = readonly [number, number, number, number, number, number];
3323
+ declare const IDENTITY_AFFINE: Affine2D;
3324
+ declare function affine(a: number, b: number, c: number, d: number, e: number, f: number): Affine2D;
3325
+ declare function affineFromArray(m: readonly number[]): Affine2D;
3326
+ declare function affineToArray(m: Affine2D): number[];
3327
+ declare function isFiniteAffineArray(m: unknown): m is readonly number[];
3328
+ declare function isIdentityAffine(m: readonly number[], epsilon?: number): boolean;
3329
+ declare function multiplyAffine(parent: Affine2D, child: Affine2D): Affine2D;
3330
+ declare function translateAffine(tx: number, ty?: number): Affine2D;
3331
+ declare function scaleAffine(sx: number, sy?: number): Affine2D;
3332
+ declare function rotateAffine(angleDeg: number): Affine2D;
3333
+ declare function skewXAffine(angleDeg: number): Affine2D;
3334
+ declare function skewYAffine(angleDeg: number): Affine2D;
3335
+ declare function around(origin: Point, operation: Affine2D): Affine2D;
3336
+ declare function parseSvgTransformList(transform: string): Affine2D;
3337
+ declare function matrixTransformPart(matrix: readonly number[] | null | undefined): string | null;
3338
+ declare function composeLegacyTransformMatrix(state: Record<string, unknown>, defaultPivot?: Point): Affine2D;
3339
+ declare function canonicalTransformString(state: Record<string, unknown>, defaultPivot?: Point): string | null;
3340
+ /**
3341
+ * Compatibility normalizer for documents that still carry the pre-v3
3342
+ * `ancestorTransform` field. The legacy ancestor matrix is composed as the
3343
+ * outer transform and then removed so runtime/editor code only sees the
3344
+ * canonical local `transformMatrix`.
3345
+ */
3346
+ declare function foldLegacyAncestorTransformIntoMatrix(state: Record<string, unknown>, defaultPivot?: Point): void;
3347
+ declare function canonicalPolygonTransformString(state: Record<string, unknown>, cx: number, cy: number): string;
3348
+
3228
3349
  /**
3229
3350
  * Document-level SVG renderer.
3230
3351
  *
@@ -3605,7 +3726,7 @@ declare function getBuiltInMarkerDefs(): SerializedMarkerDef[];
3605
3726
  *
3606
3727
  * Produces:
3607
3728
  * - `<animate>` for numeric and color properties
3608
- * - `<animateTransform>` for rotation, skewX, skewY
3729
+ * - `<animateTransform>` for transformMatrix, rotation, skewX, skewY
3609
3730
  * - `<animateMotion>` for path-based motion
3610
3731
  * - `<discard>` for remove-at-time tracks
3611
3732
  *
@@ -4080,6 +4201,10 @@ declare abstract class ShapeBuilder<T extends ShapeBuilder<T>> {
4080
4201
  scale(x: number, y?: number): T;
4081
4202
  /** Set a custom pivot point for transforms. */
4082
4203
  pivot(x: number, y: number): T;
4204
+ /** Set the canonical local affine transform matrix directly. */
4205
+ transformMatrix(matrix: readonly [number, number, number, number, number, number] | number[]): T;
4206
+ private refreshTransformMatrix;
4207
+ private defaultTransformPivot;
4083
4208
  /** Add one or more filters to the shape. */
4084
4209
  filter(...filters: ShapeFilter[]): T;
4085
4210
  /** Add a drop shadow filter. */
@@ -4811,11 +4936,11 @@ declare class Track {
4811
4936
  * Add a keyframe at the given time.
4812
4937
  *
4813
4938
  * @param time - Time in seconds from the start of the track.
4814
- * @param value - The property value at this time (number or color string).
4939
+ * @param value - The property value at this time.
4815
4940
  * @param easing - Easing curve leading *into* this keyframe.
4816
4941
  * Defaults to LINEAR.
4817
4942
  */
4818
- keyframe(time: number, value: number | string, easing?: EasingType): Track;
4943
+ keyframe(time: number, value: number | string | number[], easing?: EasingType): Track;
4819
4944
  /**
4820
4945
  * Add a keyframe with a custom cubic-bezier easing.
4821
4946
  *
@@ -4823,7 +4948,7 @@ declare class Track {
4823
4948
  * @param value - The property value.
4824
4949
  * @param points - Cubic-bezier control points [x1, y1, x2, y2].
4825
4950
  */
4826
- keyframeBezier(time: number, value: number | string, points: [number, number, number, number]): Track;
4951
+ keyframeBezier(time: number, value: number | string | number[], points: [number, number, number, number]): Track;
4827
4952
  /**
4828
4953
  * Add a keyframe with a CSS linear() easing function.
4829
4954
  *
@@ -4831,7 +4956,7 @@ declare class Track {
4831
4956
  * @param value - The property value.
4832
4957
  * @param linearPoints - Control points for the piecewise linear function.
4833
4958
  */
4834
- keyframeLinear(time: number, value: number | string, linearPoints: LinearEasingPoint[]): Track;
4959
+ keyframeLinear(time: number, value: number | string | number[], linearPoints: LinearEasingPoint[]): Track;
4835
4960
  /** Add multiple keyframes at once. */
4836
4961
  keyframes(...kfs: AnimationKeyframe[]): Track;
4837
4962
  /** Disable this track (excluded from playback/export). */
@@ -5483,4 +5608,4 @@ declare function solveSudoku(grid: SudokuGrid, options?: SolveSudokuOptions): Su
5483
5608
  declare function validateSudokuPuzzle(grid: SudokuGrid): SudokuValidationResult;
5484
5609
  declare function generateSudokuPuzzle(options: GenerateSudokuOptions): GeneratedSudokuPuzzle;
5485
5610
 
5486
- export { type AnimatablePropertyDescriptor, type AnimationKeyframe, type AnimationTimeline, type AnimationTrack, type AnimationTrigger, type AnimationTriggerType, type AnyNodeProps, type ArcParams$1 as ArcParams, type AriaRole, Arrow, type ArrowNodeProps, Audio, BUILTIN_MARKER_ID_MAP, type BaseFilter, type BaseFilterPrimitive, type BlackAndWhiteFilter, type BlurQuality, type BrightnessFilter, CURRENT_SCHEMA_VERSION, type ChannelPainterFilter, Circle, type CircleNodeProps, Cloud, type CodeFormat, type CodegenOptions, type CommonNodeProps, type ConnectionDirection, type ConnectionPoint, Container, ContainerShapeBuilder, type ContouringDiscreteFilter, type ContouringTableFilter, type ContrastFilter, type CornerShapeValue, type CreateDocumentOptions, type CreateShapeOptions, Cross, type CrossNodeProps, type CrumpledPlasticFilter, type CustomPatternDef, type CycleBehavior, DEFAULT_COORDINATE_PRECISION, type DiffuseLightingFilter, Document, type DocumentMetadata, type DocumentNodeProps, type DocumentOptions, type DocumentScript, type DocumentStyle, type DropShadowFilter, type DuotoneFilter, EASING_CURVES, EVENT_TRIGGER_OPTIONS, EasingType, Ellipse, type EllipseNodeProps, type EmbossFilter, type ExtractedVariables, type FeBlendPrimitive, type FeColorMatrixPrimitive, type FeComponentTransferPrimitive, type FeCompositePrimitive, type FeConvolveMatrixPrimitive, type FeDiffuseLightingPrimitive, type FeDisplacementMapPrimitive, type FeDropShadowPrimitive, type FeFloodPrimitive, type FeGaussianBlurPrimitive, type FeImagePrimitive, type FeMergePrimitive, type FeMorphologyPrimitive, type FeOffsetPrimitive, type FeSpecularLightingPrimitive, type FeTilePrimitive, type FeTurbulencePrimitive, type FillType, type FilmGrainFilter, type FilterBlendMode, type FilterLibraryDef, type FilterLightSource, type FilterPrimitive, type FilterPrimitiveType, type FilterType, type GaussianBlurFilter, Gear, type GearNodeProps, type GenerateSudokuOptions, type GeneratedSudokuPuzzle, type GlowFilter, type GouacheFilter, type GradientDefinition, type GradientSpreadMethod, type GradientStop, type GradientUnits, type GrayscaleFilter, type GroupNodeProps, type Guide, Heart, type HistorySnapshot, type HueRotateFilter, Hyperlink, type ImageAttribution, type ImageNodeProps, ImageShape, type InkBlotFilter, type InnerGlowFilter, type InnerShadowFilter, type InvertFilter, LIBRARY_EMIT_ORDER, type LibraryDef, type LibraryDefBase, type LibraryDefOfKind, type LibraryKind, type LicenseType, type LightSource, Lightning, Line, type LineEndpointValue, type LineNodeProps, type LinearEasingPoint, type LinearGradient, LinearGradientBuilder, type LinearGradientLibraryDef, type LinkTarget, MARKER_HEIGHT, MARKER_VIEWBOX, MARKER_WIDTH, MAX_COORDINATE_PRECISION, MIGRATIONS, type MarkerDescriptor, type MarkerLibraryDef, type Measurement, type Migration, type MorphologyFilter, type MorphologyOperator, type MotionBlurFilter, NGon, type NGonNodeProps, NestedSvg, type NodeTypePropsMap, type NoiseFilter, type OpacityFilter, type OutlineFilter, type OutlinePosition, PUZZLE_DEFAULTS, type ParseOptions, Path, PathCurveType, type PathNodeProps, type PathPoint, PathPointType, PatternBuilder, type PatternElement, type PatternFill, type PatternLibraryDef, type PatternParams, type PatternSvgContentResult, type PatternType, type PixelateFilter, type Point, type PointLightFilter, type PolygonBaseNodeProps, Polyline, type PolylineNodeProps, type PuzzleBounds, type PuzzleOptions, type PuzzlePiece, type PuzzleStyle, type PuzzleTabPattern, type RadialGradient, RadialGradientBuilder, type RadialGradientLibraryDef, type RawSvgFilter, Rectangle, type RectangleNodeProps, type RenderOptions, type RichTextData, type RichTextLine, type RichTextSegment, type RichTextSegmentStyle, type RiddledFilter, Ring, type RingNodeProps, type RoundEdgesFilter, type SaturateFilter, type SegmentCurveType, type SepiaFilter, type SerializedAnimationTimeline, type SerializedClipMaskGroup, type SerializedColorGlyph, type SerializedColorGlyphLibrary, type SerializedGroup, type SerializedMarkerDef, type SerializedShape, type SerializedSymbolDef, type SerializedVariantAxis, type SerializedViewbox, ShapeBuilder, type ShapeFilter, type ShapeMetadata, ShapeReference, type SharpenFilter, type SolveSudokuOptions, type SpecularLightingFilter, SpeechBubble, Spiral, type SpiralNodeProps, type SpotLightFilter, Square, type SquareNodeProps, Star, type StarNodeProps, type StepPosition, type StepsParams, type StringifyOptions, type StrokeType, type SudokuDifficulty, type SudokuGrid, type SudokuRating, type SudokuValidationResult, type SvgPrimitiveChainFilter, Switch, type SymbolInstanceNodeProps, type SymbolLibraryDef, type TemplateVariable, type TemplateVariableMode, type TemplateVariableSource, type TemplateVariableType, Text, type TextNodeProps, Timeline, Track, type TransferFunc, Triangle, type TriangleNodeProps, type ValidationError, type ValidationResult, type VariableMap, Video, View, type Viewbox, type WarpFilter, type WarpType, type WatercolorFilter, type XrayFilter, collectReferencedLibraryIds, computeArrowVertices, computeCloudPath, computeCrossVertices, computeDashArray, computeGearPath, computeGearVertices, computeHeartPath, computeLightningVertices, computePolygonVertices, computeRectanglePath, computeRingPath, computeSpeechBubbleVertices, computeSpiralPath, computeSplinePath, computeStarVertices, createDocument, createShape, createViewbox, defaultVariableMode, escXml, extractVariables, filterAttr, generateCode, generateCssCode, generateD3Code, generateId, generatePatternSvgContent, generatePuzzlePieces, generateReactCode, generateSudokuPuzzle, generateSvgCode, generateVueCode, getBuiltInMarkerDefs, getEasingCubicBezier, getEffectivePrecision, getMarkerDescriptors, getPatternElements, linearGradient, migrateSnapshot, parseDocument, parseVariableArgs, pattern, radialGradient, renderAnimationElements, renderBuiltinMarkerDefs, renderCircle, renderEllipse, renderFilterDefs, renderFilterLibraryDef, renderFilterPrimitive, renderFilterPrimitivesForType, renderImage, renderLibraryDef, renderLibraryDefs, renderLine, renderLinearGradientLibraryDef, renderMarkerLibraryDef, renderPatternLibraryDef, renderPolygonShape, renderPolyline, renderRadialGradientLibraryDef, renderRectangle, renderReferencedLibraryDefs, renderShape, renderSpline, renderSvgPrimitiveChainFilter, renderSymbolLibraryDef, renderText, renderToSvg, roundCoord, roundNumberString, roundSerializedShape, roundSnapshot, solveSudoku, stringifyDocument, substituteString, substituteVariables, validateSnapshot, validateSudokuPuzzle, verticesToPath };
5611
+ export { type Affine2D, type AffineTransformMatrix, type AnimatablePropertyDescriptor, type AnimationKeyframe, type AnimationTimeline, type AnimationTrack, type AnimationTrigger, type AnimationTriggerType, type AnyNodeProps, type ArcParams$1 as ArcParams, type AriaRole, Arrow, type ArrowNodeProps, Audio, BUILTIN_MARKER_ID_MAP, type BaseFilter, type BaseFilterPrimitive, type BlackAndWhiteFilter, type BlurQuality, type BrightnessFilter, COMMON_TRANSFORM_NODE_DEFAULTS, CURRENT_SCHEMA_VERSION, type ChannelPainterFilter, Circle, type CircleNodeProps, Cloud, type CodeFormat, type CodegenOptions, type CommonNodeProps, type CommonTransformNodeProps, type ConnectionDirection, type ConnectionPoint, Container, ContainerShapeBuilder, type ContouringDiscreteFilter, type ContouringTableFilter, type ContrastFilter, type CornerShapeValue, type CreateDocumentOptions, type CreateShapeOptions, Cross, type CrossNodeProps, type CrumpledPlasticFilter, type CustomPatternDef, type CycleBehavior, DEFAULT_COORDINATE_PRECISION, type DiffuseLightingFilter, Document, type DocumentMetadata, type DocumentNodeProps, type DocumentOptions, type DocumentScript, type DocumentStyle, type DropShadowFilter, type DuotoneFilter, EASING_CURVES, EVENT_TRIGGER_OPTIONS, EasingType, Ellipse, type EllipseNodeProps, type EmbossFilter, type ExtractedVariables, type FeBlendPrimitive, type FeColorMatrixPrimitive, type FeComponentTransferPrimitive, type FeCompositePrimitive, type FeConvolveMatrixPrimitive, type FeDiffuseLightingPrimitive, type FeDisplacementMapPrimitive, type FeDropShadowPrimitive, type FeFloodPrimitive, type FeGaussianBlurPrimitive, type FeImagePrimitive, type FeMergePrimitive, type FeMorphologyPrimitive, type FeOffsetPrimitive, type FeSpecularLightingPrimitive, type FeTilePrimitive, type FeTurbulencePrimitive, type FillType, type FilmGrainFilter, type FilterBlendMode, type FilterLibraryDef, type FilterLightSource, type FilterPrimitive, type FilterPrimitiveType, type FilterType, type GaussianBlurFilter, Gear, type GearNodeProps, type GenerateSudokuOptions, type GeneratedSudokuPuzzle, type GlowFilter, type GouacheFilter, type GradientDefinition, type GradientSpreadMethod, type GradientStop, type GradientUnits, type GrayscaleFilter, type GroupNodeProps, type Guide, Heart, type HistorySnapshot, type HueRotateFilter, Hyperlink, IDENTITY_AFFINE, type ImageAttribution, type ImageNodeProps, ImageShape, type InkBlotFilter, type InnerGlowFilter, type InnerShadowFilter, type InvertFilter, LIBRARY_EMIT_ORDER, type LibraryDef, type LibraryDefBase, type LibraryDefOfKind, type LibraryKind, type LicenseType, type LightSource, Lightning, Line, type LineEndpointValue, type LineNodeProps, type LinearEasingPoint, type LinearGradient, LinearGradientBuilder, type LinearGradientLibraryDef, type LinkTarget, MARKER_HEIGHT, MARKER_VIEWBOX, MARKER_WIDTH, MAX_COORDINATE_PRECISION, MIGRATIONS, type MarkerDescriptor, type MarkerLibraryDef, type Measurement, type Migration, type MorphologyFilter, type MorphologyOperator, type MotionBlurFilter, NGon, type NGonNodeProps, NUMERIC_SHAPE_TRANSFORM_STATE_KEYS, NestedSvg, type NodeTypePropsMap, type NoiseFilter, type OpacityFilter, type OutlineFilter, type OutlinePosition, PUZZLE_DEFAULTS, type ParseOptions, Path, PathCurveType, type PathNodeProps, type PathPoint, PathPointType, PatternBuilder, type PatternElement, type PatternFill, type PatternLibraryDef, type PatternParams, type PatternSvgContentResult, type PatternType, type PixelateFilter, type Point, type PointLightFilter, type PolygonBaseNodeProps, Polyline, type PolylineNodeProps, type PuzzleBounds, type PuzzleOptions, type PuzzlePiece, type PuzzleStyle, type PuzzleTabPattern, type RadialGradient, RadialGradientBuilder, type RadialGradientLibraryDef, type RawSvgFilter, Rectangle, type RectangleNodeProps, type RenderOptions, type RichTextData, type RichTextLine, type RichTextSegment, type RichTextSegmentStyle, type RiddledFilter, Ring, type RingNodeProps, type RoundEdgesFilter, SHAPE_TRANSFORM_STATE_KEYS, type SaturateFilter, type SegmentCurveType, type SepiaFilter, type SerializedAnimationTimeline, type SerializedClipMaskGroup, type SerializedColorGlyph, type SerializedColorGlyphLibrary, type SerializedGroup, type SerializedMarkerDef, type SerializedPaintServerDef, type SerializedSceneNodePlacement, type SerializedShape, type SerializedShapeState, type SerializedSymbolDef, type SerializedVariantAxis, type SerializedViewbox, ShapeBuilder, type ShapeFilter, type ShapeMetadata, ShapeReference, type ShapeTransformState, type SharpenFilter, type SolveSudokuOptions, type SpecularLightingFilter, SpeechBubble, Spiral, type SpiralNodeProps, type SpotLightFilter, Square, type SquareNodeProps, Star, type StarNodeProps, type StepPosition, type StepsParams, type StringifyOptions, type StrokeType, type SudokuDifficulty, type SudokuGrid, type SudokuRating, type SudokuValidationResult, type SvgPrimitiveChainFilter, Switch, type SymbolInstanceNodeProps, type SymbolLibraryDef, type TemplateVariable, type TemplateVariableMode, type TemplateVariableSource, type TemplateVariableType, Text, type TextNodeProps, Timeline, Track, type TransferFunc, Triangle, type TriangleNodeProps, type ValidationError, type ValidationResult, type VariableMap, Video, View, type Viewbox, type WarpFilter, type WarpType, type WatercolorFilter, type XrayFilter, affine, affineFromArray, affineToArray, around, canonicalPolygonTransformString, canonicalTransformString, collectReferencedLibraryIds, composeLegacyTransformMatrix, computeArrowVertices, computeCloudPath, computeCrossVertices, computeDashArray, computeGearPath, computeGearVertices, computeHeartPath, computeLightningVertices, computePolygonVertices, computeRectanglePath, computeRingPath, computeSpeechBubbleVertices, computeSpiralPath, computeSplinePath, computeStarVertices, createDocument, createShape, createViewbox, defaultVariableMode, escXml, extractVariables, filterAttr, foldLegacyAncestorTransformIntoMatrix, generateCode, generateCssCode, generateD3Code, generateId, generatePatternSvgContent, generatePuzzlePieces, generateReactCode, generateSudokuPuzzle, generateSvgCode, generateVueCode, getBuiltInMarkerDefs, getEasingCubicBezier, getEffectivePrecision, getMarkerDescriptors, getPatternElements, isFiniteAffineArray, isIdentityAffine, linearGradient, matrixTransformPart, migrateSnapshot, multiplyAffine, parseDocument, parseSvgTransformList, parseVariableArgs, pattern, radialGradient, renderAnimationElements, renderBuiltinMarkerDefs, renderCircle, renderEllipse, renderFilterDefs, renderFilterLibraryDef, renderFilterPrimitive, renderFilterPrimitivesForType, renderImage, renderLibraryDef, renderLibraryDefs, renderLine, renderLinearGradientLibraryDef, renderMarkerLibraryDef, renderPatternLibraryDef, renderPolygonShape, renderPolyline, renderRadialGradientLibraryDef, renderRectangle, renderReferencedLibraryDefs, renderShape, renderSpline, renderSvgPrimitiveChainFilter, renderSymbolLibraryDef, renderText, renderToSvg, rotateAffine, roundCoord, roundNumberString, roundSerializedShape, roundSnapshot, scaleAffine, skewXAffine, skewYAffine, solveSudoku, stringifyDocument, substituteString, substituteVariables, translateAffine, validateSnapshot, validateSudokuPuzzle, verticesToPath };