@haiyue/animation-spec 0.1.0 → 0.2.2
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.
- package/README.md +40 -6
- package/SPECIFICATION.md +12 -2
- package/bin/hya-live2d-convert.mjs +76 -0
- package/bin/{hya-convert.mjs → hya-lottie-convert.mjs} +1 -1
- package/dist/chunks/binary-DvuTJ_hy.js +1 -0
- package/dist/chunks/clip-baked-Dv-wjX9d.js +1 -0
- package/dist/chunks/errors-Bzs3GOD9.js +1 -0
- package/dist/chunks/expression-D1cKtNwM.js +1 -0
- package/dist/chunks/extensions-DxL4AxOC.js +1 -0
- package/dist/conversion.d.ts +1 -0
- package/dist/conversion.js +1 -0
- package/dist/cubism.d.ts +1 -0
- package/dist/cubism.js +1 -0
- package/dist/deformable2d.d.ts +1 -0
- package/dist/deformable2d.js +1 -0
- package/dist/hya-production.d.ts +1 -0
- package/dist/hya-production.js +1 -0
- package/dist/index.d.ts +1 -10
- package/dist/index.js +1 -2927
- package/dist/live2d/clip-baked.d.ts +1 -0
- package/dist/live2d/clip-baked.js +1 -0
- package/dist/live2d.d.ts +1 -0
- package/dist/live2d.js +1 -0
- package/dist/lottie.d.ts +1 -62
- package/dist/lottie.js +1 -2642
- package/dist/native3d.d.ts +1 -2
- package/dist/native3d.js +1 -907
- package/dist/shared.d.ts +2791 -0
- package/package.json +93 -69
- package/schema/animation.schema.json +104 -12
- package/schema/deformable-mesh-2d-extension.schema.json +18 -0
- package/schema/deformable-mesh-2d.contract.json +58 -0
- package/schema/hya-composition.schema.json +41 -0
- package/schema/parameterized-rig-2d.contract.json +63 -0
- package/schema/parameterized-rig-2d.schema.json +57 -0
- package/schema/parameterized-rig-census-map.json +128 -0
- package/schema/responsive-layout-2d-census-map.json +49 -0
- package/schema/responsive-layout-2d.contract.json +58 -0
- package/schema/responsive-layout-2d.schema.json +34 -0
- package/schema/state-machine-v2-census-map.json +1 -0
- package/schema/state-machine-v2.contract.json +66 -0
- package/schema/state-machine-v2.schema.json +55 -0
- package/schema/vector-visual-census-map.json +120 -0
- package/schema/vector-visual.contract.json +47 -0
- package/schema/vector-visual.schema.json +72 -0
- package/dist/binary.d.ts +0 -7
- package/dist/chunks/types-l6nBVYwx.js +0 -8
- package/dist/chunks/types-l6nBVYwx.js.map +0 -1
- package/dist/errors.d.ts +0 -7
- package/dist/extensions.d.ts +0 -19
- package/dist/index.js.map +0 -1
- package/dist/lottie-merge-path.d.ts +0 -11
- package/dist/lottie.js.map +0 -1
- package/dist/native3d/Animation3DError.d.ts +0 -8
- package/dist/native3d/Animation3DParser.d.ts +0 -7
- package/dist/native3d/Animation3DTypes.d.ts +0 -285
- package/dist/native3d/index.d.ts +0 -5
- package/dist/native3d.js.map +0 -1
- package/dist/parser.d.ts +0 -2
- package/dist/state-machine.d.ts +0 -130
- package/dist/text-selector.d.ts +0 -2
- package/dist/types.d.ts +0 -419
- package/dist/validation.d.ts +0 -32
- package/src/binary.ts +0 -1441
- package/src/errors.ts +0 -18
- package/src/extensions.ts +0 -55
- package/src/index.ts +0 -90
- package/src/lottie-merge-path.ts +0 -204
- package/src/lottie.ts +0 -3073
- package/src/native3d/Animation3DError.ts +0 -20
- package/src/native3d/Animation3DParser.ts +0 -964
- package/src/native3d/Animation3DTypes.ts +0 -322
- package/src/native3d/index.ts +0 -14
- package/src/native3d.ts +0 -2
- package/src/parser.ts +0 -41
- package/src/state-machine.ts +0 -645
- package/src/text-selector.ts +0 -7
- package/src/types.ts +0 -483
- package/src/validation.ts +0 -1286
- package/test/fixtures/basic-lottie.json +0 -31
package/dist/shared.d.ts
ADDED
|
@@ -0,0 +1,2791 @@
|
|
|
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
|
+
declare const HYA_COMPOSITION_FORMAT: "haiyue-composition";
|
|
985
|
+
declare const HYA_COMPOSITION_VERSION: 1;
|
|
986
|
+
type HyaCompositionValue = null | boolean | number | string | readonly HyaCompositionValue[] | {
|
|
987
|
+
readonly [key: string]: HyaCompositionValue;
|
|
988
|
+
};
|
|
989
|
+
interface HyaCompositionPart {
|
|
990
|
+
readonly id: string;
|
|
991
|
+
readonly extension: string;
|
|
992
|
+
readonly required: boolean;
|
|
993
|
+
readonly requires: readonly string[];
|
|
994
|
+
readonly dependencies: readonly string[];
|
|
995
|
+
readonly document: HyaCompositionValue;
|
|
996
|
+
}
|
|
997
|
+
interface HyaCompositionTarget {
|
|
998
|
+
readonly id: string;
|
|
999
|
+
readonly part: string;
|
|
1000
|
+
readonly kind: 'animation-node' | 'layout-node' | 'text-block' | 'asset' | 'state-input' | 'interaction-target' | 'semantic-node' | 'audio-cue';
|
|
1001
|
+
readonly address: readonly string[];
|
|
1002
|
+
}
|
|
1003
|
+
interface HyaCompositionDocument {
|
|
1004
|
+
readonly format: typeof HYA_COMPOSITION_FORMAT;
|
|
1005
|
+
readonly version: typeof HYA_COMPOSITION_VERSION;
|
|
1006
|
+
readonly parts: readonly HyaCompositionPart[];
|
|
1007
|
+
readonly targets: readonly HyaCompositionTarget[];
|
|
1008
|
+
}
|
|
1009
|
+
interface HyaCompositionLimits {
|
|
1010
|
+
readonly maxInputBytes: number;
|
|
1011
|
+
readonly maxJsonNodes: number;
|
|
1012
|
+
readonly maxDepth: number;
|
|
1013
|
+
readonly maxStringBytes: number;
|
|
1014
|
+
readonly maxParts: number;
|
|
1015
|
+
readonly maxTargets: number;
|
|
1016
|
+
readonly maxRequirementsPerPart: number;
|
|
1017
|
+
}
|
|
1018
|
+
type HyaCompositionPartValidator = (document: HyaCompositionValue) => void;
|
|
1019
|
+
interface HyaCompositionParseOptions {
|
|
1020
|
+
/** Strict is the default; only explicitly optional parts may be skipped otherwise. */
|
|
1021
|
+
readonly strict?: boolean;
|
|
1022
|
+
readonly limits?: Partial<HyaCompositionLimits>;
|
|
1023
|
+
/** Trusted application registrations; never deserialized from the document. */
|
|
1024
|
+
readonly validators?: ReadonlyMap<string, HyaCompositionPartValidator>;
|
|
1025
|
+
/** Reuse the existing core required-extension registry without replacing its parser. */
|
|
1026
|
+
readonly coreExtensions?: AnimationExtensionRegistry;
|
|
1027
|
+
}
|
|
1028
|
+
interface HyaCompositionDiagnostic {
|
|
1029
|
+
readonly code: 'W_HYA_COMPOSITION_OPTIONAL_SKIPPED';
|
|
1030
|
+
readonly path: string;
|
|
1031
|
+
readonly capability: string;
|
|
1032
|
+
readonly part: string;
|
|
1033
|
+
}
|
|
1034
|
+
interface HyaCompositionParseResult {
|
|
1035
|
+
readonly document: HyaCompositionDocument;
|
|
1036
|
+
readonly diagnostics: readonly HyaCompositionDiagnostic[];
|
|
1037
|
+
}
|
|
1038
|
+
interface HyaCompositionPlan {
|
|
1039
|
+
readonly document: HyaCompositionDocument;
|
|
1040
|
+
readonly activeParts: readonly string[];
|
|
1041
|
+
readonly targets: readonly HyaCompositionTarget[];
|
|
1042
|
+
readonly diagnostics: readonly HyaCompositionDiagnostic[];
|
|
1043
|
+
readonly complete: boolean;
|
|
1044
|
+
}
|
|
1045
|
+
type HyaCompositionErrorCode = 'E_HYA_COMPOSITION_FORMAT' | 'E_HYA_COMPOSITION_VERSION' | 'E_HYA_COMPOSITION_LIMIT' | 'E_HYA_COMPOSITION_REQUIRED' | 'E_HYA_COMPOSITION_OPTIONAL' | 'E_HYA_COMPOSITION_CAPABILITY' | 'E_HYA_COMPOSITION_REFERENCE' | 'E_HYA_COMPOSITION_GRAPH' | 'E_HYA_COMPOSITION_PART';
|
|
1046
|
+
declare const DEFAULT_HYA_COMPOSITION_LIMITS: HyaCompositionLimits;
|
|
1047
|
+
|
|
1048
|
+
declare class HyaCompositionError extends Error {
|
|
1049
|
+
readonly code: HyaCompositionErrorCode;
|
|
1050
|
+
readonly path: string;
|
|
1051
|
+
readonly capability?: string | undefined;
|
|
1052
|
+
readonly causeCode?: string | undefined;
|
|
1053
|
+
readonly name = "HyaCompositionError";
|
|
1054
|
+
constructor(code: HyaCompositionErrorCode, path: string, message: string, capability?: string | undefined, causeCode?: string | undefined);
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
declare function parseHyaComposition(source: unknown, options?: HyaCompositionParseOptions): HyaCompositionParseResult;
|
|
1058
|
+
/** Deterministic JSON is a new envelope codec, not a replacement HYA/HYLA binary container. */
|
|
1059
|
+
declare function encodeHyaComposition(source: unknown, options?: HyaCompositionParseOptions): Uint8Array;
|
|
1060
|
+
declare function negotiateHyaComposition(source: unknown, capabilities: ReadonlySet<string>, options?: HyaCompositionParseOptions): HyaCompositionPlan;
|
|
1061
|
+
|
|
1062
|
+
declare const TEXT_SHAPING_STACK: "haiyue-text-shaping@1";
|
|
1063
|
+
type TextDirection = 'auto' | 'ltr' | 'rtl';
|
|
1064
|
+
type TextAlignment = 'start' | 'center' | 'end' | 'justify';
|
|
1065
|
+
type TextVerticalAlignment = 'top' | 'middle' | 'bottom' | 'baseline';
|
|
1066
|
+
type TextColor = readonly [number, number, number, number];
|
|
1067
|
+
type TextPaintSource = {
|
|
1068
|
+
readonly kind: 'solid';
|
|
1069
|
+
readonly color: TextColor;
|
|
1070
|
+
} | {
|
|
1071
|
+
readonly kind: 'linear-gradient';
|
|
1072
|
+
readonly start: readonly [number, number];
|
|
1073
|
+
readonly end: readonly [number, number];
|
|
1074
|
+
readonly stops: readonly {
|
|
1075
|
+
readonly offset: number;
|
|
1076
|
+
readonly color: TextColor;
|
|
1077
|
+
}[];
|
|
1078
|
+
} | {
|
|
1079
|
+
readonly kind: 'radial-gradient';
|
|
1080
|
+
readonly center: readonly [number, number];
|
|
1081
|
+
readonly radius: number;
|
|
1082
|
+
readonly stops: readonly {
|
|
1083
|
+
readonly offset: number;
|
|
1084
|
+
readonly color: TextColor;
|
|
1085
|
+
}[];
|
|
1086
|
+
};
|
|
1087
|
+
interface TextFill {
|
|
1088
|
+
readonly source: TextPaintSource;
|
|
1089
|
+
readonly opacity?: number;
|
|
1090
|
+
}
|
|
1091
|
+
interface TextStroke {
|
|
1092
|
+
readonly source: TextPaintSource;
|
|
1093
|
+
readonly width: number;
|
|
1094
|
+
readonly opacity?: number;
|
|
1095
|
+
readonly join?: 'miter' | 'round' | 'bevel';
|
|
1096
|
+
}
|
|
1097
|
+
interface TextStyleDefinition {
|
|
1098
|
+
readonly id: string;
|
|
1099
|
+
readonly fontAssets: readonly string[];
|
|
1100
|
+
readonly fontFamily: string;
|
|
1101
|
+
readonly fontWeight: number;
|
|
1102
|
+
readonly fontStyle: 'normal' | 'italic';
|
|
1103
|
+
readonly fontSize: number;
|
|
1104
|
+
readonly lineHeight: number;
|
|
1105
|
+
readonly tracking: number;
|
|
1106
|
+
readonly alignment: TextAlignment;
|
|
1107
|
+
readonly verticalAlignment?: TextVerticalAlignment;
|
|
1108
|
+
readonly direction?: TextDirection;
|
|
1109
|
+
readonly language?: string;
|
|
1110
|
+
readonly script?: string;
|
|
1111
|
+
readonly axes?: Readonly<Record<string, number>>;
|
|
1112
|
+
readonly features?: Readonly<Record<string, boolean | number>>;
|
|
1113
|
+
readonly fills: readonly TextFill[];
|
|
1114
|
+
readonly strokes?: readonly TextStroke[];
|
|
1115
|
+
readonly background?: {
|
|
1116
|
+
readonly color: TextColor;
|
|
1117
|
+
readonly cornerRadius?: number;
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
interface TextRunDefinition {
|
|
1121
|
+
readonly id: string;
|
|
1122
|
+
readonly style: string;
|
|
1123
|
+
readonly text: string;
|
|
1124
|
+
readonly valuePort?: string;
|
|
1125
|
+
}
|
|
1126
|
+
interface TextModifierRange {
|
|
1127
|
+
readonly start: number;
|
|
1128
|
+
readonly end: number;
|
|
1129
|
+
readonly units: 'grapheme' | 'word' | 'line' | 'percent';
|
|
1130
|
+
readonly falloffFrom?: number;
|
|
1131
|
+
readonly falloffTo?: number;
|
|
1132
|
+
readonly increment?: number;
|
|
1133
|
+
readonly offset?: number;
|
|
1134
|
+
readonly mode?: 'clamp' | 'repeat' | 'mirror';
|
|
1135
|
+
readonly strength?: number;
|
|
1136
|
+
}
|
|
1137
|
+
interface TextTransformModifier {
|
|
1138
|
+
readonly kind: 'transform';
|
|
1139
|
+
readonly range: TextModifierRange;
|
|
1140
|
+
readonly translation?: readonly [number, number];
|
|
1141
|
+
readonly scale?: readonly [number, number];
|
|
1142
|
+
readonly rotation?: number;
|
|
1143
|
+
readonly origin?: readonly [number, number];
|
|
1144
|
+
readonly opacity?: number;
|
|
1145
|
+
readonly variables?: Readonly<Record<string, number>>;
|
|
1146
|
+
}
|
|
1147
|
+
interface TextFollowPathModifier {
|
|
1148
|
+
readonly kind: 'follow-path';
|
|
1149
|
+
readonly range: TextModifierRange;
|
|
1150
|
+
readonly points: readonly number[];
|
|
1151
|
+
readonly radial?: boolean;
|
|
1152
|
+
readonly orient?: boolean;
|
|
1153
|
+
readonly start?: number;
|
|
1154
|
+
readonly end?: number;
|
|
1155
|
+
readonly offset?: number;
|
|
1156
|
+
}
|
|
1157
|
+
type TextModifier = TextTransformModifier | TextFollowPathModifier;
|
|
1158
|
+
interface TextBlockDefinition {
|
|
1159
|
+
readonly id: string;
|
|
1160
|
+
readonly runs: readonly TextRunDefinition[];
|
|
1161
|
+
readonly width: number;
|
|
1162
|
+
readonly height: number;
|
|
1163
|
+
readonly wrap?: 'none' | 'word' | 'grapheme';
|
|
1164
|
+
readonly overflow?: 'visible' | 'clip' | 'ellipsis';
|
|
1165
|
+
readonly paragraphSpacing?: number;
|
|
1166
|
+
readonly origin?: readonly [number, number];
|
|
1167
|
+
readonly verticalTrim?: {
|
|
1168
|
+
readonly top: number;
|
|
1169
|
+
readonly bottom: number;
|
|
1170
|
+
};
|
|
1171
|
+
readonly modifiers?: readonly TextModifier[];
|
|
1172
|
+
readonly input?: {
|
|
1173
|
+
readonly valuePort: string;
|
|
1174
|
+
readonly selectionPort?: string;
|
|
1175
|
+
readonly cursorPort?: string;
|
|
1176
|
+
readonly multiline?: boolean;
|
|
1177
|
+
readonly selectionRadius?: number;
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
interface TextShapingContract {
|
|
1181
|
+
readonly stack: typeof TEXT_SHAPING_STACK;
|
|
1182
|
+
readonly backendRevision: string;
|
|
1183
|
+
readonly unicodeVersion: string;
|
|
1184
|
+
readonly graphemeRevision: string;
|
|
1185
|
+
readonly bidiRevision: string;
|
|
1186
|
+
}
|
|
1187
|
+
interface CompiledGlyphMetric {
|
|
1188
|
+
readonly glyphId: number;
|
|
1189
|
+
readonly advance: number;
|
|
1190
|
+
readonly bounds: readonly [number, number, number, number];
|
|
1191
|
+
readonly axisAdvance?: Readonly<Record<string, number>>;
|
|
1192
|
+
}
|
|
1193
|
+
interface CompiledFontMetrics {
|
|
1194
|
+
readonly unitsPerEm: number;
|
|
1195
|
+
readonly ascent: number;
|
|
1196
|
+
readonly descent: number;
|
|
1197
|
+
readonly lineGap: number;
|
|
1198
|
+
readonly missingGlyph: CompiledGlyphMetric;
|
|
1199
|
+
readonly glyphs: Readonly<Record<string, CompiledGlyphMetric>>;
|
|
1200
|
+
readonly ligatures?: Readonly<Record<string, CompiledGlyphMetric>>;
|
|
1201
|
+
readonly kerning?: Readonly<Record<string, number>>;
|
|
1202
|
+
readonly axes?: Readonly<Record<string, {
|
|
1203
|
+
readonly min: number;
|
|
1204
|
+
readonly default: number;
|
|
1205
|
+
readonly max: number;
|
|
1206
|
+
}>>;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
declare const LAYOUT_EXTENSION_ID: "org.haiyue.layout-2d@1";
|
|
1210
|
+
declare const LAYOUT_FORMAT: "haiyue-responsive-layout-2d";
|
|
1211
|
+
declare const LAYOUT_VERSION: 1;
|
|
1212
|
+
type LayoutLength = {
|
|
1213
|
+
readonly unit: 'point' | 'percent' | 'fraction';
|
|
1214
|
+
readonly value: number;
|
|
1215
|
+
} | {
|
|
1216
|
+
readonly unit: 'hug' | 'fill';
|
|
1217
|
+
};
|
|
1218
|
+
type LayoutEdge = readonly [LayoutLength, LayoutLength, LayoutLength, LayoutLength];
|
|
1219
|
+
type LayoutColor = readonly [number, number, number, number];
|
|
1220
|
+
interface LayoutLimits {
|
|
1221
|
+
readonly maxInputBytes: number;
|
|
1222
|
+
readonly maxMetadataBytes: number;
|
|
1223
|
+
readonly maxAssets: number;
|
|
1224
|
+
readonly maxAssetBytes: number;
|
|
1225
|
+
readonly maxTotalAssetBytes: number;
|
|
1226
|
+
readonly maxArtboards: number;
|
|
1227
|
+
readonly maxNodes: number;
|
|
1228
|
+
readonly maxTextBytes: number;
|
|
1229
|
+
readonly maxGlyphs: number;
|
|
1230
|
+
readonly maxLines: number;
|
|
1231
|
+
readonly maxLayoutPasses: number;
|
|
1232
|
+
readonly maxNestedDepth: number;
|
|
1233
|
+
readonly maxComponentInstances: number;
|
|
1234
|
+
readonly maxListItems: number;
|
|
1235
|
+
readonly maxVirtualizedWindow: number;
|
|
1236
|
+
readonly maxNslicePatches: number;
|
|
1237
|
+
readonly maxGpuBytes: number;
|
|
1238
|
+
}
|
|
1239
|
+
type LayoutAssetSource = {
|
|
1240
|
+
readonly kind: 'embedded';
|
|
1241
|
+
readonly data: readonly number[] | Uint8Array;
|
|
1242
|
+
readonly integrity: string;
|
|
1243
|
+
} | {
|
|
1244
|
+
readonly kind: 'referenced';
|
|
1245
|
+
readonly uri: string;
|
|
1246
|
+
readonly integrity: string;
|
|
1247
|
+
} | {
|
|
1248
|
+
readonly kind: 'hosted';
|
|
1249
|
+
readonly slot: string;
|
|
1250
|
+
readonly fallbackAsset?: string;
|
|
1251
|
+
readonly integrity?: string;
|
|
1252
|
+
};
|
|
1253
|
+
interface LayoutAssetBase {
|
|
1254
|
+
readonly id: string;
|
|
1255
|
+
readonly name?: string;
|
|
1256
|
+
readonly mimeType?: string;
|
|
1257
|
+
readonly source?: LayoutAssetSource;
|
|
1258
|
+
}
|
|
1259
|
+
interface LayoutFolderAsset extends LayoutAssetBase {
|
|
1260
|
+
readonly kind: 'folder';
|
|
1261
|
+
readonly children: readonly string[];
|
|
1262
|
+
}
|
|
1263
|
+
interface LayoutImageAsset extends LayoutAssetBase {
|
|
1264
|
+
readonly kind: 'image';
|
|
1265
|
+
readonly source: LayoutAssetSource;
|
|
1266
|
+
readonly width: number;
|
|
1267
|
+
readonly height: number;
|
|
1268
|
+
readonly filter?: 'nearest' | 'linear';
|
|
1269
|
+
readonly wrapX?: 'clamp' | 'repeat' | 'mirror';
|
|
1270
|
+
readonly wrapY?: 'clamp' | 'repeat' | 'mirror';
|
|
1271
|
+
}
|
|
1272
|
+
interface LayoutFontAsset extends LayoutAssetBase {
|
|
1273
|
+
readonly kind: 'font';
|
|
1274
|
+
readonly source: LayoutAssetSource;
|
|
1275
|
+
readonly family: string;
|
|
1276
|
+
readonly weight: number;
|
|
1277
|
+
readonly style: 'normal' | 'italic';
|
|
1278
|
+
readonly metrics: CompiledFontMetrics;
|
|
1279
|
+
}
|
|
1280
|
+
interface LayoutAudioAsset extends LayoutAssetBase {
|
|
1281
|
+
readonly kind: 'audio';
|
|
1282
|
+
readonly source: LayoutAssetSource;
|
|
1283
|
+
readonly duration: number;
|
|
1284
|
+
readonly sampleRate: number;
|
|
1285
|
+
readonly channels: number;
|
|
1286
|
+
}
|
|
1287
|
+
interface LayoutBlobAsset extends LayoutAssetBase {
|
|
1288
|
+
readonly kind: 'blob';
|
|
1289
|
+
readonly source: LayoutAssetSource;
|
|
1290
|
+
readonly signature?: string;
|
|
1291
|
+
}
|
|
1292
|
+
interface LayoutManifestAsset extends LayoutAssetBase {
|
|
1293
|
+
readonly kind: 'manifest';
|
|
1294
|
+
readonly source: LayoutAssetSource;
|
|
1295
|
+
readonly entries: Readonly<Record<string, string>>;
|
|
1296
|
+
}
|
|
1297
|
+
interface LayoutTextAsset extends LayoutAssetBase {
|
|
1298
|
+
readonly kind: 'text';
|
|
1299
|
+
readonly source: LayoutAssetSource;
|
|
1300
|
+
readonly folderPath?: string;
|
|
1301
|
+
readonly encoding?: 'utf-8';
|
|
1302
|
+
}
|
|
1303
|
+
type LayoutAsset = LayoutFolderAsset | LayoutImageAsset | LayoutFontAsset | LayoutAudioAsset | LayoutBlobAsset | LayoutManifestAsset | LayoutTextAsset;
|
|
1304
|
+
interface LayoutVisualStyle {
|
|
1305
|
+
readonly opacity?: number;
|
|
1306
|
+
readonly background?: LayoutColor;
|
|
1307
|
+
readonly borderColor?: LayoutColor;
|
|
1308
|
+
readonly borderWidth?: readonly [number, number, number, number];
|
|
1309
|
+
readonly cornerRadius?: readonly [number, number, number, number];
|
|
1310
|
+
readonly clip?: boolean;
|
|
1311
|
+
}
|
|
1312
|
+
interface LayoutGridTrack {
|
|
1313
|
+
readonly min: LayoutLength;
|
|
1314
|
+
readonly max?: LayoutLength;
|
|
1315
|
+
}
|
|
1316
|
+
interface LayoutGridPlacement {
|
|
1317
|
+
readonly column: number;
|
|
1318
|
+
readonly row: number;
|
|
1319
|
+
readonly columnSpan?: number;
|
|
1320
|
+
readonly rowSpan?: number;
|
|
1321
|
+
}
|
|
1322
|
+
interface LayoutStyle {
|
|
1323
|
+
readonly display?: 'flex' | 'grid' | 'none';
|
|
1324
|
+
readonly position?: 'relative' | 'absolute';
|
|
1325
|
+
readonly direction?: 'row' | 'column';
|
|
1326
|
+
readonly writingDirection?: 'ltr' | 'rtl';
|
|
1327
|
+
readonly wrap?: boolean;
|
|
1328
|
+
readonly width?: LayoutLength;
|
|
1329
|
+
readonly height?: LayoutLength;
|
|
1330
|
+
readonly minWidth?: LayoutLength;
|
|
1331
|
+
readonly maxWidth?: LayoutLength;
|
|
1332
|
+
readonly minHeight?: LayoutLength;
|
|
1333
|
+
readonly maxHeight?: LayoutLength;
|
|
1334
|
+
readonly aspectRatio?: number;
|
|
1335
|
+
readonly margin?: LayoutEdge;
|
|
1336
|
+
readonly padding?: LayoutEdge;
|
|
1337
|
+
readonly inset?: LayoutEdge;
|
|
1338
|
+
readonly gap?: readonly [LayoutLength, LayoutLength];
|
|
1339
|
+
readonly justify?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
1340
|
+
readonly align?: 'start' | 'center' | 'end' | 'stretch';
|
|
1341
|
+
readonly justifySelf?: 'auto' | 'start' | 'center' | 'end' | 'stretch';
|
|
1342
|
+
readonly overflow?: 'visible' | 'hidden' | 'scroll';
|
|
1343
|
+
readonly gridColumns?: readonly LayoutGridTrack[];
|
|
1344
|
+
readonly gridRows?: readonly LayoutGridTrack[];
|
|
1345
|
+
readonly gridPlacement?: LayoutGridPlacement;
|
|
1346
|
+
readonly reflow?: {
|
|
1347
|
+
readonly duration: number;
|
|
1348
|
+
readonly easing: readonly [number, number, number, number];
|
|
1349
|
+
};
|
|
1350
|
+
}
|
|
1351
|
+
interface LayoutScrollDefinition {
|
|
1352
|
+
readonly axis: 'x' | 'y' | 'both';
|
|
1353
|
+
readonly mode?: 'clamped' | 'elastic' | 'infinite';
|
|
1354
|
+
readonly snap?: number;
|
|
1355
|
+
readonly friction?: number;
|
|
1356
|
+
readonly elasticity?: number;
|
|
1357
|
+
readonly scrollbar?: {
|
|
1358
|
+
readonly node: string;
|
|
1359
|
+
readonly autoSize?: boolean;
|
|
1360
|
+
};
|
|
1361
|
+
}
|
|
1362
|
+
interface LayoutListDefinition {
|
|
1363
|
+
readonly dataPort: string;
|
|
1364
|
+
readonly templateArtboard: string;
|
|
1365
|
+
readonly direction: 'row' | 'column';
|
|
1366
|
+
readonly itemExtent: number;
|
|
1367
|
+
readonly gap?: number;
|
|
1368
|
+
readonly virtualize?: boolean;
|
|
1369
|
+
readonly buffer?: number;
|
|
1370
|
+
readonly carousel?: boolean;
|
|
1371
|
+
}
|
|
1372
|
+
interface LayoutNSliceDefinition {
|
|
1373
|
+
readonly source: {
|
|
1374
|
+
readonly kind: 'asset';
|
|
1375
|
+
readonly asset: string;
|
|
1376
|
+
} | {
|
|
1377
|
+
readonly kind: 'node';
|
|
1378
|
+
readonly node: string;
|
|
1379
|
+
};
|
|
1380
|
+
readonly sourceSize: readonly [number, number];
|
|
1381
|
+
readonly xCuts: readonly number[];
|
|
1382
|
+
readonly yCuts: readonly number[];
|
|
1383
|
+
readonly tileModes?: readonly ('stretch' | 'repeat' | 'mirror')[];
|
|
1384
|
+
}
|
|
1385
|
+
interface LayoutComponentDefinition {
|
|
1386
|
+
readonly artboard: string;
|
|
1387
|
+
readonly fit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
1388
|
+
readonly alignment?: readonly [number, number];
|
|
1389
|
+
readonly sizing?: 'node' | 'leaf' | 'layout';
|
|
1390
|
+
readonly playback?: {
|
|
1391
|
+
readonly mode: 'simple' | 'remap' | 'mix';
|
|
1392
|
+
readonly speed?: number;
|
|
1393
|
+
readonly paused?: boolean;
|
|
1394
|
+
readonly quantize?: number;
|
|
1395
|
+
readonly stateful?: boolean;
|
|
1396
|
+
readonly remapPort?: string;
|
|
1397
|
+
readonly mixPort?: string;
|
|
1398
|
+
};
|
|
1399
|
+
readonly exposedInputs?: readonly string[];
|
|
1400
|
+
readonly exposedEvents?: readonly string[];
|
|
1401
|
+
}
|
|
1402
|
+
interface LayoutNodeDefinition {
|
|
1403
|
+
readonly id: string;
|
|
1404
|
+
readonly parent?: string;
|
|
1405
|
+
readonly kind: 'container' | 'leaf' | 'text' | 'image' | 'component' | 'list' | 'n-slice';
|
|
1406
|
+
readonly style: LayoutStyle;
|
|
1407
|
+
readonly visual?: LayoutVisualStyle;
|
|
1408
|
+
readonly intrinsicSize?: readonly [number, number];
|
|
1409
|
+
readonly text?: string;
|
|
1410
|
+
readonly asset?: string;
|
|
1411
|
+
readonly component?: LayoutComponentDefinition;
|
|
1412
|
+
readonly list?: LayoutListDefinition;
|
|
1413
|
+
readonly nSlice?: LayoutNSliceDefinition;
|
|
1414
|
+
readonly scroll?: LayoutScrollDefinition;
|
|
1415
|
+
}
|
|
1416
|
+
interface LayoutArtboardDefinition {
|
|
1417
|
+
readonly id: string;
|
|
1418
|
+
readonly name?: string;
|
|
1419
|
+
readonly width: number;
|
|
1420
|
+
readonly height: number;
|
|
1421
|
+
readonly root: string;
|
|
1422
|
+
readonly nodes: readonly LayoutNodeDefinition[];
|
|
1423
|
+
}
|
|
1424
|
+
interface LayoutRootInstance {
|
|
1425
|
+
readonly id: string;
|
|
1426
|
+
readonly artboard: string;
|
|
1427
|
+
readonly fit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
1428
|
+
readonly alignment?: readonly [number, number];
|
|
1429
|
+
readonly transform?: readonly [number, number, number, number, number, number];
|
|
1430
|
+
}
|
|
1431
|
+
interface ResponsiveLayoutDocument {
|
|
1432
|
+
readonly format: typeof LAYOUT_FORMAT;
|
|
1433
|
+
readonly version: typeof LAYOUT_VERSION;
|
|
1434
|
+
readonly extension: typeof LAYOUT_EXTENSION_ID;
|
|
1435
|
+
readonly shaping: TextShapingContract;
|
|
1436
|
+
readonly assets: readonly LayoutAsset[];
|
|
1437
|
+
readonly textStyles: readonly TextStyleDefinition[];
|
|
1438
|
+
readonly textBlocks: readonly TextBlockDefinition[];
|
|
1439
|
+
readonly artboards: readonly LayoutArtboardDefinition[];
|
|
1440
|
+
readonly instances: readonly LayoutRootInstance[];
|
|
1441
|
+
}
|
|
1442
|
+
interface LayoutParseOptions {
|
|
1443
|
+
readonly limits?: Partial<LayoutLimits>;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
declare function parseResponsiveLayoutDocument(value: unknown, options?: LayoutParseOptions): ResponsiveLayoutDocument;
|
|
1447
|
+
|
|
1448
|
+
declare function isResponsiveLayoutBinary(buffer: ArrayBuffer): boolean;
|
|
1449
|
+
declare function encodeResponsiveLayoutDocument(source: ResponsiveLayoutDocument, options?: LayoutParseOptions): ArrayBuffer;
|
|
1450
|
+
declare function decodeResponsiveLayoutDocument(buffer: ArrayBuffer, options?: LayoutParseOptions): ResponsiveLayoutDocument;
|
|
1451
|
+
|
|
1452
|
+
type LayoutDiagnosticCode = 'E_LAYOUT_FORMAT' | 'E_LAYOUT_LIMIT' | 'E_LAYOUT_NUMBER' | 'E_LAYOUT_REFERENCE' | 'E_LAYOUT_CYCLE' | 'E_LAYOUT_OSCILLATION' | 'E_LAYOUT_SHAPING' | 'E_LAYOUT_ASSET_INTEGRITY' | 'E_LAYOUT_BINARY';
|
|
1453
|
+
declare class LayoutDiagnostic extends Error {
|
|
1454
|
+
readonly code: LayoutDiagnosticCode;
|
|
1455
|
+
readonly path: string;
|
|
1456
|
+
readonly name = "LayoutDiagnostic";
|
|
1457
|
+
constructor(code: LayoutDiagnosticCode, path: string, message: string);
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
interface DataBindingLimits {
|
|
1461
|
+
readonly maxEnums: number;
|
|
1462
|
+
readonly maxEnumValues: number;
|
|
1463
|
+
readonly maxModels: number;
|
|
1464
|
+
readonly maxProperties: number;
|
|
1465
|
+
readonly maxInstances: number;
|
|
1466
|
+
readonly maxListItems: number;
|
|
1467
|
+
readonly maxBindings: number;
|
|
1468
|
+
readonly maxConverters: number;
|
|
1469
|
+
readonly maxOperations: number;
|
|
1470
|
+
readonly maxPathDepth: number;
|
|
1471
|
+
readonly maxStringBytes: number;
|
|
1472
|
+
readonly maxTotalTextBytes: number;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
declare const HYA_DATA_BINDING_EXTENSION_ID: "org.haiyue.data-binding@1";
|
|
1476
|
+
declare const HYA_DATA_BINDING_FORMAT: "haiyue-data-binding";
|
|
1477
|
+
declare const HYA_DATA_BINDING_VERSION: 1;
|
|
1478
|
+
type DataColor = readonly [number, number, number, number];
|
|
1479
|
+
type DataScalar = number | string | boolean | DataColor | null;
|
|
1480
|
+
interface DataObject {
|
|
1481
|
+
readonly [key: string]: DataValue;
|
|
1482
|
+
}
|
|
1483
|
+
type DataValue = DataScalar | readonly DataValue[] | DataObject;
|
|
1484
|
+
type DataPropertyKind = 'number' | 'integer' | 'string' | 'boolean' | 'color' | 'trigger' | 'enum' | 'model' | 'list' | 'image' | 'artboard' | 'font' | 'blob';
|
|
1485
|
+
interface DataEnumDefinition {
|
|
1486
|
+
readonly id: string;
|
|
1487
|
+
readonly values: readonly Readonly<{
|
|
1488
|
+
key: string;
|
|
1489
|
+
value: number;
|
|
1490
|
+
}>[];
|
|
1491
|
+
}
|
|
1492
|
+
interface DataPropertyDefinition {
|
|
1493
|
+
readonly id: string;
|
|
1494
|
+
readonly kind: DataPropertyKind;
|
|
1495
|
+
readonly enum?: string;
|
|
1496
|
+
readonly model?: string;
|
|
1497
|
+
readonly item?: Readonly<{
|
|
1498
|
+
kind: Exclude<DataPropertyKind, 'trigger' | 'list'>;
|
|
1499
|
+
enum?: string;
|
|
1500
|
+
model?: string;
|
|
1501
|
+
}>;
|
|
1502
|
+
readonly defaultValue?: DataValue;
|
|
1503
|
+
readonly nullable?: boolean;
|
|
1504
|
+
}
|
|
1505
|
+
interface DataModelDefinition {
|
|
1506
|
+
readonly id: string;
|
|
1507
|
+
readonly properties: readonly DataPropertyDefinition[];
|
|
1508
|
+
readonly defaultInstance?: string;
|
|
1509
|
+
}
|
|
1510
|
+
interface DataModelInstance {
|
|
1511
|
+
readonly id: string;
|
|
1512
|
+
readonly model: string;
|
|
1513
|
+
readonly scope: 'default' | 'global' | 'local';
|
|
1514
|
+
readonly values: Readonly<Record<string, DataValue>>;
|
|
1515
|
+
}
|
|
1516
|
+
type DataConverterOperation = Readonly<{
|
|
1517
|
+
op: 'round';
|
|
1518
|
+
decimals: number;
|
|
1519
|
+
}> | Readonly<{
|
|
1520
|
+
op: 'to-string';
|
|
1521
|
+
decimals?: number;
|
|
1522
|
+
colorFormat?: 'hex' | 'rgba';
|
|
1523
|
+
}> | Readonly<{
|
|
1524
|
+
op: 'to-number';
|
|
1525
|
+
}> | Readonly<{
|
|
1526
|
+
op: 'boolean-not';
|
|
1527
|
+
}> | Readonly<{
|
|
1528
|
+
op: 'degrees-to-radians';
|
|
1529
|
+
}> | Readonly<{
|
|
1530
|
+
op: 'normalize';
|
|
1531
|
+
minimum: number;
|
|
1532
|
+
maximum: number;
|
|
1533
|
+
}> | Readonly<{
|
|
1534
|
+
op: 'range-map';
|
|
1535
|
+
input: readonly [number, number];
|
|
1536
|
+
output: readonly [number, number];
|
|
1537
|
+
clamp?: boolean;
|
|
1538
|
+
}> | Readonly<{
|
|
1539
|
+
op: 'string-pad';
|
|
1540
|
+
length: number;
|
|
1541
|
+
text: string;
|
|
1542
|
+
side: 'start' | 'end';
|
|
1543
|
+
}> | Readonly<{
|
|
1544
|
+
op: 'string-trim';
|
|
1545
|
+
side: 'start' | 'end' | 'both';
|
|
1546
|
+
}> | Readonly<{
|
|
1547
|
+
op: 'remove-trailing-zeros';
|
|
1548
|
+
}> | Readonly<{
|
|
1549
|
+
op: 'list-length';
|
|
1550
|
+
}> | Readonly<{
|
|
1551
|
+
op: 'number-to-list';
|
|
1552
|
+
model: string;
|
|
1553
|
+
}> | Readonly<{
|
|
1554
|
+
op: 'to-trigger';
|
|
1555
|
+
mode: 'change' | 'rising' | 'falling' | 'truthy';
|
|
1556
|
+
}> | Readonly<{
|
|
1557
|
+
op: 'interpolate';
|
|
1558
|
+
duration: number;
|
|
1559
|
+
easing: readonly [number, number, number, number];
|
|
1560
|
+
}> | Readonly<{
|
|
1561
|
+
op: 'formula';
|
|
1562
|
+
tokens: readonly Readonly<{
|
|
1563
|
+
kind: 'value' | 'input' | 'operator' | 'function';
|
|
1564
|
+
value: string | number;
|
|
1565
|
+
}>[];
|
|
1566
|
+
}> | Readonly<{
|
|
1567
|
+
op: 'custom';
|
|
1568
|
+
protocol: string;
|
|
1569
|
+
port: string;
|
|
1570
|
+
arguments?: DataObject;
|
|
1571
|
+
}>;
|
|
1572
|
+
interface DataConverterDefinition {
|
|
1573
|
+
readonly id: string;
|
|
1574
|
+
readonly version: 1;
|
|
1575
|
+
readonly operations: readonly DataConverterOperation[];
|
|
1576
|
+
}
|
|
1577
|
+
type DataMutationOperation = Readonly<{
|
|
1578
|
+
op: 'set';
|
|
1579
|
+
path: readonly (string | number)[];
|
|
1580
|
+
value: DataValue;
|
|
1581
|
+
}> | Readonly<{
|
|
1582
|
+
op: 'copy';
|
|
1583
|
+
from: readonly (string | number)[];
|
|
1584
|
+
path: readonly (string | number)[];
|
|
1585
|
+
}> | Readonly<{
|
|
1586
|
+
op: 'trigger';
|
|
1587
|
+
path: readonly (string | number)[];
|
|
1588
|
+
}> | Readonly<{
|
|
1589
|
+
op: 'list-insert';
|
|
1590
|
+
path: readonly (string | number)[];
|
|
1591
|
+
index: number;
|
|
1592
|
+
value: DataValue;
|
|
1593
|
+
}> | Readonly<{
|
|
1594
|
+
op: 'list-remove';
|
|
1595
|
+
path: readonly (string | number)[];
|
|
1596
|
+
index: number;
|
|
1597
|
+
}> | Readonly<{
|
|
1598
|
+
op: 'list-move';
|
|
1599
|
+
path: readonly (string | number)[];
|
|
1600
|
+
from: number;
|
|
1601
|
+
to: number;
|
|
1602
|
+
}>;
|
|
1603
|
+
interface DataPropertyGroupDefinition {
|
|
1604
|
+
readonly id: string;
|
|
1605
|
+
readonly version: 1;
|
|
1606
|
+
readonly operations: readonly DataMutationOperation[];
|
|
1607
|
+
}
|
|
1608
|
+
interface DataBindingSource {
|
|
1609
|
+
readonly mode: 'explicit' | 'default' | 'global' | 'auto';
|
|
1610
|
+
readonly instance?: string;
|
|
1611
|
+
readonly model?: string;
|
|
1612
|
+
readonly path: readonly (string | number)[];
|
|
1613
|
+
}
|
|
1614
|
+
interface DataBindingDefinition {
|
|
1615
|
+
readonly id: string;
|
|
1616
|
+
readonly target: string;
|
|
1617
|
+
readonly targetPath: readonly string[];
|
|
1618
|
+
readonly source: DataBindingSource;
|
|
1619
|
+
readonly converter?: string;
|
|
1620
|
+
readonly direction: 'read' | 'write' | 'two-way';
|
|
1621
|
+
}
|
|
1622
|
+
interface StatefulDataComponentDefinition {
|
|
1623
|
+
readonly id: string;
|
|
1624
|
+
readonly stateful: true;
|
|
1625
|
+
readonly model: string;
|
|
1626
|
+
readonly exposedProperties?: readonly string[];
|
|
1627
|
+
readonly exposedInputs?: readonly string[];
|
|
1628
|
+
readonly exposedEvents?: readonly string[];
|
|
1629
|
+
}
|
|
1630
|
+
interface HyaDataBindingDocument {
|
|
1631
|
+
readonly format: typeof HYA_DATA_BINDING_FORMAT;
|
|
1632
|
+
readonly version: typeof HYA_DATA_BINDING_VERSION;
|
|
1633
|
+
readonly extension: typeof HYA_DATA_BINDING_EXTENSION_ID;
|
|
1634
|
+
readonly enums: readonly DataEnumDefinition[];
|
|
1635
|
+
readonly models: readonly DataModelDefinition[];
|
|
1636
|
+
readonly instances: readonly DataModelInstance[];
|
|
1637
|
+
readonly converters: readonly DataConverterDefinition[];
|
|
1638
|
+
readonly propertyGroups: readonly DataPropertyGroupDefinition[];
|
|
1639
|
+
readonly bindings: readonly DataBindingDefinition[];
|
|
1640
|
+
readonly components: readonly StatefulDataComponentDefinition[];
|
|
1641
|
+
}
|
|
1642
|
+
interface DataBindingParseOptions {
|
|
1643
|
+
readonly limits?: Partial<DataBindingLimits>;
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
declare function parseHyaDataBinding(value: unknown, options?: DataBindingParseOptions): HyaDataBindingDocument;
|
|
1647
|
+
|
|
1648
|
+
type DataBindingDiagnosticCode = 'E_DATA_BINDING_FORMAT' | 'E_DATA_BINDING_NUMBER' | 'E_DATA_BINDING_REFERENCE' | 'E_DATA_BINDING_LIMIT' | 'E_DATA_BINDING_TYPE' | 'E_DATA_BINDING_PATH' | 'E_DATA_BINDING_GRAPH';
|
|
1649
|
+
declare class DataBindingDiagnostic extends Error {
|
|
1650
|
+
readonly code: DataBindingDiagnosticCode;
|
|
1651
|
+
readonly path: string;
|
|
1652
|
+
readonly name = "DataBindingDiagnostic";
|
|
1653
|
+
constructor(code: DataBindingDiagnosticCode, path: string, message: string);
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
declare const HYA_INTERACTION_EXTENSION_ID: "org.haiyue.interaction@1";
|
|
1657
|
+
declare const HYA_INTERACTION_FORMAT: "haiyue-interaction";
|
|
1658
|
+
declare const HYA_INTERACTION_VERSION: 1;
|
|
1659
|
+
interface InteractionLimits {
|
|
1660
|
+
readonly maxTargets: number;
|
|
1661
|
+
readonly maxListeners: number;
|
|
1662
|
+
readonly maxActions: number;
|
|
1663
|
+
readonly maxPathDepth: number;
|
|
1664
|
+
readonly maxEventQueue: number;
|
|
1665
|
+
readonly maxEventRecursion: number;
|
|
1666
|
+
readonly maxPointers: number;
|
|
1667
|
+
readonly maxPolygonPoints: number;
|
|
1668
|
+
readonly maxStringBytes: number;
|
|
1669
|
+
}
|
|
1670
|
+
interface InteractionObject {
|
|
1671
|
+
readonly [key: string]: InteractionValue;
|
|
1672
|
+
}
|
|
1673
|
+
type InteractionValue = number | string | boolean | null | readonly InteractionValue[] | InteractionObject;
|
|
1674
|
+
type InteractionEventKind = 'pointer-enter' | 'pointer-exit' | 'pointer-move' | 'pointer-down' | 'pointer-up' | 'click' | 'drag-start' | 'drag' | 'drag-end' | 'keyboard' | 'text-input' | 'gamepad' | 'focus' | 'blur' | 'data-change' | 'reported-event' | 'component-event' | 'semantic-action';
|
|
1675
|
+
type InteractionPhase = 'capture' | 'target' | 'bubble';
|
|
1676
|
+
type HitArea = Readonly<{
|
|
1677
|
+
kind: 'rect';
|
|
1678
|
+
rect: readonly [number, number, number, number];
|
|
1679
|
+
}> | Readonly<{
|
|
1680
|
+
kind: 'ellipse';
|
|
1681
|
+
center: readonly [number, number];
|
|
1682
|
+
radius: readonly [number, number];
|
|
1683
|
+
}> | Readonly<{
|
|
1684
|
+
kind: 'polygon';
|
|
1685
|
+
points: readonly (readonly [number, number])[];
|
|
1686
|
+
}> | Readonly<{
|
|
1687
|
+
kind: 'geometry';
|
|
1688
|
+
port: string;
|
|
1689
|
+
}>;
|
|
1690
|
+
interface InteractionTargetDefinition {
|
|
1691
|
+
readonly id: string;
|
|
1692
|
+
readonly parent?: string;
|
|
1693
|
+
readonly component?: string;
|
|
1694
|
+
readonly order: number;
|
|
1695
|
+
readonly transform?: readonly [number, number, number, number, number, number];
|
|
1696
|
+
readonly hitArea: HitArea;
|
|
1697
|
+
readonly clips?: readonly string[];
|
|
1698
|
+
readonly enabled?: boolean;
|
|
1699
|
+
readonly focusable?: boolean;
|
|
1700
|
+
readonly tabIndex?: number;
|
|
1701
|
+
}
|
|
1702
|
+
type InteractionAction = Readonly<{
|
|
1703
|
+
kind: 'data-set';
|
|
1704
|
+
binding: string;
|
|
1705
|
+
value: InteractionValue;
|
|
1706
|
+
}> | Readonly<{
|
|
1707
|
+
kind: 'data-trigger';
|
|
1708
|
+
binding: string;
|
|
1709
|
+
}> | Readonly<{
|
|
1710
|
+
kind: 'property-group';
|
|
1711
|
+
group: string;
|
|
1712
|
+
}> | Readonly<{
|
|
1713
|
+
kind: 'state-input';
|
|
1714
|
+
machine: string;
|
|
1715
|
+
input: string;
|
|
1716
|
+
value: InteractionValue;
|
|
1717
|
+
}> | Readonly<{
|
|
1718
|
+
kind: 'state-control';
|
|
1719
|
+
machine: string;
|
|
1720
|
+
operation: 'play' | 'pause' | 'resume' | 'stop' | 'reset';
|
|
1721
|
+
value?: number;
|
|
1722
|
+
}> | Readonly<{
|
|
1723
|
+
kind: 'report-event';
|
|
1724
|
+
name: string;
|
|
1725
|
+
payload?: InteractionValue;
|
|
1726
|
+
}> | Readonly<{
|
|
1727
|
+
kind: 'audio';
|
|
1728
|
+
operation: 'play' | 'pause' | 'stop' | 'seek';
|
|
1729
|
+
target: string;
|
|
1730
|
+
value?: number;
|
|
1731
|
+
}> | Readonly<{
|
|
1732
|
+
kind: 'semantic';
|
|
1733
|
+
operation: 'announce' | 'focus' | 'increment' | 'decrement' | 'activate';
|
|
1734
|
+
target: string;
|
|
1735
|
+
value?: InteractionValue;
|
|
1736
|
+
}> | Readonly<{
|
|
1737
|
+
kind: 'align-target';
|
|
1738
|
+
target: string;
|
|
1739
|
+
alignment: readonly [number, number];
|
|
1740
|
+
preserveOffset: boolean;
|
|
1741
|
+
}> | Readonly<{
|
|
1742
|
+
kind: 'open-url';
|
|
1743
|
+
url: string;
|
|
1744
|
+
target: 'same-context' | 'new-context';
|
|
1745
|
+
}> | Readonly<{
|
|
1746
|
+
kind: 'component-input';
|
|
1747
|
+
component: string;
|
|
1748
|
+
input: string;
|
|
1749
|
+
value: InteractionValue;
|
|
1750
|
+
}> | Readonly<{
|
|
1751
|
+
kind: 'component-event';
|
|
1752
|
+
component: string;
|
|
1753
|
+
event: string;
|
|
1754
|
+
payload?: InteractionValue;
|
|
1755
|
+
}> | Readonly<{
|
|
1756
|
+
kind: 'pointer-capture' | 'pointer-release';
|
|
1757
|
+
}> | Readonly<{
|
|
1758
|
+
kind: 'focus';
|
|
1759
|
+
target?: string;
|
|
1760
|
+
}> | Readonly<{
|
|
1761
|
+
kind: 'custom';
|
|
1762
|
+
protocol: string;
|
|
1763
|
+
port: string;
|
|
1764
|
+
arguments?: InteractionObject;
|
|
1765
|
+
}>;
|
|
1766
|
+
interface InteractionListenerDefinition {
|
|
1767
|
+
readonly id: string;
|
|
1768
|
+
readonly target: string;
|
|
1769
|
+
readonly event: InteractionEventKind;
|
|
1770
|
+
readonly phases: readonly InteractionPhase[];
|
|
1771
|
+
readonly pointerButton?: number;
|
|
1772
|
+
readonly key?: string;
|
|
1773
|
+
readonly keyPhase?: 'down' | 'up' | 'repeat';
|
|
1774
|
+
readonly modifiers?: readonly ('alt' | 'control' | 'meta' | 'shift')[];
|
|
1775
|
+
readonly gamepad?: Readonly<{
|
|
1776
|
+
index?: number;
|
|
1777
|
+
control: string;
|
|
1778
|
+
phase: 'down' | 'up' | 'change';
|
|
1779
|
+
}>;
|
|
1780
|
+
readonly semanticAction?: 'tap' | 'increase' | 'decrease' | 'focus';
|
|
1781
|
+
readonly actions: readonly InteractionAction[];
|
|
1782
|
+
}
|
|
1783
|
+
interface HyaInteractionDocument {
|
|
1784
|
+
readonly format: typeof HYA_INTERACTION_FORMAT;
|
|
1785
|
+
readonly version: typeof HYA_INTERACTION_VERSION;
|
|
1786
|
+
readonly extension: typeof HYA_INTERACTION_EXTENSION_ID;
|
|
1787
|
+
readonly dragThreshold: number;
|
|
1788
|
+
readonly targets: readonly InteractionTargetDefinition[];
|
|
1789
|
+
readonly listeners: readonly InteractionListenerDefinition[];
|
|
1790
|
+
readonly limits?: Readonly<Pick<InteractionLimits, 'maxEventQueue' | 'maxEventRecursion' | 'maxPointers'>>;
|
|
1791
|
+
}
|
|
1792
|
+
interface InteractionParseOptions {
|
|
1793
|
+
readonly limits?: Partial<InteractionLimits>;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
declare function parseHyaInteraction(value: unknown, options?: InteractionParseOptions): HyaInteractionDocument;
|
|
1797
|
+
|
|
1798
|
+
type InteractionDiagnosticCode = 'E_INTERACTION_FORMAT' | 'E_INTERACTION_NUMBER' | 'E_INTERACTION_REFERENCE' | 'E_INTERACTION_LIMIT' | 'E_INTERACTION_GRAPH' | 'E_INTERACTION_ACTION';
|
|
1799
|
+
declare class InteractionDiagnostic extends Error {
|
|
1800
|
+
readonly code: InteractionDiagnosticCode;
|
|
1801
|
+
readonly path: string;
|
|
1802
|
+
readonly name = "InteractionDiagnostic";
|
|
1803
|
+
constructor(code: InteractionDiagnosticCode, path: string, message: string);
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
declare const HYA_SEMANTICS_EXTENSION_ID: "org.haiyue.semantics@1";
|
|
1807
|
+
declare const HYA_SEMANTICS_FORMAT: "haiyue-semantics";
|
|
1808
|
+
declare const HYA_SEMANTICS_VERSION: 1;
|
|
1809
|
+
type SemanticRole = 'none' | 'group' | 'text' | 'button' | 'link' | 'image' | 'heading' | 'checkbox' | 'radio' | 'switch' | 'slider' | 'progress' | 'textbox' | 'list' | 'list-item' | 'menu' | 'menu-item' | 'dialog';
|
|
1810
|
+
type SemanticActionKind = 'tap' | 'increase' | 'decrease' | 'focus';
|
|
1811
|
+
type SemanticValue<T> = Readonly<{
|
|
1812
|
+
kind: 'literal';
|
|
1813
|
+
value: T;
|
|
1814
|
+
} | {
|
|
1815
|
+
kind: 'binding';
|
|
1816
|
+
binding: string;
|
|
1817
|
+
}>;
|
|
1818
|
+
interface SemanticState {
|
|
1819
|
+
readonly hidden?: SemanticValue<boolean>;
|
|
1820
|
+
readonly disabled?: SemanticValue<boolean>;
|
|
1821
|
+
readonly focused?: SemanticValue<boolean>;
|
|
1822
|
+
readonly expanded?: SemanticValue<boolean>;
|
|
1823
|
+
readonly selected?: SemanticValue<boolean>;
|
|
1824
|
+
readonly checked?: SemanticValue<boolean>;
|
|
1825
|
+
readonly mixed?: SemanticValue<boolean>;
|
|
1826
|
+
readonly toggled?: SemanticValue<boolean>;
|
|
1827
|
+
readonly required?: SemanticValue<boolean>;
|
|
1828
|
+
readonly readOnly?: SemanticValue<boolean>;
|
|
1829
|
+
readonly modal?: SemanticValue<boolean>;
|
|
1830
|
+
readonly obscured?: SemanticValue<boolean>;
|
|
1831
|
+
readonly multiline?: SemanticValue<boolean>;
|
|
1832
|
+
}
|
|
1833
|
+
interface SemanticCapabilities {
|
|
1834
|
+
readonly expandable?: boolean;
|
|
1835
|
+
readonly selectable?: boolean;
|
|
1836
|
+
readonly checkable?: boolean;
|
|
1837
|
+
readonly toggleable?: boolean;
|
|
1838
|
+
readonly requirable?: boolean;
|
|
1839
|
+
readonly enablable?: boolean;
|
|
1840
|
+
readonly focusable?: boolean;
|
|
1841
|
+
}
|
|
1842
|
+
interface SemanticNodeDefinition {
|
|
1843
|
+
readonly id: string;
|
|
1844
|
+
readonly target: string;
|
|
1845
|
+
readonly parent?: string;
|
|
1846
|
+
readonly role: SemanticRole;
|
|
1847
|
+
readonly label?: SemanticValue<string>;
|
|
1848
|
+
readonly value?: SemanticValue<string | number>;
|
|
1849
|
+
readonly hint?: SemanticValue<string>;
|
|
1850
|
+
readonly headingLevel?: number;
|
|
1851
|
+
readonly traits?: readonly ('button' | 'link' | 'image' | 'header' | 'adjustable' | 'selected' | 'disabled')[];
|
|
1852
|
+
readonly state?: SemanticState;
|
|
1853
|
+
readonly capabilities?: SemanticCapabilities;
|
|
1854
|
+
readonly actions?: readonly SemanticActionKind[];
|
|
1855
|
+
readonly live?: 'off' | 'polite' | 'assertive';
|
|
1856
|
+
readonly readingOrder: number;
|
|
1857
|
+
readonly navigationOrder: number;
|
|
1858
|
+
}
|
|
1859
|
+
type ReducedMotionPolicy = Readonly<{
|
|
1860
|
+
mode: 'ignore';
|
|
1861
|
+
}> | Readonly<{
|
|
1862
|
+
mode: 'respect';
|
|
1863
|
+
decorative: 'pause' | 'stop' | 'continue';
|
|
1864
|
+
essential: 'retain' | 'reduce';
|
|
1865
|
+
durationScale: number;
|
|
1866
|
+
disableParallax: boolean;
|
|
1867
|
+
}>;
|
|
1868
|
+
interface HyaSemanticsDocument {
|
|
1869
|
+
readonly format: typeof HYA_SEMANTICS_FORMAT;
|
|
1870
|
+
readonly version: typeof HYA_SEMANTICS_VERSION;
|
|
1871
|
+
readonly extension: typeof HYA_SEMANTICS_EXTENSION_ID;
|
|
1872
|
+
readonly nodes: readonly SemanticNodeDefinition[];
|
|
1873
|
+
readonly reducedMotion: ReducedMotionPolicy;
|
|
1874
|
+
}
|
|
1875
|
+
interface SemanticsParseOptions {
|
|
1876
|
+
readonly maxNodes?: number;
|
|
1877
|
+
readonly maxDepth?: number;
|
|
1878
|
+
readonly maxStringBytes?: number;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
declare function parseHyaSemantics(value: unknown, options?: SemanticsParseOptions): HyaSemanticsDocument;
|
|
1882
|
+
|
|
1883
|
+
type SemanticsDiagnosticCode = 'E_SEMANTICS_FORMAT' | 'E_SEMANTICS_NUMBER' | 'E_SEMANTICS_REFERENCE' | 'E_SEMANTICS_LIMIT' | 'E_SEMANTICS_GRAPH';
|
|
1884
|
+
declare class SemanticsDiagnostic extends Error {
|
|
1885
|
+
readonly code: SemanticsDiagnosticCode;
|
|
1886
|
+
readonly path: string;
|
|
1887
|
+
readonly name = "SemanticsDiagnostic";
|
|
1888
|
+
constructor(code: SemanticsDiagnosticCode, path: string, message: string);
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
interface AudioEventLimits {
|
|
1892
|
+
readonly maxResources: number;
|
|
1893
|
+
readonly maxBuses: number;
|
|
1894
|
+
readonly maxCues: number;
|
|
1895
|
+
readonly maxTimelineEvents: number;
|
|
1896
|
+
readonly maxVoices: number;
|
|
1897
|
+
readonly maxVoicesPerResource: number;
|
|
1898
|
+
readonly maxDecodeJobs: number;
|
|
1899
|
+
readonly maxEventTokens: number;
|
|
1900
|
+
readonly maxEmbeddedBytes: number;
|
|
1901
|
+
readonly maxTotalEmbeddedBytes: number;
|
|
1902
|
+
readonly maxDecodedFrames: number;
|
|
1903
|
+
readonly maxDecodedBytes: number;
|
|
1904
|
+
readonly maxStringBytes: number;
|
|
1905
|
+
readonly maxTotalTextBytes: number;
|
|
1906
|
+
readonly maxReferenceDepth: number;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
declare const HYA_AUDIO_EVENT_FORMAT: "haiyue-audio-events";
|
|
1910
|
+
declare const HYA_AUDIO_EVENT_VERSION: 1;
|
|
1911
|
+
declare const HYA_AUDIO_EVENT_EXTENSION_ID: "org.haiyue.audio-events@1";
|
|
1912
|
+
type HyaAudioCodec = 'pcm-f32' | 'wav' | 'mp3' | 'aac' | 'opus' | 'vorbis' | 'flac';
|
|
1913
|
+
type HyaAudioClockDomain = 'composition' | 'state' | 'event';
|
|
1914
|
+
type HyaAudioPlaybackProfile = 'sample-accurate' | 'html-media-restricted';
|
|
1915
|
+
type HyaAudioVoiceStealing = 'reject' | 'steal-oldest' | 'steal-lowest-priority';
|
|
1916
|
+
interface HyaAudioIntegrity {
|
|
1917
|
+
readonly algorithm: 'sha256';
|
|
1918
|
+
readonly digest: string;
|
|
1919
|
+
}
|
|
1920
|
+
type HyaAudioResourceSource = Readonly<{
|
|
1921
|
+
kind: 'embedded';
|
|
1922
|
+
data: string;
|
|
1923
|
+
}> | Readonly<{
|
|
1924
|
+
kind: 'referenced';
|
|
1925
|
+
uri: string;
|
|
1926
|
+
}> | Readonly<{
|
|
1927
|
+
kind: 'hosted';
|
|
1928
|
+
key: string;
|
|
1929
|
+
}>;
|
|
1930
|
+
interface HyaAudioResource {
|
|
1931
|
+
readonly id: string;
|
|
1932
|
+
readonly codec: HyaAudioCodec;
|
|
1933
|
+
readonly mediaType: string;
|
|
1934
|
+
readonly integrity: HyaAudioIntegrity;
|
|
1935
|
+
readonly sampleRate: number;
|
|
1936
|
+
readonly channels: number;
|
|
1937
|
+
readonly frameLength: number;
|
|
1938
|
+
readonly source: HyaAudioResourceSource;
|
|
1939
|
+
}
|
|
1940
|
+
interface HyaAudioBus {
|
|
1941
|
+
readonly id: string;
|
|
1942
|
+
readonly parent?: string;
|
|
1943
|
+
readonly gain: number;
|
|
1944
|
+
}
|
|
1945
|
+
interface HyaAudioLoop {
|
|
1946
|
+
readonly startFrame: number;
|
|
1947
|
+
readonly endFrame: number;
|
|
1948
|
+
readonly iterations: number | 'infinite';
|
|
1949
|
+
}
|
|
1950
|
+
interface HyaAudioCue {
|
|
1951
|
+
readonly id: string;
|
|
1952
|
+
readonly resource: string;
|
|
1953
|
+
readonly owner: string;
|
|
1954
|
+
readonly bus: string;
|
|
1955
|
+
readonly gain: number;
|
|
1956
|
+
readonly rate: number;
|
|
1957
|
+
readonly offsetFrames: number;
|
|
1958
|
+
readonly durationFrames?: number;
|
|
1959
|
+
readonly loop?: HyaAudioLoop;
|
|
1960
|
+
readonly overlap: 'allow' | 'ignore' | 'restart';
|
|
1961
|
+
readonly priority: number;
|
|
1962
|
+
}
|
|
1963
|
+
interface HyaAudioTimelineEvent {
|
|
1964
|
+
readonly id: string;
|
|
1965
|
+
readonly clock: HyaAudioClockDomain;
|
|
1966
|
+
readonly time: number;
|
|
1967
|
+
readonly sequence: number;
|
|
1968
|
+
readonly cue: string;
|
|
1969
|
+
readonly operation: 'start' | 'stop';
|
|
1970
|
+
}
|
|
1971
|
+
interface HyaAudioClockPolicy {
|
|
1972
|
+
readonly sampleRate: number;
|
|
1973
|
+
readonly lookAheadFrames: number;
|
|
1974
|
+
readonly driftToleranceFrames: number;
|
|
1975
|
+
readonly driftPolicy: 'resync' | 'error';
|
|
1976
|
+
readonly lateDecodePolicy: 'catch-up' | 'drop' | 'error';
|
|
1977
|
+
readonly visibilityPolicy: 'continue' | 'pause-resume';
|
|
1978
|
+
readonly suspendedPolicy: 'queue-until-resume' | 'error';
|
|
1979
|
+
}
|
|
1980
|
+
interface HyaAudioBrowserPolicy {
|
|
1981
|
+
readonly autoplay: 'require-user-gesture' | 'attempt';
|
|
1982
|
+
}
|
|
1983
|
+
interface HyaAudioRuntimeLimits {
|
|
1984
|
+
readonly maxVoices: number;
|
|
1985
|
+
readonly maxVoicesPerResource: number;
|
|
1986
|
+
readonly maxDecodeJobs: number;
|
|
1987
|
+
readonly maxEventTokens: number;
|
|
1988
|
+
readonly maxDecodedFrames: number;
|
|
1989
|
+
readonly maxDecodedBytes: number;
|
|
1990
|
+
}
|
|
1991
|
+
interface HyaAudioEventDocument {
|
|
1992
|
+
readonly format: typeof HYA_AUDIO_EVENT_FORMAT;
|
|
1993
|
+
readonly version: typeof HYA_AUDIO_EVENT_VERSION;
|
|
1994
|
+
readonly extension: typeof HYA_AUDIO_EVENT_EXTENSION_ID;
|
|
1995
|
+
readonly playbackProfile: HyaAudioPlaybackProfile;
|
|
1996
|
+
readonly clock: HyaAudioClockPolicy;
|
|
1997
|
+
readonly browser: HyaAudioBrowserPolicy;
|
|
1998
|
+
readonly limits: HyaAudioRuntimeLimits;
|
|
1999
|
+
readonly voiceStealing: HyaAudioVoiceStealing;
|
|
2000
|
+
readonly resources: readonly HyaAudioResource[];
|
|
2001
|
+
readonly buses: readonly HyaAudioBus[];
|
|
2002
|
+
readonly cues: readonly HyaAudioCue[];
|
|
2003
|
+
readonly timelineEvents: readonly HyaAudioTimelineEvent[];
|
|
2004
|
+
}
|
|
2005
|
+
interface AudioEventParseOptions {
|
|
2006
|
+
readonly limits?: Partial<AudioEventLimits>;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
declare function parseHyaAudioEvents(value: unknown, options?: AudioEventParseOptions): HyaAudioEventDocument;
|
|
2010
|
+
|
|
2011
|
+
type AudioEventDiagnosticCode = 'E_AUDIO_EVENT_FORMAT' | 'E_AUDIO_EVENT_VERSION' | 'E_AUDIO_EVENT_NUMBER' | 'E_AUDIO_EVENT_LIMIT' | 'E_AUDIO_EVENT_REFERENCE' | 'E_AUDIO_EVENT_GRAPH' | 'E_AUDIO_EVENT_CODEC' | 'E_AUDIO_EVENT_INTEGRITY';
|
|
2012
|
+
declare class AudioEventDiagnostic extends Error {
|
|
2013
|
+
readonly code: AudioEventDiagnosticCode;
|
|
2014
|
+
readonly path: string;
|
|
2015
|
+
readonly name = "AudioEventDiagnostic";
|
|
2016
|
+
constructor(code: AudioEventDiagnosticCode, path: string, message: string);
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
interface StateMachineV2Limits {
|
|
2020
|
+
readonly maxChannels: number;
|
|
2021
|
+
readonly maxClips: number;
|
|
2022
|
+
readonly maxTracks: number;
|
|
2023
|
+
readonly maxKeyframes: number;
|
|
2024
|
+
readonly maxStateMachines: number;
|
|
2025
|
+
readonly maxInputs: number;
|
|
2026
|
+
readonly maxLayers: number;
|
|
2027
|
+
readonly maxStates: number;
|
|
2028
|
+
readonly maxTransitions: number;
|
|
2029
|
+
readonly maxConditionTerms: number;
|
|
2030
|
+
readonly maxMotionDepth: number;
|
|
2031
|
+
readonly maxComponents: number;
|
|
2032
|
+
readonly maxStringLength: number;
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
declare const HYA_STATE_MACHINE_V2_EXTENSION_ID: "org.haiyue.animation-state-machine@2";
|
|
2036
|
+
declare const HYA_STATE_MACHINE_V2_FORMAT: "haiyue-animation-state-machine@2";
|
|
2037
|
+
type TimelineValue = number | boolean | string | readonly number[] | null | Readonly<Record<string, unknown>>;
|
|
2038
|
+
type TimelineValueKind = 'number' | 'vector' | 'color' | 'boolean' | 'string' | 'id' | 'integer' | 'unsigned' | 'callback';
|
|
2039
|
+
type TimelineInterpolation = Readonly<{
|
|
2040
|
+
kind: 'linear';
|
|
2041
|
+
}> | Readonly<{
|
|
2042
|
+
kind: 'hold';
|
|
2043
|
+
}> | Readonly<{
|
|
2044
|
+
kind: 'cubic-ease';
|
|
2045
|
+
controls: readonly [number, number, number, number];
|
|
2046
|
+
}> | Readonly<{
|
|
2047
|
+
kind: 'cubic-value';
|
|
2048
|
+
outTangent: readonly number[];
|
|
2049
|
+
inTangent: readonly number[];
|
|
2050
|
+
}> | Readonly<{
|
|
2051
|
+
kind: 'elastic';
|
|
2052
|
+
easing: 'in' | 'out' | 'in-out';
|
|
2053
|
+
amplitude: number;
|
|
2054
|
+
period: number;
|
|
2055
|
+
}>;
|
|
2056
|
+
interface TimelineKeyframe {
|
|
2057
|
+
readonly time: number;
|
|
2058
|
+
readonly value: TimelineValue;
|
|
2059
|
+
/** Interpolation from this key to the next key. Omitted on the final key. */
|
|
2060
|
+
readonly interpolation?: TimelineInterpolation;
|
|
2061
|
+
}
|
|
2062
|
+
type HyaChannelFamily = 'transform' | 'paint-path' | 'rig' | 'text-layout' | 'resource-data' | 'visibility-order' | 'event-audio-script';
|
|
2063
|
+
type HyaChannelPolicy = 'override' | 'additive' | 'discrete' | 'ownership';
|
|
2064
|
+
type HyaChannelEffectKind = 'event' | 'audio' | 'script';
|
|
2065
|
+
interface HyaTimelineChannel {
|
|
2066
|
+
readonly id: string;
|
|
2067
|
+
readonly target: string;
|
|
2068
|
+
readonly path: string;
|
|
2069
|
+
readonly family: HyaChannelFamily;
|
|
2070
|
+
readonly valueKind: TimelineValueKind;
|
|
2071
|
+
readonly valueSize?: number;
|
|
2072
|
+
readonly numericMode?: 'linear' | 'angle-radians';
|
|
2073
|
+
readonly defaultValue?: TimelineValue;
|
|
2074
|
+
readonly policy: HyaChannelPolicy;
|
|
2075
|
+
readonly effectKind?: HyaChannelEffectKind;
|
|
2076
|
+
}
|
|
2077
|
+
interface HyaTimelineTrack {
|
|
2078
|
+
readonly id: string;
|
|
2079
|
+
readonly channel: string;
|
|
2080
|
+
readonly keys: readonly TimelineKeyframe[];
|
|
2081
|
+
}
|
|
2082
|
+
interface HyaTimelineClip {
|
|
2083
|
+
readonly id: string;
|
|
2084
|
+
readonly name?: string;
|
|
2085
|
+
readonly duration: number;
|
|
2086
|
+
readonly fps?: number;
|
|
2087
|
+
readonly quantize?: boolean;
|
|
2088
|
+
readonly workArea?: Readonly<{
|
|
2089
|
+
start: number;
|
|
2090
|
+
end: number;
|
|
2091
|
+
}>;
|
|
2092
|
+
readonly tracks: readonly HyaTimelineTrack[];
|
|
2093
|
+
}
|
|
2094
|
+
type HyaPlaybackMode = 'one-shot' | 'loop' | 'ping-pong';
|
|
2095
|
+
interface HyaClipMotion {
|
|
2096
|
+
readonly kind: 'clip';
|
|
2097
|
+
readonly clip: string;
|
|
2098
|
+
readonly speed?: number;
|
|
2099
|
+
readonly speedInput?: string;
|
|
2100
|
+
readonly playback?: HyaPlaybackMode;
|
|
2101
|
+
readonly timeRemapInput?: string;
|
|
2102
|
+
}
|
|
2103
|
+
interface HyaBlend1DMotion {
|
|
2104
|
+
readonly kind: 'blend-1d';
|
|
2105
|
+
readonly input: string;
|
|
2106
|
+
readonly children: readonly Readonly<{
|
|
2107
|
+
threshold: number;
|
|
2108
|
+
motion: HyaStateMotion;
|
|
2109
|
+
}>[];
|
|
2110
|
+
}
|
|
2111
|
+
interface HyaBlend2DMotion {
|
|
2112
|
+
readonly kind: 'blend-2d';
|
|
2113
|
+
readonly algorithm: 'cartesian' | 'directional';
|
|
2114
|
+
readonly inputX: string;
|
|
2115
|
+
readonly inputY: string;
|
|
2116
|
+
readonly children: readonly Readonly<{
|
|
2117
|
+
position: readonly [number, number];
|
|
2118
|
+
motion: HyaStateMotion;
|
|
2119
|
+
}>[];
|
|
2120
|
+
}
|
|
2121
|
+
interface HyaAdditiveBlendMotion {
|
|
2122
|
+
readonly kind: 'blend-additive';
|
|
2123
|
+
readonly base: HyaStateMotion;
|
|
2124
|
+
readonly children: readonly Readonly<{
|
|
2125
|
+
motion: HyaStateMotion;
|
|
2126
|
+
weight?: number;
|
|
2127
|
+
weightInput?: string;
|
|
2128
|
+
}>[];
|
|
2129
|
+
}
|
|
2130
|
+
interface HyaNestedMotion {
|
|
2131
|
+
readonly kind: 'nested';
|
|
2132
|
+
readonly component: string;
|
|
2133
|
+
readonly speed?: number;
|
|
2134
|
+
readonly timeRemapInput?: string;
|
|
2135
|
+
readonly mixInput?: string;
|
|
2136
|
+
readonly playingInput?: string;
|
|
2137
|
+
readonly inputBindings?: Readonly<Record<string, string>>;
|
|
2138
|
+
}
|
|
2139
|
+
type HyaStateMotion = HyaClipMotion | HyaBlend1DMotion | HyaBlend2DMotion | HyaAdditiveBlendMotion | HyaNestedMotion;
|
|
2140
|
+
type HyaMachineInput = Readonly<{
|
|
2141
|
+
id: string;
|
|
2142
|
+
type: 'number';
|
|
2143
|
+
defaultValue: number;
|
|
2144
|
+
}> | Readonly<{
|
|
2145
|
+
id: string;
|
|
2146
|
+
type: 'integer';
|
|
2147
|
+
defaultValue: number;
|
|
2148
|
+
}> | Readonly<{
|
|
2149
|
+
id: string;
|
|
2150
|
+
type: 'boolean';
|
|
2151
|
+
defaultValue: boolean;
|
|
2152
|
+
}> | Readonly<{
|
|
2153
|
+
id: string;
|
|
2154
|
+
type: 'trigger';
|
|
2155
|
+
}>;
|
|
2156
|
+
type HyaComparator = 'equal' | 'not-equal' | 'greater' | 'greater-or-equal' | 'less' | 'less-or-equal';
|
|
2157
|
+
type HyaTransitionCondition = Readonly<{
|
|
2158
|
+
kind: 'input';
|
|
2159
|
+
input: string;
|
|
2160
|
+
comparator: HyaComparator;
|
|
2161
|
+
value: TimelineValue;
|
|
2162
|
+
}> | Readonly<{
|
|
2163
|
+
kind: 'trigger';
|
|
2164
|
+
input: string;
|
|
2165
|
+
}> | Readonly<{
|
|
2166
|
+
kind: 'observable';
|
|
2167
|
+
protocol: string;
|
|
2168
|
+
port: string;
|
|
2169
|
+
comparator: HyaComparator;
|
|
2170
|
+
value: TimelineValue;
|
|
2171
|
+
arguments?: Readonly<Record<string, TimelineValue>>;
|
|
2172
|
+
}> | Readonly<{
|
|
2173
|
+
kind: 'custom';
|
|
2174
|
+
protocol: string;
|
|
2175
|
+
port: string;
|
|
2176
|
+
arguments?: Readonly<Record<string, TimelineValue>>;
|
|
2177
|
+
}>;
|
|
2178
|
+
interface HyaTransitionEffect {
|
|
2179
|
+
readonly channel: string;
|
|
2180
|
+
readonly phase: 'start' | 'complete';
|
|
2181
|
+
readonly payload?: TimelineValue | Readonly<Record<string, TimelineValue>>;
|
|
2182
|
+
}
|
|
2183
|
+
interface HyaStateDefinition {
|
|
2184
|
+
readonly id: string;
|
|
2185
|
+
readonly motion: HyaStateMotion;
|
|
2186
|
+
readonly entryEffects?: readonly HyaTransitionEffect[];
|
|
2187
|
+
readonly exitEffects?: readonly HyaTransitionEffect[];
|
|
2188
|
+
}
|
|
2189
|
+
type HyaTransitionEndpoint = '@entry' | '@any' | '@exit' | string;
|
|
2190
|
+
interface HyaTransitionDefinition {
|
|
2191
|
+
readonly id: string;
|
|
2192
|
+
readonly from: HyaTransitionEndpoint;
|
|
2193
|
+
readonly to: HyaTransitionEndpoint;
|
|
2194
|
+
/** OR across groups, AND within a group. An empty list is unconditional. */
|
|
2195
|
+
readonly conditionGroups: readonly (readonly HyaTransitionCondition[])[];
|
|
2196
|
+
readonly exitTime?: number;
|
|
2197
|
+
readonly randomWeight?: number;
|
|
2198
|
+
readonly pauseWhenExiting?: boolean;
|
|
2199
|
+
readonly duration: number;
|
|
2200
|
+
readonly destinationOffset?: number;
|
|
2201
|
+
readonly interruption?: 'none' | 'source' | 'destination' | 'source-then-destination' | 'destination-then-source';
|
|
2202
|
+
readonly exitMotion?: HyaStateMotion;
|
|
2203
|
+
readonly interpolation?: TimelineInterpolation;
|
|
2204
|
+
readonly effects?: readonly HyaTransitionEffect[];
|
|
2205
|
+
}
|
|
2206
|
+
interface HyaStateLayer {
|
|
2207
|
+
readonly id: string;
|
|
2208
|
+
readonly order: number;
|
|
2209
|
+
readonly weight?: number;
|
|
2210
|
+
readonly weightInput?: string;
|
|
2211
|
+
readonly mode?: 'override' | 'additive';
|
|
2212
|
+
readonly mask?: Readonly<{
|
|
2213
|
+
include?: readonly string[];
|
|
2214
|
+
exclude?: readonly string[];
|
|
2215
|
+
}>;
|
|
2216
|
+
readonly states: readonly HyaStateDefinition[];
|
|
2217
|
+
/** Declaration order is the stable transition priority. */
|
|
2218
|
+
readonly transitions: readonly HyaTransitionDefinition[];
|
|
2219
|
+
}
|
|
2220
|
+
interface HyaStateMachineV2 {
|
|
2221
|
+
readonly id: string;
|
|
2222
|
+
readonly inputs: readonly HyaMachineInput[];
|
|
2223
|
+
readonly layers: readonly HyaStateLayer[];
|
|
2224
|
+
}
|
|
2225
|
+
interface HyaNestedComponentDefinition {
|
|
2226
|
+
readonly id: string;
|
|
2227
|
+
readonly target: string;
|
|
2228
|
+
readonly source: Readonly<{
|
|
2229
|
+
kind: 'clip';
|
|
2230
|
+
clip: string;
|
|
2231
|
+
} | {
|
|
2232
|
+
kind: 'state-machine';
|
|
2233
|
+
machine: string;
|
|
2234
|
+
}>;
|
|
2235
|
+
readonly playback: 'simple' | 'remap' | 'mix' | 'state-machine';
|
|
2236
|
+
readonly exposedInputs?: readonly string[];
|
|
2237
|
+
readonly exposedEvents?: readonly string[];
|
|
2238
|
+
}
|
|
2239
|
+
interface HyaStateMachineV2Document {
|
|
2240
|
+
readonly format: typeof HYA_STATE_MACHINE_V2_FORMAT;
|
|
2241
|
+
readonly extension: typeof HYA_STATE_MACHINE_V2_EXTENSION_ID;
|
|
2242
|
+
readonly channels: readonly HyaTimelineChannel[];
|
|
2243
|
+
readonly clips: readonly HyaTimelineClip[];
|
|
2244
|
+
readonly stateMachines: readonly HyaStateMachineV2[];
|
|
2245
|
+
readonly components?: readonly HyaNestedComponentDefinition[];
|
|
2246
|
+
}
|
|
2247
|
+
interface HyaStateMachineV1MigrationResult {
|
|
2248
|
+
readonly document: HyaStateMachineV2Document;
|
|
2249
|
+
readonly diagnostics: readonly Readonly<{
|
|
2250
|
+
code: 'W_STATE_MACHINE_V1_MIGRATED' | 'W_STATE_MACHINE_V1_CHANNEL_POLICY_REQUIRED';
|
|
2251
|
+
path: string;
|
|
2252
|
+
message: string;
|
|
2253
|
+
}>[];
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
interface ParseStateMachineV2Options {
|
|
2257
|
+
readonly limits?: Partial<StateMachineV2Limits>;
|
|
2258
|
+
}
|
|
2259
|
+
declare function parseHyaStateMachineV2(value: unknown, options?: ParseStateMachineV2Options): HyaStateMachineV2Document;
|
|
2260
|
+
|
|
2261
|
+
interface HyaStateMachineV1MigrationOptions {
|
|
2262
|
+
/** Caller-supplied executable v2 channel contracts for tracks in the parent HYA document. */
|
|
2263
|
+
readonly channels?: readonly HyaTimelineChannel[];
|
|
2264
|
+
/** Tracks already adapted from the parent HYA composition, keyed by the v1 named clip id. */
|
|
2265
|
+
readonly tracksByClip?: Readonly<Record<string, readonly HyaTimelineTrack[]>>;
|
|
2266
|
+
}
|
|
2267
|
+
/**
|
|
2268
|
+
* Deterministically migrates the built-in v1 graph without keeping a v1
|
|
2269
|
+
* execution branch. Parent HYA tracks are deliberately supplied by the
|
|
2270
|
+
* generic HYA compiler; this function never samples a source format.
|
|
2271
|
+
*/
|
|
2272
|
+
declare function migrateHyaStateMachineV1(value: unknown, options?: HyaStateMachineV1MigrationOptions): HyaStateMachineV1MigrationResult;
|
|
2273
|
+
|
|
2274
|
+
type StateMachineV2DiagnosticCode = 'E_STATE_MACHINE_V2_FORMAT' | 'E_STATE_MACHINE_V2_NUMBER' | 'E_STATE_MACHINE_V2_REFERENCE' | 'E_STATE_MACHINE_V2_LIMIT' | 'E_STATE_MACHINE_V2_POLICY' | 'E_STATE_MACHINE_V2_GRAPH' | 'E_STATE_MACHINE_V2_MIGRATION';
|
|
2275
|
+
declare class StateMachineV2Diagnostic extends Error {
|
|
2276
|
+
readonly code: StateMachineV2DiagnosticCode;
|
|
2277
|
+
readonly path: string;
|
|
2278
|
+
readonly name = "StateMachineV2Diagnostic";
|
|
2279
|
+
constructor(code: StateMachineV2DiagnosticCode, path: string, message: string);
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
type AnimationFormatErrorCode = 'E_ANIMATION_INVALID_FORMAT' | 'E_ANIMATION_UNSUPPORTED_VERSION' | 'E_ANIMATION_LIMIT_EXCEEDED' | 'E_ANIMATION_MISSING_EXTENSION' | 'E_ANIMATION_INVALID_BINARY';
|
|
2283
|
+
declare class AnimationFormatError extends Error {
|
|
2284
|
+
readonly code: AnimationFormatErrorCode;
|
|
2285
|
+
readonly path: string;
|
|
2286
|
+
readonly name = "AnimationFormatError";
|
|
2287
|
+
constructor(code: AnimationFormatErrorCode, message: string, path?: string);
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
declare function parseAnimation(source: AnimationSource, options?: AnimationParseOptions): ParsedAnimation;
|
|
2291
|
+
|
|
2292
|
+
declare function isAnimationBinary(buffer: ArrayBuffer): boolean;
|
|
2293
|
+
/** Encodes compact indexed metadata plus one contiguous zero-copy Float32 track/path pool. */
|
|
2294
|
+
declare function encodeAnimationBinary(document: AnimationDocument | ParsedAnimation, options?: AnimationParseOptions): ArrayBuffer;
|
|
2295
|
+
declare function decodeAnimationBinary(buffer: ArrayBuffer, options?: AnimationParseOptions): ParsedAnimation;
|
|
2296
|
+
|
|
2297
|
+
declare const HYA_STATE_MACHINE_EXTENSION_ID: "org.haiyue.animation-state-machine@1";
|
|
2298
|
+
/**
|
|
2299
|
+
* Stable channel families shared by the HYA compiler, editor capability UI,
|
|
2300
|
+
* and runtime adapters. A family describes value semantics; concrete channel
|
|
2301
|
+
* ids below additionally describe whether the current shared runtime can
|
|
2302
|
+
* execute that binding without falling back to a second sampler.
|
|
2303
|
+
*/
|
|
2304
|
+
type HyaStateMachineChannelKind = 'continuous-number' | 'discrete-step' | 'shape-morph' | 'resource-switch' | 'particle-side-effect' | 'audio-side-effect' | 'pose-3d';
|
|
2305
|
+
type HyaStateMachineChannelSupport = 'full' | 'degraded' | 'unsupported';
|
|
2306
|
+
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';
|
|
2307
|
+
interface HyaStateMachineChannelCapability {
|
|
2308
|
+
readonly id: HyaStateMachineChannelId;
|
|
2309
|
+
readonly kind: HyaStateMachineChannelKind;
|
|
2310
|
+
readonly support: HyaStateMachineChannelSupport;
|
|
2311
|
+
readonly sampling: 'numeric-track' | 'step-track' | 'effect-cue' | 'pose-buffer';
|
|
2312
|
+
readonly mixing: 'override-additive-layer-mask' | 'dominant-weight-then-action-order' | 'shared-instance-lifecycle' | 'reject-overlap';
|
|
2313
|
+
readonly ownership: 'pose-buffer' | 'shared-visual' | 'shared-side-effect';
|
|
2314
|
+
readonly transition: 'cross-fade' | 'switch-at-dominant-weight' | 'destination-takeover' | 'immediate-only' | 'rejected';
|
|
2315
|
+
/** Stable diagnostic emitted when support is not full. */
|
|
2316
|
+
readonly diagnosticCode?: 'E_STATE_MACHINE_CHANNEL_ADVANCED_INLINE_UNSUPPORTED' | 'E_STATE_MACHINE_CHANNEL_RESOURCE_SWITCH_OVERLAP' | 'E_STATE_MACHINE_CHANNEL_AUDIO_UNMIXABLE_RANGE';
|
|
2317
|
+
}
|
|
2318
|
+
/** Canonical immutable channel registry for the built-in state machine. */
|
|
2319
|
+
declare const HYA_STATE_MACHINE_CHANNEL_REGISTRY: ReadonlyMap<HyaStateMachineChannelId, HyaStateMachineChannelCapability>;
|
|
2320
|
+
declare function hyaStateMachineChannelCapability(id: HyaStateMachineChannelId): HyaStateMachineChannelCapability;
|
|
2321
|
+
interface HyaAnimationClipRange {
|
|
2322
|
+
readonly id: string;
|
|
2323
|
+
readonly name?: string;
|
|
2324
|
+
/** Start in the document composition, in seconds. */
|
|
2325
|
+
readonly start: number;
|
|
2326
|
+
readonly duration: number;
|
|
2327
|
+
}
|
|
2328
|
+
type HyaStateMachineLoopMode = 'once' | 'repeat' | 'ping-pong';
|
|
2329
|
+
type HyaStateMachineBlendMode = 'override' | 'additive';
|
|
2330
|
+
interface HyaStateMachineBindingMask {
|
|
2331
|
+
readonly include?: readonly string[];
|
|
2332
|
+
readonly exclude?: readonly string[];
|
|
2333
|
+
}
|
|
2334
|
+
type HyaStateMachineParameter = Readonly<{
|
|
2335
|
+
name: string;
|
|
2336
|
+
type: 'float';
|
|
2337
|
+
defaultValue: number;
|
|
2338
|
+
}> | Readonly<{
|
|
2339
|
+
name: string;
|
|
2340
|
+
type: 'integer';
|
|
2341
|
+
defaultValue: number;
|
|
2342
|
+
}> | Readonly<{
|
|
2343
|
+
name: string;
|
|
2344
|
+
type: 'boolean';
|
|
2345
|
+
defaultValue: boolean;
|
|
2346
|
+
}> | Readonly<{
|
|
2347
|
+
name: string;
|
|
2348
|
+
type: 'trigger';
|
|
2349
|
+
}>;
|
|
2350
|
+
type HyaStateMachineCondition = Readonly<{
|
|
2351
|
+
parameter: string;
|
|
2352
|
+
operator: 'greater' | 'greater-or-equal' | 'less' | 'less-or-equal';
|
|
2353
|
+
value: number;
|
|
2354
|
+
}> | Readonly<{
|
|
2355
|
+
parameter: string;
|
|
2356
|
+
operator: 'equal' | 'not-equal';
|
|
2357
|
+
value: number | boolean;
|
|
2358
|
+
}> | Readonly<{
|
|
2359
|
+
parameter: string;
|
|
2360
|
+
operator: 'is-true' | 'is-false' | 'triggered';
|
|
2361
|
+
}>;
|
|
2362
|
+
interface HyaStateMachineClipMotion {
|
|
2363
|
+
readonly kind: 'clip';
|
|
2364
|
+
readonly clipId: string;
|
|
2365
|
+
}
|
|
2366
|
+
interface HyaStateMachineBlend1DMotion {
|
|
2367
|
+
readonly kind: 'blend-1d';
|
|
2368
|
+
readonly parameter: string;
|
|
2369
|
+
readonly children: readonly Readonly<{
|
|
2370
|
+
threshold: number;
|
|
2371
|
+
motion: HyaStateMachineMotion;
|
|
2372
|
+
}>[];
|
|
2373
|
+
}
|
|
2374
|
+
interface HyaStateMachineBlend2DMotion {
|
|
2375
|
+
readonly kind: 'blend-2d';
|
|
2376
|
+
readonly algorithm: 'cartesian' | 'directional';
|
|
2377
|
+
readonly parameterX: string;
|
|
2378
|
+
readonly parameterY: string;
|
|
2379
|
+
readonly children: readonly Readonly<{
|
|
2380
|
+
position: readonly [number, number];
|
|
2381
|
+
motion: HyaStateMachineMotion;
|
|
2382
|
+
}>[];
|
|
2383
|
+
}
|
|
2384
|
+
type HyaStateMachineMotion = HyaStateMachineClipMotion | HyaStateMachineBlend1DMotion | HyaStateMachineBlend2DMotion;
|
|
2385
|
+
interface HyaStateMachineState {
|
|
2386
|
+
readonly id: string;
|
|
2387
|
+
readonly name: string;
|
|
2388
|
+
readonly motion: HyaStateMachineMotion;
|
|
2389
|
+
readonly speed?: number;
|
|
2390
|
+
readonly speedParameter?: string;
|
|
2391
|
+
readonly loop?: HyaStateMachineLoopMode;
|
|
2392
|
+
}
|
|
2393
|
+
interface HyaStateMachineTransition {
|
|
2394
|
+
readonly id: string;
|
|
2395
|
+
readonly from: string | '*';
|
|
2396
|
+
readonly to: string;
|
|
2397
|
+
readonly conditions: readonly HyaStateMachineCondition[];
|
|
2398
|
+
readonly duration: number;
|
|
2399
|
+
readonly hasExitTime?: boolean;
|
|
2400
|
+
readonly exitTime?: number;
|
|
2401
|
+
readonly destinationOffset?: number;
|
|
2402
|
+
readonly interruption?: 'none' | 'source' | 'destination' | 'source-then-destination' | 'destination-then-source';
|
|
2403
|
+
}
|
|
2404
|
+
interface HyaStateMachineLayer {
|
|
2405
|
+
readonly id: string;
|
|
2406
|
+
readonly name: string;
|
|
2407
|
+
readonly initialStateId: string;
|
|
2408
|
+
readonly states: readonly HyaStateMachineState[];
|
|
2409
|
+
readonly transitions: readonly HyaStateMachineTransition[];
|
|
2410
|
+
readonly blendMode?: HyaStateMachineBlendMode;
|
|
2411
|
+
readonly weight?: number;
|
|
2412
|
+
readonly mask?: HyaStateMachineBindingMask;
|
|
2413
|
+
}
|
|
2414
|
+
interface HyaStateMachineDefinition {
|
|
2415
|
+
readonly format: 'haiyue-animation-state-machine@1';
|
|
2416
|
+
readonly id: string;
|
|
2417
|
+
readonly name: string;
|
|
2418
|
+
readonly parameters: readonly HyaStateMachineParameter[];
|
|
2419
|
+
readonly layers: readonly HyaStateMachineLayer[];
|
|
2420
|
+
}
|
|
2421
|
+
interface HyaStateMachineExtension {
|
|
2422
|
+
readonly clips: readonly HyaAnimationClipRange[];
|
|
2423
|
+
readonly stateMachine: HyaStateMachineDefinition;
|
|
2424
|
+
}
|
|
2425
|
+
/** Strictly validates and freezes the built-in HYA state-machine extension. */
|
|
2426
|
+
declare function parseHyaStateMachineExtension(value: unknown, compositionDuration: number, path?: string): HyaStateMachineExtension;
|
|
2427
|
+
|
|
2428
|
+
interface LottieConversionDiagnostic {
|
|
2429
|
+
readonly severity: 'warning' | 'error';
|
|
2430
|
+
readonly code: string;
|
|
2431
|
+
readonly path: string;
|
|
2432
|
+
readonly message: string;
|
|
2433
|
+
}
|
|
2434
|
+
interface LottieFontMetrics {
|
|
2435
|
+
readonly unitsPerEm: number;
|
|
2436
|
+
readonly ascent: number;
|
|
2437
|
+
readonly descent: number;
|
|
2438
|
+
readonly lineGap?: number;
|
|
2439
|
+
readonly capHeight?: number;
|
|
2440
|
+
readonly xHeight?: number;
|
|
2441
|
+
}
|
|
2442
|
+
interface LottieWebFontMapping {
|
|
2443
|
+
readonly uri: string;
|
|
2444
|
+
readonly family?: string;
|
|
2445
|
+
readonly style?: 'normal' | 'italic';
|
|
2446
|
+
readonly weight?: string | number;
|
|
2447
|
+
readonly mimeType?: string;
|
|
2448
|
+
/** Stable content hash used by loaders and import tooling. */
|
|
2449
|
+
readonly integrity?: string;
|
|
2450
|
+
/** Optional measured font metrics recorded by the importer for fidelity review. */
|
|
2451
|
+
readonly metrics?: LottieFontMetrics;
|
|
2452
|
+
}
|
|
2453
|
+
interface LottieFontRequirement {
|
|
2454
|
+
readonly name: string;
|
|
2455
|
+
readonly authoredFamily: string;
|
|
2456
|
+
readonly authoredStyle: string;
|
|
2457
|
+
readonly authoredAscent?: number;
|
|
2458
|
+
readonly usageCount: number;
|
|
2459
|
+
readonly mapped: boolean;
|
|
2460
|
+
readonly resolvedFamily: string;
|
|
2461
|
+
readonly resolvedStyle: 'normal' | 'italic';
|
|
2462
|
+
readonly resolvedWeight: string | number;
|
|
2463
|
+
readonly uri?: string;
|
|
2464
|
+
readonly mimeType?: string;
|
|
2465
|
+
readonly integrity?: string;
|
|
2466
|
+
readonly metrics?: LottieFontMetrics;
|
|
2467
|
+
}
|
|
2468
|
+
interface LottieConversionOptions {
|
|
2469
|
+
name?: string;
|
|
2470
|
+
imageBaseUrl?: string;
|
|
2471
|
+
/** Optional build-time mapping from Lottie fName to a loadable web-font resource. */
|
|
2472
|
+
fonts?: Readonly<Record<string, string | Readonly<LottieWebFontMapping>>>;
|
|
2473
|
+
/** Converts warnings to errors and throws after conversion. */
|
|
2474
|
+
strict?: boolean;
|
|
2475
|
+
}
|
|
2476
|
+
interface LottieConversionResult {
|
|
2477
|
+
readonly document: AnimationDocument;
|
|
2478
|
+
readonly diagnostics: readonly LottieConversionDiagnostic[];
|
|
2479
|
+
readonly convertedLayerCount: number;
|
|
2480
|
+
readonly skippedLayerCount: number;
|
|
2481
|
+
/** Import-time font inventory; unresolved entries retain actionable diagnostics. */
|
|
2482
|
+
readonly fonts: readonly LottieFontRequirement[];
|
|
2483
|
+
}
|
|
2484
|
+
/** Converts the runtime-relevant Lottie subset without importing a Lottie player. */
|
|
2485
|
+
declare function convertLottie(source: string | Readonly<Record<string, unknown>>, options?: LottieConversionOptions): LottieConversionResult;
|
|
2486
|
+
/** Returns the complete authored-font delivery inventory without converting geometry. */
|
|
2487
|
+
declare function inspectLottieFonts(source: string | Readonly<Record<string, unknown>>, mappings?: LottieConversionOptions['fonts']): readonly LottieFontRequirement[];
|
|
2488
|
+
declare function convertLottieDocument(source: string | Readonly<Record<string, unknown>>, options?: LottieConversionOptions): AnimationDocument;
|
|
2489
|
+
|
|
2490
|
+
declare const NATIVE_3D_ANIMATION_EXTENSION_ID: "org.haiyue.animation-3d@1";
|
|
2491
|
+
declare const NATIVE_3D_ANIMATION_FORMAT: "haiyue-animation-3d@1";
|
|
2492
|
+
declare const NATIVE_3D_CLIP_FORMAT: "haiyue-animation3d-clip@1";
|
|
2493
|
+
declare const NATIVE_3D_STATE_MACHINE_FORMAT: "haiyue-animation3d-state-machine@1";
|
|
2494
|
+
type Native3DVec2 = readonly [number, number];
|
|
2495
|
+
type Native3DVec3 = readonly [number, number, number];
|
|
2496
|
+
type Native3DVec4 = readonly [number, number, number, number];
|
|
2497
|
+
type Native3DQuaternion = Native3DVec4;
|
|
2498
|
+
type Native3DScalarRange = number | readonly [number, number];
|
|
2499
|
+
interface Native3DCoordinateSystem {
|
|
2500
|
+
readonly handedness: 'right';
|
|
2501
|
+
readonly upAxis: '+y';
|
|
2502
|
+
readonly forwardAxis: '-z';
|
|
2503
|
+
readonly unit: 'meter';
|
|
2504
|
+
readonly angles: 'radian';
|
|
2505
|
+
readonly rotationStorage: 'normalized-xyzw-quaternion';
|
|
2506
|
+
}
|
|
2507
|
+
interface Native3DViewport {
|
|
2508
|
+
readonly width: number;
|
|
2509
|
+
readonly height: number;
|
|
2510
|
+
}
|
|
2511
|
+
interface Native3DTransform {
|
|
2512
|
+
readonly translation: Native3DVec3;
|
|
2513
|
+
readonly rotation: Native3DQuaternion;
|
|
2514
|
+
readonly scale: Native3DVec3;
|
|
2515
|
+
}
|
|
2516
|
+
interface Native3DMaterial {
|
|
2517
|
+
readonly id: string;
|
|
2518
|
+
readonly name: string;
|
|
2519
|
+
readonly baseColorFactor: Native3DVec4;
|
|
2520
|
+
readonly metallicFactor: number;
|
|
2521
|
+
readonly roughnessFactor: number;
|
|
2522
|
+
readonly emissiveFactor: Native3DVec3;
|
|
2523
|
+
readonly alphaMode: 'opaque' | 'mask' | 'blend';
|
|
2524
|
+
readonly alphaCutoff?: number;
|
|
2525
|
+
readonly doubleSided: boolean;
|
|
2526
|
+
readonly baseColorTexture?: string;
|
|
2527
|
+
readonly normalTexture?: string;
|
|
2528
|
+
readonly metallicRoughnessTexture?: string;
|
|
2529
|
+
readonly emissiveTexture?: string;
|
|
2530
|
+
}
|
|
2531
|
+
type Native3DCameraProjection = Readonly<{
|
|
2532
|
+
kind: 'perspective';
|
|
2533
|
+
fovYRadians: number;
|
|
2534
|
+
near: number;
|
|
2535
|
+
far: number;
|
|
2536
|
+
}> | Readonly<{
|
|
2537
|
+
kind: 'orthographic';
|
|
2538
|
+
orthoHeight: number;
|
|
2539
|
+
near: number;
|
|
2540
|
+
far: number;
|
|
2541
|
+
}>;
|
|
2542
|
+
interface Native3DCameraComponent {
|
|
2543
|
+
readonly id: string;
|
|
2544
|
+
readonly kind: 'camera3d';
|
|
2545
|
+
readonly projection: Native3DCameraProjection;
|
|
2546
|
+
}
|
|
2547
|
+
interface Native3DPrimitiveComponent {
|
|
2548
|
+
readonly id: string;
|
|
2549
|
+
readonly kind: 'primitive3d';
|
|
2550
|
+
readonly primitive: 'box' | 'sphere' | 'plane' | 'cylinder' | 'cone';
|
|
2551
|
+
readonly materialId: string;
|
|
2552
|
+
}
|
|
2553
|
+
interface Native3DModelComponent {
|
|
2554
|
+
readonly id: string;
|
|
2555
|
+
readonly kind: 'model3d';
|
|
2556
|
+
readonly resource: string;
|
|
2557
|
+
readonly materialOverrides?: readonly Readonly<{
|
|
2558
|
+
slot: string;
|
|
2559
|
+
materialId: string;
|
|
2560
|
+
}>[];
|
|
2561
|
+
}
|
|
2562
|
+
interface Native3DParticleDescriptor {
|
|
2563
|
+
readonly maxParticles: number;
|
|
2564
|
+
readonly emissionRate: number;
|
|
2565
|
+
readonly burst: number;
|
|
2566
|
+
readonly duration: number;
|
|
2567
|
+
readonly loop: boolean;
|
|
2568
|
+
readonly seed: number;
|
|
2569
|
+
readonly lifetime: Native3DScalarRange;
|
|
2570
|
+
readonly speed: Native3DScalarRange;
|
|
2571
|
+
readonly direction: Native3DVec3;
|
|
2572
|
+
readonly spread: number;
|
|
2573
|
+
readonly gravity: Native3DVec3;
|
|
2574
|
+
readonly startSize: Native3DScalarRange;
|
|
2575
|
+
readonly endSize: Native3DScalarRange;
|
|
2576
|
+
readonly rotation: Native3DScalarRange;
|
|
2577
|
+
readonly angularVelocity: Native3DScalarRange;
|
|
2578
|
+
readonly startColor: Native3DVec4;
|
|
2579
|
+
readonly endColor: Native3DVec4;
|
|
2580
|
+
readonly shape: 'point' | 'box' | 'sphere';
|
|
2581
|
+
readonly shapeSize?: Native3DVec3;
|
|
2582
|
+
readonly shapeRadius?: number;
|
|
2583
|
+
readonly blendMode: 'normal' | 'additive';
|
|
2584
|
+
readonly textureResource?: string;
|
|
2585
|
+
readonly radial: boolean;
|
|
2586
|
+
readonly opacity: number;
|
|
2587
|
+
readonly depthTest: boolean;
|
|
2588
|
+
readonly depthWrite: boolean;
|
|
2589
|
+
readonly sortMode: 'none' | 'back-to-front';
|
|
2590
|
+
}
|
|
2591
|
+
interface Native3DParticleComponent {
|
|
2592
|
+
readonly id: string;
|
|
2593
|
+
readonly kind: 'particle3d';
|
|
2594
|
+
readonly descriptor: Native3DParticleDescriptor;
|
|
2595
|
+
}
|
|
2596
|
+
type Native3DComponent = Native3DCameraComponent | Native3DPrimitiveComponent | Native3DModelComponent | Native3DParticleComponent;
|
|
2597
|
+
interface Native3DNode {
|
|
2598
|
+
readonly id: string;
|
|
2599
|
+
readonly name: string;
|
|
2600
|
+
readonly parent?: string;
|
|
2601
|
+
readonly start?: number;
|
|
2602
|
+
readonly duration?: number;
|
|
2603
|
+
readonly transform: Native3DTransform;
|
|
2604
|
+
readonly components: readonly Native3DComponent[];
|
|
2605
|
+
}
|
|
2606
|
+
type Native3DBindingTarget = Readonly<{
|
|
2607
|
+
kind: 'node-id';
|
|
2608
|
+
nodeId: string;
|
|
2609
|
+
}> | Readonly<{
|
|
2610
|
+
kind: 'node-path';
|
|
2611
|
+
segments: readonly string[];
|
|
2612
|
+
}> | Readonly<{
|
|
2613
|
+
kind: 'slot';
|
|
2614
|
+
slot: string;
|
|
2615
|
+
}>;
|
|
2616
|
+
type Native3DBinding = Readonly<{
|
|
2617
|
+
id: string;
|
|
2618
|
+
target: Native3DBindingTarget;
|
|
2619
|
+
path: 'transform.translation';
|
|
2620
|
+
valueType: 'vec3';
|
|
2621
|
+
valueSize: 3;
|
|
2622
|
+
}> | Readonly<{
|
|
2623
|
+
id: string;
|
|
2624
|
+
target: Native3DBindingTarget;
|
|
2625
|
+
path: 'transform.rotation';
|
|
2626
|
+
valueType: 'quaternion';
|
|
2627
|
+
valueSize: 4;
|
|
2628
|
+
}> | Readonly<{
|
|
2629
|
+
id: string;
|
|
2630
|
+
target: Native3DBindingTarget;
|
|
2631
|
+
path: 'transform.scale';
|
|
2632
|
+
valueType: 'vec3';
|
|
2633
|
+
valueSize: 3;
|
|
2634
|
+
}> | Readonly<{
|
|
2635
|
+
id: string;
|
|
2636
|
+
target: Native3DBindingTarget;
|
|
2637
|
+
path: 'morph.weights';
|
|
2638
|
+
valueType: 'weights';
|
|
2639
|
+
valueSize: number;
|
|
2640
|
+
}> | Readonly<{
|
|
2641
|
+
id: string;
|
|
2642
|
+
target: Native3DBindingTarget;
|
|
2643
|
+
path: 'property';
|
|
2644
|
+
component: 'material3d' | 'camera3d';
|
|
2645
|
+
property: 'baseColorFactor' | 'metallicFactor' | 'roughnessFactor' | 'emissiveFactor' | 'alphaCutoff' | 'fovYRadians' | 'near' | 'far' | 'orthoHeight';
|
|
2646
|
+
valueType: 'scalar' | 'vec3' | 'vec4';
|
|
2647
|
+
valueSize: 1 | 3 | 4;
|
|
2648
|
+
}>;
|
|
2649
|
+
interface Native3DTrack {
|
|
2650
|
+
readonly id: string;
|
|
2651
|
+
readonly binding: Native3DBinding;
|
|
2652
|
+
readonly interpolation: 'step' | 'linear' | 'cubic-spline';
|
|
2653
|
+
readonly times: readonly number[];
|
|
2654
|
+
readonly values: readonly number[];
|
|
2655
|
+
}
|
|
2656
|
+
interface Native3DEvent {
|
|
2657
|
+
readonly id: string;
|
|
2658
|
+
readonly time: number;
|
|
2659
|
+
readonly name: string;
|
|
2660
|
+
readonly payload?: Readonly<Record<string, unknown>>;
|
|
2661
|
+
}
|
|
2662
|
+
interface Native3DClip {
|
|
2663
|
+
readonly format: typeof NATIVE_3D_CLIP_FORMAT;
|
|
2664
|
+
readonly id: string;
|
|
2665
|
+
readonly name: string;
|
|
2666
|
+
readonly duration: number;
|
|
2667
|
+
readonly tracks: readonly Native3DTrack[];
|
|
2668
|
+
readonly events: readonly Native3DEvent[];
|
|
2669
|
+
}
|
|
2670
|
+
type Native3DStateMachineParameter = Readonly<{
|
|
2671
|
+
name: string;
|
|
2672
|
+
type: 'float';
|
|
2673
|
+
defaultValue: number;
|
|
2674
|
+
}> | Readonly<{
|
|
2675
|
+
name: string;
|
|
2676
|
+
type: 'integer';
|
|
2677
|
+
defaultValue: number;
|
|
2678
|
+
}> | Readonly<{
|
|
2679
|
+
name: string;
|
|
2680
|
+
type: 'boolean';
|
|
2681
|
+
defaultValue: boolean;
|
|
2682
|
+
}> | Readonly<{
|
|
2683
|
+
name: string;
|
|
2684
|
+
type: 'trigger';
|
|
2685
|
+
}>;
|
|
2686
|
+
type Native3DStateMachineMotion = Readonly<{
|
|
2687
|
+
kind: 'clip';
|
|
2688
|
+
clipId: string;
|
|
2689
|
+
}> | Readonly<{
|
|
2690
|
+
kind: 'blend-1d';
|
|
2691
|
+
parameter: string;
|
|
2692
|
+
children: readonly Readonly<{
|
|
2693
|
+
threshold: number;
|
|
2694
|
+
motion: Native3DStateMachineMotion;
|
|
2695
|
+
}>[];
|
|
2696
|
+
}> | Readonly<{
|
|
2697
|
+
kind: 'blend-2d';
|
|
2698
|
+
algorithm: 'cartesian' | 'directional';
|
|
2699
|
+
parameterX: string;
|
|
2700
|
+
parameterY: string;
|
|
2701
|
+
children: readonly Readonly<{
|
|
2702
|
+
position: Native3DVec2;
|
|
2703
|
+
motion: Native3DStateMachineMotion;
|
|
2704
|
+
}>[];
|
|
2705
|
+
}>;
|
|
2706
|
+
interface Native3DStateMachineCondition {
|
|
2707
|
+
readonly parameter: string;
|
|
2708
|
+
readonly operator: 'greater' | 'greater-or-equal' | 'less' | 'less-or-equal' | 'equal' | 'not-equal' | 'is-true' | 'is-false' | 'triggered';
|
|
2709
|
+
readonly value?: number | boolean;
|
|
2710
|
+
}
|
|
2711
|
+
interface Native3DStateMachineState {
|
|
2712
|
+
readonly id: string;
|
|
2713
|
+
readonly name: string;
|
|
2714
|
+
readonly motion: Native3DStateMachineMotion;
|
|
2715
|
+
readonly speed?: number;
|
|
2716
|
+
readonly speedParameter?: string;
|
|
2717
|
+
readonly loop?: 'once' | 'repeat' | 'ping-pong';
|
|
2718
|
+
}
|
|
2719
|
+
interface Native3DStateMachineTransition {
|
|
2720
|
+
readonly id: string;
|
|
2721
|
+
readonly from: string;
|
|
2722
|
+
readonly to: string;
|
|
2723
|
+
readonly conditions: readonly Native3DStateMachineCondition[];
|
|
2724
|
+
readonly duration: number;
|
|
2725
|
+
readonly hasExitTime?: boolean;
|
|
2726
|
+
readonly exitTime?: number;
|
|
2727
|
+
readonly destinationOffset?: number;
|
|
2728
|
+
readonly interruption?: 'none' | 'source' | 'destination' | 'source-then-destination' | 'destination-then-source';
|
|
2729
|
+
}
|
|
2730
|
+
interface Native3DStateMachineLayer {
|
|
2731
|
+
readonly id: string;
|
|
2732
|
+
readonly name: string;
|
|
2733
|
+
readonly initialStateId: string;
|
|
2734
|
+
readonly states: readonly Native3DStateMachineState[];
|
|
2735
|
+
readonly transitions: readonly Native3DStateMachineTransition[];
|
|
2736
|
+
readonly blendMode?: 'override' | 'additive';
|
|
2737
|
+
readonly weight?: number;
|
|
2738
|
+
readonly mask?: Readonly<{
|
|
2739
|
+
include?: readonly string[];
|
|
2740
|
+
exclude?: readonly string[];
|
|
2741
|
+
}>;
|
|
2742
|
+
}
|
|
2743
|
+
interface Native3DStateMachine {
|
|
2744
|
+
readonly format: typeof NATIVE_3D_STATE_MACHINE_FORMAT;
|
|
2745
|
+
readonly id: string;
|
|
2746
|
+
readonly name: string;
|
|
2747
|
+
readonly parameters: readonly Native3DStateMachineParameter[];
|
|
2748
|
+
readonly layers: readonly Native3DStateMachineLayer[];
|
|
2749
|
+
}
|
|
2750
|
+
interface Native3DAnimationPayload {
|
|
2751
|
+
readonly format: typeof NATIVE_3D_ANIMATION_FORMAT;
|
|
2752
|
+
readonly mode: 'native-3d';
|
|
2753
|
+
readonly coordinateSystem: Native3DCoordinateSystem;
|
|
2754
|
+
readonly viewport: Native3DViewport;
|
|
2755
|
+
readonly materials: readonly Native3DMaterial[];
|
|
2756
|
+
readonly nodes: readonly Native3DNode[];
|
|
2757
|
+
readonly clips: readonly Native3DClip[];
|
|
2758
|
+
readonly stateMachine?: Native3DStateMachine | null;
|
|
2759
|
+
}
|
|
2760
|
+
interface Native3DParseLimits {
|
|
2761
|
+
readonly maxMaterials?: number;
|
|
2762
|
+
readonly maxClips?: number;
|
|
2763
|
+
readonly maxStateMachineDepth?: number;
|
|
2764
|
+
}
|
|
2765
|
+
interface Native3DAnimationParseOptions extends AnimationParseLimits, Native3DParseLimits {
|
|
2766
|
+
readonly copyFloatData?: boolean;
|
|
2767
|
+
}
|
|
2768
|
+
interface ParsedNative3DAnimation {
|
|
2769
|
+
readonly document: ParsedAnimation;
|
|
2770
|
+
readonly payload: Native3DAnimationPayload;
|
|
2771
|
+
readonly resources: readonly Readonly<AnimationResource>[];
|
|
2772
|
+
}
|
|
2773
|
+
type Native3DAnimationSource = AnimationSource | AnimationDocument;
|
|
2774
|
+
|
|
2775
|
+
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';
|
|
2776
|
+
/** Stable native-3D extension diagnostic. */
|
|
2777
|
+
declare class Native3DAnimationFormatError extends Error {
|
|
2778
|
+
readonly code: Native3DAnimationDiagnosticCode;
|
|
2779
|
+
readonly path: string;
|
|
2780
|
+
readonly name = "Native3DAnimationFormatError";
|
|
2781
|
+
constructor(code: Native3DAnimationDiagnosticCode, message: string, path: string);
|
|
2782
|
+
}
|
|
2783
|
+
|
|
2784
|
+
declare function createNative3DAnimationExtensionHandler(options?: Native3DAnimationParseOptions, onValidated?: (payload: Native3DAnimationPayload) => void): AnimationExtensionHandler;
|
|
2785
|
+
/** Parses the required 3D extension and rejects mixed 2D/3D carriers. */
|
|
2786
|
+
declare function parseNative3DAnimation(source: Native3DAnimationSource, options?: Native3DAnimationParseOptions): ParsedNative3DAnimation;
|
|
2787
|
+
/** Validates and canonicalizes the extension before any runtime allocation. */
|
|
2788
|
+
declare function parseNative3DAnimationPayload(value: unknown, options?: Native3DAnimationParseOptions): Native3DAnimationPayload;
|
|
2789
|
+
|
|
2790
|
+
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 _, parseHyaInteraction as a$, createDeformableMesh2DFormatHandler as a7, createDeformableMesh2DFormatRegistry as a8, decodeDeformableMesh2DData as a9, InteractionDiagnostic as aF, LayoutDiagnostic as aI, SemanticsDiagnostic as aN, StateMachineV2Diagnostic as aQ, decodeResponsiveLayoutDocument as aS, encodeHyaComposition as aT, encodeResponsiveLayoutDocument as aU, isResponsiveLayoutBinary as aV, migrateHyaStateMachineV1 as aW, negotiateHyaComposition as aX, parseHyaAudioEvents as aY, parseHyaComposition as aZ, parseHyaDataBinding as a_, encodeDeformableMesh2DData as aa, isDeformableMesh2DBinary as ab, AudioEventDiagnostic as ac, DEFAULT_HYA_COMPOSITION_LIMITS as af, DataBindingDiagnostic as ag, HYA_COMPOSITION_FORMAT as ak, HYA_COMPOSITION_VERSION as al, HyaCompositionError as ap, parseHyaSemantics as b0, parseHyaStateMachineV2 as b1, parseResponsiveLayoutDocument as b2, ANIMATION_FILE_EXTENSION as b3, ANIMATION_FORMAT as b4, ANIMATION_MIME_TYPE as b5, ANIMATION_VECTOR_SHAPE_EXTENSION_ID as b6, ANIMATION_VERSION as b7, AnimationExtensionRegistry as br, AnimationFormatError as bv, HYA_SAFE_EXPRESSION_VERSION as c3, HYA_STATE_MACHINE_CHANNEL_REGISTRY as c4, HYA_STATE_MACHINE_EXTENSION_ID as c5, convertLottie as cE, convertLottieDocument as cF, inspectLottieFonts as cG, NATIVE_3D_ANIMATION_EXTENSION_ID as cH, NATIVE_3D_ANIMATION_FORMAT as cI, NATIVE_3D_CLIP_FORMAT as cJ, NATIVE_3D_STATE_MACHINE_FORMAT as cK, Native3DAnimationFormatError as cM, decodeAnimationBinary as co, encodeAnimationBinary as cp, evaluateSafeExpression as cq, extensionIdFromComponentType as cr, hyaStateMachineChannelCapability as cs, isAnimationBinary as ct, parseAnimation as cu, parseHyaStateMachineExtension as cv, safeExpressionDataResources as cw, validateExtensionId as cx, createNative3DAnimationExtensionHandler as dj, parseNative3DAnimation as dk, parseNative3DAnimationPayload as dl, 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 };
|
|
2791
|
+
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, DeformableMesh2DBlendMode as a0, DeformableMesh2DComponent as a1, DeformableMesh2DDataSource as a2, DeformableMesh2DDrawableSource as a3, DeformableMesh2DParseLimits as a4, ParsedDeformableMesh2DData as a5, ParsedDeformableMesh2DDrawable as a6, HyaInteractionDocument as aA, HyaSemanticsDocument as aB, HyaStateMachineV1MigrationOptions as aC, HyaStateMachineV1MigrationResult as aD, HyaStateMachineV2Document as aE, InteractionDiagnosticCode as aG, InteractionParseOptions as aH, LayoutDiagnosticCode as aJ, LayoutParseOptions as aK, ParseStateMachineV2Options as aL, ResponsiveLayoutDocument as aM, SemanticsDiagnosticCode as aO, SemanticsParseOptions as aP, StateMachineV2DiagnosticCode as aR, AudioEventDiagnosticCode as ad, AudioEventParseOptions as ae, DataBindingDiagnosticCode as ah, DataBindingParseOptions as ai, DataValue as aj, HyaAudioEventDocument as am, HyaCompositionDiagnostic as an, HyaCompositionDocument as ao, HyaCompositionErrorCode as aq, HyaCompositionLimits as ar, HyaCompositionParseOptions as as, HyaCompositionParseResult as at, HyaCompositionPart as au, HyaCompositionPartValidator as av, HyaCompositionPlan as aw, HyaCompositionTarget as ax, HyaCompositionValue as ay, HyaDataBindingDocument as az, OfflineConversionArtifact as b, AnimationVectorShapeComponent as b$, AnimationAudioComponent as b8, AnimationAudioResource as b9, AnimationNode as bA, AnimationOpacityEffect as bB, AnimationParseLimits as bC, AnimationParseOptions as bD, AnimationParticle2DComponent as bE, AnimationPath2DComponent as bF, AnimationPathCommand as bG, AnimationResource as bH, AnimationSafeExpressionContext as bI, AnimationSafeExpressionInstruction as bJ, AnimationSafeExpressionProgram as bK, AnimationShape2DComponent as bL, AnimationSource as bM, AnimationSprite2DComponent as bN, AnimationText2DComponent as bO, AnimationTextAnimator as bP, AnimationTextDocumentKeyframe as bQ, AnimationTextRangeSelector as bR, AnimationTextSelectorShape as bS, AnimationTextSelectorUnits as bT, AnimationTextStyleRun as bU, AnimationTintEffect as bV, AnimationTrack as bW, AnimationTrackProperty as bX, AnimationTransform2D as bY, AnimationVectorFeather as bZ, AnimationVectorGradientPaint as b_, AnimationBinaryResource as ba, AnimationBlurEffect as bb, AnimationCanvas as bc, AnimationColorMatrixEffect as bd, AnimationComponent as be, AnimationComposite as bf, AnimationCompositeKind as bg, AnimationCompositeLayer as bh, AnimationCompositeMode as bi, AnimationCompositeOperation as bj, AnimationCompositeStack as bk, AnimationCoordinateSystem as bl, AnimationDocument as bm, AnimationDropShadowEffect as bn, AnimationEndBehavior as bo, AnimationExtensionComponent as bp, AnimationExtensionHandler as bq, AnimationExtensionValidationContext as bs, AnimationFillEffect as bt, AnimationFillRule as bu, AnimationFormatErrorCode as bw, AnimationImageResource as bx, AnimationInterpolation as by, AnimationLayerEffect as bz, OfflineConversionAssetRequest as c, Native3DParseLimits as c$, AnimationVectorSolidPaint as c0, AnimationVectorStrokePaint as c1, AnimationVectorValueTrack as c2, HyaAnimationClipRange as c6, HyaStateMachineBindingMask as c7, HyaStateMachineBlendMode as c8, HyaStateMachineChannelCapability as c9, LottieConversionResult as cA, LottieFontMetrics as cB, LottieFontRequirement as cC, LottieWebFontMapping as cD, Native3DAnimationDiagnosticCode as cL, Native3DAnimationParseOptions as cN, Native3DAnimationPayload as cO, Native3DAnimationSource as cP, Native3DBinding as cQ, Native3DBindingTarget as cR, Native3DCameraComponent as cS, Native3DCameraProjection as cT, Native3DClip as cU, Native3DComponent as cV, Native3DCoordinateSystem as cW, Native3DEvent as cX, Native3DMaterial as cY, Native3DModelComponent as cZ, Native3DNode as c_, HyaStateMachineChannelId as ca, HyaStateMachineChannelKind as cb, HyaStateMachineChannelSupport as cc, HyaStateMachineCondition as cd, HyaStateMachineDefinition as ce, HyaStateMachineExtension as cf, HyaStateMachineLayer as cg, HyaStateMachineLoopMode as ch, HyaStateMachineMotion as ci, HyaStateMachineParameter as cj, HyaStateMachineState as ck, HyaStateMachineTransition as cl, ParsedAnimation as cm, ParsedAnimationTrack as cn, LottieConversionDiagnostic as cy, LottieConversionOptions as cz, OfflineConversionDiagnostic as d, Native3DParticleComponent as d0, Native3DParticleDescriptor as d1, Native3DPrimitiveComponent as d2, Native3DQuaternion as d3, Native3DScalarRange as d4, Native3DStateMachine as d5, Native3DStateMachineCondition as d6, Native3DStateMachineLayer as d7, Native3DStateMachineMotion as d8, Native3DStateMachineParameter as d9, Native3DStateMachineState as da, Native3DStateMachineTransition as db, Native3DTrack as dc, Native3DTransform as dd, Native3DVec2 as de, Native3DVec3 as df, Native3DVec4 as dg, Native3DViewport as dh, ParsedNative3DAnimation as di, 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 };
|