@algorisys/tinyfly 0.102.0 → 0.103.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.
@@ -1,54 +0,0 @@
1
- /**
2
- * Hand-drawn strokes for canvas drawing: each line is drawn a few times, a
3
- * little off and a little bowed, the way a pencil line is. "Line boil" redraws
4
- * the wobble a few times a second, so a still drawing looks alive.
5
- *
6
- * The wobble comes from a seeded generator keyed to the seed, the boil frame
7
- * and the stroke's place in the drawing order, never from Math.random, so the
8
- * same time always draws the same lines: a frame rendered twice, in a browser
9
- * or headless, is identical.
10
- *
11
- * Every stroke takes a `progress` (0..1) to draw it on, as a pencil would: the
12
- * part drawn so far lies exactly on the finished stroke, so it grows without
13
- * jumping.
14
- */
15
- export interface SketchStyle {
16
- /** Largest wobble, px (default 2) */
17
- roughness?: number;
18
- /** Strokes per line: 1 is clean, 2 or 3 look sketched (default 2) */
19
- passes?: number;
20
- /** Redraws per second; 0 holds the wobble still (default 8, about "on threes" at 24 fps) */
21
- boil?: number;
22
- /** Seed for the wobble, so two drawings with the same style do not boil in step (default 1) */
23
- seed?: number;
24
- }
25
- export interface Point {
26
- x: number;
27
- y: number;
28
- }
29
- /** Which redraw is showing at `time` ms. */
30
- export declare function boilFrame(time: number, boil: number): number;
31
- /**
32
- * Strokes in the context's current stroke style and line width. Each stroke's
33
- * wobble is seeded by its place in the drawing order, so draw them in the same
34
- * order every frame; a stroke drawn on partway wobbles exactly as it will when
35
- * it is finished, and does not disturb the strokes after it.
36
- */
37
- export interface SketchPen {
38
- /** A line through the points, each segment slightly bowed; `progress` draws it on (default 1) */
39
- line(points: Point[], progress?: number): void;
40
- /**
41
- * A smooth curve through the points (a limb drawn as a curve). The wobble
42
- * is spread along the whole curve rather than added at every point, so a
43
- * finely sampled curve stays smooth instead of turning lumpy.
44
- */
45
- curve(points: Point[], progress?: number): void;
46
- /** A circle whose end overshoots its start, as a quick pencil circle does */
47
- circle(cx: number, cy: number, r: number, progress?: number): void;
48
- /** An ellipse drawn the same way as `circle` */
49
- ellipse(cx: number, cy: number, rx: number, ry: number, progress?: number): void;
50
- /** A small random offset, up to `scale` × roughness, for nudging details (a face) with the boil */
51
- nudge(scale?: number): Point;
52
- }
53
- /** A pen whose wobble is fixed for the boil frame showing at `time` ms. */
54
- export declare function sketchPen(ctx: CanvasRenderingContext2D, style: SketchStyle, time: number): SketchPen;
@@ -1,47 +0,0 @@
1
- /**
2
- * Which points in time a playhead passed between two frames — the pure part of
3
- * timeline callbacks (`call`, `addPause`, per-tween `onStart` / `onComplete`,
4
- * `onRepeat`).
5
- *
6
- * A frame moves the playhead from one place to another, possibly across loop
7
- * boundaries: a plain repeat wraps back to the start, a yoyo turns around. The
8
- * movement is split into passes, and each pass reports the event times inside it
9
- * in the order they were crossed:
10
- *
11
- * - forward, `(from, to]` — an event exactly where the playhead already was has
12
- * fired before; a pass that starts a loop (or a first play) includes its start;
13
- * - reverse, `[to, from)`.
14
- */
15
- export type Direction = 'forward' | 'reverse';
16
- export interface Playhead {
17
- /** Milliseconds within the current loop */
18
- time: number;
19
- /** Loops completed */
20
- iteration: number;
21
- direction: Direction;
22
- /** The playhead is at the very start of a pass, so an event at its position has not fired */
23
- fresh?: boolean;
24
- }
25
- export type Crossing = {
26
- kind: 'event';
27
- index: number;
28
- direction: Direction;
29
- } | {
30
- kind: 'repeat';
31
- };
32
- export interface CrossingResult {
33
- crossings: Crossing[];
34
- /** Every stretch of time covered, in order, as [from, to] (to < from when reversing) */
35
- passes: Array<[number, number]>;
36
- }
37
- export interface LoopShape {
38
- duration: number;
39
- /** Yoyo: every other loop plays backwards */
40
- alternate: boolean;
41
- /**
42
- * The frame ended waiting out a repeat delay at a boundary. A plain repeat has
43
- * not wrapped yet, so the last pass (the new loop) has not started.
44
- */
45
- holding?: boolean;
46
- }
47
- export declare function playheadCrossings(times: readonly number[], from: Playhead, to: Playhead, shape: LoopShape): CrossingResult;