@flatkit/types 0.19.12 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +13 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -122,6 +122,13 @@ type Keyframe = {
|
|
|
122
122
|
};
|
|
123
123
|
/** Channels animatable by expression (= the decomposed components + opacity). */
|
|
124
124
|
type ExprChannel = 'x' | 'y' | 'scaleX' | 'scaleY' | 'rotation' | 'opacity';
|
|
125
|
+
/** ADDITIVE position offsets: a binding `dx = …` shifts the resolved position by `dx` in PARENT space,
|
|
126
|
+
* on top of the body's `at` (and any absolute `x`/`y` channel) — `pos = (at.x + dx, at.y + dy)`. Solves
|
|
127
|
+
* the recurring "absolute `x` deserts the anchor" trap for offset-style motion (`dx = 30*sin(time)`
|
|
128
|
+
* oscillates AROUND `at`, no need to re-inject the base). Bindings only — not a keyframe/modifier channel. */
|
|
129
|
+
type OffsetChannel = 'dx' | 'dy';
|
|
130
|
+
/** Any channel that an expression BINDING can target: the absolute channels + the additive offsets. */
|
|
131
|
+
type BindChannel = ExprChannel | OffsetChannel;
|
|
125
132
|
/** A STATEFUL channel modifier: instead of a pure expression, the channel INTEGRATES over time toward
|
|
126
133
|
* `target` (a normal expression). State lives per (instance, channel) in the player, advanced at a fixed
|
|
127
134
|
* step, independent of `onEnterFrame`/input; on random access (seek/render) it snaps to `target` (the rest
|
|
@@ -180,7 +187,7 @@ type Timeline = {
|
|
|
180
187
|
type InstanceBind = {
|
|
181
188
|
symbol: string;
|
|
182
189
|
as: string;
|
|
183
|
-
expr: Partial<Record<
|
|
190
|
+
expr: Partial<Record<BindChannel, string>>;
|
|
184
191
|
};
|
|
185
192
|
/**
|
|
186
193
|
* How a nested instance's OWN timeline advances (Flash's symbol-instance models):
|
|
@@ -401,7 +408,7 @@ type Group = {
|
|
|
401
408
|
w: number;
|
|
402
409
|
h: number;
|
|
403
410
|
};
|
|
404
|
-
expressions?: Partial<Record<
|
|
411
|
+
expressions?: Partial<Record<BindChannel, string>>;
|
|
405
412
|
modifiers?: Partial<Record<ExprChannel, ChannelModifier>>;
|
|
406
413
|
clip?: ClipRect;
|
|
407
414
|
};
|
|
@@ -420,7 +427,7 @@ type Instance = {
|
|
|
420
427
|
playback?: InstancePlayback;
|
|
421
428
|
filters?: Filter[];
|
|
422
429
|
blend?: BlendMode;
|
|
423
|
-
expressions?: Partial<Record<
|
|
430
|
+
expressions?: Partial<Record<BindChannel, string>>;
|
|
424
431
|
modifiers?: Partial<Record<ExprChannel, ChannelModifier>>;
|
|
425
432
|
params?: Record<string, string>;
|
|
426
433
|
clip?: ClipRect;
|
|
@@ -537,7 +544,7 @@ type Text = {
|
|
|
537
544
|
pivot?: Point;
|
|
538
545
|
filters?: Filter[];
|
|
539
546
|
blend?: BlendMode;
|
|
540
|
-
expressions?: Partial<Record<
|
|
547
|
+
expressions?: Partial<Record<BindChannel, string>>;
|
|
541
548
|
modifiers?: Partial<Record<ExprChannel, ChannelModifier>>;
|
|
542
549
|
};
|
|
543
550
|
/** Bitmap image: a leaf item animatable like text. References an asset; `w`/`h` = intrinsic size in px
|
|
@@ -557,7 +564,7 @@ type Image = {
|
|
|
557
564
|
pivot?: Point;
|
|
558
565
|
filters?: Filter[];
|
|
559
566
|
blend?: BlendMode;
|
|
560
|
-
expressions?: Partial<Record<
|
|
567
|
+
expressions?: Partial<Record<BindChannel, string>>;
|
|
561
568
|
modifiers?: Partial<Record<ExprChannel, ChannelModifier>>;
|
|
562
569
|
};
|
|
563
570
|
/** Layer content: material, one-off group, symbol instance, text, or image. */
|
|
@@ -614,4 +621,4 @@ type EditFrame = {
|
|
|
614
621
|
};
|
|
615
622
|
type Tool = 'brush' | 'rect' | 'ellipse' | 'eraser' | 'fill' | 'select' | 'transform' | 'text' | 'pan' | 'pen' | 'pathselect' | 'ink';
|
|
616
623
|
|
|
617
|
-
export type { Action, Asset, BBox, BlendMode, Cel, ChannelModifier, ClipRect, ContentKey, ContentTrack, Doc, Easing, EditFrame, ExprChannel, ExprContext, Filter, Folder, FrameAction, FrameLabel, FuncDef, Group, Image, Instance, InstanceBind, InstancePlayback, Interaction, Interactor, Item, ItemEvent, ItemInteractionState, Keyframe, Layer, Paint, ParamDef, ParamType, Path, PlaybackMode, Point, PolyGroup, Polygon, Pose, Region, ResolveOpts, Ring, Seg, SendPayload, Shape, SoundClip, SpinDir, StateAnchor, StateMachine, Stop, Stroke, Subpath, SymbolDef, Text, TextPath, Timeline, TimelineTrack, Tint, Tool, Transform };
|
|
624
|
+
export type { Action, Asset, BBox, BindChannel, BlendMode, Cel, ChannelModifier, ClipRect, ContentKey, ContentTrack, Doc, Easing, EditFrame, ExprChannel, ExprContext, Filter, Folder, FrameAction, FrameLabel, FuncDef, Group, Image, Instance, InstanceBind, InstancePlayback, Interaction, Interactor, Item, ItemEvent, ItemInteractionState, Keyframe, Layer, OffsetChannel, Paint, ParamDef, ParamType, Path, PlaybackMode, Point, PolyGroup, Polygon, Pose, Region, ResolveOpts, Ring, Seg, SendPayload, Shape, SoundClip, SpinDir, StateAnchor, StateMachine, Stop, Stroke, Subpath, SymbolDef, Text, TextPath, Timeline, TimelineTrack, Tint, Tool, Transform };
|