@haiyue/animation-spec 0.1.0 → 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.
Files changed (77) hide show
  1. package/README.md +40 -6
  2. package/SPECIFICATION.md +12 -2
  3. package/bin/hya-live2d-convert.mjs +76 -0
  4. package/bin/{hya-convert.mjs → hya-lottie-convert.mjs} +1 -1
  5. package/dist/chunks/binary-DvuTJ_hy.js +1 -0
  6. package/dist/chunks/clip-baked-Dv-wjX9d.js +1 -0
  7. package/dist/chunks/errors-Bzs3GOD9.js +1 -0
  8. package/dist/chunks/expression-D1cKtNwM.js +1 -0
  9. package/dist/chunks/extensions-DxL4AxOC.js +1 -0
  10. package/dist/conversion.d.ts +1 -0
  11. package/dist/conversion.js +1 -0
  12. package/dist/cubism.d.ts +1 -0
  13. package/dist/cubism.js +1 -0
  14. package/dist/deformable2d.d.ts +1 -0
  15. package/dist/deformable2d.js +1 -0
  16. package/dist/index.d.ts +1 -10
  17. package/dist/index.js +1 -2927
  18. package/dist/live2d/clip-baked.d.ts +1 -0
  19. package/dist/live2d/clip-baked.js +1 -0
  20. package/dist/live2d.d.ts +1 -0
  21. package/dist/live2d.js +1 -0
  22. package/dist/lottie.d.ts +1 -62
  23. package/dist/lottie.js +1 -2642
  24. package/dist/native3d.d.ts +1 -2
  25. package/dist/native3d.js +1 -907
  26. package/dist/shared.d.ts +1493 -0
  27. package/package.json +30 -10
  28. package/schema/animation.schema.json +92 -0
  29. package/schema/deformable-mesh-2d-extension.schema.json +18 -0
  30. package/schema/deformable-mesh-2d.contract.json +58 -0
  31. package/schema/parameterized-rig-2d.contract.json +63 -0
  32. package/schema/parameterized-rig-2d.schema.json +57 -0
  33. package/schema/parameterized-rig-census-map.json +128 -0
  34. package/schema/responsive-layout-2d-census-map.json +49 -0
  35. package/schema/responsive-layout-2d.contract.json +58 -0
  36. package/schema/responsive-layout-2d.schema.json +34 -0
  37. package/schema/state-machine-v2-census-map.json +1 -0
  38. package/schema/state-machine-v2.contract.json +66 -0
  39. package/schema/state-machine-v2.schema.json +55 -0
  40. package/schema/vector-visual-census-map.json +120 -0
  41. package/schema/vector-visual.contract.json +47 -0
  42. package/schema/vector-visual.schema.json +72 -0
  43. package/dist/binary.d.ts +0 -7
  44. package/dist/chunks/types-l6nBVYwx.js +0 -8
  45. package/dist/chunks/types-l6nBVYwx.js.map +0 -1
  46. package/dist/errors.d.ts +0 -7
  47. package/dist/extensions.d.ts +0 -19
  48. package/dist/index.js.map +0 -1
  49. package/dist/lottie-merge-path.d.ts +0 -11
  50. package/dist/lottie.js.map +0 -1
  51. package/dist/native3d/Animation3DError.d.ts +0 -8
  52. package/dist/native3d/Animation3DParser.d.ts +0 -7
  53. package/dist/native3d/Animation3DTypes.d.ts +0 -285
  54. package/dist/native3d/index.d.ts +0 -5
  55. package/dist/native3d.js.map +0 -1
  56. package/dist/parser.d.ts +0 -2
  57. package/dist/state-machine.d.ts +0 -130
  58. package/dist/text-selector.d.ts +0 -2
  59. package/dist/types.d.ts +0 -419
  60. package/dist/validation.d.ts +0 -32
  61. package/src/binary.ts +0 -1441
  62. package/src/errors.ts +0 -18
  63. package/src/extensions.ts +0 -55
  64. package/src/index.ts +0 -90
  65. package/src/lottie-merge-path.ts +0 -204
  66. package/src/lottie.ts +0 -3073
  67. package/src/native3d/Animation3DError.ts +0 -20
  68. package/src/native3d/Animation3DParser.ts +0 -964
  69. package/src/native3d/Animation3DTypes.ts +0 -322
  70. package/src/native3d/index.ts +0 -14
  71. package/src/native3d.ts +0 -2
  72. package/src/parser.ts +0 -41
  73. package/src/state-machine.ts +0 -645
  74. package/src/text-selector.ts +0 -7
  75. package/src/types.ts +0 -483
  76. package/src/validation.ts +0 -1286
  77. package/test/fixtures/basic-lottie.json +0 -31
@@ -0,0 +1,1493 @@
1
+ type OfflineConversionMode = 'normal' | 'strict';
2
+ interface OfflineConversionDiagnostic {
3
+ readonly severity: 'warning' | 'error';
4
+ readonly code: string;
5
+ readonly message: string;
6
+ readonly path: string;
7
+ }
8
+ interface OfflineConversionAssetRequest {
9
+ readonly uri: string;
10
+ readonly integrity?: string;
11
+ }
12
+ interface OfflineConversionResolvedAsset {
13
+ readonly uri: string;
14
+ readonly bytes: Uint8Array;
15
+ readonly integrity: string;
16
+ }
17
+ interface OfflineConversionRecipe {
18
+ readonly id: string;
19
+ readonly clip: string;
20
+ readonly start?: number;
21
+ readonly duration?: number;
22
+ readonly constants?: Readonly<Record<string, number>>;
23
+ readonly bake?: Readonly<Record<string, boolean>>;
24
+ }
25
+ interface OfflineConversionAdapterContext {
26
+ readonly signal: AbortSignal;
27
+ readonly assets: ReadonlyMap<string, OfflineConversionResolvedAsset>;
28
+ }
29
+ interface OfflineConversionSession<TFrame> {
30
+ readonly duration: number;
31
+ readonly keyTimes?: readonly number[];
32
+ readonly sourceVersion: string;
33
+ readonly evaluatorVersion: string;
34
+ readonly diagnostics?: readonly OfflineConversionDiagnostic[];
35
+ readonly features?: Readonly<Record<string, number | boolean | string>>;
36
+ evaluate(time: number, signal: AbortSignal): Promise<TFrame>;
37
+ close(): void | Promise<void>;
38
+ }
39
+ interface OfflineConversionAdapter<TSource, TFrame> {
40
+ readonly id: string;
41
+ readonly version: string;
42
+ open(source: TSource, recipe: OfflineConversionRecipe, context: OfflineConversionAdapterContext): Promise<OfflineConversionSession<TFrame>>;
43
+ }
44
+ interface OfflineConversionArtifact {
45
+ readonly path: string;
46
+ readonly bytes: Uint8Array;
47
+ readonly mimeType?: string;
48
+ }
49
+ interface OfflineConversionTransaction {
50
+ stage(path: string, bytes: Uint8Array): void | Promise<void>;
51
+ commit(): void | Promise<void>;
52
+ rollback(): void | Promise<void>;
53
+ }
54
+ interface OfflineConversionHost {
55
+ readAsset(uri: string, signal: AbortSignal): Promise<Uint8Array>;
56
+ sha256(bytes: Uint8Array): Promise<string>;
57
+ beginTransaction?(): OfflineConversionTransaction | Promise<OfflineConversionTransaction>;
58
+ }
59
+ interface OfflineConversionFrameOperations<TFrame> {
60
+ interpolate(left: TFrame, right: TFrame, progress: number): TFrame;
61
+ error(actual: TFrame, interpolated: TFrame): number;
62
+ quantize(frame: TFrame, step: number): TFrame;
63
+ dirtyChannels(previous: TFrame | undefined, current: TFrame): readonly string[];
64
+ }
65
+ interface OfflineConversionSamplingOptions {
66
+ readonly tolerance: number;
67
+ readonly quantizationStep: number;
68
+ readonly maxDepth?: number;
69
+ readonly evaluationConcurrency?: number;
70
+ }
71
+ interface OfflineConversionEncodeInput<TFrame> {
72
+ readonly times: Float32Array;
73
+ readonly frames: readonly TFrame[];
74
+ readonly dirtyChannels: readonly (readonly string[])[];
75
+ readonly recipe: OfflineConversionRecipe;
76
+ readonly assets: ReadonlyMap<string, OfflineConversionResolvedAsset>;
77
+ }
78
+ interface OfflineConversionPipelineOptions<TSource, TFrame> {
79
+ readonly source: TSource;
80
+ readonly sourceBytes: Uint8Array;
81
+ readonly adapter: OfflineConversionAdapter<TSource, TFrame>;
82
+ readonly recipe: OfflineConversionRecipe;
83
+ readonly assets?: readonly OfflineConversionAssetRequest[];
84
+ readonly host: OfflineConversionHost;
85
+ readonly frame: OfflineConversionFrameOperations<TFrame>;
86
+ readonly sampling: OfflineConversionSamplingOptions;
87
+ readonly mode?: OfflineConversionMode;
88
+ readonly signal?: AbortSignal;
89
+ readonly encode: (input: OfflineConversionEncodeInput<TFrame>) => readonly OfflineConversionArtifact[] | Promise<readonly OfflineConversionArtifact[]>;
90
+ readonly onProgress?: (progress: Readonly<{
91
+ phase: 'assets' | 'sampling' | 'encoding' | 'committing';
92
+ completed: number;
93
+ total: number;
94
+ }>) => void;
95
+ }
96
+ interface OfflineConversionReport {
97
+ readonly schemaVersion: 1;
98
+ readonly adapter: Readonly<{
99
+ id: string;
100
+ version: string;
101
+ sourceVersion: string;
102
+ evaluatorVersion: string;
103
+ }>;
104
+ readonly sourceIntegrity: string;
105
+ readonly assets: readonly Readonly<{
106
+ uri: string;
107
+ integrity: string;
108
+ bytes: number;
109
+ }>[];
110
+ readonly recipe: OfflineConversionRecipe;
111
+ readonly sampling: Readonly<{
112
+ tolerance: number;
113
+ quantizationStep: number;
114
+ maxDepth: number;
115
+ frameCount: number;
116
+ dirtyChannelCount: number;
117
+ }>;
118
+ readonly features: Readonly<Record<string, number | boolean | string>>;
119
+ readonly diagnostics: readonly OfflineConversionDiagnostic[];
120
+ readonly outputs: readonly Readonly<{
121
+ path: string;
122
+ integrity: string;
123
+ bytes: number;
124
+ mimeType?: string;
125
+ }>[];
126
+ readonly unclassifiedFailureCount: 0;
127
+ }
128
+ interface OfflineConversionPipelineResult<TFrame> {
129
+ readonly times: Float32Array;
130
+ readonly frames: readonly TFrame[];
131
+ readonly artifacts: readonly OfflineConversionArtifact[];
132
+ readonly report: OfflineConversionReport;
133
+ readonly reportBytes: Uint8Array;
134
+ }
135
+ declare class OfflineConversionError extends Error {
136
+ readonly code: 'E_CONVERSION_ABORTED' | 'E_CONVERSION_ASSET_MISSING' | 'E_CONVERSION_HASH_MISMATCH' | 'E_CONVERSION_STRICT_DIAGNOSTIC' | 'E_CONVERSION_ERROR_BOUND' | 'E_CONVERSION_INVALID_ADAPTER' | 'E_CUBISM_DEPENDENCY_MISSING' | 'E_CUBISM_RUNTIME_INPUT_UNBAKED' | 'E_CUBISM_RECIPE_CAPABILITY_MISSING' | 'E_CUBISM_DRAWABLE_COLOR_INVALID' | 'E_CUBISM_WPK_UNSUPPORTED';
137
+ readonly path: string;
138
+ constructor(code: OfflineConversionError['code'], message: string, path: string);
139
+ }
140
+ /** Runs a source-pure evaluator and commits only a complete deterministic artifact set. */
141
+ declare function runOfflineConversion<TSource, TFrame>(options: OfflineConversionPipelineOptions<TSource, TFrame>): Promise<OfflineConversionPipelineResult<TFrame>>;
142
+ declare function stableStringify(value: unknown): string;
143
+
144
+ interface AnimationExtensionValidationContext {
145
+ readonly extension: string;
146
+ readonly path: string;
147
+ fail(message: string, path?: string): never;
148
+ }
149
+ interface AnimationExtensionHandler {
150
+ /** Versioned identifier such as `org.example.particle@1`. */
151
+ readonly id: string;
152
+ validateComponent?(component: Readonly<Record<string, unknown>>, context: AnimationExtensionValidationContext): void;
153
+ validateDocument?(data: unknown, context: AnimationExtensionValidationContext): void;
154
+ }
155
+ declare class AnimationExtensionRegistry {
156
+ private readonly _handlers;
157
+ register(handler: AnimationExtensionHandler): () => void;
158
+ get(id: string): AnimationExtensionHandler | undefined;
159
+ has(id: string): boolean;
160
+ }
161
+ declare function extensionIdFromComponentType(type: string): string | null;
162
+ declare function validateExtensionId(value: string): void;
163
+
164
+ declare const HYA_SAFE_EXPRESSION_VERSION: 1;
165
+ type AnimationSafeExpressionPrimitive = number | string | boolean | null;
166
+ type AnimationSafeExpressionUnaryOperator = 'positive' | 'negative' | 'not';
167
+ type AnimationSafeExpressionBinaryOperator = 'add' | 'subtract' | 'multiply' | 'divide' | 'remainder' | 'less' | 'less-equal' | 'greater' | 'greater-equal' | 'equal' | 'not-equal' | 'and' | 'or';
168
+ type AnimationSafeExpressionFunction = 'abs' | 'min' | 'max' | 'clamp' | 'floor' | 'ceil' | 'round' | 'sqrt' | 'pow' | 'sin' | 'cos' | 'tan' | 'asin' | 'acos' | 'atan' | 'atan2' | 'log' | 'exp' | 'lerp' | 'to-fixed';
169
+ type AnimationSafeExpressionInstruction = Readonly<{
170
+ readonly op: 'constant';
171
+ readonly value: AnimationSafeExpressionPrimitive;
172
+ }> | Readonly<{
173
+ readonly op: 'time' | 'text';
174
+ }> | Readonly<{
175
+ readonly op: 'data';
176
+ readonly resource: string;
177
+ readonly path: readonly string[];
178
+ }> | Readonly<{
179
+ readonly op: 'local.get' | 'local.set';
180
+ readonly index: number;
181
+ }> | Readonly<{
182
+ readonly op: 'pop';
183
+ }> | Readonly<{
184
+ readonly op: 'unary';
185
+ readonly operator: AnimationSafeExpressionUnaryOperator;
186
+ }> | Readonly<{
187
+ readonly op: 'binary';
188
+ readonly operator: AnimationSafeExpressionBinaryOperator;
189
+ }> | Readonly<{
190
+ readonly op: 'select';
191
+ }> | Readonly<{
192
+ readonly op: 'branch.false' | 'jump';
193
+ readonly target: number;
194
+ }> | Readonly<{
195
+ readonly op: 'call';
196
+ readonly function: AnimationSafeExpressionFunction;
197
+ readonly argc: number;
198
+ }> | Readonly<{
199
+ readonly op: 'return';
200
+ }>;
201
+ /** Source-neutral, side-effect-free expression program. Source scripts are never retained in HYA. */
202
+ interface AnimationSafeExpressionProgram {
203
+ readonly version: typeof HYA_SAFE_EXPRESSION_VERSION;
204
+ readonly result: 'text';
205
+ readonly localCount: number;
206
+ readonly instructions: readonly AnimationSafeExpressionInstruction[];
207
+ }
208
+ interface AnimationSafeExpressionContext {
209
+ readonly time: number;
210
+ readonly text: string;
211
+ readonly data?: ReadonlyMap<string, unknown> | Readonly<Record<string, unknown>>;
212
+ }
213
+ /** Evaluates an already verified program without exposing host objects or executable source code. */
214
+ declare function evaluateSafeExpression(program: Readonly<AnimationSafeExpressionProgram>, context: Readonly<AnimationSafeExpressionContext>): string;
215
+ declare function safeExpressionDataResources(program: Readonly<AnimationSafeExpressionProgram>): readonly string[];
216
+
217
+ declare const ANIMATION_FORMAT: "haiyue-animation";
218
+ declare const ANIMATION_VERSION: "1.0";
219
+ declare const ANIMATION_MIME_TYPE: "application/vnd.haiyue.animation";
220
+ declare const ANIMATION_FILE_EXTENSION: ".hya";
221
+ type AnimationCoordinateSystem = 'screen-y-down';
222
+ type AnimationEndBehavior = 'hold' | 'loop' | 'destroy';
223
+ type AnimationInterpolation = 'step' | 'linear' | 'cubic-bezier';
224
+ type AnimationTrackProperty = 'position' | 'rotation' | 'scale' | 'opacity';
225
+ interface AnimationCanvas {
226
+ width: number;
227
+ height: number;
228
+ coordinateSystem: AnimationCoordinateSystem;
229
+ }
230
+ interface AnimationTransform2D {
231
+ position?: readonly [number, number];
232
+ rotation?: number;
233
+ scale?: readonly [number, number];
234
+ anchor?: readonly [number, number];
235
+ opacity?: number;
236
+ }
237
+ interface AnimationShape2DComponent {
238
+ type: 'shape2d';
239
+ shape: 'rect' | 'ellipse';
240
+ size: readonly [number, number];
241
+ position?: readonly [number, number];
242
+ fill: readonly [number, number, number, number];
243
+ }
244
+ type AnimationPathCommand = 'M' | 'L' | 'Q' | 'C' | 'Z';
245
+ type AnimationFillRule = 'nonzero' | 'evenodd';
246
+ interface AnimationPath2DComponent {
247
+ type: 'path2d';
248
+ /** Packed command stream. M/L consume 2, Q consumes 4, C consumes 6, Z consumes 0 floats. */
249
+ commands: string;
250
+ values: readonly number[] | Float32Array;
251
+ fill: readonly [number, number, number, number];
252
+ fillRule?: AnimationFillRule;
253
+ /** Maximum flattening error in animation canvas units. */
254
+ tolerance?: number;
255
+ }
256
+ interface AnimationSprite2DComponent {
257
+ type: 'sprite2d';
258
+ resource: string;
259
+ size: readonly [number, number];
260
+ position?: readonly [number, number];
261
+ tint?: readonly [number, number, number, number];
262
+ /** Normalized source rectangle [x, y, width, height]. */
263
+ uvRect?: readonly [number, number, number, number];
264
+ /** STEP-keyed normalized source rectangles for atlas/spritesheet animation. */
265
+ uvRectTrack?: AnimationVectorValueTrack;
266
+ }
267
+ interface AnimationText2DComponent {
268
+ type: 'text2d';
269
+ text: string;
270
+ size: readonly [number, number];
271
+ position?: readonly [number, number];
272
+ fontFamily?: string;
273
+ fontSize?: number;
274
+ fontWeight?: string | number;
275
+ fontStyle?: 'normal' | 'italic';
276
+ /** Optional binary font resource loaded through FontFace before rasterization. */
277
+ fontResource?: string;
278
+ lineHeight?: number;
279
+ /** Additional advance in animation canvas units between shaped graphemes. */
280
+ tracking?: number;
281
+ textAlign?: 'left' | 'center' | 'right';
282
+ verticalAlign?: 'top' | 'middle' | 'bottom';
283
+ color: readonly [number, number, number, number];
284
+ backgroundColor?: readonly [number, number, number, number];
285
+ padding?: number;
286
+ /** Optional per-line decoration used by shaped text runs. */
287
+ lineBackground?: AnimationTextLineBackground;
288
+ /** Rive-compatible overflow fitting: scale the shaped block or search an integer top font size. */
289
+ fit?: 'none' | 'scale' | 'font-size';
290
+ /** Behavior for shaped lines outside the authored box when fitting is disabled. */
291
+ overflow?: 'visible' | 'hidden' | 'clip' | 'ellipsis';
292
+ /** Preserve the first baseline while applying `fit: 'scale'`. */
293
+ fitFromBaseline?: boolean;
294
+ /** Optional wrapping performed before fit evaluation. */
295
+ wrap?: 'none' | 'word';
296
+ /** Additional canvas units inserted after an authored paragraph break. */
297
+ paragraphSpacing?: number;
298
+ paragraphSpacingTrack?: AnimationVectorValueTrack;
299
+ /** UTF-16 ranges carrying source text-run styling overrides. */
300
+ styleRuns?: readonly AnimationTextStyleRun[];
301
+ resolutionScale?: number;
302
+ /** Step-keyed source-neutral text documents. The first entry may start after zero. */
303
+ documents?: readonly AnimationTextDocumentKeyframe[];
304
+ /** Ordered per-character animators evaluated after deterministic grapheme shaping. */
305
+ animators?: readonly AnimationTextAnimator[];
306
+ /** Verified source-neutral program evaluated as a pure Text Document input. */
307
+ expression?: AnimationSafeExpressionProgram;
308
+ }
309
+ interface AnimationTextStyleRun {
310
+ /** Inclusive UTF-16 offset into the component text. */
311
+ readonly start: number;
312
+ /** Exclusive UTF-16 offset into the component text. */
313
+ readonly end: number;
314
+ readonly fontFamily?: string;
315
+ readonly fontSize?: number;
316
+ readonly fontSizeTrack?: AnimationVectorValueTrack;
317
+ readonly fontWeight?: string | number;
318
+ readonly fontStyle?: 'normal' | 'italic';
319
+ readonly fontResource?: string;
320
+ readonly lineHeight?: number;
321
+ readonly lineHeightTrack?: AnimationVectorValueTrack;
322
+ readonly tracking?: number;
323
+ readonly trackingTrack?: AnimationVectorValueTrack;
324
+ readonly color?: readonly [number, number, number, number];
325
+ readonly lineBackground?: AnimationTextLineBackground;
326
+ }
327
+ interface AnimationTextLineBackground {
328
+ readonly fill: readonly [number, number, number, number];
329
+ readonly stroke?: readonly [number, number, number, number];
330
+ readonly strokeWidth?: number;
331
+ readonly cornerRadius?: number;
332
+ readonly padding?: number;
333
+ }
334
+ interface AnimationTextDocumentKeyframe {
335
+ readonly time: number;
336
+ readonly text: string;
337
+ readonly fontFamily?: string;
338
+ readonly fontSize?: number;
339
+ readonly fontWeight?: string | number;
340
+ readonly fontStyle?: 'normal' | 'italic';
341
+ readonly fontResource?: string;
342
+ readonly lineHeight?: number;
343
+ readonly tracking?: number;
344
+ readonly textAlign?: 'left' | 'center' | 'right';
345
+ readonly color?: readonly [number, number, number, number];
346
+ }
347
+ type AnimationTextSelectorUnits = 'percent' | 'index';
348
+ type AnimationTextSelectorShape = 'square' | 'ramp-up' | 'ramp-down' | 'triangle' | 'round' | 'smooth';
349
+ type AnimationTextSelectorBasedOn = 'characters' | 'characters-excluding-spaces' | 'words' | 'lines';
350
+ interface AnimationTextRangeSelector {
351
+ readonly start: number;
352
+ readonly end: number;
353
+ readonly offset?: number;
354
+ readonly units?: AnimationTextSelectorUnits;
355
+ /** Signed selector influence in the normalized [-1, 1] domain. */
356
+ readonly amount?: number;
357
+ readonly shape?: AnimationTextSelectorShape;
358
+ /** Glyph grouping used before applying the selector range. */
359
+ readonly basedOn?: AnimationTextSelectorBasedOn;
360
+ /** Cubic Bézier easing applied to the selector shape weight. */
361
+ readonly easing?: readonly [number, number, number, number];
362
+ /** Selector edge smoothing in the normalized [0, 1] domain. */
363
+ readonly smoothness?: number;
364
+ /** Stable uint32 seed for deterministic permutation of selector groups. */
365
+ readonly randomSeed?: number;
366
+ readonly startTrack?: AnimationVectorValueTrack;
367
+ readonly endTrack?: AnimationVectorValueTrack;
368
+ readonly offsetTrack?: AnimationVectorValueTrack;
369
+ readonly amountTrack?: AnimationVectorValueTrack;
370
+ }
371
+ interface AnimationTextAnimator {
372
+ readonly selector: AnimationTextRangeSelector;
373
+ readonly position?: readonly [number, number];
374
+ readonly scale?: readonly [number, number];
375
+ readonly rotation?: number;
376
+ readonly opacity?: number;
377
+ readonly fillColor?: readonly [number, number, number, number];
378
+ readonly tracking?: number;
379
+ readonly positionTrack?: AnimationVectorValueTrack;
380
+ readonly scaleTrack?: AnimationVectorValueTrack;
381
+ readonly rotationTrack?: AnimationVectorValueTrack;
382
+ readonly opacityTrack?: AnimationVectorValueTrack;
383
+ readonly fillColorTrack?: AnimationVectorValueTrack;
384
+ readonly trackingTrack?: AnimationVectorValueTrack;
385
+ }
386
+ interface AnimationParticle2DComponent {
387
+ type: 'particle2d';
388
+ maxParticles: number;
389
+ emissionRate: number;
390
+ burst?: number;
391
+ duration?: number;
392
+ loop?: boolean;
393
+ seed?: number;
394
+ lifetime: readonly [number, number];
395
+ speed: readonly [number, number];
396
+ angle: readonly [number, number];
397
+ gravity?: readonly [number, number];
398
+ startSize: readonly [number, number];
399
+ endSize: readonly [number, number];
400
+ startColor: readonly [number, number, number, number];
401
+ endColor: readonly [number, number, number, number];
402
+ shape?: 'point' | 'box' | 'circle';
403
+ shapeSize?: readonly [number, number];
404
+ shapeRadius?: number;
405
+ blendMode?: 'normal' | 'additive';
406
+ resource?: string;
407
+ radial?: boolean;
408
+ }
409
+ interface AnimationAudioComponent {
410
+ type: 'audio';
411
+ resource: string;
412
+ volume?: number;
413
+ loop?: boolean;
414
+ startOffset?: number;
415
+ playbackRate?: number;
416
+ }
417
+ interface AnimationExtensionComponent {
418
+ /** A namespaced component id such as `org.example.particle@1`. */
419
+ type: string;
420
+ [key: string]: unknown;
421
+ }
422
+ declare const ANIMATION_VECTOR_SHAPE_EXTENSION_ID: "org.haiyue.vector-shape@1";
423
+ interface AnimationVectorValueTrack {
424
+ readonly times: readonly number[] | Float32Array;
425
+ readonly values: readonly number[] | Float32Array;
426
+ readonly valueSize: number;
427
+ readonly interpolation: AnimationInterpolation;
428
+ readonly easings?: readonly number[] | Float32Array;
429
+ }
430
+ interface AnimationVectorSolidPaint {
431
+ readonly kind: 'solid';
432
+ readonly color: readonly [number, number, number, number];
433
+ readonly opacity?: number;
434
+ readonly colorTrack?: AnimationVectorValueTrack;
435
+ readonly opacityTrack?: AnimationVectorValueTrack;
436
+ }
437
+ interface AnimationVectorGradientPaint {
438
+ readonly kind: 'linear-gradient' | 'radial-gradient';
439
+ readonly start: readonly [number, number];
440
+ readonly end: readonly [number, number];
441
+ /** Repeating offset,r,g,b,a tuples. Runtime support is intentionally bounded to eight stops. */
442
+ readonly stops: readonly number[] | Float32Array;
443
+ readonly opacity?: number;
444
+ readonly startTrack?: AnimationVectorValueTrack;
445
+ readonly endTrack?: AnimationVectorValueTrack;
446
+ readonly stopsTrack?: AnimationVectorValueTrack;
447
+ readonly opacityTrack?: AnimationVectorValueTrack;
448
+ }
449
+ interface AnimationVectorStrokePaint {
450
+ readonly color: readonly [number, number, number, number];
451
+ readonly gradient?: AnimationVectorGradientPaint;
452
+ readonly width: number;
453
+ readonly opacity?: number;
454
+ readonly lineCap: 'butt' | 'round' | 'square';
455
+ readonly lineJoin: 'miter' | 'round' | 'bevel';
456
+ readonly miterLimit: number;
457
+ readonly dash?: readonly number[] | Float32Array;
458
+ readonly dashOffset?: number;
459
+ readonly colorTrack?: AnimationVectorValueTrack;
460
+ readonly opacityTrack?: AnimationVectorValueTrack;
461
+ readonly widthTrack?: AnimationVectorValueTrack;
462
+ readonly dashOffsetTrack?: AnimationVectorValueTrack;
463
+ }
464
+ interface AnimationVectorTrimPathModifier {
465
+ readonly kind: 'trim-path';
466
+ /** Normalized path fractions. Values outside [0, 1] are wrapped by the runtime. */
467
+ readonly start: number;
468
+ readonly end: number;
469
+ /** Rotation in turns, matching start/end's normalized domain. */
470
+ readonly offset: number;
471
+ readonly mode: 'simultaneous' | 'individual';
472
+ readonly startTrack?: AnimationVectorValueTrack;
473
+ readonly endTrack?: AnimationVectorValueTrack;
474
+ readonly offsetTrack?: AnimationVectorValueTrack;
475
+ }
476
+ interface AnimationVectorRoundCornersModifier {
477
+ readonly kind: 'round-corners';
478
+ readonly radius: number;
479
+ readonly radiusTrack?: AnimationVectorValueTrack;
480
+ }
481
+ type AnimationVectorPathModifier = AnimationVectorTrimPathModifier | AnimationVectorRoundCornersModifier;
482
+ /**
483
+ * Paint-local inner feather. Radius and offset use the vector shape's local
484
+ * coordinate system and are applied before compositing.
485
+ */
486
+ interface AnimationVectorInnerFeather {
487
+ readonly radius: readonly [number, number];
488
+ readonly offset?: readonly [number, number];
489
+ }
490
+ /**
491
+ * Paint-local feather retained independently from layer effects. `inner`
492
+ * selects clipping to the authored paint path; `space` controls whether the
493
+ * radius and offset follow the local transform or the animation canvas.
494
+ */
495
+ interface AnimationVectorFeather {
496
+ readonly radius: readonly [number, number];
497
+ readonly offset?: readonly [number, number];
498
+ readonly inner: boolean;
499
+ readonly space?: 'local' | 'world';
500
+ }
501
+ interface AnimationVectorShapeComponent {
502
+ readonly type: typeof ANIMATION_VECTOR_SHAPE_EXTENSION_ID;
503
+ readonly commands: string;
504
+ readonly values: readonly number[] | Float32Array;
505
+ /** Drawable-level compositing retained from source vector runtimes. */
506
+ readonly blendMode?: 'normal' | 'additive' | 'multiplicative' | 'screen';
507
+ readonly morph?: AnimationVectorValueTrack;
508
+ /** When true, morph samples are added component-wise to `values`. */
509
+ readonly morphRelative?: boolean;
510
+ readonly fill?: AnimationVectorSolidPaint | AnimationVectorGradientPaint;
511
+ readonly stroke?: AnimationVectorStrokePaint;
512
+ /** Unlike node effects, this edge attenuation does not affect sibling paints. */
513
+ readonly feather?: AnimationVectorFeather;
514
+ /** @deprecated Legacy inner-only field retained for HYA binary compatibility. */
515
+ readonly innerFeather?: AnimationVectorInnerFeather;
516
+ /** Ordered, source-neutral path modifiers. Runtime execution follows array order. */
517
+ readonly modifiers?: readonly AnimationVectorPathModifier[];
518
+ readonly fillRule?: AnimationFillRule;
519
+ readonly tolerance?: number;
520
+ }
521
+ interface AnimationTintEffect {
522
+ readonly kind: 'tint';
523
+ readonly black: readonly [number, number, number];
524
+ readonly white: readonly [number, number, number];
525
+ readonly amount: number;
526
+ readonly blackTrack?: AnimationVectorValueTrack;
527
+ readonly whiteTrack?: AnimationVectorValueTrack;
528
+ readonly amountTrack?: AnimationVectorValueTrack;
529
+ }
530
+ interface AnimationFillEffect {
531
+ readonly kind: 'fill';
532
+ readonly color: readonly [number, number, number, number];
533
+ readonly opacity?: number;
534
+ readonly colorTrack?: AnimationVectorValueTrack;
535
+ readonly opacityTrack?: AnimationVectorValueTrack;
536
+ }
537
+ interface AnimationOpacityEffect {
538
+ readonly kind: 'opacity';
539
+ readonly opacity: number;
540
+ readonly opacityTrack?: AnimationVectorValueTrack;
541
+ }
542
+ interface AnimationColorMatrixEffect {
543
+ readonly kind: 'color-matrix';
544
+ /** Four rows of five values operating on unpremultiplied RGBA. */
545
+ readonly matrix: readonly number[] | Float32Array;
546
+ readonly matrixTrack?: AnimationVectorValueTrack;
547
+ }
548
+ interface AnimationBlurEffect {
549
+ readonly kind: 'blur';
550
+ /** Horizontal and vertical radius in output pixels. */
551
+ readonly radius: readonly [number, number];
552
+ readonly radiusTrack?: AnimationVectorValueTrack;
553
+ }
554
+ interface AnimationDropShadowEffect {
555
+ readonly kind: 'drop-shadow';
556
+ readonly color: readonly [number, number, number, number];
557
+ readonly opacity: number;
558
+ /** Shadow displacement in output pixels. */
559
+ readonly offset: readonly [number, number];
560
+ readonly blur: number;
561
+ readonly colorTrack?: AnimationVectorValueTrack;
562
+ readonly opacityTrack?: AnimationVectorValueTrack;
563
+ readonly offsetTrack?: AnimationVectorValueTrack;
564
+ readonly blurTrack?: AnimationVectorValueTrack;
565
+ }
566
+ type AnimationLayerEffect = AnimationTintEffect | AnimationFillEffect | AnimationOpacityEffect | AnimationColorMatrixEffect | AnimationBlurEffect | AnimationDropShadowEffect;
567
+ type AnimationComponent = AnimationShape2DComponent | AnimationPath2DComponent | AnimationSprite2DComponent | AnimationText2DComponent | AnimationParticle2DComponent | AnimationAudioComponent | AnimationVectorShapeComponent | AnimationExtensionComponent;
568
+ type AnimationCompositeKind = 'mask' | 'matte';
569
+ type AnimationCompositeMode = 'alpha' | 'alpha-inverted' | 'luma' | 'luma-inverted';
570
+ type AnimationCompositeOperation = 'add' | 'subtract' | 'intersect' | 'difference';
571
+ interface AnimationCompositeLayer {
572
+ kind: AnimationCompositeKind;
573
+ source: string;
574
+ mode: AnimationCompositeMode;
575
+ /** Ordered mask/matte composition. The first layer is evaluated against transparent coverage. */
576
+ operation?: AnimationCompositeOperation;
577
+ /** Screen-space feather radii in animation canvas units. */
578
+ feather?: readonly [number, number];
579
+ /** Positive values expand coverage; negative values contract it. */
580
+ expansion?: number;
581
+ /** Optional time-varying expansion sampled in composition seconds. */
582
+ expansionTrack?: AnimationVectorValueTrack;
583
+ }
584
+ interface AnimationCompositeStack {
585
+ readonly layers: readonly AnimationCompositeLayer[];
586
+ }
587
+ /** A single layer remains accepted as the compact authoring form. Parsers canonicalize neither form away. */
588
+ type AnimationComposite = AnimationCompositeLayer | AnimationCompositeStack;
589
+ interface AnimationNode {
590
+ id: string;
591
+ name?: string;
592
+ parent?: string;
593
+ start?: number;
594
+ duration?: number;
595
+ transform?: AnimationTransform2D;
596
+ composite?: AnimationComposite;
597
+ /** Ordered source-neutral visual effects applied to this node's visual subtree. */
598
+ effects?: readonly AnimationLayerEffect[];
599
+ components?: readonly AnimationComponent[];
600
+ extensions?: Readonly<Record<string, unknown>>;
601
+ }
602
+ interface AnimationTrack {
603
+ node: string;
604
+ property: AnimationTrackProperty;
605
+ interpolation: AnimationInterpolation;
606
+ /** Strictly increasing seconds relative to the composition start. */
607
+ times: readonly number[] | Float32Array;
608
+ /** Keyframe values, tightly packed by property component count. */
609
+ values: readonly number[] | Float32Array;
610
+ /** Per-segment cubic-bezier x1,y1,x2,y2 tuples. */
611
+ easings?: readonly number[] | Float32Array;
612
+ /**
613
+ * Optional per-segment spatial cubic controls for 2D position tracks.
614
+ * Each tuple is outgoingX,outgoingY,incomingX,incomingY relative to the
615
+ * segment start/end values. Temporal easing still owns curve progress.
616
+ */
617
+ spatialTangents?: readonly number[] | Float32Array;
618
+ }
619
+ interface AnimationImageResource {
620
+ id: string;
621
+ type: 'image';
622
+ uri: string;
623
+ width?: number;
624
+ height?: number;
625
+ mimeType?: string;
626
+ integrity?: string;
627
+ /** Sampling color space; ordinary authored images default to sRGB. */
628
+ colorSpace?: 'srgb' | 'linear';
629
+ }
630
+ interface AnimationBinaryResource {
631
+ id: string;
632
+ type: 'binary';
633
+ uri: string;
634
+ mimeType?: string;
635
+ integrity?: string;
636
+ }
637
+ interface AnimationAudioResource {
638
+ id: string;
639
+ type: 'audio';
640
+ uri: string;
641
+ mimeType?: string;
642
+ integrity?: string;
643
+ }
644
+ type AnimationResource = AnimationImageResource | AnimationAudioResource | AnimationBinaryResource;
645
+ interface AnimationDocument {
646
+ format: typeof ANIMATION_FORMAT;
647
+ version: typeof ANIMATION_VERSION;
648
+ name?: string;
649
+ canvas: AnimationCanvas;
650
+ duration: number;
651
+ frameRate?: number;
652
+ endBehavior?: AnimationEndBehavior;
653
+ resources?: readonly AnimationResource[];
654
+ nodes: readonly AnimationNode[];
655
+ tracks?: readonly AnimationTrack[];
656
+ extensionsUsed?: readonly string[];
657
+ extensionsRequired?: readonly string[];
658
+ extensions?: Readonly<Record<string, unknown>>;
659
+ }
660
+ interface ParsedAnimationTrack extends Omit<AnimationTrack, 'times' | 'values' | 'easings' | 'spatialTangents'> {
661
+ readonly times: Float32Array;
662
+ readonly values: Float32Array;
663
+ readonly easings?: Float32Array;
664
+ readonly spatialTangents?: Float32Array;
665
+ readonly valueSize: 1 | 2;
666
+ }
667
+ interface ParsedAnimation {
668
+ readonly format: typeof ANIMATION_FORMAT;
669
+ readonly version: typeof ANIMATION_VERSION;
670
+ readonly name?: string;
671
+ readonly canvas: Readonly<AnimationCanvas>;
672
+ readonly duration: number;
673
+ readonly frameRate?: number;
674
+ readonly endBehavior: AnimationEndBehavior;
675
+ readonly resources: readonly Readonly<AnimationResource>[];
676
+ readonly nodes: readonly Readonly<AnimationNode>[];
677
+ readonly tracks: readonly ParsedAnimationTrack[];
678
+ readonly extensionsUsed: readonly string[];
679
+ readonly extensionsRequired: readonly string[];
680
+ readonly extensions: Readonly<Record<string, unknown>>;
681
+ readonly source: 'json' | 'binary';
682
+ /** Keeps zero-copy binary track views alive. */
683
+ readonly backingBuffer?: ArrayBuffer;
684
+ }
685
+ interface AnimationParseLimits {
686
+ maxInputBytes?: number;
687
+ maxMetadataBytes?: number;
688
+ maxNodes?: number;
689
+ maxComponents?: number;
690
+ maxTracks?: number;
691
+ maxKeyframes?: number;
692
+ maxResources?: number;
693
+ maxPathValues?: number;
694
+ maxTextCharacters?: number;
695
+ maxParticleCapacity?: number;
696
+ }
697
+ interface AnimationParseOptions extends AnimationParseLimits {
698
+ extensions?: AnimationExtensionRegistry;
699
+ /** Copies binary track/path Float32 views instead of retaining the source buffer. */
700
+ copyFloatData?: boolean;
701
+ }
702
+ type AnimationSource = AnimationDocument | string | ArrayBuffer;
703
+
704
+ declare const CUBISM_DRAWABLE_CAPTURE_FORMAT: "live2d-cubism-drawable-capture";
705
+ declare const CUBISM_DRAWABLE_CAPTURE_VERSION: 1;
706
+ interface CubismCaptureTexture {
707
+ readonly id: string;
708
+ readonly uri: string;
709
+ readonly width?: number;
710
+ readonly height?: number;
711
+ readonly integrity?: string;
712
+ }
713
+ interface CubismCapturedDrawable {
714
+ readonly id: string;
715
+ readonly textureIndex: number;
716
+ readonly renderOrder: number;
717
+ readonly opacity: number;
718
+ /** Cubism Core dynamic visibility flag for the sampled frame. */
719
+ readonly visible?: boolean;
720
+ readonly blendMode?: 'normal' | 'additive' | 'multiplicative';
721
+ readonly culling?: boolean;
722
+ readonly masks?: readonly string[];
723
+ readonly invertedMask?: boolean;
724
+ readonly positions: readonly number[];
725
+ readonly uvs: readonly number[];
726
+ readonly indices: readonly number[];
727
+ readonly multiplyColor?: readonly [number, number, number, number];
728
+ readonly screenColor?: readonly [number, number, number, number];
729
+ }
730
+ interface CubismCaptureFrame {
731
+ readonly time: number;
732
+ readonly drawables: readonly CubismCapturedDrawable[];
733
+ }
734
+ interface CubismDrawableCapture {
735
+ readonly format: typeof CUBISM_DRAWABLE_CAPTURE_FORMAT;
736
+ readonly version: typeof CUBISM_DRAWABLE_CAPTURE_VERSION;
737
+ readonly name?: string;
738
+ readonly source?: Readonly<Record<string, unknown>>;
739
+ readonly capabilities?: Readonly<{
740
+ /** New Core capture tools set this explicitly; omitted legacy captures remain compatible. */
741
+ readonly drawableColors?: 'captured' | 'unavailable';
742
+ }>;
743
+ readonly canvas: {
744
+ readonly width: number;
745
+ readonly height: number;
746
+ readonly pixelsPerUnit: number;
747
+ readonly coordinateSystem: 'model-y-up';
748
+ /** Legacy captures omit this and are interpreted as top-left image UVs. */
749
+ readonly uvOrigin?: 'top-left' | 'bottom-left';
750
+ };
751
+ readonly duration: number;
752
+ readonly frameRate: number;
753
+ readonly textures: readonly CubismCaptureTexture[];
754
+ readonly frames: readonly CubismCaptureFrame[];
755
+ }
756
+ interface CubismCaptureDiagnostic {
757
+ readonly severity: 'warning' | 'error';
758
+ readonly code: 'E_CUBISM_CAPTURE_INVALID' | 'E_CUBISM_MASK_BUDGET_EXCEEDED' | 'E_CUBISM_TOPOLOGY_CHANGED' | 'E_CUBISM_DRAWABLE_COLOR_INVALID' | 'W_CUBISM_DRAWABLE_COLOR_UNAVAILABLE';
759
+ readonly message: string;
760
+ readonly path: string;
761
+ }
762
+ interface CubismCaptureConversionOptions {
763
+ readonly dataUri?: string;
764
+ readonly strict?: boolean;
765
+ }
766
+ interface CubismCaptureConversionResult {
767
+ readonly document: AnimationDocument;
768
+ readonly data: ArrayBuffer;
769
+ readonly diagnostics: readonly CubismCaptureDiagnostic[];
770
+ readonly report: Readonly<{
771
+ sourceFormat: typeof CUBISM_DRAWABLE_CAPTURE_FORMAT;
772
+ profile: 'clip-baked';
773
+ frameCount: number;
774
+ drawableCount: number;
775
+ vertexCount: number;
776
+ textureCount: number;
777
+ maskReferenceCount: number;
778
+ invertedMaskDrawableCount: number;
779
+ additiveDrawableCount: number;
780
+ multiplicativeDrawableCount: number;
781
+ multiplyColorDrawableCount: number;
782
+ screenColorDrawableCount: number;
783
+ multiplyColorDrawableFrameCount: number;
784
+ screenColorDrawableFrameCount: number;
785
+ emptyDrawableCount: number;
786
+ unsupportedRuntimeFeatures: readonly string[];
787
+ }>;
788
+ }
789
+ declare class CubismCaptureConversionError extends Error {
790
+ readonly diagnostics: readonly CubismCaptureDiagnostic[];
791
+ constructor(message: string, diagnostics: readonly CubismCaptureDiagnostic[]);
792
+ }
793
+ declare function convertCubismCaptureToHya(capture: CubismDrawableCapture, options?: CubismCaptureConversionOptions): CubismCaptureConversionResult;
794
+
795
+ /** Build-time sampler for the documented Motion3 segment representation. */
796
+ interface CubismMotion3Curve {
797
+ readonly Target: 'Model' | 'Parameter' | 'PartOpacity';
798
+ readonly Id: string;
799
+ readonly Segments: readonly number[];
800
+ }
801
+ interface CubismMotion3 {
802
+ readonly Version?: number;
803
+ readonly Meta: {
804
+ readonly Duration: number;
805
+ readonly Loop?: boolean;
806
+ };
807
+ readonly Curves: readonly CubismMotion3Curve[];
808
+ }
809
+ interface CubismMotion3Sample {
810
+ readonly parameters: ReadonlyMap<string, number>;
811
+ readonly partOpacities: ReadonlyMap<string, number>;
812
+ readonly modelOpacity: number | undefined;
813
+ }
814
+ declare function sampleCubismMotion3(motion: CubismMotion3, inputTime: number): CubismMotion3Sample;
815
+
816
+ /** A normalized Motion3 entry declared by `model3.json#FileReferences.Motions`. */
817
+ interface CubismModel3MotionReference {
818
+ readonly id: string;
819
+ readonly group: string;
820
+ readonly index: number;
821
+ readonly file: string;
822
+ readonly fadeInTime?: number;
823
+ readonly fadeOutTime?: number;
824
+ readonly sound?: string;
825
+ }
826
+ /**
827
+ * Flatten the grouped Cubism model3 motion table without loading proprietary runtime code.
828
+ * The stable id can be used by tools and example UIs as an action-selection value.
829
+ */
830
+ declare function listCubismModel3Motions(value: unknown): readonly CubismModel3MotionReference[];
831
+
832
+ interface CubismCaptureClipInput {
833
+ readonly id: string;
834
+ readonly name?: string;
835
+ readonly capture: CubismDrawableCapture;
836
+ }
837
+ interface CubismCaptureClipRange {
838
+ readonly id: string;
839
+ readonly name?: string;
840
+ readonly start: number;
841
+ readonly duration: number;
842
+ readonly frameCount: number;
843
+ }
844
+ interface CubismCaptureSetOptions {
845
+ /** Unplayed separation that prevents interpolation across adjacent actions. Defaults to one 30 fps frame. */
846
+ readonly interClipGap?: number;
847
+ readonly name?: string;
848
+ }
849
+ interface CubismCaptureSet {
850
+ readonly capture: CubismDrawableCapture;
851
+ readonly clips: readonly CubismCaptureClipRange[];
852
+ }
853
+ /** Pack same-model baked clips into one stable timeline without merging their playback ranges. */
854
+ declare function combineCubismCaptureClips(inputs: readonly CubismCaptureClipInput[], options?: CubismCaptureSetOptions): CubismCaptureSet;
855
+
856
+ declare const CUBISM_CLIP_BAKED_UPDATE_ORDER: readonly ["reset-defaults", "motion", "expression", "constant-inputs", "physics", "pose", "model-update"];
857
+ interface CubismClipBakedRecipe extends OfflineConversionRecipe {
858
+ readonly motion?: string;
859
+ readonly expression?: string;
860
+ readonly physics?: boolean;
861
+ readonly pose?: boolean;
862
+ readonly runtimeInputs?: readonly string[];
863
+ }
864
+ interface CubismBuildTimeEvaluator {
865
+ readonly version: string;
866
+ readonly duration: number;
867
+ readonly keyTimes?: readonly number[];
868
+ readonly capabilities: Readonly<{
869
+ motion: boolean;
870
+ expression: boolean;
871
+ physics: boolean;
872
+ pose: boolean;
873
+ drawableColors?: boolean;
874
+ }>;
875
+ evaluate(time: number, recipe: CubismClipBakedRecipe, updateOrder: typeof CUBISM_CLIP_BAKED_UPDATE_ORDER, signal: AbortSignal): Promise<CubismCaptureFrame>;
876
+ close(): void | Promise<void>;
877
+ }
878
+ interface CubismClipBakedSource {
879
+ readonly entry: string;
880
+ readonly name: string;
881
+ readonly sourceVersion: string;
882
+ readonly coreVersion: string;
883
+ readonly canvas: CubismDrawableCapture['canvas'];
884
+ readonly frameRate: number;
885
+ readonly textures: readonly CubismCaptureTexture[];
886
+ readonly dependencies: readonly Readonly<{
887
+ uri: string;
888
+ integrity?: string;
889
+ }>[];
890
+ readonly evaluator: CubismBuildTimeEvaluator;
891
+ }
892
+ interface CubismClipBakedConversionOptions {
893
+ readonly source: CubismClipBakedSource;
894
+ readonly sourceBytes: Uint8Array;
895
+ readonly recipe: CubismClipBakedRecipe;
896
+ readonly host: OfflineConversionHost;
897
+ readonly sampling: OfflineConversionSamplingOptions;
898
+ readonly mode?: OfflineConversionMode;
899
+ readonly signal?: AbortSignal;
900
+ readonly dataPath?: string;
901
+ readonly hyaPath?: string;
902
+ }
903
+ /** License-isolated adapter: the evaluator owns Core/Framework, while this module only sees captured drawables. */
904
+ declare class CubismClipBakedAdapter implements OfflineConversionAdapter<CubismClipBakedSource, CubismCaptureFrame> {
905
+ readonly id = "live2d-cubism-clip-baked";
906
+ readonly version = "1.1.0";
907
+ open(source: CubismClipBakedSource, recipe: OfflineConversionRecipe, context: {
908
+ readonly signal: AbortSignal;
909
+ readonly assets: ReadonlyMap<string, OfflineConversionResolvedAsset>;
910
+ }): Promise<OfflineConversionSession<CubismCaptureFrame>>;
911
+ }
912
+ declare function runCubismClipBakedConversion(options: CubismClipBakedConversionOptions): Promise<OfflineConversionPipelineResult<CubismCaptureFrame>>;
913
+ declare const CUBISM_CAPTURE_FRAME_OPERATIONS: OfflineConversionFrameOperations<CubismCaptureFrame>;
914
+
915
+ declare const DEFORMABLE_MESH_2D_EXTENSION_ID: "org.haiyue.deformable-mesh-2d@1";
916
+ declare const DEFORMABLE_MESH_2D_DATA_FORMAT: "haiyue-deformable-mesh-2d";
917
+ declare const DEFORMABLE_MESH_2D_DATA_VERSION: 1;
918
+ declare const DEFORMABLE_MESH_2D_MAX_MASK_REFERENCES: 32768;
919
+ interface DeformableMesh2DComponent extends AnimationExtensionComponent {
920
+ readonly type: typeof DEFORMABLE_MESH_2D_EXTENSION_ID;
921
+ readonly dataResource: string;
922
+ readonly textures: readonly string[];
923
+ }
924
+ type DeformableMesh2DBlendMode = 'normal' | 'additive' | 'multiplicative';
925
+ type DeformableMesh2DMaskMode = 'alpha' | 'alpha-inverted';
926
+ interface DeformableMesh2DDrawableSource {
927
+ readonly id: string;
928
+ readonly textureIndex: number;
929
+ readonly blendMode: DeformableMesh2DBlendMode;
930
+ readonly culling: boolean;
931
+ readonly masks: readonly string[];
932
+ /** How the combined mask coverage is applied to this drawable. */
933
+ readonly maskMode?: DeformableMesh2DMaskMode;
934
+ readonly uvs: Float32Array;
935
+ readonly indices: Uint32Array;
936
+ /** Absolute screen-y-down xy values, frame-major. */
937
+ readonly positions: Float32Array;
938
+ readonly opacities: Float32Array;
939
+ readonly renderOrders: Float32Array;
940
+ /** Optional frame-major RGBA. Missing values use [1, 1, 1, 1]. */
941
+ readonly multiplyColors?: Float32Array;
942
+ /** Optional frame-major RGBA. Missing values use [0, 0, 0, 0]. */
943
+ readonly screenColors?: Float32Array;
944
+ }
945
+ interface DeformableMesh2DDataSource {
946
+ readonly canvasWidth: number;
947
+ readonly canvasHeight: number;
948
+ readonly duration: number;
949
+ readonly frameRate: number;
950
+ readonly times: Float32Array;
951
+ readonly drawables: readonly DeformableMesh2DDrawableSource[];
952
+ }
953
+ interface ParsedDeformableMesh2DDrawable extends DeformableMesh2DDrawableSource {
954
+ readonly vertexCount: number;
955
+ readonly maskMode: DeformableMesh2DMaskMode;
956
+ }
957
+ interface ParsedDeformableMesh2DData {
958
+ readonly format: typeof DEFORMABLE_MESH_2D_DATA_FORMAT;
959
+ readonly version: typeof DEFORMABLE_MESH_2D_DATA_VERSION;
960
+ readonly canvasWidth: number;
961
+ readonly canvasHeight: number;
962
+ readonly duration: number;
963
+ readonly frameRate: number;
964
+ readonly times: Float32Array;
965
+ readonly drawables: readonly ParsedDeformableMesh2DDrawable[];
966
+ readonly backingBuffer: ArrayBuffer;
967
+ }
968
+ interface DeformableMesh2DParseLimits {
969
+ readonly maxInputBytes?: number;
970
+ readonly maxMetadataBytes?: number;
971
+ readonly maxDrawables?: number;
972
+ readonly maxVertices?: number;
973
+ readonly maxFrames?: number;
974
+ readonly maxMaskReferences?: number;
975
+ }
976
+
977
+ declare function isDeformableMesh2DBinary(buffer: ArrayBuffer): boolean;
978
+ declare function encodeDeformableMesh2DData(source: DeformableMesh2DDataSource): ArrayBuffer;
979
+ declare function decodeDeformableMesh2DData(buffer: ArrayBuffer, limits?: DeformableMesh2DParseLimits): ParsedDeformableMesh2DData;
980
+
981
+ declare function createDeformableMesh2DFormatHandler(): AnimationExtensionHandler;
982
+ declare function createDeformableMesh2DFormatRegistry(): AnimationExtensionRegistry;
983
+
984
+ type AnimationFormatErrorCode = 'E_ANIMATION_INVALID_FORMAT' | 'E_ANIMATION_UNSUPPORTED_VERSION' | 'E_ANIMATION_LIMIT_EXCEEDED' | 'E_ANIMATION_MISSING_EXTENSION' | 'E_ANIMATION_INVALID_BINARY';
985
+ declare class AnimationFormatError extends Error {
986
+ readonly code: AnimationFormatErrorCode;
987
+ readonly path: string;
988
+ readonly name = "AnimationFormatError";
989
+ constructor(code: AnimationFormatErrorCode, message: string, path?: string);
990
+ }
991
+
992
+ declare function parseAnimation(source: AnimationSource, options?: AnimationParseOptions): ParsedAnimation;
993
+
994
+ declare function isAnimationBinary(buffer: ArrayBuffer): boolean;
995
+ /** Encodes compact indexed metadata plus one contiguous zero-copy Float32 track/path pool. */
996
+ declare function encodeAnimationBinary(document: AnimationDocument | ParsedAnimation, options?: AnimationParseOptions): ArrayBuffer;
997
+ declare function decodeAnimationBinary(buffer: ArrayBuffer, options?: AnimationParseOptions): ParsedAnimation;
998
+
999
+ declare const HYA_STATE_MACHINE_EXTENSION_ID: "org.haiyue.animation-state-machine@1";
1000
+ /**
1001
+ * Stable channel families shared by the HYA compiler, editor capability UI,
1002
+ * and runtime adapters. A family describes value semantics; concrete channel
1003
+ * ids below additionally describe whether the current shared runtime can
1004
+ * execute that binding without falling back to a second sampler.
1005
+ */
1006
+ type HyaStateMachineChannelKind = 'continuous-number' | 'discrete-step' | 'shape-morph' | 'resource-switch' | 'particle-side-effect' | 'audio-side-effect' | 'pose-3d';
1007
+ type HyaStateMachineChannelSupport = 'full' | 'degraded' | 'unsupported';
1008
+ type HyaStateMachineChannelId = 'core-transform' | 'sprite-uv' | 'vector-morph' | 'vector-paint' | 'text-animator' | 'visual-effect' | 'composite-expansion' | 'resource-switch' | 'particle-2d' | 'particle-3d' | 'audio' | 'pose-3d';
1009
+ interface HyaStateMachineChannelCapability {
1010
+ readonly id: HyaStateMachineChannelId;
1011
+ readonly kind: HyaStateMachineChannelKind;
1012
+ readonly support: HyaStateMachineChannelSupport;
1013
+ readonly sampling: 'numeric-track' | 'step-track' | 'effect-cue' | 'pose-buffer';
1014
+ readonly mixing: 'override-additive-layer-mask' | 'dominant-weight-then-action-order' | 'shared-instance-lifecycle' | 'reject-overlap';
1015
+ readonly ownership: 'pose-buffer' | 'shared-visual' | 'shared-side-effect';
1016
+ readonly transition: 'cross-fade' | 'switch-at-dominant-weight' | 'destination-takeover' | 'immediate-only' | 'rejected';
1017
+ /** Stable diagnostic emitted when support is not full. */
1018
+ readonly diagnosticCode?: 'E_STATE_MACHINE_CHANNEL_ADVANCED_INLINE_UNSUPPORTED' | 'E_STATE_MACHINE_CHANNEL_RESOURCE_SWITCH_OVERLAP' | 'E_STATE_MACHINE_CHANNEL_AUDIO_UNMIXABLE_RANGE';
1019
+ }
1020
+ /** Canonical immutable channel registry for the built-in state machine. */
1021
+ declare const HYA_STATE_MACHINE_CHANNEL_REGISTRY: ReadonlyMap<HyaStateMachineChannelId, HyaStateMachineChannelCapability>;
1022
+ declare function hyaStateMachineChannelCapability(id: HyaStateMachineChannelId): HyaStateMachineChannelCapability;
1023
+ interface HyaAnimationClipRange {
1024
+ readonly id: string;
1025
+ readonly name?: string;
1026
+ /** Start in the document composition, in seconds. */
1027
+ readonly start: number;
1028
+ readonly duration: number;
1029
+ }
1030
+ type HyaStateMachineLoopMode = 'once' | 'repeat' | 'ping-pong';
1031
+ type HyaStateMachineBlendMode = 'override' | 'additive';
1032
+ interface HyaStateMachineBindingMask {
1033
+ readonly include?: readonly string[];
1034
+ readonly exclude?: readonly string[];
1035
+ }
1036
+ type HyaStateMachineParameter = Readonly<{
1037
+ name: string;
1038
+ type: 'float';
1039
+ defaultValue: number;
1040
+ }> | Readonly<{
1041
+ name: string;
1042
+ type: 'integer';
1043
+ defaultValue: number;
1044
+ }> | Readonly<{
1045
+ name: string;
1046
+ type: 'boolean';
1047
+ defaultValue: boolean;
1048
+ }> | Readonly<{
1049
+ name: string;
1050
+ type: 'trigger';
1051
+ }>;
1052
+ type HyaStateMachineCondition = Readonly<{
1053
+ parameter: string;
1054
+ operator: 'greater' | 'greater-or-equal' | 'less' | 'less-or-equal';
1055
+ value: number;
1056
+ }> | Readonly<{
1057
+ parameter: string;
1058
+ operator: 'equal' | 'not-equal';
1059
+ value: number | boolean;
1060
+ }> | Readonly<{
1061
+ parameter: string;
1062
+ operator: 'is-true' | 'is-false' | 'triggered';
1063
+ }>;
1064
+ interface HyaStateMachineClipMotion {
1065
+ readonly kind: 'clip';
1066
+ readonly clipId: string;
1067
+ }
1068
+ interface HyaStateMachineBlend1DMotion {
1069
+ readonly kind: 'blend-1d';
1070
+ readonly parameter: string;
1071
+ readonly children: readonly Readonly<{
1072
+ threshold: number;
1073
+ motion: HyaStateMachineMotion;
1074
+ }>[];
1075
+ }
1076
+ interface HyaStateMachineBlend2DMotion {
1077
+ readonly kind: 'blend-2d';
1078
+ readonly algorithm: 'cartesian' | 'directional';
1079
+ readonly parameterX: string;
1080
+ readonly parameterY: string;
1081
+ readonly children: readonly Readonly<{
1082
+ position: readonly [number, number];
1083
+ motion: HyaStateMachineMotion;
1084
+ }>[];
1085
+ }
1086
+ type HyaStateMachineMotion = HyaStateMachineClipMotion | HyaStateMachineBlend1DMotion | HyaStateMachineBlend2DMotion;
1087
+ interface HyaStateMachineState {
1088
+ readonly id: string;
1089
+ readonly name: string;
1090
+ readonly motion: HyaStateMachineMotion;
1091
+ readonly speed?: number;
1092
+ readonly speedParameter?: string;
1093
+ readonly loop?: HyaStateMachineLoopMode;
1094
+ }
1095
+ interface HyaStateMachineTransition {
1096
+ readonly id: string;
1097
+ readonly from: string | '*';
1098
+ readonly to: string;
1099
+ readonly conditions: readonly HyaStateMachineCondition[];
1100
+ readonly duration: number;
1101
+ readonly hasExitTime?: boolean;
1102
+ readonly exitTime?: number;
1103
+ readonly destinationOffset?: number;
1104
+ readonly interruption?: 'none' | 'source' | 'destination' | 'source-then-destination' | 'destination-then-source';
1105
+ }
1106
+ interface HyaStateMachineLayer {
1107
+ readonly id: string;
1108
+ readonly name: string;
1109
+ readonly initialStateId: string;
1110
+ readonly states: readonly HyaStateMachineState[];
1111
+ readonly transitions: readonly HyaStateMachineTransition[];
1112
+ readonly blendMode?: HyaStateMachineBlendMode;
1113
+ readonly weight?: number;
1114
+ readonly mask?: HyaStateMachineBindingMask;
1115
+ }
1116
+ interface HyaStateMachineDefinition {
1117
+ readonly format: 'haiyue-animation-state-machine@1';
1118
+ readonly id: string;
1119
+ readonly name: string;
1120
+ readonly parameters: readonly HyaStateMachineParameter[];
1121
+ readonly layers: readonly HyaStateMachineLayer[];
1122
+ }
1123
+ interface HyaStateMachineExtension {
1124
+ readonly clips: readonly HyaAnimationClipRange[];
1125
+ readonly stateMachine: HyaStateMachineDefinition;
1126
+ }
1127
+ /** Strictly validates and freezes the built-in HYA state-machine extension. */
1128
+ declare function parseHyaStateMachineExtension(value: unknown, compositionDuration: number, path?: string): HyaStateMachineExtension;
1129
+
1130
+ interface LottieConversionDiagnostic {
1131
+ readonly severity: 'warning' | 'error';
1132
+ readonly code: string;
1133
+ readonly path: string;
1134
+ readonly message: string;
1135
+ }
1136
+ interface LottieFontMetrics {
1137
+ readonly unitsPerEm: number;
1138
+ readonly ascent: number;
1139
+ readonly descent: number;
1140
+ readonly lineGap?: number;
1141
+ readonly capHeight?: number;
1142
+ readonly xHeight?: number;
1143
+ }
1144
+ interface LottieWebFontMapping {
1145
+ readonly uri: string;
1146
+ readonly family?: string;
1147
+ readonly style?: 'normal' | 'italic';
1148
+ readonly weight?: string | number;
1149
+ readonly mimeType?: string;
1150
+ /** Stable content hash used by loaders and import tooling. */
1151
+ readonly integrity?: string;
1152
+ /** Optional measured font metrics recorded by the importer for fidelity review. */
1153
+ readonly metrics?: LottieFontMetrics;
1154
+ }
1155
+ interface LottieFontRequirement {
1156
+ readonly name: string;
1157
+ readonly authoredFamily: string;
1158
+ readonly authoredStyle: string;
1159
+ readonly authoredAscent?: number;
1160
+ readonly usageCount: number;
1161
+ readonly mapped: boolean;
1162
+ readonly resolvedFamily: string;
1163
+ readonly resolvedStyle: 'normal' | 'italic';
1164
+ readonly resolvedWeight: string | number;
1165
+ readonly uri?: string;
1166
+ readonly mimeType?: string;
1167
+ readonly integrity?: string;
1168
+ readonly metrics?: LottieFontMetrics;
1169
+ }
1170
+ interface LottieConversionOptions {
1171
+ name?: string;
1172
+ imageBaseUrl?: string;
1173
+ /** Optional build-time mapping from Lottie fName to a loadable web-font resource. */
1174
+ fonts?: Readonly<Record<string, string | Readonly<LottieWebFontMapping>>>;
1175
+ /** Converts warnings to errors and throws after conversion. */
1176
+ strict?: boolean;
1177
+ }
1178
+ interface LottieConversionResult {
1179
+ readonly document: AnimationDocument;
1180
+ readonly diagnostics: readonly LottieConversionDiagnostic[];
1181
+ readonly convertedLayerCount: number;
1182
+ readonly skippedLayerCount: number;
1183
+ /** Import-time font inventory; unresolved entries retain actionable diagnostics. */
1184
+ readonly fonts: readonly LottieFontRequirement[];
1185
+ }
1186
+ /** Converts the runtime-relevant Lottie subset without importing a Lottie player. */
1187
+ declare function convertLottie(source: string | Readonly<Record<string, unknown>>, options?: LottieConversionOptions): LottieConversionResult;
1188
+ /** Returns the complete authored-font delivery inventory without converting geometry. */
1189
+ declare function inspectLottieFonts(source: string | Readonly<Record<string, unknown>>, mappings?: LottieConversionOptions['fonts']): readonly LottieFontRequirement[];
1190
+ declare function convertLottieDocument(source: string | Readonly<Record<string, unknown>>, options?: LottieConversionOptions): AnimationDocument;
1191
+
1192
+ declare const NATIVE_3D_ANIMATION_EXTENSION_ID: "org.haiyue.animation-3d@1";
1193
+ declare const NATIVE_3D_ANIMATION_FORMAT: "haiyue-animation-3d@1";
1194
+ declare const NATIVE_3D_CLIP_FORMAT: "haiyue-animation3d-clip@1";
1195
+ declare const NATIVE_3D_STATE_MACHINE_FORMAT: "haiyue-animation3d-state-machine@1";
1196
+ type Native3DVec2 = readonly [number, number];
1197
+ type Native3DVec3 = readonly [number, number, number];
1198
+ type Native3DVec4 = readonly [number, number, number, number];
1199
+ type Native3DQuaternion = Native3DVec4;
1200
+ type Native3DScalarRange = number | readonly [number, number];
1201
+ interface Native3DCoordinateSystem {
1202
+ readonly handedness: 'right';
1203
+ readonly upAxis: '+y';
1204
+ readonly forwardAxis: '-z';
1205
+ readonly unit: 'meter';
1206
+ readonly angles: 'radian';
1207
+ readonly rotationStorage: 'normalized-xyzw-quaternion';
1208
+ }
1209
+ interface Native3DViewport {
1210
+ readonly width: number;
1211
+ readonly height: number;
1212
+ }
1213
+ interface Native3DTransform {
1214
+ readonly translation: Native3DVec3;
1215
+ readonly rotation: Native3DQuaternion;
1216
+ readonly scale: Native3DVec3;
1217
+ }
1218
+ interface Native3DMaterial {
1219
+ readonly id: string;
1220
+ readonly name: string;
1221
+ readonly baseColorFactor: Native3DVec4;
1222
+ readonly metallicFactor: number;
1223
+ readonly roughnessFactor: number;
1224
+ readonly emissiveFactor: Native3DVec3;
1225
+ readonly alphaMode: 'opaque' | 'mask' | 'blend';
1226
+ readonly alphaCutoff?: number;
1227
+ readonly doubleSided: boolean;
1228
+ readonly baseColorTexture?: string;
1229
+ readonly normalTexture?: string;
1230
+ readonly metallicRoughnessTexture?: string;
1231
+ readonly emissiveTexture?: string;
1232
+ }
1233
+ type Native3DCameraProjection = Readonly<{
1234
+ kind: 'perspective';
1235
+ fovYRadians: number;
1236
+ near: number;
1237
+ far: number;
1238
+ }> | Readonly<{
1239
+ kind: 'orthographic';
1240
+ orthoHeight: number;
1241
+ near: number;
1242
+ far: number;
1243
+ }>;
1244
+ interface Native3DCameraComponent {
1245
+ readonly id: string;
1246
+ readonly kind: 'camera3d';
1247
+ readonly projection: Native3DCameraProjection;
1248
+ }
1249
+ interface Native3DPrimitiveComponent {
1250
+ readonly id: string;
1251
+ readonly kind: 'primitive3d';
1252
+ readonly primitive: 'box' | 'sphere' | 'plane' | 'cylinder' | 'cone';
1253
+ readonly materialId: string;
1254
+ }
1255
+ interface Native3DModelComponent {
1256
+ readonly id: string;
1257
+ readonly kind: 'model3d';
1258
+ readonly resource: string;
1259
+ readonly materialOverrides?: readonly Readonly<{
1260
+ slot: string;
1261
+ materialId: string;
1262
+ }>[];
1263
+ }
1264
+ interface Native3DParticleDescriptor {
1265
+ readonly maxParticles: number;
1266
+ readonly emissionRate: number;
1267
+ readonly burst: number;
1268
+ readonly duration: number;
1269
+ readonly loop: boolean;
1270
+ readonly seed: number;
1271
+ readonly lifetime: Native3DScalarRange;
1272
+ readonly speed: Native3DScalarRange;
1273
+ readonly direction: Native3DVec3;
1274
+ readonly spread: number;
1275
+ readonly gravity: Native3DVec3;
1276
+ readonly startSize: Native3DScalarRange;
1277
+ readonly endSize: Native3DScalarRange;
1278
+ readonly rotation: Native3DScalarRange;
1279
+ readonly angularVelocity: Native3DScalarRange;
1280
+ readonly startColor: Native3DVec4;
1281
+ readonly endColor: Native3DVec4;
1282
+ readonly shape: 'point' | 'box' | 'sphere';
1283
+ readonly shapeSize?: Native3DVec3;
1284
+ readonly shapeRadius?: number;
1285
+ readonly blendMode: 'normal' | 'additive';
1286
+ readonly textureResource?: string;
1287
+ readonly radial: boolean;
1288
+ readonly opacity: number;
1289
+ readonly depthTest: boolean;
1290
+ readonly depthWrite: boolean;
1291
+ readonly sortMode: 'none' | 'back-to-front';
1292
+ }
1293
+ interface Native3DParticleComponent {
1294
+ readonly id: string;
1295
+ readonly kind: 'particle3d';
1296
+ readonly descriptor: Native3DParticleDescriptor;
1297
+ }
1298
+ type Native3DComponent = Native3DCameraComponent | Native3DPrimitiveComponent | Native3DModelComponent | Native3DParticleComponent;
1299
+ interface Native3DNode {
1300
+ readonly id: string;
1301
+ readonly name: string;
1302
+ readonly parent?: string;
1303
+ readonly start?: number;
1304
+ readonly duration?: number;
1305
+ readonly transform: Native3DTransform;
1306
+ readonly components: readonly Native3DComponent[];
1307
+ }
1308
+ type Native3DBindingTarget = Readonly<{
1309
+ kind: 'node-id';
1310
+ nodeId: string;
1311
+ }> | Readonly<{
1312
+ kind: 'node-path';
1313
+ segments: readonly string[];
1314
+ }> | Readonly<{
1315
+ kind: 'slot';
1316
+ slot: string;
1317
+ }>;
1318
+ type Native3DBinding = Readonly<{
1319
+ id: string;
1320
+ target: Native3DBindingTarget;
1321
+ path: 'transform.translation';
1322
+ valueType: 'vec3';
1323
+ valueSize: 3;
1324
+ }> | Readonly<{
1325
+ id: string;
1326
+ target: Native3DBindingTarget;
1327
+ path: 'transform.rotation';
1328
+ valueType: 'quaternion';
1329
+ valueSize: 4;
1330
+ }> | Readonly<{
1331
+ id: string;
1332
+ target: Native3DBindingTarget;
1333
+ path: 'transform.scale';
1334
+ valueType: 'vec3';
1335
+ valueSize: 3;
1336
+ }> | Readonly<{
1337
+ id: string;
1338
+ target: Native3DBindingTarget;
1339
+ path: 'morph.weights';
1340
+ valueType: 'weights';
1341
+ valueSize: number;
1342
+ }> | Readonly<{
1343
+ id: string;
1344
+ target: Native3DBindingTarget;
1345
+ path: 'property';
1346
+ component: 'material3d' | 'camera3d';
1347
+ property: 'baseColorFactor' | 'metallicFactor' | 'roughnessFactor' | 'emissiveFactor' | 'alphaCutoff' | 'fovYRadians' | 'near' | 'far' | 'orthoHeight';
1348
+ valueType: 'scalar' | 'vec3' | 'vec4';
1349
+ valueSize: 1 | 3 | 4;
1350
+ }>;
1351
+ interface Native3DTrack {
1352
+ readonly id: string;
1353
+ readonly binding: Native3DBinding;
1354
+ readonly interpolation: 'step' | 'linear' | 'cubic-spline';
1355
+ readonly times: readonly number[];
1356
+ readonly values: readonly number[];
1357
+ }
1358
+ interface Native3DEvent {
1359
+ readonly id: string;
1360
+ readonly time: number;
1361
+ readonly name: string;
1362
+ readonly payload?: Readonly<Record<string, unknown>>;
1363
+ }
1364
+ interface Native3DClip {
1365
+ readonly format: typeof NATIVE_3D_CLIP_FORMAT;
1366
+ readonly id: string;
1367
+ readonly name: string;
1368
+ readonly duration: number;
1369
+ readonly tracks: readonly Native3DTrack[];
1370
+ readonly events: readonly Native3DEvent[];
1371
+ }
1372
+ type Native3DStateMachineParameter = Readonly<{
1373
+ name: string;
1374
+ type: 'float';
1375
+ defaultValue: number;
1376
+ }> | Readonly<{
1377
+ name: string;
1378
+ type: 'integer';
1379
+ defaultValue: number;
1380
+ }> | Readonly<{
1381
+ name: string;
1382
+ type: 'boolean';
1383
+ defaultValue: boolean;
1384
+ }> | Readonly<{
1385
+ name: string;
1386
+ type: 'trigger';
1387
+ }>;
1388
+ type Native3DStateMachineMotion = Readonly<{
1389
+ kind: 'clip';
1390
+ clipId: string;
1391
+ }> | Readonly<{
1392
+ kind: 'blend-1d';
1393
+ parameter: string;
1394
+ children: readonly Readonly<{
1395
+ threshold: number;
1396
+ motion: Native3DStateMachineMotion;
1397
+ }>[];
1398
+ }> | Readonly<{
1399
+ kind: 'blend-2d';
1400
+ algorithm: 'cartesian' | 'directional';
1401
+ parameterX: string;
1402
+ parameterY: string;
1403
+ children: readonly Readonly<{
1404
+ position: Native3DVec2;
1405
+ motion: Native3DStateMachineMotion;
1406
+ }>[];
1407
+ }>;
1408
+ interface Native3DStateMachineCondition {
1409
+ readonly parameter: string;
1410
+ readonly operator: 'greater' | 'greater-or-equal' | 'less' | 'less-or-equal' | 'equal' | 'not-equal' | 'is-true' | 'is-false' | 'triggered';
1411
+ readonly value?: number | boolean;
1412
+ }
1413
+ interface Native3DStateMachineState {
1414
+ readonly id: string;
1415
+ readonly name: string;
1416
+ readonly motion: Native3DStateMachineMotion;
1417
+ readonly speed?: number;
1418
+ readonly speedParameter?: string;
1419
+ readonly loop?: 'once' | 'repeat' | 'ping-pong';
1420
+ }
1421
+ interface Native3DStateMachineTransition {
1422
+ readonly id: string;
1423
+ readonly from: string;
1424
+ readonly to: string;
1425
+ readonly conditions: readonly Native3DStateMachineCondition[];
1426
+ readonly duration: number;
1427
+ readonly hasExitTime?: boolean;
1428
+ readonly exitTime?: number;
1429
+ readonly destinationOffset?: number;
1430
+ readonly interruption?: 'none' | 'source' | 'destination' | 'source-then-destination' | 'destination-then-source';
1431
+ }
1432
+ interface Native3DStateMachineLayer {
1433
+ readonly id: string;
1434
+ readonly name: string;
1435
+ readonly initialStateId: string;
1436
+ readonly states: readonly Native3DStateMachineState[];
1437
+ readonly transitions: readonly Native3DStateMachineTransition[];
1438
+ readonly blendMode?: 'override' | 'additive';
1439
+ readonly weight?: number;
1440
+ readonly mask?: Readonly<{
1441
+ include?: readonly string[];
1442
+ exclude?: readonly string[];
1443
+ }>;
1444
+ }
1445
+ interface Native3DStateMachine {
1446
+ readonly format: typeof NATIVE_3D_STATE_MACHINE_FORMAT;
1447
+ readonly id: string;
1448
+ readonly name: string;
1449
+ readonly parameters: readonly Native3DStateMachineParameter[];
1450
+ readonly layers: readonly Native3DStateMachineLayer[];
1451
+ }
1452
+ interface Native3DAnimationPayload {
1453
+ readonly format: typeof NATIVE_3D_ANIMATION_FORMAT;
1454
+ readonly mode: 'native-3d';
1455
+ readonly coordinateSystem: Native3DCoordinateSystem;
1456
+ readonly viewport: Native3DViewport;
1457
+ readonly materials: readonly Native3DMaterial[];
1458
+ readonly nodes: readonly Native3DNode[];
1459
+ readonly clips: readonly Native3DClip[];
1460
+ readonly stateMachine?: Native3DStateMachine | null;
1461
+ }
1462
+ interface Native3DParseLimits {
1463
+ readonly maxMaterials?: number;
1464
+ readonly maxClips?: number;
1465
+ readonly maxStateMachineDepth?: number;
1466
+ }
1467
+ interface Native3DAnimationParseOptions extends AnimationParseLimits, Native3DParseLimits {
1468
+ readonly copyFloatData?: boolean;
1469
+ }
1470
+ interface ParsedNative3DAnimation {
1471
+ readonly document: ParsedAnimation;
1472
+ readonly payload: Native3DAnimationPayload;
1473
+ readonly resources: readonly Readonly<AnimationResource>[];
1474
+ }
1475
+ type Native3DAnimationSource = AnimationSource | AnimationDocument;
1476
+
1477
+ type Native3DAnimationDiagnosticCode = 'E_ANIMATION_3D_INVALID_PAYLOAD' | 'E_ANIMATION_3D_MIXED_DIMENSIONS' | 'E_ANIMATION_3D_UNSUPPORTED_FEATURE' | 'E_ANIMATION_3D_UNKNOWN_RESOURCE' | 'E_ANIMATION_3D_BINDING_MISMATCH' | 'E_ANIMATION_3D_LIMIT_EXCEEDED';
1478
+ /** Stable native-3D extension diagnostic. */
1479
+ declare class Native3DAnimationFormatError extends Error {
1480
+ readonly code: Native3DAnimationDiagnosticCode;
1481
+ readonly path: string;
1482
+ readonly name = "Native3DAnimationFormatError";
1483
+ constructor(code: Native3DAnimationDiagnosticCode, message: string, path: string);
1484
+ }
1485
+
1486
+ declare function createNative3DAnimationExtensionHandler(options?: Native3DAnimationParseOptions, onValidated?: (payload: Native3DAnimationPayload) => void): AnimationExtensionHandler;
1487
+ /** Parses the required 3D extension and rejects mixed 2D/3D carriers. */
1488
+ declare function parseNative3DAnimation(source: Native3DAnimationSource, options?: Native3DAnimationParseOptions): ParsedNative3DAnimation;
1489
+ /** Validates and canonicalizes the extension before any runtime allocation. */
1490
+ declare function parseNative3DAnimationPayload(value: unknown, options?: Native3DAnimationParseOptions): Native3DAnimationPayload;
1491
+
1492
+ export { DEFORMABLE_MESH_2D_MAX_MASK_REFERENCES as $, CUBISM_CAPTURE_FRAME_OPERATIONS as C, CubismClipBakedAdapter as J, combineCubismCaptureClips as T, convertCubismCaptureToHya as U, listCubismModel3Motions as V, runCubismClipBakedConversion as W, sampleCubismMotion3 as X, DEFORMABLE_MESH_2D_DATA_FORMAT as Y, DEFORMABLE_MESH_2D_DATA_VERSION as Z, DEFORMABLE_MESH_2D_EXTENSION_ID as _, createDeformableMesh2DFormatHandler as a7, createDeformableMesh2DFormatRegistry as a8, decodeDeformableMesh2DData as a9, AnimationExtensionRegistry as aA, AnimationFormatError as aE, encodeDeformableMesh2DData as aa, isDeformableMesh2DBinary as ab, ANIMATION_FILE_EXTENSION as ac, ANIMATION_FORMAT as ad, ANIMATION_MIME_TYPE as ae, ANIMATION_VECTOR_SHAPE_EXTENSION_ID as af, ANIMATION_VERSION as ag, extensionIdFromComponentType as bA, hyaStateMachineChannelCapability as bB, isAnimationBinary as bC, parseAnimation as bD, parseHyaStateMachineExtension as bE, safeExpressionDataResources as bF, validateExtensionId as bG, convertLottie as bN, convertLottieDocument as bO, inspectLottieFonts as bP, NATIVE_3D_ANIMATION_EXTENSION_ID as bQ, NATIVE_3D_ANIMATION_FORMAT as bR, NATIVE_3D_CLIP_FORMAT as bS, NATIVE_3D_STATE_MACHINE_FORMAT as bT, Native3DAnimationFormatError as bV, HYA_SAFE_EXPRESSION_VERSION as bc, HYA_STATE_MACHINE_CHANNEL_REGISTRY as bd, HYA_STATE_MACHINE_EXTENSION_ID as be, decodeAnimationBinary as bx, encodeAnimationBinary as by, evaluateSafeExpression as bz, createNative3DAnimationExtensionHandler as cs, parseNative3DAnimation as ct, parseNative3DAnimationPayload as cu, OfflineConversionError as f, runOfflineConversion as r, stableStringify as s, CUBISM_CLIP_BAKED_UPDATE_ORDER as t, CUBISM_DRAWABLE_CAPTURE_FORMAT as u, CUBISM_DRAWABLE_CAPTURE_VERSION as v, CubismCaptureConversionError as z };
1493
+ export type { CubismCaptureConversionOptions as A, CubismCaptureConversionResult as B, CubismCaptureDiagnostic as D, CubismCaptureFrame as E, CubismCaptureSet as F, CubismCaptureSetOptions as G, CubismCaptureTexture as H, CubismCapturedDrawable as I, CubismClipBakedConversionOptions as K, CubismClipBakedRecipe as L, CubismClipBakedSource as M, CubismDrawableCapture as N, OfflineConversionAdapter as O, CubismModel3MotionReference as P, CubismMotion3 as Q, CubismMotion3Curve as R, CubismMotion3Sample as S, OfflineConversionAdapterContext as a, AnimationTextSelectorShape as a$, DeformableMesh2DBlendMode as a0, DeformableMesh2DComponent as a1, DeformableMesh2DDataSource as a2, DeformableMesh2DDrawableSource as a3, DeformableMesh2DParseLimits as a4, ParsedDeformableMesh2DData as a5, ParsedDeformableMesh2DDrawable as a6, AnimationExtensionValidationContext as aB, AnimationFillEffect as aC, AnimationFillRule as aD, AnimationFormatErrorCode as aF, AnimationImageResource as aG, AnimationInterpolation as aH, AnimationLayerEffect as aI, AnimationNode as aJ, AnimationOpacityEffect as aK, AnimationParseLimits as aL, AnimationParseOptions as aM, AnimationParticle2DComponent as aN, AnimationPath2DComponent as aO, AnimationPathCommand as aP, AnimationResource as aQ, AnimationSafeExpressionContext as aR, AnimationSafeExpressionInstruction as aS, AnimationSafeExpressionProgram as aT, AnimationShape2DComponent as aU, AnimationSource as aV, AnimationSprite2DComponent as aW, AnimationText2DComponent as aX, AnimationTextAnimator as aY, AnimationTextDocumentKeyframe as aZ, AnimationTextRangeSelector as a_, AnimationAudioComponent as ah, AnimationAudioResource as ai, AnimationBinaryResource as aj, AnimationBlurEffect as ak, AnimationCanvas as al, AnimationColorMatrixEffect as am, AnimationComponent as an, AnimationComposite as ao, AnimationCompositeKind as ap, AnimationCompositeLayer as aq, AnimationCompositeMode as ar, AnimationCompositeOperation as as, AnimationCompositeStack as at, AnimationCoordinateSystem as au, AnimationDocument as av, AnimationDropShadowEffect as aw, AnimationEndBehavior as ax, AnimationExtensionComponent as ay, AnimationExtensionHandler as az, OfflineConversionArtifact as b, Native3DCameraComponent as b$, AnimationTextSelectorUnits as b0, AnimationTextStyleRun as b1, AnimationTintEffect as b2, AnimationTrack as b3, AnimationTrackProperty as b4, AnimationTransform2D as b5, AnimationVectorFeather as b6, AnimationVectorGradientPaint as b7, AnimationVectorShapeComponent as b8, AnimationVectorSolidPaint as b9, LottieConversionDiagnostic as bH, LottieConversionOptions as bI, LottieConversionResult as bJ, LottieFontMetrics as bK, LottieFontRequirement as bL, LottieWebFontMapping as bM, Native3DAnimationDiagnosticCode as bU, Native3DAnimationParseOptions as bW, Native3DAnimationPayload as bX, Native3DAnimationSource as bY, Native3DBinding as bZ, Native3DBindingTarget as b_, AnimationVectorStrokePaint as ba, AnimationVectorValueTrack as bb, HyaAnimationClipRange as bf, HyaStateMachineBindingMask as bg, HyaStateMachineBlendMode as bh, HyaStateMachineChannelCapability as bi, HyaStateMachineChannelId as bj, HyaStateMachineChannelKind as bk, HyaStateMachineChannelSupport as bl, HyaStateMachineCondition as bm, HyaStateMachineDefinition as bn, HyaStateMachineExtension as bo, HyaStateMachineLayer as bp, HyaStateMachineLoopMode as bq, HyaStateMachineMotion as br, HyaStateMachineParameter as bs, HyaStateMachineState as bt, HyaStateMachineTransition as bu, ParsedAnimation as bv, ParsedAnimationTrack as bw, OfflineConversionAssetRequest as c, Native3DCameraProjection as c0, Native3DClip as c1, Native3DComponent as c2, Native3DCoordinateSystem as c3, Native3DEvent as c4, Native3DMaterial as c5, Native3DModelComponent as c6, Native3DNode as c7, Native3DParseLimits as c8, Native3DParticleComponent as c9, Native3DParticleDescriptor as ca, Native3DPrimitiveComponent as cb, Native3DQuaternion as cc, Native3DScalarRange as cd, Native3DStateMachine as ce, Native3DStateMachineCondition as cf, Native3DStateMachineLayer as cg, Native3DStateMachineMotion as ch, Native3DStateMachineParameter as ci, Native3DStateMachineState as cj, Native3DStateMachineTransition as ck, Native3DTrack as cl, Native3DTransform as cm, Native3DVec2 as cn, Native3DVec3 as co, Native3DVec4 as cp, Native3DViewport as cq, ParsedNative3DAnimation as cr, OfflineConversionDiagnostic as d, OfflineConversionEncodeInput as e, OfflineConversionFrameOperations as g, OfflineConversionHost as h, OfflineConversionMode as i, OfflineConversionPipelineOptions as j, OfflineConversionPipelineResult as k, OfflineConversionRecipe as l, OfflineConversionReport as m, OfflineConversionResolvedAsset as n, OfflineConversionSamplingOptions as o, OfflineConversionSession as p, OfflineConversionTransaction as q, CubismBuildTimeEvaluator as w, CubismCaptureClipInput as x, CubismCaptureClipRange as y };