@it-compiles/anima 0.1.3 → 0.1.4

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.
@@ -156,27 +156,33 @@ export type Padding = number | {
156
156
  bottom?: number;
157
157
  left?: number;
158
158
  };
159
- /** Handle for measured bounding box - returns lazy expressions */
159
+ /** Lazy function that evaluates Vec2 from resolved context (always callable) */
160
+ export type Vec2Fn = (ctx: ResolvedCtx) => Vec2;
161
+ /** Lazy function that evaluates number from resolved context (always callable) */
162
+ export type NumFn = (ctx: ResolvedCtx) => number;
163
+ /** Lazy function that evaluates Rect from resolved context (always callable) */
164
+ export type RectFn = (ctx: ResolvedCtx) => Rect;
165
+ /** Handle for measured bounding box - returns lazy expressions that are always callable */
160
166
  export interface BBoxHandle {
161
167
  /** Add uniform or per-side padding */
162
168
  pad(p: Padding): BBoxHandle;
163
- /** Get size as [width, height] */
164
- size(): Vec2Expr;
165
- /** Get width in pixels */
166
- width(): NumExpr;
167
- /** Get height in pixels */
168
- height(): NumExpr;
169
+ /** Get size as [width, height] - always returns a callable function */
170
+ size(): Vec2Fn;
171
+ /** Get width in pixels - always returns a callable function */
172
+ width(): NumFn;
173
+ /** Get height in pixels - always returns a callable function */
174
+ height(): NumFn;
169
175
  /** Get { width, height } for use with resize().to() */
170
176
  whSize(): {
171
- width: NumExpr;
172
- height: NumExpr;
177
+ width: NumFn;
178
+ height: NumFn;
173
179
  };
174
- /** Get center point */
175
- center(): Vec2Expr;
176
- /** Get position of any anchor on the bbox */
177
- anchor(a: Anchor): Vec2Expr;
178
- /** Get the raw rect */
179
- toRect(): RectExpr;
180
+ /** Get center point - always returns a callable function */
181
+ center(): Vec2Fn;
182
+ /** Get position of any anchor on the bbox - always returns a callable function */
183
+ anchor(a: Anchor): Vec2Fn;
184
+ /** Get the raw rect - always returns a callable function */
185
+ toRect(): RectFn;
180
186
  }
181
187
  export interface PinMethods {
182
188
  to(pos: Vec2Expr, u: number): void;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { Vec2, Vec2Expr, NumExpr, RectExpr, Anchor, SceneObject, GroupObject, ObjRef, Scene, Timeline, TimelineAPI, AnimCtx, EaseFn, Transform, Rect, TextOpts, RectOpts, ImageOpts, ImageSource, LayoutOpts, AlignOpts, Padding, PinMethods, TransformMethods, ResizeMethods, FitMethods, BBoxHandle, GroupBuilder, LayoutBuilder, ResolvedCtx, } from './core';
1
+ export type { Vec2, Vec2Expr, NumExpr, RectExpr, Vec2Fn, NumFn, RectFn, Anchor, SceneObject, GroupObject, ObjRef, Scene, Timeline, TimelineAPI, AnimCtx, EaseFn, Transform, Rect, TextOpts, RectOpts, ImageOpts, ImageSource, LayoutOpts, AlignOpts, Padding, PinMethods, TransformMethods, ResizeMethods, FitMethods, BBoxHandle, GroupBuilder, LayoutBuilder, ResolvedCtx, } from './core';
2
2
  export { isGroup, isExpr } from './core';
3
3
  export { makeScene } from './core';
4
4
  export { timeline } from './core';