@svgsketch/core 0.4.0 → 0.5.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 +99 -5
- package/dist/index.d.ts +99 -5
- package/dist/index.js +11 -11
- package/dist/index.mjs +11 -11
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -40,7 +40,18 @@ declare enum EasingType {
|
|
|
40
40
|
EASE_OUT_BACK = "ease-out-back",
|
|
41
41
|
EASE_IN_OUT_BACK = "ease-in-out-back",
|
|
42
42
|
CUSTOM_BEZIER = "custom-bezier",
|
|
43
|
-
LINEAR_FUNCTION = "linear-function"
|
|
43
|
+
LINEAR_FUNCTION = "linear-function",
|
|
44
|
+
STEPS = "steps"
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Step position for CSS `steps()` easing. Follows CSS Easing 1 §3.2.
|
|
48
|
+
* `start`/`end` are legacy aliases for `jump-start`/`jump-end`.
|
|
49
|
+
*/
|
|
50
|
+
type StepPosition = 'jump-start' | 'jump-end' | 'jump-none' | 'jump-both';
|
|
51
|
+
/** Parameters for a `steps(count, position)` easing function. */
|
|
52
|
+
interface StepsParams {
|
|
53
|
+
count: number;
|
|
54
|
+
position: StepPosition;
|
|
44
55
|
}
|
|
45
56
|
/**
|
|
46
57
|
* Map from EasingType → cubic-bezier control points [x1, y1, x2, y2].
|
|
@@ -97,6 +108,8 @@ interface AnimationKeyframe {
|
|
|
97
108
|
customBezier?: [number, number, number, number];
|
|
98
109
|
/** Control points for CSS linear() easing when easing is LINEAR_FUNCTION. */
|
|
99
110
|
linearPoints?: LinearEasingPoint[];
|
|
111
|
+
/** Step count and jump position when easing is STEPS. */
|
|
112
|
+
stepsParams?: StepsParams;
|
|
100
113
|
}
|
|
101
114
|
/** A control point for a CSS linear() easing function. */
|
|
102
115
|
interface LinearEasingPoint {
|
|
@@ -222,6 +235,7 @@ interface SerializedAnimationTimeline {
|
|
|
222
235
|
value: number;
|
|
223
236
|
position: number;
|
|
224
237
|
}[];
|
|
238
|
+
stepsParams?: StepsParams;
|
|
225
239
|
}[];
|
|
226
240
|
}[];
|
|
227
241
|
}
|
|
@@ -297,6 +311,23 @@ interface GradientStop {
|
|
|
297
311
|
color: string;
|
|
298
312
|
opacity: number;
|
|
299
313
|
}
|
|
314
|
+
/**
|
|
315
|
+
* How gradient coordinates are interpreted.
|
|
316
|
+
*
|
|
317
|
+
* - `'objectBoundingBox'` (default): coordinates are fractions of the
|
|
318
|
+
* painted element's bounding box, where `1` equals the full width or
|
|
319
|
+
* height. The gradient rescales to each shape.
|
|
320
|
+
* - `'userSpaceOnUse'`: coordinates are absolute user-space values, so
|
|
321
|
+
* the gradient is a fixed color field in the document. Multiple
|
|
322
|
+
* shapes referencing the same gradient see a consistent field, and
|
|
323
|
+
* clipped shapes reveal a specific slice of it. Required for
|
|
324
|
+
* round-tripping source SVGs that author gradients this way.
|
|
325
|
+
*
|
|
326
|
+
* When omitted, the renderer treats the gradient as `objectBoundingBox`
|
|
327
|
+
* for backward compatibility with documents authored before this field
|
|
328
|
+
* was added.
|
|
329
|
+
*/
|
|
330
|
+
type GradientUnits = 'objectBoundingBox' | 'userSpaceOnUse';
|
|
300
331
|
interface LinearGradient {
|
|
301
332
|
type: 'linear-gradient';
|
|
302
333
|
id: string;
|
|
@@ -307,6 +338,12 @@ interface LinearGradient {
|
|
|
307
338
|
stops: GradientStop[];
|
|
308
339
|
spreadMethod: GradientSpreadMethod;
|
|
309
340
|
opacity: number;
|
|
341
|
+
/**
|
|
342
|
+
* When present and equal to `'userSpaceOnUse'`, `x1`/`y1`/`x2`/`y2`
|
|
343
|
+
* are in document user space (post any ancestor bake), not in the
|
|
344
|
+
* element's bbox-normalised [0, 1] space. See `GradientUnits`.
|
|
345
|
+
*/
|
|
346
|
+
gradientUnits?: GradientUnits;
|
|
310
347
|
}
|
|
311
348
|
interface RadialGradient {
|
|
312
349
|
type: 'radial-gradient';
|
|
@@ -321,6 +358,11 @@ interface RadialGradient {
|
|
|
321
358
|
stops: GradientStop[];
|
|
322
359
|
spreadMethod: GradientSpreadMethod;
|
|
323
360
|
opacity: number;
|
|
361
|
+
/**
|
|
362
|
+
* When present and equal to `'userSpaceOnUse'`, `cx`/`cy`/`fx`/`fy`/
|
|
363
|
+
* `r`/`ry` are in document user space. See `GradientUnits`.
|
|
364
|
+
*/
|
|
365
|
+
gradientUnits?: GradientUnits;
|
|
324
366
|
}
|
|
325
367
|
/**
|
|
326
368
|
* Per-pattern-type tuneable parameters.
|
|
@@ -1136,6 +1178,16 @@ interface SerializedShape {
|
|
|
1136
1178
|
headWidthPercent?: number;
|
|
1137
1179
|
headLengthPercent?: number;
|
|
1138
1180
|
shaftWidthPercent?: number;
|
|
1181
|
+
tailAngleDeg?: number;
|
|
1182
|
+
tailLengthPercent?: number;
|
|
1183
|
+
tailWidthPercent?: number;
|
|
1184
|
+
lobeRadiusPercent?: number;
|
|
1185
|
+
cleftDepthPercent?: number;
|
|
1186
|
+
boltSegments?: number;
|
|
1187
|
+
boltJaggednessPercent?: number;
|
|
1188
|
+
boltWidthPercent?: number;
|
|
1189
|
+
cloudBumps?: number;
|
|
1190
|
+
cloudPuffinessPercent?: number;
|
|
1139
1191
|
x1?: number;
|
|
1140
1192
|
y1?: number;
|
|
1141
1193
|
x2?: number;
|
|
@@ -1150,6 +1202,16 @@ interface SerializedShape {
|
|
|
1150
1202
|
endEndpoint?: 'none' | 'arrow' | 'open-arrow' | 'circle' | 'diamond' | 'square';
|
|
1151
1203
|
locked?: boolean;
|
|
1152
1204
|
visible?: boolean;
|
|
1205
|
+
/**
|
|
1206
|
+
* SVG `visibility` presentation attribute. Distinct from `visible`:
|
|
1207
|
+
* `visible` (boolean) is the editor's user-toggled layer hide
|
|
1208
|
+
* (display:none semantics); `visibility` is the SVG attribute
|
|
1209
|
+
* (preserves layout, can be flipped by SMIL
|
|
1210
|
+
* `<animate attributeName="visibility">`). Conflating the two breaks
|
|
1211
|
+
* SMIL visibility animations on imported SVGs because display:none
|
|
1212
|
+
* overrides the SVG visibility attribute.
|
|
1213
|
+
*/
|
|
1214
|
+
visibility?: 'visible' | 'hidden' | 'collapse';
|
|
1153
1215
|
fillType?: FillType;
|
|
1154
1216
|
fillGradient?: LinearGradient | RadialGradient | PatternFill;
|
|
1155
1217
|
strokeType?: StrokeType;
|
|
@@ -1832,6 +1894,41 @@ declare function computeCrossVertices(radius: number, armWidthPercent: number, s
|
|
|
1832
1894
|
* Compute arrow vertices (7 points forming an arrow).
|
|
1833
1895
|
*/
|
|
1834
1896
|
declare function computeArrowVertices(radius: number, headWidthPercent: number, headLengthPercent: number, shaftWidthPercent: number, shiftAngleDeg?: number): Point[];
|
|
1897
|
+
/**
|
|
1898
|
+
* Compute speech-bubble vertices — square body with a tail protruding at a
|
|
1899
|
+
* chosen angle. The base endpoints lie on the chosen body edge (keeping the
|
|
1900
|
+
* body outline continuous); the tip extends in the direction of `tailAngleDeg`
|
|
1901
|
+
* at length `tailLengthPercent * radius`.
|
|
1902
|
+
*
|
|
1903
|
+
* The `shiftAngleDeg` rotates the entire shape (body + tail).
|
|
1904
|
+
*/
|
|
1905
|
+
declare function computeSpeechBubbleVertices(radius: number, tailAngleDeg: number, tailLengthPercent: number, tailWidthPercent: number, shiftAngleDeg?: number): Point[];
|
|
1906
|
+
/**
|
|
1907
|
+
* Compute lightning-bolt vertices — a zigzag ribbon from top tip to bottom tip.
|
|
1908
|
+
* `boltSegments` line segments make the zigzag (alternating x offsets of
|
|
1909
|
+
* `boltJaggednessPercent * radius`); the ribbon is `boltWidthPercent * radius`
|
|
1910
|
+
* wide, perpendicular to each segment's bisector normal.
|
|
1911
|
+
*/
|
|
1912
|
+
declare function computeLightningVertices(radius: number, boltSegments: number, boltJaggednessPercent: number, boltWidthPercent: number, shiftAngleDeg?: number): Point[];
|
|
1913
|
+
/**
|
|
1914
|
+
* Compute heart path — two cubic Béziers meeting at the bottom tip and the
|
|
1915
|
+
* upper cleft. `lobeRadiusPercent` controls the horizontal extent of the two
|
|
1916
|
+
* top lobes; `cleftDepthPercent` controls how deep the central dip sits.
|
|
1917
|
+
*/
|
|
1918
|
+
declare function computeHeartPath(radius: number, lobeRadiusPercent: number, cleftDepthPercent: number, shiftAngleDeg?: number): string;
|
|
1919
|
+
/**
|
|
1920
|
+
* Compute cloud path — a classic cartoon-cloud silhouette built as the outer
|
|
1921
|
+
* boundary of N overlapping circles placed around an elongated ellipse.
|
|
1922
|
+
* Circles go all the way around (top, sides, bottom), and the silhouette is
|
|
1923
|
+
* closed by walking each circle's outer arc via the intersection with its
|
|
1924
|
+
* next neighbor. Every transition between bumps is tangent-smooth — no flat
|
|
1925
|
+
* edges, no corners.
|
|
1926
|
+
*
|
|
1927
|
+
* `cloudBumps` (3..8) — number of bump circles forming the silhouette.
|
|
1928
|
+
* `cloudPuffinessPercent` (40..80) — drives bump overlap; higher values
|
|
1929
|
+
* smooth the underside; lower values leave the bumps more pronounced.
|
|
1930
|
+
*/
|
|
1931
|
+
declare function computeCloudPath(radius: number, cloudBumps: number, cloudPuffinessPercent: number, shiftAngleDeg?: number): string;
|
|
1835
1932
|
/**
|
|
1836
1933
|
* Convert an array of vertices to an SVG path string.
|
|
1837
1934
|
* Supports optional rounded corners via quadratic Bézier.
|
|
@@ -1845,9 +1942,6 @@ declare function computeRingPath(radius: number, innerRadiusPercent: number, fil
|
|
|
1845
1942
|
* Generate SVG path for an Archimedean spiral.
|
|
1846
1943
|
*/
|
|
1847
1944
|
declare function computeSpiralPath(radius: number, turns: number, thicknessPercent: number, spiralDirection?: number, shiftAngleDeg?: number): string;
|
|
1848
|
-
/**
|
|
1849
|
-
* Compute gear vertices (4 vertices per tooth).
|
|
1850
|
-
*/
|
|
1851
1945
|
declare function computeGearVertices(teeth: number, radius: number, toothDepthPercent: number, shiftAngleDeg?: number): Point[];
|
|
1852
1946
|
/**
|
|
1853
1947
|
* Generate full gear path including optional center hole.
|
|
@@ -3255,4 +3349,4 @@ declare class Document {
|
|
|
3255
3349
|
private _ensureMetadata;
|
|
3256
3350
|
}
|
|
3257
3351
|
|
|
3258
|
-
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, type BaseFilter, type BlackAndWhiteFilter, type BlurQuality, type BrightnessFilter, CURRENT_SCHEMA_VERSION, type ChannelPainterFilter, Circle, type CircleNodeProps, type CodeFormat, type CodegenOptions, type CommonNodeProps, type ContouringDiscreteFilter, type ContouringTableFilter, type ContrastFilter, type CornerShapeValue, type CreateDocumentOptions, type CreateShapeOptions, Cross, type CrossNodeProps, type CrumpledPlasticFilter, type CustomPatternDef, type CycleBehavior, Document, type DocumentMetadata, type DocumentNodeProps, type DocumentOptions, type DropShadowFilter, type DuotoneFilter, EASING_CURVES, EVENT_TRIGGER_OPTIONS, EasingType, Ellipse, type EllipseNodeProps, type EmbossFilter, type ExtractedVariables, type FillType, type FilmGrainFilter, type FilterType, type GaussianBlurFilter, Gear, type GearNodeProps, type GlowFilter, type GouacheFilter, type GradientDefinition, type GradientSpreadMethod, type GradientStop, type GrayscaleFilter, type GroupNodeProps, type Guide, type HistorySnapshot, type HueRotateFilter, type ImageAttribution, type ImageNodeProps, ImageShape, type InkBlotFilter, type InnerGlowFilter, type InnerShadowFilter, type InvertFilter, type LicenseType, Line, type LineEndpointValue, type LineNodeProps, type LinearEasingPoint, type LinearGradient, LinearGradientBuilder, type LinkTarget, MARKER_HEIGHT, MARKER_VIEWBOX, MARKER_WIDTH, MIGRATIONS, type MarkerDescriptor, type Measurement, type Migration, type MorphologyFilter, type MorphologyOperator, type MotionBlurFilter, NGon, type NGonNodeProps, type NodeTypePropsMap, type NoiseFilter, type OpacityFilter, type OutlineFilter, type OutlinePosition, type ParseOptions, PatternBuilder, type PatternElement, type PatternFill, type PatternParams, type PatternSvgContentResult, type PatternType, type PixelateFilter, type Point, type PointLightFilter, type PolygonBaseNodeProps, Polyline, type PolylineNodeProps, type RadialGradient, RadialGradientBuilder, 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 SerializedGroup, type SerializedShape, type SerializedSymbolDef, type SerializedVariantAxis, type SerializedViewbox, ShapeBuilder, type ShapeFilter, type ShapeMetadata, type SharpenFilter, Spiral, type SpiralNodeProps, Spline, SplineCurveType, type SplineNodeProps, type SplinePoint, SplinePointType, type SpotLightFilter, Square, type SquareNodeProps, Star, type StarNodeProps, type StringifyOptions, type StrokeType, type SymbolInstanceNodeProps, type TemplateVariable, type TemplateVariableSource, type TemplateVariableType, Text, type TextNodeProps, Timeline, Track, Triangle, type TriangleNodeProps, type ValidationError, type ValidationResult, type VariableMap, type Viewbox, type WarpFilter, type WarpType, type WatercolorFilter, type XrayFilter, computeArrowVertices, computeCrossVertices, computeDashArray, computeGearPath, computeGearVertices, computePolygonVertices, computeRectanglePath, computeRingPath, computeSpiralPath, computeSplinePath, computeStarVertices, createDocument, createShape, createViewbox, escXml, extractVariables, filterAttr, generateCode, generateCssCode, generateD3Code, generateId, generatePatternSvgContent, generateReactCode, generateSvgCode, generateVueCode, getEasingCubicBezier, getMarkerDescriptors, getPatternElements, linearGradient, migrateSnapshot, parseDocument, parseVariableArgs, pattern, radialGradient, renderAnimationElements, renderCircle, renderEllipse, renderFilterDefs, renderFilterPrimitivesForType, renderImage, renderLine, renderPolygonShape, renderPolyline, renderRectangle, renderShape, renderSpline, renderText, renderToSvg, stringifyDocument, substituteString, substituteVariables, validateSnapshot, verticesToPath };
|
|
3352
|
+
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, type BaseFilter, type BlackAndWhiteFilter, type BlurQuality, type BrightnessFilter, CURRENT_SCHEMA_VERSION, type ChannelPainterFilter, Circle, type CircleNodeProps, type CodeFormat, type CodegenOptions, type CommonNodeProps, type ContouringDiscreteFilter, type ContouringTableFilter, type ContrastFilter, type CornerShapeValue, type CreateDocumentOptions, type CreateShapeOptions, Cross, type CrossNodeProps, type CrumpledPlasticFilter, type CustomPatternDef, type CycleBehavior, Document, type DocumentMetadata, type DocumentNodeProps, type DocumentOptions, type DropShadowFilter, type DuotoneFilter, EASING_CURVES, EVENT_TRIGGER_OPTIONS, EasingType, Ellipse, type EllipseNodeProps, type EmbossFilter, type ExtractedVariables, type FillType, type FilmGrainFilter, type FilterType, type GaussianBlurFilter, Gear, type GearNodeProps, type GlowFilter, type GouacheFilter, type GradientDefinition, type GradientSpreadMethod, type GradientStop, type GradientUnits, type GrayscaleFilter, type GroupNodeProps, type Guide, type HistorySnapshot, type HueRotateFilter, type ImageAttribution, type ImageNodeProps, ImageShape, type InkBlotFilter, type InnerGlowFilter, type InnerShadowFilter, type InvertFilter, type LicenseType, Line, type LineEndpointValue, type LineNodeProps, type LinearEasingPoint, type LinearGradient, LinearGradientBuilder, type LinkTarget, MARKER_HEIGHT, MARKER_VIEWBOX, MARKER_WIDTH, MIGRATIONS, type MarkerDescriptor, type Measurement, type Migration, type MorphologyFilter, type MorphologyOperator, type MotionBlurFilter, NGon, type NGonNodeProps, type NodeTypePropsMap, type NoiseFilter, type OpacityFilter, type OutlineFilter, type OutlinePosition, type ParseOptions, PatternBuilder, type PatternElement, type PatternFill, type PatternParams, type PatternSvgContentResult, type PatternType, type PixelateFilter, type Point, type PointLightFilter, type PolygonBaseNodeProps, Polyline, type PolylineNodeProps, type RadialGradient, RadialGradientBuilder, 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 SerializedGroup, type SerializedShape, type SerializedSymbolDef, type SerializedVariantAxis, type SerializedViewbox, ShapeBuilder, type ShapeFilter, type ShapeMetadata, type SharpenFilter, Spiral, type SpiralNodeProps, Spline, SplineCurveType, type SplineNodeProps, type SplinePoint, SplinePointType, type SpotLightFilter, Square, type SquareNodeProps, Star, type StarNodeProps, type StepPosition, type StepsParams, type StringifyOptions, type StrokeType, type SymbolInstanceNodeProps, type TemplateVariable, type TemplateVariableSource, type TemplateVariableType, Text, type TextNodeProps, Timeline, Track, Triangle, type TriangleNodeProps, type ValidationError, type ValidationResult, type VariableMap, type Viewbox, type WarpFilter, type WarpType, type WatercolorFilter, type XrayFilter, computeArrowVertices, computeCloudPath, computeCrossVertices, computeDashArray, computeGearPath, computeGearVertices, computeHeartPath, computeLightningVertices, computePolygonVertices, computeRectanglePath, computeRingPath, computeSpeechBubbleVertices, computeSpiralPath, computeSplinePath, computeStarVertices, createDocument, createShape, createViewbox, escXml, extractVariables, filterAttr, generateCode, generateCssCode, generateD3Code, generateId, generatePatternSvgContent, generateReactCode, generateSvgCode, generateVueCode, getEasingCubicBezier, getMarkerDescriptors, getPatternElements, linearGradient, migrateSnapshot, parseDocument, parseVariableArgs, pattern, radialGradient, renderAnimationElements, renderCircle, renderEllipse, renderFilterDefs, renderFilterPrimitivesForType, renderImage, renderLine, renderPolygonShape, renderPolyline, renderRectangle, renderShape, renderSpline, renderText, renderToSvg, stringifyDocument, substituteString, substituteVariables, validateSnapshot, verticesToPath };
|
package/dist/index.d.ts
CHANGED
|
@@ -40,7 +40,18 @@ declare enum EasingType {
|
|
|
40
40
|
EASE_OUT_BACK = "ease-out-back",
|
|
41
41
|
EASE_IN_OUT_BACK = "ease-in-out-back",
|
|
42
42
|
CUSTOM_BEZIER = "custom-bezier",
|
|
43
|
-
LINEAR_FUNCTION = "linear-function"
|
|
43
|
+
LINEAR_FUNCTION = "linear-function",
|
|
44
|
+
STEPS = "steps"
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Step position for CSS `steps()` easing. Follows CSS Easing 1 §3.2.
|
|
48
|
+
* `start`/`end` are legacy aliases for `jump-start`/`jump-end`.
|
|
49
|
+
*/
|
|
50
|
+
type StepPosition = 'jump-start' | 'jump-end' | 'jump-none' | 'jump-both';
|
|
51
|
+
/** Parameters for a `steps(count, position)` easing function. */
|
|
52
|
+
interface StepsParams {
|
|
53
|
+
count: number;
|
|
54
|
+
position: StepPosition;
|
|
44
55
|
}
|
|
45
56
|
/**
|
|
46
57
|
* Map from EasingType → cubic-bezier control points [x1, y1, x2, y2].
|
|
@@ -97,6 +108,8 @@ interface AnimationKeyframe {
|
|
|
97
108
|
customBezier?: [number, number, number, number];
|
|
98
109
|
/** Control points for CSS linear() easing when easing is LINEAR_FUNCTION. */
|
|
99
110
|
linearPoints?: LinearEasingPoint[];
|
|
111
|
+
/** Step count and jump position when easing is STEPS. */
|
|
112
|
+
stepsParams?: StepsParams;
|
|
100
113
|
}
|
|
101
114
|
/** A control point for a CSS linear() easing function. */
|
|
102
115
|
interface LinearEasingPoint {
|
|
@@ -222,6 +235,7 @@ interface SerializedAnimationTimeline {
|
|
|
222
235
|
value: number;
|
|
223
236
|
position: number;
|
|
224
237
|
}[];
|
|
238
|
+
stepsParams?: StepsParams;
|
|
225
239
|
}[];
|
|
226
240
|
}[];
|
|
227
241
|
}
|
|
@@ -297,6 +311,23 @@ interface GradientStop {
|
|
|
297
311
|
color: string;
|
|
298
312
|
opacity: number;
|
|
299
313
|
}
|
|
314
|
+
/**
|
|
315
|
+
* How gradient coordinates are interpreted.
|
|
316
|
+
*
|
|
317
|
+
* - `'objectBoundingBox'` (default): coordinates are fractions of the
|
|
318
|
+
* painted element's bounding box, where `1` equals the full width or
|
|
319
|
+
* height. The gradient rescales to each shape.
|
|
320
|
+
* - `'userSpaceOnUse'`: coordinates are absolute user-space values, so
|
|
321
|
+
* the gradient is a fixed color field in the document. Multiple
|
|
322
|
+
* shapes referencing the same gradient see a consistent field, and
|
|
323
|
+
* clipped shapes reveal a specific slice of it. Required for
|
|
324
|
+
* round-tripping source SVGs that author gradients this way.
|
|
325
|
+
*
|
|
326
|
+
* When omitted, the renderer treats the gradient as `objectBoundingBox`
|
|
327
|
+
* for backward compatibility with documents authored before this field
|
|
328
|
+
* was added.
|
|
329
|
+
*/
|
|
330
|
+
type GradientUnits = 'objectBoundingBox' | 'userSpaceOnUse';
|
|
300
331
|
interface LinearGradient {
|
|
301
332
|
type: 'linear-gradient';
|
|
302
333
|
id: string;
|
|
@@ -307,6 +338,12 @@ interface LinearGradient {
|
|
|
307
338
|
stops: GradientStop[];
|
|
308
339
|
spreadMethod: GradientSpreadMethod;
|
|
309
340
|
opacity: number;
|
|
341
|
+
/**
|
|
342
|
+
* When present and equal to `'userSpaceOnUse'`, `x1`/`y1`/`x2`/`y2`
|
|
343
|
+
* are in document user space (post any ancestor bake), not in the
|
|
344
|
+
* element's bbox-normalised [0, 1] space. See `GradientUnits`.
|
|
345
|
+
*/
|
|
346
|
+
gradientUnits?: GradientUnits;
|
|
310
347
|
}
|
|
311
348
|
interface RadialGradient {
|
|
312
349
|
type: 'radial-gradient';
|
|
@@ -321,6 +358,11 @@ interface RadialGradient {
|
|
|
321
358
|
stops: GradientStop[];
|
|
322
359
|
spreadMethod: GradientSpreadMethod;
|
|
323
360
|
opacity: number;
|
|
361
|
+
/**
|
|
362
|
+
* When present and equal to `'userSpaceOnUse'`, `cx`/`cy`/`fx`/`fy`/
|
|
363
|
+
* `r`/`ry` are in document user space. See `GradientUnits`.
|
|
364
|
+
*/
|
|
365
|
+
gradientUnits?: GradientUnits;
|
|
324
366
|
}
|
|
325
367
|
/**
|
|
326
368
|
* Per-pattern-type tuneable parameters.
|
|
@@ -1136,6 +1178,16 @@ interface SerializedShape {
|
|
|
1136
1178
|
headWidthPercent?: number;
|
|
1137
1179
|
headLengthPercent?: number;
|
|
1138
1180
|
shaftWidthPercent?: number;
|
|
1181
|
+
tailAngleDeg?: number;
|
|
1182
|
+
tailLengthPercent?: number;
|
|
1183
|
+
tailWidthPercent?: number;
|
|
1184
|
+
lobeRadiusPercent?: number;
|
|
1185
|
+
cleftDepthPercent?: number;
|
|
1186
|
+
boltSegments?: number;
|
|
1187
|
+
boltJaggednessPercent?: number;
|
|
1188
|
+
boltWidthPercent?: number;
|
|
1189
|
+
cloudBumps?: number;
|
|
1190
|
+
cloudPuffinessPercent?: number;
|
|
1139
1191
|
x1?: number;
|
|
1140
1192
|
y1?: number;
|
|
1141
1193
|
x2?: number;
|
|
@@ -1150,6 +1202,16 @@ interface SerializedShape {
|
|
|
1150
1202
|
endEndpoint?: 'none' | 'arrow' | 'open-arrow' | 'circle' | 'diamond' | 'square';
|
|
1151
1203
|
locked?: boolean;
|
|
1152
1204
|
visible?: boolean;
|
|
1205
|
+
/**
|
|
1206
|
+
* SVG `visibility` presentation attribute. Distinct from `visible`:
|
|
1207
|
+
* `visible` (boolean) is the editor's user-toggled layer hide
|
|
1208
|
+
* (display:none semantics); `visibility` is the SVG attribute
|
|
1209
|
+
* (preserves layout, can be flipped by SMIL
|
|
1210
|
+
* `<animate attributeName="visibility">`). Conflating the two breaks
|
|
1211
|
+
* SMIL visibility animations on imported SVGs because display:none
|
|
1212
|
+
* overrides the SVG visibility attribute.
|
|
1213
|
+
*/
|
|
1214
|
+
visibility?: 'visible' | 'hidden' | 'collapse';
|
|
1153
1215
|
fillType?: FillType;
|
|
1154
1216
|
fillGradient?: LinearGradient | RadialGradient | PatternFill;
|
|
1155
1217
|
strokeType?: StrokeType;
|
|
@@ -1832,6 +1894,41 @@ declare function computeCrossVertices(radius: number, armWidthPercent: number, s
|
|
|
1832
1894
|
* Compute arrow vertices (7 points forming an arrow).
|
|
1833
1895
|
*/
|
|
1834
1896
|
declare function computeArrowVertices(radius: number, headWidthPercent: number, headLengthPercent: number, shaftWidthPercent: number, shiftAngleDeg?: number): Point[];
|
|
1897
|
+
/**
|
|
1898
|
+
* Compute speech-bubble vertices — square body with a tail protruding at a
|
|
1899
|
+
* chosen angle. The base endpoints lie on the chosen body edge (keeping the
|
|
1900
|
+
* body outline continuous); the tip extends in the direction of `tailAngleDeg`
|
|
1901
|
+
* at length `tailLengthPercent * radius`.
|
|
1902
|
+
*
|
|
1903
|
+
* The `shiftAngleDeg` rotates the entire shape (body + tail).
|
|
1904
|
+
*/
|
|
1905
|
+
declare function computeSpeechBubbleVertices(radius: number, tailAngleDeg: number, tailLengthPercent: number, tailWidthPercent: number, shiftAngleDeg?: number): Point[];
|
|
1906
|
+
/**
|
|
1907
|
+
* Compute lightning-bolt vertices — a zigzag ribbon from top tip to bottom tip.
|
|
1908
|
+
* `boltSegments` line segments make the zigzag (alternating x offsets of
|
|
1909
|
+
* `boltJaggednessPercent * radius`); the ribbon is `boltWidthPercent * radius`
|
|
1910
|
+
* wide, perpendicular to each segment's bisector normal.
|
|
1911
|
+
*/
|
|
1912
|
+
declare function computeLightningVertices(radius: number, boltSegments: number, boltJaggednessPercent: number, boltWidthPercent: number, shiftAngleDeg?: number): Point[];
|
|
1913
|
+
/**
|
|
1914
|
+
* Compute heart path — two cubic Béziers meeting at the bottom tip and the
|
|
1915
|
+
* upper cleft. `lobeRadiusPercent` controls the horizontal extent of the two
|
|
1916
|
+
* top lobes; `cleftDepthPercent` controls how deep the central dip sits.
|
|
1917
|
+
*/
|
|
1918
|
+
declare function computeHeartPath(radius: number, lobeRadiusPercent: number, cleftDepthPercent: number, shiftAngleDeg?: number): string;
|
|
1919
|
+
/**
|
|
1920
|
+
* Compute cloud path — a classic cartoon-cloud silhouette built as the outer
|
|
1921
|
+
* boundary of N overlapping circles placed around an elongated ellipse.
|
|
1922
|
+
* Circles go all the way around (top, sides, bottom), and the silhouette is
|
|
1923
|
+
* closed by walking each circle's outer arc via the intersection with its
|
|
1924
|
+
* next neighbor. Every transition between bumps is tangent-smooth — no flat
|
|
1925
|
+
* edges, no corners.
|
|
1926
|
+
*
|
|
1927
|
+
* `cloudBumps` (3..8) — number of bump circles forming the silhouette.
|
|
1928
|
+
* `cloudPuffinessPercent` (40..80) — drives bump overlap; higher values
|
|
1929
|
+
* smooth the underside; lower values leave the bumps more pronounced.
|
|
1930
|
+
*/
|
|
1931
|
+
declare function computeCloudPath(radius: number, cloudBumps: number, cloudPuffinessPercent: number, shiftAngleDeg?: number): string;
|
|
1835
1932
|
/**
|
|
1836
1933
|
* Convert an array of vertices to an SVG path string.
|
|
1837
1934
|
* Supports optional rounded corners via quadratic Bézier.
|
|
@@ -1845,9 +1942,6 @@ declare function computeRingPath(radius: number, innerRadiusPercent: number, fil
|
|
|
1845
1942
|
* Generate SVG path for an Archimedean spiral.
|
|
1846
1943
|
*/
|
|
1847
1944
|
declare function computeSpiralPath(radius: number, turns: number, thicknessPercent: number, spiralDirection?: number, shiftAngleDeg?: number): string;
|
|
1848
|
-
/**
|
|
1849
|
-
* Compute gear vertices (4 vertices per tooth).
|
|
1850
|
-
*/
|
|
1851
1945
|
declare function computeGearVertices(teeth: number, radius: number, toothDepthPercent: number, shiftAngleDeg?: number): Point[];
|
|
1852
1946
|
/**
|
|
1853
1947
|
* Generate full gear path including optional center hole.
|
|
@@ -3255,4 +3349,4 @@ declare class Document {
|
|
|
3255
3349
|
private _ensureMetadata;
|
|
3256
3350
|
}
|
|
3257
3351
|
|
|
3258
|
-
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, type BaseFilter, type BlackAndWhiteFilter, type BlurQuality, type BrightnessFilter, CURRENT_SCHEMA_VERSION, type ChannelPainterFilter, Circle, type CircleNodeProps, type CodeFormat, type CodegenOptions, type CommonNodeProps, type ContouringDiscreteFilter, type ContouringTableFilter, type ContrastFilter, type CornerShapeValue, type CreateDocumentOptions, type CreateShapeOptions, Cross, type CrossNodeProps, type CrumpledPlasticFilter, type CustomPatternDef, type CycleBehavior, Document, type DocumentMetadata, type DocumentNodeProps, type DocumentOptions, type DropShadowFilter, type DuotoneFilter, EASING_CURVES, EVENT_TRIGGER_OPTIONS, EasingType, Ellipse, type EllipseNodeProps, type EmbossFilter, type ExtractedVariables, type FillType, type FilmGrainFilter, type FilterType, type GaussianBlurFilter, Gear, type GearNodeProps, type GlowFilter, type GouacheFilter, type GradientDefinition, type GradientSpreadMethod, type GradientStop, type GrayscaleFilter, type GroupNodeProps, type Guide, type HistorySnapshot, type HueRotateFilter, type ImageAttribution, type ImageNodeProps, ImageShape, type InkBlotFilter, type InnerGlowFilter, type InnerShadowFilter, type InvertFilter, type LicenseType, Line, type LineEndpointValue, type LineNodeProps, type LinearEasingPoint, type LinearGradient, LinearGradientBuilder, type LinkTarget, MARKER_HEIGHT, MARKER_VIEWBOX, MARKER_WIDTH, MIGRATIONS, type MarkerDescriptor, type Measurement, type Migration, type MorphologyFilter, type MorphologyOperator, type MotionBlurFilter, NGon, type NGonNodeProps, type NodeTypePropsMap, type NoiseFilter, type OpacityFilter, type OutlineFilter, type OutlinePosition, type ParseOptions, PatternBuilder, type PatternElement, type PatternFill, type PatternParams, type PatternSvgContentResult, type PatternType, type PixelateFilter, type Point, type PointLightFilter, type PolygonBaseNodeProps, Polyline, type PolylineNodeProps, type RadialGradient, RadialGradientBuilder, 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 SerializedGroup, type SerializedShape, type SerializedSymbolDef, type SerializedVariantAxis, type SerializedViewbox, ShapeBuilder, type ShapeFilter, type ShapeMetadata, type SharpenFilter, Spiral, type SpiralNodeProps, Spline, SplineCurveType, type SplineNodeProps, type SplinePoint, SplinePointType, type SpotLightFilter, Square, type SquareNodeProps, Star, type StarNodeProps, type StringifyOptions, type StrokeType, type SymbolInstanceNodeProps, type TemplateVariable, type TemplateVariableSource, type TemplateVariableType, Text, type TextNodeProps, Timeline, Track, Triangle, type TriangleNodeProps, type ValidationError, type ValidationResult, type VariableMap, type Viewbox, type WarpFilter, type WarpType, type WatercolorFilter, type XrayFilter, computeArrowVertices, computeCrossVertices, computeDashArray, computeGearPath, computeGearVertices, computePolygonVertices, computeRectanglePath, computeRingPath, computeSpiralPath, computeSplinePath, computeStarVertices, createDocument, createShape, createViewbox, escXml, extractVariables, filterAttr, generateCode, generateCssCode, generateD3Code, generateId, generatePatternSvgContent, generateReactCode, generateSvgCode, generateVueCode, getEasingCubicBezier, getMarkerDescriptors, getPatternElements, linearGradient, migrateSnapshot, parseDocument, parseVariableArgs, pattern, radialGradient, renderAnimationElements, renderCircle, renderEllipse, renderFilterDefs, renderFilterPrimitivesForType, renderImage, renderLine, renderPolygonShape, renderPolyline, renderRectangle, renderShape, renderSpline, renderText, renderToSvg, stringifyDocument, substituteString, substituteVariables, validateSnapshot, verticesToPath };
|
|
3352
|
+
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, type BaseFilter, type BlackAndWhiteFilter, type BlurQuality, type BrightnessFilter, CURRENT_SCHEMA_VERSION, type ChannelPainterFilter, Circle, type CircleNodeProps, type CodeFormat, type CodegenOptions, type CommonNodeProps, type ContouringDiscreteFilter, type ContouringTableFilter, type ContrastFilter, type CornerShapeValue, type CreateDocumentOptions, type CreateShapeOptions, Cross, type CrossNodeProps, type CrumpledPlasticFilter, type CustomPatternDef, type CycleBehavior, Document, type DocumentMetadata, type DocumentNodeProps, type DocumentOptions, type DropShadowFilter, type DuotoneFilter, EASING_CURVES, EVENT_TRIGGER_OPTIONS, EasingType, Ellipse, type EllipseNodeProps, type EmbossFilter, type ExtractedVariables, type FillType, type FilmGrainFilter, type FilterType, type GaussianBlurFilter, Gear, type GearNodeProps, type GlowFilter, type GouacheFilter, type GradientDefinition, type GradientSpreadMethod, type GradientStop, type GradientUnits, type GrayscaleFilter, type GroupNodeProps, type Guide, type HistorySnapshot, type HueRotateFilter, type ImageAttribution, type ImageNodeProps, ImageShape, type InkBlotFilter, type InnerGlowFilter, type InnerShadowFilter, type InvertFilter, type LicenseType, Line, type LineEndpointValue, type LineNodeProps, type LinearEasingPoint, type LinearGradient, LinearGradientBuilder, type LinkTarget, MARKER_HEIGHT, MARKER_VIEWBOX, MARKER_WIDTH, MIGRATIONS, type MarkerDescriptor, type Measurement, type Migration, type MorphologyFilter, type MorphologyOperator, type MotionBlurFilter, NGon, type NGonNodeProps, type NodeTypePropsMap, type NoiseFilter, type OpacityFilter, type OutlineFilter, type OutlinePosition, type ParseOptions, PatternBuilder, type PatternElement, type PatternFill, type PatternParams, type PatternSvgContentResult, type PatternType, type PixelateFilter, type Point, type PointLightFilter, type PolygonBaseNodeProps, Polyline, type PolylineNodeProps, type RadialGradient, RadialGradientBuilder, 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 SerializedGroup, type SerializedShape, type SerializedSymbolDef, type SerializedVariantAxis, type SerializedViewbox, ShapeBuilder, type ShapeFilter, type ShapeMetadata, type SharpenFilter, Spiral, type SpiralNodeProps, Spline, SplineCurveType, type SplineNodeProps, type SplinePoint, SplinePointType, type SpotLightFilter, Square, type SquareNodeProps, Star, type StarNodeProps, type StepPosition, type StepsParams, type StringifyOptions, type StrokeType, type SymbolInstanceNodeProps, type TemplateVariable, type TemplateVariableSource, type TemplateVariableType, Text, type TextNodeProps, Timeline, Track, Triangle, type TriangleNodeProps, type ValidationError, type ValidationResult, type VariableMap, type Viewbox, type WarpFilter, type WarpType, type WatercolorFilter, type XrayFilter, computeArrowVertices, computeCloudPath, computeCrossVertices, computeDashArray, computeGearPath, computeGearVertices, computeHeartPath, computeLightningVertices, computePolygonVertices, computeRectanglePath, computeRingPath, computeSpeechBubbleVertices, computeSpiralPath, computeSplinePath, computeStarVertices, createDocument, createShape, createViewbox, escXml, extractVariables, filterAttr, generateCode, generateCssCode, generateD3Code, generateId, generatePatternSvgContent, generateReactCode, generateSvgCode, generateVueCode, getEasingCubicBezier, getMarkerDescriptors, getPatternElements, linearGradient, migrateSnapshot, parseDocument, parseVariableArgs, pattern, radialGradient, renderAnimationElements, renderCircle, renderEllipse, renderFilterDefs, renderFilterPrimitivesForType, renderImage, renderLine, renderPolygonShape, renderPolyline, renderRectangle, renderShape, renderSpline, renderText, renderToSvg, stringifyDocument, substituteString, substituteVariables, validateSnapshot, verticesToPath };
|