@algorisys/tinyfly 0.97.0 → 0.99.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.
Files changed (48) hide show
  1. package/README.md +10 -10
  2. package/docs/acting.md +76 -13
  3. package/docs/character-appearance.md +329 -0
  4. package/docs/editor-guide.md +54 -9
  5. package/docs/examples.md +1 -1
  6. package/docs/getting-started.md +1 -1
  7. package/docs/gsap-compat.md +1 -1
  8. package/docs/llm-guide.md +29 -2
  9. package/docs/maps.md +2 -2
  10. package/docs/props.md +8 -6
  11. package/docs/scene-3d.md +3 -1
  12. package/docs/teaching.md +1 -1
  13. package/lib/addons/characters.js +5911 -4230
  14. package/lib/browser/tinyfly.iife.js +14 -14
  15. package/lib/browser/tinyfly.js +8545 -6864
  16. package/lib/browser/tinyfly.umd.js +14 -14
  17. package/lib/types/characters/acting/character-script.d.ts +44 -0
  18. package/lib/types/characters/acting/index.d.ts +1 -0
  19. package/lib/types/characters/capabilities.d.ts +15 -0
  20. package/lib/types/characters/cast.d.ts +284 -0
  21. package/lib/types/characters/character.d.ts +35 -5
  22. package/lib/types/characters/chart.d.ts +52 -14
  23. package/lib/types/characters/hair-follow.d.ts +76 -0
  24. package/lib/types/characters/hands/held-items.d.ts +88 -0
  25. package/lib/types/characters/hands/index.d.ts +1 -0
  26. package/lib/types/characters/head/ears.d.ts +10 -0
  27. package/lib/types/characters/head/facial-hair.d.ts +118 -0
  28. package/lib/types/characters/head/glasses.d.ts +24 -0
  29. package/lib/types/characters/head/hair.d.ts +586 -0
  30. package/lib/types/characters/head/hats.d.ts +58 -0
  31. package/lib/types/characters/head/head-look.d.ts +56 -0
  32. package/lib/types/characters/head/index.d.ts +5 -0
  33. package/lib/types/characters/head/shell.d.ts +64 -0
  34. package/lib/types/characters/index.d.ts +5 -1
  35. package/lib/types/characters/interactions.d.ts +69 -0
  36. package/lib/types/characters/props/draw.d.ts +9 -0
  37. package/lib/types/characters/props/families/animals.d.ts +6 -0
  38. package/lib/types/characters/props/prop-surface.d.ts +14 -3
  39. package/lib/types/characters/props/ride-3d.d.ts +31 -2
  40. package/lib/types/characters/props/target.d.ts +5 -1
  41. package/lib/types/characters/species/human-motion.d.ts +5 -2
  42. package/lib/types/characters/species/human.d.ts +113 -4
  43. package/lib/types/characters/wardrobe/basic-outfit.d.ts +19 -5
  44. package/lib/types/characters/whiteboard.d.ts +13 -1
  45. package/llms-full.txt +549 -56
  46. package/llms.txt +29 -28
  47. package/package.json +1 -1
  48. package/skills/tinyfly/SKILL.md +18 -4
@@ -0,0 +1,64 @@
1
+ import type { Point } from '../../adapters/canvas/sketch';
2
+ import type { Vec3 } from '../rig/body-plan';
3
+ import { type SolvedHead } from '../rig/skeleton';
4
+ /**
5
+ * Regions on and around the head: hair, a beard, a hat's crown. A region is
6
+ * described in the head's own terms and drawn wherever the head's turn, nod
7
+ * and tilt put it, so it turns with the head through every view instead of
8
+ * being a flat drawing pasted on.
9
+ *
10
+ * A point on the head is named by two numbers:
11
+ * - `around`: radians around the head from the middle of the face, toward the
12
+ * character's left +, so ±π is the back of the head;
13
+ * - `up`: head radii from the head's centre, +1 the crown, -1 under the chin
14
+ * (below -1 only for things that hang, like long hair or a long beard).
15
+ *
16
+ * The region says where it is (`inside`, positive inside) and where each of
17
+ * its points sits (`position`, in head radii: x toward the character's left,
18
+ * y up, z forward). It is cut into the part facing the viewer and the part
19
+ * facing away; each part's outline is traced (marching squares over a grid
20
+ * of `around` × `up`) and projected to the screen. The far part is drawn
21
+ * before the head and the near part after it, so a bob shows beside the face
22
+ * and its fringe crosses the forehead, and from behind the hair covers the
23
+ * whole head. Same input, same outline: no randomness, no state.
24
+ */
25
+ export interface ShellRegion {
26
+ /** Positive inside the region, negative outside; continuous across the boundary */
27
+ inside(around: number, up: number): number;
28
+ /** Where a point of the region is, head radii (x toward its left, y up, z forward) */
29
+ position(around: number, up: number): Vec3;
30
+ /** Which way the surface faces there (default: away from the head's centre) */
31
+ normal?(around: number, up: number): Vec3;
32
+ /** Highest `up` the region reaches (default 1, the crown) */
33
+ top?: number;
34
+ /** Lowest `up` the region reaches (default -1, under the chin) */
35
+ bottom?: number;
36
+ }
37
+ /** The two halves of a region as seen: outlines on the screen. */
38
+ export interface ShellOutlines {
39
+ /** The part facing the viewer: drawn over the head */
40
+ near: Point[][];
41
+ /** The part facing away: drawn behind the head */
42
+ far: Point[][];
43
+ }
44
+ /** A point on the unit sphere from `around` and `up`. */
45
+ export declare function spherePoint(around: number, up: number): Vec3;
46
+ /** How directly a head-space direction faces the viewer: 1 straight on, 0 at the edge, negative away. */
47
+ export declare function facingOf(head: SolvedHead, [x, y, z]: Vec3): number;
48
+ /** A head-space point (head radii) on the screen. */
49
+ export declare function onScreen(head: SolvedHead, point: Vec3): Point;
50
+ /** Smallest angle between two `around` values. */
51
+ export declare function aroundDistance(a: number, b: number): number;
52
+ /**
53
+ * Trace the outlines of a region's near and far parts, on the screen.
54
+ * `columns` around the head: more for fine texture (spikes, curls).
55
+ */
56
+ export declare function shellOutlines(head: SolvedHead, region: ShellRegion, columns?: number): ShellOutlines;
57
+ export declare function cachedOutlines(head: SolvedHead, key: unknown, make: () => ShellOutlines): ShellOutlines;
58
+ /**
59
+ * Run `draw` with the head's disc cut out of the canvas, for things behind
60
+ * the head: they show only around it, even when the head is see-through.
61
+ */
62
+ export declare function behindHead(ctx: CanvasRenderingContext2D, head: SolvedHead, draw: () => void): void;
63
+ /** Split a head-space polyline into the runs that face the viewer, on the screen. */
64
+ export declare function visibleRuns(head: SolvedHead, points: Vec3[], normals: Vec3[], threshold?: number): Point[][];
@@ -23,11 +23,15 @@ export * from './surface';
23
23
  export * from '../adapters/canvas/polyline';
24
24
  export * from './hand';
25
25
  export * from './character';
26
- export { humanPlan, humanPose, mirrorHumanPose, humanFieldLabel, HUMAN_REST, HUMAN_POSES, HUMAN_EXPRESSIONS, type HumanBuild, type HumanPoseName } from './species/human';
26
+ export { humanPlan, humanPose, mirrorHumanPose, humanFieldLabel, HUMAN_REST, HUMAN_POSES, HUMAN_EXPRESSIONS, HUMAN_BUILDS, type HumanBuild, type HumanBuildName, type HumanPoseName, type HumanExpressionName } from './species/human';
27
+ export { CHARACTER_CAST, castMember, type CastMember, type CastName } from './cast';
28
+ export { meetHands, meetingSpacing, HAND_MEETINGS, type HandMeeting, type HandsMeet, type MeetingPartner, type MeetHandsOptions } from './interactions';
27
29
  export * from './species/human-motion';
28
30
  export type { BodyPlan, ChainSpec, BoneSpec, BoneAngles, ContactSpec, HeadSpec, Pose as CharacterPose, Vec3 } from './rig/body-plan';
29
31
  export { createPen, ellipsePoints, type Pen, type Look, type PencilOptions, type PenOptions } from './look/pen';
30
32
  export { basicOutfit, type BasicOutfitOptions } from './wardrobe/basic-outfit';
33
+ export * from './head';
34
+ export { hairFollow, hairFollowTracks, hairMotionAt, type HairFollowSample, type HairFollowOptions, type HairFollowKey, type HairFollowTrackOptions } from './hair-follow';
31
35
  export * from './hands';
32
36
  export * from './acting';
33
37
  export * from './capabilities';
@@ -0,0 +1,69 @@
1
+ import { type Character } from './character';
2
+ import type { Pose } from './rig/body-plan';
3
+ /**
4
+ * Two characters whose hands meet: a handshake, a high five, a fist bump, or
5
+ * a parcel handed from one to the other. Rather than playing two clips and
6
+ * hoping the hands line up, both arms reach (exactly, see `reachCharacter`)
7
+ * for one shared point, worked out from where the two stand and how tall
8
+ * they are. The result is two poses and the point, plain data to key as
9
+ * tracks; any field of the poses can still be changed.
10
+ *
11
+ * Both stand on the same ground line, `a` on the left facing right and `b`
12
+ * on the right facing left, turned three-quarters toward the viewer (or side
13
+ * on, with `view: 'side'`). Hands are the characters' right hands (a hand
14
+ * over uses both).
15
+ */
16
+ export type HandMeeting = 'handshake' | 'highFive' | 'fistBump' | 'handOver';
17
+ export interface MeetingPartner {
18
+ character: Character;
19
+ /** Starting pose (default rest); its arms are replaced, the rest kept */
20
+ pose?: Pose;
21
+ /** Scene x of the feet */
22
+ x: number;
23
+ }
24
+ export interface MeetHandsOptions {
25
+ /** `threeQuarter` (default): turned toward the viewer as well as each other; `side`: in profile */
26
+ view?: 'threeQuarter' | 'side';
27
+ /** Where the hands meet, as a share of the shorter one's height above the ground (default by kind) */
28
+ height?: number;
29
+ }
30
+ export interface HandsMeet {
31
+ a: Pose;
32
+ b: Pose;
33
+ /** Where the hands meet: scene x, and px above the ground (negative y, as drawing space) */
34
+ point: {
35
+ x: number;
36
+ y: number;
37
+ };
38
+ /** Both reached it (they stand close enough; see `meetingSpacing`) */
39
+ reached: boolean;
40
+ }
41
+ /**
42
+ * Each kind: how high the hands meet and how far apart the two stand for
43
+ * it (both as a share of the shorter one's height), and how far they lean in.
44
+ */
45
+ export declare const HAND_MEETINGS: {
46
+ handshake: {
47
+ height: number;
48
+ spacing: number;
49
+ lean: number;
50
+ };
51
+ highFive: {
52
+ height: number;
53
+ spacing: number;
54
+ lean: number;
55
+ };
56
+ fistBump: {
57
+ height: number;
58
+ spacing: number;
59
+ lean: number;
60
+ };
61
+ handOver: {
62
+ height: number;
63
+ spacing: number;
64
+ lean: number;
65
+ };
66
+ };
67
+ /** How far apart (px, feet to feet) two characters stand for their hands to meet comfortably. */
68
+ export declare function meetingSpacing(kind: HandMeeting, a: Character, b: Character): number;
69
+ export declare function meetHands(kind: HandMeeting, a: MeetingPartner, b: MeetingPartner, options?: MeetHandsOptions): HandsMeet;
@@ -31,6 +31,15 @@ export interface PropDrawOptions {
31
31
  paper?: string;
32
32
  /** The fog's colour, for faces lit by a scene (`light`, `fog` on the solved faces) */
33
33
  fog?: string;
34
+ /** Parts that have come loose (see `propSurface().piece`): drawn carried from where they sit and turned about their middle, by part id */
35
+ loose?: Record<string, LoosePart>;
36
+ }
37
+ /** Where a loose part has gone: px from its place in the prop's space, its turn (degrees) and how faded it is. */
38
+ export interface LoosePart {
39
+ x: number;
40
+ y: number;
41
+ rotate: number;
42
+ opacity: number;
34
43
  }
35
44
  /** Draws in the prop's own space: feet at 0, 0, up is −y. */
36
45
  export declare function drawSolvedProp(ctx: CanvasRenderingContext2D, solved: SolvedProp, options?: PropDrawOptions): void;
@@ -139,6 +139,12 @@ export declare function sittingPose(h: Pick<QuadrupedHelpers, 'upper' | 'lower'
139
139
  export declare const QUADRUPED_ACTING: ActingRig;
140
140
  /** Kept for the horse's name. */
141
141
  export declare const HORSE_ACTING: ActingRig;
142
+ /**
143
+ * Lying down with the head up (a sphinx pose): the body lowered until the
144
+ * folded hind legs and the belly are on the ground, the front legs stretched
145
+ * forward along it, paws flat.
146
+ */
147
+ export declare function lyingPose(h: Pick<QuadrupedHelpers, 'upper' | 'lower' | 'foot' | 'legLength' | 'tailHangs'>): Record<string, number>;
142
148
  export interface AnimalOptions {
143
149
  kind?: string;
144
150
  summary?: string;
@@ -30,6 +30,12 @@ import { type PropTarget } from './target';
30
30
  * that drives off. Edits are keys on its controls, written out by `tracks()`
31
31
  * on the prop target's id. Do not key a control both here and in its own
32
32
  * script: the later track wins.
33
+ *
34
+ * A part can come loose: `piece('part:wheel-0-left')` makes it a piece that
35
+ * `fling`, `follow` and `move` carry off (or the `fling` and `move` edits),
36
+ * drawn where it went. Every anchor and part is a floor: a figure standing
37
+ * on the roof (`onto: { surface, anchor: 'anchor:roof' }`) is carried with
38
+ * it as the prop lifts, drives or is squashed (`ride()`).
33
39
  */
34
40
  export interface PropSurfaceOptions {
35
41
  /** The prop's own tracks (its `propScript` result), so its places follow it as it moves */
@@ -40,8 +46,8 @@ export interface PropSurface extends Surface {
40
46
  readonly prop: PropTarget;
41
47
  /** The box at a named place, at `time` (default: after every edit): `box`, `anchor:NAME`, `part:ID`, `control:NAME` */
42
48
  anchor(name: string, time?: number): SurfaceBox;
43
- /** A prop has no pieces: this throws */
44
- piece(anchor: string): SurfacePiece;
49
+ /** Make the part at a `part:` place a piece that can come loose (with the parts built on it: a wheel and its hub) */
50
+ piece(anchor: string): PropPiece;
45
51
  /** Change the prop at a time: `set` a control to a value, or `switch` it on (open) or off (shut) */
46
52
  edit(name: string, anchor: string | string[], options: SurfaceEditOptions): PropSurface;
47
53
  follow(piece: SurfacePiece, path: TimedPoint[]): PropSurface;
@@ -52,12 +58,17 @@ export interface PropSurface extends Surface {
52
58
  y: number;
53
59
  };
54
60
  }): PropSurface;
55
- /** Nothing on a prop carries a figure yet: the tracks come back as they are */
61
+ /** A figure's tracks with it carried by the anchor or part it stands on, as the prop moves */
56
62
  ride(tracks: Track[], target: string, options: {
57
63
  ground: number;
58
64
  every?: number;
59
65
  }): Track[];
60
66
  tracks(target: string): Track[];
61
67
  }
68
+ /** A part of a prop that has come loose. */
69
+ export interface PropPiece extends SurfacePiece {
70
+ /** The part's id */
71
+ readonly part: string;
72
+ }
62
73
  export declare const PROP_SURFACE: SurfaceAbout;
63
74
  export declare function propSurface(target: PropTarget, options?: PropSurfaceOptions): PropSurface;
@@ -1,7 +1,7 @@
1
1
  import type { Track } from '../../engine/types';
2
2
  import type { Vec3 } from '../../engine/math';
3
3
  import type { Pose } from '../rig/body-plan';
4
- import { type CharacterOptions } from '../character';
4
+ import { type CharacterOptions, type CharacterPoseKey } from '../character';
5
5
  import type { Prop } from './target';
6
6
  /**
7
7
  * Riding in a 3D scene: a character carried by a prop, its hips kept on a
@@ -62,10 +62,39 @@ export interface PropRide3DOptions {
62
62
  /** Sample spacing, ms (default 33) */
63
63
  every?: number;
64
64
  }
65
- /** Riding poses for a human: on a seat, and astride a saddle (legs apart round a horse's barrel). */
65
+ /**
66
+ * Riding poses for a human: on a seat, astride a saddle (legs apart round a
67
+ * horse's barrel), driving (hands forward on a wheel) and on a bike's saddle
68
+ * (leaning to the handlebars; the legs cycle with `pedallingPose`).
69
+ */
66
70
  export declare const RIDING_POSES: {
67
71
  seated: Pose;
68
72
  astride: Pose;
73
+ driving: Pose;
74
+ cycling: Pose;
69
75
  };
76
+ /**
77
+ * The cycling pose with the legs part way round the pedals: `phase` 0 → 1
78
+ * is one turn of the cranks (the left foot at the top at 0, the right half a
79
+ * turn behind), built on `base` (default `RIDING_POSES.cycling`).
80
+ */
81
+ export declare function pedallingPose(phase: number, base?: Pose): Pose;
82
+ export interface PedallingOptions {
83
+ /** From and to, ms */
84
+ start: number;
85
+ end: number;
86
+ /** Turns of the cranks per second (default 1.2) */
87
+ cadence?: number;
88
+ /** The pose the legs cycle on (default `RIDING_POSES.cycling`) */
89
+ base?: Pose;
90
+ /** Keys per turn (default 8) */
91
+ samplesPerTurn?: number;
92
+ }
93
+ /**
94
+ * Pose keys that pedal from `start` to `end` (`act: false`: a cycle is
95
+ * already timed), for a rider's own pose tracks (`characterPoseTracks` or
96
+ * `actCharacterTracks`) while `propRide3D` or `propRide` carries it.
97
+ */
98
+ export declare function pedallingKeys(options: PedallingOptions): CharacterPoseKey[];
70
99
  /** The rider's `x`, `y`, `z` and `rotateY` tracks while it rides (see the module's notes). */
71
100
  export declare function propRide3D(options: PropRide3DOptions): Track[];
@@ -3,7 +3,7 @@ import type { PropertyInfo } from '../../adapters/canvas/target-properties';
3
3
  import type { FrameInfo } from '../../headless/video-scene';
4
4
  import type { ActingRig } from '../acting/acting';
5
5
  import { type PropRig, type SolvedProp } from './rig';
6
- import { type PropDrawOptions } from './draw';
6
+ import { type LoosePart, type PropDrawOptions } from './draw';
7
7
  import type { PropAction } from './script';
8
8
  /**
9
9
  * A prop: what it is, its rig, what it can do and how it acts. Families
@@ -92,7 +92,11 @@ export interface PropTarget extends CustomTarget {
92
92
  /** px per metre */
93
93
  readonly propScale: number;
94
94
  readonly propDraw: Omit<PropDrawOptions, 'time' | 'rider'>;
95
+ /** Parts that have come loose as pieces (`propSurface().piece`): the piece's key in its props, by part id */
96
+ readonly loose?: Map<string, number>;
95
97
  }
98
+ /** Where the loose parts have gone in this frame, from the `piece.K.*` values, by part id. */
99
+ export declare function loosePartsOf(target: PropTarget, values: Record<string, number>): Record<string, LoosePart> | undefined;
96
100
  /** Every control a prop has, described: the common ones and its own. */
97
101
  export declare function propControls(prop: Prop): Record<string, PropertyInfo & {
98
102
  default?: number;
@@ -8,8 +8,11 @@ import { type Gait, type GaitName } from '../gaits';
8
8
  * `base`'s. `stride` scales the swing.
9
9
  */
10
10
  export declare function humanGaitPose(gait: GaitName | Gait | string | undefined, phase: number, base?: Pose, stride?: number): Pose;
11
- /** Ground covered by one gait cycle (two steps) for a character `height` px tall: the feet stay planted. */
12
- export declare function humanGaitStrideLength(gait: GaitName | Gait | string | undefined, height: number, stride?: number): number;
11
+ /**
12
+ * Ground covered by one gait cycle (two steps) for a character `height` px
13
+ * tall: the feet stay planted. `legLength` is the build's (see HUMAN_BUILDS).
14
+ */
15
+ export declare function humanGaitStrideLength(gait: GaitName | Gait | string | undefined, height: number, stride?: number, legLength?: number): number;
13
16
  /** One step of a gag: when (ms in), what changes from the pose so far, and the ease into it. */
14
17
  export interface HumanGagStep {
15
18
  after: number;
@@ -1,5 +1,4 @@
1
1
  import type { BodyPlan, Pose } from '../rig/body-plan';
2
- import { type ExpressionName } from '../stick-figure';
3
2
  /**
4
3
  * The human body plan for the v2 character system: a two-bone spine, a neck,
5
4
  * two arms and two legs with feet, and a head.
@@ -19,7 +18,12 @@ import { type ExpressionName } from '../stick-figure';
19
18
  * turned-out plié), and the same for `.right`
20
19
  * - `stretch` (1 normal), `lift` (fraction of height above the ground), `roll` (whole-figure roll, degrees)
21
20
  * - the face: `mouth`, `smile`, `mouthWidth`, `blink`, `eye.left`, `eye.right`,
22
- * `brow.left`, `brow.right`, `browTilt`, `lookX`, `lookY` (as the v1 stick figure)
21
+ * `brow.left`, `brow.right`, `browTilt`, `lookX`, `lookY` (as the v1 stick figure),
22
+ * and marks that fade in from 0 to 1: `blush` (cheeks), `tears`, `sweat` (a bead at the temple)
23
+ * - hair in motion: `hair.swing` (round the head toward its left +, degrees), `hair.trail`
24
+ * (streaming back +, head radii), `hair.lift` (up +, head radii); `hairFollow` keys them
25
+ * - `held.left`, `held.right`, `held.both`: whether what the character holds
26
+ * there shows (1, the default) or has been let go (below 0.5)
23
27
  *
24
28
  * The character's left is +x: facing the viewer its left arm is on screen-right.
25
29
  */
@@ -30,7 +34,67 @@ export interface HumanBuild {
30
34
  shoulderWidth?: number;
31
35
  /** Half the hip width, fraction of the height (0: both legs from one point) */
32
36
  hipWidth?: number;
37
+ /** Leg length, as a share of the standard (default 1); the body takes up the difference */
38
+ legLength?: number;
39
+ /** Arm length, as a share of the standard (default 1) */
40
+ armLength?: number;
33
41
  }
42
+ /**
43
+ * Ready-made builds: proportions only, so the same poses, gaits and actions
44
+ * work on each. Age, posture and clothes are separate choices: a child build
45
+ * has a larger head and shorter limbs, nothing more. How tall a character
46
+ * stands is its `height`; a build changes how that height is shared out.
47
+ */
48
+ export declare const HUMAN_BUILDS: {
49
+ standard: {};
50
+ slim: {
51
+ headSize: number;
52
+ shoulderWidth: number;
53
+ hipWidth: number;
54
+ };
55
+ tall: {
56
+ headSize: number;
57
+ legLength: number;
58
+ armLength: number;
59
+ };
60
+ short: {
61
+ headSize: number;
62
+ legLength: number;
63
+ shoulderWidth: number;
64
+ hipWidth: number;
65
+ };
66
+ broad: {
67
+ shoulderWidth: number;
68
+ hipWidth: number;
69
+ };
70
+ curvy: {
71
+ shoulderWidth: number;
72
+ hipWidth: number;
73
+ };
74
+ stocky: {
75
+ headSize: number;
76
+ shoulderWidth: number;
77
+ hipWidth: number;
78
+ };
79
+ kid: {
80
+ headSize: number;
81
+ };
82
+ child: {
83
+ headSize: number;
84
+ legLength: number;
85
+ armLength: number;
86
+ shoulderWidth: number;
87
+ hipWidth: number;
88
+ };
89
+ toddler: {
90
+ headSize: number;
91
+ legLength: number;
92
+ armLength: number;
93
+ shoulderWidth: number;
94
+ hipWidth: number;
95
+ };
96
+ };
97
+ export type HumanBuildName = keyof typeof HUMAN_BUILDS;
34
98
  export declare const HUMAN_REST: Pose;
35
99
  /** A full human pose from the fields that differ from rest. */
36
100
  export declare function humanPose(changes?: Pose): Pose;
@@ -59,6 +123,17 @@ export declare const HUMAN_POSES: {
59
123
  crouch: Pose;
60
124
  crawl: Pose;
61
125
  lieDown: Pose;
126
+ sleep: Pose;
127
+ stretch: Pose;
128
+ sitFloor: Pose;
129
+ carry: Pose;
130
+ lift: Pose;
131
+ push: Pose;
132
+ pull: Pose;
133
+ drink: Pose;
134
+ phone: Pose;
135
+ read: Pose;
136
+ type: Pose;
62
137
  };
63
138
  export type HumanPoseName = keyof typeof HUMAN_POSES;
64
139
  /** A human body plan; the same pose fields work on every build. */
@@ -67,6 +142,40 @@ export declare function humanPlan(build?: HumanBuild): BodyPlan;
67
142
  export declare function humanFieldLabel(field: string): string;
68
143
  /**
69
144
  * The ready-made faces (happy, sad, surprised, angry…), as human pose fields.
70
- * Each sets every face field, so applying one replaces the whole face.
145
+ * Each sets every face field, so applying one replaces the whole face; any
146
+ * two blend. The second group, from the emotions reference sheet, uses the
147
+ * human face's marks (blush, tears, sweat).
71
148
  */
72
- export declare const HUMAN_EXPRESSIONS: Record<ExpressionName, Pose>;
149
+ export declare const HUMAN_EXPRESSIONS: {
150
+ laughing: Pose;
151
+ afraid: Pose;
152
+ bored: Pose;
153
+ tired: Pose;
154
+ embarrassed: Pose;
155
+ proud: Pose;
156
+ determined: Pose;
157
+ affectionate: Pose;
158
+ hurt: Pose;
159
+ suspicious: Pose;
160
+ relieved: Pose;
161
+ excited: Pose;
162
+ neutral: Pose;
163
+ happy: Pose;
164
+ joyful: Pose;
165
+ sad: Pose;
166
+ crying: Pose;
167
+ surprised: Pose;
168
+ shocked: Pose;
169
+ angry: Pose;
170
+ furious: Pose;
171
+ worried: Pose;
172
+ scared: Pose;
173
+ confused: Pose;
174
+ skeptical: Pose;
175
+ thinking: Pose;
176
+ sleepy: Pose;
177
+ disgusted: Pose;
178
+ smug: Pose;
179
+ wink: Pose;
180
+ };
181
+ export type HumanExpressionName = keyof typeof HUMAN_EXPRESSIONS;
@@ -1,14 +1,28 @@
1
1
  import type { CharacterLayers } from '../character';
2
2
  /**
3
- * A first outfit for the human character: a T-shirt and trousers, drawn as
4
- * layers on the body's parts, through the character's pen (so it matches the
5
- * look). The sleeves grow out of the shirt's shoulders with no seam. The full
6
- * wardrobe is a later milestone; this is the shape every garment will follow.
3
+ * Clothes for the human character, as plain data, drawn as layers on the
4
+ * body's parts through the character's pen (so they match the look). The
5
+ * base is a top and trousers whose sleeves grow out of the shirt's shoulders
6
+ * with no seam; the options change its cut (long or no sleeves, shorts, a
7
+ * skirt) and add pieces worn over it (a collar, a tie, an apron, a lab coat).
8
+ * The defaults are the original T-shirt and trousers, unchanged.
7
9
  */
8
10
  export interface BasicOutfitOptions {
9
11
  /** Shirt colour (default red) */
10
12
  shirt?: string;
11
- /** Trouser colour (default navy) */
13
+ /** Trouser (or shorts, or skirt) colour (default navy) */
12
14
  trousers?: string;
15
+ /** Sleeves: `short` (default), `long` (to the wrist) or `none` */
16
+ sleeves?: 'short' | 'long' | 'none';
17
+ /** Below the waist: `trousers` (default), `shorts` (to the knee) or `skirt` */
18
+ bottom?: 'trousers' | 'shorts' | 'skirt';
19
+ /** A shirt collar at the neck */
20
+ collar?: boolean;
21
+ /** A tie down the front, in this colour */
22
+ tie?: string | null;
23
+ /** Worn over the clothes: an apron or a lab coat (default none) */
24
+ over?: 'apron' | 'labCoat' | null;
25
+ /** The apron's or lab coat's colour (default: white coat, tan apron) */
26
+ overColor?: string;
13
27
  }
14
28
  export declare function basicOutfit(options?: BasicOutfitOptions): CharacterLayers;
@@ -36,7 +36,7 @@ import { type SurfaceBox } from './surface/surface-box';
36
36
  * `mark.ID.draw`, `strike.K.draw`, `piece.K.x`…) and written out by
37
37
  * `tracks()`.
38
38
  */
39
- export type BoardThemeName = 'whiteboard' | 'chalkboard';
39
+ export type BoardThemeName = 'whiteboard' | 'chalkboard' | 'lines';
40
40
  export interface BoardTheme {
41
41
  background: string;
42
42
  frame: string;
@@ -49,6 +49,12 @@ export interface BoardTheme {
49
49
  stroke: number;
50
50
  /** Ink opacity (chalk is a little see-through) */
51
51
  opacity: number;
52
+ /** Ruled paper: the lines' colour, their spacing (em of the font size) and a margin line's colour */
53
+ rule?: {
54
+ color: string;
55
+ spacing?: number;
56
+ margin?: string;
57
+ };
52
58
  }
53
59
  export declare const BOARD_THEMES: Record<BoardThemeName, BoardTheme>;
54
60
  /** The marks a board can draw. */
@@ -76,6 +82,12 @@ export interface BoardMark {
76
82
  /** `arrow`: from one place to another */
77
83
  from?: string;
78
84
  to?: string;
85
+ /**
86
+ * `arrow`: how far it bows, as a fraction of its length (+ bows to the left of
87
+ * the way it points, − to the right). Default: a slight hand-drawn bow, or
88
+ * round any text it would cross.
89
+ */
90
+ bend?: number;
79
91
  color?: string;
80
92
  /** Start undrawn, to be drawn in with the `draw` edit */
81
93
  hidden?: boolean;