@holtjs/craft 0.0.0-stage → 0.2.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.
@@ -0,0 +1,537 @@
1
+ declare const RIG_PRIMITIVE_SHAPES: readonly ['ellipsoid', 'box', 'cone', 'capsule', 'cylinder', 'torus'];
2
+ type RigPrimitiveShape = (typeof RIG_PRIMITIVE_SHAPES)[number];
3
+ /** A single lightweight 3D volume primitive attached in socket local space (or prop local space). */
4
+ interface RigPrimitiveSpec {
5
+ readonly shape: RigPrimitiveShape;
6
+ readonly pos: Vec3;
7
+ readonly size: Vec3;
8
+ readonly rot?: Vec3;
9
+ readonly color: string;
10
+ readonly shade?: 'ramp' | 'flat';
11
+ readonly outline?: boolean;
12
+ readonly group?: number;
13
+ }
14
+ /** Optional 2D pixel grid sprite for a cosmetic (e.g. 12x12 pixel art, 1-4 views). */
15
+ interface RigPixelSpriteSpec {
16
+ readonly width: number;
17
+ readonly height: number;
18
+ readonly anchorX: number;
19
+ readonly anchorY: number;
20
+ readonly palette: Readonly<Record<string, string>>;
21
+ readonly front: readonly string[];
22
+ readonly side?: readonly string[];
23
+ readonly back?: readonly string[];
24
+ }
25
+ /** Declarative socket-attached cosmetic contributed by a Data Pack or Mod (zero PNG sheet baking). */
26
+ interface RigCosmeticSpec {
27
+ readonly id: string;
28
+ readonly name: string;
29
+ readonly socket: RigSocketName;
30
+ readonly slot: RigCosmeticSlot;
31
+ readonly offset?: Vec3;
32
+ readonly rot?: Vec3;
33
+ readonly scale?: number;
34
+ readonly primitives?: readonly RigPrimitiveSpec[];
35
+ readonly pixels?: RigPixelSpriteSpec;
36
+ }
37
+ /** Declarative prop temporarily shown on a socket during a `RigClip` keyframe. */
38
+ interface RigPropInstance {
39
+ readonly socket: RigSocketName;
40
+ readonly offset?: Vec3;
41
+ readonly rot?: Vec3;
42
+ readonly scale?: number;
43
+ readonly primitives: readonly RigPrimitiveSpec[];
44
+ }
45
+ interface RigBonePoseOverride {
46
+ readonly pos?: Vec3;
47
+ readonly rot?: Vec3;
48
+ readonly scale?: Vec3;
49
+ }
50
+ interface RigKeyframe {
51
+ readonly at: number;
52
+ readonly ease?: RigEaseMode;
53
+ readonly bones?: Readonly<Partial<Record<RigBoneName, RigBonePoseOverride>>>;
54
+ readonly reach?: Readonly<Partial<Record<'armL' | 'armR', {
55
+ readonly target: Vec3;
56
+ readonly stretch?: boolean;
57
+ }>>>;
58
+ readonly eyes?: RigEyeMode;
59
+ readonly water?: number | null;
60
+ readonly props?: readonly RigPropInstance[];
61
+ }
62
+ /** Declarative bone-keyframe animation clip contributed by a Data Pack or Mod. */
63
+ interface RigClip {
64
+ readonly id: string;
65
+ readonly name: string;
66
+ readonly durationMs: number;
67
+ readonly fps: number;
68
+ readonly dirs: 1 | 4 | 8 | 16;
69
+ readonly loop: boolean;
70
+ readonly icon?: string;
71
+ readonly keyframes: readonly RigKeyframe[];
72
+ }
73
+ declare function validateRigPrimitiveList(raw: unknown, maxCount: number): {
74
+ ok: true;
75
+ list: RigPrimitiveSpec[];
76
+ } | {
77
+ ok: false;
78
+ code: string;
79
+ message: string;
80
+ };
81
+ declare function validateRigPixelSprite(raw: unknown, maxSize: number): {
82
+ ok: true;
83
+ pixels: RigPixelSpriteSpec;
84
+ } | {
85
+ ok: false;
86
+ code: string;
87
+ message: string;
88
+ };
89
+ declare function validateRigCosmetic(raw: unknown): {
90
+ ok: true;
91
+ cosmetic: RigCosmeticSpec;
92
+ } | {
93
+ ok: false;
94
+ code: string;
95
+ message: string;
96
+ };
97
+ declare function validateRigClip(raw: unknown): {
98
+ ok: true;
99
+ clip: RigClip;
100
+ } | {
101
+ ok: false;
102
+ code: string;
103
+ message: string;
104
+ };
105
+ /** Evaluate a declarative `RigClip` at normalized time `tNorm ∈ [0, 1]` and direction `dir16`. */
106
+ declare function evaluateRigClip(bodyOrKey: RigBodyKey | RigBodySpec, clip: RigClip, tNorm: number, dir16?: number): RigPoseState;
107
+ /** Compute the discrete frame count for compiling a `RigClip` into a sprite strip. */
108
+ declare function rigClipFrameCount(clip: RigClip): number;
109
+ declare const RIG_BODY_KEYS: readonly ['0', 'A', 'B', 'C', 'Y', 'K', 'M', 'G'];
110
+ type RigBodyKey = (typeof RIG_BODY_KEYS)[number];
111
+ declare const RIG_BODY_EYE_STYLES: readonly ['otter', 'big', 'cat', 'dot', 'blue'];
112
+ type RigBodyEyeStyle = (typeof RIG_BODY_EYE_STYLES)[number];
113
+ declare const RIG_BODY_TAIL_STYLES: readonly ['otter', 'cat', 'fluffy', 'curled', 'stub'];
114
+ type RigBodyTailStyle = (typeof RIG_BODY_TAIL_STYLES)[number];
115
+ declare const RIG_BODY_ATTACH_BONES: readonly ['head', 'chest', 'hips', 'tail0', 'armL', 'armR'];
116
+ type RigBodyAttachBone = (typeof RIG_BODY_ATTACH_BONES)[number];
117
+ interface RigBodyCustomColors {
118
+ readonly head?: string;
119
+ readonly torso?: string;
120
+ readonly belly?: string;
121
+ readonly muzzle?: string;
122
+ readonly mask?: string;
123
+ readonly nose?: string;
124
+ readonly blush?: string;
125
+ readonly ear?: string;
126
+ readonly earIn?: string;
127
+ readonly eye?: string;
128
+ readonly tail?: string;
129
+ readonly tailTip?: string;
130
+ readonly feet?: string;
131
+ readonly arm?: string;
132
+ }
133
+ interface RigBodyAttachment {
134
+ readonly bone: RigBodyAttachBone;
135
+ readonly primitives: readonly RigPrimitiveSpec[];
136
+ }
137
+ interface RigBodySpec {
138
+ readonly key: RigBodyKey;
139
+ /** Optional custom character ID when compiled from a Data Pack or Mod `RigCustomBodySpec`. */
140
+ readonly customId?: string;
141
+ readonly customName?: string;
142
+ readonly cat?: boolean;
143
+ readonly oneGroup?: boolean;
144
+ readonly head: {
145
+ readonly c: Vec3;
146
+ readonly r: Vec3;
147
+ readonly sq?: number;
148
+ };
149
+ readonly mask?: {
150
+ readonly c: Vec3;
151
+ readonly r: Vec3;
152
+ };
153
+ readonly muzzle: {
154
+ readonly c: Vec3;
155
+ readonly r: Vec3;
156
+ };
157
+ readonly nose: Vec3;
158
+ readonly noNose?: boolean;
159
+ readonly noBlush?: boolean;
160
+ readonly noWhiskers?: boolean;
161
+ readonly eye: {
162
+ readonly x: number;
163
+ readonly y: number;
164
+ readonly r: Vec3;
165
+ readonly small?: boolean;
166
+ readonly noHi?: boolean;
167
+ readonly hi2?: boolean;
168
+ };
169
+ readonly blush: {
170
+ readonly x: number;
171
+ readonly y: number;
172
+ };
173
+ readonly cheeks?: {
174
+ readonly x: number;
175
+ readonly y: number;
176
+ readonly z: number;
177
+ readonly r: Vec3;
178
+ };
179
+ readonly cowlick?: boolean;
180
+ readonly tufts?: {
181
+ readonly x: number;
182
+ readonly y: number;
183
+ readonly z: number;
184
+ readonly r: Vec3;
185
+ readonly rot: number;
186
+ };
187
+ readonly ear: {
188
+ readonly p: Vec3;
189
+ readonly r: Vec3;
190
+ readonly cone?: boolean;
191
+ readonly tilt?: number;
192
+ readonly hidden?: boolean;
193
+ };
194
+ readonly torso: {
195
+ readonly c: Vec3;
196
+ readonly r: Vec3;
197
+ readonly sq?: number;
198
+ };
199
+ readonly belly: {
200
+ readonly c: Vec3;
201
+ readonly r: Vec3;
202
+ };
203
+ readonly chestY: number;
204
+ readonly neckR: readonly [number, number];
205
+ readonly scarfY?: number;
206
+ readonly scarfDy?: number;
207
+ readonly hatPad?: number;
208
+ readonly phonesY?: number;
209
+ readonly runLean?: number;
210
+ readonly arm: {
211
+ readonly s: Vec3;
212
+ readonly paw: Vec3;
213
+ readonly len: number;
214
+ readonly r: number;
215
+ };
216
+ readonly hip: Vec3;
217
+ readonly leg: number;
218
+ readonly legR: number;
219
+ readonly tail: {
220
+ readonly base: Vec3;
221
+ readonly yaw: number;
222
+ readonly pitch: number;
223
+ readonly hidden?: boolean;
224
+ readonly segs?: ReadonlyArray<readonly [number, number, number, number, number?]>;
225
+ readonly tube?: ReadonlyArray<readonly [number, number, number, number?, number?]>;
226
+ };
227
+ /** Material overrides matching `otter3d.js` (`head`, `torso`, `belly`, `arm`, `leg`, `foot`, `nose`, `earIn`, `ears`, `muzzle`, `mark`). */
228
+ readonly mats?: {
229
+ readonly head?: number;
230
+ readonly torso?: number;
231
+ readonly belly?: number;
232
+ readonly arm?: number;
233
+ readonly leg?: number;
234
+ readonly foot?: number;
235
+ readonly nose?: number;
236
+ readonly earIn?: number;
237
+ readonly ears?: readonly [number, number];
238
+ readonly muzzle?: number;
239
+ readonly mark?: number;
240
+ };
241
+ readonly locks?: ReadonlyArray<readonly [number, number, number, Vec3, number, number]>;
242
+ /** Optional custom hex palette overrides for mod/pack-contributed playable characters. */
243
+ readonly customColors?: RigBodyCustomColors;
244
+ /** Optional custom eye stamp style for mod/pack-contributed playable characters. */
245
+ readonly customEyeStyle?: RigBodyEyeStyle;
246
+ /** Optional extra bone-attached 3D primitives (beaks, cheek fluff, antlers, flippers, antennae, etc.). */
247
+ readonly customExtras?: readonly RigBodyAttachment[];
248
+ }
249
+ /** Exact canonical proportions of all 8 Raft Deck character bodies. */
250
+ declare const RIG_BODIES: Readonly<Record<RigBodyKey, RigBodySpec>>;
251
+ declare function rigBodyKeyFromIndex(bodyIdx: number): RigBodyKey;
252
+ type Vec3 = readonly [number, number, number];
253
+ type MutVec3 = [number, number, number];
254
+ type Quat = [number, number, number, number];
255
+ type Mat4 = Float64Array;
256
+ declare const RIG_BONE_NAMES: readonly ['root', 'hips', 'chest', 'neck', 'head', 'armL', 'armR', 'legL', 'legR', 'tail0', 'tail1', 'tail2'];
257
+ type RigBoneName = (typeof RIG_BONE_NAMES)[number];
258
+ declare const RIG_SOCKET_NAMES: readonly ['headTop', 'face', 'earL', 'earR', 'neck', 'back', 'waist', 'handL', 'handR'];
259
+ type RigSocketName = (typeof RIG_SOCKET_NAMES)[number];
260
+ declare const RIG_COSMETIC_SLOTS: readonly ['hat', 'face', 'neck', 'back', 'hand', 'other'];
261
+ type RigCosmeticSlot = (typeof RIG_COSMETIC_SLOTS)[number];
262
+ declare const RIG_EYE_MODES: readonly ['open', 'happy', 'shut', 'squeeze'];
263
+ type RigEyeMode = (typeof RIG_EYE_MODES)[number];
264
+ declare const RIG_EASE_MODES: readonly ['linear', 'easeInOut', 'easeOut', 'step'];
265
+ type RigEaseMode = (typeof RIG_EASE_MODES)[number];
266
+ /** Shared projection constants matching `assets/otters3d/otter3d.js` (`makeCamera(32, 13, 29)`). */
267
+ declare const RIG_MODEL_SCALE = 0.93;
268
+ declare const RIG_CELL_SIZE = 32;
269
+ declare const RIG_CAMERA_ELEV_DEG = 13;
270
+ declare const RIG_CAMERA_GROUND_Y = 29;
271
+ declare const RIG_DUO_VIEW = 2;
272
+ declare const RIG_COS_E: number;
273
+ declare const RIG_SIN_E: number;
274
+ declare const RIG_LIMITS: {
275
+ readonly maxCosmeticPrimitives: 16;
276
+ readonly maxCosmeticPixelSize: 24;
277
+ readonly maxCustomBodyExtras: 12;
278
+ readonly maxCustomBodyPrimitives: 24;
279
+ readonly maxDecorPrimitives: 24;
280
+ readonly maxDecorPixelSize: 48;
281
+ readonly maxClipKeyframes: 16;
282
+ readonly maxClipProps: 4;
283
+ readonly maxClipDurationMs: 12000;
284
+ readonly minClipDurationMs: 120;
285
+ readonly maxClipFps: 12;
286
+ readonly minClipFps: 2;
287
+ readonly maxClipNameLen: 48;
288
+ };
289
+ declare function quatIdentity(): Quat;
290
+ declare function quatMul(a: Quat, b: Quat): Quat;
291
+ declare function quatFromEuler(rx: number, ry: number, rz: number, order?: 'XYZ' | 'YXZ'): Quat;
292
+ declare function quatFromAxisAngle(axis: Vec3, angle: number): Quat;
293
+ declare function quatFromUnitVectors(from: Vec3, to: Vec3): Quat;
294
+ declare function mat4Compose(pos: Vec3, q: Quat, scale: Vec3, out?: Mat4): Mat4;
295
+ declare function mat4Mul(a: Mat4, b: Mat4, out?: Mat4): Mat4;
296
+ declare function mat4Invert(m: Mat4, out?: Mat4): Mat4 | null;
297
+ declare function mat4TransformPoint(m: Mat4, p: Vec3): MutVec3;
298
+ declare function mat4TransformDir(m: Mat4, v: Vec3): MutVec3;
299
+ interface RigBoneTransform {
300
+ pos: MutVec3;
301
+ quat: Quat;
302
+ scale: MutVec3;
303
+ world: Mat4;
304
+ }
305
+ interface RigPoseState {
306
+ readonly body: RigBodySpec;
307
+ readonly bones: Record<RigBoneName, RigBoneTransform>;
308
+ torsoScale: MutVec3;
309
+ bellyScale: MutVec3;
310
+ eyeMode: RigEyeMode;
311
+ water: number;
312
+ shadow: boolean;
313
+ yaw: number;
314
+ props: readonly RigPropInstance[];
315
+ }
316
+ interface SocketDefinition {
317
+ readonly name: RigSocketName;
318
+ readonly bone: RigBoneName;
319
+ readonly localPos: Vec3;
320
+ readonly refBone: RigBoneName;
321
+ readonly refLocalPos: Vec3;
322
+ }
323
+ interface ProjectedPoint2D {
324
+ readonly x: number;
325
+ readonly y: number;
326
+ readonly depth: number;
327
+ readonly frontness: number;
328
+ readonly worldY: number;
329
+ }
330
+ interface ProjectedSocket2D {
331
+ readonly socket: RigSocketName;
332
+ readonly x: number;
333
+ readonly y: number;
334
+ readonly depth: number;
335
+ readonly behind: boolean;
336
+ readonly angle: number;
337
+ readonly facing: 'front' | 'sideL' | 'sideR' | 'back';
338
+ readonly visible: boolean;
339
+ }
340
+ /** Build a fresh rest-pose skeleton state for any built-in or mod-contributed Raft Deck character body. */
341
+ declare function createRigState(bodyOrKey: RigBodyKey | RigBodySpec, yaw?: number): RigPoseState;
342
+ /** Recompute all 12 bone world matrices in parent-before-child topological order. */
343
+ declare function updateRigMatrices(state: RigPoseState): void;
344
+ /** Aim an arm bone (`armL` or `armR`) toward a chest-space target point, matching `otter3d.js` `reach()`. */
345
+ declare function reachArm(state: RigPoseState, side: 'armL' | 'armR', target: Vec3, stretch?: boolean): void;
346
+ /** Compute the canonical socket definitions for a given body type (auto-fitted to head/torso/arm proportions). */
347
+ declare function getBodySockets(bodyOrKey: RigBodyKey | RigBodySpec): Readonly<Record<RigSocketName, SocketDefinition>>;
348
+ /** Project a 3D world-space point into Deck's 32x32 sprite cell (`elev = 13°`, `ground = 29`). */
349
+ declare function projectWorldPoint2D(worldPt: Vec3): ProjectedPoint2D;
350
+ /** Project any canonical socket of a posed `RigPoseState` to 2D sprite coordinates, depth, tilt & facing. */
351
+ declare function projectSocket2D(state: RigPoseState, socketName: RigSocketName): ProjectedSocket2D;
352
+ /** Project all 9 sockets at once for a given posed rig state. */
353
+ declare function projectAllSockets2D(state: RigPoseState): Record<RigSocketName, ProjectedSocket2D>;
354
+ declare const RIG_DECOR_GROUPS: readonly ['office', 'pet', 'nature', 'decor', 'game'];
355
+ type RigDecorGroup = (typeof RIG_DECOR_GROUPS)[number];
356
+ declare const RIG_BODY_CATEGORIES: readonly ['animal', 'character'];
357
+ type RigBodyCategory = (typeof RIG_BODY_CATEGORIES)[number];
358
+ interface RigCustomBodyDefaultColors {
359
+ readonly fur?: string;
360
+ readonly belly?: string;
361
+ readonly scarf?: string | null;
362
+ }
363
+ /** Declarative playable character contributed by a Data Pack or Mod (works like built-in otters & cats). */
364
+ interface RigCustomBodySpec {
365
+ readonly id: string;
366
+ readonly name: string;
367
+ readonly base: RigBodyKey;
368
+ readonly category: RigBodyCategory;
369
+ readonly head?: {
370
+ readonly c?: Vec3;
371
+ readonly r?: Vec3;
372
+ readonly sq?: number;
373
+ };
374
+ readonly torso?: {
375
+ readonly c?: Vec3;
376
+ readonly r?: Vec3;
377
+ readonly sq?: number;
378
+ };
379
+ readonly belly?: {
380
+ readonly c?: Vec3;
381
+ readonly r?: Vec3;
382
+ };
383
+ readonly muzzle?: {
384
+ readonly c?: Vec3;
385
+ readonly r?: Vec3;
386
+ };
387
+ readonly mask?: {
388
+ readonly c: Vec3;
389
+ readonly r: Vec3;
390
+ } | null;
391
+ readonly nose?: Vec3 | null;
392
+ readonly ear?: {
393
+ readonly p?: Vec3;
394
+ readonly r?: Vec3;
395
+ readonly cone?: boolean;
396
+ readonly tilt?: number;
397
+ readonly hidden?: boolean;
398
+ };
399
+ readonly eye?: {
400
+ readonly x?: number;
401
+ readonly y?: number;
402
+ readonly r?: Vec3;
403
+ readonly style?: RigBodyEyeStyle;
404
+ };
405
+ readonly blush?: {
406
+ readonly x?: number;
407
+ readonly y?: number;
408
+ readonly hidden?: boolean;
409
+ };
410
+ readonly tail?: {
411
+ readonly hidden?: boolean;
412
+ readonly style?: RigBodyTailStyle;
413
+ };
414
+ readonly colors?: RigBodyCustomColors;
415
+ readonly defaultColors?: RigCustomBodyDefaultColors;
416
+ readonly extras?: readonly RigBodyAttachment[];
417
+ }
418
+ /** Declarative placeable/world decor prop contributed by a Data Pack or Mod (zero PNG upload required). */
419
+ interface RigDecorPropSpec {
420
+ readonly id: string;
421
+ readonly name: string;
422
+ readonly group: RigDecorGroup;
423
+ readonly tilesW: number;
424
+ readonly tilesD: number;
425
+ readonly frameW: number;
426
+ readonly frameH: number;
427
+ readonly dirs: 1 | 4;
428
+ readonly baseY: number;
429
+ readonly solidMask: number;
430
+ readonly underlay?: boolean;
431
+ readonly scale?: number;
432
+ readonly offset?: Vec3;
433
+ readonly primitives?: readonly RigPrimitiveSpec[];
434
+ readonly pixels?: RigPixelSpriteSpec;
435
+ readonly light?: {
436
+ readonly tone: 'warm' | 'cream' | 'aqua' | 'arcadeCyan' | 'arcadePink' | 'beacon' | 'ktv';
437
+ readonly r: number;
438
+ readonly flicker?: boolean;
439
+ };
440
+ readonly place?: {
441
+ readonly x: number;
442
+ readonly y: number;
443
+ readonly dir?: number;
444
+ };
445
+ }
446
+ /** Strictly validate a Data Pack or Mod playable character spec (`RigCustomBodySpec`). */
447
+ declare function validateRigCustomBody(raw: unknown): {
448
+ ok: true;
449
+ body: RigCustomBodySpec;
450
+ } | {
451
+ ok: false;
452
+ code: string;
453
+ message: string;
454
+ };
455
+ /** Compile a validated `RigCustomBodySpec` into a full `RigBodySpec` runnable by `createRigState` / `renderRigPose`. */
456
+ declare function compileCustomBodySpec(spec: RigCustomBodySpec): RigBodySpec;
457
+ /** Strictly validate a declarative procedural decor prop (`RigDecorPropSpec`) for Data Packs or Sandboxed Mods. */
458
+ declare function validateRigDecorProp(raw: unknown): {
459
+ ok: true;
460
+ prop: RigDecorPropSpec;
461
+ } | {
462
+ ok: false;
463
+ code: string;
464
+ message: string;
465
+ };
466
+ type Rgb = readonly [number, number, number];
467
+ type Ramp4 = readonly [Rgb, Rgb, Rgb, Rgb];
468
+ interface RigLookColors {
469
+ readonly fur: {
470
+ readonly fur: Rgb;
471
+ readonly shade: Rgb;
472
+ };
473
+ readonly belly: Rgb;
474
+ readonly scarf?: Rgb | null;
475
+ }
476
+ declare function parseHexRgb(hex: string): Rgb;
477
+ /** Auto-derive a Deck-style 4-shade pixel ramp `[light, base, shade, outline]` from any base `#rrggbb` color. */
478
+ declare function derivePixelRamp(hex: string): Ramp4;
479
+ interface RenderedRigCell {
480
+ readonly width: number;
481
+ readonly height: number;
482
+ readonly rgba: Uint8ClampedArray;
483
+ }
484
+ interface CompiledRigStrip {
485
+ readonly width: number;
486
+ readonly height: number;
487
+ readonly frames: number;
488
+ readonly cellSize: number;
489
+ readonly rgba: Uint8ClampedArray;
490
+ }
491
+ declare const DEFAULT_RIG_COLORS: RigLookColors;
492
+ /** Render any posed `RigPoseState` (+ look colors & optional 3D cosmetics) to a crisp 32x32 RGBA pixel cell. */
493
+ declare function renderRigPose(state: RigPoseState, opts?: {
494
+ colors?: RigLookColors;
495
+ cosmetics?: readonly RigCosmeticSpec[];
496
+ cellSize?: number;
497
+ ss?: number;
498
+ }): RenderedRigCell;
499
+ /** Lazily compile an entire declarative `RigClip` into a horizontal 32x32 RGBA sprite strip for `(body, look, dir16)`. */
500
+ declare function renderRigClipStrip(bodyOrKey: RigBodyKey | RigBodySpec, clip: RigClip, dir16?: number, opts?: {
501
+ colors?: RigLookColors;
502
+ cosmetics?: readonly RigCosmeticSpec[];
503
+ cellSize?: number;
504
+ ss?: number;
505
+ }): CompiledRigStrip;
506
+ /** Lazily compile all frames of a built-in animation (`idle`, `walk`, `run`, `swim`, `sit`, ...) for a custom body at `dir16`. */
507
+ declare function renderBodyAnimStrip(bodyOrKey: RigBodyKey | RigBodySpec, anim: string, dir16?: number, opts?: {
508
+ colors?: RigLookColors;
509
+ cosmetics?: readonly RigCosmeticSpec[];
510
+ cellSize?: number;
511
+ ss?: number;
512
+ }): CompiledRigStrip;
513
+ /** Render a standalone declarative cosmetic (either 3D primitives or 2D pixel grid) centered at `(size/2, size/2)`. */
514
+ declare function renderCosmeticSprite(cosmetic: RigCosmeticSpec, dir16?: number, opts?: {
515
+ size?: number;
516
+ ss?: number;
517
+ }): RenderedRigCell;
518
+ /** Alpha-composite a cosmetic sprite onto a target RGBA buffer at socket pixel `(cx, cy)` (rounded, nearest-neighbor). */
519
+ declare function compositeSpriteRgba(dst: Uint8ClampedArray, dstW: number, dstH: number, src: RenderedRigCell, cx: number, cy: number, behind?: boolean): void;
520
+ /** Render one directional frame (`dir4 ∈ 0..3`) of a declarative `RigDecorPropSpec` (3D primitives or 2D pixel grid). */
521
+ declare function renderDecorPropSprite(spec: RigDecorPropSpec, dir4?: number, opts?: {
522
+ ss?: number;
523
+ }): RenderedRigCell;
524
+ /** Compile a 1-dir or 4-dir declarative `RigDecorPropSpec` into a horizontal `(frameW * dirs) × frameH` RGBA spritesheet. */
525
+ declare function renderDecorPropSheet(spec: RigDecorPropSpec, opts?: {
526
+ ss?: number;
527
+ }): {
528
+ readonly width: number;
529
+ readonly height: number;
530
+ readonly frameW: number;
531
+ readonly frameH: number;
532
+ readonly dirs: 1 | 4;
533
+ readonly rgba: Uint8ClampedArray;
534
+ };
535
+ /** Helper for debugging/verification: evaluate rest pose of a built-in or custom body at dir16. */
536
+ declare function renderBodyRestPreview(bodyOrKey: RigBodyKey | RigBodySpec, dir16?: number, colors?: RigLookColors): RenderedRigCell;
537
+ export { Vec3 as $, ProjectedSocket2D as A, RIG_PRIMITIVE_SHAPES as At, RIG_EYE_MODES as B, rigClipFrameCount as Bt, RigDecorPropSpec as C, RigBodyAttachment as Ct, Mat4 as D, RigBodySpec as Dt, validateRigDecorProp as E, RigBodyKey as Et, RIG_CELL_SIZE as F, RigPixelSpriteSpec as Ft, RigBoneName as G, RIG_MODEL_SCALE as H, validateRigCosmetic as Ht, RIG_COSMETIC_SLOTS as I, RigPrimitiveShape as It, RigEaseMode as J, RigBoneTransform as K, RIG_COS_E as L, RigPrimitiveSpec as Lt, RIG_BONE_NAMES as M, RigClip as Mt, RIG_CAMERA_ELEV_DEG as N, RigCosmeticSpec as Nt, MutVec3 as O, RigBodyTailStyle as Ot, RIG_CAMERA_GROUND_Y as P, RigKeyframe as Pt, SocketDefinition as Q, RIG_DUO_VIEW as R, RigPropInstance as Rt, RigDecorGroup as S, RigBodyAttachBone as St, validateRigCustomBody as T, RigBodyEyeStyle as Tt, RIG_SIN_E as U, validateRigPixelSprite as Ut, RIG_LIMITS as V, validateRigClip as Vt, RIG_SOCKET_NAMES as W, validateRigPrimitiveList as Wt, RigPoseState as X, RigEyeMode as Y, RigSocketName as Z, RIG_BODY_CATEGORIES as _, RIG_BODIES as _t, renderBodyAnimStrip as a, mat4TransformDir as at, RigCustomBodyDefaultColors as b, RIG_BODY_KEYS as bt, renderDecorPropSheet as c, projectSocket2D as ct, renderRigPose as d, quatFromEuler as dt, createRigState as et, Ramp4 as f, quatFromUnitVectors as ft, parseHexRgb as g, updateRigMatrices as gt, derivePixelRamp as h, reachArm as ht, compositeSpriteRgba as i, mat4Mul as it, Quat as j, RigBonePoseOverride as jt, ProjectedPoint2D as k, rigBodyKeyFromIndex as kt, renderDecorPropSprite as l, projectWorldPoint2D as lt, RigLookColors as m, quatMul as mt, DEFAULT_RIG_COLORS as n, mat4Compose as nt, renderBodyRestPreview as o, mat4TransformPoint as ot, Rgb as p, quatIdentity as pt, RigCosmeticSlot as q, RenderedRigCell as r, mat4Invert as rt, renderCosmeticSprite as s, projectAllSockets2D as st, CompiledRigStrip as t, getBodySockets as tt, renderRigClipStrip as u, quatFromAxisAngle as ut, RIG_DECOR_GROUPS as v, RIG_BODY_ATTACH_BONES as vt, compileCustomBodySpec as w, RigBodyCustomColors as wt, RigCustomBodySpec as x, RIG_BODY_TAIL_STYLES as xt, RigBodyCategory as y, RIG_BODY_EYE_STYLES as yt, RIG_EASE_MODES as z, evaluateRigClip as zt };