@popcraft/kit 0.1.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/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/dist/index.js +160558 -0
- package/package.json +40 -0
- package/types/design-script.d.ts +39 -0
- package/types/lib/agent/design-script/build.d.ts +35 -0
- package/types/lib/agent/design-script/check.d.ts +11 -0
- package/types/lib/agent/design-script/helper-names.d.ts +1 -0
- package/types/lib/agent/design-script/kit-modules.d.ts +43 -0
- package/types/lib/agent/design-script/recorder.d.ts +52 -0
- package/types/lib/agent/design-script/replay.d.ts +13 -0
- package/types/lib/agent/design-script/run-node.d.ts +2 -0
- package/types/lib/ai/audio-models.d.ts +66 -0
- package/types/lib/ai/content.d.ts +27 -0
- package/types/lib/ai/limits.d.ts +42 -0
- package/types/lib/audio/presentation/loudness.d.ts +80 -0
- package/types/lib/audio/presentation/types.d.ts +112 -0
- package/types/lib/brand/apply.d.ts +25 -0
- package/types/lib/brand/review-kits.d.ts +10 -0
- package/types/lib/brand/types.d.ts +20 -0
- package/types/lib/code/hash.d.ts +2 -0
- package/types/lib/document/auto-layout.d.ts +10 -0
- package/types/lib/document/breakpoints.d.ts +45 -0
- package/types/lib/document/clone.d.ts +6 -0
- package/types/lib/document/color.d.ts +52 -0
- package/types/lib/document/detach.d.ts +12 -0
- package/types/lib/document/effects.d.ts +60 -0
- package/types/lib/document/expressions.d.ts +78 -0
- package/types/lib/document/instance-layout.d.ts +94 -0
- package/types/lib/document/instances.d.ts +63 -0
- package/types/lib/document/libraries.d.ts +97 -0
- package/types/lib/document/node-delta.d.ts +21 -0
- package/types/lib/document/page-tokens.d.ts +16 -0
- package/types/lib/document/photo-frames.d.ts +14 -0
- package/types/lib/document/print-pages.d.ts +85 -0
- package/types/lib/document/scene-graph.d.ts +194 -0
- package/types/lib/document/scene3d.d.ts +76 -0
- package/types/lib/document/shader-graph-effects.d.ts +8 -0
- package/types/lib/document/shader-graph.d.ts +134 -0
- package/types/lib/document/shader-params.d.ts +65 -0
- package/types/lib/document/shape-to-path.d.ts +20 -0
- package/types/lib/document/text-styles.d.ts +28 -0
- package/types/lib/document/text-tokens.d.ts +6 -0
- package/types/lib/document/transform.d.ts +79 -0
- package/types/lib/document/transform3d.d.ts +99 -0
- package/types/lib/document/trim.d.ts +35 -0
- package/types/lib/document/types.d.ts +2560 -0
- package/types/lib/document/variables.d.ts +14 -0
- package/types/lib/editor/easing.d.ts +46 -0
- package/types/lib/editor/modes/types.d.ts +131 -0
- package/types/lib/editor/prototype-connect.d.ts +49 -0
- package/types/lib/editor/smart-animate.d.ts +37 -0
- package/types/lib/engine/geometry/flatten.d.ts +2 -0
- package/types/lib/engine/geometry/shape-outline.d.ts +24 -0
- package/types/lib/engine/pixel/cells.d.ts +12 -0
- package/types/lib/engine/pixel/palettes.d.ts +25 -0
- package/types/lib/engine/readiness.d.ts +20 -0
- package/types/lib/engine/routing.d.ts +41 -0
- package/types/lib/engine/shader-graph-presets.d.ts +22 -0
- package/types/lib/engine/shader-presets-legacy.d.ts +7 -0
- package/types/lib/engine/shader-presets.d.ts +43 -0
- package/types/lib/engine/text/atlas.d.ts +120 -0
- package/types/lib/engine/text/emoji/segment.d.ts +15 -0
- package/types/lib/engine/text/fallback-fonts.d.ts +47 -0
- package/types/lib/engine/text/fontkit-lazy.d.ts +8 -0
- package/types/lib/engine/text/fonts.d.ts +33 -0
- package/types/lib/engine/text/glyph-linear.d.ts +22 -0
- package/types/lib/engine/text/google-fonts.d.ts +17 -0
- package/types/lib/engine/text/hyphenate/en-us.d.ts +6 -0
- package/types/lib/engine/text/hyphenate/liang.d.ts +21 -0
- package/types/lib/engine/text/layout-access.d.ts +16 -0
- package/types/lib/engine/text/layout.d.ts +168 -0
- package/types/lib/engine/text/lists.d.ts +16 -0
- package/types/lib/engine/text/measure.d.ts +58 -0
- package/types/lib/engine/text/outline-sdf.d.ts +34 -0
- package/types/lib/engine/text/shaper.d.ts +88 -0
- package/types/lib/engine/text/text-area.d.ts +16 -0
- package/types/lib/engine/text/text-fit.d.ts +51 -0
- package/types/lib/engine/text/text-path.d.ts +134 -0
- package/types/lib/engine/text/text-rings.d.ts +17 -0
- package/types/lib/engine/text/wrap-obstacles.d.ts +20 -0
- package/types/lib/i18n/catalogs.d.ts +10 -0
- package/types/lib/i18n/format.d.ts +27 -0
- package/types/lib/i18n/locales.d.ts +25 -0
- package/types/lib/i18n/pseudo.d.ts +10 -0
- package/types/lib/i18n/runtime.d.ts +27 -0
- package/types/lib/io/codecs/wav.d.ts +7 -0
- package/types/lib/io/codecs/webp.d.ts +7 -0
- package/types/lib/io/export-ir/children.d.ts +2 -0
- package/types/lib/io/json-export.d.ts +11 -0
- package/types/lib/media-library/types.d.ts +39 -0
- package/types/lib/motion/audio-analysis.d.ts +44 -0
- package/types/lib/motion/audio-clips.d.ts +92 -0
- package/types/lib/motion/audio-onsets.d.ts +13 -0
- package/types/lib/motion/audio-signals.d.ts +59 -0
- package/types/lib/motion/author.d.ts +80 -0
- package/types/lib/motion/composition.d.ts +99 -0
- package/types/lib/motion/instances.d.ts +95 -0
- package/types/lib/motion/key-selection.d.ts +100 -0
- package/types/lib/motion/keys.d.ts +41 -0
- package/types/lib/motion/layer-time-edit.d.ts +40 -0
- package/types/lib/motion/markers.d.ts +31 -0
- package/types/lib/motion/modifier-edit.d.ts +84 -0
- package/types/lib/motion/modifiers.d.ts +44 -0
- package/types/lib/motion/morph.d.ts +14 -0
- package/types/lib/motion/pose-layout.d.ts +6 -0
- package/types/lib/motion/pose.d.ts +115 -0
- package/types/lib/motion/presets.d.ts +148 -0
- package/types/lib/motion/properties.d.ts +74 -0
- package/types/lib/motion/sample-keys.d.ts +8 -0
- package/types/lib/motion/sample.d.ts +51 -0
- package/types/lib/motion/sound.d.ts +25 -0
- package/types/lib/motion/spatial-curve.d.ts +15 -0
- package/types/lib/motion/spatial.d.ts +38 -0
- package/types/lib/motion/text-animators.d.ts +79 -0
- package/types/lib/motion/text-units.d.ts +47 -0
- package/types/lib/motion/time.d.ts +58 -0
- package/types/lib/motion/transitions.d.ts +99 -0
- package/types/lib/motion/values.d.ts +12 -0
- package/types/lib/motion/video-clip.d.ts +63 -0
- package/types/lib/presets/page-presets.d.ts +50 -0
- package/types/lib/storage/media-hash.d.ts +4 -0
- package/types/lib/storage/media-refs.d.ts +2 -0
- package/types/lib/storage/media-store.d.ts +70 -0
- package/types/lib/templates/apply.d.ts +38 -0
- package/types/lib/templates/capture.d.ts +25 -0
- package/types/lib/templates/groups.d.ts +82 -0
- package/types/lib/templates/layout.d.ts +20 -0
- package/types/lib/templates/quality.d.ts +59 -0
- package/types/lib/templates/resize.d.ts +34 -0
- package/types/lib/templates/safe-areas.d.ts +42 -0
- package/types/lib/templates/text-measurer.d.ts +10 -0
- package/types/lib/templates/thumbnail.d.ts +134 -0
- package/types/lib/templates/types.d.ts +95 -0
- package/types/lib/templates/vocabulary.d.ts +50 -0
- package/types/lib/units/units.d.ts +23 -0
- package/types/packages/kit/src/index.d.ts +59 -0
- package/types/packages/runtime/src/expressions.d.ts +41 -0
- package/types/templates/src/app/shared.d.ts +29 -0
- package/types/templates/src/audio/beat-loop.d.ts +9 -0
- package/types/templates/src/audio/media.d.ts +42 -0
- package/types/templates/src/audio/music-synth.d.ts +57 -0
- package/types/templates/src/audio/music-worlds.d.ts +8 -0
- package/types/templates/src/audio/music.d.ts +19 -0
- package/types/templates/src/audio/studio/deck.d.ts +340 -0
- package/types/templates/src/audio/studio/dsp.d.ts +151 -0
- package/types/templates/src/audio/studio/fx.d.ts +96 -0
- package/types/templates/src/audio/studio/mix.d.ts +84 -0
- package/types/templates/src/audio/studio/voices.d.ts +120 -0
- package/types/templates/src/data/geometry.d.ts +16 -0
- package/types/templates/src/effects/shared.d.ts +17 -0
- package/types/templates/src/kit.d.ts +582 -0
- package/types/templates/src/motion3d/devices.d.ts +42 -0
- package/types/templates/src/motion3d/ui.d.ts +48 -0
- package/types/templates/src/saas/video-shared.d.ts +114 -0
- package/types/templates/src/saas/web-shared.d.ts +74 -0
- package/types/templates/src/shared/beat.d.ts +24 -0
- package/types/templates/src/shared/captions.d.ts +24 -0
- package/types/templates/src/shared/devices.d.ts +188 -0
- package/types/templates/src/shared/draw.d.ts +43 -0
- package/types/templates/src/shared/fit.d.ts +73 -0
- package/types/templates/src/shared/marks.d.ts +51 -0
- package/types/templates/src/shared/motion.d.ts +15 -0
- package/types/templates/src/shared/overlays.d.ts +80 -0
- package/types/templates/src/shared/pointer.d.ts +46 -0
- package/types/templates/src/shared/texture.d.ts +41 -0
- package/types/templates/src/shared/type.d.ts +6 -0
- package/types/templates/src/shared/window.d.ts +50 -0
- package/types/templates/src/social/shared.d.ts +66 -0
- package/types/templates/src/web/shared.d.ts +64 -0
|
@@ -0,0 +1,2560 @@
|
|
|
1
|
+
export type NodeType = 'PAGE' | 'FRAME' | 'SECTION' | 'SLICE' | 'RECTANGLE' | 'ELLIPSE' | 'POLYGON' | 'STAR' | 'LINE' | 'ARROW' | 'TEXT' | 'GROUP' | 'VECTOR' | 'BOOLEAN' | 'IMAGE' | 'COMPONENT' | 'COMPONENT_SET' | 'INSTANCE' | 'STICKY' | 'PIXEL_GRID' | 'RASTER' | (string & {});
|
|
2
|
+
export interface Color {
|
|
3
|
+
r: number;
|
|
4
|
+
g: number;
|
|
5
|
+
b: number;
|
|
6
|
+
a: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ColorStop {
|
|
9
|
+
/** Stable address for motion tracks (`fills[@f1].gradientStops[@g1].color`); assigned when a track first needs it. */
|
|
10
|
+
id?: string;
|
|
11
|
+
position: number;
|
|
12
|
+
color: Color;
|
|
13
|
+
}
|
|
14
|
+
export interface Paint {
|
|
15
|
+
/** Stable address for motion tracks (`fills[@f1].color`); assigned lazily by `ensureItemId` (lib/motion/properties.ts). */
|
|
16
|
+
id?: string;
|
|
17
|
+
type: 'SOLID' | 'GRADIENT_LINEAR' | 'GRADIENT_RADIAL' | 'GRADIENT_ANGULAR' | 'GRADIENT_DIAMOND' | 'IMAGE' | 'SHADER' | 'PATTERN' | 'VIDEO';
|
|
18
|
+
color?: Color;
|
|
19
|
+
opacity?: number;
|
|
20
|
+
visible?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* `false` draws this paint on the canvas but NOT in exports — a frame's background you want to design
|
|
23
|
+
* against and ship transparent. Absent means included, so nothing existing changes meaning.
|
|
24
|
+
*/
|
|
25
|
+
includeInExport?: boolean;
|
|
26
|
+
gradientStops?: ColorStop[];
|
|
27
|
+
gradientTransform?: number[][];
|
|
28
|
+
gradientHandlePositions?: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
}[];
|
|
32
|
+
imageHash?: string;
|
|
33
|
+
imageUrl?: string;
|
|
34
|
+
scaleMode?: 'FILL' | 'FIT' | 'TILE' | 'CROP';
|
|
35
|
+
/** A stock photo's licence and attribution, kept with the picture (lib/photos/stock.ts). */
|
|
36
|
+
imageCredit?: MediaCredit;
|
|
37
|
+
boundVariables?: Record<string, string>;
|
|
38
|
+
shaderCode?: string;
|
|
39
|
+
shaderName?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Values for the shader's `struct Params { … }` fields, by field name (lib/document/shader-params.ts reflects the
|
|
42
|
+
* struct). A field without a value here draws with its `// @default`. These go to a uniform, never into the code,
|
|
43
|
+
* so a drag or an animated value re-renders the fill without recompiling it. Keyable per field:
|
|
44
|
+
* `fills[@f1].shaderParams.speed`, and per component for vectors (`.center.x`) and colours (`.tint.r`).
|
|
45
|
+
*/
|
|
46
|
+
shaderParams?: Record<string, ShaderParamValue>;
|
|
47
|
+
/**
|
|
48
|
+
* The node graph this shader was built from (lib/document/shader-graph.ts): it compiles to `shaderCode` plus the
|
|
49
|
+
* starting `shaderParams` through the same reflected `struct Params` contract, so the renderer only ever sees the
|
|
50
|
+
* code. Edit the graph and compile it again; the knob values stay in `shaderParams`.
|
|
51
|
+
*/
|
|
52
|
+
shaderGraph?: ShaderGraph;
|
|
53
|
+
textureParams?: TextureFillParams;
|
|
54
|
+
patternSourceId?: string;
|
|
55
|
+
patternScale?: number;
|
|
56
|
+
patternSpacing?: {
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
};
|
|
60
|
+
patternOffset?: {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
};
|
|
64
|
+
patternAlignment?: 'GRID' | 'BRICK_H' | 'BRICK_V';
|
|
65
|
+
patternPreset?: string;
|
|
66
|
+
patternColors?: Color[];
|
|
67
|
+
videoHash?: string;
|
|
68
|
+
videoName?: string;
|
|
69
|
+
videoLoop?: boolean;
|
|
70
|
+
/** Legacy: whether the video's sound was off. Upgraded on load to `videoSound.muted` (lib/motion/migrate.ts). */
|
|
71
|
+
videoMuted?: boolean;
|
|
72
|
+
videoPlayback?: 'AUTO' | 'PRESENT_ONLY' | 'PAUSED';
|
|
73
|
+
videoPosterTime?: number;
|
|
74
|
+
/** Source ms shown at the layer's time 0 (slip; below 0 when the source starts after the layer does): 0 unset. */
|
|
75
|
+
videoIn?: number;
|
|
76
|
+
/** Source ms per layer ms (0.25…4): 1 unset. Its sound is stretched to match, pitch kept. */
|
|
77
|
+
videoSpeed?: number;
|
|
78
|
+
/** Its sound, linked to the picture (lib/motion/sound.ts): unset, off (as a video without sound settings always was). */
|
|
79
|
+
videoSound?: VideoSound;
|
|
80
|
+
/** How the clip comes in over what is under it, from its bar's start (a cut when unset). */
|
|
81
|
+
videoTransition?: VideoTransition;
|
|
82
|
+
/** Pose only, never stored: the source second the layer shows at the posed moment (lib/motion/pose.ts). */
|
|
83
|
+
videoTime?: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A video's own sound, linked to its picture: heard over the layer's bar, from the same source time as the picture
|
|
87
|
+
* (lib/motion/sound.ts derives an AudioClip from it, so it mixes, plays and exports as every other clip). Levels,
|
|
88
|
+
* fades and balance are the AudioClip's own fields; gain keys are clip ms (0 = the bar's start).
|
|
89
|
+
*/
|
|
90
|
+
export interface VideoSound extends Pick<AudioClip, 'gain' | 'fadeIn' | 'fadeOut' | 'fadeCurve' | 'pan' | 'muted'> {
|
|
91
|
+
/** ms the sound is heard later than its picture (an Alt-drag of one without the other); 0 unset. */
|
|
92
|
+
offset?: number;
|
|
93
|
+
}
|
|
94
|
+
/** A video clip's transition in (lib/motion/video-clip.ts): a cross-dissolve over what is under it, or a dip through a colour. */
|
|
95
|
+
export interface VideoTransition {
|
|
96
|
+
type: 'DISSOLVE' | 'DIP_BLACK' | 'DIP_WHITE';
|
|
97
|
+
/** ms, from the bar's start. */
|
|
98
|
+
duration: number;
|
|
99
|
+
}
|
|
100
|
+
/** A shader param's value: `f32` a number, `vec2f`/`vec3f` a vector, `vec4f` (or `vec3f` marked `@color`) a colour. */
|
|
101
|
+
export type ShaderParamValue = number | Color | {
|
|
102
|
+
x: number;
|
|
103
|
+
y: number;
|
|
104
|
+
} | {
|
|
105
|
+
x: number;
|
|
106
|
+
y: number;
|
|
107
|
+
z: number;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* A node shader graph (see `Paint.shaderGraph`; lib/document/shader-graph.ts compiles it). Nodes and edges are maps
|
|
111
|
+
* keyed by id, but they do not merge per node in collab: a layer's `fills` is one value in the shared doc
|
|
112
|
+
* (lib/collab/ydoc.ts), so two people editing one graph at once overwrite each other. A node's unconnected inputs
|
|
113
|
+
* double as its knobs, and each knob is a `struct Params` field of the compiled shader (`<node>_<port>`), so it is
|
|
114
|
+
* keyable under that name.
|
|
115
|
+
*/
|
|
116
|
+
export interface ShaderGraph {
|
|
117
|
+
/** `options`: compile-time choices (a math operator, the signal an Audio node follows); they change the code. */
|
|
118
|
+
nodes: Record<string, {
|
|
119
|
+
id: string;
|
|
120
|
+
kind: string;
|
|
121
|
+
x: number;
|
|
122
|
+
y: number;
|
|
123
|
+
inputs?: Record<string, ShaderParamValue>;
|
|
124
|
+
options?: Record<string, string>;
|
|
125
|
+
}>;
|
|
126
|
+
edges: Record<string, {
|
|
127
|
+
id: string;
|
|
128
|
+
from: {
|
|
129
|
+
node: string;
|
|
130
|
+
port: string;
|
|
131
|
+
};
|
|
132
|
+
to: {
|
|
133
|
+
node: string;
|
|
134
|
+
port: string;
|
|
135
|
+
};
|
|
136
|
+
}>;
|
|
137
|
+
}
|
|
138
|
+
export type TextureNoiseType = 'VALUE' | 'PERLIN' | 'WORLEY' | 'FBM' | 'PAPER' | 'CANVAS';
|
|
139
|
+
export interface TextureFillParams {
|
|
140
|
+
noise: TextureNoiseType;
|
|
141
|
+
scale: number;
|
|
142
|
+
contrast: number;
|
|
143
|
+
colorA: Color;
|
|
144
|
+
colorB: Color;
|
|
145
|
+
seed: number;
|
|
146
|
+
animated: boolean;
|
|
147
|
+
}
|
|
148
|
+
export interface VectorEditMode {
|
|
149
|
+
nodeId: string;
|
|
150
|
+
activePathIndex: number;
|
|
151
|
+
selectedPoints: number[];
|
|
152
|
+
}
|
|
153
|
+
export interface StrokeStyle {
|
|
154
|
+
/** Stable address for motion tracks (`strokes[@s1].color`); assigned when a track first needs it. */
|
|
155
|
+
id?: string;
|
|
156
|
+
color: Color;
|
|
157
|
+
width: number | [number, number, number, number];
|
|
158
|
+
alignment: 'CENTER' | 'INSIDE' | 'OUTSIDE';
|
|
159
|
+
cap: 'NONE' | 'ROUND' | 'SQUARE';
|
|
160
|
+
join: 'MITER' | 'BEVEL' | 'ROUND';
|
|
161
|
+
dashPattern: number[];
|
|
162
|
+
boundVariables?: Record<string, string>;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Trim paths: only the part of a layer's stroke between `start` and `end` (fractions of its length) draws, turned
|
|
166
|
+
* along the outline by `offset` degrees (360 is one lap). The fill is never trimmed. See lib/document/trim.ts.
|
|
167
|
+
*/
|
|
168
|
+
export interface StrokeTrim {
|
|
169
|
+
start: number;
|
|
170
|
+
end: number;
|
|
171
|
+
offset: number;
|
|
172
|
+
/** A vector with several paths: each path trimmed on its own (unset), or all of them as one line, one after another. */
|
|
173
|
+
mode?: 'SIMULTANEOUS' | 'SEQUENTIAL';
|
|
174
|
+
}
|
|
175
|
+
export interface Shadow {
|
|
176
|
+
/** Stable address for motion tracks (`effects[@e1].blur`); assigned when a track first needs it. Every effect carries one. */
|
|
177
|
+
id?: string;
|
|
178
|
+
color: Color;
|
|
179
|
+
offset: {
|
|
180
|
+
x: number;
|
|
181
|
+
y: number;
|
|
182
|
+
};
|
|
183
|
+
blur: number;
|
|
184
|
+
spread: number;
|
|
185
|
+
visible: boolean;
|
|
186
|
+
type: 'DROP_SHADOW' | 'INNER_SHADOW';
|
|
187
|
+
/** Drop shadow: draw it behind the layer's semi-transparent fill (Figma's "show behind transparent areas"). Unset on older files means yes. */
|
|
188
|
+
showBehindTransparent?: boolean;
|
|
189
|
+
}
|
|
190
|
+
export type ShadowEffect = Shadow;
|
|
191
|
+
/** Legacy blur record (documents before the unified effect list); read through `lib/document/effects.ts`. */
|
|
192
|
+
export interface Blur {
|
|
193
|
+
type: 'LAYER' | 'BACKGROUND';
|
|
194
|
+
radius: number;
|
|
195
|
+
visible: boolean;
|
|
196
|
+
}
|
|
197
|
+
export interface BlurEffect {
|
|
198
|
+
id?: string;
|
|
199
|
+
type: 'LAYER_BLUR' | 'BACKGROUND_BLUR';
|
|
200
|
+
radius: number;
|
|
201
|
+
visible: boolean;
|
|
202
|
+
}
|
|
203
|
+
/** Blur that ramps along a direction: none before `start`, full `radius` from `end` (fractions of the box along `angle`°). */
|
|
204
|
+
export interface ProgressiveBlurEffect {
|
|
205
|
+
id?: string;
|
|
206
|
+
type: 'PROGRESSIVE_BLUR';
|
|
207
|
+
radius: number;
|
|
208
|
+
angle: number;
|
|
209
|
+
start: number;
|
|
210
|
+
end: number;
|
|
211
|
+
visible: boolean; /** Which blur ramps: the layer itself (default) or the backdrop behind it. */
|
|
212
|
+
target?: 'LAYER' | 'BACKGROUND';
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Motion blur: the layer smeared along one direction — `radius` px of streak at `angle`° (0 is left–right, 90 top–bottom,
|
|
216
|
+
* in the page's axes). On a group, frame or instance every layer inside smears the same way, so a whole character or a
|
|
217
|
+
* camera group can streak through a whip pan or a punch (lib/document/effects.ts `inheritedMotionBlur`).
|
|
218
|
+
*/
|
|
219
|
+
export interface MotionBlurEffect {
|
|
220
|
+
id?: string;
|
|
221
|
+
type: 'MOTION_BLUR';
|
|
222
|
+
radius: number;
|
|
223
|
+
angle: number;
|
|
224
|
+
visible: boolean;
|
|
225
|
+
}
|
|
226
|
+
/** Grain over the layer: `amount` 0–1, `size` in px, `density` 0–1 (share of cells that get grain); mono, per-channel color, duotone (A→B) or multitone (A/B/original). */
|
|
227
|
+
export interface NoiseEffect {
|
|
228
|
+
id?: string;
|
|
229
|
+
type: 'NOISE';
|
|
230
|
+
amount: number;
|
|
231
|
+
size: number;
|
|
232
|
+
monochrome: boolean;
|
|
233
|
+
seed: number;
|
|
234
|
+
visible: boolean;
|
|
235
|
+
mode?: 'MONO' | 'COLOR' | 'DUOTONE' | 'MULTITONE';
|
|
236
|
+
density?: number;
|
|
237
|
+
colorA?: Color;
|
|
238
|
+
colorB?: Color;
|
|
239
|
+
}
|
|
240
|
+
/** Procedural texture laid over the layer (same generators as texture fills), between two colors at `opacity`. */
|
|
241
|
+
export interface TextureEffect {
|
|
242
|
+
id?: string;
|
|
243
|
+
type: 'TEXTURE';
|
|
244
|
+
noise: TextureNoiseType;
|
|
245
|
+
scale: number;
|
|
246
|
+
contrast: number;
|
|
247
|
+
opacity: number;
|
|
248
|
+
colorA: Color;
|
|
249
|
+
colorB: Color;
|
|
250
|
+
seed: number;
|
|
251
|
+
visible: boolean;
|
|
252
|
+
}
|
|
253
|
+
/** Glass: the backdrop refracted through the layer's edges (`refraction` px, chromatic `dispersion` 0–1), frosted by `radius`, with a light rim (0–1) and a depth shadow (0–2). */
|
|
254
|
+
export interface GlassEffect {
|
|
255
|
+
id?: string;
|
|
256
|
+
type: 'GLASS';
|
|
257
|
+
radius: number;
|
|
258
|
+
refraction?: number;
|
|
259
|
+
dispersion?: number;
|
|
260
|
+
rim?: number;
|
|
261
|
+
depth?: number;
|
|
262
|
+
visible: boolean;
|
|
263
|
+
}
|
|
264
|
+
export interface VectorPoint {
|
|
265
|
+
x: number;
|
|
266
|
+
y: number;
|
|
267
|
+
handleIn?: {
|
|
268
|
+
x: number;
|
|
269
|
+
y: number;
|
|
270
|
+
};
|
|
271
|
+
handleOut?: {
|
|
272
|
+
x: number;
|
|
273
|
+
y: number;
|
|
274
|
+
};
|
|
275
|
+
cornerRadius?: number;
|
|
276
|
+
}
|
|
277
|
+
export interface VectorPath {
|
|
278
|
+
points: VectorPoint[];
|
|
279
|
+
closed: boolean;
|
|
280
|
+
data?: (string | number)[];
|
|
281
|
+
}
|
|
282
|
+
export type StyleType = 'PAINT' | 'TEXT' | 'EFFECT' | 'GRID';
|
|
283
|
+
export interface BaseStyle {
|
|
284
|
+
id: string;
|
|
285
|
+
name: string;
|
|
286
|
+
type: StyleType;
|
|
287
|
+
description?: string;
|
|
288
|
+
}
|
|
289
|
+
export interface PaintStyle extends BaseStyle {
|
|
290
|
+
type: 'PAINT';
|
|
291
|
+
paints: Paint[];
|
|
292
|
+
}
|
|
293
|
+
/** A tab stop, measured from the paragraph's left edge (px). */
|
|
294
|
+
export interface TabStop {
|
|
295
|
+
position: number;
|
|
296
|
+
align: 'LEFT' | 'CENTER' | 'RIGHT' | 'DECIMAL';
|
|
297
|
+
leader?: 'NONE' | 'DOT' | 'UNDERSCORE';
|
|
298
|
+
}
|
|
299
|
+
/** List formatting for a paragraph. `level` nests (0 = outermost); `indent` is per level (default 1.5 em). */
|
|
300
|
+
export interface ListStyle {
|
|
301
|
+
type: 'NONE' | 'UNORDERED' | 'ORDERED';
|
|
302
|
+
level?: number;
|
|
303
|
+
format?: 'BULLET' | 'DASH' | 'DECIMAL' | 'LOWER_ALPHA' | 'UPPER_ALPHA' | 'LOWER_ROMAN' | 'UPPER_ROMAN';
|
|
304
|
+
indent?: number;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Formatting of one paragraph (keyed by the index of its first character). Anything unset falls back to the
|
|
308
|
+
* node; `styleId` names a text style whose paragraph properties apply under these overrides.
|
|
309
|
+
*/
|
|
310
|
+
export interface ParagraphFormat {
|
|
311
|
+
start: number;
|
|
312
|
+
styleId?: string;
|
|
313
|
+
textAlign?: 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFIED';
|
|
314
|
+
/** Space after the paragraph. */
|
|
315
|
+
paragraphSpacing?: number;
|
|
316
|
+
spaceBefore?: number;
|
|
317
|
+
/** First-line indent. */
|
|
318
|
+
paragraphIndent?: number;
|
|
319
|
+
list?: ListStyle;
|
|
320
|
+
tabStops?: TabStop[];
|
|
321
|
+
hyphenate?: boolean;
|
|
322
|
+
}
|
|
323
|
+
export interface TextStyle extends BaseStyle {
|
|
324
|
+
type: 'TEXT';
|
|
325
|
+
/** CHARACTER styles apply to runs or nodes; PARAGRAPH styles also carry the paragraph properties below. */
|
|
326
|
+
scope?: 'CHARACTER' | 'PARAGRAPH';
|
|
327
|
+
textAlign?: 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFIED';
|
|
328
|
+
spaceBefore?: number;
|
|
329
|
+
list?: ListStyle;
|
|
330
|
+
tabStops?: TabStop[];
|
|
331
|
+
hyphenate?: boolean;
|
|
332
|
+
fontFeatures?: FontFeatureSettings;
|
|
333
|
+
fontVariations?: FontVariationSettings;
|
|
334
|
+
fontFamily: string;
|
|
335
|
+
fontWeight: number;
|
|
336
|
+
fontSize: number;
|
|
337
|
+
fontStyle: 'normal' | 'italic';
|
|
338
|
+
letterSpacing: number;
|
|
339
|
+
lineHeight: number | 'AUTO';
|
|
340
|
+
paragraphSpacing: number;
|
|
341
|
+
paragraphIndent: number;
|
|
342
|
+
textDecoration: 'NONE' | 'UNDERLINE' | 'STRIKETHROUGH';
|
|
343
|
+
textCase: 'ORIGINAL' | 'UPPER' | 'LOWER' | 'TITLE';
|
|
344
|
+
}
|
|
345
|
+
export type HalftoneShape = 'CIRCLE' | 'SQUARE' | 'DIAMOND' | 'LINE' | 'CROSS' | 'TRIANGLE';
|
|
346
|
+
/** One tone band of a halftone (light / mid / dark). */
|
|
347
|
+
export interface HalftoneBand {
|
|
348
|
+
shape: HalftoneShape;
|
|
349
|
+
color: Color;
|
|
350
|
+
/** Dot size multiplier for this band (1 = coverage matches tone). */
|
|
351
|
+
scale: number;
|
|
352
|
+
}
|
|
353
|
+
export type Effect = ShadowEffect | BlurEffect | ProgressiveBlurEffect | MotionBlurEffect | NoiseEffect | TextureEffect | GlassEffect | HalftoneEffect;
|
|
354
|
+
export interface HalftoneEffect {
|
|
355
|
+
id?: string;
|
|
356
|
+
type: 'HALFTONE';
|
|
357
|
+
/** Screen angle in degrees. */
|
|
358
|
+
angle?: number;
|
|
359
|
+
/** Cell size in world units. */
|
|
360
|
+
dotSize?: number;
|
|
361
|
+
/** Tone contrast (1 = unchanged, 0 = flat, up to 3). */
|
|
362
|
+
contrast?: number;
|
|
363
|
+
/** Ink color (single-tone mode). */
|
|
364
|
+
color1?: Color;
|
|
365
|
+
/** Paper / gap color (transparent when unset). */
|
|
366
|
+
color2?: Color;
|
|
367
|
+
/** Legacy: true = classic color halftone (dots take the source color). Superseded by colorMode. */
|
|
368
|
+
invert?: boolean;
|
|
369
|
+
/** Dots use the ink/band colors, or the source color under each cell. */
|
|
370
|
+
colorMode?: 'INK' | 'SOURCE';
|
|
371
|
+
shape?: HalftoneShape;
|
|
372
|
+
/** Dot arrangement: square grid, parallel line screen, or concentric rings around `center`. */
|
|
373
|
+
layout?: 'UNIFORM' | 'LINEAR' | 'RADIAL';
|
|
374
|
+
/** Where tone comes from: the layer's luminance, or a generated linear / radial gradient. */
|
|
375
|
+
toneSource?: 'CONTENT' | 'LINEAR_GRADIENT' | 'RADIAL_GRADIENT';
|
|
376
|
+
/** Linear gradient direction in degrees. */
|
|
377
|
+
gradientAngle?: number;
|
|
378
|
+
/** Radial layout / gradient centre in node space (0..1). */
|
|
379
|
+
center?: {
|
|
380
|
+
x: number;
|
|
381
|
+
y: number;
|
|
382
|
+
};
|
|
383
|
+
/** Swap light and dark. */
|
|
384
|
+
invertTone?: boolean;
|
|
385
|
+
/** Separate shapes / colors / sizes for light, mid and dark tones. */
|
|
386
|
+
bands?: {
|
|
387
|
+
enabled: boolean;
|
|
388
|
+
midStart: number;
|
|
389
|
+
darkStart: number;
|
|
390
|
+
light: HalftoneBand;
|
|
391
|
+
mid: HalftoneBand;
|
|
392
|
+
dark: HalftoneBand;
|
|
393
|
+
};
|
|
394
|
+
visible: boolean;
|
|
395
|
+
}
|
|
396
|
+
export interface EffectStyle extends BaseStyle {
|
|
397
|
+
type: 'EFFECT';
|
|
398
|
+
effects: Effect[];
|
|
399
|
+
}
|
|
400
|
+
export interface LayoutGrid {
|
|
401
|
+
type: 'GRID' | 'COLUMNS' | 'ROWS';
|
|
402
|
+
visible: boolean;
|
|
403
|
+
color: Color;
|
|
404
|
+
count?: number;
|
|
405
|
+
size?: number;
|
|
406
|
+
gutter?: number;
|
|
407
|
+
margin?: number;
|
|
408
|
+
}
|
|
409
|
+
export interface GridStyle extends BaseStyle {
|
|
410
|
+
type: 'GRID';
|
|
411
|
+
layoutGrids: LayoutGrid[];
|
|
412
|
+
}
|
|
413
|
+
export type Style = PaintStyle | TextStyle | EffectStyle | GridStyle;
|
|
414
|
+
/**
|
|
415
|
+
* Rest transform beyond position and rotation (lib/document/transform.ts `localMatrix`). All optional; absent
|
|
416
|
+
* means the default, so documents without them place exactly as before. `width`/`height` stay the unscaled
|
|
417
|
+
* layout box: scale is a transform (children, text and strokes scale with it), as in CSS and After Effects.
|
|
418
|
+
* The Design-mode Scale tool still bakes sizes (scale-geometry.ts); these are for motion.
|
|
419
|
+
*/
|
|
420
|
+
export interface TransformRest {
|
|
421
|
+
/** Horizontal scale about the anchor (default 1). Negative mirrors, like `flipHorizontal`. */
|
|
422
|
+
scaleX?: number;
|
|
423
|
+
/** Vertical scale about the anchor (default 1). Negative mirrors, like `flipVertical`. */
|
|
424
|
+
scaleY?: number;
|
|
425
|
+
/** Rotation/scale pivot as a fraction of the box width (default 0.5, the centre); may lie outside 0..1. */
|
|
426
|
+
anchorX?: number;
|
|
427
|
+
/** Rotation/scale pivot as a fraction of the box height (default 0.5); `1.15` pivots below the box. */
|
|
428
|
+
anchorY?: number;
|
|
429
|
+
/** Offset added after layout, in the parent's space (default 0). Auto layout never reads it. */
|
|
430
|
+
translateX?: number;
|
|
431
|
+
/** Offset added after layout, in the parent's space (default 0). */
|
|
432
|
+
translateY?: number;
|
|
433
|
+
/**
|
|
434
|
+
* Tilt about the box's horizontal axis through the anchor, in degrees (default 0). Only a layer inside a 3D
|
|
435
|
+
* context (a group or frame with `scene3d`) is drawn tilted; anywhere else it is ignored, like CSS `rotateX`
|
|
436
|
+
* without a perspective. `rotation` is the turn about the view axis (rotateZ). See lib/document/scene3d.ts.
|
|
437
|
+
*/
|
|
438
|
+
rotateX?: number;
|
|
439
|
+
/** Turn about the box's vertical axis through the anchor, in degrees (default 0). 3D contexts only. */
|
|
440
|
+
rotateY?: number;
|
|
441
|
+
/** Depth in px toward the viewer (default 0; negative is farther away). 3D contexts only. */
|
|
442
|
+
z?: number;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* How a 3D layer takes the scene's lights (lib/document/scene3d.ts). Every field is optional and keyable; with no
|
|
446
|
+
* lights in the scene, or `acceptsLights: false`, the layer draws exactly as it would unlit.
|
|
447
|
+
*/
|
|
448
|
+
export interface Material3D {
|
|
449
|
+
/** Default true. */
|
|
450
|
+
acceptsLights?: boolean;
|
|
451
|
+
/** How much ambient light reaches the layer (default 1). */
|
|
452
|
+
ambient?: number;
|
|
453
|
+
/** How much directional, point and spot light it scatters (Lambert; default 1). */
|
|
454
|
+
diffuse?: number;
|
|
455
|
+
/** Blinn-Phong highlight strength (default 0: none). */
|
|
456
|
+
specular?: number;
|
|
457
|
+
/** Highlight tightness: the Blinn-Phong exponent (default 24). */
|
|
458
|
+
shininess?: number;
|
|
459
|
+
}
|
|
460
|
+
export type Light3DType = 'AMBIENT' | 'DIRECTIONAL' | 'POINT' | 'SPOT';
|
|
461
|
+
/**
|
|
462
|
+
* A light in a 3D context. Positions and targets are in the context's own space: px from its top-left, x right,
|
|
463
|
+
* y down, z toward the viewer. A directional light shines from its position toward its target (only the
|
|
464
|
+
* direction matters); a spot is a point light limited to a cone around the line to its target.
|
|
465
|
+
*/
|
|
466
|
+
export interface Light3D {
|
|
467
|
+
/** Stable: tracks address the light as `scene3d.lights[@id]`. */
|
|
468
|
+
id: string;
|
|
469
|
+
type: Light3DType;
|
|
470
|
+
name?: string;
|
|
471
|
+
color: Color;
|
|
472
|
+
/** 1 is full strength. */
|
|
473
|
+
intensity: number;
|
|
474
|
+
x: number;
|
|
475
|
+
y: number;
|
|
476
|
+
z: number;
|
|
477
|
+
targetX: number;
|
|
478
|
+
targetY: number;
|
|
479
|
+
targetZ: number;
|
|
480
|
+
/** Spot: the whole cone, in degrees (default 60). */
|
|
481
|
+
coneAngle?: number;
|
|
482
|
+
/** Spot: how much of the cone's edge fades, 0 (hard) to 1 (all of it; default 0.5). */
|
|
483
|
+
coneFeather?: number;
|
|
484
|
+
/** Default true. */
|
|
485
|
+
visible?: boolean;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* The camera of a 3D context. Its eye starts where CSS `perspective` puts the viewer: in front of the point of
|
|
489
|
+
* interest (default: the perspective origin on the z = 0 plane) at the zoom distance, so an untouched camera
|
|
490
|
+
* frames the context exactly as the flat layout. Every field is keyable.
|
|
491
|
+
*/
|
|
492
|
+
export interface Camera3D {
|
|
493
|
+
/**
|
|
494
|
+
* Focal length in mm, on a 36 mm film across the context's width: the keyable truth. The zoom distance (the
|
|
495
|
+
* CSS `perspective`, in px) and the field of view are derived from it (lib/document/transform3d.ts `zoomPx`).
|
|
496
|
+
*/
|
|
497
|
+
focalLength: number;
|
|
498
|
+
/** Rig offsets in the context's space (px): truck, pedestal, dolly. The point of interest travels with them. */
|
|
499
|
+
x?: number;
|
|
500
|
+
y?: number;
|
|
501
|
+
z?: number;
|
|
502
|
+
/** Orbit about the point of interest, in degrees (around the vertical axis). */
|
|
503
|
+
orbit?: number;
|
|
504
|
+
/** Tilt (look up/down) and pan (look left/right), degrees, about the eye. */
|
|
505
|
+
rotateX?: number;
|
|
506
|
+
rotateY?: number;
|
|
507
|
+
/** Roll about the view axis, degrees. */
|
|
508
|
+
roll?: number;
|
|
509
|
+
/** Point of interest in the context's space. Unset: the perspective origin, at z 0. */
|
|
510
|
+
poiX?: number;
|
|
511
|
+
poiY?: number;
|
|
512
|
+
poiZ?: number;
|
|
513
|
+
/** Depth of field. Reserved: stored and synced, not drawn yet. */
|
|
514
|
+
dof?: {
|
|
515
|
+
enabled?: boolean;
|
|
516
|
+
focusDistance?: number;
|
|
517
|
+
aperture?: number;
|
|
518
|
+
blurLevel?: number;
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* A 3D context on a group or frame (CSS preserve-3d): its layers — its children, and the children of plain groups
|
|
523
|
+
* below it — are placed in 3D (rotateX/rotateY/z), each drawn as a flat card seen through the camera, sorted back
|
|
524
|
+
* to front. To everything outside, the context is a 2D layer at its own place. lib/document/scene3d.ts.
|
|
525
|
+
*/
|
|
526
|
+
export interface Scene3D {
|
|
527
|
+
camera: Camera3D;
|
|
528
|
+
lights?: Light3D[];
|
|
529
|
+
/** The perspective origin as a fraction of the box (default 0.5, 0.5: the centre). */
|
|
530
|
+
originX?: number;
|
|
531
|
+
originY?: number;
|
|
532
|
+
}
|
|
533
|
+
/** What every node can carry for motion (lib/motion). */
|
|
534
|
+
export interface MotionFields {
|
|
535
|
+
/** Keyed property tracks, behaviours and layer time. Documents with the older `keyframes` / `timelineDuration`
|
|
536
|
+
* fields are upgraded on load (lib/motion/migrate.ts). */
|
|
537
|
+
motion?: NodeMotion;
|
|
538
|
+
/** A top-level frame's timeline, as set in Animate mode; unset: long enough for its last key. */
|
|
539
|
+
timeline?: FrameTimeline;
|
|
540
|
+
/** A top-level frame's state machine (lib/motion/state-machine.ts): which part of its timeline plays, and when. */
|
|
541
|
+
stateMachine?: StateMachine;
|
|
542
|
+
/** The layer's colour label in the Animate timeline (After Effects' label colours): a way to group rows by eye. */
|
|
543
|
+
timelineColor?: TimelineColor;
|
|
544
|
+
}
|
|
545
|
+
/** The colour labels a timeline row can carry (theme hues, so they follow the theme). */
|
|
546
|
+
export type TimelineColor = 'accent' | 'success' | 'warning' | 'danger' | 'component' | 'prototype' | 'ai';
|
|
547
|
+
export interface BaseNode extends TransformRest, MotionFields {
|
|
548
|
+
id: string;
|
|
549
|
+
name: string;
|
|
550
|
+
type: NodeType;
|
|
551
|
+
/** Dev Mode: notes pinned to this layer (numbered on the canvas in Dev view). */
|
|
552
|
+
annotations?: Annotation[];
|
|
553
|
+
/** Dev Mode: links developers need for this layer (Storybook, tickets, docs). */
|
|
554
|
+
devResources?: DevResource[];
|
|
555
|
+
/** PopCorn private mode: the user id this node is private to. It stays on that device (never synced, exported
|
|
556
|
+
* to the cloud or shown to others) until revealed. See lib/collab/private.ts. */
|
|
557
|
+
privateTo?: string;
|
|
558
|
+
/** Lighting response when drawn as a layer of a 3D context. */
|
|
559
|
+
material3d?: Material3D;
|
|
560
|
+
/**
|
|
561
|
+
* Accessibility: the text alternative exports and presenting use for this layer as a picture (HTML `alt`, SVG
|
|
562
|
+
* `<title>`/`aria-label`, the slide's reading order). `''` marks it decorative (skipped); undefined means none was
|
|
563
|
+
* written (an image then falls back to its layer name). Edited in the inspector's Alt text section.
|
|
564
|
+
*/
|
|
565
|
+
altText?: string;
|
|
566
|
+
x: number;
|
|
567
|
+
y: number;
|
|
568
|
+
width: number;
|
|
569
|
+
height: number;
|
|
570
|
+
rotation: number;
|
|
571
|
+
opacity: number;
|
|
572
|
+
visible: boolean;
|
|
573
|
+
locked: boolean;
|
|
574
|
+
parentId: string | null;
|
|
575
|
+
childIds: string[];
|
|
576
|
+
constraints?: {
|
|
577
|
+
horizontal: 'MIN' | 'MAX' | 'CENTER' | 'STRETCH' | 'SCALE';
|
|
578
|
+
vertical: 'MIN' | 'MAX' | 'CENTER' | 'STRETCH' | 'SCALE';
|
|
579
|
+
};
|
|
580
|
+
flipHorizontal?: boolean;
|
|
581
|
+
flipVertical?: boolean;
|
|
582
|
+
/** Layer inside a pixel canvas: ids of the animation frames it appears in (undefined = every frame). */
|
|
583
|
+
pixelFrameIds?: string[];
|
|
584
|
+
minWidth?: number;
|
|
585
|
+
maxWidth?: number;
|
|
586
|
+
minHeight?: number;
|
|
587
|
+
maxHeight?: number;
|
|
588
|
+
/** What the layer sets differently at each breakpoint (by breakpoint id): lib/document/breakpoints.ts. */
|
|
589
|
+
responsive?: Record<string, ResponsiveProps>;
|
|
590
|
+
/** What the layer is on a web page: its element, its accessible name, where it links. */
|
|
591
|
+
semantics?: NodeSemantics;
|
|
592
|
+
/** The layer as a form control on a web page (a field, a checkbox, a button, the form itself). */
|
|
593
|
+
control?: ControlMeta;
|
|
594
|
+
componentPropertyReferences?: Record<string, string>;
|
|
595
|
+
/**
|
|
596
|
+
* Inside a component: registry paths (lib/motion/properties.ts) this layer takes from a NUMBER or COLOR
|
|
597
|
+
* component property, `{ 'fills[@f1].color': 'Accent' }`. An instance that sets the property shows its value
|
|
598
|
+
* there — and a path the component also keys takes the instance's value instead of the keys (an input).
|
|
599
|
+
*/
|
|
600
|
+
componentPropertyPaths?: Record<string, string>;
|
|
601
|
+
boundVariables?: Record<string, string>;
|
|
602
|
+
/**
|
|
603
|
+
* Live values: a property that follows an expression over the file's variables (lib/document/expressions.ts),
|
|
604
|
+
* `{ width: 'health / maxHealth * 320', characters: 'pad(score, 6)', visible: 'health < 30' }`. Resolved with the
|
|
605
|
+
* bound variables (lib/document/variables.ts), so a prototype's Set variable moves every layer that reads it.
|
|
606
|
+
*/
|
|
607
|
+
boundExpressions?: Record<string, string>;
|
|
608
|
+
/**
|
|
609
|
+
* Prototype: a shared element. Smart animate hands a layer over to the layer with the same key on the other
|
|
610
|
+
* frame wherever each sits in its tree (a mini player's cover becoming the now-playing cover), instead of only
|
|
611
|
+
* matching layers by name at the same place in the hierarchy (lib/editor/smart-animate.ts).
|
|
612
|
+
*/
|
|
613
|
+
sharedElement?: string;
|
|
614
|
+
}
|
|
615
|
+
export interface ExportSetting {
|
|
616
|
+
suffix: string;
|
|
617
|
+
format: 'PNG' | 'JPG' | 'WEBP' | 'SVG' | 'PDF' | 'GIF' | 'SHEET';
|
|
618
|
+
scale: number;
|
|
619
|
+
sheetLayout?: 'ROWS' | 'COLUMNS' | 'PACKED';
|
|
620
|
+
gifTag?: string;
|
|
621
|
+
gifRange?: {
|
|
622
|
+
from: number;
|
|
623
|
+
to: number;
|
|
624
|
+
};
|
|
625
|
+
constraint?: {
|
|
626
|
+
type: 'SCALE' | 'WIDTH' | 'HEIGHT';
|
|
627
|
+
value: number;
|
|
628
|
+
};
|
|
629
|
+
/** Raster formats: print resolution — renders at dpi/96 and tags the file (JFIF density, PNG pHYs). Wins over `scale`. */
|
|
630
|
+
dpi?: number;
|
|
631
|
+
/** PDF only: print options (see `lib/io/pdf`). Absent: a screen PDF at the export scale. */
|
|
632
|
+
pdf?: {
|
|
633
|
+
dpi?: number;
|
|
634
|
+
bleed?: boolean;
|
|
635
|
+
marks?: boolean;
|
|
636
|
+
colorBars?: boolean;
|
|
637
|
+
colorMode?: 'RGB' | 'CMYK';
|
|
638
|
+
textAs?: 'FONT' | 'OUTLINE';
|
|
639
|
+
spreads?: boolean;
|
|
640
|
+
ats?: boolean;
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
export interface SceneNode extends BaseNode {
|
|
644
|
+
fills: Paint[];
|
|
645
|
+
fillStyleId?: string;
|
|
646
|
+
strokes: StrokeStyle[];
|
|
647
|
+
strokeStyleId?: string;
|
|
648
|
+
/** Trim paths on the stroke (vectors and shapes). */
|
|
649
|
+
trim?: StrokeTrim;
|
|
650
|
+
cornerRadius: number | [number, number, number, number];
|
|
651
|
+
cornerSmoothing?: number;
|
|
652
|
+
/** @deprecated Folded into `effects` on load (`migrateDocumentEffects`); readers go through `lib/document/effects.ts`. */
|
|
653
|
+
shadows?: Shadow[];
|
|
654
|
+
/** @deprecated See `shadows`. */
|
|
655
|
+
blurs?: Blur[];
|
|
656
|
+
/** Every effect on the node, in application order. */
|
|
657
|
+
effects?: Effect[];
|
|
658
|
+
effectStyleId?: string;
|
|
659
|
+
/** Text: the effect preset that produced the current shadows (for the picker). */
|
|
660
|
+
textEffectPreset?: string;
|
|
661
|
+
blendMode: BlendMode;
|
|
662
|
+
isMask?: boolean;
|
|
663
|
+
/**
|
|
664
|
+
* Clipping mask (Procreate): this layer shows only where the layer BELOW it has pixels, and that
|
|
665
|
+
* layer still draws normally — the difference from an ordinary mask, whose mask child is invisible.
|
|
666
|
+
* Several layers can clip to the same base by each setting this in turn.
|
|
667
|
+
*/
|
|
668
|
+
clipToBelow?: boolean;
|
|
669
|
+
/**
|
|
670
|
+
* Alpha lock (Procreate): the layer's silhouette is fixed. Painting recolors what is already there
|
|
671
|
+
* and cannot add a pixel outside it or take one away — shading inside a shape without cutting a mask.
|
|
672
|
+
*/
|
|
673
|
+
alphaLock?: boolean;
|
|
674
|
+
maskType?: 'ALPHA' | 'VECTOR' | 'LUMINANCE';
|
|
675
|
+
exportSettings?: ExportSetting[];
|
|
676
|
+
/**
|
|
677
|
+
* When set on an image/shape, overlapping text on the same page wraps around this node's AABB.
|
|
678
|
+
* Contour wrap is out of scope; this is bounding-box only.
|
|
679
|
+
*/
|
|
680
|
+
textWrap?: {
|
|
681
|
+
mode: 'NONE' | 'BOUNDING_BOX';
|
|
682
|
+
padding?: number;
|
|
683
|
+
sides?: 'BOTH' | 'LEFT' | 'RIGHT';
|
|
684
|
+
};
|
|
685
|
+
isComponent?: boolean;
|
|
686
|
+
componentId?: string;
|
|
687
|
+
layoutSizingHorizontal?: 'FIXED' | 'HUG' | 'FILL';
|
|
688
|
+
layoutSizingVertical?: 'FIXED' | 'HUG' | 'FILL';
|
|
689
|
+
layoutPositioning?: 'AUTO' | 'ABSOLUTE';
|
|
690
|
+
minWidth?: number;
|
|
691
|
+
maxWidth?: number;
|
|
692
|
+
minHeight?: number;
|
|
693
|
+
maxHeight?: number;
|
|
694
|
+
/** An AI image job is filling this layer (drawn with a loading overlay; cleared when it lands). */
|
|
695
|
+
aiPending?: AiPending;
|
|
696
|
+
}
|
|
697
|
+
export interface AiPending {
|
|
698
|
+
/** The prompt (or action label) shown under the loading indicator. */
|
|
699
|
+
prompt: string;
|
|
700
|
+
model: string;
|
|
701
|
+
/** ms since epoch; older than AI_PENDING_TTL_MS without a result = interrupted. */
|
|
702
|
+
startedAt: number;
|
|
703
|
+
}
|
|
704
|
+
export type BlendMode = 'NORMAL' | 'DISSOLVE' | 'MULTIPLY' | 'SCREEN' | 'OVERLAY' | 'DARKEN' | 'LIGHTEN' | 'COLOR_DODGE' | 'COLOR_BURN' | 'HARD_LIGHT' | 'SOFT_LIGHT' | 'DIFFERENCE' | 'EXCLUSION' | 'HUE' | 'SATURATION' | 'COLOR' | 'LUMINOSITY';
|
|
705
|
+
export interface Guide {
|
|
706
|
+
id: string;
|
|
707
|
+
axis: 'X' | 'Y';
|
|
708
|
+
pos: number;
|
|
709
|
+
/** FOLD guides are print fold lines (drawn dashed, kept with the page). */
|
|
710
|
+
kind?: 'FOLD';
|
|
711
|
+
}
|
|
712
|
+
export interface SnapIndicator {
|
|
713
|
+
axis: 'X' | 'Y';
|
|
714
|
+
coord: number;
|
|
715
|
+
startBound: number;
|
|
716
|
+
endBound: number;
|
|
717
|
+
distance?: number;
|
|
718
|
+
/**
|
|
719
|
+
* When present, this indicator is a SPACING (gap) measurement rather than an alignment line.
|
|
720
|
+
* The gap runs ALONG `axis` (X = horizontal gap) from `gapStart`→`gapEnd`, drawn at the
|
|
721
|
+
* perpendicular position `perp`. Used for Figma-style equal-spacing feedback while dragging.
|
|
722
|
+
*/
|
|
723
|
+
spacing?: {
|
|
724
|
+
gapStart: number;
|
|
725
|
+
gapEnd: number;
|
|
726
|
+
perp: number;
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
export interface PageNode extends BaseNode {
|
|
730
|
+
type: 'PAGE';
|
|
731
|
+
backgroundColor: Color;
|
|
732
|
+
guides?: Guide[];
|
|
733
|
+
prototypeDevice?: 'NONE' | 'IPHONE_14' | 'IPHONE_SE' | 'IPAD_PRO' | 'MACBOOK_PRO' | 'SURFACE_PRO';
|
|
734
|
+
}
|
|
735
|
+
/** Marks a top-level frame as one ordered page of a fixed-page document (see `lib/document/print-pages.ts`). */
|
|
736
|
+
export interface PrintPageMeta {
|
|
737
|
+
isPrintPage: true;
|
|
738
|
+
/** Reading order; missing indexes sort last, then by position. */
|
|
739
|
+
index?: number;
|
|
740
|
+
/** Overrides of the document defaults, px. */
|
|
741
|
+
pageSize?: {
|
|
742
|
+
width: number;
|
|
743
|
+
height: number;
|
|
744
|
+
};
|
|
745
|
+
/**
|
|
746
|
+
* The page preset (lib/presets/page-presets.ts) this sheet is, when its size alone would name another one: a
|
|
747
|
+
* 1920×1080 slide in a file of square posts, which is also "Video 1080p". A template offers the size by it.
|
|
748
|
+
*/
|
|
749
|
+
presetId?: string;
|
|
750
|
+
bleed?: Edges;
|
|
751
|
+
margins?: Edges;
|
|
752
|
+
/** Speaker notes (presentations). */
|
|
753
|
+
notes?: string;
|
|
754
|
+
/** Presentations: leave this slide out of the show (still exports unless the exporter skips it). */
|
|
755
|
+
skip?: boolean;
|
|
756
|
+
/** Presentations: how the show moves onto this slide. */
|
|
757
|
+
transition?: PrototypeTransition;
|
|
758
|
+
/** Presentations: how the show moves on from this slide (unset: the document's `showAdvance`, else on a click). */
|
|
759
|
+
advance?: ShowAdvance;
|
|
760
|
+
/** A master: a page whose content is drawn behind every page that names it (`masterId`); not a sheet itself. */
|
|
761
|
+
isMaster?: boolean;
|
|
762
|
+
/** The master this page inherits; its children render behind this page's own, read-only. */
|
|
763
|
+
masterId?: string;
|
|
764
|
+
/** Optional master for the first sheet (overrides `masterId` on page index 0). */
|
|
765
|
+
masterIdFirst?: string;
|
|
766
|
+
/** Optional master for left-hand sheets when facing pages are on (overrides `masterId`). */
|
|
767
|
+
masterIdLeft?: string;
|
|
768
|
+
/** Optional master for right-hand sheets when facing pages are on (overrides `masterId`). */
|
|
769
|
+
masterIdRight?: string;
|
|
770
|
+
/** Reserved header band height in px (print chrome guide); body content is not auto-clipped. */
|
|
771
|
+
headerHeight?: number;
|
|
772
|
+
/** Reserved footer band height in px (print chrome guide). */
|
|
773
|
+
footerHeight?: number;
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* A design written as code: the script, the size it was built at, every root it made (the master, its other sizes,
|
|
777
|
+
* its components) and a hash of what it built, so a rebuild can tell when someone has edited the result by hand.
|
|
778
|
+
*/
|
|
779
|
+
export interface DesignScriptSource {
|
|
780
|
+
source: string;
|
|
781
|
+
size: string | {
|
|
782
|
+
width: number;
|
|
783
|
+
height: number;
|
|
784
|
+
};
|
|
785
|
+
roots: string[];
|
|
786
|
+
builtHash: string;
|
|
787
|
+
}
|
|
788
|
+
export interface FrameNode extends SceneNode {
|
|
789
|
+
type: 'FRAME';
|
|
790
|
+
/** The design script that built this frame and its sibling sizes (lib/agent/design-script): run again to rebuild. */
|
|
791
|
+
designScript?: DesignScriptSource;
|
|
792
|
+
/** A 3D context (see `Scene3D`). */
|
|
793
|
+
scene3d?: Scene3D;
|
|
794
|
+
/** Present on the page frames of PRINT / SOCIAL / PRESENTATION documents. */
|
|
795
|
+
print?: PrintPageMeta;
|
|
796
|
+
clipsContent: boolean;
|
|
797
|
+
backgroundColor: Color;
|
|
798
|
+
layoutMode: 'NONE' | 'HORIZONTAL' | 'VERTICAL' | 'GRID';
|
|
799
|
+
primaryAxisAlignItems?: 'MIN' | 'MAX' | 'CENTER' | 'SPACE_BETWEEN';
|
|
800
|
+
counterAxisAlignItems?: 'MIN' | 'MAX' | 'CENTER';
|
|
801
|
+
padding: {
|
|
802
|
+
top: number;
|
|
803
|
+
right: number;
|
|
804
|
+
bottom: number;
|
|
805
|
+
left: number;
|
|
806
|
+
};
|
|
807
|
+
itemSpacing: number;
|
|
808
|
+
counterAxisSpacing?: number;
|
|
809
|
+
layoutGridColumns?: number | 'AUTO';
|
|
810
|
+
layoutGridRows?: number | 'AUTO';
|
|
811
|
+
layoutGridMinColumnWidth?: number;
|
|
812
|
+
layoutGridMinRowHeight?: number;
|
|
813
|
+
layoutGridColumnSizes?: {
|
|
814
|
+
sizing: 'FILL' | 'HUG' | 'FIXED';
|
|
815
|
+
value: string;
|
|
816
|
+
}[];
|
|
817
|
+
layoutGridRowSizes?: {
|
|
818
|
+
sizing: 'FILL' | 'HUG' | 'FIXED';
|
|
819
|
+
value: string;
|
|
820
|
+
}[];
|
|
821
|
+
interactions: Interaction[];
|
|
822
|
+
overflowScrolling: 'NONE' | 'HORIZONTAL' | 'VERTICAL' | 'BOTH';
|
|
823
|
+
isFlowStartingPoint: boolean;
|
|
824
|
+
/** A top-level frame as a page of a website: its address and what a browser tab and a search result say of it. */
|
|
825
|
+
route?: RouteMeta;
|
|
826
|
+
/** Repeat what the frame holds once for each record of a collection (lib/document/collections.ts). */
|
|
827
|
+
repeat?: RepeatMeta;
|
|
828
|
+
/** Name shown in the flows list when this frame starts a flow. */
|
|
829
|
+
flowName?: string;
|
|
830
|
+
/** Auto layout: wrap children onto new lines when the primary axis is fixed. */
|
|
831
|
+
layoutWrap?: 'NO_WRAP' | 'WRAP';
|
|
832
|
+
componentPropertyReferences?: {
|
|
833
|
+
visible?: string;
|
|
834
|
+
characters?: string;
|
|
835
|
+
/** Nested INSTANCE: the INSTANCE_SWAP / VARIANT property that chooses its main component. */
|
|
836
|
+
mainComponent?: string;
|
|
837
|
+
};
|
|
838
|
+
layoutGrids?: LayoutGrid[];
|
|
839
|
+
gridStyleId?: string;
|
|
840
|
+
}
|
|
841
|
+
export interface SectionNode extends BaseNode {
|
|
842
|
+
type: 'SECTION';
|
|
843
|
+
backgroundColor: Color;
|
|
844
|
+
/** Dev Mode hand-off status shown on the section label. */
|
|
845
|
+
devStatus?: DevStatus;
|
|
846
|
+
}
|
|
847
|
+
export interface SliceNode extends BaseNode {
|
|
848
|
+
type: 'SLICE';
|
|
849
|
+
exportSettings: ExportSetting[];
|
|
850
|
+
}
|
|
851
|
+
export interface RectangleNode extends SceneNode {
|
|
852
|
+
type: 'RECTANGLE';
|
|
853
|
+
}
|
|
854
|
+
export interface EllipseNode extends SceneNode {
|
|
855
|
+
type: 'ELLIPSE';
|
|
856
|
+
arcData?: {
|
|
857
|
+
startAngle: number;
|
|
858
|
+
endAngle: number;
|
|
859
|
+
innerRadius: number;
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
export interface ConnectorAttachment {
|
|
863
|
+
nodeId: string;
|
|
864
|
+
position: 'TOP' | 'RIGHT' | 'BOTTOM' | 'LEFT' | 'CENTER';
|
|
865
|
+
}
|
|
866
|
+
export interface LineNode extends SceneNode {
|
|
867
|
+
type: 'LINE';
|
|
868
|
+
startPoint: {
|
|
869
|
+
x: number;
|
|
870
|
+
y: number;
|
|
871
|
+
};
|
|
872
|
+
endPoint: {
|
|
873
|
+
x: number;
|
|
874
|
+
y: number;
|
|
875
|
+
};
|
|
876
|
+
startArrowhead?: 'NONE' | 'ARROW' | 'TRIANGLE' | 'DIAMOND' | 'CIRCLE' | 'REVERSE_TRIANGLE';
|
|
877
|
+
endArrowhead?: 'NONE' | 'ARROW' | 'TRIANGLE' | 'DIAMOND' | 'CIRCLE' | 'REVERSE_TRIANGLE';
|
|
878
|
+
connectorStart?: ConnectorAttachment;
|
|
879
|
+
connectorEnd?: ConnectorAttachment;
|
|
880
|
+
routingMode?: 'STRAIGHT' | 'ORTHOGONAL' | 'BEZIER';
|
|
881
|
+
routingPoints?: {
|
|
882
|
+
x: number;
|
|
883
|
+
y: number;
|
|
884
|
+
}[];
|
|
885
|
+
autoRoute?: boolean;
|
|
886
|
+
}
|
|
887
|
+
export interface ArrowNode extends SceneNode {
|
|
888
|
+
type: 'ARROW';
|
|
889
|
+
startPoint: {
|
|
890
|
+
x: number;
|
|
891
|
+
y: number;
|
|
892
|
+
};
|
|
893
|
+
endPoint: {
|
|
894
|
+
x: number;
|
|
895
|
+
y: number;
|
|
896
|
+
};
|
|
897
|
+
startArrowhead: 'NONE' | 'ARROW' | 'TRIANGLE' | 'DIAMOND' | 'CIRCLE' | 'REVERSE_TRIANGLE';
|
|
898
|
+
endArrowhead: 'NONE' | 'ARROW' | 'TRIANGLE' | 'DIAMOND' | 'CIRCLE' | 'REVERSE_TRIANGLE';
|
|
899
|
+
connectorStart?: ConnectorAttachment;
|
|
900
|
+
connectorEnd?: ConnectorAttachment;
|
|
901
|
+
routingMode?: 'STRAIGHT' | 'ORTHOGONAL' | 'BEZIER';
|
|
902
|
+
routingPoints?: {
|
|
903
|
+
x: number;
|
|
904
|
+
y: number;
|
|
905
|
+
}[];
|
|
906
|
+
autoRoute?: boolean;
|
|
907
|
+
}
|
|
908
|
+
export interface PolygonNode extends SceneNode {
|
|
909
|
+
type: 'POLYGON';
|
|
910
|
+
pointCount: number;
|
|
911
|
+
}
|
|
912
|
+
export interface StarNode extends SceneNode {
|
|
913
|
+
type: 'STAR';
|
|
914
|
+
pointCount: number;
|
|
915
|
+
innerRadius: number;
|
|
916
|
+
}
|
|
917
|
+
export interface TextSegment {
|
|
918
|
+
start: number;
|
|
919
|
+
end: number;
|
|
920
|
+
fontFeatures?: FontFeatureSettings;
|
|
921
|
+
fontVariations?: FontVariationSettings;
|
|
922
|
+
fills?: Paint[];
|
|
923
|
+
strokes?: StrokeStyle[];
|
|
924
|
+
fontSize?: number;
|
|
925
|
+
fontFamily?: string;
|
|
926
|
+
fontWeight?: number;
|
|
927
|
+
fontStyle?: 'normal' | 'italic';
|
|
928
|
+
textDecoration?: 'NONE' | 'UNDERLINE' | 'STRIKETHROUGH';
|
|
929
|
+
textDecorationStyle?: 'SOLID' | 'DASHED' | 'WAVY';
|
|
930
|
+
textDecorationThickness?: number | 'AUTO';
|
|
931
|
+
textDecorationOffset?: number | 'AUTO';
|
|
932
|
+
textDecorationSkipInk?: boolean;
|
|
933
|
+
textDecorationColor?: Paint[] | 'AUTO';
|
|
934
|
+
textCase?: 'ORIGINAL' | 'UPPER' | 'LOWER' | 'TITLE';
|
|
935
|
+
textVerticalTrim?: 'NONE' | 'CAP_HEIGHT';
|
|
936
|
+
textListStyle?: 'NONE' | 'UNORDERED' | 'ORDERED';
|
|
937
|
+
/** Hyperlink URL for this run (rendered underlined; opens in present mode; `<a>` in SVG export). */
|
|
938
|
+
link?: string;
|
|
939
|
+
lineHeight?: number | 'AUTO';
|
|
940
|
+
letterSpacing?: number;
|
|
941
|
+
}
|
|
942
|
+
/** OpenType feature toggles (tag → 0 off / 1 on / n alternate index) and variation axis values. */
|
|
943
|
+
export type FontFeatureSettings = Record<string, number>;
|
|
944
|
+
export type FontVariationSettings = Record<string, number>;
|
|
945
|
+
/** Where a glyph sits against the path (Illustrator's "Align to Path"). */
|
|
946
|
+
export type TextPathPlacement = 'BASELINE' | 'ASCENDER' | 'DESCENDER' | 'CENTER';
|
|
947
|
+
/** How each glyph is shaped onto the path (Illustrator's Type on a Path effects). */
|
|
948
|
+
export type TextPathEffect = 'RAINBOW' | 'SKEW' | 'RIBBON' | 'STAIR' | 'GRAVITY';
|
|
949
|
+
/**
|
|
950
|
+
* How a TEXT layer follows a path. `ARC`, `CIRCLE` and `WAVE` are the layer's own geometry (built from its line);
|
|
951
|
+
* `PATH` follows another node's outline, live: editing that node moves the text with it.
|
|
952
|
+
*/
|
|
953
|
+
export interface TextPath {
|
|
954
|
+
mode: 'ARC' | 'CIRCLE' | 'WAVE' | 'PATH';
|
|
955
|
+
/** ARC: −100…100; 100 is a full circle, positive bends the ends downward. */
|
|
956
|
+
bend?: number;
|
|
957
|
+
/** CIRCLE: the radius in px (default: the text wraps about 80% of the way round). */
|
|
958
|
+
radius?: number;
|
|
959
|
+
/** WAVE: peak height in px (default half the font size) and whole waves along the line (default 1.5). */
|
|
960
|
+
amplitude?: number;
|
|
961
|
+
frequency?: number;
|
|
962
|
+
/** PATH: the node whose outline the text follows. */
|
|
963
|
+
pathId?: string;
|
|
964
|
+
/**
|
|
965
|
+
* The start bracket, as a fraction of the path's length. A closed path is measured clockwise from its top
|
|
966
|
+
* centre, so 0 is 12 o'clock and 0.5 is 6 o'clock.
|
|
967
|
+
*/
|
|
968
|
+
offset?: number;
|
|
969
|
+
/** The end bracket (default: the end of an open path; on a closed path, one full turn after the start). */
|
|
970
|
+
endOffset?: number;
|
|
971
|
+
/** Run the text the other way along the path, on its other side (below / inside a closed shape). */
|
|
972
|
+
flip?: boolean;
|
|
973
|
+
/** Where the text sits between the brackets. JUSTIFY stretches it to fill them exactly. Default LEFT. */
|
|
974
|
+
align?: 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFY';
|
|
975
|
+
/** Which line of the glyphs rides on the path. Default BASELINE. */
|
|
976
|
+
placement?: TextPathPlacement;
|
|
977
|
+
/** px away from the path, on the glyphs' up side (negative: toward their feet). */
|
|
978
|
+
baselineShift?: number;
|
|
979
|
+
/** Extra px between letters along the path (on top of the text's own letter spacing). */
|
|
980
|
+
spacing?: number;
|
|
981
|
+
/** Default RAINBOW (each glyph turns to the tangent). */
|
|
982
|
+
effect?: TextPathEffect;
|
|
983
|
+
/** Text past the end bracket: hidden with an overflow marker (CLIP, the default), drawn on, or shrunk to fit. */
|
|
984
|
+
overflow?: 'CLIP' | 'VISIBLE' | 'SHRINK';
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* Area type: the text flows inside another node's closed outline, each line as wide as the shape is at that
|
|
988
|
+
* height. The text's box follows the shape; editing the shape reflows the text.
|
|
989
|
+
*/
|
|
990
|
+
export interface TextArea {
|
|
991
|
+
shapeId: string;
|
|
992
|
+
/** Distance kept from the outline, px. */
|
|
993
|
+
inset?: number;
|
|
994
|
+
}
|
|
995
|
+
/** Font size chosen by the layout to fill the container: only ever smaller (SHRINK) or whatever fills it (FIT). */
|
|
996
|
+
export type TextFit = 'NONE' | 'SHRINK' | 'FIT';
|
|
997
|
+
export interface TextNode extends SceneNode {
|
|
998
|
+
type: 'TEXT';
|
|
999
|
+
characters: string;
|
|
1000
|
+
fontSize: number;
|
|
1001
|
+
fontFamily: string;
|
|
1002
|
+
fontWeight: number;
|
|
1003
|
+
fontStyle: 'normal' | 'italic';
|
|
1004
|
+
fontFeatures?: FontFeatureSettings;
|
|
1005
|
+
fontVariations?: FontVariationSettings;
|
|
1006
|
+
/** How emoji draw: the OS color emoji font (default), bundled color Twemoji, or one-color outlines. */
|
|
1007
|
+
emojiStyle?: 'SYSTEM' | 'COLOR' | 'OUTLINE';
|
|
1008
|
+
textAlign: 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFIED';
|
|
1009
|
+
verticalAlign: 'TOP' | 'CENTER' | 'BOTTOM';
|
|
1010
|
+
lineHeight: number | 'AUTO';
|
|
1011
|
+
letterSpacing: number;
|
|
1012
|
+
paragraphSpacing: number;
|
|
1013
|
+
paragraphIndent: number;
|
|
1014
|
+
textStyleId?: string;
|
|
1015
|
+
textDecoration: 'NONE' | 'UNDERLINE' | 'STRIKETHROUGH';
|
|
1016
|
+
textDecorationStyle?: 'SOLID' | 'DASHED' | 'WAVY';
|
|
1017
|
+
textDecorationThickness?: number | 'AUTO';
|
|
1018
|
+
textDecorationOffset?: number | 'AUTO';
|
|
1019
|
+
textDecorationSkipInk?: boolean;
|
|
1020
|
+
textDecorationColor?: Paint[] | 'AUTO';
|
|
1021
|
+
textCase: 'ORIGINAL' | 'UPPER' | 'LOWER' | 'TITLE';
|
|
1022
|
+
textVerticalTrim?: 'NONE' | 'CAP_HEIGHT';
|
|
1023
|
+
/** Legacy flat list flag; `list` and per-paragraph `paragraphs[].list` supersede it. */
|
|
1024
|
+
textListStyle?: 'NONE' | 'UNORDERED' | 'ORDERED';
|
|
1025
|
+
/** Node-wide list formatting (paragraph formats override it). */
|
|
1026
|
+
list?: ListStyle;
|
|
1027
|
+
/** Node-wide tab stops (paragraph formats override them). Without any, tabs fall every 4 em. */
|
|
1028
|
+
tabStops?: TabStop[];
|
|
1029
|
+
/** Space before each paragraph but the first. */
|
|
1030
|
+
spaceBefore?: number;
|
|
1031
|
+
/** Per-paragraph formatting: alignment, spacing, indent, list, tabs, or a named paragraph style. */
|
|
1032
|
+
paragraphs?: ParagraphFormat[];
|
|
1033
|
+
/** Break words at the line end with a hyphen (en-US patterns). */
|
|
1034
|
+
hyphenate?: boolean;
|
|
1035
|
+
/** Flow the text through columns of equal width. */
|
|
1036
|
+
columns?: {
|
|
1037
|
+
count: number;
|
|
1038
|
+
gap: number;
|
|
1039
|
+
};
|
|
1040
|
+
/** Text on a path: the line bends onto an arc or another node's outline (single line, no wrapping). */
|
|
1041
|
+
textPath?: TextPath;
|
|
1042
|
+
/** Area type: flow inside another node's outline (ignored while the text is on a path). */
|
|
1043
|
+
textArea?: TextArea;
|
|
1044
|
+
/**
|
|
1045
|
+
* Auto-size the type to its container — the area shape, the fixed box, or the path between its brackets. The
|
|
1046
|
+
* stored sizes stay as set; the layout scales every size (segments, spacing, line height) by one factor.
|
|
1047
|
+
*/
|
|
1048
|
+
textFit?: TextFit;
|
|
1049
|
+
/** Threading: this frame continues the text of `threadPrevId` and overflows into `threadNextId`. Only the head owns characters. */
|
|
1050
|
+
threadPrevId?: string;
|
|
1051
|
+
threadNextId?: string;
|
|
1052
|
+
/** Hyperlink URL applied to the whole text node (per-run links live on styledSegments). */
|
|
1053
|
+
link?: string;
|
|
1054
|
+
textTruncation?: 'NONE' | 'ENDING';
|
|
1055
|
+
/** Line clamp: keep at most this many lines and end the last one with an ellipsis (CSS line-clamp). */
|
|
1056
|
+
maxLines?: number;
|
|
1057
|
+
textAutoResize: 'NONE' | 'WIDTH_AND_HEIGHT' | 'HEIGHT';
|
|
1058
|
+
styledSegments?: TextSegment[];
|
|
1059
|
+
interactions: Interaction[];
|
|
1060
|
+
/** Per-letter, per-word or per-line animation (lib/motion/text-animators.ts): drawn only while the text plays. */
|
|
1061
|
+
textAnimators?: TextAnimator[];
|
|
1062
|
+
/** A number the text shows, counting: while it plays the characters are `text.counter`'s value, formatted. */
|
|
1063
|
+
textCounter?: TextCounter;
|
|
1064
|
+
}
|
|
1065
|
+
/** What a text animator moves: each letter, word or line of the text on its own. */
|
|
1066
|
+
export type TextAnimatorUnit = 'letter' | 'word' | 'line';
|
|
1067
|
+
/** Which unit a range covers first (and, with a stagger, starts first). `center` goes out from the middle. */
|
|
1068
|
+
export type TextAnimatorOrder = 'forward' | 'reverse' | 'center' | 'random';
|
|
1069
|
+
/**
|
|
1070
|
+
* Where a fully-selected unit is, relative to where it rests: offsets in the text's own px, a scale factor and
|
|
1071
|
+
* degrees about the unit's centre, an opacity factor, a tint mixed over the fill, a blur (px) softening the glyphs.
|
|
1072
|
+
* A unit partly selected gets that fraction of each.
|
|
1073
|
+
*/
|
|
1074
|
+
export interface TextAnimatorProps {
|
|
1075
|
+
translateX?: number;
|
|
1076
|
+
translateY?: number;
|
|
1077
|
+
scale?: number;
|
|
1078
|
+
rotation?: number;
|
|
1079
|
+
opacity?: number;
|
|
1080
|
+
color?: Color;
|
|
1081
|
+
blur?: number;
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* A text animator (After Effects' animator + range selector). The text's units are laid out in `order` in equal
|
|
1085
|
+
* slots over [0, 1]; the range selects [start, end] (shifted by `offset`), and a unit's weight is how much of its
|
|
1086
|
+
* slot the range covers, shaped by `ease` (hold: all or nothing), times `amount`. With a `stagger`, unit k (in
|
|
1087
|
+
* order) plays the animator's keys `k · stagger` ms later, so one set of keys becomes a cascade.
|
|
1088
|
+
* `range.*`, `amount` and each prop are keyable: `text.animators[@id].range.start`, `text.animators[@id].props.opacity`.
|
|
1089
|
+
*/
|
|
1090
|
+
export interface TextAnimator {
|
|
1091
|
+
/** Stable: tracks address the animator by it. */
|
|
1092
|
+
id: string;
|
|
1093
|
+
name?: string;
|
|
1094
|
+
unit: TextAnimatorUnit;
|
|
1095
|
+
/** Fractions of the units, 0..1 (offset −1..1). */
|
|
1096
|
+
range: {
|
|
1097
|
+
start: number;
|
|
1098
|
+
end: number;
|
|
1099
|
+
offset: number;
|
|
1100
|
+
};
|
|
1101
|
+
/** 0..1, default 1. */
|
|
1102
|
+
amount?: number;
|
|
1103
|
+
order: TextAnimatorOrder;
|
|
1104
|
+
/** For `random`: the same seed gives the same order. */
|
|
1105
|
+
seed?: number;
|
|
1106
|
+
/** ms between consecutive units' time (0: they share it). */
|
|
1107
|
+
stagger?: number;
|
|
1108
|
+
props: TextAnimatorProps;
|
|
1109
|
+
/** The weight across a unit's slot edge (default linear). */
|
|
1110
|
+
ease?: Interp;
|
|
1111
|
+
}
|
|
1112
|
+
/** A counting number: `text.counter` (keyable) runs from `from` to `to`, shown with this formatting. */
|
|
1113
|
+
export interface TextCounter {
|
|
1114
|
+
from: number;
|
|
1115
|
+
to: number;
|
|
1116
|
+
/** Digits after the point, 0..6. */
|
|
1117
|
+
decimals?: number;
|
|
1118
|
+
prefix?: string;
|
|
1119
|
+
suffix?: string;
|
|
1120
|
+
/** Between thousands ('' for none, ',' by default). */
|
|
1121
|
+
separator?: string;
|
|
1122
|
+
/** The value the text rests at (the finished figure, `to`, when unset). */
|
|
1123
|
+
value?: number;
|
|
1124
|
+
/**
|
|
1125
|
+
* Show the figure in whole steps from `from` (1: a countdown's seconds): it changes only once the value has
|
|
1126
|
+
* travelled a full step, so one key pair ticks a clock instead of one hold key per tick. Unset: every figure.
|
|
1127
|
+
*/
|
|
1128
|
+
step?: number;
|
|
1129
|
+
}
|
|
1130
|
+
export interface GroupNode extends BaseNode {
|
|
1131
|
+
type: 'GROUP';
|
|
1132
|
+
isMaskGroup?: boolean;
|
|
1133
|
+
/** A 3D context (see `Scene3D`). */
|
|
1134
|
+
scene3d?: Scene3D;
|
|
1135
|
+
}
|
|
1136
|
+
export interface VectorNode extends SceneNode {
|
|
1137
|
+
type: 'VECTOR';
|
|
1138
|
+
paths: VectorPath[];
|
|
1139
|
+
fillRule: 'NONZERO' | 'EVENODD';
|
|
1140
|
+
}
|
|
1141
|
+
export interface BooleanNode extends SceneNode {
|
|
1142
|
+
type: 'BOOLEAN';
|
|
1143
|
+
booleanOperation: BooleanOperation;
|
|
1144
|
+
/** 'LOCAL' once the children are stored relative to this node (the rule everywhere else). Absent on
|
|
1145
|
+
* documents written before that change; the loader rebases those once and sets it. */
|
|
1146
|
+
booleanChildSpace?: 'LOCAL';
|
|
1147
|
+
paths: VectorPath[];
|
|
1148
|
+
fillRule: 'NONZERO' | 'EVENODD';
|
|
1149
|
+
}
|
|
1150
|
+
/** Non-destructive image adjustment (applied on the GPU at the image's native resolution, in order). */
|
|
1151
|
+
export type ImageAdjustmentType = 'BRIGHTNESS' | 'CONTRAST' | 'EXPOSURE' | 'SATURATION' | 'VIBRANCE' | 'HUE' | 'TEMPERATURE' | 'CURVES' | 'BLUR' | 'SHARPEN' | 'NOISE' | 'PIXELATE' | 'EDGE' | 'MONOCHROME' | 'INVERT' | 'POSTERIZE' | 'VIGNETTE' | 'BULGE' | 'PINCH' | 'SWIRL';
|
|
1152
|
+
export interface CurvePoint {
|
|
1153
|
+
x: number;
|
|
1154
|
+
y: number;
|
|
1155
|
+
}
|
|
1156
|
+
export interface ImageAdjustment {
|
|
1157
|
+
id: string;
|
|
1158
|
+
type: ImageAdjustmentType;
|
|
1159
|
+
enabled: boolean;
|
|
1160
|
+
/** Primary amount (meaning per type — see lib/engine/image-adjust/adjustments.ts). */
|
|
1161
|
+
amount: number;
|
|
1162
|
+
/** Secondary value: tint (TEMPERATURE), radius (warps, px-relative 0..1), mono noise, posterize levels… */
|
|
1163
|
+
amount2?: number;
|
|
1164
|
+
/** Warp / vignette centre in image space (0..1). */
|
|
1165
|
+
center?: {
|
|
1166
|
+
x: number;
|
|
1167
|
+
y: number;
|
|
1168
|
+
};
|
|
1169
|
+
/** MONOCHROME tint color. */
|
|
1170
|
+
color?: Color;
|
|
1171
|
+
/** CURVES: control points per channel (0..1). */
|
|
1172
|
+
curves?: {
|
|
1173
|
+
rgb: CurvePoint[];
|
|
1174
|
+
r: CurvePoint[];
|
|
1175
|
+
g: CurvePoint[];
|
|
1176
|
+
b: CurvePoint[];
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Where an openly licensed picture came from, stored with the layer or fill that shows it so the attribution the
|
|
1181
|
+
* licence asks for survives copies, exports and offline use (lib/photos/stock.ts `creditLine`).
|
|
1182
|
+
*/
|
|
1183
|
+
export interface MediaCredit {
|
|
1184
|
+
/** Openverse (the stock photo search), or Wikimedia Commons directly (the official templates' own photographs). */
|
|
1185
|
+
provider: 'openverse' | 'wikimedia';
|
|
1186
|
+
/** The provider's id for the picture. */
|
|
1187
|
+
id: string;
|
|
1188
|
+
title: string;
|
|
1189
|
+
creator: string;
|
|
1190
|
+
creatorUrl?: string;
|
|
1191
|
+
/** Licence code as the provider gives it: `by`, `by-sa`, `cc0`, `pdm`, `by-nc`… */
|
|
1192
|
+
license: string;
|
|
1193
|
+
licenseVersion?: string;
|
|
1194
|
+
licenseUrl?: string;
|
|
1195
|
+
/** The page the picture was published on. */
|
|
1196
|
+
sourceUrl: string;
|
|
1197
|
+
/** Where the provider found it (flickr, wikimedia…). */
|
|
1198
|
+
source?: string;
|
|
1199
|
+
}
|
|
1200
|
+
export interface ImageNode extends SceneNode {
|
|
1201
|
+
type: 'IMAGE';
|
|
1202
|
+
imageUrl: string;
|
|
1203
|
+
scaleMode: 'FILL' | 'FIT' | 'CROP' | 'TILE';
|
|
1204
|
+
/** A stock photo's licence and attribution, kept with the layer (lib/photos/stock.ts). */
|
|
1205
|
+
credit?: MediaCredit;
|
|
1206
|
+
/** Non-destructive adjustment stack; the original image is never modified. */
|
|
1207
|
+
adjustments?: ImageAdjustment[];
|
|
1208
|
+
/**
|
|
1209
|
+
* Mockup warp: where the image's four corners (top-left, top-right, bottom-right, bottom-left) sit, as
|
|
1210
|
+
* fractions of the layer's box. The image is projected onto that quadrilateral; outside it is transparent.
|
|
1211
|
+
*/
|
|
1212
|
+
perspective?: PerspectiveCorners;
|
|
1213
|
+
}
|
|
1214
|
+
export type PerspectiveCorners = [[number, number], [number, number], [number, number], [number, number]];
|
|
1215
|
+
/**
|
|
1216
|
+
* NUMBER and COLOR feed layer paths (`componentPropertyPaths`) and key values (`Key.bind`): a counter's target, a
|
|
1217
|
+
* progress, an accent. MOTION shows one of the instance's playback settings (`InstanceNode.playback`) as a property.
|
|
1218
|
+
*/
|
|
1219
|
+
export type ComponentPropertyType = 'BOOLEAN' | 'TEXT' | 'INSTANCE_SWAP' | 'VARIANT' | 'NUMBER' | 'COLOR' | 'MOTION';
|
|
1220
|
+
/** A value an instance gives a component property. */
|
|
1221
|
+
export type ComponentPropertyValue = string | boolean | number | Color;
|
|
1222
|
+
export interface ComponentPropertyDefinition {
|
|
1223
|
+
type: ComponentPropertyType;
|
|
1224
|
+
/** INSTANCE_SWAP / VARIANT: a component id. NUMBER: a number. COLOR: a color. MOTION: the bound playback field's default. */
|
|
1225
|
+
defaultValue: ComponentPropertyValue;
|
|
1226
|
+
/** INSTANCE_SWAP: components offered first in the picker (ids). VARIANT: the variants of one set (ids). */
|
|
1227
|
+
preferredValues?: string[];
|
|
1228
|
+
/** NUMBER: the range and step the instance's control offers. */
|
|
1229
|
+
min?: number;
|
|
1230
|
+
max?: number;
|
|
1231
|
+
step?: number;
|
|
1232
|
+
/** MOTION: the playback field the property sets on each instance. */
|
|
1233
|
+
binds?: PlaybackField;
|
|
1234
|
+
}
|
|
1235
|
+
/** React source the file carries (lib/code): what a code component is drawn by. */
|
|
1236
|
+
export interface CodeModule {
|
|
1237
|
+
id: string;
|
|
1238
|
+
name: string;
|
|
1239
|
+
/** TSX. Its exports are the components; `react` is the only package it may import unless `packages` names others. */
|
|
1240
|
+
source: string;
|
|
1241
|
+
/** Packages this file lets the module import beside React, each at an exact version (`{ "clsx": "2.1.1" }`). */
|
|
1242
|
+
packages?: Record<string, string>;
|
|
1243
|
+
}
|
|
1244
|
+
/** Which export of which module draws a component (the default export when unnamed). */
|
|
1245
|
+
export interface CodeRef {
|
|
1246
|
+
moduleId: string;
|
|
1247
|
+
exportName?: string;
|
|
1248
|
+
}
|
|
1249
|
+
/** Where a local component was copied from: a library's component, made the file's own (lib/document/libraries.ts). */
|
|
1250
|
+
export interface LibraryOrigin {
|
|
1251
|
+
libraryId: string;
|
|
1252
|
+
id: string;
|
|
1253
|
+
name?: string;
|
|
1254
|
+
}
|
|
1255
|
+
export interface ComponentNode extends SceneNode {
|
|
1256
|
+
type: 'COMPONENT';
|
|
1257
|
+
description?: string;
|
|
1258
|
+
/** A local copy of a library component (inserted or unlinked): which one, so another insert reuses this copy. */
|
|
1259
|
+
libraryOrigin?: LibraryOrigin;
|
|
1260
|
+
codeConnect?: CodeConnect;
|
|
1261
|
+
/**
|
|
1262
|
+
* The component is drawn by code on a web page (lib/code): a React component from one of the file's code modules,
|
|
1263
|
+
* given the component's properties. Its layers are what shows where the code cannot run or has not been drawn yet.
|
|
1264
|
+
*/
|
|
1265
|
+
code?: CodeRef;
|
|
1266
|
+
componentPropertyDefinitions: Record<string, ComponentPropertyDefinition>;
|
|
1267
|
+
variantProperties?: Record<string, string>;
|
|
1268
|
+
layoutMode?: 'NONE' | 'HORIZONTAL' | 'VERTICAL';
|
|
1269
|
+
primaryAxisAlignItems?: 'MIN' | 'MAX' | 'CENTER' | 'SPACE_BETWEEN';
|
|
1270
|
+
counterAxisAlignItems?: 'MIN' | 'MAX' | 'CENTER';
|
|
1271
|
+
padding?: {
|
|
1272
|
+
top: number;
|
|
1273
|
+
right: number;
|
|
1274
|
+
bottom: number;
|
|
1275
|
+
left: number;
|
|
1276
|
+
};
|
|
1277
|
+
itemSpacing?: number;
|
|
1278
|
+
/**
|
|
1279
|
+
* In a 3D scene, its instances pass through like a plain group (CSS `transform-style: preserve-3d`): their
|
|
1280
|
+
* layers are 3D layers of the scene, placed through the instance, instead of one flattened card — so a part of a
|
|
1281
|
+
* 3D object can be an interactive component and stay solid. Honoured when the component draws nothing of its own
|
|
1282
|
+
* (no visible fill, stroke or effect, no clip). lib/document/scene3d.ts `passesThrough`.
|
|
1283
|
+
*/
|
|
1284
|
+
preserve3d?: boolean;
|
|
1285
|
+
}
|
|
1286
|
+
export interface ComponentSetNode extends SceneNode {
|
|
1287
|
+
type: 'COMPONENT_SET';
|
|
1288
|
+
description?: string;
|
|
1289
|
+
/** A local copy of a library's component set (see `ComponentNode.libraryOrigin`). */
|
|
1290
|
+
libraryOrigin?: LibraryOrigin;
|
|
1291
|
+
componentPropertyDefinitions: Record<string, ComponentPropertyDefinition>;
|
|
1292
|
+
layoutMode?: 'NONE' | 'HORIZONTAL' | 'VERTICAL';
|
|
1293
|
+
primaryAxisAlignItems?: 'MIN' | 'MAX' | 'CENTER' | 'SPACE_BETWEEN';
|
|
1294
|
+
counterAxisAlignItems?: 'MIN' | 'MAX' | 'CENTER';
|
|
1295
|
+
padding?: {
|
|
1296
|
+
top: number;
|
|
1297
|
+
right: number;
|
|
1298
|
+
bottom: number;
|
|
1299
|
+
left: number;
|
|
1300
|
+
};
|
|
1301
|
+
itemSpacing?: number;
|
|
1302
|
+
}
|
|
1303
|
+
export interface InstanceNode extends SceneNode {
|
|
1304
|
+
type: 'INSTANCE';
|
|
1305
|
+
mainComponentId: string;
|
|
1306
|
+
overrides: Record<string, Partial<AnyNode>>;
|
|
1307
|
+
componentProperties: Record<string, ComponentPropertyValue>;
|
|
1308
|
+
/** Inside a component: this nested instance's properties show on every instance of that component. */
|
|
1309
|
+
isExposedInstance?: boolean;
|
|
1310
|
+
/** How this instance plays its component's timeline (a motion component). Unset fields: the component's MOTION
|
|
1311
|
+
* property defaults, then `DEFAULT_PLAYBACK` (lib/motion/time.ts). */
|
|
1312
|
+
playback?: InstancePlayback;
|
|
1313
|
+
}
|
|
1314
|
+
/** What starts an instance's playback. `inView`: when it is on screen (present mode: the frame is shown; web export: scrolled into view). `manual`: only a state change (a variant switch) plays it. */
|
|
1315
|
+
export type PlaybackTrigger = 'load' | 'click' | 'hover' | 'inView' | 'manual';
|
|
1316
|
+
export type PlaybackLoop = 'none' | 'loop' | 'pingpong';
|
|
1317
|
+
/**
|
|
1318
|
+
* An instance's time mapping onto its component's timeline (lib/motion/time.ts `instanceTime`): the one mapping
|
|
1319
|
+
* nested instances compose and precomps reuse.
|
|
1320
|
+
*/
|
|
1321
|
+
export interface InstancePlayback {
|
|
1322
|
+
/** ms after its own zero (its layer time, or the trigger) that it starts. */
|
|
1323
|
+
start?: number;
|
|
1324
|
+
/** Component ms per ms (≥ 0; 0 holds the first frame). */
|
|
1325
|
+
speed?: number;
|
|
1326
|
+
loop?: PlaybackLoop;
|
|
1327
|
+
/** What a finished, unlooped playback shows: its last frame (default) or its first. */
|
|
1328
|
+
hold?: 'first' | 'last';
|
|
1329
|
+
/** Play only between two of the component timeline's markers (ids), in order. */
|
|
1330
|
+
range?: [string, string];
|
|
1331
|
+
trigger?: PlaybackTrigger;
|
|
1332
|
+
}
|
|
1333
|
+
export type PlaybackField = 'start' | 'speed' | 'loop' | 'hold' | 'trigger';
|
|
1334
|
+
export interface StickyNode extends SceneNode {
|
|
1335
|
+
type: 'STICKY';
|
|
1336
|
+
text: string;
|
|
1337
|
+
authorName: string;
|
|
1338
|
+
fontFamily?: string;
|
|
1339
|
+
fontWeight?: number;
|
|
1340
|
+
fontSize?: number;
|
|
1341
|
+
fontStyle?: 'normal' | 'italic';
|
|
1342
|
+
textAlign?: 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFIED';
|
|
1343
|
+
verticalAlign?: 'TOP' | 'CENTER' | 'BOTTOM';
|
|
1344
|
+
textDecoration?: 'NONE' | 'UNDERLINE' | 'STRIKETHROUGH';
|
|
1345
|
+
}
|
|
1346
|
+
export interface NativeExtensionNode extends TransformRest, MotionFields {
|
|
1347
|
+
type: string;
|
|
1348
|
+
id: string;
|
|
1349
|
+
name: string;
|
|
1350
|
+
parentId: string | null;
|
|
1351
|
+
childIds: string[];
|
|
1352
|
+
x: number;
|
|
1353
|
+
y: number;
|
|
1354
|
+
width: number;
|
|
1355
|
+
height: number;
|
|
1356
|
+
rotation: number;
|
|
1357
|
+
opacity: number;
|
|
1358
|
+
visible: boolean;
|
|
1359
|
+
locked: boolean;
|
|
1360
|
+
fills: Paint[];
|
|
1361
|
+
strokes: StrokeStyle[];
|
|
1362
|
+
cornerRadius: number | [number, number, number, number];
|
|
1363
|
+
shadows?: Shadow[];
|
|
1364
|
+
blurs?: Blur[];
|
|
1365
|
+
blendMode: BlendMode;
|
|
1366
|
+
[key: string]: any;
|
|
1367
|
+
}
|
|
1368
|
+
export type PixelColorMode = 'RGBA' | 'INDEXED' | 'GRAYSCALE';
|
|
1369
|
+
export interface PixelFrame {
|
|
1370
|
+
id: string;
|
|
1371
|
+
cels: string;
|
|
1372
|
+
duration: number;
|
|
1373
|
+
}
|
|
1374
|
+
export interface PixelTag {
|
|
1375
|
+
id: string;
|
|
1376
|
+
name: string;
|
|
1377
|
+
from: number;
|
|
1378
|
+
to: number;
|
|
1379
|
+
direction: 'FORWARD' | 'REVERSE' | 'PING_PONG';
|
|
1380
|
+
color: string;
|
|
1381
|
+
}
|
|
1382
|
+
export interface PixelTileset {
|
|
1383
|
+
tileW: number;
|
|
1384
|
+
tileH: number;
|
|
1385
|
+
tiles: string[];
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Live paint layer: a fixed-resolution RGBA bitmap brushes paint into on the GPU. Pixels live in the
|
|
1389
|
+
* media store as PNG tiles; the node holds only their refs, so undo/sync swap a handful of strings.
|
|
1390
|
+
*/
|
|
1391
|
+
export interface RasterNode extends SceneNode {
|
|
1392
|
+
type: 'RASTER';
|
|
1393
|
+
pixelWidth: number;
|
|
1394
|
+
pixelHeight: number;
|
|
1395
|
+
/** "tx,ty" → media:// ref of a RASTER_TILE_SIZE² PNG tile (absent = transparent). */
|
|
1396
|
+
rasterTiles: Record<string, string>;
|
|
1397
|
+
}
|
|
1398
|
+
export interface PixelGridNode extends SceneNode {
|
|
1399
|
+
type: 'PIXEL_GRID';
|
|
1400
|
+
pixelWidth: number;
|
|
1401
|
+
pixelHeight: number;
|
|
1402
|
+
colorMode: PixelColorMode;
|
|
1403
|
+
palette: string[];
|
|
1404
|
+
transparentIndex: number;
|
|
1405
|
+
frames: PixelFrame[];
|
|
1406
|
+
activeFrame: number;
|
|
1407
|
+
tags: PixelTag[];
|
|
1408
|
+
onionSkin?: {
|
|
1409
|
+
enabled: boolean;
|
|
1410
|
+
prev: number;
|
|
1411
|
+
next: number;
|
|
1412
|
+
opacity: number;
|
|
1413
|
+
};
|
|
1414
|
+
tiledMode?: 'NONE' | 'X' | 'Y' | 'BOTH';
|
|
1415
|
+
referenceImageUrl?: string;
|
|
1416
|
+
referenceOpacity?: number;
|
|
1417
|
+
referenceVisible?: boolean;
|
|
1418
|
+
tileset?: PixelTileset;
|
|
1419
|
+
}
|
|
1420
|
+
export type AnyNode = PageNode | FrameNode | SectionNode | SliceNode | RectangleNode | EllipseNode | PolygonNode | StarNode | LineNode | ArrowNode | TextNode | GroupNode | VectorNode | BooleanNode | ImageNode | ComponentNode | ComponentSetNode | InstanceNode | StickyNode | PixelGridNode | RasterNode | NativeExtensionNode;
|
|
1421
|
+
/** Display unit for lengths. Geometry is always stored in CSS px; see `lib/units/units.ts`. */
|
|
1422
|
+
export type Unit = 'px' | 'pt' | 'in' | 'mm' | 'cm' | 'pc';
|
|
1423
|
+
export interface Edges {
|
|
1424
|
+
top: number;
|
|
1425
|
+
right: number;
|
|
1426
|
+
bottom: number;
|
|
1427
|
+
left: number;
|
|
1428
|
+
}
|
|
1429
|
+
/**
|
|
1430
|
+
* What kind of thing this file is. CANVAS is the Figma-style infinite canvas every file had before. `KIT` is only
|
|
1431
|
+
* what files made from the retired Kit template still say (it opens like Web): files of components are official
|
|
1432
|
+
* libraries now (seed/libraries), and no template, command or dialog makes a KIT file.
|
|
1433
|
+
*/
|
|
1434
|
+
export type DocumentKind = 'CANVAS' | 'PRINT' | 'SOCIAL' | 'PRESENTATION' | 'WEB' | 'APP' | 'BOARD' | 'KIT' | 'EMAIL';
|
|
1435
|
+
/**
|
|
1436
|
+
* Document-level settings (shared with collaborators, undoable). Lengths are px. Every field is
|
|
1437
|
+
* optional so a file without `settings` behaves exactly as before: CANVAS, px, 96 dpi, no bleed.
|
|
1438
|
+
*/
|
|
1439
|
+
/**
|
|
1440
|
+
* How a show moves on from a slide or a scene (lib/motion/present.ts `advanceOf`):
|
|
1441
|
+
* - `click`: it waits for a click (or a key) at each build and at its end — a deck's default;
|
|
1442
|
+
* - `end`: its builds play through without waiting, and the show moves on when its animation ends — a
|
|
1443
|
+
* composition scene's default, and a motion template's;
|
|
1444
|
+
* - `after`: the same, `seconds` after its animation ends (a still slide: after it arrives).
|
|
1445
|
+
*/
|
|
1446
|
+
export type ShowAdvance = {
|
|
1447
|
+
on: 'click';
|
|
1448
|
+
} | {
|
|
1449
|
+
on: 'end';
|
|
1450
|
+
} | {
|
|
1451
|
+
on: 'after';
|
|
1452
|
+
seconds: number;
|
|
1453
|
+
};
|
|
1454
|
+
export interface DocumentSettings {
|
|
1455
|
+
/** The show's default for slides that set no `advance` of their own (unset: on a click). */
|
|
1456
|
+
showAdvance?: ShowAdvance;
|
|
1457
|
+
/** At the last slide's end, go back to the first (a kiosk, a looping motion piece) instead of holding it. */
|
|
1458
|
+
showLoop?: boolean;
|
|
1459
|
+
kind?: DocumentKind;
|
|
1460
|
+
units?: Unit;
|
|
1461
|
+
/** Raster DPI for exports of print kinds (300 is the print default). */
|
|
1462
|
+
dpi?: number;
|
|
1463
|
+
/** Default page size (px) for fixed-page kinds; `presetId` refers to `lib/presets/page-presets.ts`. */
|
|
1464
|
+
pageSize?: {
|
|
1465
|
+
width: number;
|
|
1466
|
+
height: number;
|
|
1467
|
+
presetId?: string;
|
|
1468
|
+
};
|
|
1469
|
+
bleed?: Edges;
|
|
1470
|
+
margins?: Edges;
|
|
1471
|
+
slug?: number;
|
|
1472
|
+
facingPages?: boolean;
|
|
1473
|
+
pageNumbering?: {
|
|
1474
|
+
start: number;
|
|
1475
|
+
format: 'ARABIC' | 'ROMAN' | 'ALPHA';
|
|
1476
|
+
sectionPrefix?: string;
|
|
1477
|
+
};
|
|
1478
|
+
colorMode?: 'RGB' | 'CMYK';
|
|
1479
|
+
baselineGrid?: {
|
|
1480
|
+
step: number;
|
|
1481
|
+
offset: number;
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
export interface Document {
|
|
1485
|
+
id: string;
|
|
1486
|
+
name: string;
|
|
1487
|
+
/**
|
|
1488
|
+
* This device's record of the cloud file this document holds (lib/client/cloud/sync.ts `linkActive`). Local only —
|
|
1489
|
+
* never synced. A document whose link is lost still says which file it is, so auto-sync re-links it instead of
|
|
1490
|
+
* uploading it as a new file: a copy of a cloud file must never become a second cloud file on its own.
|
|
1491
|
+
*/
|
|
1492
|
+
cloudKey?: string;
|
|
1493
|
+
pages: string[];
|
|
1494
|
+
nodes: Record<string, AnyNode>;
|
|
1495
|
+
styles?: Record<string, Style>;
|
|
1496
|
+
variables?: Record<string, Variable>;
|
|
1497
|
+
variableCollections?: Record<string, VariableCollection>;
|
|
1498
|
+
/** Per-collection preview mode (collectionId → modeId); falls back to the collection's defaultModeId */
|
|
1499
|
+
activeVariableModes?: Record<string, string>;
|
|
1500
|
+
/** Node (usually a frame) the user picked to represent this file in the file browser.
|
|
1501
|
+
* When unset, the thumbnail is auto-generated (largest frame, else whole page). */
|
|
1502
|
+
thumbnailNodeId?: string;
|
|
1503
|
+
/** Libraries used by this file (libraryId → the version imported); their items carry `lib:<id>:` ids. */
|
|
1504
|
+
libraries?: Record<string, import('./libraries.js').LibraryUse>;
|
|
1505
|
+
/** The last PopCorn vote, kept with the file so results survive a reload (and reach files with no live room). */
|
|
1506
|
+
voteResults?: VoteResults;
|
|
1507
|
+
/** Kind, units, page size, bleed… (see `DocumentSettings`). Absent on plain canvases. */
|
|
1508
|
+
settings?: DocumentSettings;
|
|
1509
|
+
/**
|
|
1510
|
+
* The drawing palette: this file's set of made-up instruments. Absent until someone edits it, and
|
|
1511
|
+
* `defaultDrawPalette()` stands in (lib/presets/draw-palette.ts).
|
|
1512
|
+
*/
|
|
1513
|
+
drawPalette?: DrawTool[];
|
|
1514
|
+
/** Scene sequences (lib/motion/composition.ts): frames played one after another with transitions between them. */
|
|
1515
|
+
compositions?: Record<string, Composition>;
|
|
1516
|
+
/** The document as a website: its breakpoints (lib/document/breakpoints.ts). Absent until the file sets any. */
|
|
1517
|
+
site?: SiteSettings;
|
|
1518
|
+
/** The file's code modules, by id (lib/code): the React source its code components are drawn by. */
|
|
1519
|
+
codeModules?: Record<string, CodeModule>;
|
|
1520
|
+
/** The file's content collections and their records (lib/document/collections.ts). */
|
|
1521
|
+
collections?: Record<string, Collection>;
|
|
1522
|
+
/** Every collection's records, by record id (flat, so two people editing different records both keep their edits). */
|
|
1523
|
+
records?: Record<string, CollectionRecord>;
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* A window width a page is designed for. The widest has no `maxWidth` and is the design itself (the base); each
|
|
1527
|
+
* narrower one applies below its `maxWidth`, and is drawn on the canvas at `previewWidth`.
|
|
1528
|
+
*/
|
|
1529
|
+
export interface Breakpoint {
|
|
1530
|
+
id: string;
|
|
1531
|
+
name: string;
|
|
1532
|
+
maxWidth: number | null;
|
|
1533
|
+
previewWidth: number;
|
|
1534
|
+
}
|
|
1535
|
+
export interface SiteSettings {
|
|
1536
|
+
breakpoints?: Breakpoint[];
|
|
1537
|
+
}
|
|
1538
|
+
/** What a layer is as a form control on a web page. */
|
|
1539
|
+
export declare const CONTROL_KINDS: readonly ["FORM", "INPUT", "TEXTAREA", "SELECT", "CHECKBOX", "RADIO", "BUTTON"];
|
|
1540
|
+
export type ControlKind = (typeof CONTROL_KINDS)[number];
|
|
1541
|
+
export declare const INPUT_TYPES: readonly ["text", "email", "number", "tel", "url", "search", "date", "password"];
|
|
1542
|
+
/**
|
|
1543
|
+
* A layer as a form control (lib/document/controls.ts). The layer is still an ordinary layer: it is drawn, styled,
|
|
1544
|
+
* laid out and overridden as any other, and on a web page a real control takes its place and its look.
|
|
1545
|
+
*/
|
|
1546
|
+
export interface ControlMeta {
|
|
1547
|
+
kind: ControlKind;
|
|
1548
|
+
/** The name its value is sent under. */
|
|
1549
|
+
name?: string;
|
|
1550
|
+
/** INPUT: what it takes (default text). */
|
|
1551
|
+
inputType?: (typeof INPUT_TYPES)[number];
|
|
1552
|
+
/** INPUT / TEXTAREA: the hint shown while it is empty; unset: the words of its text layer. */
|
|
1553
|
+
placeholder?: string;
|
|
1554
|
+
required?: boolean;
|
|
1555
|
+
/** The value it starts with; CHECKBOX / RADIO: the value it sends when checked; BUTTON: what it sends, under its name, with the form it sends. */
|
|
1556
|
+
value?: string;
|
|
1557
|
+
/** CHECKBOX / RADIO: checked to begin with. */
|
|
1558
|
+
checked?: boolean;
|
|
1559
|
+
/** SELECT: its choices. */
|
|
1560
|
+
options?: {
|
|
1561
|
+
value: string;
|
|
1562
|
+
label: string;
|
|
1563
|
+
}[];
|
|
1564
|
+
/** BUTTON: what it does in a form (default: submit). */
|
|
1565
|
+
buttonType?: 'submit' | 'reset' | 'button';
|
|
1566
|
+
/** The variable that holds its value: typing writes it, so layers bound to it follow. */
|
|
1567
|
+
variableId?: string;
|
|
1568
|
+
/** FORM: what happens once it is sent (go to a thank-you screen, open an overlay). */
|
|
1569
|
+
onSubmit?: PrototypeAction;
|
|
1570
|
+
/**
|
|
1571
|
+
* FORM: what sending it does on a published site that has sign-in (lib/sites/auth.ts). `signUp` makes an account
|
|
1572
|
+
* from its `name`, `email` and `password` fields, `signIn` signs in with `email` and `password`, `signOut` ends the
|
|
1573
|
+
* session; `updateAccount` changes the visitor's name (`name`), `changePassword` their password (`password` and
|
|
1574
|
+
* `new_password`), `deleteAccount` ends the account (`password`), `forgotPassword` emails a reset link (`email`) that
|
|
1575
|
+
* opens the site's `/reset-password` page, where `resetPassword` sets the new one (`new_password`); `deleteRecord` (a form inside a list's copy) removes that copy's record from the visitor's own, `updateRecord` (also inside a copy) changes that record: the
|
|
1576
|
+
* fields the form sends take their new values and the rest stay as they were (a button's own `name` and `value`
|
|
1577
|
+
* are sent with the form it sends, so "Mark done" is a button named `done` with the value `Yes`). Unset:
|
|
1578
|
+
* its values are saved. `onSubmit` runs only when it worked.
|
|
1579
|
+
*/
|
|
1580
|
+
formAction?: 'signUp' | 'signIn' | 'signOut' | 'updateAccount' | 'changePassword' | 'deleteAccount' | 'forgotPassword' | 'resetPassword' | 'deleteRecord' | 'updateRecord';
|
|
1581
|
+
/** FORM: the collection its submissions are kept in. */
|
|
1582
|
+
collectionId?: string;
|
|
1583
|
+
}
|
|
1584
|
+
/** The kind of value a collection's field holds. */
|
|
1585
|
+
export declare const FIELD_TYPES: readonly ["TEXT", "RICH_TEXT", "NUMBER", "BOOLEAN", "DATE", "COLOR", "MEDIA", "URL", "SLUG", "OPTION"];
|
|
1586
|
+
export type FieldType = (typeof FIELD_TYPES)[number];
|
|
1587
|
+
export interface CollectionField {
|
|
1588
|
+
id: string;
|
|
1589
|
+
name: string;
|
|
1590
|
+
type: FieldType;
|
|
1591
|
+
options?: string[];
|
|
1592
|
+
}
|
|
1593
|
+
/** A set of records with the same fields: posts, products, team members (lib/document/collections.ts). */
|
|
1594
|
+
export interface Collection {
|
|
1595
|
+
id: string;
|
|
1596
|
+
name: string;
|
|
1597
|
+
fields: CollectionField[];
|
|
1598
|
+
/** The field a record's page address is made from. */
|
|
1599
|
+
slugFieldId?: string;
|
|
1600
|
+
/**
|
|
1601
|
+
* Each signed-in visitor of the published site has their own records (lib/sites/data.ts): the ones in the file are
|
|
1602
|
+
* what the design is drawn with, and on the site a visitor sees and adds only theirs, kept in the site's database.
|
|
1603
|
+
*/
|
|
1604
|
+
perVisitor?: boolean;
|
|
1605
|
+
/**
|
|
1606
|
+
* With `perVisitor`: every signed-in visitor sees everyone's records (a guest book, a team's board), each made by
|
|
1607
|
+
* whoever added it — `item_by` is their name, `item_mine` whether it is the visitor's own, and only its maker
|
|
1608
|
+
* changes or deletes one.
|
|
1609
|
+
*/
|
|
1610
|
+
shared?: boolean;
|
|
1611
|
+
/** Record ids, in order. */
|
|
1612
|
+
order: string[];
|
|
1613
|
+
}
|
|
1614
|
+
/** One record: its collection, and a value for each field (by field id). */
|
|
1615
|
+
export interface CollectionRecord {
|
|
1616
|
+
id: string;
|
|
1617
|
+
collectionId: string;
|
|
1618
|
+
values: Record<string, unknown>;
|
|
1619
|
+
/** When it was made (ISO), for a record a visitor saved: what `countSince` and `streak` count days by. */
|
|
1620
|
+
createdAt?: string;
|
|
1621
|
+
/** A shared collection's record: who made it, and whether that is the visitor looking at it. */
|
|
1622
|
+
by?: string;
|
|
1623
|
+
mine?: boolean;
|
|
1624
|
+
}
|
|
1625
|
+
/** A frame that repeats what it holds once for each record of a collection. */
|
|
1626
|
+
export interface RepeatMeta {
|
|
1627
|
+
collectionId: string;
|
|
1628
|
+
limit?: number;
|
|
1629
|
+
offset?: number;
|
|
1630
|
+
sort?: {
|
|
1631
|
+
fieldId: string;
|
|
1632
|
+
dir: 'ASC' | 'DESC';
|
|
1633
|
+
};
|
|
1634
|
+
/** An expression over `item` (lib/document/expressions.ts): only records it holds for are shown. */
|
|
1635
|
+
filter?: string;
|
|
1636
|
+
}
|
|
1637
|
+
/** A screen as a page of a website (lib/io/web/site.ts `routesOf`). */
|
|
1638
|
+
export interface RouteMeta {
|
|
1639
|
+
/** Its address: `/`, `/pricing`, `/blog/first-post`. Unset: `/` for the first screen, else made from its name. */
|
|
1640
|
+
path?: string;
|
|
1641
|
+
/** The page's title (the browser tab, a search result); unset: the frame's name. */
|
|
1642
|
+
title?: string;
|
|
1643
|
+
description?: string;
|
|
1644
|
+
/** The page a visitor gets for an address the site does not have. */
|
|
1645
|
+
notFound?: boolean;
|
|
1646
|
+
/**
|
|
1647
|
+
* Who the page is for, on a site with sign-in. `signedIn`: a visitor who is not signed in is taken to the site's
|
|
1648
|
+
* first `signedOut` page instead (its sign-in screen). `signedOut`: one who is signed in is taken to the first
|
|
1649
|
+
* `signedIn` page (their home). Unset: anyone.
|
|
1650
|
+
*/
|
|
1651
|
+
access?: 'signedIn' | 'signedOut';
|
|
1652
|
+
/** One page per record of this collection, at `path/<slug>`: the frame is the record's page, `item` its record. */
|
|
1653
|
+
collectionId?: string;
|
|
1654
|
+
}
|
|
1655
|
+
/** Where a link goes: a web address, one of the file's screens, a layer on the page, an email address or a phone number. */
|
|
1656
|
+
export type LinkTarget = {
|
|
1657
|
+
kind: 'url';
|
|
1658
|
+
url: string;
|
|
1659
|
+
newTab?: boolean;
|
|
1660
|
+
} | {
|
|
1661
|
+
kind: 'screen';
|
|
1662
|
+
frameId: string;
|
|
1663
|
+
} | {
|
|
1664
|
+
kind: 'anchor';
|
|
1665
|
+
nodeId: string;
|
|
1666
|
+
} | {
|
|
1667
|
+
kind: 'email';
|
|
1668
|
+
value: string;
|
|
1669
|
+
} | {
|
|
1670
|
+
kind: 'tel';
|
|
1671
|
+
value: string;
|
|
1672
|
+
};
|
|
1673
|
+
/** The element a layer is on a web page: a heading, a landmark, a list, a button, a link. */
|
|
1674
|
+
export declare const SEMANTIC_TAGS: readonly ["div", "section", "header", "footer", "nav", "main", "aside", "article", "ul", "ol", "li", "h1", "h2", "h3", "h4", "h5", "h6", "p", "span", "button", "figure", "label"];
|
|
1675
|
+
export type SemanticTag = (typeof SEMANTIC_TAGS)[number];
|
|
1676
|
+
/**
|
|
1677
|
+
* What a layer means on a web page, beside how it looks (lib/document/semantics.ts): the element it is, how a screen
|
|
1678
|
+
* reader names it, the id a link to it uses, and where it links.
|
|
1679
|
+
*/
|
|
1680
|
+
export interface NodeSemantics {
|
|
1681
|
+
tag?: SemanticTag;
|
|
1682
|
+
/** Its accessible name, where its words do not say it (an icon button's "Close"). */
|
|
1683
|
+
label?: string;
|
|
1684
|
+
/** Nothing a screen reader should meet: decoration. */
|
|
1685
|
+
hidden?: boolean;
|
|
1686
|
+
/** The id it has on the page (`#pricing`): what a link to this layer goes to. */
|
|
1687
|
+
anchor?: string;
|
|
1688
|
+
/** The whole layer is a link. */
|
|
1689
|
+
link?: LinkTarget;
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* What a layer may set differently at a breakpoint: its layout and its size, whether it shows, and the size of its
|
|
1693
|
+
* words. Everything else (its paint, what it says) is the same at every width.
|
|
1694
|
+
*/
|
|
1695
|
+
export interface ResponsiveProps {
|
|
1696
|
+
visible?: boolean;
|
|
1697
|
+
x?: number;
|
|
1698
|
+
y?: number;
|
|
1699
|
+
width?: number;
|
|
1700
|
+
height?: number;
|
|
1701
|
+
minWidth?: number;
|
|
1702
|
+
maxWidth?: number;
|
|
1703
|
+
minHeight?: number;
|
|
1704
|
+
maxHeight?: number;
|
|
1705
|
+
layoutMode?: FrameNode['layoutMode'];
|
|
1706
|
+
layoutWrap?: FrameNode['layoutWrap'];
|
|
1707
|
+
itemSpacing?: number;
|
|
1708
|
+
counterAxisSpacing?: number;
|
|
1709
|
+
padding?: FrameNode['padding'];
|
|
1710
|
+
primaryAxisAlignItems?: FrameNode['primaryAxisAlignItems'];
|
|
1711
|
+
counterAxisAlignItems?: FrameNode['counterAxisAlignItems'];
|
|
1712
|
+
layoutGridColumns?: FrameNode['layoutGridColumns'];
|
|
1713
|
+
layoutSizingHorizontal?: 'FIXED' | 'HUG' | 'FILL';
|
|
1714
|
+
layoutSizingVertical?: 'FIXED' | 'HUG' | 'FILL';
|
|
1715
|
+
layoutPositioning?: 'AUTO' | 'ABSOLUTE';
|
|
1716
|
+
fontSize?: number;
|
|
1717
|
+
lineHeight?: number | 'AUTO';
|
|
1718
|
+
textAlign?: 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFIED';
|
|
1719
|
+
/** The text style it is set in at this breakpoint (a headline that steps down a size): its size, leading and spacing come with it. */
|
|
1720
|
+
textStyleId?: string;
|
|
1721
|
+
}
|
|
1722
|
+
/**
|
|
1723
|
+
* One instrument on the drawing palette: a brush, a color and a size, kept together.
|
|
1724
|
+
*
|
|
1725
|
+
* A palette entry is not a tool in the toolbar sense — "brush" is. It is a brush already loaded: the red
|
|
1726
|
+
* marker, the green pencil, the 2px inker you use for panel borders. That is why the palette lives in the
|
|
1727
|
+
* FILE rather than the app: the set of instruments a comic is drawn with belongs to that comic, travels
|
|
1728
|
+
* with it, and is not the set you want open in a wireframe.
|
|
1729
|
+
*/
|
|
1730
|
+
export interface DrawTool {
|
|
1731
|
+
id: string;
|
|
1732
|
+
/** What the pointer does — the same tool ids the toolbar uses. */
|
|
1733
|
+
tool: ToolType;
|
|
1734
|
+
/** Which brush, when the tool paints. */
|
|
1735
|
+
preset: BrushPreset;
|
|
1736
|
+
/** A brush from the user's own library, which overrides `preset`'s dynamics. */
|
|
1737
|
+
userBrushId?: string;
|
|
1738
|
+
color: Color;
|
|
1739
|
+
size: number;
|
|
1740
|
+
/** 0–1. Absent means whatever the brush's own default is. */
|
|
1741
|
+
opacity?: number;
|
|
1742
|
+
/** 0–100 stabilisation, as the draw bar's Smooth slider sets it. */
|
|
1743
|
+
smoothing?: number;
|
|
1744
|
+
/** What the person called it. Unnamed instruments show their brush's name. */
|
|
1745
|
+
name?: string;
|
|
1746
|
+
}
|
|
1747
|
+
export interface VoteResults {
|
|
1748
|
+
endedAt: number;
|
|
1749
|
+
votesPerPerson: number;
|
|
1750
|
+
scope: 'STICKIES' | 'SELECTION' | 'ALL';
|
|
1751
|
+
/** node id → votes across everyone. */
|
|
1752
|
+
tallies: Record<string, number>;
|
|
1753
|
+
}
|
|
1754
|
+
export interface VariableCollection {
|
|
1755
|
+
id: string;
|
|
1756
|
+
name: string;
|
|
1757
|
+
modes: {
|
|
1758
|
+
id: string;
|
|
1759
|
+
name: string;
|
|
1760
|
+
}[];
|
|
1761
|
+
defaultModeId: string;
|
|
1762
|
+
}
|
|
1763
|
+
export type VariableType = 'COLOR' | 'FLOAT' | 'STRING' | 'BOOLEAN';
|
|
1764
|
+
export type VariableScope = 'ALL_FILLS' | 'FRAME_FILL' | 'SHAPE_FILL' | 'TEXT_FILL' | 'STROKE_COLOR' | 'EFFECT_COLOR' | 'WIDTH_HEIGHT' | 'GAP' | 'CORNER_RADIUS' | 'TEXT_CONTENT' | 'FONT_SIZE' | 'OPACITY';
|
|
1765
|
+
export type CodeSyntaxPlatform = 'WEB' | 'ANDROID' | 'iOS';
|
|
1766
|
+
export interface Variable {
|
|
1767
|
+
id: string;
|
|
1768
|
+
name: string;
|
|
1769
|
+
type: VariableType;
|
|
1770
|
+
variableCollectionId: string;
|
|
1771
|
+
valuesByMode: Record<string, any>;
|
|
1772
|
+
description?: string;
|
|
1773
|
+
/** Where the variable may be bound (empty / undefined: everywhere its type allows). */
|
|
1774
|
+
scopes?: VariableScope[];
|
|
1775
|
+
/** How the variable is named in code per platform (Dev Mode shows it instead of the raw name). */
|
|
1776
|
+
codeSyntax?: Partial<Record<CodeSyntaxPlatform, string>>;
|
|
1777
|
+
}
|
|
1778
|
+
/** Dev Mode annotation pinned to a layer. */
|
|
1779
|
+
export interface Annotation {
|
|
1780
|
+
id: string;
|
|
1781
|
+
label: string;
|
|
1782
|
+
category?: 'GENERAL' | 'ACCESSIBILITY' | 'INTERACTION' | 'CONTENT' | 'DEV';
|
|
1783
|
+
}
|
|
1784
|
+
/** A link developers need alongside a layer (Storybook, Jira, docs…). */
|
|
1785
|
+
export interface DevResource {
|
|
1786
|
+
id: string;
|
|
1787
|
+
name: string;
|
|
1788
|
+
url: string;
|
|
1789
|
+
}
|
|
1790
|
+
export type DevStatus = 'READY_FOR_DEV' | 'COMPLETED';
|
|
1791
|
+
/**
|
|
1792
|
+
* Code Connect: how a component is written in the codebase. `template` is the call site with `{{Prop}}`
|
|
1793
|
+
* placeholders for the component's properties (and `{{children}}`); the dev panel fills them from the
|
|
1794
|
+
* selected instance's values.
|
|
1795
|
+
*/
|
|
1796
|
+
export interface CodeConnect {
|
|
1797
|
+
path: string;
|
|
1798
|
+
importStatement?: string;
|
|
1799
|
+
template: string;
|
|
1800
|
+
language?: 'react' | 'swift' | 'compose' | 'vue' | 'other';
|
|
1801
|
+
}
|
|
1802
|
+
export type ToolType = 'SELECT' | 'SCALE' | 'FRAME' | 'SECTION' | 'SLICE' | 'RECTANGLE' | 'STICKY' | 'ELLIPSE' | 'POLYGON' | 'STAR' | 'LINE' | 'ARROW' | 'PEN' | 'PENCIL' | 'BRUSH' | 'SMUDGE' | 'CLONE' | 'HEAL' | 'LIQUIFY' | 'ERASER' | 'VECTOR' | 'TEXT' | 'HAND' | 'IMAGE' | 'COMMENT' | 'LASSO' | 'BUCKET' | (string & {});
|
|
1803
|
+
export type BrushPreset = 'MECH_PENCIL' | 'SKETCH_PENCIL' | 'COLORED_PENCIL' | 'VINE_CHARCOAL' | 'CHARCOAL_BLOCK' | 'CHARCOAL_PENCIL' | 'CHARCOAL_DUST' | 'BALLPOINT' | 'DIP_PEN' | 'FELT_TIP' | 'CROW_QUILL' | 'HATCH_PEN' | 'SCRATCH_PEN' | 'CONTOUR' | 'SOFT_ROUND' | 'SABLE' | 'DRY_BRUSH' | 'PALETTE_KNIFE' | 'STUCCO' | 'SPONGE' | 'RAKE' | 'SCUMBLE' | 'NOISE_TEX' | 'CANVAS_TEX' | 'PAPER_TOOTH' | 'BRUSH_SCRIPT' | 'CHISEL_MARKER' | 'FINE_HAIR' | 'SOFT_TINT' | 'HARD_ROUND' | 'BASIC' | 'HEIST' | 'BLOCKBUSTER' | 'GRINDHOUSE' | 'BIOPIC' | 'SPAGHETTI' | 'SLASHER' | 'MARKER' | 'HIGHLIGHTER' | 'AIRBRUSH' | 'WATERCOLOR' | 'INKER' | 'BRUSH_PEN' | 'TECHNICAL' | 'CALLIG_NIB' | 'ITALIC' | 'SCRIPT' | 'PENCIL_2B' | 'CHARCOAL' | 'CRAYON' | 'FLAT_BRUSH' | 'ROUND_BRUSH' | 'GOUACHE' | 'OIL' | 'SPRAYPAINT' | 'SPLATTER' | 'PENCIL_6B' | 'PENCIL_HB' | 'SOFT_PASTEL' | 'OIL_PASTEL' | 'CHALK' | 'WILLOW_CHARCOAL' | 'CONTE' | 'STUDIO_PEN' | 'SYRUP' | 'GEL_PEN' | 'DRY_INK' | 'FINE_TIP' | 'INK_BLEED' | 'MONOLINE' | 'GESINSKI' | 'EAGLEHAWK' | 'OBERON' | 'ACRYLIC' | 'WET_ACRYLIC' | 'WATER_WASH' | 'WATER_BRUSH' | 'AIRBRUSH_SOFT' | 'AIRBRUSH_MEDIUM' | 'AIRBRUSH_HARD' | 'AIRBRUSH_ULTRAFINE' | 'FAT_CAP' | 'MEDIUM_NOZZLE' | 'FLICKS' | 'GRUNGE' | 'STIPPLE' | 'HALFTONE_DOTS' | 'CONCRETE' | 'BRISTLE_BRUSH' | 'SPATTER_STAMP' | 'NEON' | 'LIGHTPEN' | 'GLIMMER';
|
|
1804
|
+
export type BrushTipShape = 'ROUND' | 'OVAL' | 'NIB' | 'CHISEL' | 'SQUARE';
|
|
1805
|
+
export type BrushTipStamp = 'BRISTLE' | 'SPATTER' | 'CHALK_BLOCK' | 'GRUNGE' | 'STIPPLE';
|
|
1806
|
+
export interface BrushDynamics {
|
|
1807
|
+
spacing: number;
|
|
1808
|
+
scatter: number;
|
|
1809
|
+
count: number;
|
|
1810
|
+
jitter: number;
|
|
1811
|
+
stampSize: number;
|
|
1812
|
+
pressureSize: boolean;
|
|
1813
|
+
taper: number;
|
|
1814
|
+
taperStart?: number;
|
|
1815
|
+
taperEnd?: number;
|
|
1816
|
+
taperOpacity?: number;
|
|
1817
|
+
taperTip?: number;
|
|
1818
|
+
tip?: BrushTipShape;
|
|
1819
|
+
tipStamp?: BrushTipStamp;
|
|
1820
|
+
tipStampImage?: string;
|
|
1821
|
+
tipFollow?: boolean | 'AZIMUTH';
|
|
1822
|
+
tipAngle?: number;
|
|
1823
|
+
roundness?: number;
|
|
1824
|
+
rotJitter?: number;
|
|
1825
|
+
countJitter?: number;
|
|
1826
|
+
speedSize?: number;
|
|
1827
|
+
fallOff?: number;
|
|
1828
|
+
hueJitter?: number;
|
|
1829
|
+
lightJitter?: number;
|
|
1830
|
+
pressureCurve?: number;
|
|
1831
|
+
goo?: number;
|
|
1832
|
+
settle?: number;
|
|
1833
|
+
dilution?: number;
|
|
1834
|
+
attack?: number;
|
|
1835
|
+
pull?: number;
|
|
1836
|
+
grade?: number;
|
|
1837
|
+
rendering?: BrushRendering;
|
|
1838
|
+
grain?: BrushGrainType;
|
|
1839
|
+
grainDepth?: number;
|
|
1840
|
+
grainScale?: number;
|
|
1841
|
+
grainBehaviour?: BrushGrainBehaviour;
|
|
1842
|
+
grainRotation?: number;
|
|
1843
|
+
grainBlend?: BrushGrainBlend;
|
|
1844
|
+
pressureOpacity?: boolean;
|
|
1845
|
+
pressureScatter?: number;
|
|
1846
|
+
tiltSize?: number;
|
|
1847
|
+
tiltOpacity?: number;
|
|
1848
|
+
/**
|
|
1849
|
+
* 0..1: shading with the side of the tip. Laying the pen down flattens the dab into an oval lying along the pen
|
|
1850
|
+
* (its azimuth) — with tiltSize widening it and tiltOpacity lightening it, a pencil shades like a real lead's side.
|
|
1851
|
+
*/
|
|
1852
|
+
tiltShape?: number;
|
|
1853
|
+
/** 0..1 of the way to flat (0.25 ≈ 22°): tilt up to this still draws with the point, as Procreate's tilt angle. */
|
|
1854
|
+
tiltThreshold?: number;
|
|
1855
|
+
colorPressure?: number;
|
|
1856
|
+
colorTilt?: number;
|
|
1857
|
+
colorStroke?: number;
|
|
1858
|
+
grainImage?: string;
|
|
1859
|
+
}
|
|
1860
|
+
/**
|
|
1861
|
+
* How a stroke's dabs accumulate (Procreate's "Rendering" tab).
|
|
1862
|
+
*
|
|
1863
|
+
* The two ends of this already existed as one unnamed boolean: a stroke either max-blends its dabs and
|
|
1864
|
+
* takes the brush opacity once at the end (a glaze), or over-blends dabs that each carry the opacity and
|
|
1865
|
+
* therefore darken where the stroke crosses itself (build-up). Naming it makes the middle reachable.
|
|
1866
|
+
*
|
|
1867
|
+
* LIGHT_GLAZE one flat pass at the brush opacity; overlaps inside the stroke never darken
|
|
1868
|
+
* UNIFORM_GLAZE the same, and per-dab alpha (pressure, taper, fall-off) is ignored — dead flat
|
|
1869
|
+
* INTENSE_GLAZE dabs build up, but each lays down less than the full opacity
|
|
1870
|
+
* HEAVY_GLAZE dabs build up at full opacity — the stroke darkens fast where it overlaps
|
|
1871
|
+
* BLENDING build-up that also picks up the color underneath (wet mix is forced on)
|
|
1872
|
+
*/
|
|
1873
|
+
export type BrushRendering = 'LIGHT_GLAZE' | 'UNIFORM_GLAZE' | 'INTENSE_GLAZE' | 'HEAVY_GLAZE' | 'BLENDING';
|
|
1874
|
+
export type BrushGrainType = 'PAPER' | 'CANVAS' | 'SPECKLE' | 'NOISE';
|
|
1875
|
+
/**
|
|
1876
|
+
* Where the grain lives (Procreate's grain "Behaviour").
|
|
1877
|
+
*
|
|
1878
|
+
* TEXTURIZED anchored to the canvas, so overlapping strokes share one continuous tooth — drawing on
|
|
1879
|
+
* real toothy paper. The only behaviour this engine had.
|
|
1880
|
+
* MOVING anchored to the brush, so the tooth travels with the stroke and smears along it — dry
|
|
1881
|
+
* media dragged across a surface rather than rubbed into one.
|
|
1882
|
+
*/
|
|
1883
|
+
export type BrushGrainBehaviour = 'TEXTURIZED' | 'MOVING';
|
|
1884
|
+
/**
|
|
1885
|
+
* How the grain meets the mark.
|
|
1886
|
+
*
|
|
1887
|
+
* BITE the tooth's peaks take paint away — what this engine always did
|
|
1888
|
+
* HOLD the opposite: paint clings to the peaks and the valleys stay bare, the way a crayon dragged
|
|
1889
|
+
* over a raised surface catches the tops
|
|
1890
|
+
* SOFT bites, but gently — the tooth has to be pronounced before it removes much, which is how a
|
|
1891
|
+
* fine-tooth paper reads under a soft pencil
|
|
1892
|
+
*/
|
|
1893
|
+
export type BrushGrainBlend = 'BITE' | 'HOLD' | 'SOFT';
|
|
1894
|
+
export type SymmetryMode = 'VERTICAL' | 'HORIZONTAL' | 'QUADRANT' | 'RADIAL';
|
|
1895
|
+
export interface SymmetrySettings {
|
|
1896
|
+
mode: SymmetryMode;
|
|
1897
|
+
center: {
|
|
1898
|
+
x: number;
|
|
1899
|
+
y: number;
|
|
1900
|
+
};
|
|
1901
|
+
segments?: number;
|
|
1902
|
+
}
|
|
1903
|
+
export type BrushRenderMode = 'VECTOR' | 'RASTER';
|
|
1904
|
+
/**
|
|
1905
|
+
* How the liquify brush moves pixels (Procreate "Liquify").
|
|
1906
|
+
*
|
|
1907
|
+
* PUSH carry pixels along with the brush
|
|
1908
|
+
* TWIRL_CW / TWIRL_CCW rotate the neighbourhood under the brush
|
|
1909
|
+
* PINCH draw the contents in toward the centre
|
|
1910
|
+
* EXPAND push them out from it
|
|
1911
|
+
* RECONSTRUCT relax the warp back toward the layer as it was when liquify first touched it
|
|
1912
|
+
*/
|
|
1913
|
+
export type LiquifyMode = 'PUSH' | 'TWIRL_CW' | 'TWIRL_CCW' | 'PINCH' | 'EXPAND' | 'RECONSTRUCT';
|
|
1914
|
+
export interface BrushSettings {
|
|
1915
|
+
size: number;
|
|
1916
|
+
opacity: number;
|
|
1917
|
+
hardness: number;
|
|
1918
|
+
smoothing: number;
|
|
1919
|
+
stabilization?: number;
|
|
1920
|
+
motionFiltering?: number;
|
|
1921
|
+
pressureSensitivity: boolean;
|
|
1922
|
+
preset: BrushPreset;
|
|
1923
|
+
color: Color;
|
|
1924
|
+
dynamics?: BrushDynamics;
|
|
1925
|
+
renderMode?: BrushRenderMode;
|
|
1926
|
+
wetMix?: number;
|
|
1927
|
+
smudgeStrength?: number;
|
|
1928
|
+
liquifyMode?: LiquifyMode;
|
|
1929
|
+
liquifyStrength?: number;
|
|
1930
|
+
secondaryColor?: Color;
|
|
1931
|
+
blendMode?: BlendMode;
|
|
1932
|
+
userBrushId?: string;
|
|
1933
|
+
paintIntoLayer?: boolean;
|
|
1934
|
+
}
|
|
1935
|
+
/** A saved user brush (Brush Studio "Save as brush" / imported Procreate brush). */
|
|
1936
|
+
export interface UserBrush {
|
|
1937
|
+
id: string;
|
|
1938
|
+
name: string;
|
|
1939
|
+
group: string;
|
|
1940
|
+
basePreset: BrushPreset;
|
|
1941
|
+
dynamics: BrushDynamics;
|
|
1942
|
+
size?: number;
|
|
1943
|
+
opacity?: number;
|
|
1944
|
+
hardness?: number;
|
|
1945
|
+
smoothing?: number;
|
|
1946
|
+
stabilization?: number;
|
|
1947
|
+
motionFiltering?: number;
|
|
1948
|
+
renderMode?: BrushRenderMode;
|
|
1949
|
+
wetMix?: number;
|
|
1950
|
+
blendMode?: BlendMode;
|
|
1951
|
+
secondaryColor?: Color;
|
|
1952
|
+
source?: 'USER' | 'PROCREATE';
|
|
1953
|
+
/** Set when the brush came from an installed marketplace brush pack (uninstalling the pack removes it). */
|
|
1954
|
+
packId?: string;
|
|
1955
|
+
createdAt: number;
|
|
1956
|
+
}
|
|
1957
|
+
export interface StrokePoint {
|
|
1958
|
+
x: number;
|
|
1959
|
+
y: number;
|
|
1960
|
+
pressure: number;
|
|
1961
|
+
timestamp: number;
|
|
1962
|
+
tilt?: number;
|
|
1963
|
+
azimuth?: number;
|
|
1964
|
+
}
|
|
1965
|
+
export interface VectorNode extends SceneNode {
|
|
1966
|
+
type: 'VECTOR';
|
|
1967
|
+
paths: VectorPath[];
|
|
1968
|
+
fillRule: 'NONZERO' | 'EVENODD';
|
|
1969
|
+
strokePoints?: StrokePoint[];
|
|
1970
|
+
brushPreset?: BrushPreset;
|
|
1971
|
+
centerline?: VectorPath;
|
|
1972
|
+
brushSize?: number;
|
|
1973
|
+
brushDynamics?: BrushDynamics;
|
|
1974
|
+
brushEditingSpine?: boolean;
|
|
1975
|
+
brushFills?: Paint[];
|
|
1976
|
+
}
|
|
1977
|
+
export type BooleanOperation = 'UNION' | 'SUBTRACT' | 'INTERSECT' | 'EXCLUDE';
|
|
1978
|
+
export interface Camera {
|
|
1979
|
+
x: number;
|
|
1980
|
+
y: number;
|
|
1981
|
+
zoom: number;
|
|
1982
|
+
}
|
|
1983
|
+
export interface SelectionBounds {
|
|
1984
|
+
x: number;
|
|
1985
|
+
y: number;
|
|
1986
|
+
width: number;
|
|
1987
|
+
height: number;
|
|
1988
|
+
rotation: number;
|
|
1989
|
+
}
|
|
1990
|
+
export interface Command {
|
|
1991
|
+
type: string;
|
|
1992
|
+
execute: () => void;
|
|
1993
|
+
undo: () => void;
|
|
1994
|
+
description: string;
|
|
1995
|
+
}
|
|
1996
|
+
/**
|
|
1997
|
+
* Every trigger, in the order the editor lists them: the one list the type, the command schema and the editability
|
|
1998
|
+
* registry read. ON_SCROLL fires as the frame it is on scrolls: a TIMELINE scrub reads the scroll offset instead of
|
|
1999
|
+
* a drag.
|
|
2000
|
+
*/
|
|
2001
|
+
export declare const INTERACTION_TRIGGERS: readonly ["ON_CLICK", "ON_HOVER", "ON_PRESS", "ON_DRAG", "MOUSE_ENTER", "MOUSE_LEAVE", "AFTER_TIMEOUT", "KEY_DOWN", "ON_SCROLL"];
|
|
2002
|
+
export type InteractionTrigger = (typeof INTERACTION_TRIGGERS)[number];
|
|
2003
|
+
export type TransitionType = 'INSTANT' | 'DISSOLVE' | 'SMART_ANIMATE' | 'SLIDE_FROM_LEFT' | 'SLIDE_FROM_RIGHT' | 'SLIDE_FROM_TOP' | 'SLIDE_FROM_BOTTOM' | 'PUSH_FROM_LEFT' | 'PUSH_FROM_RIGHT' | 'PUSH_FROM_TOP' | 'PUSH_FROM_BOTTOM'
|
|
2004
|
+
/** Move out: the source slides away and reveals the destination underneath. */
|
|
2005
|
+
| 'MOVE_OUT_TO_LEFT' | 'MOVE_OUT_TO_RIGHT' | 'MOVE_OUT_TO_TOP' | 'MOVE_OUT_TO_BOTTOM'
|
|
2006
|
+
/** The destination grows out of a circle about the transition's centre (a circle `clip-path` wipe). */
|
|
2007
|
+
| 'CIRCLE_WIPE'
|
|
2008
|
+
/** Iris out: the source closes into a circle about the centre over the destination. */
|
|
2009
|
+
| 'IRIS'
|
|
2010
|
+
/** The source rushes toward the view and fades while the destination settles in behind it. */
|
|
2011
|
+
| 'ZOOM_THROUGH'
|
|
2012
|
+
/** A straight cut: `INSTANT` under the name editors use for scenes. */
|
|
2013
|
+
| 'CUT'
|
|
2014
|
+
/** A whip pan: the camera swings left (both scenes rush right, the next one in from the left), streaked with motion blur. */
|
|
2015
|
+
| 'WHIP_LEFT'
|
|
2016
|
+
/** A whip pan to the right: both scenes rush left, the next one in from the right, streaked with motion blur. */
|
|
2017
|
+
| 'WHIP_RIGHT';
|
|
2018
|
+
export type EasingType = 'EASE_IN' | 'EASE_OUT' | 'EASE_IN_OUT' | 'LINEAR' | 'SPRING';
|
|
2019
|
+
export declare const NAVIGATION_TYPES: readonly ["NAVIGATE", "OVERLAY", "SWAP", "SCROLL_TO", "BACK", "CLOSE", "SET_VARIABLE", "SET_MODE", "CHANGE_TO", "TIMELINE", "ORBIT_3D", "CONDITIONAL", "OPEN_URL"];
|
|
2020
|
+
export type NavigationType = (typeof NAVIGATION_TYPES)[number];
|
|
2021
|
+
/** One branch of a CONDITIONAL action: its actions run, in order, when `condition` holds (no condition: else). */
|
|
2022
|
+
export interface ConditionalBranch {
|
|
2023
|
+
/** An expression over the variables (lib/document/expressions.ts); unset on the else branch. */
|
|
2024
|
+
condition?: string;
|
|
2025
|
+
actions: PrototypeAction[];
|
|
2026
|
+
}
|
|
2027
|
+
/** How an ORBIT_3D drag turns its layer: a horizontal drag turns it about its vertical axis (rotateY), a vertical one tilts it (rotateX) when `tilt` is on, within `tiltRange`. */
|
|
2028
|
+
export interface Orbit3D {
|
|
2029
|
+
/** Degrees per px of drag (default 0.4). */
|
|
2030
|
+
degreesPerPx?: number;
|
|
2031
|
+
/** A vertical drag tilts it too (default off). */
|
|
2032
|
+
tilt?: boolean;
|
|
2033
|
+
/** How far from its own the tilt goes, degrees (default [-30, 30]). */
|
|
2034
|
+
tiltRange?: [number, number];
|
|
2035
|
+
/**
|
|
2036
|
+
* The layer a vertical drag tilts (its rotateX), when not the orbited one: a group holding it, so the object tilts
|
|
2037
|
+
* toward the camera whichever way it has turned, as a trackball does.
|
|
2038
|
+
*/
|
|
2039
|
+
tiltLayerId?: string;
|
|
2040
|
+
}
|
|
2041
|
+
/** Which way a drag goes (ON_DRAG's `dragDirection`): its larger axis, and the sign along it. */
|
|
2042
|
+
export type DragDirection = 'LEFT' | 'RIGHT' | 'UP' | 'DOWN';
|
|
2043
|
+
/**
|
|
2044
|
+
* A TIMELINE action (lib/motion/timeline-control.ts): what it does to which timeline.
|
|
2045
|
+
* - SCRUB (ON_DRAG / ON_SCROLL): the drag's (or scroll's) distance along `axis` maps onto the span's time, `distance`
|
|
2046
|
+
* px covering the whole span; on release it holds, settles on the nearest marker, or plays on.
|
|
2047
|
+
* - PLAY / PAUSE / TOGGLE: the timeline's clock (a paused one holds where it is).
|
|
2048
|
+
* - SEEK: glide to a time, or the next / previous marker in the span: held, it holds there; playing, it plays on.
|
|
2049
|
+
*/
|
|
2050
|
+
export interface TimelineControl {
|
|
2051
|
+
op: 'SCRUB' | 'PLAY' | 'PAUSE' | 'TOGGLE' | 'SEEK';
|
|
2052
|
+
/** The active frame's timeline (default), or the motion instance the interaction belongs to. */
|
|
2053
|
+
target?: 'FRAME' | 'INSTANCE';
|
|
2054
|
+
/** SCRUB: the drag axis (default X). */
|
|
2055
|
+
axis?: 'X' | 'Y';
|
|
2056
|
+
/** SCRUB: px of drag that cover the span (default: the layer's own width or height). Negative: left / up moves on. */
|
|
2057
|
+
distance?: number;
|
|
2058
|
+
/** The ms range scrubbed and sought within (default: the whole timeline). */
|
|
2059
|
+
span?: [number, number];
|
|
2060
|
+
/** SCRUB: after the drag ends — stay put (default), settle on the nearest marker, or play on from there. */
|
|
2061
|
+
release?: 'HOLD' | 'SNAP' | 'PLAY';
|
|
2062
|
+
/** SEEK: a time (ms), or the next / previous marker. */
|
|
2063
|
+
to?: number | 'NEXT' | 'PREV';
|
|
2064
|
+
/** SNAP and SEEK: how long the glide takes (ms, default 350). */
|
|
2065
|
+
glide?: number;
|
|
2066
|
+
}
|
|
2067
|
+
export interface PrototypeTransition {
|
|
2068
|
+
type: TransitionType;
|
|
2069
|
+
duration: number;
|
|
2070
|
+
easing: EasingType;
|
|
2071
|
+
/** SPRING easing parameters (Figma-style gentle/quick/bouncy presets map onto these). */
|
|
2072
|
+
spring?: {
|
|
2073
|
+
stiffness: number;
|
|
2074
|
+
damping: number;
|
|
2075
|
+
mass: number;
|
|
2076
|
+
};
|
|
2077
|
+
/**
|
|
2078
|
+
* SMART_ANIMATE: ms between the hand-offs of the destination's top-level layers, in layer order (a chained
|
|
2079
|
+
* hand-off: the backdrop moves first, then the cover, then the words). The whole glide still takes `duration`.
|
|
2080
|
+
*/
|
|
2081
|
+
stagger?: number;
|
|
2082
|
+
/** CIRCLE_WIPE / IRIS / ZOOM_THROUGH: centre on the layer the interaction fired on instead of the frame's centre. */
|
|
2083
|
+
origin?: 'CENTER' | 'LAYER';
|
|
2084
|
+
/** Where it centres, as fractions of the source frame: what the player works out for `origin: 'LAYER'` (and keeps for Back). */
|
|
2085
|
+
params?: TransitionParams;
|
|
2086
|
+
}
|
|
2087
|
+
/**
|
|
2088
|
+
* A property path: `x`, `opacity`, `fills[@f1].color`, `effects[@e2].offset.x`, `text.content`. Array items are
|
|
2089
|
+
* addressed by their stable `id` (`[@id]`), never by index, so reordering or deleting items never retargets a track.
|
|
2090
|
+
*/
|
|
2091
|
+
export type PropPath = string & {
|
|
2092
|
+
readonly __propPath: unique symbol;
|
|
2093
|
+
};
|
|
2094
|
+
/** A value a track holds: numbers and colors interpolate; strings and booleans hold (discrete). */
|
|
2095
|
+
/** A key's value; an outline (a vector's `paths`) morphs, see lib/motion/morph.ts. */
|
|
2096
|
+
export type MotionValue = number | Color | string | boolean | VectorPath[];
|
|
2097
|
+
export type EaseFamily = 'sine' | 'quad' | 'cubic' | 'quart' | 'quint' | 'expo' | 'circ' | 'back' | 'elastic' | 'bounce';
|
|
2098
|
+
/** Penner's easing set (lib/editor/easing.ts `EASINGS`). */
|
|
2099
|
+
export type EaseName = `${EaseFamily}-${'in' | 'out' | 'in-out'}`;
|
|
2100
|
+
/** How a value travels from a key to the next one. */
|
|
2101
|
+
export type Interp = {
|
|
2102
|
+
kind: 'hold';
|
|
2103
|
+
} | {
|
|
2104
|
+
kind: 'linear';
|
|
2105
|
+
}
|
|
2106
|
+
/** CSS cubic-bezier control points. */
|
|
2107
|
+
| {
|
|
2108
|
+
kind: 'bezier';
|
|
2109
|
+
cp: [number, number, number, number];
|
|
2110
|
+
}
|
|
2111
|
+
/** A named curve; `param` is back's overshoot `c` (default 1.70158) or elastic's period (default 0.3). */
|
|
2112
|
+
| {
|
|
2113
|
+
kind: 'ease';
|
|
2114
|
+
name: EaseName;
|
|
2115
|
+
param?: number;
|
|
2116
|
+
}
|
|
2117
|
+
/** A damped spring settling over the segment (motion.dev-style parameters). */
|
|
2118
|
+
| {
|
|
2119
|
+
kind: 'spring';
|
|
2120
|
+
stiffness: number;
|
|
2121
|
+
damping: number;
|
|
2122
|
+
mass: number;
|
|
2123
|
+
};
|
|
2124
|
+
export interface Key<V extends MotionValue = MotionValue> {
|
|
2125
|
+
/** Stable within its track: selection, copy/paste and collab address keys by id rather than by time. */
|
|
2126
|
+
id: string;
|
|
2127
|
+
/** ms, in the layer's local time. */
|
|
2128
|
+
t: number;
|
|
2129
|
+
v: V;
|
|
2130
|
+
/** The curve to the next key. */
|
|
2131
|
+
out: Interp;
|
|
2132
|
+
/**
|
|
2133
|
+
* Spatial tangents of a position key (lib/motion/spatial.ts): px offsets from the key's position to the motion
|
|
2134
|
+
* path's bezier handles, arriving (`in`) and leaving (`out`). Stored on the x-axis key (`x` or `translateX`) of a
|
|
2135
|
+
* pair whose y-axis track has a key at the same time; absent: the path runs straight.
|
|
2136
|
+
*/
|
|
2137
|
+
spatial?: {
|
|
2138
|
+
in?: [number, number];
|
|
2139
|
+
out?: [number, number];
|
|
2140
|
+
};
|
|
2141
|
+
/** Inside a component: the value comes from this NUMBER / COLOR property (`· mul + add` for numbers), per instance;
|
|
2142
|
+
* `v` is what it shows where the property has no value. "Count to N", "slide this far". */
|
|
2143
|
+
bind?: KeyBinding;
|
|
2144
|
+
}
|
|
2145
|
+
/** A key value taken from a component property. */
|
|
2146
|
+
export interface KeyBinding {
|
|
2147
|
+
prop: string;
|
|
2148
|
+
mul?: number;
|
|
2149
|
+
add?: number;
|
|
2150
|
+
}
|
|
2151
|
+
/**
|
|
2152
|
+
* A behaviour on a track, evaluated when the track is sampled (lib/motion/modifiers.ts). Pure and deterministic.
|
|
2153
|
+
* `loop` remaps time before the keys are sampled; the others change the value afterwards, in array order.
|
|
2154
|
+
* Rates and frequencies are per second of layer time; `bounce.start`/`end` are ms.
|
|
2155
|
+
*/
|
|
2156
|
+
export type Modifier = ModifierBase & (
|
|
2157
|
+
/** Adds `rate` units per second: constant spin, scroll, drift. */
|
|
2158
|
+
{
|
|
2159
|
+
kind: 'spin';
|
|
2160
|
+
rate: number;
|
|
2161
|
+
}
|
|
2162
|
+
/** Adds `amp · sin(2π(freq·s + phase))`; `phase` in cycles. */
|
|
2163
|
+
| {
|
|
2164
|
+
kind: 'sine';
|
|
2165
|
+
amp: number;
|
|
2166
|
+
freq: number;
|
|
2167
|
+
phase?: number;
|
|
2168
|
+
}
|
|
2169
|
+
/** Adds smooth seeded noise in [-amp, amp] (wiggle). */
|
|
2170
|
+
| {
|
|
2171
|
+
kind: 'noise';
|
|
2172
|
+
amp: number;
|
|
2173
|
+
freq: number;
|
|
2174
|
+
octaves?: number;
|
|
2175
|
+
seed: number;
|
|
2176
|
+
}
|
|
2177
|
+
/** Adds `amp · |sin(π·freq·s)| · max(0, 1 − decay·s)` from `start` (until `end`): a decaying bounce. */
|
|
2178
|
+
| {
|
|
2179
|
+
kind: 'bounce';
|
|
2180
|
+
amp: number;
|
|
2181
|
+
freq: number;
|
|
2182
|
+
decay: number;
|
|
2183
|
+
start: number;
|
|
2184
|
+
end?: number;
|
|
2185
|
+
}
|
|
2186
|
+
/** Past `range` (default: the first to the last key) the keys repeat, mirror, carry on at the end speed, or repeat stacked. */
|
|
2187
|
+
| {
|
|
2188
|
+
kind: 'loop';
|
|
2189
|
+
mode: 'cycle' | 'pingpong' | 'continue' | 'offset';
|
|
2190
|
+
range?: [number, number];
|
|
2191
|
+
}
|
|
2192
|
+
/** Wraps the value into [offset, offset + period): a scrolling grid. */
|
|
2193
|
+
| {
|
|
2194
|
+
kind: 'mod';
|
|
2195
|
+
period: number;
|
|
2196
|
+
offset?: number;
|
|
2197
|
+
}
|
|
2198
|
+
/** Takes another layer's sampled value (`· mul + add`, `delay` ms behind): a pick-whip. */
|
|
2199
|
+
| {
|
|
2200
|
+
kind: 'link';
|
|
2201
|
+
source: {
|
|
2202
|
+
nodeId: string;
|
|
2203
|
+
path: PropPath;
|
|
2204
|
+
};
|
|
2205
|
+
mul?: number;
|
|
2206
|
+
add?: number;
|
|
2207
|
+
delay?: number;
|
|
2208
|
+
} | {
|
|
2209
|
+
kind: 'clamp';
|
|
2210
|
+
min?: number;
|
|
2211
|
+
max?: number;
|
|
2212
|
+
}
|
|
2213
|
+
/**
|
|
2214
|
+
* Follows the audio the timeline plays (lib/motion/audio-signals.ts): the signal (0…1, `gain`× then past
|
|
2215
|
+
* `threshold`) maps onto `from`…`to`, which is added to the value (`add`, the default), replaces it (`set`) or scales
|
|
2216
|
+
* it (`multiply`). A colour track mixes toward `color` by the signal. `attack`/`release` smooth it (ms), `lag` reads it
|
|
2217
|
+
* that many ms back (a waveform's history), `bin` picks a spectrum band (0 low … 1 high), `clip` one clip (id or media
|
|
2218
|
+
* hash). With nothing heard (editing at rest) the signal is 0.
|
|
2219
|
+
*/
|
|
2220
|
+
| {
|
|
2221
|
+
kind: 'audio';
|
|
2222
|
+
signal: AudioSignalName;
|
|
2223
|
+
gain: number;
|
|
2224
|
+
from: number;
|
|
2225
|
+
to: number;
|
|
2226
|
+
mode?: AudioBehaviourMode;
|
|
2227
|
+
bin?: number;
|
|
2228
|
+
attack?: number;
|
|
2229
|
+
release?: number;
|
|
2230
|
+
lag?: number;
|
|
2231
|
+
threshold?: number;
|
|
2232
|
+
clip?: string;
|
|
2233
|
+
color?: Color;
|
|
2234
|
+
});
|
|
2235
|
+
/** What an `audio` behaviour follows (lib/motion/audio-analysis.ts computes each from the decoded file). */
|
|
2236
|
+
export type AudioSignalName = 'level' | 'bass' | 'mid' | 'treble' | 'beat' | 'onset' | 'spectrum';
|
|
2237
|
+
/** How an `audio` behaviour's mapped signal meets the value. */
|
|
2238
|
+
export type AudioBehaviourMode = 'add' | 'set' | 'multiply';
|
|
2239
|
+
/** What every behaviour carries besides its own parameters. */
|
|
2240
|
+
export interface ModifierBase {
|
|
2241
|
+
/** Stable within its track: the behaviours list addresses a behaviour by id, so a reorder never retargets an edit. */
|
|
2242
|
+
id?: string;
|
|
2243
|
+
/**
|
|
2244
|
+
* Keyed parameters: a numeric parameter with keys here takes its value from them (layer time, the keys' own curves)
|
|
2245
|
+
* instead of the stored field — a wiggle whose amplitude dies down, a spin that speeds up.
|
|
2246
|
+
*/
|
|
2247
|
+
animated?: {
|
|
2248
|
+
[param: string]: Key<number>[] | undefined;
|
|
2249
|
+
};
|
|
2250
|
+
}
|
|
2251
|
+
export interface Track<V extends MotionValue = MotionValue> {
|
|
2252
|
+
/** Sorted by `t`. Empty with modifiers means "the rest value plus the modifiers" (a constant spin needs no keys). */
|
|
2253
|
+
keys: Key<V>[];
|
|
2254
|
+
modifiers?: Modifier[];
|
|
2255
|
+
muted?: boolean;
|
|
2256
|
+
}
|
|
2257
|
+
/** The order a stagger visits a container's children in. */
|
|
2258
|
+
export type StaggerOrder = 'index' | 'reverse' | 'center' | 'random' | {
|
|
2259
|
+
ids: string[];
|
|
2260
|
+
};
|
|
2261
|
+
export interface Stagger {
|
|
2262
|
+
/** ms between consecutive children. */
|
|
2263
|
+
delay: number;
|
|
2264
|
+
order: StaggerOrder;
|
|
2265
|
+
/** For `random`: the same seed gives the same order. */
|
|
2266
|
+
seed?: number;
|
|
2267
|
+
/** Spreads the offsets along a curve instead of evenly (the total stays `delay · (n − 1)`). */
|
|
2268
|
+
distribution?: Interp;
|
|
2269
|
+
}
|
|
2270
|
+
export interface NodeMotion {
|
|
2271
|
+
tracks: Partial<Record<PropPath, Track>>;
|
|
2272
|
+
/** Local time shift (ms): this layer and its subtree run `timeOffset` later (a layer start, a baked stagger). */
|
|
2273
|
+
timeOffset?: number;
|
|
2274
|
+
/** Visible range in parent time (ms): the layer exists in [in, out). */
|
|
2275
|
+
span?: {
|
|
2276
|
+
in: number;
|
|
2277
|
+
out?: number;
|
|
2278
|
+
};
|
|
2279
|
+
/** Live stagger over this container's children (lib/motion/time.ts). */
|
|
2280
|
+
stagger?: Stagger;
|
|
2281
|
+
}
|
|
2282
|
+
/**
|
|
2283
|
+
* Frame rates a timeline snaps and steps at, in menu order — the one list the timeline, export, templates and the
|
|
2284
|
+
* command schemas read (120 for high-frame-rate screens and slow-motion edits).
|
|
2285
|
+
*/
|
|
2286
|
+
export declare const TIMELINE_FPS_VALUES: readonly [24, 25, 30, 50, 60, 120];
|
|
2287
|
+
export type TimelineFps = (typeof TIMELINE_FPS_VALUES)[number];
|
|
2288
|
+
/** A named moment on a timeline: a snap target, a cue. `pause` markers are present mode's click steps. */
|
|
2289
|
+
export interface TimelineMarker {
|
|
2290
|
+
id: string;
|
|
2291
|
+
/** ms, frame time. */
|
|
2292
|
+
t: number;
|
|
2293
|
+
label?: string;
|
|
2294
|
+
kind?: 'marker' | 'pause';
|
|
2295
|
+
}
|
|
2296
|
+
/** An animated top-level frame's timeline. */
|
|
2297
|
+
export interface FrameTimeline {
|
|
2298
|
+
/** ms. */
|
|
2299
|
+
duration: number;
|
|
2300
|
+
/** The frame grid keys, the playhead and nudges snap to (60 when unset). */
|
|
2301
|
+
fps?: TimelineFps;
|
|
2302
|
+
/** The range [in, out) (ms) that playback loops within and export renders. Unset: the whole duration. */
|
|
2303
|
+
workArea?: [number, number];
|
|
2304
|
+
/** Sorted by `t`, unique ids. */
|
|
2305
|
+
markers?: TimelineMarker[];
|
|
2306
|
+
/** Sound of its own (frame ms), on lanes like a composition's: detached video sound, imported files. */
|
|
2307
|
+
audio?: AudioClip[];
|
|
2308
|
+
}
|
|
2309
|
+
export type StateMachineValue = boolean | number | string;
|
|
2310
|
+
export type StateMachineInputType = 'boolean' | 'number' | 'string' | 'event';
|
|
2311
|
+
/** A value the machine's guards read: a boolean, number or string with its starting value, or an event (fired, never held). */
|
|
2312
|
+
export interface StateMachineInput {
|
|
2313
|
+
id: string;
|
|
2314
|
+
name: string;
|
|
2315
|
+
type: StateMachineInputType;
|
|
2316
|
+
/** The starting value (events have none). */
|
|
2317
|
+
value?: StateMachineValue;
|
|
2318
|
+
}
|
|
2319
|
+
export type StateMachineGuardOp = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
2320
|
+
/** A condition on one input: compared with `value` (an event input: whether it was just fired). */
|
|
2321
|
+
export interface StateMachineGuard {
|
|
2322
|
+
input: string;
|
|
2323
|
+
op?: StateMachineGuardOp;
|
|
2324
|
+
value?: StateMachineValue;
|
|
2325
|
+
}
|
|
2326
|
+
export type StateMachineActionType = 'set' | 'toggle' | 'increment' | 'decrement' | 'fire' | 'reset';
|
|
2327
|
+
/** A change to one input: set to `value`, toggle a boolean, step a number by `value` (default 1), fire an event, reset to its start. */
|
|
2328
|
+
export interface StateMachineAction {
|
|
2329
|
+
type: StateMachineActionType;
|
|
2330
|
+
input: string;
|
|
2331
|
+
value?: StateMachineValue;
|
|
2332
|
+
}
|
|
2333
|
+
/** One state: the stretch of the timeline it plays (marker ids; unset `from`: the start, unset `to`: the next marker or the end). */
|
|
2334
|
+
export interface StateMachineState {
|
|
2335
|
+
id: string;
|
|
2336
|
+
name: string;
|
|
2337
|
+
from?: string;
|
|
2338
|
+
to?: string;
|
|
2339
|
+
/** Plays its stretch over and over (default: once, then holds its last frame). */
|
|
2340
|
+
loop?: boolean;
|
|
2341
|
+
/** Timeline ms per ms (default 1). */
|
|
2342
|
+
speed?: number;
|
|
2343
|
+
/** Actions run when the state is entered. */
|
|
2344
|
+
entry?: StateMachineAction[];
|
|
2345
|
+
/** Where it sits in the graph (px). */
|
|
2346
|
+
x: number;
|
|
2347
|
+
y: number;
|
|
2348
|
+
}
|
|
2349
|
+
/** A way from one state (or any: '*') to another, taken when every guard holds. Checked in id order. */
|
|
2350
|
+
export interface StateMachineTransition {
|
|
2351
|
+
id: string;
|
|
2352
|
+
from: string;
|
|
2353
|
+
to: string;
|
|
2354
|
+
guards?: StateMachineGuard[];
|
|
2355
|
+
}
|
|
2356
|
+
export type StateMachineListenerType = 'pointerDown' | 'pointerUp' | 'pointerEnter' | 'pointerExit' | 'click' | 'complete' | 'keyDown' | 'keyUp';
|
|
2357
|
+
/**
|
|
2358
|
+
* What sets the inputs: a pointer event on a layer (any layer of the frame when unset), a key pressed or let go, or a
|
|
2359
|
+
* state's stretch finishing.
|
|
2360
|
+
*/
|
|
2361
|
+
export interface StateMachineListener {
|
|
2362
|
+
id: string;
|
|
2363
|
+
type: StateMachineListenerType;
|
|
2364
|
+
layer?: string;
|
|
2365
|
+
/** keyDown / keyUp: the key (KeyboardEvent.key, letters in either case); unset, any key. */
|
|
2366
|
+
key?: string;
|
|
2367
|
+
actions: StateMachineAction[];
|
|
2368
|
+
}
|
|
2369
|
+
export interface StateMachine {
|
|
2370
|
+
/** Stable: the dotLottie file names the machine by it. */
|
|
2371
|
+
id: string;
|
|
2372
|
+
name: string;
|
|
2373
|
+
/** The state it starts in. */
|
|
2374
|
+
initial: string;
|
|
2375
|
+
states: Record<string, StateMachineState>;
|
|
2376
|
+
transitions: Record<string, StateMachineTransition>;
|
|
2377
|
+
inputs: Record<string, StateMachineInput>;
|
|
2378
|
+
listeners: Record<string, StateMachineListener>;
|
|
2379
|
+
}
|
|
2380
|
+
/** A scene sequence: its clips, in the order they play. */
|
|
2381
|
+
export interface Composition {
|
|
2382
|
+
id: string;
|
|
2383
|
+
name: string;
|
|
2384
|
+
/** px: the stage every scene is shown on, centred. */
|
|
2385
|
+
width: number;
|
|
2386
|
+
height: number;
|
|
2387
|
+
fps: TimelineFps;
|
|
2388
|
+
/** Behind the scenes (where no clip is playing, or a scene does not cover the stage). */
|
|
2389
|
+
background?: Color;
|
|
2390
|
+
/** A deck's soundtrack (lib/audio/presentation): the page it narrates, how it was made, each slide's narration. */
|
|
2391
|
+
presentation?: import('../audio/presentation/types.js').PresentationSoundtrack;
|
|
2392
|
+
/** Sorted by `start`; each clip's transition fits in its overlap with the clip before (lib/motion/invariants.ts). */
|
|
2393
|
+
clips: SceneClip[];
|
|
2394
|
+
/** Its sound (lib/motion/audio-plan.ts): clips of audio from the media store on lanes, mixed; sorted by lane, then start. */
|
|
2395
|
+
audio?: AudioClip[];
|
|
2396
|
+
/** Playback loops within, and export renders, [in, out) ms of composition time. Unset: all of it. */
|
|
2397
|
+
workArea?: [number, number];
|
|
2398
|
+
/** Sorted by `t`, unique ids. */
|
|
2399
|
+
markers?: TimelineMarker[];
|
|
2400
|
+
/** Present mode: at the end, start again from the first scene instead of holding the last frame. */
|
|
2401
|
+
showLoop?: boolean;
|
|
2402
|
+
}
|
|
2403
|
+
/** One scene of a composition: frame `frameId`'s timeline from `in` to `out` (frame ms), starting at `start` (composition ms). */
|
|
2404
|
+
export interface SceneClip {
|
|
2405
|
+
id: string;
|
|
2406
|
+
frameId: string;
|
|
2407
|
+
/** Composition ms the clip starts at. */
|
|
2408
|
+
start: number;
|
|
2409
|
+
/** Frame ms the clip plays from. */
|
|
2410
|
+
in: number;
|
|
2411
|
+
/** Frame ms it plays to (exclusive): the clip lasts `out − in`. */
|
|
2412
|
+
out: number;
|
|
2413
|
+
/** How it replaces the clip before it: over the first `duration` ms of this clip, while the one before plays out. */
|
|
2414
|
+
transitionIn?: SceneTransition;
|
|
2415
|
+
/** Present mode: at this scene's end, carry on (unset, `end`), wait for a click, or hold `seconds` first. */
|
|
2416
|
+
advance?: ShowAdvance;
|
|
2417
|
+
}
|
|
2418
|
+
/**
|
|
2419
|
+
* A piece of an audio file on one of a composition's lanes: the file's `in` to `out` (file ms), heard from `start`
|
|
2420
|
+
* (composition ms). Times are ms in the document; they become samples only inside the mixer (48 kHz). Clips on one
|
|
2421
|
+
* lane never overlap (lib/motion/audio-clips.ts); lanes sum.
|
|
2422
|
+
*/
|
|
2423
|
+
export interface AudioClip {
|
|
2424
|
+
id: string;
|
|
2425
|
+
/** The file in the media store (lib/storage/media-store.ts, `popcraft-media:<hash>`), content-hashed like `videoHash`. */
|
|
2426
|
+
mediaHash: string;
|
|
2427
|
+
/** What the strip labels it (the file's name when imported). */
|
|
2428
|
+
name: string;
|
|
2429
|
+
/** Composition ms the clip is heard from. */
|
|
2430
|
+
start: number;
|
|
2431
|
+
/** File ms it plays from. */
|
|
2432
|
+
in: number;
|
|
2433
|
+
/** File ms it plays to (exclusive): the clip lasts `out − in`. */
|
|
2434
|
+
out: number;
|
|
2435
|
+
/** Level over the clip as a linear factor (1 = as recorded), keyed in clip ms (0 = the clip's start); unset: 1. */
|
|
2436
|
+
gain?: Track<number>;
|
|
2437
|
+
/** ms the clip takes to rise from silence at its start (linear); unset: none. */
|
|
2438
|
+
fadeIn?: number;
|
|
2439
|
+
/** ms it takes to fall to silence at its end (linear); unset: none. */
|
|
2440
|
+
fadeOut?: number;
|
|
2441
|
+
/** The fades' shape: straight lines (unset), or equal power (sin/cos) — what a crossfade uses, so its level holds. */
|
|
2442
|
+
fadeCurve?: 'linear' | 'equalPower';
|
|
2443
|
+
/** File ms per clip ms (0.25…4), pitch kept (lib/motion/time-stretch.ts): the clip lasts `(out − in) / speed`. 1 unset. */
|
|
2444
|
+
speed?: number;
|
|
2445
|
+
/** Derived, never stored: the video layer this is the linked sound of (lib/motion/sound.ts). */
|
|
2446
|
+
link?: string;
|
|
2447
|
+
muted?: boolean;
|
|
2448
|
+
/** Which lane it sits on (0 is the top one). */
|
|
2449
|
+
lane: number;
|
|
2450
|
+
/** Stereo balance, −1 (left) … 1 (right); unset: centre. */
|
|
2451
|
+
pan?: number;
|
|
2452
|
+
}
|
|
2453
|
+
/** A transition between two scenes (the same types and evaluator as prototype transitions: lib/motion/transitions.ts). */
|
|
2454
|
+
export interface SceneTransition {
|
|
2455
|
+
type: TransitionType;
|
|
2456
|
+
/** ms. */
|
|
2457
|
+
duration: number;
|
|
2458
|
+
/** The curve its progress follows. */
|
|
2459
|
+
interp: Interp;
|
|
2460
|
+
params?: TransitionParams;
|
|
2461
|
+
}
|
|
2462
|
+
export interface TransitionParams {
|
|
2463
|
+
/** Where circle wipes, irises and zooms centre, as fractions of the stage (0.5, 0.5 by default). */
|
|
2464
|
+
center?: {
|
|
2465
|
+
x: number;
|
|
2466
|
+
y: number;
|
|
2467
|
+
};
|
|
2468
|
+
}
|
|
2469
|
+
export type OverlayPosition = 'CENTER' | 'TOP_LEFT' | 'TOP_CENTER' | 'TOP_RIGHT' | 'BOTTOM_LEFT' | 'BOTTOM_CENTER' | 'BOTTOM_RIGHT' | 'MANUAL';
|
|
2470
|
+
export interface PrototypeAction {
|
|
2471
|
+
navigationType: NavigationType;
|
|
2472
|
+
destinationId: string | null;
|
|
2473
|
+
transition: PrototypeTransition;
|
|
2474
|
+
variableId?: string;
|
|
2475
|
+
variableValue?: any;
|
|
2476
|
+
variableToggle?: boolean;
|
|
2477
|
+
/**
|
|
2478
|
+
* SET_VARIABLE: the value as an expression over the variables (`health - 15`, `min(maxHealth, health + 25)`,
|
|
2479
|
+
* `$key` for the key that fired): worked out when the action runs, in place of `variableValue`. A number set with
|
|
2480
|
+
* a transition duration glides there in present mode (bound layers ease over it) while the variable holds the
|
|
2481
|
+
* new value at once.
|
|
2482
|
+
*/
|
|
2483
|
+
variableExpression?: string;
|
|
2484
|
+
/** CHANGE_TO: the instance that changes (unset: the one the interaction fired on, or the instance it sits in). */
|
|
2485
|
+
targetId?: string;
|
|
2486
|
+
/** CONDITIONAL: the branches, tried in order; the first that holds runs. */
|
|
2487
|
+
branches?: ConditionalBranch[];
|
|
2488
|
+
collectionId?: string;
|
|
2489
|
+
modeId?: string;
|
|
2490
|
+
overlayPosition?: OverlayPosition;
|
|
2491
|
+
/** MANUAL position: offset of the overlay's top-left from the active frame's top-left. */
|
|
2492
|
+
overlayOffset?: {
|
|
2493
|
+
x: number;
|
|
2494
|
+
y: number;
|
|
2495
|
+
};
|
|
2496
|
+
/** Dim the frame behind the overlay (null / undefined: no dim). */
|
|
2497
|
+
overlayBackground?: {
|
|
2498
|
+
color: Color;
|
|
2499
|
+
opacity: number;
|
|
2500
|
+
} | null;
|
|
2501
|
+
closeOnOutsideClick?: boolean;
|
|
2502
|
+
timeline?: TimelineControl;
|
|
2503
|
+
orbit?: Orbit3D;
|
|
2504
|
+
/** OPEN_URL: where it goes (a web address, an email address, a phone number). */
|
|
2505
|
+
link?: LinkTarget;
|
|
2506
|
+
}
|
|
2507
|
+
export interface Interaction {
|
|
2508
|
+
id: string;
|
|
2509
|
+
trigger: InteractionTrigger;
|
|
2510
|
+
action: PrototypeAction;
|
|
2511
|
+
triggerDelay?: number;
|
|
2512
|
+
/** KEY_DOWN: the key that fires it (KeyboardEvent.key); any key when unset. */
|
|
2513
|
+
triggerKey?: string;
|
|
2514
|
+
/** ON_DRAG: only a drag this way fires it (a swipe down to close, a swipe right to go back); any way when unset. */
|
|
2515
|
+
dragDirection?: DragDirection;
|
|
2516
|
+
}
|
|
2517
|
+
export interface Comment {
|
|
2518
|
+
id: string;
|
|
2519
|
+
authorId: string;
|
|
2520
|
+
authorName: string;
|
|
2521
|
+
authorAvatarUrl?: string;
|
|
2522
|
+
message: string;
|
|
2523
|
+
createdAt: number;
|
|
2524
|
+
updatedAt?: number;
|
|
2525
|
+
resolved: boolean;
|
|
2526
|
+
x: number;
|
|
2527
|
+
y: number;
|
|
2528
|
+
pageId?: string;
|
|
2529
|
+
nodeId?: string;
|
|
2530
|
+
offsetX?: number;
|
|
2531
|
+
offsetY?: number;
|
|
2532
|
+
reactions?: Record<string, string[]>;
|
|
2533
|
+
replies: CommentReply[];
|
|
2534
|
+
}
|
|
2535
|
+
export interface CommentReply {
|
|
2536
|
+
id: string;
|
|
2537
|
+
authorId: string;
|
|
2538
|
+
authorName: string;
|
|
2539
|
+
authorAvatarUrl?: string;
|
|
2540
|
+
message: string;
|
|
2541
|
+
createdAt: number;
|
|
2542
|
+
reactions?: Record<string, string[]>;
|
|
2543
|
+
}
|
|
2544
|
+
export interface ExtensionManifest {
|
|
2545
|
+
id: string;
|
|
2546
|
+
name: string;
|
|
2547
|
+
version: string;
|
|
2548
|
+
description?: string;
|
|
2549
|
+
main: string;
|
|
2550
|
+
ui?: string;
|
|
2551
|
+
permissions: string[];
|
|
2552
|
+
}
|
|
2553
|
+
export interface Extension {
|
|
2554
|
+
manifest: ExtensionManifest;
|
|
2555
|
+
enabled: boolean;
|
|
2556
|
+
iframe?: HTMLIFrameElement;
|
|
2557
|
+
}
|
|
2558
|
+
export declare function createColor(r: number, g: number, b: number, a?: number): Color;
|
|
2559
|
+
export declare function createSolidPaint(color: Color): Paint;
|
|
2560
|
+
export declare function createDefaultSceneNodeProps(): Omit<SceneNode, keyof BaseNode>;
|