@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.
- package/dist/agent/index.cjs +3 -3
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.js +3 -3
- package/dist/animation-editor/index.cjs +424 -85
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +174 -7
- package/dist/animation-editor/index.d.ts +174 -7
- package/dist/animation-editor/index.js +348 -9
- package/dist/animation-editor/index.js.map +1 -1
- package/dist/chunk-FJ3324TZ.js +59 -0
- package/dist/chunk-FJ3324TZ.js.map +1 -0
- package/dist/{chunk-5EO2IXQE.js → chunk-FPRIUR4T.js} +1 -1
- package/dist/chunk-FPRIUR4T.js.map +1 -0
- package/dist/{chunk-YVVSTD3B.js → chunk-G6WXWS4Y.js} +9 -18
- package/dist/chunk-G6WXWS4Y.js.map +1 -0
- package/dist/{chunk-NGYD3AMN.js → chunk-MPQAO33O.js} +2 -2
- package/dist/{chunk-PEHYWUVV.cjs → chunk-O5RVCDEC.cjs} +82 -82
- package/dist/{chunk-PEHYWUVV.cjs.map → chunk-O5RVCDEC.cjs.map} +1 -1
- package/dist/{chunk-TK53AB4Q.cjs → chunk-QDJKUBWE.cjs} +3 -3
- package/dist/{chunk-TK53AB4Q.cjs.map → chunk-QDJKUBWE.cjs.map} +1 -1
- package/dist/{chunk-5XXMLBH4.cjs → chunk-QQKTOA4U.cjs} +1 -1
- package/dist/chunk-QQKTOA4U.cjs.map +1 -0
- package/dist/{chunk-IWSMDQE5.cjs → chunk-UXFI3CDZ.cjs} +13 -22
- package/dist/chunk-UXFI3CDZ.cjs.map +1 -0
- package/dist/{chunk-WE25VLCO.cjs → chunk-V5YGPRCZ.cjs} +36 -36
- package/dist/{chunk-WE25VLCO.cjs.map → chunk-V5YGPRCZ.cjs.map} +1 -1
- package/dist/chunk-W6QTLHZ3.cjs +59 -0
- package/dist/chunk-W6QTLHZ3.cjs.map +1 -0
- package/dist/{chunk-WATAQ2Z2.js → chunk-WUDPFWAN.js} +2 -2
- package/dist/{chunk-VFAKN46Z.js → chunk-XZWOLXWA.js} +3 -3
- package/dist/{chunk-VFAKN46Z.js.map → chunk-XZWOLXWA.js.map} +1 -1
- package/dist/effects/index.cjs +51 -6
- package/dist/effects/index.cjs.map +1 -1
- package/dist/effects/index.d.cts +39 -8
- package/dist/effects/index.d.ts +39 -8
- package/dist/effects/index.js +48 -3
- package/dist/effects/index.js.map +1 -1
- package/dist/{export-TqXMOlDt.d.cts → export-Bp7ji2r4.d.cts} +4 -3
- package/dist/{export-BzSRXyH6.d.cts → export-C1s4eolZ.d.ts} +5 -3
- package/dist/{export-8RnlngAv.d.ts → export-DAyPY94f.d.ts} +4 -3
- package/dist/{export-DM3h7QEI.d.ts → export-DVl4fWy5.d.cts} +5 -3
- package/dist/generation/index.cjs +3 -3
- package/dist/generation/index.cjs.map +1 -1
- package/dist/generation/index.js +3 -3
- package/dist/helpers-BBLlekuM.d.ts +2009 -0
- package/dist/helpers-i95Ob6Vi.d.cts +2009 -0
- package/dist/image-editor/index.cjs +712 -721
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +5 -7
- package/dist/image-editor/index.d.ts +5 -7
- package/dist/image-editor/index.js +19 -28
- package/dist/image-editor/index.js.map +1 -1
- package/dist/paint-editor/index.cjs +12 -11
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +3 -5
- package/dist/paint-editor/index.d.ts +3 -5
- package/dist/paint-editor/index.js +6 -5
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/{svg-BDrjRnL1.d.cts → svg-BkRL-fZJ.d.cts} +1 -1
- package/dist/{svg-C-vZ3q50.d.ts → svg-DJKriJ4A.d.ts} +1 -1
- package/dist/tools/index.cjs +2 -2
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.js +3 -3
- package/dist/{tools-C7JtLYzo.d.ts → tools-CM8Oe8F3.d.ts} +1 -1
- package/dist/{tools-DHKGHiSK.d.cts → tools-DZCv2kX1.d.cts} +1 -1
- package/dist/vector/index.cjs +1032 -883
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +61 -6
- package/dist/vector/index.d.ts +61 -6
- package/dist/vector/index.js +155 -6
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.cjs +271 -270
- package/dist/video-editor/index.cjs.map +1 -1
- package/dist/video-editor/index.d.cts +4 -6
- package/dist/video-editor/index.d.ts +4 -6
- package/dist/video-editor/index.js +6 -5
- package/dist/video-editor/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-animation-editor/SKILL.md +24 -1
- package/skills/pixerate-vector/SKILL.md +15 -0
- package/dist/chunk-5EO2IXQE.js.map +0 -1
- package/dist/chunk-5XXMLBH4.cjs.map +0 -1
- package/dist/chunk-IWSMDQE5.cjs.map +0 -1
- package/dist/chunk-YVVSTD3B.js.map +0 -1
- package/dist/flair-CxB3fOcU.d.ts +0 -739
- package/dist/flair-D7BxyBwL.d.cts +0 -739
- package/dist/helpers-777mC6dc.d.cts +0 -253
- package/dist/helpers-DX2_7L5t.d.ts +0 -253
- package/dist/types-BcX7sCsn.d.ts +0 -993
- package/dist/types-CznabG7m.d.cts +0 -993
- /package/dist/{chunk-NGYD3AMN.js.map → chunk-MPQAO33O.js.map} +0 -0
- /package/dist/{chunk-WATAQ2Z2.js.map → chunk-WUDPFWAN.js.map} +0 -0
|
@@ -0,0 +1,2009 @@
|
|
|
1
|
+
import { J as JsonSchema, S as SchemaValidationError } from './schema-Di0CS6Pe.js';
|
|
2
|
+
import { a as MotionBehavior } from './behavior-Ymbld6jL.js';
|
|
3
|
+
import { b as AnimationEasing } from './easing-lM0Xo9Ni.js';
|
|
4
|
+
import { b as AnimationLoopMode } from './evaluate-CfmT6xA3.js';
|
|
5
|
+
import { C as CanvasGradientDef } from './gradient-KDfCvhuj.js';
|
|
6
|
+
import { W as WarpStyle, a as WarpMesh } from './types-CwMPoRMU.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Export to Flair (`@pixerate/flair`): a scene becomes an `SvgMotion` (one SVG plus a list of
|
|
10
|
+
* from → to changes on its elements), a catalog `VectorEffect`, or an `EffectDocument` for
|
|
11
|
+
* Flair's effect editor. The types are mirrored here so this package does not depend on Flair.
|
|
12
|
+
*
|
|
13
|
+
* Changes are exact where Flair can express them: a change with a linear, cubic-out or
|
|
14
|
+
* cubic-in-out curve (the editor's defaults) is one change, and so (Flair 0.36 and later) is
|
|
15
|
+
* one with any cubic-bezier curve, written as `[x1, y1, x2, y2]`. Anything else (springs,
|
|
16
|
+
* elastic, `hold`, morphs and live-effect tweens) is sampled at the
|
|
17
|
+
* scene's `fps` into short linear changes, which Flair plays the same way. Pulses, shakes,
|
|
18
|
+
* teeters, waves, wiggles and colour pulses are one change with a `behavior` (Flair 0.38).
|
|
19
|
+
*
|
|
20
|
+
* Reveals (`wipe`, `iris`, `split`) wrap their node in a group clipped through a rect or circle
|
|
21
|
+
* in the group's own box units (`clipPathUnits="objectBoundingBox"`), as Flair's
|
|
22
|
+
* `entrance.wipe` does, and animate the shape's attributes. A follow wraps its node in a group
|
|
23
|
+
* that Flair's `along` carries along a copy of the path in the node's parent's units (written
|
|
24
|
+
* in `<defs>`, so the path may be hidden or anywhere), turning with it for `orient`, as
|
|
25
|
+
* Flair's `path.follow` does.
|
|
26
|
+
*/
|
|
27
|
+
/** Flair's easing names. */
|
|
28
|
+
type FlairEaseName = 'linear' | 'in-out' | 'out';
|
|
29
|
+
/** Flair's spring ease (Flair 0.39 and later): the editor's spring, number for number. */
|
|
30
|
+
interface FlairSpringEase {
|
|
31
|
+
spring: {
|
|
32
|
+
mass?: number;
|
|
33
|
+
stiffness?: number;
|
|
34
|
+
damping?: number;
|
|
35
|
+
velocity?: number;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** A Flair easing: a name, (Flair 0.36 and later) a CSS cubic-bezier `[x1, y1, x2, y2]`, or (0.39) a spring. */
|
|
39
|
+
type FlairEase = FlairEaseName | readonly [number, number, number, number] | FlairSpringEase;
|
|
40
|
+
/** Flair's curves, for matching. */
|
|
41
|
+
declare const FLAIR_EASES: Readonly<Record<FlairEaseName, (t: number) => number>>;
|
|
42
|
+
/** One change of a Flair `SvgMotion` (mirrors `SvgAnimation` in `@pixerate/flair/vector`). */
|
|
43
|
+
interface FlairSvgAnimation {
|
|
44
|
+
id?: string;
|
|
45
|
+
step?: number;
|
|
46
|
+
delay?: number;
|
|
47
|
+
ms?: number;
|
|
48
|
+
ease?: FlairEase;
|
|
49
|
+
attrs?: Record<string, readonly [string | number, string | number]>;
|
|
50
|
+
draw?: boolean | readonly [number, number];
|
|
51
|
+
/** Moves the element along a path (by id), from and to the fractions of its length in `at`. */
|
|
52
|
+
along?: string;
|
|
53
|
+
at?: readonly [number, number];
|
|
54
|
+
/** With `along`: turns the element with the path's direction. */
|
|
55
|
+
orient?: boolean;
|
|
56
|
+
/** Flair 0.38 and later: how the change swings from → to (see `MotionBehavior`). */
|
|
57
|
+
behavior?: MotionBehavior;
|
|
58
|
+
/** Flair 0.39 and later: stepped time, held on a grid of this many frames per second. */
|
|
59
|
+
strobe?: number;
|
|
60
|
+
/** Flair 0.39 and later: whole cycles to play (default 1); with `alternate`, every other one backwards. */
|
|
61
|
+
repeat?: number;
|
|
62
|
+
alternate?: boolean;
|
|
63
|
+
/** Flair features scenes do not have (imports skip them with a note). */
|
|
64
|
+
count?: readonly [number, number];
|
|
65
|
+
/** With `count`: how the number is written (Flair's number format) and to how many decimals. */
|
|
66
|
+
format?: string;
|
|
67
|
+
decimals?: number;
|
|
68
|
+
write?: string;
|
|
69
|
+
/** With `write`: the caret drawn while typing. */
|
|
70
|
+
caret?: string;
|
|
71
|
+
/** Flair's label for the change, e.g. `entrance.fade@logo`; motion primitives set it to find their changes again. */
|
|
72
|
+
tag?: string;
|
|
73
|
+
scramble?: string;
|
|
74
|
+
solo?: number;
|
|
75
|
+
view?: readonly [number, number, number, number] | string;
|
|
76
|
+
}
|
|
77
|
+
/** Mirrors `SvgMotion` in `@pixerate/flair/vector`. */
|
|
78
|
+
interface FlairSvgMotion {
|
|
79
|
+
svg: string;
|
|
80
|
+
animate?: FlairSvgAnimation[];
|
|
81
|
+
}
|
|
82
|
+
/** Mirrors Flair's catalog `VectorEffect` (`@pixerate/flair/catalog`). */
|
|
83
|
+
interface FlairVectorEffect {
|
|
84
|
+
kind: 'vector';
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
description: string;
|
|
88
|
+
category: string;
|
|
89
|
+
tags: string[];
|
|
90
|
+
motion: FlairSvgMotion;
|
|
91
|
+
/** Values are `#rrggbb` strings, or `[r, g, b]` channels from 0 to 1 (Flair's catalog writes both); imports turn them into hex. */
|
|
92
|
+
presets?: {
|
|
93
|
+
name: string;
|
|
94
|
+
values: Record<string, string | readonly number[]>;
|
|
95
|
+
}[];
|
|
96
|
+
/** Ms on the last frame before looping. */
|
|
97
|
+
hold?: number;
|
|
98
|
+
trigger?: 'hover' | 'press' | 'click' | 'scroll';
|
|
99
|
+
}
|
|
100
|
+
/** Mirrors Flair's `EffectDocument` (`@pixerate/flair/editor`) for a vector effect. */
|
|
101
|
+
interface FlairEffectDocument {
|
|
102
|
+
version: 1;
|
|
103
|
+
name: string;
|
|
104
|
+
effect: {
|
|
105
|
+
kind: 'vector';
|
|
106
|
+
motion: FlairSvgMotion;
|
|
107
|
+
hold?: number;
|
|
108
|
+
};
|
|
109
|
+
values: Record<string, string>;
|
|
110
|
+
tracks: Record<string, never>;
|
|
111
|
+
duration: number;
|
|
112
|
+
loop: boolean;
|
|
113
|
+
presets: {
|
|
114
|
+
name: string;
|
|
115
|
+
values: Record<string, string>;
|
|
116
|
+
}[];
|
|
117
|
+
}
|
|
118
|
+
interface FlairMotionExport {
|
|
119
|
+
motion: FlairSvgMotion;
|
|
120
|
+
/** The scene's length (ms). */
|
|
121
|
+
duration: number;
|
|
122
|
+
/** Ms after the last change (Flair's `hold`). */
|
|
123
|
+
hold: number;
|
|
124
|
+
/** Changes sampled into linear steps. */
|
|
125
|
+
sampled: number;
|
|
126
|
+
/** What could not be carried over, in sentences. */
|
|
127
|
+
notes: string[];
|
|
128
|
+
/** How the viewer plays it: pass to Flair's `SvgPlayer` as `{ trigger }` (from the scene's `trigger`). */
|
|
129
|
+
trigger?: MotionTrigger;
|
|
130
|
+
}
|
|
131
|
+
interface FlairExportOptions {
|
|
132
|
+
/**
|
|
133
|
+
* Play in answer to the viewer (default: the scene's `trigger`; null for none). With `click`
|
|
134
|
+
* shot n is Flair step n + 1: nothing plays until the first click, and each click plays the next shot.
|
|
135
|
+
*/
|
|
136
|
+
trigger?: MotionTrigger | null;
|
|
137
|
+
/** Sampling rate for changes Flair cannot express exactly (default: the scene's `fps`, else 30). */
|
|
138
|
+
fps?: number;
|
|
139
|
+
/** Decimal places (default 3). */
|
|
140
|
+
precision?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Write cubic-bezier easings (the `ease`, `ease-in`, `ease-out`, `ease-in-out`, `ease-in-back`
|
|
143
|
+
* and `ease-out-back` presets, and `{ type: 'cubic-bezier' }` curves) as one change with
|
|
144
|
+
* `ease: [x1, y1, x2, y2]` (default true). Needs Flair 0.36 or later; set false for older
|
|
145
|
+
* Flair, and they are sampled into linear steps.
|
|
146
|
+
*/
|
|
147
|
+
curves?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Write pulses, shakes, teeters, waves, wiggles and colour pulses as one change with a Flair
|
|
150
|
+
* `behavior` (default true), so they play exactly. Needs Flair 0.38 or later; set false for
|
|
151
|
+
* older Flair, and they are sampled into linear steps.
|
|
152
|
+
*/
|
|
153
|
+
behaviors?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* The Flair version the export is for (default `0.39`): it decides what is written exactly
|
|
156
|
+
* and what is sampled. 0.36 adds cubic-bezier curves, 0.38 behaviours, 0.39 springs and
|
|
157
|
+
* stepped time (`strobe`). `curves` and `behaviors` override it.
|
|
158
|
+
*/
|
|
159
|
+
flair?: string;
|
|
160
|
+
}
|
|
161
|
+
/** The Flair version exports target by default. */
|
|
162
|
+
declare const FLAIR_EXPORT_VERSION = "0.39";
|
|
163
|
+
/** Whether Flair `version` is at least `min` (dotted numbers). */
|
|
164
|
+
declare function flairAtLeast(version: string, min: string): boolean;
|
|
165
|
+
/** The Flair easing that matches `ease` (within 1% everywhere), if any. */
|
|
166
|
+
declare function flairEaseFor(ease: AnimationEasing): FlairEaseName | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* The Flair easing for `ease`: a Flair name when one matches within 1%, else (with `curves`,
|
|
169
|
+
* the default) the curve's `[x1, y1, x2, y2]` when it is a cubic-bezier. Undefined for curves
|
|
170
|
+
* Flair cannot play (springs, elastic, `hold`), which are sampled.
|
|
171
|
+
*/
|
|
172
|
+
declare function flairCurveFor(ease: AnimationEasing, curves?: boolean): FlairEase | undefined;
|
|
173
|
+
/** A scene as a Flair `SvgMotion`. */
|
|
174
|
+
declare function toFlairSvgMotion(scene: MotionScene, options?: FlairExportOptions): FlairMotionExport;
|
|
175
|
+
interface FlairEffectOptions extends FlairExportOptions {
|
|
176
|
+
/** Kebab-case id (default: the scene's name). */
|
|
177
|
+
id?: string;
|
|
178
|
+
name?: string;
|
|
179
|
+
description?: string;
|
|
180
|
+
/** Flair catalog category (default `icon`). */
|
|
181
|
+
category?: string;
|
|
182
|
+
tags?: string[];
|
|
183
|
+
}
|
|
184
|
+
/** A scene as a Flair catalog vector effect, with its colour controls and presets. */
|
|
185
|
+
declare function toFlairVectorEffect(scene: MotionScene, options?: FlairEffectOptions): FlairVectorEffect;
|
|
186
|
+
/** A scene as a document for Flair's `EffectEditor` (`replaceDocument`). */
|
|
187
|
+
declare function toFlairEffectDocument(scene: MotionScene, options?: FlairExportOptions): FlairEffectDocument;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The effects contract: how an editor finds, describes and renders effects that live in another
|
|
191
|
+
* package. This library ships no effects of its own here, only the shapes a provider fills in;
|
|
192
|
+
* a host passes a provider to an editor (`setEffectsProvider`) and the editor degrades to its
|
|
193
|
+
* old behaviour without one.
|
|
194
|
+
*
|
|
195
|
+
* Every time is in milliseconds. Pixels are straight-alpha RGBA rows, top to bottom.
|
|
196
|
+
*/
|
|
197
|
+
|
|
198
|
+
/** How an effect is drawn: a pixel shader, an animated vector picture, or motion applied to someone else's vector art. */
|
|
199
|
+
type EffectKind = 'shader' | 'vector' | 'motion';
|
|
200
|
+
/**
|
|
201
|
+
* What an effect is for. An effect may have several uses.
|
|
202
|
+
*
|
|
203
|
+
* - `filter`: changes an input picture (`inputs.source`).
|
|
204
|
+
* - `transition`: blends `inputs.from` into `inputs.to`; `progress` runs 0 → 1.
|
|
205
|
+
* - `generator`: draws a picture from nothing (a background, a texture).
|
|
206
|
+
* - `overlay`: draws something meant to sit over other content, usually with transparency.
|
|
207
|
+
* - `title`: draws type or a graphic meant as a title.
|
|
208
|
+
* - `motion`: animates vector art (`applyVectorEffect`).
|
|
209
|
+
* - `interactive`: reacts to pointer, scroll or audio input at run time.
|
|
210
|
+
*/
|
|
211
|
+
type EffectUse = 'filter' | 'transition' | 'generator' | 'overlay' | 'title' | 'motion' | 'interactive';
|
|
212
|
+
declare const EFFECT_KINDS: readonly EffectKind[];
|
|
213
|
+
declare const EFFECT_USES: readonly EffectUse[];
|
|
214
|
+
/** One entry of a provider's catalog. */
|
|
215
|
+
interface EffectSummary {
|
|
216
|
+
/** Stable id, saved in documents. Never reused for a different effect. */
|
|
217
|
+
id: string;
|
|
218
|
+
name: string;
|
|
219
|
+
kind: EffectKind;
|
|
220
|
+
/** The provider's own grouping (e.g. `gradient`, `light`, `transition`). */
|
|
221
|
+
category: string;
|
|
222
|
+
uses: readonly EffectUse[];
|
|
223
|
+
description?: string;
|
|
224
|
+
tags?: readonly string[];
|
|
225
|
+
/** True when the effect's output has transparent pixels (it can sit over other content). */
|
|
226
|
+
transparent: boolean;
|
|
227
|
+
/** True when the effect loops; its `duration` is then one cycle. */
|
|
228
|
+
loop: boolean;
|
|
229
|
+
/** Length of one play (ms). Absent for effects that do not change over time. */
|
|
230
|
+
duration?: number;
|
|
231
|
+
}
|
|
232
|
+
interface EffectSearchOptions {
|
|
233
|
+
kind?: EffectKind;
|
|
234
|
+
category?: string;
|
|
235
|
+
use?: EffectUse;
|
|
236
|
+
/** Most results to return. */
|
|
237
|
+
limit?: number;
|
|
238
|
+
}
|
|
239
|
+
/** One control value: a number, a `#rrggbb` colour or other string, a switch, or a vector of numbers. */
|
|
240
|
+
type EffectValue = number | string | boolean | readonly number[];
|
|
241
|
+
type EffectValues = Readonly<Record<string, EffectValue>>;
|
|
242
|
+
/**
|
|
243
|
+
* The controls of an effect as a strict JSON Schema: `type: 'object'`, `additionalProperties:
|
|
244
|
+
* false`, and a `description` on every property (with units and range). `checkEffectProvider`
|
|
245
|
+
* checks this.
|
|
246
|
+
*/
|
|
247
|
+
type EffectControlSchema = JsonSchema & {
|
|
248
|
+
type: 'object';
|
|
249
|
+
properties: {
|
|
250
|
+
readonly [control: string]: JsonSchema;
|
|
251
|
+
};
|
|
252
|
+
additionalProperties: false;
|
|
253
|
+
};
|
|
254
|
+
interface EffectPreset {
|
|
255
|
+
name: string;
|
|
256
|
+
/** Values to apply over the defaults. */
|
|
257
|
+
values: EffectValues;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* A named input the effect reads. Filters read `source`, transitions `from` and `to`; a mask is
|
|
261
|
+
* passed separately (`EffectRenderRequest.mask`), not as an input.
|
|
262
|
+
*/
|
|
263
|
+
interface EffectInputSpec {
|
|
264
|
+
name: string;
|
|
265
|
+
kind: 'image' | 'audio';
|
|
266
|
+
description: string;
|
|
267
|
+
required: boolean;
|
|
268
|
+
}
|
|
269
|
+
/** Everything an editor needs to show an effect's controls and render it. */
|
|
270
|
+
interface EffectDescription extends EffectSummary {
|
|
271
|
+
controls: EffectControlSchema;
|
|
272
|
+
/** A value for every control. */
|
|
273
|
+
defaults: EffectValues;
|
|
274
|
+
presets: readonly EffectPreset[];
|
|
275
|
+
inputs: readonly EffectInputSpec[];
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Pixels in and out of a renderer, shaped like `ImageData`.
|
|
279
|
+
*
|
|
280
|
+
* `data` is 8-bit sRGB with straight alpha and is always present. `float`, when present, is the
|
|
281
|
+
* same picture as 32-bit floats in **linear light** (sRGB primaries), straight alpha, where colour
|
|
282
|
+
* may exceed 1. Renderers created with `depth` 16 or 32 return `float` when the provider
|
|
283
|
+
* `supportsFloat`; `data` is then its clamped sRGB encoding.
|
|
284
|
+
*/
|
|
285
|
+
interface EffectPixels {
|
|
286
|
+
width: number;
|
|
287
|
+
height: number;
|
|
288
|
+
data: Uint8ClampedArray;
|
|
289
|
+
float?: Float32Array;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* An input picture. Always accepted as `EffectPixels`; a provider whose capabilities include
|
|
293
|
+
* `supportsHostImages` also takes the host's own image objects, which saves a read back.
|
|
294
|
+
*/
|
|
295
|
+
type EffectImageSource = EffectPixels | ImageBitmap | OffscreenCanvas | VideoFrame;
|
|
296
|
+
interface EffectRendererOptions {
|
|
297
|
+
/** Output size in pixels. */
|
|
298
|
+
width: number;
|
|
299
|
+
height: number;
|
|
300
|
+
/** Bits per channel of the target (default 8). 16 and 32 ask for `float` output. */
|
|
301
|
+
depth?: 8 | 16 | 32;
|
|
302
|
+
}
|
|
303
|
+
interface EffectRenderRequest {
|
|
304
|
+
/** Effect time (ms), from the start of the effect. */
|
|
305
|
+
time: number;
|
|
306
|
+
/** Control values; missing controls take their defaults. Invalid values reject with `EffectControlError`. */
|
|
307
|
+
values?: EffectValues;
|
|
308
|
+
/** Pictures for the effect's named inputs (see `EffectDescription.inputs`). */
|
|
309
|
+
inputs?: Readonly<Record<string, EffectImageSource>>;
|
|
310
|
+
/** Coverage (alpha channel, 0 = untouched) limiting where the effect applies. Only with `supportsMask`. */
|
|
311
|
+
mask?: EffectImageSource;
|
|
312
|
+
/** Transitions: how far from `from` to `to`, 0–1. Defaults to `time / duration`. */
|
|
313
|
+
progress?: number;
|
|
314
|
+
}
|
|
315
|
+
/** A live renderer for one effect at one size. Not safe for concurrent `render` calls. */
|
|
316
|
+
interface EffectRenderer {
|
|
317
|
+
readonly effectId: string;
|
|
318
|
+
readonly width: number;
|
|
319
|
+
readonly height: number;
|
|
320
|
+
readonly depth: 8 | 16 | 32;
|
|
321
|
+
render(request: EffectRenderRequest): Promise<EffectPixels>;
|
|
322
|
+
/** Frees GPU or worker resources. Rendering afterwards rejects. */
|
|
323
|
+
dispose(): void;
|
|
324
|
+
}
|
|
325
|
+
/** One change of an animated SVG (the shape of Flair's `SvgAnimation`). */
|
|
326
|
+
type EffectSvgAnimation = FlairSvgAnimation;
|
|
327
|
+
/** An animated SVG: markup plus changes to its elements (the shape of Flair's `SvgMotion`). */
|
|
328
|
+
interface EffectVectorMotion {
|
|
329
|
+
svg: string;
|
|
330
|
+
animate?: readonly EffectSvgAnimation[];
|
|
331
|
+
/** Length of one play (ms). */
|
|
332
|
+
duration: number;
|
|
333
|
+
loop: boolean;
|
|
334
|
+
/** Ms held on the last frame before looping. */
|
|
335
|
+
hold?: number;
|
|
336
|
+
}
|
|
337
|
+
/** What a vector or motion effect is applied to: SVG markup, optionally with the ids of the elements to animate (default: all). */
|
|
338
|
+
type EffectVectorTarget = string | {
|
|
339
|
+
svg: string;
|
|
340
|
+
nodeIds?: readonly string[];
|
|
341
|
+
};
|
|
342
|
+
/** What a provider can do, so editors can degrade cleanly. */
|
|
343
|
+
interface EffectProviderCapabilities {
|
|
344
|
+
/** Renders off the main thread. */
|
|
345
|
+
supportsWorker: boolean;
|
|
346
|
+
/** Returns `float` pixels for depth 16 and 32 renderers. */
|
|
347
|
+
supportsFloat: boolean;
|
|
348
|
+
/** Honours `EffectRenderRequest.mask`; otherwise the editor masks the result itself. */
|
|
349
|
+
supportsMask: boolean;
|
|
350
|
+
/** Takes `ImageBitmap`, `OffscreenCanvas` or `VideoFrame` inputs, not only `EffectPixels`. */
|
|
351
|
+
supportsHostImages: boolean;
|
|
352
|
+
/** Implements `applyVectorEffect`. */
|
|
353
|
+
supportsVector: boolean;
|
|
354
|
+
/** Largest width or height a renderer accepts (px). */
|
|
355
|
+
maxSize?: number;
|
|
356
|
+
}
|
|
357
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
358
|
+
/**
|
|
359
|
+
* A source of effects. Implementations live outside this library (for example Flair's
|
|
360
|
+
* `flairEffects()`); `createFakeEffectProvider` is a small reference implementation.
|
|
361
|
+
*
|
|
362
|
+
* Unknown ids reject or throw `UnknownEffectError`, invalid values `EffectControlError`, and an
|
|
363
|
+
* operation the provider cannot do `EffectUnsupportedError`.
|
|
364
|
+
*/
|
|
365
|
+
interface EffectProvider {
|
|
366
|
+
/** Stable id of the provider, saved next to effect ids (e.g. `flair`). */
|
|
367
|
+
readonly id: string;
|
|
368
|
+
readonly name: string;
|
|
369
|
+
readonly version?: string;
|
|
370
|
+
readonly capabilities: EffectProviderCapabilities;
|
|
371
|
+
list(options?: EffectSearchOptions): MaybePromise<readonly EffectSummary[]>;
|
|
372
|
+
/** Effects matching every word of `query` (in name, id, category, tags or description), best first. */
|
|
373
|
+
search(query: string, options?: EffectSearchOptions): MaybePromise<readonly EffectSummary[]>;
|
|
374
|
+
describe(id: string): MaybePromise<EffectDescription>;
|
|
375
|
+
/** A pixel renderer. A `vector` effect may refuse with `EffectUnsupportedError` where it cannot lay out SVG (a Worker). */
|
|
376
|
+
createRenderer(id: string, options: EffectRendererOptions): MaybePromise<EffectRenderer>;
|
|
377
|
+
/**
|
|
378
|
+
* Vector and motion effects as an animated SVG. Present when `capabilities.supportsVector`. A
|
|
379
|
+
* `motion` effect animates the target's elements (`nodeIds`, else each top-level element with an
|
|
380
|
+
* id); a `vector` effect brings its own picture and ignores the target. Refuse a target the
|
|
381
|
+
* effect cannot use with `EffectUnsupportedError`.
|
|
382
|
+
*/
|
|
383
|
+
applyVectorEffect?(id: string, target: EffectVectorTarget, values?: EffectValues): MaybePromise<EffectVectorMotion>;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/** An affine matrix `[a, b, c, d, e, f]`: `x' = a·x + c·y + e`, `y' = b·x + d·y + f` (SVG order). */
|
|
387
|
+
type VectorMatrix = readonly [number, number, number, number, number, number];
|
|
388
|
+
/** A point in document coordinates. */
|
|
389
|
+
interface Vec2 {
|
|
390
|
+
x: number;
|
|
391
|
+
y: number;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* How an anchor's handles relate:
|
|
395
|
+
* - `corner`: handles move independently (or are absent).
|
|
396
|
+
* - `smooth`: handles stay on one line through the anchor, lengths independent.
|
|
397
|
+
* - `symmetric`: handles stay on one line with equal lengths.
|
|
398
|
+
*/
|
|
399
|
+
type VectorAnchorType = 'corner' | 'smooth' | 'symmetric';
|
|
400
|
+
/**
|
|
401
|
+
* Live corner shapes: `round` (an arc tangent to both sides), `inverted` (an arc centred on
|
|
402
|
+
* the corner, cut into the shape) and `chamfer` (a straight bevel).
|
|
403
|
+
*/
|
|
404
|
+
type VectorCornerKind = 'round' | 'inverted' | 'chamfer';
|
|
405
|
+
declare const VECTOR_CORNER_KINDS: readonly VectorCornerKind[];
|
|
406
|
+
/**
|
|
407
|
+
* A live corner: drawn rounded (or cut) at render, hit-test, bounds, boolean, outline and export
|
|
408
|
+
* time while the stored anchor stays sharp. The radius shrinks to fit when the sides are short:
|
|
409
|
+
* the cut reaches at most halfway along each side.
|
|
410
|
+
*/
|
|
411
|
+
interface VectorCorner {
|
|
412
|
+
radius: number;
|
|
413
|
+
/** Default `round`. */
|
|
414
|
+
kind?: VectorCornerKind;
|
|
415
|
+
/**
|
|
416
|
+
* Corner smoothing (squircle, as in Figma and iOS), 0–1, round corners between straight sides
|
|
417
|
+
* only: the cut reaches (1 + smoothing) times as far along each side and eases into a shorter arc,
|
|
418
|
+
* so curvature builds up gradually. Default 0 (a circular arc).
|
|
419
|
+
*/
|
|
420
|
+
smoothing?: number;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* One anchor of a subpath. Handles are absolute document positions; a missing (or `null`)
|
|
424
|
+
* handle sits on the anchor, so a segment with no handles at either end is a straight line.
|
|
425
|
+
*/
|
|
426
|
+
interface VectorAnchor {
|
|
427
|
+
x: number;
|
|
428
|
+
y: number;
|
|
429
|
+
/** Control point of the segment arriving at this anchor. */
|
|
430
|
+
in?: Vec2 | null;
|
|
431
|
+
/** Control point of the segment leaving this anchor. */
|
|
432
|
+
out?: Vec2 | null;
|
|
433
|
+
/** Default `corner`. */
|
|
434
|
+
type?: VectorAnchorType;
|
|
435
|
+
/** Live corner radius. Ignored on smooth / symmetric anchors and the ends of open subpaths. */
|
|
436
|
+
corner?: VectorCorner | null;
|
|
437
|
+
/**
|
|
438
|
+
* A stable id, unique within its path, given when a constraint refers to the anchor (see
|
|
439
|
+
* `VectorConstraint`). Edits that move or restyle the anchor keep it; edits that rebuild a path
|
|
440
|
+
* drop it, and constraints on a dropped anchor are removed.
|
|
441
|
+
*/
|
|
442
|
+
id?: string;
|
|
443
|
+
}
|
|
444
|
+
/** A chain of anchors joined by line or cubic Bézier segments. */
|
|
445
|
+
interface VectorSubpath {
|
|
446
|
+
anchors: VectorAnchor[];
|
|
447
|
+
/** Joins the last anchor back to the first. */
|
|
448
|
+
closed: boolean;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Gradient styles: `linear` (start → end), `radial` (centred on the start, reaching the end;
|
|
452
|
+
* focal point and aspect), `conic` (an angle sweep around the start, from the end's direction
|
|
453
|
+
* towards the aspect handle's: clockwise on screen), `reflected` (linear mirrored about the
|
|
454
|
+
* start) and `diamond` (`|u| + |v|` in the gradient's frame: a rhombus through the end and the
|
|
455
|
+
* aspect handle).
|
|
456
|
+
*/
|
|
457
|
+
type VectorGradientType = 'linear' | 'radial' | 'conic' | 'reflected' | 'diamond';
|
|
458
|
+
declare const VECTOR_GRADIENT_TYPES: readonly VectorGradientType[];
|
|
459
|
+
/** What a gradient paints past its ends: the end colours, mirrored periods or repeated periods. */
|
|
460
|
+
type VectorGradientSpread = 'pad' | 'reflect' | 'repeat';
|
|
461
|
+
declare const VECTOR_GRADIENT_SPREADS: readonly VectorGradientSpread[];
|
|
462
|
+
/** Where colours mix between stops: sRGB (SVG's own), linear light or Oklab. */
|
|
463
|
+
type VectorGradientInterpolation = 'srgb' | 'linear' | 'oklab';
|
|
464
|
+
declare const VECTOR_GRADIENT_INTERPOLATIONS: readonly VectorGradientInterpolation[];
|
|
465
|
+
/**
|
|
466
|
+
* The space a gradient's points are in: fractions of the shape's bounding box (SVG's
|
|
467
|
+
* `objectBoundingBox`, the default) or the node's own coordinates (`userSpaceOnUse`).
|
|
468
|
+
*/
|
|
469
|
+
type VectorGradientUnits = 'objectBoundingBox' | 'userSpaceOnUse';
|
|
470
|
+
/**
|
|
471
|
+
* How a gradient lies on a stroke: `within` (laid over the stroke's area like a fill), `along`
|
|
472
|
+
* (t runs from 0 at the start of each subpath to 1 at its end) or `across` (from the stroke's
|
|
473
|
+
* left edge to its right edge, looking along the path).
|
|
474
|
+
*/
|
|
475
|
+
type VectorStrokeGradientMode = 'within' | 'along' | 'across';
|
|
476
|
+
declare const VECTOR_STROKE_GRADIENT_MODES: readonly VectorStrokeGradientMode[];
|
|
477
|
+
/** A colour stop. `opacity` multiplies the colour's own alpha. */
|
|
478
|
+
interface VectorGradientStop {
|
|
479
|
+
/** 0–1. */
|
|
480
|
+
offset: number;
|
|
481
|
+
color: string;
|
|
482
|
+
/** 0–1, default 1. */
|
|
483
|
+
opacity?: number;
|
|
484
|
+
/**
|
|
485
|
+
* Where, between this stop and the next (0–1 of the way), the colour is half-way between
|
|
486
|
+
* them. Default 0.5 (an even mix).
|
|
487
|
+
*/
|
|
488
|
+
midpoint?: number;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* A gradient paint. `CanvasGradientDef` (the canvas package's linear `angle` / radial
|
|
492
|
+
* `cx, cy, r` gradients) is a valid value: those fields are the shorthand form. Explicit
|
|
493
|
+
* geometry (`start` / `end`, in `units`) wins over the shorthand.
|
|
494
|
+
*/
|
|
495
|
+
interface VectorGradient {
|
|
496
|
+
type: VectorGradientType;
|
|
497
|
+
stops: VectorGradientStop[];
|
|
498
|
+
/**
|
|
499
|
+
* Shorthand direction in degrees, CSS style (0 points up, clockwise): a linear or reflected
|
|
500
|
+
* gradient's direction across the box (default 180), a conic gradient's start angle or a
|
|
501
|
+
* diamond's turn (default 90).
|
|
502
|
+
*/
|
|
503
|
+
angle?: number;
|
|
504
|
+
/** Shorthand centre and radius of radial, conic and diamond gradients (fractions of the box, default 0.5). */
|
|
505
|
+
cx?: number;
|
|
506
|
+
cy?: number;
|
|
507
|
+
r?: number;
|
|
508
|
+
/** Where t = 0: a linear gradient's start, the centre of the other styles. */
|
|
509
|
+
start?: Vec2;
|
|
510
|
+
/** Where t = 1 along the gradient's main axis (a radial gradient's radius). */
|
|
511
|
+
end?: Vec2;
|
|
512
|
+
/**
|
|
513
|
+
* The end of the secondary axis (radial, conic and diamond): its distance from `start` over
|
|
514
|
+
* the main axis' length is the aspect ratio. Absent: square to the main axis, as long.
|
|
515
|
+
*/
|
|
516
|
+
width?: Vec2 | null;
|
|
517
|
+
/** A radial gradient's focal point (where t = 0); absent: the centre. */
|
|
518
|
+
focal?: Vec2 | null;
|
|
519
|
+
/** Radius of the focal circle as a fraction of the radius (SVG `fr`, default 0). */
|
|
520
|
+
focalRadius?: number;
|
|
521
|
+
/** Space of `start`, `end`, `width` and `focal` (default `objectBoundingBox`). */
|
|
522
|
+
units?: VectorGradientUnits;
|
|
523
|
+
/** Default `pad`. */
|
|
524
|
+
spread?: VectorGradientSpread;
|
|
525
|
+
/** Default `srgb`. */
|
|
526
|
+
interpolation?: VectorGradientInterpolation;
|
|
527
|
+
/**
|
|
528
|
+
* 0–1: how far the colours follow a smooth spline through the stops instead of straight
|
|
529
|
+
* lines (Photoshop's Smoothness). Default 0.
|
|
530
|
+
*/
|
|
531
|
+
smoothness?: number;
|
|
532
|
+
/** On a stroke: how the gradient lies on it (default `within`). Ignored on fills. */
|
|
533
|
+
strokeMode?: VectorStrokeGradientMode;
|
|
534
|
+
}
|
|
535
|
+
/** A fill or stroke: any CSS colour, a gradient, or `null` / `'none'` for no paint. */
|
|
536
|
+
type VectorPaint = string | VectorGradient | VectorMeshGradient | VectorFreeformGradient | CanvasGradientDef | null;
|
|
537
|
+
/**
|
|
538
|
+
* A gradient mesh (Illustrator's Gradient Mesh, PDF shading types 6 and 7): a lattice of
|
|
539
|
+
* `(rows + 1) × (columns + 1)` points in the node's own space, row by row, each with a colour.
|
|
540
|
+
* Each cell is a smooth patch whose sides are curves through the lattice and whose colour blends
|
|
541
|
+
* between its four corners. Outside the patches the paint is transparent.
|
|
542
|
+
*/
|
|
543
|
+
interface VectorMeshGradient {
|
|
544
|
+
type: 'mesh';
|
|
545
|
+
rows: number;
|
|
546
|
+
columns: number;
|
|
547
|
+
/** Lattice points, row by row (`(rows + 1) × (columns + 1)` of them). */
|
|
548
|
+
points: Vec2[];
|
|
549
|
+
/** A CSS colour per point. */
|
|
550
|
+
colors: string[];
|
|
551
|
+
/** Opacity per point (0–1, default 1 each). */
|
|
552
|
+
opacities?: number[];
|
|
553
|
+
}
|
|
554
|
+
/** One colour point of a freeform gradient. */
|
|
555
|
+
interface VectorFreeformPoint {
|
|
556
|
+
x: number;
|
|
557
|
+
y: number;
|
|
558
|
+
color: string;
|
|
559
|
+
/** 0–1, default 1. */
|
|
560
|
+
opacity?: number;
|
|
561
|
+
/** Radius of the disc of pure colour round the point, as a fraction of half the box's longer side (0–1, default 0). */
|
|
562
|
+
spread?: number;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* A freeform gradient (Illustrator's Freeform Gradient): colour points placed anywhere in the
|
|
566
|
+
* node's own space, blended across the shape by distance, and optional smooth lines through some
|
|
567
|
+
* of them that carry their colours along their length.
|
|
568
|
+
*/
|
|
569
|
+
interface VectorFreeformGradient {
|
|
570
|
+
type: 'freeform';
|
|
571
|
+
points: VectorFreeformPoint[];
|
|
572
|
+
/** Each line runs smoothly through the points at these indices, in order. */
|
|
573
|
+
lines?: number[][];
|
|
574
|
+
}
|
|
575
|
+
type VectorFillRule = 'nonzero' | 'evenodd';
|
|
576
|
+
type VectorLineCap = 'butt' | 'round' | 'square';
|
|
577
|
+
type VectorLineJoin = 'miter' | 'round' | 'bevel';
|
|
578
|
+
/**
|
|
579
|
+
* Where the stroke sits on the outline: centred on it, inside the shape or outside it. Only
|
|
580
|
+
* shapes whose subpaths are all closed have an inside; open paths always stroke centred.
|
|
581
|
+
*/
|
|
582
|
+
type VectorStrokeAlign = 'center' | 'inside' | 'outside';
|
|
583
|
+
/** Arrowheads and end markers for the ends of open paths. */
|
|
584
|
+
type VectorArrowhead = 'triangle' | 'arrow' | 'open' | 'circle' | 'square' | 'bar';
|
|
585
|
+
declare const VECTOR_ARROWHEADS: readonly VectorArrowhead[];
|
|
586
|
+
/**
|
|
587
|
+
* `extend`: the head's tip sits past the end point and the path keeps its length; `tip`: the
|
|
588
|
+
* tip sits on the end point and the stroke is shortened under the head.
|
|
589
|
+
*/
|
|
590
|
+
type VectorArrowAlign = 'extend' | 'tip';
|
|
591
|
+
/**
|
|
592
|
+
* One point of a variable-width stroke profile. `t` is the position along the subpath by
|
|
593
|
+
* length (0 at its start, 1 at its end); `left` and `right` are how far the stroke reaches on
|
|
594
|
+
* each side, as multiples of half the stroke width (looking along the path on screen, y down).
|
|
595
|
+
* A uniform stroke has 1 on both sides. Two points at the same `t` make a step.
|
|
596
|
+
*/
|
|
597
|
+
interface VectorWidthPoint {
|
|
598
|
+
t: number;
|
|
599
|
+
left: number;
|
|
600
|
+
right: number;
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* Blend modes of paint layers and nodes: the set SVG and CSS `mix-blend-mode` draw, named as the
|
|
604
|
+
* image editor names them (`@pixerate/editor/image-editor` `BlendMode`). `linear-dodge` draws as
|
|
605
|
+
* CSS `plus-lighter`. The image editor's other modes (linear burn, vivid light, pigment, …) have
|
|
606
|
+
* no SVG equivalent and are not offered.
|
|
607
|
+
*/
|
|
608
|
+
type VectorBlendMode = 'normal' | 'darken' | 'multiply' | 'color-burn' | 'lighten' | 'screen' | 'color-dodge' | 'linear-dodge' | 'overlay' | 'soft-light' | 'hard-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity';
|
|
609
|
+
/** Every vector blend mode, in the image editor's (Photoshop's) menu order. */
|
|
610
|
+
declare const VECTOR_BLEND_MODES: readonly VectorBlendMode[];
|
|
611
|
+
/** One fill of a path's fill stack (`VectorStyle.fills`). */
|
|
612
|
+
interface VectorPaintLayer {
|
|
613
|
+
/** A colour, a gradient, or `null` for none. */
|
|
614
|
+
paint: VectorPaint;
|
|
615
|
+
/** 0–1, default 1. Multiplies the paint's own alpha. */
|
|
616
|
+
opacity?: number;
|
|
617
|
+
/** How the layer mixes with what is under it (the layers below, then the backdrop). Default `normal`. */
|
|
618
|
+
blendMode?: VectorBlendMode;
|
|
619
|
+
/** Hidden layers are kept but not drawn or hit. Default true. */
|
|
620
|
+
visible?: boolean;
|
|
621
|
+
}
|
|
622
|
+
/** The settings each stroke layer has of its own (the stroke shorthand fields of `VectorStyle`). */
|
|
623
|
+
type VectorStrokeSettings = Pick<VectorStyle, 'strokeWidth' | 'strokeLinecap' | 'strokeLinejoin' | 'strokeDasharray' | 'strokeAlign' | 'startArrow' | 'endArrow' | 'arrowAlign' | 'startArrowScale' | 'endArrowScale' | 'strokeWidthProfile'>;
|
|
624
|
+
/**
|
|
625
|
+
* What a stroke layer draws. Only `paint` (a paint along the outline, the default) exists today.
|
|
626
|
+
* Other kinds are the extension point for strokes drawn some other way, such as a raster
|
|
627
|
+
* brushstroke from `@pixerate/editor/paint` laid along the path: a layer with an unknown kind is
|
|
628
|
+
* kept through edits, load and SVG round trips, listed to agents, and skipped when drawing and
|
|
629
|
+
* hit-testing.
|
|
630
|
+
*/
|
|
631
|
+
type VectorStrokeLayerKind = 'paint';
|
|
632
|
+
/** One stroke of a path's stroke stack (`VectorStyle.strokes`): a paint plus its own stroke settings. */
|
|
633
|
+
interface VectorStrokeLayer extends VectorPaintLayer, VectorStrokeSettings {
|
|
634
|
+
/** Default `paint`. See `VectorStrokeLayerKind`. */
|
|
635
|
+
kind?: VectorStrokeLayerKind;
|
|
636
|
+
}
|
|
637
|
+
/** Paint and stroke settings of a path. */
|
|
638
|
+
interface VectorStyle {
|
|
639
|
+
fill?: VectorPaint;
|
|
640
|
+
stroke?: VectorPaint;
|
|
641
|
+
/** Default 1. */
|
|
642
|
+
strokeWidth?: number;
|
|
643
|
+
strokeLinecap?: VectorLineCap;
|
|
644
|
+
strokeLinejoin?: VectorLineJoin;
|
|
645
|
+
strokeDasharray?: number[];
|
|
646
|
+
/** Default `nonzero`. */
|
|
647
|
+
fillRule?: VectorFillRule;
|
|
648
|
+
/** Default `center`. */
|
|
649
|
+
strokeAlign?: VectorStrokeAlign;
|
|
650
|
+
/** Head at the start of the first subpath when it is open, or none. */
|
|
651
|
+
startArrow?: VectorArrowhead | null;
|
|
652
|
+
/** Head at the end of the last subpath when it is open, or none. */
|
|
653
|
+
endArrow?: VectorArrowhead | null;
|
|
654
|
+
/** Default `extend`. */
|
|
655
|
+
arrowAlign?: VectorArrowAlign;
|
|
656
|
+
/** Size of the start head as a multiple of the stroke width (default 1: a head 4 widths long). */
|
|
657
|
+
startArrowScale?: number;
|
|
658
|
+
/** Size of the end head (default 1). */
|
|
659
|
+
endArrowScale?: number;
|
|
660
|
+
/**
|
|
661
|
+
* Variable width: side scales along each subpath, interpolated with a monotone cubic (see
|
|
662
|
+
* `widthProfileAt`). Absent, empty or `null` strokes at a uniform width. A profiled stroke is
|
|
663
|
+
* drawn as its filled outline.
|
|
664
|
+
*/
|
|
665
|
+
strokeWidthProfile?: VectorWidthPoint[] | null;
|
|
666
|
+
/**
|
|
667
|
+
* The fill stack, bottom to top. Absent: `fill` alone is the stack (one layer, or none without
|
|
668
|
+
* a paint). Present: it is the truth, and `fill` mirrors its top layer's paint. The shorthand
|
|
669
|
+
* stays writable: setting `fill` to a paint repaints the top layer, `null` clears the stack.
|
|
670
|
+
* Stacks of one plain layer (full opacity, `normal`, visible) are stored as the shorthand.
|
|
671
|
+
*/
|
|
672
|
+
fills?: VectorPaintLayer[] | null;
|
|
673
|
+
/**
|
|
674
|
+
* The stroke stack, bottom to top, drawn over every fill. Like `fills`: absent, `stroke` and the
|
|
675
|
+
* stroke settings above are the one stroke; present, they mirror its top layer, and writing them
|
|
676
|
+
* edits that layer (`stroke: null` clears the stack).
|
|
677
|
+
*/
|
|
678
|
+
strokes?: VectorStrokeLayer[] | null;
|
|
679
|
+
}
|
|
680
|
+
interface VectorNodeBase {
|
|
681
|
+
id: string;
|
|
682
|
+
name?: string;
|
|
683
|
+
/** Default true. */
|
|
684
|
+
visible?: boolean;
|
|
685
|
+
/** Locked nodes are drawn but cannot be picked or edited on the canvas. */
|
|
686
|
+
locked?: boolean;
|
|
687
|
+
/** 0–1, default 1. */
|
|
688
|
+
opacity?: number;
|
|
689
|
+
/**
|
|
690
|
+
* Placement in the parent's space: a rigid matrix (rotation + translation). Anchors and
|
|
691
|
+
* children are in the node's own space. Omitted for unrotated nodes, whose positions are
|
|
692
|
+
* stored directly. Scale and skew are never stored here — `transformVectorNode` bakes
|
|
693
|
+
* them into the geometry, so stroke widths and the rotated selection box stay exact.
|
|
694
|
+
*/
|
|
695
|
+
transform?: VectorMatrix;
|
|
696
|
+
/**
|
|
697
|
+
* An in-between a blend group generated from its keys. Steps are rebuilt whenever a key or
|
|
698
|
+
* the blend options change, and are locked (clicks select the blend group).
|
|
699
|
+
*/
|
|
700
|
+
blendStep?: boolean;
|
|
701
|
+
/**
|
|
702
|
+
* Live path effects, applied top to bottom: each acts on every path above it (the node's own
|
|
703
|
+
* outline, or a group's children, then the result of the effects before it), and effects after a
|
|
704
|
+
* repeater act on its copies. The stored anchors and children never change.
|
|
705
|
+
*/
|
|
706
|
+
effects?: VectorEffect[] | null;
|
|
707
|
+
/**
|
|
708
|
+
* As an operand of a live boolean group: how it combines with the result of the operands below
|
|
709
|
+
* it. Absent: the group's `liveBoolean` operation.
|
|
710
|
+
*/
|
|
711
|
+
booleanOperation?: VectorBooleanOperation | null;
|
|
712
|
+
/** How the whole node (all its paint, filters included) mixes with what is under it. Default `normal`. */
|
|
713
|
+
blendMode?: VectorBlendMode;
|
|
714
|
+
/**
|
|
715
|
+
* Visual filters (drop and inner shadows, glows, blurs, feather), applied to everything the
|
|
716
|
+
* node draws. Unlike path `effects` they never change geometry: bounds, hit-testing and
|
|
717
|
+
* booleans ignore them.
|
|
718
|
+
*/
|
|
719
|
+
filters?: VectorFilter[] | null;
|
|
720
|
+
/**
|
|
721
|
+
* How the node follows its frame when the frame is resized (`VectorGroupNode.frame`): per
|
|
722
|
+
* axis, pinned to the start (default `left` / `top`), the end, both (it stretches), the centre,
|
|
723
|
+
* or scaled with the frame. Ignored outside frames.
|
|
724
|
+
*/
|
|
725
|
+
resizing?: VectorResizing | null;
|
|
726
|
+
}
|
|
727
|
+
/** Horizontal resizing constraint of a frame's child (see `VectorNodeBase.resizing`). */
|
|
728
|
+
type VectorHorizontalResizing = 'left' | 'right' | 'leftRight' | 'center' | 'scale';
|
|
729
|
+
/** Vertical resizing constraint of a frame's child (see `VectorNodeBase.resizing`). */
|
|
730
|
+
type VectorVerticalResizing = 'top' | 'bottom' | 'topBottom' | 'center' | 'scale';
|
|
731
|
+
declare const VECTOR_HORIZONTAL_RESIZING: readonly VectorHorizontalResizing[];
|
|
732
|
+
declare const VECTOR_VERTICAL_RESIZING: readonly VectorVerticalResizing[];
|
|
733
|
+
/** A frame child's resizing constraints (Figma's "constraints"). */
|
|
734
|
+
interface VectorResizing {
|
|
735
|
+
/** Default `left`. */
|
|
736
|
+
horizontal?: VectorHorizontalResizing;
|
|
737
|
+
/** Default `top`. */
|
|
738
|
+
vertical?: VectorVerticalResizing;
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* Makes a group a frame (an artboard when top-level): a rectangle in the group's own space with an
|
|
742
|
+
* optional fill drawn below the children, which by default it clips. Resizing the frame moves and
|
|
743
|
+
* resizes its children by their `resizing` constraints instead of scaling them.
|
|
744
|
+
*/
|
|
745
|
+
interface VectorFrame {
|
|
746
|
+
x: number;
|
|
747
|
+
y: number;
|
|
748
|
+
width: number;
|
|
749
|
+
height: number;
|
|
750
|
+
/** The frame's background, drawn below its children (default none). */
|
|
751
|
+
fill?: VectorPaint;
|
|
752
|
+
/** Clip the children to the frame (default true). */
|
|
753
|
+
clip?: boolean;
|
|
754
|
+
}
|
|
755
|
+
/** A shape made of one or more subpaths (holes and compound shapes included). */
|
|
756
|
+
interface VectorPathNode extends VectorNodeBase, VectorStyle {
|
|
757
|
+
type: 'path';
|
|
758
|
+
subpaths: VectorSubpath[];
|
|
759
|
+
/**
|
|
760
|
+
* Makes the path a connector: an open line whose ends may be glued to other objects'
|
|
761
|
+
* connection sites. Its geometry is routed again after every edit, so it follows them.
|
|
762
|
+
*/
|
|
763
|
+
connector?: VectorConnector | null;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Where a connector end meets an object: the middle of a side of the object's own (unrotated)
|
|
767
|
+
* bounds, its centre, or `auto` (the side facing the connector's other end, chosen on every route).
|
|
768
|
+
*/
|
|
769
|
+
type VectorConnectorSide = 'top' | 'right' | 'bottom' | 'left' | 'center' | 'auto';
|
|
770
|
+
declare const VECTOR_CONNECTOR_SIDES: readonly VectorConnectorSide[];
|
|
771
|
+
/** How a connector runs between its ends: a straight line, right-angled elbows or an S-curve. */
|
|
772
|
+
type VectorConnectorRoute = 'straight' | 'elbow' | 'curved';
|
|
773
|
+
declare const VECTOR_CONNECTOR_ROUTES: readonly VectorConnectorRoute[];
|
|
774
|
+
/** A glued connector end. */
|
|
775
|
+
interface VectorConnectorEnd {
|
|
776
|
+
nodeId: string;
|
|
777
|
+
/** Default `auto`. */
|
|
778
|
+
side?: VectorConnectorSide;
|
|
779
|
+
}
|
|
780
|
+
/** A connector's settings (`VectorPathNode.connector`). An end that is not glued stays where it is. */
|
|
781
|
+
interface VectorConnector {
|
|
782
|
+
start?: VectorConnectorEnd | null;
|
|
783
|
+
end?: VectorConnectorEnd | null;
|
|
784
|
+
/** Default `straight`. */
|
|
785
|
+
route?: VectorConnectorRoute;
|
|
786
|
+
/** Corner radius of an elbow route's bends (document units, default 0). */
|
|
787
|
+
radius?: number;
|
|
788
|
+
/** How far an elbow or curve leaves a glued end straight out of its side before turning (document units, default 16). */
|
|
789
|
+
gap?: number;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* How a blend spaces its in-betweens: a number of `steps` between each pair of keys, a fixed
|
|
793
|
+
* `distance` between steps along the spine, or `smoothColor` (as many steps as the colours
|
|
794
|
+
* need for a smooth ramp; by distance when the colours match).
|
|
795
|
+
*/
|
|
796
|
+
type VectorBlendSpacing = 'steps' | 'distance' | 'smoothColor';
|
|
797
|
+
declare const VECTOR_BLEND_SPACINGS: readonly VectorBlendSpacing[];
|
|
798
|
+
/** Settings of a blend. */
|
|
799
|
+
interface VectorBlendOptions {
|
|
800
|
+
/** Default `steps`. */
|
|
801
|
+
spacing?: VectorBlendSpacing;
|
|
802
|
+
/** Steps between each pair of keys with `steps` spacing (default 5). */
|
|
803
|
+
steps?: number;
|
|
804
|
+
/** Distance between steps along the spine with `distance` spacing (default 20). */
|
|
805
|
+
distance?: number;
|
|
806
|
+
/** Turn the steps with the spine's direction (default `false`: they keep the keys' orientation). */
|
|
807
|
+
orientToSpine?: boolean;
|
|
808
|
+
/** Move anchors in straight lines instead of the rotation-aware morph (default `false`). */
|
|
809
|
+
linear?: boolean;
|
|
810
|
+
}
|
|
811
|
+
/** A live blend: the group's keys plus how the in-betweens are made and laid out. */
|
|
812
|
+
interface VectorBlend extends VectorBlendOptions {
|
|
813
|
+
/**
|
|
814
|
+
* A replaced spine in the group's space: the steps follow it instead of the straight lines
|
|
815
|
+
* between the keys' centres (the keys sit along it, spread evenly by arc length).
|
|
816
|
+
*/
|
|
817
|
+
spine?: VectorSubpath | null;
|
|
818
|
+
/** The anchor of each key's first subpath its blend starts from, by key id (the Blend tool's clicks). */
|
|
819
|
+
starts?: Record<string, number>;
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* How a mask group's mask (its first, bottom child) hides the rest: `clip` (a clipping mask: the
|
|
823
|
+
* mask's outline, fully opaque; its paint is not drawn), `alpha` (an opacity mask by the mask's
|
|
824
|
+
* drawn alpha: soft edges, gradients and opacity count) or `luminance` (by its brightness times
|
|
825
|
+
* its alpha: white shows, black hides).
|
|
826
|
+
*/
|
|
827
|
+
type VectorMaskType = 'clip' | 'alpha' | 'luminance';
|
|
828
|
+
declare const VECTOR_MASK_TYPES: readonly VectorMaskType[];
|
|
829
|
+
/** A group's mask settings (`VectorGroupNode.mask`). */
|
|
830
|
+
interface VectorMask {
|
|
831
|
+
type: VectorMaskType;
|
|
832
|
+
/** Show the contents where the mask hides them and hide them where it shows them. Default false. */
|
|
833
|
+
invert?: boolean;
|
|
834
|
+
}
|
|
835
|
+
/** A group of nodes that select and transform together. */
|
|
836
|
+
/**
|
|
837
|
+
* A group drawn by a provider vector effect (see `@pixerate/editor/effects`): its children are the
|
|
838
|
+
* effect's picture, made again when its values change. Kept as plain shapes without a provider.
|
|
839
|
+
*/
|
|
840
|
+
interface VectorProviderEffect {
|
|
841
|
+
/** The provider's effect id. */
|
|
842
|
+
effect: string;
|
|
843
|
+
provider?: string;
|
|
844
|
+
name?: string;
|
|
845
|
+
/** Control values (over the effect's defaults). */
|
|
846
|
+
values: Record<string, number | string | boolean | readonly number[]>;
|
|
847
|
+
}
|
|
848
|
+
interface VectorGroupNode extends VectorNodeBase {
|
|
849
|
+
type: 'group';
|
|
850
|
+
children: VectorNode[];
|
|
851
|
+
/** The provider vector effect this group shows (see `VectorProviderEffect`). */
|
|
852
|
+
providerEffect?: VectorProviderEffect | null;
|
|
853
|
+
/**
|
|
854
|
+
* Makes the group a live blend: its children that are not `blendStep`s are the keys, in
|
|
855
|
+
* stacking order, and the steps between them are regenerated whenever a key changes.
|
|
856
|
+
*/
|
|
857
|
+
blend?: VectorBlend | null;
|
|
858
|
+
/**
|
|
859
|
+
* Makes the group a live boolean: its children stay editable operands, folded bottom to top
|
|
860
|
+
* (each by its own `booleanOperation` or this one), and the group draws as the result in the
|
|
861
|
+
* bottom operand's style.
|
|
862
|
+
*/
|
|
863
|
+
liveBoolean?: VectorBooleanOperation | null;
|
|
864
|
+
/**
|
|
865
|
+
* Makes the group a mask group: its first (bottom) child is the mask and the children above it
|
|
866
|
+
* show only where the mask lets them (see `VectorMaskType`). Hit-testing, bounds, snapping and
|
|
867
|
+
* booleans use the masked result. A hidden mask child turns the mask off (the contents draw
|
|
868
|
+
* whole). The group's own opacity, blend mode and filters apply to the masked result, and its
|
|
869
|
+
* path effects to the contents (not the mask). Ignored on blends and live booleans.
|
|
870
|
+
*/
|
|
871
|
+
mask?: VectorMask | null;
|
|
872
|
+
/**
|
|
873
|
+
* Makes the group a frame (see `VectorFrame`): it draws its fill below the children, clips them,
|
|
874
|
+
* selects and snaps by its rectangle, and lays its children out by their `resizing` constraints
|
|
875
|
+
* when resized. Ignored on blends, live booleans and mask groups.
|
|
876
|
+
*/
|
|
877
|
+
frame?: VectorFrame | null;
|
|
878
|
+
/**
|
|
879
|
+
* Makes the group a live symmetry group: it draws its children and their mirrored (or rotated)
|
|
880
|
+
* copies, regenerated whenever a child changes. Ignored on blends, live booleans, mask groups
|
|
881
|
+
* and frames.
|
|
882
|
+
*/
|
|
883
|
+
symmetry?: VectorSymmetry | null;
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* How a symmetry group repeats its children: mirrored across a `vertical`, `horizontal` or
|
|
887
|
+
* `diagonal` axis, across both axes (`dual`: four quarters), or `radial`ly round the centre
|
|
888
|
+
* (`copies` turns, each mirrored too with `mirror`, like a kaleidoscope).
|
|
889
|
+
*/
|
|
890
|
+
type VectorSymmetryMode = 'vertical' | 'horizontal' | 'dual' | 'diagonal' | 'radial';
|
|
891
|
+
declare const VECTOR_SYMMETRY_MODES: readonly VectorSymmetryMode[];
|
|
892
|
+
/** A symmetry group's settings (`VectorGroupNode.symmetry`). */
|
|
893
|
+
interface VectorSymmetry {
|
|
894
|
+
mode: VectorSymmetryMode;
|
|
895
|
+
/** Where the axes cross (the group's own space). */
|
|
896
|
+
center: Vec2;
|
|
897
|
+
/** Turn of the axes, degrees clockwise (default 0). */
|
|
898
|
+
rotation?: number;
|
|
899
|
+
/** Radial: how many turns round the circle (2–64, default 6). */
|
|
900
|
+
copies?: number;
|
|
901
|
+
/** Radial: mirror each turn too (default false). */
|
|
902
|
+
mirror?: boolean;
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* The character style of text (a font and how it is set). Sizes are document units; `tracking` is in
|
|
906
|
+
* 1/1000 em. Paint comes from the node's fills and strokes (and a run's own `fill`).
|
|
907
|
+
*/
|
|
908
|
+
interface VectorCharacterStyle {
|
|
909
|
+
/** Family name ("Inter"); a family the shaper lacks draws in a fallback and is listed as missing. */
|
|
910
|
+
fontFamily: string;
|
|
911
|
+
/** CSS weight, 1–1000 (400 regular, 700 bold). */
|
|
912
|
+
fontWeight: number;
|
|
913
|
+
/** Default false. */
|
|
914
|
+
italic?: boolean;
|
|
915
|
+
fontSize: number;
|
|
916
|
+
/** Letter spacing in 1/1000 em (default 0). */
|
|
917
|
+
tracking?: number;
|
|
918
|
+
/** Baseline-to-baseline distance; absent: auto (`autoLeading` × size). */
|
|
919
|
+
leading?: number;
|
|
920
|
+
/** Raises (positive) or lowers the text (default 0). */
|
|
921
|
+
baselineShift?: number;
|
|
922
|
+
underline?: boolean;
|
|
923
|
+
strikethrough?: boolean;
|
|
924
|
+
}
|
|
925
|
+
/** Character style fields a run can set over the node's own style, plus its own fill. */
|
|
926
|
+
type VectorTextRunStyle = Partial<VectorCharacterStyle> & {
|
|
927
|
+
/** The run's fill: replaces the paint of the node's top fill for these characters. */
|
|
928
|
+
fill?: VectorPaint;
|
|
929
|
+
};
|
|
930
|
+
/** A style over `length` UTF-16 code units of the text, in order. */
|
|
931
|
+
interface VectorTextRun {
|
|
932
|
+
length: number;
|
|
933
|
+
style: VectorTextRunStyle;
|
|
934
|
+
}
|
|
935
|
+
type VectorTextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
936
|
+
declare const VECTOR_TEXT_ALIGNS: readonly VectorTextAlign[];
|
|
937
|
+
/** Paragraph settings of a text node (all its paragraphs). Lengths in document units. */
|
|
938
|
+
interface VectorParagraphStyle {
|
|
939
|
+
/** Default `left`. `justify` stretches every line of area text but a paragraph's last; on a path it spreads the text over the path. */
|
|
940
|
+
align?: VectorTextAlign;
|
|
941
|
+
/** Auto leading as a multiple of the font size (default 1.2). */
|
|
942
|
+
autoLeading?: number;
|
|
943
|
+
firstLineIndent?: number;
|
|
944
|
+
startIndent?: number;
|
|
945
|
+
endIndent?: number;
|
|
946
|
+
spaceBefore?: number;
|
|
947
|
+
spaceAfter?: number;
|
|
948
|
+
}
|
|
949
|
+
/** Where text on a path sits across the path: its baseline, ascender, descender or centre on the line. */
|
|
950
|
+
type VectorPathTextBaseline = 'baseline' | 'ascender' | 'descender' | 'center';
|
|
951
|
+
declare const VECTOR_PATH_TEXT_BASELINES: readonly VectorPathTextBaseline[];
|
|
952
|
+
/**
|
|
953
|
+
* Where a text node's text goes, in the node's own space:
|
|
954
|
+
* - `point`: one line per paragraph, the first baseline starting at (`x`, `y`);
|
|
955
|
+
* - `area`: lines wrapped inside the box at (`x`, `y`) of `width` × `height` (lines that do not fit
|
|
956
|
+
* are hidden: the text overflows);
|
|
957
|
+
* - `path`: one line set along `path` (paragraph breaks become spaces), from `start` to `end`
|
|
958
|
+
* (distances from the path's ends), turned with the path (`orientation: 'rotate'`) or upright.
|
|
959
|
+
* `flip` runs the text the other way, on the other side.
|
|
960
|
+
*/
|
|
961
|
+
type VectorTextFrame = {
|
|
962
|
+
kind: 'point';
|
|
963
|
+
x: number;
|
|
964
|
+
y: number;
|
|
965
|
+
} | {
|
|
966
|
+
kind: 'area';
|
|
967
|
+
x: number;
|
|
968
|
+
y: number;
|
|
969
|
+
width: number;
|
|
970
|
+
height: number;
|
|
971
|
+
} | {
|
|
972
|
+
kind: 'path';
|
|
973
|
+
path: VectorSubpath;
|
|
974
|
+
/** Margin from the path's start (default 0). */
|
|
975
|
+
start?: number;
|
|
976
|
+
/** Margin from the path's end (default 0). */
|
|
977
|
+
end?: number;
|
|
978
|
+
flip?: boolean;
|
|
979
|
+
/** Default `rotate`. */
|
|
980
|
+
orientation?: 'rotate' | 'upright';
|
|
981
|
+
/** Default `baseline`. */
|
|
982
|
+
baseline?: VectorPathTextBaseline;
|
|
983
|
+
};
|
|
984
|
+
/**
|
|
985
|
+
* Text: a string with a character style, optional styled runs and a paragraph style, set in a
|
|
986
|
+
* frame. It paints with the node's fills and strokes like a path. Layout and glyphs come from the
|
|
987
|
+
* editor's text shaper (`setVectorTextShaper`); with an outline shaper the text draws as glyph
|
|
988
|
+
* outlines (so path effects, envelopes, booleans and Create Outlines work), otherwise as SVG text.
|
|
989
|
+
*/
|
|
990
|
+
interface VectorTextNode extends VectorNodeBase, VectorStyle {
|
|
991
|
+
type: 'text';
|
|
992
|
+
text: string;
|
|
993
|
+
/** The base character style. */
|
|
994
|
+
font: VectorCharacterStyle;
|
|
995
|
+
/** Runs over the text, each overriding some fields of `font` (absent: one style throughout). */
|
|
996
|
+
runs?: VectorTextRun[] | null;
|
|
997
|
+
paragraph?: VectorParagraphStyle | null;
|
|
998
|
+
frame: VectorTextFrame;
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Per-instance changes to a symbol's art: every fill and / or stroke of the art painted with one
|
|
1002
|
+
* paint (a tint), and art nodes (by their id in the symbol) hidden.
|
|
1003
|
+
*/
|
|
1004
|
+
interface VectorInstanceOverrides {
|
|
1005
|
+
fill?: VectorPaint;
|
|
1006
|
+
stroke?: VectorPaint;
|
|
1007
|
+
/** Ids of nodes of the symbol's art (top-level or nested) not drawn in this instance. */
|
|
1008
|
+
hidden?: string[];
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* A placed copy of a symbol (`VectorDocument.symbols`): it draws the symbol's art through its
|
|
1012
|
+
* `transform`, which, unlike other nodes', may scale and skew. Editing the symbol changes every
|
|
1013
|
+
* instance.
|
|
1014
|
+
*/
|
|
1015
|
+
interface VectorInstanceNode extends VectorNodeBase {
|
|
1016
|
+
type: 'instance';
|
|
1017
|
+
symbolId: string;
|
|
1018
|
+
/** Strokes (and other lengths of the art's paint) scale with the instance (default true, as in Illustrator). */
|
|
1019
|
+
scaleStrokes?: boolean;
|
|
1020
|
+
overrides?: VectorInstanceOverrides | null;
|
|
1021
|
+
/**
|
|
1022
|
+
* The symbol's art, resolved by the editor (the same array as the symbol's `nodes`). Not part of
|
|
1023
|
+
* the stored document: `VectorEditorController.toJSON` and SVG export leave it out, and loading
|
|
1024
|
+
* resolves it again (`resolveVectorSymbols`).
|
|
1025
|
+
*/
|
|
1026
|
+
art?: VectorNode[];
|
|
1027
|
+
}
|
|
1028
|
+
type VectorNode = VectorPathNode | VectorGroupNode | VectorTextNode | VectorInstanceNode;
|
|
1029
|
+
/** A symbol: reusable art its instances draw. */
|
|
1030
|
+
interface VectorSymbol {
|
|
1031
|
+
id: string;
|
|
1032
|
+
name: string;
|
|
1033
|
+
/** The art, bottom to top, in the symbol's own space (its origin is the registration point instances are placed by). */
|
|
1034
|
+
nodes: VectorNode[];
|
|
1035
|
+
}
|
|
1036
|
+
/** A vector drawing: an artboard and its nodes, bottom to top. */
|
|
1037
|
+
interface VectorDocument {
|
|
1038
|
+
width: number;
|
|
1039
|
+
height: number;
|
|
1040
|
+
/** Artboard colour (default: transparent). */
|
|
1041
|
+
background?: string;
|
|
1042
|
+
nodes: VectorNode[];
|
|
1043
|
+
/** Symbols the document's instances draw (see `VectorInstanceNode`). */
|
|
1044
|
+
symbols?: VectorSymbol[];
|
|
1045
|
+
/** Constraints between anchors, segments and circles, solved after every edit. */
|
|
1046
|
+
constraints?: VectorConstraint[];
|
|
1047
|
+
/** Named values the constraints' expressions use. */
|
|
1048
|
+
parameters?: VectorParameter[];
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* Constraint kinds (CAD-style parametric drawing). Geometric: `coincident` (two points, a point on
|
|
1052
|
+
* a segment's line, or a point on a circle), `collinear` (two segments on one line), `concentric`
|
|
1053
|
+
* (two circles, or a circle's centre on a point), `fix`, `parallel`, `perpendicular`, `horizontal`
|
|
1054
|
+
* / `vertical` (a segment, or two points level), `tangent` (a segment and a circle, two circles, or
|
|
1055
|
+
* G1 at an anchor: its handles in line), `smooth` (G2 at an anchor: G1 and equal curvature),
|
|
1056
|
+
* `symmetric` (two points about a segment's line) and `equal` (segment lengths or radii).
|
|
1057
|
+
* Dimensional (with a `value`): `distance`, `angle` (degrees), `radius` and `diameter`.
|
|
1058
|
+
*/
|
|
1059
|
+
type VectorConstraintKind = 'coincident' | 'collinear' | 'concentric' | 'fix' | 'parallel' | 'perpendicular' | 'horizontal' | 'vertical' | 'tangent' | 'smooth' | 'symmetric' | 'equal' | 'distance' | 'angle' | 'radius' | 'diameter';
|
|
1060
|
+
declare const VECTOR_CONSTRAINT_KINDS: readonly VectorConstraintKind[];
|
|
1061
|
+
/**
|
|
1062
|
+
* What a constraint refers to: an anchor of a path (by its stable `id`), one of the anchor's
|
|
1063
|
+
* handles, the segment from the anchor to the next one, or (no `anchor`) a whole path as a circle
|
|
1064
|
+
* (its centre and radius, for closed round paths).
|
|
1065
|
+
*/
|
|
1066
|
+
interface VectorGeomRef {
|
|
1067
|
+
nodeId: string;
|
|
1068
|
+
/** The anchor's `id` (see `VectorAnchor.id`). */
|
|
1069
|
+
anchor?: string;
|
|
1070
|
+
/** With `anchor`: the handle instead of the anchor point. */
|
|
1071
|
+
handle?: 'in' | 'out';
|
|
1072
|
+
/** With `anchor`: the segment from it to the next anchor. */
|
|
1073
|
+
segment?: boolean;
|
|
1074
|
+
/** Without `anchor`: the path as a circle. */
|
|
1075
|
+
circle?: boolean;
|
|
1076
|
+
}
|
|
1077
|
+
/** A constraint kept by the document and solved after every edit. */
|
|
1078
|
+
interface VectorConstraint {
|
|
1079
|
+
id: string;
|
|
1080
|
+
kind: VectorConstraintKind;
|
|
1081
|
+
refs: VectorGeomRef[];
|
|
1082
|
+
/** Dimensional constraints: the value as an expression (document units, degrees for angles), e.g. `"40"` or `"w / 2"`. */
|
|
1083
|
+
value?: string;
|
|
1084
|
+
/** Dimensional constraints: a name other expressions can use (`d1`, `ang2`). */
|
|
1085
|
+
name?: string;
|
|
1086
|
+
/** `distance`: measured along the line between (default), or only horizontally or vertically. */
|
|
1087
|
+
axis?: 'aligned' | 'horizontal' | 'vertical';
|
|
1088
|
+
}
|
|
1089
|
+
/** A named value constraints' expressions can use. */
|
|
1090
|
+
interface VectorParameter {
|
|
1091
|
+
name: string;
|
|
1092
|
+
/** An expression (numbers, other names, `+ - * /`, parentheses, `pi`). */
|
|
1093
|
+
value: string;
|
|
1094
|
+
description?: string;
|
|
1095
|
+
}
|
|
1096
|
+
/** An axis-aligned rectangle. */
|
|
1097
|
+
interface VectorBounds {
|
|
1098
|
+
x: number;
|
|
1099
|
+
y: number;
|
|
1100
|
+
width: number;
|
|
1101
|
+
height: number;
|
|
1102
|
+
}
|
|
1103
|
+
/** Identifies one anchor of a path node. */
|
|
1104
|
+
interface VectorAnchorRef {
|
|
1105
|
+
nodeId: string;
|
|
1106
|
+
subpath: number;
|
|
1107
|
+
index: number;
|
|
1108
|
+
}
|
|
1109
|
+
/** Identifies one handle of an anchor. */
|
|
1110
|
+
interface VectorHandleRef extends VectorAnchorRef {
|
|
1111
|
+
handle: 'in' | 'out';
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Canvas tools. `direct` edits anchors, handles and segments; the shape tools drag out a new
|
|
1115
|
+
* shape; `scissors` cuts a path at a point, `knife` cuts filled shapes along a freehand stroke,
|
|
1116
|
+
* `eraser` rubs out the area under one and `width` drags a stroke's width at a point.
|
|
1117
|
+
* `shapeBuilder` merges (Alt: deletes) the faces the selected shapes make, and `paintBucket`
|
|
1118
|
+
* fills the region the visible outlines enclose around a click with a new shape. `blend`
|
|
1119
|
+
* blends the shape clicked first into the one clicked next (clicking an anchor of a closed path
|
|
1120
|
+
* starts the blend there). `envelope` edits the mesh of the selection's envelope: drag its
|
|
1121
|
+
* anchors and handles, or inside a patch to pull the surface. `type` adds point text (click) or
|
|
1122
|
+
* area text (drag) and edits text it clicks; `typePath` sets text along the path it clicks. `frame`
|
|
1123
|
+
* drags out a frame (`VectorGroupNode.frame`), taking in the top-level objects it fully encloses.
|
|
1124
|
+
* `connector` drags a connector between objects, gluing each end to the side it starts or ends on.
|
|
1125
|
+
*/
|
|
1126
|
+
type VectorTool = 'select' | 'direct' | 'pen' | 'pencil' | 'rect' | 'ellipse' | 'polygon' | 'star' | 'line' | 'scissors' | 'knife' | 'eraser' | 'width' | 'shapeBuilder' | 'paintBucket' | 'blend' | 'gradient' | 'envelope' | 'type' | 'typePath' | 'frame' | 'connector';
|
|
1127
|
+
declare const VECTOR_TOOLS: readonly VectorTool[];
|
|
1128
|
+
/** Keyboard modifiers held during a pointer event. */
|
|
1129
|
+
interface VectorModifiers {
|
|
1130
|
+
shift?: boolean;
|
|
1131
|
+
alt?: boolean;
|
|
1132
|
+
/** Cmd on macOS, Ctrl elsewhere. */
|
|
1133
|
+
mod?: boolean;
|
|
1134
|
+
}
|
|
1135
|
+
/** The eight resize handles of a selection box and the rotation handle. */
|
|
1136
|
+
type VectorTransformHandle = 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'rotate';
|
|
1137
|
+
declare const VECTOR_TRANSFORM_HANDLES: readonly VectorTransformHandle[];
|
|
1138
|
+
/** Pan and zoom of the canvas: `screen = document × zoom + (x, y)`. */
|
|
1139
|
+
interface VectorViewport {
|
|
1140
|
+
/** Screen position of the document origin, in screen pixels. */
|
|
1141
|
+
x: number;
|
|
1142
|
+
y: number;
|
|
1143
|
+
zoom: number;
|
|
1144
|
+
}
|
|
1145
|
+
/** What the next shape and pen path are drawn with. */
|
|
1146
|
+
interface VectorDefaults extends VectorStyle {
|
|
1147
|
+
/** Sides of the polygon tool (default 6). */
|
|
1148
|
+
polygonSides?: number;
|
|
1149
|
+
/** Points of the star tool (default 5). */
|
|
1150
|
+
starPoints?: number;
|
|
1151
|
+
/** Inner radius of the star tool as a fraction of the outer one (default 0.5). */
|
|
1152
|
+
starInnerRatio?: number;
|
|
1153
|
+
/** Live corner radius the rectangle, polygon and star tools give their corners (default 0). */
|
|
1154
|
+
cornerRadius?: number;
|
|
1155
|
+
/** Corner kind of those tools (default `round`). */
|
|
1156
|
+
cornerKind?: VectorCornerKind;
|
|
1157
|
+
}
|
|
1158
|
+
type VectorAlign = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
|
|
1159
|
+
type VectorDistribute = 'horizontal' | 'vertical';
|
|
1160
|
+
type VectorBooleanOperation = 'union' | 'subtract' | 'intersect' | 'exclude';
|
|
1161
|
+
/**
|
|
1162
|
+
* Pathfinder operations: `divide` (every face its own shape), `trim` (hidden parts removed),
|
|
1163
|
+
* `merge` (Trim, then touching parts of one fill joined), `crop` (the top shape crops the others),
|
|
1164
|
+
* `outline` (outlines cut into open strokes where they meet) and `minusBack` (the top shape minus
|
|
1165
|
+
* everything below it).
|
|
1166
|
+
*/
|
|
1167
|
+
type VectorPathfinderOperation = 'divide' | 'trim' | 'merge' | 'crop' | 'outline' | 'minusBack';
|
|
1168
|
+
declare const VECTOR_PATHFINDER_OPERATIONS: readonly VectorPathfinderOperation[];
|
|
1169
|
+
type VectorArrange = 'front' | 'forward' | 'backward' | 'back';
|
|
1170
|
+
/** Average: line anchors up on a horizontal line (same y), a vertical one (same x), or both. */
|
|
1171
|
+
type VectorAverageAxis = 'horizontal' | 'vertical' | 'both';
|
|
1172
|
+
/**
|
|
1173
|
+
* Live path effects (After Effects' path operators): `trim` (Trim Paths), `roundCorners`,
|
|
1174
|
+
* `puckerBloat`, `twist`, `zigzag`, `wiggle` (Wiggle Paths), `offset` (Offset Paths), `merge`
|
|
1175
|
+
* (Merge Paths), `repeater`, `envelope` (an envelope distortion: a warp preset or a mesh),
|
|
1176
|
+
* `contour` (CorelDRAW's Contour: concentric offset steps blending toward end colours) and
|
|
1177
|
+
* `blockShadow` (CorelDRAW's Block Shadow: the shape swept along a direction, under it).
|
|
1178
|
+
*/
|
|
1179
|
+
type VectorEffectType = 'trim' | 'roundCorners' | 'puckerBloat' | 'twist' | 'zigzag' | 'wiggle' | 'offset' | 'merge' | 'repeater' | 'envelope' | 'contour' | 'blockShadow';
|
|
1180
|
+
declare const VECTOR_EFFECT_TYPES: readonly VectorEffectType[];
|
|
1181
|
+
/** Warp presets (Photoshop's fifteen, in menu order); shared with the image editor (`src/geom`). */
|
|
1182
|
+
type VectorWarpStyle = WarpStyle;
|
|
1183
|
+
/**
|
|
1184
|
+
* A grid of bicubic Bézier patches mapping a source box onto the plane. `us` / `vs` are the patch
|
|
1185
|
+
* boundaries as fractions of the box (increasing, first 0, last 1); `points` is the
|
|
1186
|
+
* `(3·(us.length − 1) + 1) × (3·(vs.length − 1) + 1)` control grid, row by row, in the node's own
|
|
1187
|
+
* space. Neighbouring patches share their edge row: anchors sit where both indices are multiples
|
|
1188
|
+
* of 3, handles where one is. Shared with the image editor (`src/geom`).
|
|
1189
|
+
*/
|
|
1190
|
+
type VectorWarpMesh = WarpMesh;
|
|
1191
|
+
/** Merge Paths modes: a compound path (no boolean), union, the first minus the others, intersection or exclusion. */
|
|
1192
|
+
type VectorMergeMode = 'merge' | 'add' | 'subtract' | 'intersect' | 'exclude';
|
|
1193
|
+
declare const VECTOR_MERGE_MODES: readonly VectorMergeMode[];
|
|
1194
|
+
/** Parameters of each effect type. Lengths are in the node's own units, angles in degrees, percentages 0–100. */
|
|
1195
|
+
interface VectorEffectParamsMap {
|
|
1196
|
+
trim: {
|
|
1197
|
+
/** Start and end of the kept part, percent of the length (swapped when start > end). */
|
|
1198
|
+
start: number;
|
|
1199
|
+
end: number;
|
|
1200
|
+
/** Shifts both, in degrees (360° = once round). */
|
|
1201
|
+
offset: number;
|
|
1202
|
+
/**
|
|
1203
|
+
* `simultaneous`: every path trimmed by the same fractions of its own length;
|
|
1204
|
+
* `individual`: the paths laid end to end in stacking order and trimmed as one length.
|
|
1205
|
+
*/
|
|
1206
|
+
mode: 'simultaneous' | 'individual';
|
|
1207
|
+
};
|
|
1208
|
+
roundCorners: {
|
|
1209
|
+
radius: number;
|
|
1210
|
+
};
|
|
1211
|
+
/** Percent, −100 (pucker: spiky) to 100 (bloat: bulging). */
|
|
1212
|
+
puckerBloat: {
|
|
1213
|
+
amount: number;
|
|
1214
|
+
};
|
|
1215
|
+
twist: {
|
|
1216
|
+
/** Turn at the farthest point from the centre (none at the centre). */
|
|
1217
|
+
angle: number;
|
|
1218
|
+
/** The centre as an offset from the middle of the paths' bounds. */
|
|
1219
|
+
center: Vec2;
|
|
1220
|
+
};
|
|
1221
|
+
zigzag: {
|
|
1222
|
+
/** How far the points move to either side. */
|
|
1223
|
+
size: number;
|
|
1224
|
+
/** Ridges per segment. */
|
|
1225
|
+
ridges: number;
|
|
1226
|
+
/** Rounded waves instead of sharp zig zags. */
|
|
1227
|
+
smooth: boolean;
|
|
1228
|
+
};
|
|
1229
|
+
wiggle: {
|
|
1230
|
+
/** Largest displacement. */
|
|
1231
|
+
size: number;
|
|
1232
|
+
/** Points added per segment. */
|
|
1233
|
+
detail: number;
|
|
1234
|
+
smooth: boolean;
|
|
1235
|
+
/** Wiggles per second. */
|
|
1236
|
+
speed: number;
|
|
1237
|
+
/** Percent: how much neighbouring points move together. */
|
|
1238
|
+
correlation: number;
|
|
1239
|
+
/** Degrees (360° = one wiggle). */
|
|
1240
|
+
phase: number;
|
|
1241
|
+
/** The same seed (and time) always gives the same wiggle. */
|
|
1242
|
+
seed: number;
|
|
1243
|
+
/** Seconds: where along the wiggle's motion it is drawn. */
|
|
1244
|
+
time: number;
|
|
1245
|
+
};
|
|
1246
|
+
offset: {
|
|
1247
|
+
/** Grows (positive) or shrinks (negative) the shapes. */
|
|
1248
|
+
amount: number;
|
|
1249
|
+
join: VectorLineJoin;
|
|
1250
|
+
miterLimit: number;
|
|
1251
|
+
/** Copies, copy i offset by `amount · (i + 1 + copyOffset)`. */
|
|
1252
|
+
copies: number;
|
|
1253
|
+
copyOffset: number;
|
|
1254
|
+
};
|
|
1255
|
+
merge: {
|
|
1256
|
+
mode: VectorMergeMode;
|
|
1257
|
+
};
|
|
1258
|
+
repeater: {
|
|
1259
|
+
/** Copies, the original included; a fraction fades the last copy. */
|
|
1260
|
+
copies: number;
|
|
1261
|
+
/** Shifts the copies along: copy i is transformed `i + offset` times. */
|
|
1262
|
+
offset: number;
|
|
1263
|
+
/** Each step: move, about `anchor` turn by `rotation` and scale by `scale` percent. */
|
|
1264
|
+
position: Vec2;
|
|
1265
|
+
/** Offset from the middle of the paths' bounds. */
|
|
1266
|
+
anchor: Vec2;
|
|
1267
|
+
rotation: number;
|
|
1268
|
+
scale: Vec2;
|
|
1269
|
+
/** Percent opacity of the first and last copies (in between interpolated). */
|
|
1270
|
+
startOpacity: number;
|
|
1271
|
+
endOpacity: number;
|
|
1272
|
+
/** `below`: each copy draws under the one before it; `above`: over it. */
|
|
1273
|
+
composite: 'below' | 'above';
|
|
1274
|
+
};
|
|
1275
|
+
/**
|
|
1276
|
+
* Contour: concentric copies of each shape offset `offset` apart, `steps` of them `inside`,
|
|
1277
|
+
* `outside`, or `center` (inside until the shape is used up), their fill and stroke blending
|
|
1278
|
+
* from the shape's own colours to `fillColor` / `strokeColor` (null keeps the colour).
|
|
1279
|
+
* `acceleration` (−100…100) bunches the colour change toward the end (positive) or start.
|
|
1280
|
+
*/
|
|
1281
|
+
contour: {
|
|
1282
|
+
direction: 'inside' | 'outside' | 'center';
|
|
1283
|
+
steps: number;
|
|
1284
|
+
offset: number;
|
|
1285
|
+
join: VectorLineJoin;
|
|
1286
|
+
miterLimit: number;
|
|
1287
|
+
fillColor: string | null;
|
|
1288
|
+
strokeColor: string | null;
|
|
1289
|
+
acceleration: number;
|
|
1290
|
+
};
|
|
1291
|
+
/**
|
|
1292
|
+
* Block shadow (CorelDRAW's Block Shadow; a long shadow when it fades): each shape swept
|
|
1293
|
+
* `distance` along `angle` (degrees, 0 right, 90 down, in the node's own space) as one solid
|
|
1294
|
+
* shape under the art, in `color` (null: the shape's own solid fill) at `opacity` percent,
|
|
1295
|
+
* fading to `endOpacity` percent at the far end.
|
|
1296
|
+
*/
|
|
1297
|
+
blockShadow: {
|
|
1298
|
+
angle: number;
|
|
1299
|
+
distance: number;
|
|
1300
|
+
color: string | null;
|
|
1301
|
+
opacity: number;
|
|
1302
|
+
endOpacity: number;
|
|
1303
|
+
};
|
|
1304
|
+
/**
|
|
1305
|
+
* Envelope distortion: the paths above it are mapped from their combined bounds through a warp
|
|
1306
|
+
* preset (bend and horizontal / vertical distortion in percent) or, with style `mesh`, through
|
|
1307
|
+
* `mesh` (null: the flat mesh of `columns × rows` patches over the bounds). The bounds are
|
|
1308
|
+
* taken afresh each time, so editing the contents keeps the envelope.
|
|
1309
|
+
*/
|
|
1310
|
+
envelope: {
|
|
1311
|
+
style: VectorWarpStyle | 'mesh';
|
|
1312
|
+
bend: number;
|
|
1313
|
+
horizontal: number;
|
|
1314
|
+
vertical: number;
|
|
1315
|
+
orientation: 'horizontal' | 'vertical';
|
|
1316
|
+
/** Patches of the mesh (a preset turns into a mesh of this size when it is edited). */
|
|
1317
|
+
rows: number;
|
|
1318
|
+
columns: number;
|
|
1319
|
+
mesh: VectorWarpMesh | null;
|
|
1320
|
+
};
|
|
1321
|
+
}
|
|
1322
|
+
/** One entry of an effect stack. */
|
|
1323
|
+
type VectorEffect = {
|
|
1324
|
+
[K in VectorEffectType]: {
|
|
1325
|
+
/** Unique within the node. */
|
|
1326
|
+
id: string;
|
|
1327
|
+
type: K;
|
|
1328
|
+
/** Disabled effects are skipped. Default true. */
|
|
1329
|
+
enabled?: boolean;
|
|
1330
|
+
params: VectorEffectParamsMap[K];
|
|
1331
|
+
};
|
|
1332
|
+
}[VectorEffectType];
|
|
1333
|
+
/** Identifies one segment of a path node: from anchor `segment` to the next. */
|
|
1334
|
+
interface VectorSegmentRef {
|
|
1335
|
+
nodeId: string;
|
|
1336
|
+
subpath: number;
|
|
1337
|
+
segment: number;
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* Visual filters: `dropShadow` (the node's silhouette, offset and blurred, under it),
|
|
1341
|
+
* `innerShadow` (a shadow cast inside the edges), `outerGlow` / `innerGlow` (an unoffset glow
|
|
1342
|
+
* outside or inside the edges), `layerBlur` (the whole node blurred) and `feather` (edges faded
|
|
1343
|
+
* to transparent).
|
|
1344
|
+
*/
|
|
1345
|
+
type VectorFilterType = 'dropShadow' | 'innerShadow' | 'outerGlow' | 'innerGlow' | 'layerBlur' | 'feather';
|
|
1346
|
+
declare const VECTOR_FILTER_TYPES: readonly VectorFilterType[];
|
|
1347
|
+
/** A shadow or glow: colour, offset, blur and spread in the node's own units. */
|
|
1348
|
+
interface VectorShadowParams {
|
|
1349
|
+
color: string;
|
|
1350
|
+
/** 0–1: multiplies the colour's own alpha. */
|
|
1351
|
+
opacity: number;
|
|
1352
|
+
/** Blur radius (the SVG / CSS standard deviation is half of it). */
|
|
1353
|
+
blur: number;
|
|
1354
|
+
/** Grows the silhouette before blurring (inner effects: chokes it inwards). */
|
|
1355
|
+
spread: number;
|
|
1356
|
+
}
|
|
1357
|
+
/** Parameters of each filter type. Lengths are in the node's own units. */
|
|
1358
|
+
interface VectorFilterParamsMap {
|
|
1359
|
+
dropShadow: VectorShadowParams & {
|
|
1360
|
+
offsetX: number;
|
|
1361
|
+
offsetY: number;
|
|
1362
|
+
};
|
|
1363
|
+
innerShadow: VectorShadowParams & {
|
|
1364
|
+
offsetX: number;
|
|
1365
|
+
offsetY: number;
|
|
1366
|
+
};
|
|
1367
|
+
outerGlow: VectorShadowParams;
|
|
1368
|
+
innerGlow: VectorShadowParams;
|
|
1369
|
+
layerBlur: {
|
|
1370
|
+
radius: number;
|
|
1371
|
+
};
|
|
1372
|
+
/** Fades the edges over `radius` inwards. */
|
|
1373
|
+
feather: {
|
|
1374
|
+
radius: number;
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
/** One entry of a node's filter stack. */
|
|
1378
|
+
type VectorFilter = {
|
|
1379
|
+
[K in VectorFilterType]: {
|
|
1380
|
+
/** Unique within the node. */
|
|
1381
|
+
id: string;
|
|
1382
|
+
type: K;
|
|
1383
|
+
/** Disabled filters are skipped. Default true. */
|
|
1384
|
+
enabled?: boolean;
|
|
1385
|
+
params: VectorFilterParamsMap[K];
|
|
1386
|
+
};
|
|
1387
|
+
}[VectorFilterType];
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* A vector animation as plain JSON: a piece of vector artwork (the editor's `VectorDocument`,
|
|
1391
|
+
* as the vector editor draws it) and the shots that bring it to life.
|
|
1392
|
+
*
|
|
1393
|
+
* Shots, not timelines: a shot frames the camera, plays its commands and holds. Timing comes
|
|
1394
|
+
* from the content (each command has a sensible default length, and drawing a line takes as
|
|
1395
|
+
* long as the line is long), so there are no keyframes to manage. The same scene plays the
|
|
1396
|
+
* same frames every time: every frame is a pure function of time.
|
|
1397
|
+
*/
|
|
1398
|
+
interface MotionScene {
|
|
1399
|
+
/** Format version (always 1). */
|
|
1400
|
+
version: 1;
|
|
1401
|
+
/** A short name, e.g. `logo-reveal`. */
|
|
1402
|
+
name: string;
|
|
1403
|
+
description?: string;
|
|
1404
|
+
/** The artwork in its resting state. Commands target its node ids. */
|
|
1405
|
+
artwork: VectorDocument;
|
|
1406
|
+
shots: MotionShot[];
|
|
1407
|
+
/** Playback past the end: stop (`none`, default), `loop` or `ping-pong`. */
|
|
1408
|
+
loop?: AnimationLoopMode;
|
|
1409
|
+
/**
|
|
1410
|
+
* Plays in answer to the viewer instead of on its own (exported to Flair's player):
|
|
1411
|
+
* - `click`: nothing plays until the viewer clicks; each click plays the next shot, and after the
|
|
1412
|
+
* last one a click plays the first again, so a last shot that puts things back makes a toggle.
|
|
1413
|
+
* - `hover` / `press`: plays forward while the pointer is over (or down on) it, and back when it leaves.
|
|
1414
|
+
* - `scroll`: scrubs through the scene as it scrolls through the viewport.
|
|
1415
|
+
* The editor previews it played through; `loop` does not apply.
|
|
1416
|
+
*/
|
|
1417
|
+
trigger?: MotionTrigger;
|
|
1418
|
+
/** Frame rate used to sample motion that a target format cannot express exactly (default 30). */
|
|
1419
|
+
fps?: number;
|
|
1420
|
+
/**
|
|
1421
|
+
* Stepped time for every command that gives none: changes hold on a grid of this many frames
|
|
1422
|
+
* per second ("on twos" at 12), for a hand-drawn look. Default: smooth.
|
|
1423
|
+
*/
|
|
1424
|
+
steps?: number;
|
|
1425
|
+
/** A beat grid to cue shots to (`MotionShot.at.beat`): music or a voiceover's rhythm. */
|
|
1426
|
+
beat?: MotionBeatGrid;
|
|
1427
|
+
/** A voiceover's words with their times, to cue shots to (`MotionShot.at.word`). */
|
|
1428
|
+
narration?: MotionNarration;
|
|
1429
|
+
/** Wanted length in seconds `[min, max]`; `check` warns outside it. */
|
|
1430
|
+
target?: [number, number];
|
|
1431
|
+
/**
|
|
1432
|
+
* Reusable motion: named command lists written against the target `"$"`, played on any
|
|
1433
|
+
* node with a `play` command (a "pop and settle" or "attention" you use many times).
|
|
1434
|
+
*/
|
|
1435
|
+
clips?: Record<string, MotionClip>;
|
|
1436
|
+
/**
|
|
1437
|
+
* Properties that follow other properties: a background moving at half the speed of the
|
|
1438
|
+
* foreground (parallax), a wheel turning as it rolls. Each adds to what its target's commands do.
|
|
1439
|
+
*/
|
|
1440
|
+
drivers?: MotionDriver[];
|
|
1441
|
+
/**
|
|
1442
|
+
* Motion blur on the stage and in rendered frames (not in exports): each frame averages a few
|
|
1443
|
+
* moments across the shutter, more for faster motion.
|
|
1444
|
+
*/
|
|
1445
|
+
motionBlur?: MotionBlur;
|
|
1446
|
+
/** Parameters a Flair effect made from this scene exposes (see `toFlairVectorEffect`). */
|
|
1447
|
+
controls?: MotionControl[];
|
|
1448
|
+
/** Named sets of control values. */
|
|
1449
|
+
presets?: MotionPreset[];
|
|
1450
|
+
}
|
|
1451
|
+
/** What the viewer does to play a triggered scene (see `MotionScene.trigger`). */
|
|
1452
|
+
type MotionTrigger = 'click' | 'hover' | 'press' | 'scroll';
|
|
1453
|
+
declare const MOTION_TRIGGERS: readonly MotionTrigger[];
|
|
1454
|
+
/** A rectangle of the artwork, in document units. */
|
|
1455
|
+
interface MotionRect {
|
|
1456
|
+
x: number;
|
|
1457
|
+
y: number;
|
|
1458
|
+
width: number;
|
|
1459
|
+
height: number;
|
|
1460
|
+
}
|
|
1461
|
+
/**
|
|
1462
|
+
* Where the camera looks: a rectangle, or the id of a node to frame (with `padding` around
|
|
1463
|
+
* its bounds, default 24). The camera eases there over `ms` (default 1000; the first shot cuts).
|
|
1464
|
+
*/
|
|
1465
|
+
type MotionCamera = (MotionRect | {
|
|
1466
|
+
frame: string;
|
|
1467
|
+
padding?: number;
|
|
1468
|
+
}) & {
|
|
1469
|
+
ease?: AnimationEasing;
|
|
1470
|
+
ms?: number;
|
|
1471
|
+
/** Zoom at a steady rate (the size changes by the same factor each moment) instead of linearly. */
|
|
1472
|
+
geometric?: boolean;
|
|
1473
|
+
};
|
|
1474
|
+
/** A steady beat: `bpm` beats a minute, the first at `offset` ms, `meter` beats a bar. */
|
|
1475
|
+
interface MotionBeatGrid {
|
|
1476
|
+
bpm: number;
|
|
1477
|
+
/** When beat 0 falls, ms (default 0). */
|
|
1478
|
+
offset?: number;
|
|
1479
|
+
/** Beats in a bar (default 4), for reading beats as bar and beat. */
|
|
1480
|
+
meter?: number;
|
|
1481
|
+
}
|
|
1482
|
+
/** A voiceover: its words in order, each with when it is said (ms), from a TTS or speech-to-text word timing. */
|
|
1483
|
+
interface MotionNarration {
|
|
1484
|
+
words: {
|
|
1485
|
+
text: string;
|
|
1486
|
+
start: number;
|
|
1487
|
+
end?: number;
|
|
1488
|
+
}[];
|
|
1489
|
+
}
|
|
1490
|
+
/** When a shot is cued to start: on a beat, on a narration word, or at a time. */
|
|
1491
|
+
interface MotionCue {
|
|
1492
|
+
/** Beat number on the scene's beat grid, from 0 (fractions for off-beats: 2.5 is the "and" of beat 3). */
|
|
1493
|
+
beat?: number;
|
|
1494
|
+
/** Index of a word in the scene's narration, from 0. */
|
|
1495
|
+
word?: number;
|
|
1496
|
+
/** A time in ms. */
|
|
1497
|
+
ms?: number;
|
|
1498
|
+
}
|
|
1499
|
+
/** One beat of the animation. */
|
|
1500
|
+
interface MotionShot {
|
|
1501
|
+
/** Stable id (unique in the scene), e.g. `intro`. */
|
|
1502
|
+
id: string;
|
|
1503
|
+
/** What happens in this shot, in a few words (shown on the timeline). */
|
|
1504
|
+
label?: string;
|
|
1505
|
+
/** Omit to keep the current framing. */
|
|
1506
|
+
camera?: MotionCamera;
|
|
1507
|
+
/**
|
|
1508
|
+
* Start on a cue: a beat, a narration word or a time. The shot before holds until then; a
|
|
1509
|
+
* cue that comes before the shot before has ended is missed (`check` says by how much).
|
|
1510
|
+
* Give one of `beat`, `word` or `ms`.
|
|
1511
|
+
*/
|
|
1512
|
+
at?: MotionCue;
|
|
1513
|
+
/** Commands, played one after another (unless a command says `with: "previous"`). */
|
|
1514
|
+
run: MotionCommand[];
|
|
1515
|
+
/** Milliseconds to hold after the commands finish (default 600). */
|
|
1516
|
+
hold?: number;
|
|
1517
|
+
/**
|
|
1518
|
+
* Plays the whole shot this many times as fast (default 1): its camera move, delays,
|
|
1519
|
+
* durations, staggers and hold all scale by 1 / speed. `fit_animation` sets it to fit a length.
|
|
1520
|
+
*/
|
|
1521
|
+
speed?: number;
|
|
1522
|
+
}
|
|
1523
|
+
/** How `split` splits outlined text. */
|
|
1524
|
+
type MotionTextUnit = 'letter' | 'word' | 'line';
|
|
1525
|
+
declare const MOTION_TEXT_UNITS: readonly MotionTextUnit[];
|
|
1526
|
+
/** The order `split` units animate in. */
|
|
1527
|
+
type MotionCascade = 'forward' | 'backward' | 'center' | 'edges' | 'random';
|
|
1528
|
+
declare const MOTION_CASCADES: readonly MotionCascade[];
|
|
1529
|
+
/** Fields every command takes. */
|
|
1530
|
+
interface MotionCommandBase {
|
|
1531
|
+
/** Node ids from the artwork (groups animate as one, unless `split` splits their text). */
|
|
1532
|
+
targets: string[];
|
|
1533
|
+
/**
|
|
1534
|
+
* For outlined text (a group of letter paths): animate it a letter, word or line at a time,
|
|
1535
|
+
* staggered in reading order (default stagger 40 ms a letter, 120 a word, 300 a line).
|
|
1536
|
+
*/
|
|
1537
|
+
split?: MotionTextUnit;
|
|
1538
|
+
/** With `split`: the order units go in (default `forward`). `random` is the same every time. */
|
|
1539
|
+
cascade?: MotionCascade;
|
|
1540
|
+
/** Length in ms for each target, one cycle when repeating (each type has a default; `draw` follows the path length; a spring `ease` lasts until it settles). */
|
|
1541
|
+
duration?: number;
|
|
1542
|
+
/** Wait this many ms before starting (default 0). */
|
|
1543
|
+
delay?: number;
|
|
1544
|
+
/** Start each further target this many ms after the one before (default 0). */
|
|
1545
|
+
stagger?: number;
|
|
1546
|
+
/** `after` (default) starts when the commands before it finish; `previous` starts with the command before. */
|
|
1547
|
+
with?: 'after' | 'previous';
|
|
1548
|
+
/** An easing; a spring with no `duration` lasts until it settles. */
|
|
1549
|
+
ease?: AnimationEasing;
|
|
1550
|
+
/** Why this command is here (for people and agents reading the scene). */
|
|
1551
|
+
note?: string;
|
|
1552
|
+
/**
|
|
1553
|
+
* Play the change this many times (a whole number, default 1); `duration` is one cycle. Not
|
|
1554
|
+
* for `enter`, `exit` or `wait`.
|
|
1555
|
+
*/
|
|
1556
|
+
repeat?: number;
|
|
1557
|
+
/**
|
|
1558
|
+
* How repeats follow each other: `loop` (default) starts each cycle afresh, `mirror` plays
|
|
1559
|
+
* every other one backwards, `offset` carries on from where the last ended (rotate by 90,
|
|
1560
|
+
* repeat 4: a full turn). Colours and shapes offset like `loop`.
|
|
1561
|
+
*/
|
|
1562
|
+
repeatMode?: 'loop' | 'mirror' | 'offset';
|
|
1563
|
+
/** Stepped time: hold the change on a grid of this many frames per second (default: the scene's `steps`, else smooth). */
|
|
1564
|
+
steps?: number;
|
|
1565
|
+
/**
|
|
1566
|
+
* The provider effect this command came from (see `applyMotionEffect`): commands that share a
|
|
1567
|
+
* `source.instance` are one applied effect, changed or removed together. Plain commands have none.
|
|
1568
|
+
*/
|
|
1569
|
+
source?: MotionEffectSource;
|
|
1570
|
+
}
|
|
1571
|
+
/** Where a command came from when an effects provider made it (`@pixerate/editor/effects`). */
|
|
1572
|
+
interface MotionEffectSource {
|
|
1573
|
+
/** The applied effect's id in the scene (e.g. `fx1`), shared by all its commands. */
|
|
1574
|
+
instance: string;
|
|
1575
|
+
/** The provider's effect id. */
|
|
1576
|
+
effect: string;
|
|
1577
|
+
provider?: string;
|
|
1578
|
+
name?: string;
|
|
1579
|
+
/** The control values it was applied with. */
|
|
1580
|
+
values?: Record<string, EffectValue>;
|
|
1581
|
+
}
|
|
1582
|
+
type MotionEnterStyle = 'fade' | 'pop' | 'grow' | 'slide' | 'draw' | 'zoom' | 'rise' | 'wipe' | 'iris' | 'split';
|
|
1583
|
+
type MotionExitStyle = 'fade' | 'shrink' | 'slide' | 'undraw' | 'wipe';
|
|
1584
|
+
type MotionDirection = 'up' | 'down' | 'left' | 'right';
|
|
1585
|
+
/** The opening an `iris` reveals through. */
|
|
1586
|
+
type MotionIrisShape = 'circle' | 'box';
|
|
1587
|
+
/** The line a `split` opens from. */
|
|
1588
|
+
type MotionSplitOrientation = 'horizontal' | 'vertical';
|
|
1589
|
+
/**
|
|
1590
|
+
* Brings hidden targets in. Targets entered in a shot are hidden before it. Each style is a
|
|
1591
|
+
* Flair motion primitive (`entrance.<style>`) with the same defaults.
|
|
1592
|
+
*/
|
|
1593
|
+
interface MotionEnterCommand extends MotionCommandBase, MotionDrawOrder {
|
|
1594
|
+
type: 'enter';
|
|
1595
|
+
/**
|
|
1596
|
+
* Default `fade`. `draw` draws the outline on, then fades the fill in. `pop` scales up past
|
|
1597
|
+
* full size and settles; `zoom` settles from larger; `rise` rises a short way with a little
|
|
1598
|
+
* overshoot. `wipe`, `iris` and `split` reveal the target through a clip over its box (see
|
|
1599
|
+
* `MotionFrame.clips`), reaching past it far enough to show its whole stroke.
|
|
1600
|
+
*/
|
|
1601
|
+
style?: MotionEnterStyle;
|
|
1602
|
+
/**
|
|
1603
|
+
* For `slide`: the direction of travel (default `up`). For `wipe`: the way the edge travels
|
|
1604
|
+
* (default `right`, which reveals from the left).
|
|
1605
|
+
*/
|
|
1606
|
+
direction?: MotionDirection;
|
|
1607
|
+
/** For `slide` (default 40) and `rise` (default 20): how far in document units. */
|
|
1608
|
+
distance?: number;
|
|
1609
|
+
/** For `pop` (default 0.5) and `zoom` (default 1.6): the starting scale. */
|
|
1610
|
+
scale?: number;
|
|
1611
|
+
/** For `iris`: open through a `circle` (default; an ellipse on a box that is not square) or a `box`. */
|
|
1612
|
+
shape?: MotionIrisShape;
|
|
1613
|
+
/** For `split`: open up and down from a `horizontal` line through the middle (default), or left and right from a `vertical` one. */
|
|
1614
|
+
orientation?: MotionSplitOrientation;
|
|
1615
|
+
}
|
|
1616
|
+
/** Takes targets out. */
|
|
1617
|
+
interface MotionExitCommand extends MotionCommandBase, MotionDrawOrder {
|
|
1618
|
+
type: 'exit';
|
|
1619
|
+
/** Default `fade`. `wipe` hides the target behind an edge travelling `direction` (a wipe in, reversed). */
|
|
1620
|
+
style?: MotionExitStyle;
|
|
1621
|
+
/** For `slide`: the direction of travel (default `down`). For `wipe`: the way the edge travels (default `right`, which hides from the left). */
|
|
1622
|
+
direction?: MotionDirection;
|
|
1623
|
+
distance?: number;
|
|
1624
|
+
}
|
|
1625
|
+
/**
|
|
1626
|
+
* How the strokes of a group (or several paths) draw on or off together. Default: all at once,
|
|
1627
|
+
* each over the whole time.
|
|
1628
|
+
*/
|
|
1629
|
+
interface MotionDrawOrder {
|
|
1630
|
+
/** `together` (default) or `sequence`: one stroke after another, each for a time in proportion to its length. */
|
|
1631
|
+
order?: 'together' | 'sequence';
|
|
1632
|
+
/** With `together`: `time` (default) gives every stroke the whole time; `speed` draws them all at one speed, so short ones take less. */
|
|
1633
|
+
pace?: 'time' | 'speed';
|
|
1634
|
+
/** With `pace: "speed"`: `start` (default) starts them together, `end` finishes them together. */
|
|
1635
|
+
align?: 'start' | 'end';
|
|
1636
|
+
/** With `sequence`: `document` (default, stacking order) or `distance` from `origin` (a radial reveal). */
|
|
1637
|
+
sortBy?: 'document' | 'distance';
|
|
1638
|
+
/** With `sortBy: "distance"`: the point (document units) strokes are drawn out from (default the target's centre). */
|
|
1639
|
+
origin?: {
|
|
1640
|
+
x: number;
|
|
1641
|
+
y: number;
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
/** Draws a stroke on (or off) between two fractions of its length. */
|
|
1645
|
+
interface MotionDrawCommand extends MotionCommandBase, MotionDrawOrder {
|
|
1646
|
+
type: 'draw';
|
|
1647
|
+
/**
|
|
1648
|
+
* A travelling stroke this fraction of the length long (0–1): it runs along the path and off
|
|
1649
|
+
* the end, instead of drawing it on and leaving it.
|
|
1650
|
+
*/
|
|
1651
|
+
comet?: number;
|
|
1652
|
+
/** Fraction drawn at the end (default 1). */
|
|
1653
|
+
to?: number;
|
|
1654
|
+
/** Fraction drawn at the start (default: what is drawn now). */
|
|
1655
|
+
from?: number;
|
|
1656
|
+
}
|
|
1657
|
+
/** Moves targets by an offset, or to a point (their centre lands there). */
|
|
1658
|
+
interface MotionMoveCommand extends MotionCommandBase {
|
|
1659
|
+
/**
|
|
1660
|
+
* `add` makes the change a layer over the pose instead of a change to it: it stacks on
|
|
1661
|
+
* whatever else moves the target (a shake on a slide), and what it adds stays once it ends.
|
|
1662
|
+
* Default `replace` for move, rotate and scale (the later change takes over), `add` for
|
|
1663
|
+
* pulse, shake, teeter, wave and wiggle.
|
|
1664
|
+
*/
|
|
1665
|
+
blend?: 'replace' | 'add';
|
|
1666
|
+
type: 'move';
|
|
1667
|
+
by?: {
|
|
1668
|
+
x: number;
|
|
1669
|
+
y: number;
|
|
1670
|
+
};
|
|
1671
|
+
to?: {
|
|
1672
|
+
x: number;
|
|
1673
|
+
y: number;
|
|
1674
|
+
};
|
|
1675
|
+
/**
|
|
1676
|
+
* Points (document units) the centre passes through on the way, in order. The path is
|
|
1677
|
+
* smooth (velocity carries through each point) and never overshoots a point.
|
|
1678
|
+
*/
|
|
1679
|
+
via?: {
|
|
1680
|
+
x: number;
|
|
1681
|
+
y: number;
|
|
1682
|
+
}[];
|
|
1683
|
+
/** With `via`: `even` (default) keeps the speed steady along the path, `equal` gives each leg the same time. */
|
|
1684
|
+
pacing?: 'even' | 'equal';
|
|
1685
|
+
}
|
|
1686
|
+
/** Turns targets about their centre, by or to an angle in degrees (clockwise). */
|
|
1687
|
+
interface MotionRotateCommand extends MotionCommandBase {
|
|
1688
|
+
/**
|
|
1689
|
+
* `add` makes the change a layer over the pose instead of a change to it: it stacks on
|
|
1690
|
+
* whatever else moves the target (a shake on a slide), and what it adds stays once it ends.
|
|
1691
|
+
* Default `replace` for move, rotate and scale (the later change takes over), `add` for
|
|
1692
|
+
* pulse, shake, teeter, wave and wiggle.
|
|
1693
|
+
*/
|
|
1694
|
+
blend?: 'replace' | 'add';
|
|
1695
|
+
type: 'rotate';
|
|
1696
|
+
by?: number;
|
|
1697
|
+
to?: number;
|
|
1698
|
+
}
|
|
1699
|
+
/** Scales targets about their centre (1 = rest size). */
|
|
1700
|
+
interface MotionScaleCommand extends MotionCommandBase {
|
|
1701
|
+
/**
|
|
1702
|
+
* `add` makes the change a layer over the pose instead of a change to it: it stacks on
|
|
1703
|
+
* whatever else moves the target (a shake on a slide), and what it adds stays once it ends.
|
|
1704
|
+
* Default `replace` for move, rotate and scale (the later change takes over), `add` for
|
|
1705
|
+
* pulse, shake, teeter, wave and wiggle.
|
|
1706
|
+
*/
|
|
1707
|
+
blend?: 'replace' | 'add';
|
|
1708
|
+
type: 'scale';
|
|
1709
|
+
to: number | {
|
|
1710
|
+
x: number;
|
|
1711
|
+
y: number;
|
|
1712
|
+
};
|
|
1713
|
+
/** Grow at a steady rate (the same factor each moment), which reads as an even zoom. */
|
|
1714
|
+
geometric?: boolean;
|
|
1715
|
+
}
|
|
1716
|
+
/** Changes opacity (0–1). */
|
|
1717
|
+
interface MotionFadeCommand extends MotionCommandBase {
|
|
1718
|
+
type: 'fade';
|
|
1719
|
+
to: number;
|
|
1720
|
+
}
|
|
1721
|
+
/** Changes solid paints and stroke width. Colours mix in OKLab. */
|
|
1722
|
+
interface MotionStyleCommand extends MotionCommandBase {
|
|
1723
|
+
type: 'style';
|
|
1724
|
+
fill?: string;
|
|
1725
|
+
stroke?: string;
|
|
1726
|
+
strokeWidth?: number;
|
|
1727
|
+
}
|
|
1728
|
+
/** Morphs each target into the shape of another node (`into`), which usually stays hidden. */
|
|
1729
|
+
interface MotionMorphCommand extends MotionCommandBase {
|
|
1730
|
+
type: 'morph';
|
|
1731
|
+
into: string;
|
|
1732
|
+
}
|
|
1733
|
+
/**
|
|
1734
|
+
* Smart Animate: tweens a group into another group (`into`, usually hidden), part by part. Each
|
|
1735
|
+
* part of the target takes the shape, paint and place of its partner in `into`, paired by name,
|
|
1736
|
+
* then by id (`card-a-title` ↔ `card-b-title`), then by kind in order. Parts with no partner fade
|
|
1737
|
+
* out; parts of `into` with no partner do not appear (`check` lists them).
|
|
1738
|
+
*/
|
|
1739
|
+
interface MotionMatchCommand extends MotionCommandBase {
|
|
1740
|
+
type: 'match';
|
|
1741
|
+
/** Id of the group (or node) to become. */
|
|
1742
|
+
into: string;
|
|
1743
|
+
}
|
|
1744
|
+
/** A reusable piece of motion: commands that target `"$"` (whatever `play` names), timed as in a shot. */
|
|
1745
|
+
interface MotionClip {
|
|
1746
|
+
description?: string;
|
|
1747
|
+
/** Commands, timed as in a shot; `"$"` in `targets` stands for the node played on. Clips cannot play clips. */
|
|
1748
|
+
run: MotionCommand[];
|
|
1749
|
+
}
|
|
1750
|
+
/** Motion blur: how long the shutter is open and how many moments a frame averages at most. */
|
|
1751
|
+
interface MotionBlur {
|
|
1752
|
+
/** Shutter angle in degrees of a frame at the scene's fps (default 180: half a frame; 360 is a whole frame). */
|
|
1753
|
+
shutter?: number;
|
|
1754
|
+
/** Most moments a frame averages (default 8, at most 32); fewer for slower motion. */
|
|
1755
|
+
samples?: number;
|
|
1756
|
+
}
|
|
1757
|
+
/** Properties a driver reads and drives: offsets (document units), turn (degrees), scales and opacity. */
|
|
1758
|
+
type MotionDrivenProperty = 'x' | 'y' | 'rotation' | 'scaleX' | 'scaleY' | 'opacity';
|
|
1759
|
+
declare const MOTION_DRIVEN_PROPERTIES: readonly MotionDrivenProperty[];
|
|
1760
|
+
/**
|
|
1761
|
+
* One property following another. Both are read as a change from rest (offsets and turns from
|
|
1762
|
+
* 0, scales and opacity from 1): the target's property changes by `source change · factor + offset`,
|
|
1763
|
+
* clamped to `clamp`, on top of its own commands (added to offsets and turns, multiplied into
|
|
1764
|
+
* scales and opacity as 1 + change).
|
|
1765
|
+
*/
|
|
1766
|
+
interface MotionDriver {
|
|
1767
|
+
/** The node that follows. */
|
|
1768
|
+
target: string;
|
|
1769
|
+
property: MotionDrivenProperty;
|
|
1770
|
+
/** The node and property it follows. */
|
|
1771
|
+
source: {
|
|
1772
|
+
node: string;
|
|
1773
|
+
property: MotionDrivenProperty;
|
|
1774
|
+
};
|
|
1775
|
+
/** Default 1 (0.5 moves at half the speed; 360 / (2π·radius) turns a wheel by how far it rolls). */
|
|
1776
|
+
factor?: number;
|
|
1777
|
+
/** Added to the change (default 0). */
|
|
1778
|
+
offset?: number;
|
|
1779
|
+
/** Limits the change to `[min, max]`. */
|
|
1780
|
+
clamp?: [number, number];
|
|
1781
|
+
}
|
|
1782
|
+
/** The placeholder target in a clip's commands. */
|
|
1783
|
+
declare const MOTION_CLIP_TARGET = "$";
|
|
1784
|
+
/** Plays a clip (`scene.clips`) on the targets: its commands, with `"$"` standing for each target. */
|
|
1785
|
+
interface MotionPlayCommand extends MotionCommandBase {
|
|
1786
|
+
type: 'play';
|
|
1787
|
+
/** The clip's name. */
|
|
1788
|
+
clip: string;
|
|
1789
|
+
/** Play it this many times as fast (default 1). */
|
|
1790
|
+
speed?: number;
|
|
1791
|
+
}
|
|
1792
|
+
/** Moves targets along a path node, centre on the path. */
|
|
1793
|
+
interface MotionFollowCommand extends MotionCommandBase {
|
|
1794
|
+
type: 'follow';
|
|
1795
|
+
/** Id of a path node in the artwork (it can be hidden). */
|
|
1796
|
+
path: string;
|
|
1797
|
+
/**
|
|
1798
|
+
* Turn with the path's direction (default false). Moves, shakes and wiggles made during the
|
|
1799
|
+
* follow then turn with it too: they are offsets from the target's place on the path.
|
|
1800
|
+
*/
|
|
1801
|
+
rotate?: boolean;
|
|
1802
|
+
/** Fractions of the path's length to travel between (default 0 → 1). */
|
|
1803
|
+
from?: number;
|
|
1804
|
+
to?: number;
|
|
1805
|
+
}
|
|
1806
|
+
/** Scales up and back, `count` times (draws the eye). */
|
|
1807
|
+
interface MotionPulseCommand extends MotionCommandBase {
|
|
1808
|
+
/**
|
|
1809
|
+
* `add` makes the change a layer over the pose instead of a change to it: it stacks on
|
|
1810
|
+
* whatever else moves the target (a shake on a slide), and what it adds stays once it ends.
|
|
1811
|
+
* Default `replace` for move, rotate and scale (the later change takes over), `add` for
|
|
1812
|
+
* pulse, shake, teeter, wave and wiggle.
|
|
1813
|
+
*/
|
|
1814
|
+
blend?: 'replace' | 'add';
|
|
1815
|
+
type: 'pulse';
|
|
1816
|
+
/** Extra scale at the peak (default 0.15). */
|
|
1817
|
+
amount?: number;
|
|
1818
|
+
count?: number;
|
|
1819
|
+
}
|
|
1820
|
+
/** Shakes side to side (or up and down), settling. */
|
|
1821
|
+
interface MotionShakeCommand extends MotionCommandBase {
|
|
1822
|
+
/**
|
|
1823
|
+
* `add` makes the change a layer over the pose instead of a change to it: it stacks on
|
|
1824
|
+
* whatever else moves the target (a shake on a slide), and what it adds stays once it ends.
|
|
1825
|
+
* Default `replace` for move, rotate and scale (the later change takes over), `add` for
|
|
1826
|
+
* pulse, shake, teeter, wave and wiggle.
|
|
1827
|
+
*/
|
|
1828
|
+
blend?: 'replace' | 'add';
|
|
1829
|
+
type: 'shake';
|
|
1830
|
+
/** Distance in document units (default 8). */
|
|
1831
|
+
amount?: number;
|
|
1832
|
+
count?: number;
|
|
1833
|
+
/** Default `horizontal`. */
|
|
1834
|
+
axis?: 'horizontal' | 'vertical';
|
|
1835
|
+
}
|
|
1836
|
+
/** Rocks about the centre by `angle` either way, settling (Flair's `emphasis.teeter`). */
|
|
1837
|
+
interface MotionTeeterCommand extends MotionCommandBase {
|
|
1838
|
+
/**
|
|
1839
|
+
* `add` makes the change a layer over the pose instead of a change to it: it stacks on
|
|
1840
|
+
* whatever else moves the target (a shake on a slide), and what it adds stays once it ends.
|
|
1841
|
+
* Default `replace` for move, rotate and scale (the later change takes over), `add` for
|
|
1842
|
+
* pulse, shake, teeter, wave and wiggle.
|
|
1843
|
+
*/
|
|
1844
|
+
blend?: 'replace' | 'add';
|
|
1845
|
+
type: 'teeter';
|
|
1846
|
+
/** Degrees either way (default 8). */
|
|
1847
|
+
angle?: number;
|
|
1848
|
+
/** Rocks (default 3). */
|
|
1849
|
+
count?: number;
|
|
1850
|
+
}
|
|
1851
|
+
/** Bobs up and down without settling, like something floating (Flair's `emphasis.wave`). */
|
|
1852
|
+
interface MotionWaveCommand extends MotionCommandBase {
|
|
1853
|
+
/**
|
|
1854
|
+
* `add` makes the change a layer over the pose instead of a change to it: it stacks on
|
|
1855
|
+
* whatever else moves the target (a shake on a slide), and what it adds stays once it ends.
|
|
1856
|
+
* Default `replace` for move, rotate and scale (the later change takes over), `add` for
|
|
1857
|
+
* pulse, shake, teeter, wave and wiggle.
|
|
1858
|
+
*/
|
|
1859
|
+
blend?: 'replace' | 'add';
|
|
1860
|
+
type: 'wave';
|
|
1861
|
+
/** Height in document units (default 6). */
|
|
1862
|
+
amount?: number;
|
|
1863
|
+
/** Bobs (default 2). */
|
|
1864
|
+
count?: number;
|
|
1865
|
+
}
|
|
1866
|
+
/**
|
|
1867
|
+
* Wanders about its place as smooth seeded noise, easing out of and back to rest (Flair's
|
|
1868
|
+
* `emphasis.wiggle`). The same seed always wanders the same way.
|
|
1869
|
+
*/
|
|
1870
|
+
interface MotionWiggleCommand extends MotionCommandBase {
|
|
1871
|
+
/**
|
|
1872
|
+
* `add` makes the change a layer over the pose instead of a change to it: it stacks on
|
|
1873
|
+
* whatever else moves the target (a shake on a slide), and what it adds stays once it ends.
|
|
1874
|
+
* Default `replace` for move, rotate and scale (the later change takes over), `add` for
|
|
1875
|
+
* pulse, shake, teeter, wave and wiggle.
|
|
1876
|
+
*/
|
|
1877
|
+
blend?: 'replace' | 'add';
|
|
1878
|
+
type: 'wiggle';
|
|
1879
|
+
/** Up to about this far, in document units (default 6). */
|
|
1880
|
+
amount?: number;
|
|
1881
|
+
/** Wanders per second, in Hz (default 3). */
|
|
1882
|
+
frequency?: number;
|
|
1883
|
+
/** Layers of finer detail (default 2). */
|
|
1884
|
+
octaves?: number;
|
|
1885
|
+
/** Also turns about the centre by up to about this many degrees (default 0). */
|
|
1886
|
+
rotate?: number;
|
|
1887
|
+
/** A whole number; default: one picked from the target's id, so each target wanders its own way. */
|
|
1888
|
+
seed?: number;
|
|
1889
|
+
}
|
|
1890
|
+
/** Tints solid paint toward a colour and back, `count` times (Flair's `emphasis.color-pulse`). */
|
|
1891
|
+
interface MotionColorPulseCommand extends MotionCommandBase {
|
|
1892
|
+
type: 'color-pulse';
|
|
1893
|
+
/** The tint (default `#f59e0b`). Mixes in OKLab. */
|
|
1894
|
+
color?: string;
|
|
1895
|
+
/** Which paint (default `fill`). On a group it tints every path in it. */
|
|
1896
|
+
paint?: 'fill' | 'stroke';
|
|
1897
|
+
count?: number;
|
|
1898
|
+
}
|
|
1899
|
+
/** Tweens a numeric parameter of a live path effect on the target (twist angle, wiggle time, zig zag size…). */
|
|
1900
|
+
interface MotionEffectCommand extends MotionCommandBase {
|
|
1901
|
+
type: 'effect';
|
|
1902
|
+
/** Id of an effect in the target node's `effects`. */
|
|
1903
|
+
effect: string;
|
|
1904
|
+
/** A numeric parameter of that effect, e.g. `angle`. */
|
|
1905
|
+
param: string;
|
|
1906
|
+
to: number;
|
|
1907
|
+
}
|
|
1908
|
+
/** Does nothing for `duration` ms. */
|
|
1909
|
+
interface MotionWaitCommand {
|
|
1910
|
+
type: 'wait';
|
|
1911
|
+
duration: number;
|
|
1912
|
+
with?: 'after' | 'previous';
|
|
1913
|
+
note?: string;
|
|
1914
|
+
}
|
|
1915
|
+
type MotionCommand = MotionEnterCommand | MotionExitCommand | MotionDrawCommand | MotionMoveCommand | MotionRotateCommand | MotionScaleCommand | MotionFadeCommand | MotionStyleCommand | MotionMorphCommand | MotionMatchCommand | MotionPlayCommand | MotionFollowCommand | MotionPulseCommand | MotionShakeCommand | MotionTeeterCommand | MotionWaveCommand | MotionWiggleCommand | MotionColorPulseCommand | MotionEffectCommand | MotionWaitCommand;
|
|
1916
|
+
type MotionCommandType = MotionCommand['type'];
|
|
1917
|
+
declare const MOTION_COMMAND_TYPES: readonly MotionCommandType[];
|
|
1918
|
+
declare const MOTION_ENTER_STYLES: readonly MotionEnterStyle[];
|
|
1919
|
+
declare const MOTION_BLENDS: readonly ["replace", "add"];
|
|
1920
|
+
declare const MOTION_REPEAT_MODES: readonly ["loop", "mirror", "offset"];
|
|
1921
|
+
declare const MOTION_EXIT_STYLES: readonly MotionExitStyle[];
|
|
1922
|
+
declare const MOTION_IRIS_SHAPES: readonly MotionIrisShape[];
|
|
1923
|
+
declare const MOTION_SPLIT_ORIENTATIONS: readonly MotionSplitOrientation[];
|
|
1924
|
+
declare const MOTION_DIRECTIONS: readonly MotionDirection[];
|
|
1925
|
+
/**
|
|
1926
|
+
* A colour parameter of the effect made from the scene: it stands for every use of its
|
|
1927
|
+
* `default` colour in the artwork and the commands, so recolouring it recolours them all.
|
|
1928
|
+
*/
|
|
1929
|
+
interface MotionControl {
|
|
1930
|
+
/** Identifier, e.g. `accent`. */
|
|
1931
|
+
name: string;
|
|
1932
|
+
type: 'color';
|
|
1933
|
+
/** A `#rrggbb` colour used in the scene. */
|
|
1934
|
+
default: string;
|
|
1935
|
+
label?: string;
|
|
1936
|
+
}
|
|
1937
|
+
interface MotionPreset {
|
|
1938
|
+
name: string;
|
|
1939
|
+
values: Record<string, string>;
|
|
1940
|
+
}
|
|
1941
|
+
/** Default lengths (ms) of commands that give none. */
|
|
1942
|
+
declare const MOTION_DEFAULT_DURATIONS: Readonly<Record<Exclude<MotionCommandType, 'wait' | 'draw'>, number>>;
|
|
1943
|
+
/** Default hold after a shot's commands (ms). */
|
|
1944
|
+
declare const MOTION_DEFAULT_HOLD = 600;
|
|
1945
|
+
/** Default camera move (ms). */
|
|
1946
|
+
declare const MOTION_CAMERA_MS = 1000;
|
|
1947
|
+
/** `draw` lasts `length × MOTION_DRAW_MS_PER_UNIT`, clamped to `MOTION_DRAW_RANGE`. */
|
|
1948
|
+
declare const MOTION_DRAW_MS_PER_UNIT = 1.5;
|
|
1949
|
+
declare const MOTION_DRAW_RANGE: readonly [number, number];
|
|
1950
|
+
/**
|
|
1951
|
+
* The Flair motion primitive (`@pixerate/flair/motion`) a command plays, or undefined when
|
|
1952
|
+
* Flair has none (`move`, `scale`, `fade`, `style`, `morph`, `effect`, `wait` are the editor's
|
|
1953
|
+
* own). Commands and primitives of the same name take the same parameters and defaults.
|
|
1954
|
+
*/
|
|
1955
|
+
declare function motionFlairPrimitive(command: MotionCommand): string | undefined;
|
|
1956
|
+
|
|
1957
|
+
/**
|
|
1958
|
+
* Helpers for providers and editors: value validation, catalog search, pixel buffers, masking,
|
|
1959
|
+
* and a provider slot editors hold.
|
|
1960
|
+
*/
|
|
1961
|
+
|
|
1962
|
+
/** Problems with `values` against an effect's control schema (unknown controls, types, ranges). Partial values are fine. */
|
|
1963
|
+
declare function effectValueErrors(description: Pick<EffectDescription, 'controls'>, values: unknown): SchemaValidationError[];
|
|
1964
|
+
/**
|
|
1965
|
+
* `values` over the effect's defaults, validated against its control schema. Throws
|
|
1966
|
+
* `EffectControlError` naming every bad control. Providers call this in `render`; editors call
|
|
1967
|
+
* it before saving values.
|
|
1968
|
+
*/
|
|
1969
|
+
declare function resolveEffectValues(description: Pick<EffectDescription, 'id' | 'controls' | 'defaults'>, values?: EffectValues): Record<string, EffectValues[string]>;
|
|
1970
|
+
/**
|
|
1971
|
+
* Filters a catalog and ranks it against `query` (every word must appear in the id, name,
|
|
1972
|
+
* category, tags or description; name matches rank first). An empty query keeps catalog order.
|
|
1973
|
+
* Providers can implement `list` and `search` with it.
|
|
1974
|
+
*/
|
|
1975
|
+
declare function searchEffectSummaries<T extends EffectSummary>(catalog: readonly T[], query?: string, options?: EffectSearchOptions): T[];
|
|
1976
|
+
/** A transparent picture, with float samples when `float` is set. */
|
|
1977
|
+
declare function createEffectPixels(width: number, height: number, float?: boolean): EffectPixels;
|
|
1978
|
+
/** True for an `EffectPixels` (rather than a host image object). */
|
|
1979
|
+
declare function isEffectPixels(source: EffectImageSource | unknown): source is EffectPixels;
|
|
1980
|
+
/** sRGB-encoded 0–1 to linear light. */
|
|
1981
|
+
declare const srgbToLinear: (v: number) => number;
|
|
1982
|
+
/** Linear light to sRGB-encoded (clamped below at 0; may exceed 1). */
|
|
1983
|
+
declare const linearToSrgb: (v: number) => number;
|
|
1984
|
+
/** Fills `pixels.data` from `pixels.float` (linear float to clamped 8-bit sRGB). */
|
|
1985
|
+
declare function encodeEffectFloat(pixels: EffectPixels): EffectPixels;
|
|
1986
|
+
/**
|
|
1987
|
+
* Blends an effect `result` back over its `source` by `mask` coverage (alpha channel), in place
|
|
1988
|
+
* on `result`: where the mask is 0 the source shows, where it is 255 the result. Without a
|
|
1989
|
+
* source (generators), the result's alpha is multiplied by coverage. Editors use it when the
|
|
1990
|
+
* provider does not `supportsMask`. All three must have the same size.
|
|
1991
|
+
*/
|
|
1992
|
+
declare function applyEffectMask(result: EffectPixels, mask: EffectPixels, source?: EffectPixels): EffectPixels;
|
|
1993
|
+
/**
|
|
1994
|
+
* Holds an editor's effects provider. Controllers expose it as `effectsProvider`,
|
|
1995
|
+
* `setEffectsProvider(provider | null)` and `useEffects(provider)`; listeners hear every change.
|
|
1996
|
+
*/
|
|
1997
|
+
declare class EffectsSlot {
|
|
1998
|
+
private current;
|
|
1999
|
+
private readonly listeners;
|
|
2000
|
+
get provider(): EffectProvider | null;
|
|
2001
|
+
set(provider: EffectProvider | null): void;
|
|
2002
|
+
/** Sets `provider` and returns a function that clears it again (if it is still the one set). */
|
|
2003
|
+
use(provider: EffectProvider): () => void;
|
|
2004
|
+
/** The provider, or a `NoEffectsProviderError`. */
|
|
2005
|
+
require(): EffectProvider;
|
|
2006
|
+
subscribe(listener: (provider: EffectProvider | null) => void): () => void;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
export { isEffectPixels as $, type EffectProviderCapabilities as A, type EffectRenderRequest as B, type EffectValue as C, type EffectDescription as D, type EffectProvider as E, type EffectPixels as F, type EffectSummary as G, EFFECT_KINDS as H, EFFECT_USES as I, type EffectControlSchema as J, type EffectImageSource as K, type EffectInputSpec as L, type EffectKind as M, type EffectPreset as N, type EffectRenderer as O, type EffectRendererOptions as P, type EffectSearchOptions as Q, type EffectSvgAnimation as R, type EffectValues as S, type EffectVectorMotion as T, type EffectVectorTarget as U, type VectorEffectType as V, EffectsSlot as W, applyEffectMask as X, createEffectPixels as Y, effectValueErrors as Z, encodeEffectFloat as _, type EffectUse as a, type MotionExitCommand as a$, linearToSrgb as a0, resolveEffectValues as a1, searchEffectSummaries as a2, srgbToLinear as a3, type MotionCommand as a4, type MotionShot as a5, type MotionScene as a6, type MotionDirection as a7, type MotionIrisShape as a8, type MotionSplitOrientation as a9, type FlairEaseName as aA, type FlairSpringEase as aB, type FlairSvgAnimation as aC, MOTION_BLENDS as aD, MOTION_CAMERA_MS as aE, MOTION_CASCADES as aF, MOTION_CLIP_TARGET as aG, MOTION_COMMAND_TYPES as aH, MOTION_DEFAULT_DURATIONS as aI, MOTION_DEFAULT_HOLD as aJ, MOTION_DIRECTIONS as aK, MOTION_DRAW_MS_PER_UNIT as aL, MOTION_DRAW_RANGE as aM, MOTION_DRIVEN_PROPERTIES as aN, MOTION_ENTER_STYLES as aO, MOTION_EXIT_STYLES as aP, MOTION_IRIS_SHAPES as aQ, MOTION_REPEAT_MODES as aR, MOTION_SPLIT_ORIENTATIONS as aS, MOTION_TEXT_UNITS as aT, MOTION_TRIGGERS as aU, type MotionColorPulseCommand as aV, type MotionCommandBase as aW, type MotionDrawCommand as aX, type MotionDrawOrder as aY, type MotionEffectCommand as aZ, type MotionEnterCommand as a_, type MotionDriver as aa, type MotionDrivenProperty as ab, type MotionRect as ac, type MotionBeatGrid as ad, type MotionCue as ae, type MotionCamera as af, type MotionTextUnit as ag, type MotionCascade as ah, type MotionBlur as ai, type MotionControl as aj, type MotionPreset as ak, type MotionClip as al, type FlairSvgMotion as am, type FlairVectorEffect as an, type MotionEffectSource as ao, type FlairExportOptions as ap, type FlairMotionExport as aq, type FlairEffectOptions as ar, type FlairEffectDocument as as, type MotionEnterStyle as at, type MotionExitStyle as au, type MotionCommandType as av, type MotionNarration as aw, FLAIR_EASES as ax, FLAIR_EXPORT_VERSION as ay, type FlairEase as az, type VectorEffectParamsMap as b, type VectorHorizontalResizing as b$, type MotionFadeCommand as b0, type MotionFollowCommand as b1, type MotionMatchCommand as b2, type MotionMorphCommand as b3, type MotionMoveCommand as b4, type MotionPlayCommand as b5, type MotionPulseCommand as b6, type MotionRotateCommand as b7, type MotionScaleCommand as b8, type MotionShakeCommand as b9, type VectorParagraphStyle as bA, type VectorTextFrame as bB, type VectorTransformHandle as bC, type VectorAnchorRef as bD, type VectorPathfinderOperation as bE, type VectorTool as bF, type VectorDefaults as bG, type VectorTextAlign as bH, type VectorStyle as bI, type VectorHandleRef as bJ, type VectorSegmentRef as bK, type VectorBlendOptions as bL, type VectorModifiers as bM, type VectorProviderEffect as bN, type VectorBlendMode as bO, type VectorAlign as bP, type VectorDistribute as bQ, type VectorArrange as bR, type VectorMaskType as bS, type VectorSymmetryMode as bT, type VectorSymmetry as bU, type VectorFreeformPoint as bV, type VectorMeshGradient as bW, type VectorFreeformGradient as bX, type VectorArrowhead as bY, type VectorResizing as bZ, type VectorFrame as b_, type MotionStyleCommand as ba, type MotionTeeterCommand as bb, type MotionTrigger as bc, type MotionWaitCommand as bd, type MotionWaveCommand as be, type MotionWiggleCommand as bf, flairAtLeast as bg, flairCurveFor as bh, flairEaseFor as bi, motionFlairPrimitive as bj, toFlairEffectDocument as bk, toFlairSvgMotion as bl, toFlairVectorEffect as bm, type VectorAnchor as bn, type VectorTextNode as bo, type VectorAnchorType as bp, type VectorCornerKind as bq, type VectorViewport as br, type VectorConnectorRoute as bs, type VectorConnectorSide as bt, type VectorConnectorEnd as bu, type VectorConnector as bv, type VectorConstraintKind as bw, type VectorConstraint as bx, type VectorCharacterStyle as by, type VectorTextRun as bz, type VectorPathNode as c, type VectorVerticalResizing as c0, type VectorMask as c1, type VectorAverageAxis as c2, type VectorSymbol as c3, type VectorParameter as c4, type VectorBlendSpacing as c5, type VectorGradientInterpolation as c6, type VectorStrokeGradientMode as c7, type VectorArrowAlign as c8, type VectorPaintLayer as c9, VECTOR_TOOLS as cA, VECTOR_TRANSFORM_HANDLES as cB, VECTOR_VERTICAL_RESIZING as cC, type VectorCorner as cD, type VectorGeomRef as cE, type VectorLineCap as cF, type VectorPathTextBaseline as cG, type VectorStrokeLayerKind as cH, type VectorTextRunStyle as cI, type VectorWarpStyle as cJ, type VectorStrokeLayer as ca, type VectorBlend as cb, type VectorMergeMode as cc, type VectorLineJoin as cd, type VectorStrokeSettings as ce, type VectorInstanceOverrides as cf, VECTOR_ARROWHEADS as cg, VECTOR_BLEND_MODES as ch, VECTOR_BLEND_SPACINGS as ci, VECTOR_CONNECTOR_ROUTES as cj, VECTOR_CONNECTOR_SIDES as ck, VECTOR_CONSTRAINT_KINDS as cl, VECTOR_CORNER_KINDS as cm, VECTOR_EFFECT_TYPES as cn, VECTOR_FILTER_TYPES as co, VECTOR_GRADIENT_INTERPOLATIONS as cp, VECTOR_GRADIENT_SPREADS as cq, VECTOR_GRADIENT_TYPES as cr, VECTOR_HORIZONTAL_RESIZING as cs, VECTOR_MASK_TYPES as ct, VECTOR_MERGE_MODES as cu, VECTOR_PATHFINDER_OPERATIONS as cv, VECTOR_PATH_TEXT_BASELINES as cw, VECTOR_STROKE_GRADIENT_MODES as cx, VECTOR_SYMMETRY_MODES as cy, VECTOR_TEXT_ALIGNS as cz, 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 VectorDocument as y, type VectorWidthPoint as z };
|