@haiyue/animation-spec 0.2.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/bin/hya-live2d-convert.mjs +0 -0
- package/bin/hya-lottie-convert.mjs +0 -0
- package/dist/hya-production.d.ts +1 -0
- package/dist/hya-production.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/lottie.d.ts +1 -1
- package/dist/native3d.d.ts +1 -1
- package/dist/shared.d.ts +1300 -2
- package/package.json +93 -89
- package/schema/animation.schema.json +12 -12
- package/schema/hya-composition.schema.json +41 -0
- package/schema/responsive-layout-2d.schema.json +1 -1
package/dist/shared.d.ts
CHANGED
|
@@ -981,6 +981,1304 @@ declare function decodeDeformableMesh2DData(buffer: ArrayBuffer, limits?: Deform
|
|
|
981
981
|
declare function createDeformableMesh2DFormatHandler(): AnimationExtensionHandler;
|
|
982
982
|
declare function createDeformableMesh2DFormatRegistry(): AnimationExtensionRegistry;
|
|
983
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
|
+
|
|
984
2282
|
type AnimationFormatErrorCode = 'E_ANIMATION_INVALID_FORMAT' | 'E_ANIMATION_UNSUPPORTED_VERSION' | 'E_ANIMATION_LIMIT_EXCEEDED' | 'E_ANIMATION_MISSING_EXTENSION' | 'E_ANIMATION_INVALID_BINARY';
|
|
985
2283
|
declare class AnimationFormatError extends Error {
|
|
986
2284
|
readonly code: AnimationFormatErrorCode;
|
|
@@ -1489,5 +2787,5 @@ declare function parseNative3DAnimation(source: Native3DAnimationSource, options
|
|
|
1489
2787
|
/** Validates and canonicalizes the extension before any runtime allocation. */
|
|
1490
2788
|
declare function parseNative3DAnimationPayload(value: unknown, options?: Native3DAnimationParseOptions): Native3DAnimationPayload;
|
|
1491
2789
|
|
|
1492
|
-
export { DEFORMABLE_MESH_2D_MAX_MASK_REFERENCES as $, CUBISM_CAPTURE_FRAME_OPERATIONS as C, CubismClipBakedAdapter as J, combineCubismCaptureClips as T, convertCubismCaptureToHya as U, listCubismModel3Motions as V, runCubismClipBakedConversion as W, sampleCubismMotion3 as X, DEFORMABLE_MESH_2D_DATA_FORMAT as Y, DEFORMABLE_MESH_2D_DATA_VERSION as Z, DEFORMABLE_MESH_2D_EXTENSION_ID as _, createDeformableMesh2DFormatHandler as a7, createDeformableMesh2DFormatRegistry as a8, decodeDeformableMesh2DData as a9,
|
|
1493
|
-
export type { CubismCaptureConversionOptions as A, CubismCaptureConversionResult as B, CubismCaptureDiagnostic as D, CubismCaptureFrame as E, CubismCaptureSet as F, CubismCaptureSetOptions as G, CubismCaptureTexture as H, CubismCapturedDrawable as I, CubismClipBakedConversionOptions as K, CubismClipBakedRecipe as L, CubismClipBakedSource as M, CubismDrawableCapture as N, OfflineConversionAdapter as O, CubismModel3MotionReference as P, CubismMotion3 as Q, CubismMotion3Curve as R, CubismMotion3Sample as S, OfflineConversionAdapterContext as a,
|
|
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 };
|