@pixerate/editor 0.124.0 → 0.125.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.
Files changed (92) hide show
  1. package/dist/agent/index.cjs +3 -3
  2. package/dist/agent/index.cjs.map +1 -1
  3. package/dist/agent/index.js +3 -3
  4. package/dist/animation-editor/index.cjs +424 -85
  5. package/dist/animation-editor/index.cjs.map +1 -1
  6. package/dist/animation-editor/index.d.cts +174 -7
  7. package/dist/animation-editor/index.d.ts +174 -7
  8. package/dist/animation-editor/index.js +348 -9
  9. package/dist/animation-editor/index.js.map +1 -1
  10. package/dist/chunk-FJ3324TZ.js +59 -0
  11. package/dist/chunk-FJ3324TZ.js.map +1 -0
  12. package/dist/{chunk-5EO2IXQE.js → chunk-FPRIUR4T.js} +1 -1
  13. package/dist/chunk-FPRIUR4T.js.map +1 -0
  14. package/dist/{chunk-YVVSTD3B.js → chunk-G6WXWS4Y.js} +9 -18
  15. package/dist/chunk-G6WXWS4Y.js.map +1 -0
  16. package/dist/{chunk-NGYD3AMN.js → chunk-MPQAO33O.js} +2 -2
  17. package/dist/{chunk-PEHYWUVV.cjs → chunk-O5RVCDEC.cjs} +82 -82
  18. package/dist/{chunk-PEHYWUVV.cjs.map → chunk-O5RVCDEC.cjs.map} +1 -1
  19. package/dist/{chunk-TK53AB4Q.cjs → chunk-QDJKUBWE.cjs} +3 -3
  20. package/dist/{chunk-TK53AB4Q.cjs.map → chunk-QDJKUBWE.cjs.map} +1 -1
  21. package/dist/{chunk-5XXMLBH4.cjs → chunk-QQKTOA4U.cjs} +1 -1
  22. package/dist/chunk-QQKTOA4U.cjs.map +1 -0
  23. package/dist/{chunk-IWSMDQE5.cjs → chunk-UXFI3CDZ.cjs} +13 -22
  24. package/dist/chunk-UXFI3CDZ.cjs.map +1 -0
  25. package/dist/{chunk-WE25VLCO.cjs → chunk-V5YGPRCZ.cjs} +36 -36
  26. package/dist/{chunk-WE25VLCO.cjs.map → chunk-V5YGPRCZ.cjs.map} +1 -1
  27. package/dist/chunk-W6QTLHZ3.cjs +59 -0
  28. package/dist/chunk-W6QTLHZ3.cjs.map +1 -0
  29. package/dist/{chunk-WATAQ2Z2.js → chunk-WUDPFWAN.js} +2 -2
  30. package/dist/{chunk-VFAKN46Z.js → chunk-XZWOLXWA.js} +3 -3
  31. package/dist/{chunk-VFAKN46Z.js.map → chunk-XZWOLXWA.js.map} +1 -1
  32. package/dist/effects/index.cjs +51 -6
  33. package/dist/effects/index.cjs.map +1 -1
  34. package/dist/effects/index.d.cts +39 -8
  35. package/dist/effects/index.d.ts +39 -8
  36. package/dist/effects/index.js +48 -3
  37. package/dist/effects/index.js.map +1 -1
  38. package/dist/{export-TqXMOlDt.d.cts → export-Bp7ji2r4.d.cts} +4 -3
  39. package/dist/{export-BzSRXyH6.d.cts → export-C1s4eolZ.d.ts} +5 -3
  40. package/dist/{export-8RnlngAv.d.ts → export-DAyPY94f.d.ts} +4 -3
  41. package/dist/{export-DM3h7QEI.d.ts → export-DVl4fWy5.d.cts} +5 -3
  42. package/dist/generation/index.cjs +3 -3
  43. package/dist/generation/index.cjs.map +1 -1
  44. package/dist/generation/index.js +3 -3
  45. package/dist/helpers-BBLlekuM.d.ts +2009 -0
  46. package/dist/helpers-i95Ob6Vi.d.cts +2009 -0
  47. package/dist/image-editor/index.cjs +712 -721
  48. package/dist/image-editor/index.cjs.map +1 -1
  49. package/dist/image-editor/index.d.cts +5 -7
  50. package/dist/image-editor/index.d.ts +5 -7
  51. package/dist/image-editor/index.js +19 -28
  52. package/dist/image-editor/index.js.map +1 -1
  53. package/dist/paint-editor/index.cjs +12 -11
  54. package/dist/paint-editor/index.cjs.map +1 -1
  55. package/dist/paint-editor/index.d.cts +3 -5
  56. package/dist/paint-editor/index.d.ts +3 -5
  57. package/dist/paint-editor/index.js +6 -5
  58. package/dist/paint-editor/index.js.map +1 -1
  59. package/dist/{svg-BDrjRnL1.d.cts → svg-BkRL-fZJ.d.cts} +1 -1
  60. package/dist/{svg-C-vZ3q50.d.ts → svg-DJKriJ4A.d.ts} +1 -1
  61. package/dist/tools/index.cjs +2 -2
  62. package/dist/tools/index.cjs.map +1 -1
  63. package/dist/tools/index.js +3 -3
  64. package/dist/{tools-C7JtLYzo.d.ts → tools-CM8Oe8F3.d.ts} +1 -1
  65. package/dist/{tools-DHKGHiSK.d.cts → tools-DZCv2kX1.d.cts} +1 -1
  66. package/dist/vector/index.cjs +1032 -883
  67. package/dist/vector/index.cjs.map +1 -1
  68. package/dist/vector/index.d.cts +61 -6
  69. package/dist/vector/index.d.ts +61 -6
  70. package/dist/vector/index.js +155 -6
  71. package/dist/vector/index.js.map +1 -1
  72. package/dist/video-editor/index.cjs +271 -270
  73. package/dist/video-editor/index.cjs.map +1 -1
  74. package/dist/video-editor/index.d.cts +4 -6
  75. package/dist/video-editor/index.d.ts +4 -6
  76. package/dist/video-editor/index.js +6 -5
  77. package/dist/video-editor/index.js.map +1 -1
  78. package/package.json +1 -1
  79. package/skills/pixerate-animation-editor/SKILL.md +24 -1
  80. package/skills/pixerate-vector/SKILL.md +15 -0
  81. package/dist/chunk-5EO2IXQE.js.map +0 -1
  82. package/dist/chunk-5XXMLBH4.cjs.map +0 -1
  83. package/dist/chunk-IWSMDQE5.cjs.map +0 -1
  84. package/dist/chunk-YVVSTD3B.js.map +0 -1
  85. package/dist/flair-CxB3fOcU.d.ts +0 -739
  86. package/dist/flair-D7BxyBwL.d.cts +0 -739
  87. package/dist/helpers-777mC6dc.d.cts +0 -253
  88. package/dist/helpers-DX2_7L5t.d.ts +0 -253
  89. package/dist/types-BcX7sCsn.d.ts +0 -993
  90. package/dist/types-CznabG7m.d.cts +0 -993
  91. /package/dist/{chunk-NGYD3AMN.js.map → chunk-MPQAO33O.js.map} +0 -0
  92. /package/dist/{chunk-WATAQ2Z2.js.map → chunk-WUDPFWAN.js.map} +0 -0
@@ -1,993 +0,0 @@
1
- import { C as CanvasGradientDef } from './gradient-KDfCvhuj.cjs';
2
- import { W as WarpStyle, a as WarpMesh } from './types-CwMPoRMU.cjs';
3
-
4
- /** An affine matrix `[a, b, c, d, e, f]`: `x' = a·x + c·y + e`, `y' = b·x + d·y + f` (SVG order). */
5
- type VectorMatrix = readonly [number, number, number, number, number, number];
6
- /** A point in document coordinates. */
7
- interface Vec2 {
8
- x: number;
9
- y: number;
10
- }
11
- /**
12
- * How an anchor's handles relate:
13
- * - `corner`: handles move independently (or are absent).
14
- * - `smooth`: handles stay on one line through the anchor, lengths independent.
15
- * - `symmetric`: handles stay on one line with equal lengths.
16
- */
17
- type VectorAnchorType = 'corner' | 'smooth' | 'symmetric';
18
- /**
19
- * Live corner shapes: `round` (an arc tangent to both sides), `inverted` (an arc centred on
20
- * the corner, cut into the shape) and `chamfer` (a straight bevel).
21
- */
22
- type VectorCornerKind = 'round' | 'inverted' | 'chamfer';
23
- declare const VECTOR_CORNER_KINDS: readonly VectorCornerKind[];
24
- /**
25
- * A live corner: drawn rounded (or cut) at render, hit-test, bounds, boolean, outline and export
26
- * time while the stored anchor stays sharp. The radius shrinks to fit when the sides are short:
27
- * the cut reaches at most halfway along each side.
28
- */
29
- interface VectorCorner {
30
- radius: number;
31
- /** Default `round`. */
32
- kind?: VectorCornerKind;
33
- /**
34
- * Corner smoothing (squircle, as in Figma and iOS), 0–1, round corners between straight sides
35
- * only: the cut reaches (1 + smoothing) times as far along each side and eases into a shorter arc,
36
- * so curvature builds up gradually. Default 0 (a circular arc).
37
- */
38
- smoothing?: number;
39
- }
40
- /**
41
- * One anchor of a subpath. Handles are absolute document positions; a missing (or `null`)
42
- * handle sits on the anchor, so a segment with no handles at either end is a straight line.
43
- */
44
- interface VectorAnchor {
45
- x: number;
46
- y: number;
47
- /** Control point of the segment arriving at this anchor. */
48
- in?: Vec2 | null;
49
- /** Control point of the segment leaving this anchor. */
50
- out?: Vec2 | null;
51
- /** Default `corner`. */
52
- type?: VectorAnchorType;
53
- /** Live corner radius. Ignored on smooth / symmetric anchors and the ends of open subpaths. */
54
- corner?: VectorCorner | null;
55
- /**
56
- * A stable id, unique within its path, given when a constraint refers to the anchor (see
57
- * `VectorConstraint`). Edits that move or restyle the anchor keep it; edits that rebuild a path
58
- * drop it, and constraints on a dropped anchor are removed.
59
- */
60
- id?: string;
61
- }
62
- /** A chain of anchors joined by line or cubic Bézier segments. */
63
- interface VectorSubpath {
64
- anchors: VectorAnchor[];
65
- /** Joins the last anchor back to the first. */
66
- closed: boolean;
67
- }
68
- /**
69
- * Gradient styles: `linear` (start → end), `radial` (centred on the start, reaching the end;
70
- * focal point and aspect), `conic` (an angle sweep around the start, from the end's direction
71
- * towards the aspect handle's: clockwise on screen), `reflected` (linear mirrored about the
72
- * start) and `diamond` (`|u| + |v|` in the gradient's frame: a rhombus through the end and the
73
- * aspect handle).
74
- */
75
- type VectorGradientType = 'linear' | 'radial' | 'conic' | 'reflected' | 'diamond';
76
- declare const VECTOR_GRADIENT_TYPES: readonly VectorGradientType[];
77
- /** What a gradient paints past its ends: the end colours, mirrored periods or repeated periods. */
78
- type VectorGradientSpread = 'pad' | 'reflect' | 'repeat';
79
- declare const VECTOR_GRADIENT_SPREADS: readonly VectorGradientSpread[];
80
- /** Where colours mix between stops: sRGB (SVG's own), linear light or Oklab. */
81
- type VectorGradientInterpolation = 'srgb' | 'linear' | 'oklab';
82
- declare const VECTOR_GRADIENT_INTERPOLATIONS: readonly VectorGradientInterpolation[];
83
- /**
84
- * The space a gradient's points are in: fractions of the shape's bounding box (SVG's
85
- * `objectBoundingBox`, the default) or the node's own coordinates (`userSpaceOnUse`).
86
- */
87
- type VectorGradientUnits = 'objectBoundingBox' | 'userSpaceOnUse';
88
- /**
89
- * How a gradient lies on a stroke: `within` (laid over the stroke's area like a fill), `along`
90
- * (t runs from 0 at the start of each subpath to 1 at its end) or `across` (from the stroke's
91
- * left edge to its right edge, looking along the path).
92
- */
93
- type VectorStrokeGradientMode = 'within' | 'along' | 'across';
94
- declare const VECTOR_STROKE_GRADIENT_MODES: readonly VectorStrokeGradientMode[];
95
- /** A colour stop. `opacity` multiplies the colour's own alpha. */
96
- interface VectorGradientStop {
97
- /** 0–1. */
98
- offset: number;
99
- color: string;
100
- /** 0–1, default 1. */
101
- opacity?: number;
102
- /**
103
- * Where, between this stop and the next (0–1 of the way), the colour is half-way between
104
- * them. Default 0.5 (an even mix).
105
- */
106
- midpoint?: number;
107
- }
108
- /**
109
- * A gradient paint. `CanvasGradientDef` (the canvas package's linear `angle` / radial
110
- * `cx, cy, r` gradients) is a valid value: those fields are the shorthand form. Explicit
111
- * geometry (`start` / `end`, in `units`) wins over the shorthand.
112
- */
113
- interface VectorGradient {
114
- type: VectorGradientType;
115
- stops: VectorGradientStop[];
116
- /**
117
- * Shorthand direction in degrees, CSS style (0 points up, clockwise): a linear or reflected
118
- * gradient's direction across the box (default 180), a conic gradient's start angle or a
119
- * diamond's turn (default 90).
120
- */
121
- angle?: number;
122
- /** Shorthand centre and radius of radial, conic and diamond gradients (fractions of the box, default 0.5). */
123
- cx?: number;
124
- cy?: number;
125
- r?: number;
126
- /** Where t = 0: a linear gradient's start, the centre of the other styles. */
127
- start?: Vec2;
128
- /** Where t = 1 along the gradient's main axis (a radial gradient's radius). */
129
- end?: Vec2;
130
- /**
131
- * The end of the secondary axis (radial, conic and diamond): its distance from `start` over
132
- * the main axis' length is the aspect ratio. Absent: square to the main axis, as long.
133
- */
134
- width?: Vec2 | null;
135
- /** A radial gradient's focal point (where t = 0); absent: the centre. */
136
- focal?: Vec2 | null;
137
- /** Radius of the focal circle as a fraction of the radius (SVG `fr`, default 0). */
138
- focalRadius?: number;
139
- /** Space of `start`, `end`, `width` and `focal` (default `objectBoundingBox`). */
140
- units?: VectorGradientUnits;
141
- /** Default `pad`. */
142
- spread?: VectorGradientSpread;
143
- /** Default `srgb`. */
144
- interpolation?: VectorGradientInterpolation;
145
- /**
146
- * 0–1: how far the colours follow a smooth spline through the stops instead of straight
147
- * lines (Photoshop's Smoothness). Default 0.
148
- */
149
- smoothness?: number;
150
- /** On a stroke: how the gradient lies on it (default `within`). Ignored on fills. */
151
- strokeMode?: VectorStrokeGradientMode;
152
- }
153
- /** A fill or stroke: any CSS colour, a gradient, or `null` / `'none'` for no paint. */
154
- type VectorPaint = string | VectorGradient | VectorMeshGradient | VectorFreeformGradient | CanvasGradientDef | null;
155
- /**
156
- * A gradient mesh (Illustrator's Gradient Mesh, PDF shading types 6 and 7): a lattice of
157
- * `(rows + 1) × (columns + 1)` points in the node's own space, row by row, each with a colour.
158
- * Each cell is a smooth patch whose sides are curves through the lattice and whose colour blends
159
- * between its four corners. Outside the patches the paint is transparent.
160
- */
161
- interface VectorMeshGradient {
162
- type: 'mesh';
163
- rows: number;
164
- columns: number;
165
- /** Lattice points, row by row (`(rows + 1) × (columns + 1)` of them). */
166
- points: Vec2[];
167
- /** A CSS colour per point. */
168
- colors: string[];
169
- /** Opacity per point (0–1, default 1 each). */
170
- opacities?: number[];
171
- }
172
- /** One colour point of a freeform gradient. */
173
- interface VectorFreeformPoint {
174
- x: number;
175
- y: number;
176
- color: string;
177
- /** 0–1, default 1. */
178
- opacity?: number;
179
- /** Radius of the disc of pure colour round the point, as a fraction of half the box's longer side (0–1, default 0). */
180
- spread?: number;
181
- }
182
- /**
183
- * A freeform gradient (Illustrator's Freeform Gradient): colour points placed anywhere in the
184
- * node's own space, blended across the shape by distance, and optional smooth lines through some
185
- * of them that carry their colours along their length.
186
- */
187
- interface VectorFreeformGradient {
188
- type: 'freeform';
189
- points: VectorFreeformPoint[];
190
- /** Each line runs smoothly through the points at these indices, in order. */
191
- lines?: number[][];
192
- }
193
- type VectorFillRule = 'nonzero' | 'evenodd';
194
- type VectorLineCap = 'butt' | 'round' | 'square';
195
- type VectorLineJoin = 'miter' | 'round' | 'bevel';
196
- /**
197
- * Where the stroke sits on the outline: centred on it, inside the shape or outside it. Only
198
- * shapes whose subpaths are all closed have an inside; open paths always stroke centred.
199
- */
200
- type VectorStrokeAlign = 'center' | 'inside' | 'outside';
201
- /** Arrowheads and end markers for the ends of open paths. */
202
- type VectorArrowhead = 'triangle' | 'arrow' | 'open' | 'circle' | 'square' | 'bar';
203
- declare const VECTOR_ARROWHEADS: readonly VectorArrowhead[];
204
- /**
205
- * `extend`: the head's tip sits past the end point and the path keeps its length; `tip`: the
206
- * tip sits on the end point and the stroke is shortened under the head.
207
- */
208
- type VectorArrowAlign = 'extend' | 'tip';
209
- /**
210
- * One point of a variable-width stroke profile. `t` is the position along the subpath by
211
- * length (0 at its start, 1 at its end); `left` and `right` are how far the stroke reaches on
212
- * each side, as multiples of half the stroke width (looking along the path on screen, y down).
213
- * A uniform stroke has 1 on both sides. Two points at the same `t` make a step.
214
- */
215
- interface VectorWidthPoint {
216
- t: number;
217
- left: number;
218
- right: number;
219
- }
220
- /**
221
- * Blend modes of paint layers and nodes: the set SVG and CSS `mix-blend-mode` draw, named as the
222
- * image editor names them (`@pixerate/editor/image-editor` `BlendMode`). `linear-dodge` draws as
223
- * CSS `plus-lighter`. The image editor's other modes (linear burn, vivid light, pigment, …) have
224
- * no SVG equivalent and are not offered.
225
- */
226
- type VectorBlendMode = 'normal' | 'darken' | 'multiply' | 'color-burn' | 'lighten' | 'screen' | 'color-dodge' | 'linear-dodge' | 'overlay' | 'soft-light' | 'hard-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity';
227
- /** Every vector blend mode, in the image editor's (Photoshop's) menu order. */
228
- declare const VECTOR_BLEND_MODES: readonly VectorBlendMode[];
229
- /** One fill of a path's fill stack (`VectorStyle.fills`). */
230
- interface VectorPaintLayer {
231
- /** A colour, a gradient, or `null` for none. */
232
- paint: VectorPaint;
233
- /** 0–1, default 1. Multiplies the paint's own alpha. */
234
- opacity?: number;
235
- /** How the layer mixes with what is under it (the layers below, then the backdrop). Default `normal`. */
236
- blendMode?: VectorBlendMode;
237
- /** Hidden layers are kept but not drawn or hit. Default true. */
238
- visible?: boolean;
239
- }
240
- /** The settings each stroke layer has of its own (the stroke shorthand fields of `VectorStyle`). */
241
- type VectorStrokeSettings = Pick<VectorStyle, 'strokeWidth' | 'strokeLinecap' | 'strokeLinejoin' | 'strokeDasharray' | 'strokeAlign' | 'startArrow' | 'endArrow' | 'arrowAlign' | 'startArrowScale' | 'endArrowScale' | 'strokeWidthProfile'>;
242
- /**
243
- * What a stroke layer draws. Only `paint` (a paint along the outline, the default) exists today.
244
- * Other kinds are the extension point for strokes drawn some other way, such as a raster
245
- * brushstroke from `@pixerate/editor/paint` laid along the path: a layer with an unknown kind is
246
- * kept through edits, load and SVG round trips, listed to agents, and skipped when drawing and
247
- * hit-testing.
248
- */
249
- type VectorStrokeLayerKind = 'paint';
250
- /** One stroke of a path's stroke stack (`VectorStyle.strokes`): a paint plus its own stroke settings. */
251
- interface VectorStrokeLayer extends VectorPaintLayer, VectorStrokeSettings {
252
- /** Default `paint`. See `VectorStrokeLayerKind`. */
253
- kind?: VectorStrokeLayerKind;
254
- }
255
- /** Paint and stroke settings of a path. */
256
- interface VectorStyle {
257
- fill?: VectorPaint;
258
- stroke?: VectorPaint;
259
- /** Default 1. */
260
- strokeWidth?: number;
261
- strokeLinecap?: VectorLineCap;
262
- strokeLinejoin?: VectorLineJoin;
263
- strokeDasharray?: number[];
264
- /** Default `nonzero`. */
265
- fillRule?: VectorFillRule;
266
- /** Default `center`. */
267
- strokeAlign?: VectorStrokeAlign;
268
- /** Head at the start of the first subpath when it is open, or none. */
269
- startArrow?: VectorArrowhead | null;
270
- /** Head at the end of the last subpath when it is open, or none. */
271
- endArrow?: VectorArrowhead | null;
272
- /** Default `extend`. */
273
- arrowAlign?: VectorArrowAlign;
274
- /** Size of the start head as a multiple of the stroke width (default 1: a head 4 widths long). */
275
- startArrowScale?: number;
276
- /** Size of the end head (default 1). */
277
- endArrowScale?: number;
278
- /**
279
- * Variable width: side scales along each subpath, interpolated with a monotone cubic (see
280
- * `widthProfileAt`). Absent, empty or `null` strokes at a uniform width. A profiled stroke is
281
- * drawn as its filled outline.
282
- */
283
- strokeWidthProfile?: VectorWidthPoint[] | null;
284
- /**
285
- * The fill stack, bottom to top. Absent: `fill` alone is the stack (one layer, or none without
286
- * a paint). Present: it is the truth, and `fill` mirrors its top layer's paint. The shorthand
287
- * stays writable: setting `fill` to a paint repaints the top layer, `null` clears the stack.
288
- * Stacks of one plain layer (full opacity, `normal`, visible) are stored as the shorthand.
289
- */
290
- fills?: VectorPaintLayer[] | null;
291
- /**
292
- * The stroke stack, bottom to top, drawn over every fill. Like `fills`: absent, `stroke` and the
293
- * stroke settings above are the one stroke; present, they mirror its top layer, and writing them
294
- * edits that layer (`stroke: null` clears the stack).
295
- */
296
- strokes?: VectorStrokeLayer[] | null;
297
- }
298
- interface VectorNodeBase {
299
- id: string;
300
- name?: string;
301
- /** Default true. */
302
- visible?: boolean;
303
- /** Locked nodes are drawn but cannot be picked or edited on the canvas. */
304
- locked?: boolean;
305
- /** 0–1, default 1. */
306
- opacity?: number;
307
- /**
308
- * Placement in the parent's space: a rigid matrix (rotation + translation). Anchors and
309
- * children are in the node's own space. Omitted for unrotated nodes, whose positions are
310
- * stored directly. Scale and skew are never stored here — `transformVectorNode` bakes
311
- * them into the geometry, so stroke widths and the rotated selection box stay exact.
312
- */
313
- transform?: VectorMatrix;
314
- /**
315
- * An in-between a blend group generated from its keys. Steps are rebuilt whenever a key or
316
- * the blend options change, and are locked (clicks select the blend group).
317
- */
318
- blendStep?: boolean;
319
- /**
320
- * Live path effects, applied top to bottom: each acts on every path above it (the node's own
321
- * outline, or a group's children, then the result of the effects before it), and effects after a
322
- * repeater act on its copies. The stored anchors and children never change.
323
- */
324
- effects?: VectorEffect[] | null;
325
- /**
326
- * As an operand of a live boolean group: how it combines with the result of the operands below
327
- * it. Absent: the group's `liveBoolean` operation.
328
- */
329
- booleanOperation?: VectorBooleanOperation | null;
330
- /** How the whole node (all its paint, filters included) mixes with what is under it. Default `normal`. */
331
- blendMode?: VectorBlendMode;
332
- /**
333
- * Visual filters (drop and inner shadows, glows, blurs, feather), applied to everything the
334
- * node draws. Unlike path `effects` they never change geometry: bounds, hit-testing and
335
- * booleans ignore them.
336
- */
337
- filters?: VectorFilter[] | null;
338
- /**
339
- * How the node follows its frame when the frame is resized (`VectorGroupNode.frame`): per
340
- * axis, pinned to the start (default `left` / `top`), the end, both (it stretches), the centre,
341
- * or scaled with the frame. Ignored outside frames.
342
- */
343
- resizing?: VectorResizing | null;
344
- }
345
- /** Horizontal resizing constraint of a frame's child (see `VectorNodeBase.resizing`). */
346
- type VectorHorizontalResizing = 'left' | 'right' | 'leftRight' | 'center' | 'scale';
347
- /** Vertical resizing constraint of a frame's child (see `VectorNodeBase.resizing`). */
348
- type VectorVerticalResizing = 'top' | 'bottom' | 'topBottom' | 'center' | 'scale';
349
- declare const VECTOR_HORIZONTAL_RESIZING: readonly VectorHorizontalResizing[];
350
- declare const VECTOR_VERTICAL_RESIZING: readonly VectorVerticalResizing[];
351
- /** A frame child's resizing constraints (Figma's "constraints"). */
352
- interface VectorResizing {
353
- /** Default `left`. */
354
- horizontal?: VectorHorizontalResizing;
355
- /** Default `top`. */
356
- vertical?: VectorVerticalResizing;
357
- }
358
- /**
359
- * Makes a group a frame (an artboard when top-level): a rectangle in the group's own space with an
360
- * optional fill drawn below the children, which by default it clips. Resizing the frame moves and
361
- * resizes its children by their `resizing` constraints instead of scaling them.
362
- */
363
- interface VectorFrame {
364
- x: number;
365
- y: number;
366
- width: number;
367
- height: number;
368
- /** The frame's background, drawn below its children (default none). */
369
- fill?: VectorPaint;
370
- /** Clip the children to the frame (default true). */
371
- clip?: boolean;
372
- }
373
- /** A shape made of one or more subpaths (holes and compound shapes included). */
374
- interface VectorPathNode extends VectorNodeBase, VectorStyle {
375
- type: 'path';
376
- subpaths: VectorSubpath[];
377
- /**
378
- * Makes the path a connector: an open line whose ends may be glued to other objects'
379
- * connection sites. Its geometry is routed again after every edit, so it follows them.
380
- */
381
- connector?: VectorConnector | null;
382
- }
383
- /**
384
- * Where a connector end meets an object: the middle of a side of the object's own (unrotated)
385
- * bounds, its centre, or `auto` (the side facing the connector's other end, chosen on every route).
386
- */
387
- type VectorConnectorSide = 'top' | 'right' | 'bottom' | 'left' | 'center' | 'auto';
388
- declare const VECTOR_CONNECTOR_SIDES: readonly VectorConnectorSide[];
389
- /** How a connector runs between its ends: a straight line, right-angled elbows or an S-curve. */
390
- type VectorConnectorRoute = 'straight' | 'elbow' | 'curved';
391
- declare const VECTOR_CONNECTOR_ROUTES: readonly VectorConnectorRoute[];
392
- /** A glued connector end. */
393
- interface VectorConnectorEnd {
394
- nodeId: string;
395
- /** Default `auto`. */
396
- side?: VectorConnectorSide;
397
- }
398
- /** A connector's settings (`VectorPathNode.connector`). An end that is not glued stays where it is. */
399
- interface VectorConnector {
400
- start?: VectorConnectorEnd | null;
401
- end?: VectorConnectorEnd | null;
402
- /** Default `straight`. */
403
- route?: VectorConnectorRoute;
404
- /** Corner radius of an elbow route's bends (document units, default 0). */
405
- radius?: number;
406
- /** How far an elbow or curve leaves a glued end straight out of its side before turning (document units, default 16). */
407
- gap?: number;
408
- }
409
- /**
410
- * How a blend spaces its in-betweens: a number of `steps` between each pair of keys, a fixed
411
- * `distance` between steps along the spine, or `smoothColor` (as many steps as the colours
412
- * need for a smooth ramp; by distance when the colours match).
413
- */
414
- type VectorBlendSpacing = 'steps' | 'distance' | 'smoothColor';
415
- declare const VECTOR_BLEND_SPACINGS: readonly VectorBlendSpacing[];
416
- /** Settings of a blend. */
417
- interface VectorBlendOptions {
418
- /** Default `steps`. */
419
- spacing?: VectorBlendSpacing;
420
- /** Steps between each pair of keys with `steps` spacing (default 5). */
421
- steps?: number;
422
- /** Distance between steps along the spine with `distance` spacing (default 20). */
423
- distance?: number;
424
- /** Turn the steps with the spine's direction (default `false`: they keep the keys' orientation). */
425
- orientToSpine?: boolean;
426
- /** Move anchors in straight lines instead of the rotation-aware morph (default `false`). */
427
- linear?: boolean;
428
- }
429
- /** A live blend: the group's keys plus how the in-betweens are made and laid out. */
430
- interface VectorBlend extends VectorBlendOptions {
431
- /**
432
- * A replaced spine in the group's space: the steps follow it instead of the straight lines
433
- * between the keys' centres (the keys sit along it, spread evenly by arc length).
434
- */
435
- spine?: VectorSubpath | null;
436
- /** The anchor of each key's first subpath its blend starts from, by key id (the Blend tool's clicks). */
437
- starts?: Record<string, number>;
438
- }
439
- /**
440
- * How a mask group's mask (its first, bottom child) hides the rest: `clip` (a clipping mask: the
441
- * mask's outline, fully opaque; its paint is not drawn), `alpha` (an opacity mask by the mask's
442
- * drawn alpha: soft edges, gradients and opacity count) or `luminance` (by its brightness times
443
- * its alpha: white shows, black hides).
444
- */
445
- type VectorMaskType = 'clip' | 'alpha' | 'luminance';
446
- declare const VECTOR_MASK_TYPES: readonly VectorMaskType[];
447
- /** A group's mask settings (`VectorGroupNode.mask`). */
448
- interface VectorMask {
449
- type: VectorMaskType;
450
- /** Show the contents where the mask hides them and hide them where it shows them. Default false. */
451
- invert?: boolean;
452
- }
453
- /** A group of nodes that select and transform together. */
454
- interface VectorGroupNode extends VectorNodeBase {
455
- type: 'group';
456
- children: VectorNode[];
457
- /**
458
- * Makes the group a live blend: its children that are not `blendStep`s are the keys, in
459
- * stacking order, and the steps between them are regenerated whenever a key changes.
460
- */
461
- blend?: VectorBlend | null;
462
- /**
463
- * Makes the group a live boolean: its children stay editable operands, folded bottom to top
464
- * (each by its own `booleanOperation` or this one), and the group draws as the result in the
465
- * bottom operand's style.
466
- */
467
- liveBoolean?: VectorBooleanOperation | null;
468
- /**
469
- * Makes the group a mask group: its first (bottom) child is the mask and the children above it
470
- * show only where the mask lets them (see `VectorMaskType`). Hit-testing, bounds, snapping and
471
- * booleans use the masked result. A hidden mask child turns the mask off (the contents draw
472
- * whole). The group's own opacity, blend mode and filters apply to the masked result, and its
473
- * path effects to the contents (not the mask). Ignored on blends and live booleans.
474
- */
475
- mask?: VectorMask | null;
476
- /**
477
- * Makes the group a frame (see `VectorFrame`): it draws its fill below the children, clips them,
478
- * selects and snaps by its rectangle, and lays its children out by their `resizing` constraints
479
- * when resized. Ignored on blends, live booleans and mask groups.
480
- */
481
- frame?: VectorFrame | null;
482
- /**
483
- * Makes the group a live symmetry group: it draws its children and their mirrored (or rotated)
484
- * copies, regenerated whenever a child changes. Ignored on blends, live booleans, mask groups
485
- * and frames.
486
- */
487
- symmetry?: VectorSymmetry | null;
488
- }
489
- /**
490
- * How a symmetry group repeats its children: mirrored across a `vertical`, `horizontal` or
491
- * `diagonal` axis, across both axes (`dual`: four quarters), or `radial`ly round the centre
492
- * (`copies` turns, each mirrored too with `mirror`, like a kaleidoscope).
493
- */
494
- type VectorSymmetryMode = 'vertical' | 'horizontal' | 'dual' | 'diagonal' | 'radial';
495
- declare const VECTOR_SYMMETRY_MODES: readonly VectorSymmetryMode[];
496
- /** A symmetry group's settings (`VectorGroupNode.symmetry`). */
497
- interface VectorSymmetry {
498
- mode: VectorSymmetryMode;
499
- /** Where the axes cross (the group's own space). */
500
- center: Vec2;
501
- /** Turn of the axes, degrees clockwise (default 0). */
502
- rotation?: number;
503
- /** Radial: how many turns round the circle (2–64, default 6). */
504
- copies?: number;
505
- /** Radial: mirror each turn too (default false). */
506
- mirror?: boolean;
507
- }
508
- /**
509
- * The character style of text (a font and how it is set). Sizes are document units; `tracking` is in
510
- * 1/1000 em. Paint comes from the node's fills and strokes (and a run's own `fill`).
511
- */
512
- interface VectorCharacterStyle {
513
- /** Family name ("Inter"); a family the shaper lacks draws in a fallback and is listed as missing. */
514
- fontFamily: string;
515
- /** CSS weight, 1–1000 (400 regular, 700 bold). */
516
- fontWeight: number;
517
- /** Default false. */
518
- italic?: boolean;
519
- fontSize: number;
520
- /** Letter spacing in 1/1000 em (default 0). */
521
- tracking?: number;
522
- /** Baseline-to-baseline distance; absent: auto (`autoLeading` × size). */
523
- leading?: number;
524
- /** Raises (positive) or lowers the text (default 0). */
525
- baselineShift?: number;
526
- underline?: boolean;
527
- strikethrough?: boolean;
528
- }
529
- /** Character style fields a run can set over the node's own style, plus its own fill. */
530
- type VectorTextRunStyle = Partial<VectorCharacterStyle> & {
531
- /** The run's fill: replaces the paint of the node's top fill for these characters. */
532
- fill?: VectorPaint;
533
- };
534
- /** A style over `length` UTF-16 code units of the text, in order. */
535
- interface VectorTextRun {
536
- length: number;
537
- style: VectorTextRunStyle;
538
- }
539
- type VectorTextAlign = 'left' | 'center' | 'right' | 'justify';
540
- declare const VECTOR_TEXT_ALIGNS: readonly VectorTextAlign[];
541
- /** Paragraph settings of a text node (all its paragraphs). Lengths in document units. */
542
- interface VectorParagraphStyle {
543
- /** Default `left`. `justify` stretches every line of area text but a paragraph's last; on a path it spreads the text over the path. */
544
- align?: VectorTextAlign;
545
- /** Auto leading as a multiple of the font size (default 1.2). */
546
- autoLeading?: number;
547
- firstLineIndent?: number;
548
- startIndent?: number;
549
- endIndent?: number;
550
- spaceBefore?: number;
551
- spaceAfter?: number;
552
- }
553
- /** Where text on a path sits across the path: its baseline, ascender, descender or centre on the line. */
554
- type VectorPathTextBaseline = 'baseline' | 'ascender' | 'descender' | 'center';
555
- declare const VECTOR_PATH_TEXT_BASELINES: readonly VectorPathTextBaseline[];
556
- /**
557
- * Where a text node's text goes, in the node's own space:
558
- * - `point`: one line per paragraph, the first baseline starting at (`x`, `y`);
559
- * - `area`: lines wrapped inside the box at (`x`, `y`) of `width` × `height` (lines that do not fit
560
- * are hidden: the text overflows);
561
- * - `path`: one line set along `path` (paragraph breaks become spaces), from `start` to `end`
562
- * (distances from the path's ends), turned with the path (`orientation: 'rotate'`) or upright.
563
- * `flip` runs the text the other way, on the other side.
564
- */
565
- type VectorTextFrame = {
566
- kind: 'point';
567
- x: number;
568
- y: number;
569
- } | {
570
- kind: 'area';
571
- x: number;
572
- y: number;
573
- width: number;
574
- height: number;
575
- } | {
576
- kind: 'path';
577
- path: VectorSubpath;
578
- /** Margin from the path's start (default 0). */
579
- start?: number;
580
- /** Margin from the path's end (default 0). */
581
- end?: number;
582
- flip?: boolean;
583
- /** Default `rotate`. */
584
- orientation?: 'rotate' | 'upright';
585
- /** Default `baseline`. */
586
- baseline?: VectorPathTextBaseline;
587
- };
588
- /**
589
- * Text: a string with a character style, optional styled runs and a paragraph style, set in a
590
- * frame. It paints with the node's fills and strokes like a path. Layout and glyphs come from the
591
- * editor's text shaper (`setVectorTextShaper`); with an outline shaper the text draws as glyph
592
- * outlines (so path effects, envelopes, booleans and Create Outlines work), otherwise as SVG text.
593
- */
594
- interface VectorTextNode extends VectorNodeBase, VectorStyle {
595
- type: 'text';
596
- text: string;
597
- /** The base character style. */
598
- font: VectorCharacterStyle;
599
- /** Runs over the text, each overriding some fields of `font` (absent: one style throughout). */
600
- runs?: VectorTextRun[] | null;
601
- paragraph?: VectorParagraphStyle | null;
602
- frame: VectorTextFrame;
603
- }
604
- /**
605
- * Per-instance changes to a symbol's art: every fill and / or stroke of the art painted with one
606
- * paint (a tint), and art nodes (by their id in the symbol) hidden.
607
- */
608
- interface VectorInstanceOverrides {
609
- fill?: VectorPaint;
610
- stroke?: VectorPaint;
611
- /** Ids of nodes of the symbol's art (top-level or nested) not drawn in this instance. */
612
- hidden?: string[];
613
- }
614
- /**
615
- * A placed copy of a symbol (`VectorDocument.symbols`): it draws the symbol's art through its
616
- * `transform`, which, unlike other nodes', may scale and skew. Editing the symbol changes every
617
- * instance.
618
- */
619
- interface VectorInstanceNode extends VectorNodeBase {
620
- type: 'instance';
621
- symbolId: string;
622
- /** Strokes (and other lengths of the art's paint) scale with the instance (default true, as in Illustrator). */
623
- scaleStrokes?: boolean;
624
- overrides?: VectorInstanceOverrides | null;
625
- /**
626
- * The symbol's art, resolved by the editor (the same array as the symbol's `nodes`). Not part of
627
- * the stored document: `VectorEditorController.toJSON` and SVG export leave it out, and loading
628
- * resolves it again (`resolveVectorSymbols`).
629
- */
630
- art?: VectorNode[];
631
- }
632
- type VectorNode = VectorPathNode | VectorGroupNode | VectorTextNode | VectorInstanceNode;
633
- /** A symbol: reusable art its instances draw. */
634
- interface VectorSymbol {
635
- id: string;
636
- name: string;
637
- /** The art, bottom to top, in the symbol's own space (its origin is the registration point instances are placed by). */
638
- nodes: VectorNode[];
639
- }
640
- /** A vector drawing: an artboard and its nodes, bottom to top. */
641
- interface VectorDocument {
642
- width: number;
643
- height: number;
644
- /** Artboard colour (default: transparent). */
645
- background?: string;
646
- nodes: VectorNode[];
647
- /** Symbols the document's instances draw (see `VectorInstanceNode`). */
648
- symbols?: VectorSymbol[];
649
- /** Constraints between anchors, segments and circles, solved after every edit. */
650
- constraints?: VectorConstraint[];
651
- /** Named values the constraints' expressions use. */
652
- parameters?: VectorParameter[];
653
- }
654
- /**
655
- * Constraint kinds (CAD-style parametric drawing). Geometric: `coincident` (two points, a point on
656
- * a segment's line, or a point on a circle), `collinear` (two segments on one line), `concentric`
657
- * (two circles, or a circle's centre on a point), `fix`, `parallel`, `perpendicular`, `horizontal`
658
- * / `vertical` (a segment, or two points level), `tangent` (a segment and a circle, two circles, or
659
- * G1 at an anchor: its handles in line), `smooth` (G2 at an anchor: G1 and equal curvature),
660
- * `symmetric` (two points about a segment's line) and `equal` (segment lengths or radii).
661
- * Dimensional (with a `value`): `distance`, `angle` (degrees), `radius` and `diameter`.
662
- */
663
- type VectorConstraintKind = 'coincident' | 'collinear' | 'concentric' | 'fix' | 'parallel' | 'perpendicular' | 'horizontal' | 'vertical' | 'tangent' | 'smooth' | 'symmetric' | 'equal' | 'distance' | 'angle' | 'radius' | 'diameter';
664
- declare const VECTOR_CONSTRAINT_KINDS: readonly VectorConstraintKind[];
665
- /**
666
- * What a constraint refers to: an anchor of a path (by its stable `id`), one of the anchor's
667
- * handles, the segment from the anchor to the next one, or (no `anchor`) a whole path as a circle
668
- * (its centre and radius, for closed round paths).
669
- */
670
- interface VectorGeomRef {
671
- nodeId: string;
672
- /** The anchor's `id` (see `VectorAnchor.id`). */
673
- anchor?: string;
674
- /** With `anchor`: the handle instead of the anchor point. */
675
- handle?: 'in' | 'out';
676
- /** With `anchor`: the segment from it to the next anchor. */
677
- segment?: boolean;
678
- /** Without `anchor`: the path as a circle. */
679
- circle?: boolean;
680
- }
681
- /** A constraint kept by the document and solved after every edit. */
682
- interface VectorConstraint {
683
- id: string;
684
- kind: VectorConstraintKind;
685
- refs: VectorGeomRef[];
686
- /** Dimensional constraints: the value as an expression (document units, degrees for angles), e.g. `"40"` or `"w / 2"`. */
687
- value?: string;
688
- /** Dimensional constraints: a name other expressions can use (`d1`, `ang2`). */
689
- name?: string;
690
- /** `distance`: measured along the line between (default), or only horizontally or vertically. */
691
- axis?: 'aligned' | 'horizontal' | 'vertical';
692
- }
693
- /** A named value constraints' expressions can use. */
694
- interface VectorParameter {
695
- name: string;
696
- /** An expression (numbers, other names, `+ - * /`, parentheses, `pi`). */
697
- value: string;
698
- description?: string;
699
- }
700
- /** An axis-aligned rectangle. */
701
- interface VectorBounds {
702
- x: number;
703
- y: number;
704
- width: number;
705
- height: number;
706
- }
707
- /** Identifies one anchor of a path node. */
708
- interface VectorAnchorRef {
709
- nodeId: string;
710
- subpath: number;
711
- index: number;
712
- }
713
- /** Identifies one handle of an anchor. */
714
- interface VectorHandleRef extends VectorAnchorRef {
715
- handle: 'in' | 'out';
716
- }
717
- /**
718
- * Canvas tools. `direct` edits anchors, handles and segments; the shape tools drag out a new
719
- * shape; `scissors` cuts a path at a point, `knife` cuts filled shapes along a freehand stroke,
720
- * `eraser` rubs out the area under one and `width` drags a stroke's width at a point.
721
- * `shapeBuilder` merges (Alt: deletes) the faces the selected shapes make, and `paintBucket`
722
- * fills the region the visible outlines enclose around a click with a new shape. `blend`
723
- * blends the shape clicked first into the one clicked next (clicking an anchor of a closed path
724
- * starts the blend there). `envelope` edits the mesh of the selection's envelope: drag its
725
- * anchors and handles, or inside a patch to pull the surface. `type` adds point text (click) or
726
- * area text (drag) and edits text it clicks; `typePath` sets text along the path it clicks. `frame`
727
- * drags out a frame (`VectorGroupNode.frame`), taking in the top-level objects it fully encloses.
728
- * `connector` drags a connector between objects, gluing each end to the side it starts or ends on.
729
- */
730
- type VectorTool = 'select' | 'direct' | 'pen' | 'pencil' | 'rect' | 'ellipse' | 'polygon' | 'star' | 'line' | 'scissors' | 'knife' | 'eraser' | 'width' | 'shapeBuilder' | 'paintBucket' | 'blend' | 'gradient' | 'envelope' | 'type' | 'typePath' | 'frame' | 'connector';
731
- declare const VECTOR_TOOLS: readonly VectorTool[];
732
- /** Keyboard modifiers held during a pointer event. */
733
- interface VectorModifiers {
734
- shift?: boolean;
735
- alt?: boolean;
736
- /** Cmd on macOS, Ctrl elsewhere. */
737
- mod?: boolean;
738
- }
739
- /** The eight resize handles of a selection box and the rotation handle. */
740
- type VectorTransformHandle = 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'rotate';
741
- declare const VECTOR_TRANSFORM_HANDLES: readonly VectorTransformHandle[];
742
- /** Pan and zoom of the canvas: `screen = document × zoom + (x, y)`. */
743
- interface VectorViewport {
744
- /** Screen position of the document origin, in screen pixels. */
745
- x: number;
746
- y: number;
747
- zoom: number;
748
- }
749
- /** What the next shape and pen path are drawn with. */
750
- interface VectorDefaults extends VectorStyle {
751
- /** Sides of the polygon tool (default 6). */
752
- polygonSides?: number;
753
- /** Points of the star tool (default 5). */
754
- starPoints?: number;
755
- /** Inner radius of the star tool as a fraction of the outer one (default 0.5). */
756
- starInnerRatio?: number;
757
- /** Live corner radius the rectangle, polygon and star tools give their corners (default 0). */
758
- cornerRadius?: number;
759
- /** Corner kind of those tools (default `round`). */
760
- cornerKind?: VectorCornerKind;
761
- }
762
- type VectorAlign = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
763
- type VectorDistribute = 'horizontal' | 'vertical';
764
- type VectorBooleanOperation = 'union' | 'subtract' | 'intersect' | 'exclude';
765
- /**
766
- * Pathfinder operations: `divide` (every face its own shape), `trim` (hidden parts removed),
767
- * `merge` (Trim, then touching parts of one fill joined), `crop` (the top shape crops the others),
768
- * `outline` (outlines cut into open strokes where they meet) and `minusBack` (the top shape minus
769
- * everything below it).
770
- */
771
- type VectorPathfinderOperation = 'divide' | 'trim' | 'merge' | 'crop' | 'outline' | 'minusBack';
772
- declare const VECTOR_PATHFINDER_OPERATIONS: readonly VectorPathfinderOperation[];
773
- type VectorArrange = 'front' | 'forward' | 'backward' | 'back';
774
- /** Average: line anchors up on a horizontal line (same y), a vertical one (same x), or both. */
775
- type VectorAverageAxis = 'horizontal' | 'vertical' | 'both';
776
- /**
777
- * Live path effects (After Effects' path operators): `trim` (Trim Paths), `roundCorners`,
778
- * `puckerBloat`, `twist`, `zigzag`, `wiggle` (Wiggle Paths), `offset` (Offset Paths), `merge`
779
- * (Merge Paths), `repeater`, `envelope` (an envelope distortion: a warp preset or a mesh),
780
- * `contour` (CorelDRAW's Contour: concentric offset steps blending toward end colours) and
781
- * `blockShadow` (CorelDRAW's Block Shadow: the shape swept along a direction, under it).
782
- */
783
- type VectorEffectType = 'trim' | 'roundCorners' | 'puckerBloat' | 'twist' | 'zigzag' | 'wiggle' | 'offset' | 'merge' | 'repeater' | 'envelope' | 'contour' | 'blockShadow';
784
- declare const VECTOR_EFFECT_TYPES: readonly VectorEffectType[];
785
- /** Warp presets (Photoshop's fifteen, in menu order); shared with the image editor (`src/geom`). */
786
- type VectorWarpStyle = WarpStyle;
787
- /**
788
- * A grid of bicubic Bézier patches mapping a source box onto the plane. `us` / `vs` are the patch
789
- * boundaries as fractions of the box (increasing, first 0, last 1); `points` is the
790
- * `(3·(us.length − 1) + 1) × (3·(vs.length − 1) + 1)` control grid, row by row, in the node's own
791
- * space. Neighbouring patches share their edge row: anchors sit where both indices are multiples
792
- * of 3, handles where one is. Shared with the image editor (`src/geom`).
793
- */
794
- type VectorWarpMesh = WarpMesh;
795
- /** Merge Paths modes: a compound path (no boolean), union, the first minus the others, intersection or exclusion. */
796
- type VectorMergeMode = 'merge' | 'add' | 'subtract' | 'intersect' | 'exclude';
797
- declare const VECTOR_MERGE_MODES: readonly VectorMergeMode[];
798
- /** Parameters of each effect type. Lengths are in the node's own units, angles in degrees, percentages 0–100. */
799
- interface VectorEffectParamsMap {
800
- trim: {
801
- /** Start and end of the kept part, percent of the length (swapped when start > end). */
802
- start: number;
803
- end: number;
804
- /** Shifts both, in degrees (360° = once round). */
805
- offset: number;
806
- /**
807
- * `simultaneous`: every path trimmed by the same fractions of its own length;
808
- * `individual`: the paths laid end to end in stacking order and trimmed as one length.
809
- */
810
- mode: 'simultaneous' | 'individual';
811
- };
812
- roundCorners: {
813
- radius: number;
814
- };
815
- /** Percent, −100 (pucker: spiky) to 100 (bloat: bulging). */
816
- puckerBloat: {
817
- amount: number;
818
- };
819
- twist: {
820
- /** Turn at the farthest point from the centre (none at the centre). */
821
- angle: number;
822
- /** The centre as an offset from the middle of the paths' bounds. */
823
- center: Vec2;
824
- };
825
- zigzag: {
826
- /** How far the points move to either side. */
827
- size: number;
828
- /** Ridges per segment. */
829
- ridges: number;
830
- /** Rounded waves instead of sharp zig zags. */
831
- smooth: boolean;
832
- };
833
- wiggle: {
834
- /** Largest displacement. */
835
- size: number;
836
- /** Points added per segment. */
837
- detail: number;
838
- smooth: boolean;
839
- /** Wiggles per second. */
840
- speed: number;
841
- /** Percent: how much neighbouring points move together. */
842
- correlation: number;
843
- /** Degrees (360° = one wiggle). */
844
- phase: number;
845
- /** The same seed (and time) always gives the same wiggle. */
846
- seed: number;
847
- /** Seconds: where along the wiggle's motion it is drawn. */
848
- time: number;
849
- };
850
- offset: {
851
- /** Grows (positive) or shrinks (negative) the shapes. */
852
- amount: number;
853
- join: VectorLineJoin;
854
- miterLimit: number;
855
- /** Copies, copy i offset by `amount · (i + 1 + copyOffset)`. */
856
- copies: number;
857
- copyOffset: number;
858
- };
859
- merge: {
860
- mode: VectorMergeMode;
861
- };
862
- repeater: {
863
- /** Copies, the original included; a fraction fades the last copy. */
864
- copies: number;
865
- /** Shifts the copies along: copy i is transformed `i + offset` times. */
866
- offset: number;
867
- /** Each step: move, about `anchor` turn by `rotation` and scale by `scale` percent. */
868
- position: Vec2;
869
- /** Offset from the middle of the paths' bounds. */
870
- anchor: Vec2;
871
- rotation: number;
872
- scale: Vec2;
873
- /** Percent opacity of the first and last copies (in between interpolated). */
874
- startOpacity: number;
875
- endOpacity: number;
876
- /** `below`: each copy draws under the one before it; `above`: over it. */
877
- composite: 'below' | 'above';
878
- };
879
- /**
880
- * Contour: concentric copies of each shape offset `offset` apart, `steps` of them `inside`,
881
- * `outside`, or `center` (inside until the shape is used up), their fill and stroke blending
882
- * from the shape's own colours to `fillColor` / `strokeColor` (null keeps the colour).
883
- * `acceleration` (−100…100) bunches the colour change toward the end (positive) or start.
884
- */
885
- contour: {
886
- direction: 'inside' | 'outside' | 'center';
887
- steps: number;
888
- offset: number;
889
- join: VectorLineJoin;
890
- miterLimit: number;
891
- fillColor: string | null;
892
- strokeColor: string | null;
893
- acceleration: number;
894
- };
895
- /**
896
- * Block shadow (CorelDRAW's Block Shadow; a long shadow when it fades): each shape swept
897
- * `distance` along `angle` (degrees, 0 right, 90 down, in the node's own space) as one solid
898
- * shape under the art, in `color` (null: the shape's own solid fill) at `opacity` percent,
899
- * fading to `endOpacity` percent at the far end.
900
- */
901
- blockShadow: {
902
- angle: number;
903
- distance: number;
904
- color: string | null;
905
- opacity: number;
906
- endOpacity: number;
907
- };
908
- /**
909
- * Envelope distortion: the paths above it are mapped from their combined bounds through a warp
910
- * preset (bend and horizontal / vertical distortion in percent) or, with style `mesh`, through
911
- * `mesh` (null: the flat mesh of `columns × rows` patches over the bounds). The bounds are
912
- * taken afresh each time, so editing the contents keeps the envelope.
913
- */
914
- envelope: {
915
- style: VectorWarpStyle | 'mesh';
916
- bend: number;
917
- horizontal: number;
918
- vertical: number;
919
- orientation: 'horizontal' | 'vertical';
920
- /** Patches of the mesh (a preset turns into a mesh of this size when it is edited). */
921
- rows: number;
922
- columns: number;
923
- mesh: VectorWarpMesh | null;
924
- };
925
- }
926
- /** One entry of an effect stack. */
927
- type VectorEffect = {
928
- [K in VectorEffectType]: {
929
- /** Unique within the node. */
930
- id: string;
931
- type: K;
932
- /** Disabled effects are skipped. Default true. */
933
- enabled?: boolean;
934
- params: VectorEffectParamsMap[K];
935
- };
936
- }[VectorEffectType];
937
- /** Identifies one segment of a path node: from anchor `segment` to the next. */
938
- interface VectorSegmentRef {
939
- nodeId: string;
940
- subpath: number;
941
- segment: number;
942
- }
943
- /**
944
- * Visual filters: `dropShadow` (the node's silhouette, offset and blurred, under it),
945
- * `innerShadow` (a shadow cast inside the edges), `outerGlow` / `innerGlow` (an unoffset glow
946
- * outside or inside the edges), `layerBlur` (the whole node blurred) and `feather` (edges faded
947
- * to transparent).
948
- */
949
- type VectorFilterType = 'dropShadow' | 'innerShadow' | 'outerGlow' | 'innerGlow' | 'layerBlur' | 'feather';
950
- declare const VECTOR_FILTER_TYPES: readonly VectorFilterType[];
951
- /** A shadow or glow: colour, offset, blur and spread in the node's own units. */
952
- interface VectorShadowParams {
953
- color: string;
954
- /** 0–1: multiplies the colour's own alpha. */
955
- opacity: number;
956
- /** Blur radius (the SVG / CSS standard deviation is half of it). */
957
- blur: number;
958
- /** Grows the silhouette before blurring (inner effects: chokes it inwards). */
959
- spread: number;
960
- }
961
- /** Parameters of each filter type. Lengths are in the node's own units. */
962
- interface VectorFilterParamsMap {
963
- dropShadow: VectorShadowParams & {
964
- offsetX: number;
965
- offsetY: number;
966
- };
967
- innerShadow: VectorShadowParams & {
968
- offsetX: number;
969
- offsetY: number;
970
- };
971
- outerGlow: VectorShadowParams;
972
- innerGlow: VectorShadowParams;
973
- layerBlur: {
974
- radius: number;
975
- };
976
- /** Fades the edges over `radius` inwards. */
977
- feather: {
978
- radius: number;
979
- };
980
- }
981
- /** One entry of a node's filter stack. */
982
- type VectorFilter = {
983
- [K in VectorFilterType]: {
984
- /** Unique within the node. */
985
- id: string;
986
- type: K;
987
- /** Disabled filters are skipped. Default true. */
988
- enabled?: boolean;
989
- params: VectorFilterParamsMap[K];
990
- };
991
- }[VectorFilterType];
992
-
993
- export { type VectorAlign as $, type VectorTextNode as A, type VectorAnchorType as B, type VectorCornerKind as C, type VectorViewport as D, type VectorConnectorRoute as E, type VectorConnectorSide as F, type VectorConnectorEnd as G, type VectorConnector as H, type VectorConstraintKind as I, type VectorConstraint as J, type VectorCharacterStyle as K, type VectorTextRun as L, type VectorParagraphStyle as M, type VectorTextFrame as N, type VectorTransformHandle as O, type VectorAnchorRef as P, type VectorPathfinderOperation as Q, type VectorTool as R, type VectorDefaults as S, type VectorTextAlign as T, type VectorStyle as U, type VectorDocument as V, type VectorHandleRef as W, type VectorSegmentRef as X, type VectorBlendOptions as Y, type VectorModifiers as Z, type VectorBlendMode as _, type VectorEffectType as a, type VectorDistribute as a0, type VectorArrange as a1, type VectorMaskType as a2, type VectorSymmetryMode as a3, type VectorSymmetry as a4, type VectorFreeformPoint as a5, type VectorMeshGradient as a6, type VectorFreeformGradient as a7, type VectorArrowhead as a8, type VectorResizing as a9, VECTOR_FILTER_TYPES as aA, VECTOR_GRADIENT_INTERPOLATIONS as aB, VECTOR_GRADIENT_SPREADS as aC, VECTOR_GRADIENT_TYPES as aD, VECTOR_HORIZONTAL_RESIZING as aE, VECTOR_MASK_TYPES as aF, VECTOR_MERGE_MODES as aG, VECTOR_PATHFINDER_OPERATIONS as aH, VECTOR_PATH_TEXT_BASELINES as aI, VECTOR_STROKE_GRADIENT_MODES as aJ, VECTOR_SYMMETRY_MODES as aK, VECTOR_TEXT_ALIGNS as aL, VECTOR_TOOLS as aM, VECTOR_TRANSFORM_HANDLES as aN, VECTOR_VERTICAL_RESIZING as aO, type VectorCorner as aP, type VectorGeomRef as aQ, type VectorLineCap as aR, type VectorPathTextBaseline as aS, type VectorStrokeLayerKind as aT, type VectorTextRunStyle as aU, type VectorWarpStyle as aV, type VectorFrame as aa, type VectorHorizontalResizing as ab, type VectorVerticalResizing as ac, type VectorMask as ad, type VectorAverageAxis as ae, type VectorSymbol as af, type VectorParameter as ag, type VectorBlendSpacing as ah, type VectorGradientInterpolation as ai, type VectorStrokeGradientMode as aj, type VectorArrowAlign as ak, type VectorPaintLayer as al, type VectorStrokeLayer as am, type VectorBlend as an, type VectorMergeMode as ao, type VectorLineJoin as ap, type VectorStrokeSettings as aq, type VectorInstanceOverrides as ar, VECTOR_ARROWHEADS as as, VECTOR_BLEND_MODES as at, VECTOR_BLEND_SPACINGS as au, VECTOR_CONNECTOR_ROUTES as av, VECTOR_CONNECTOR_SIDES as aw, VECTOR_CONSTRAINT_KINDS as ax, VECTOR_CORNER_KINDS as ay, VECTOR_EFFECT_TYPES as az, type VectorEffectParamsMap as b, type VectorPathNode as c, type VectorFillRule as d, type VectorBooleanOperation as e, type VectorNode as f, type VectorEffect as g, type VectorGroupNode as h, type VectorBounds as i, type VectorWarpMesh as j, type VectorInstanceNode as k, type VectorFilterType as l, type VectorFilterParamsMap as m, type VectorFilter as n, type VectorGradient as o, type Vec2 as p, type VectorGradientUnits as q, type VectorGradientSpread as r, type VectorGradientType as s, type VectorPaint as t, type VectorMatrix as u, type VectorGradientStop as v, type VectorStrokeAlign as w, type VectorSubpath as x, type VectorWidthPoint as y, type VectorAnchor as z };