@vvfx/lottie2ir 0.0.1-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ import type { LottieJSON } from '../common/conversion-types';
2
+ /**
3
+ * Parses serialized input and validates the required root composition fields.
4
+ *
5
+ * Validation is limited to the root composition timing and canvas fields.
6
+ *
7
+ * @throws `LottieConverterError` when the input is not an object with a valid `fr`, `w`, `h`, `ip`, and `op` range.
8
+ */
9
+ export declare function parseLottieInput(input: string | LottieJSON): LottieJSON;
@@ -0,0 +1,27 @@
1
+ import { type IRLayerMatte } from '@vvfx/animation-ir';
2
+ import type { ConversionDiagnostic } from '@vvfx/animation-ir/adapter';
3
+ import type { LottieAsset, LottieFont, LottieImageAsset, LottieLayer, LottiePrecompAsset, LottieVisualLayer } from '../common/conversion-types';
4
+ /** Source layer with the IR identity and graph references resolved for conversion. */
5
+ interface ParsedLottieLayerContext {
6
+ sourceLayer: LottieVisualLayer;
7
+ asset?: LottieImageAsset | LottiePrecompAsset;
8
+ layerId: string;
9
+ parentLayerId?: string;
10
+ matte?: IRLayerMatte;
11
+ }
12
+ interface ParseLottieLayerStackOptions {
13
+ layers: LottieLayer[];
14
+ assetById: ReadonlyMap<string, LottieAsset>;
15
+ fonts: LottieFont[];
16
+ }
17
+ interface ParseLottieLayerStackResult {
18
+ contexts: ParsedLottieLayerContext[];
19
+ diagnostics: ConversionDiagnostic[];
20
+ }
21
+ /**
22
+ * Resolves one Composition's asset, parent, and matte references before layer conversion.
23
+ *
24
+ * Supported layers are returned in IR back-to-front painter order after every reference is known.
25
+ */
26
+ export declare function parseLottieLayerStack({ layers, assetById, fonts, }: ParseLottieLayerStackOptions): ParseLottieLayerStackResult;
27
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { LottieVisualLayer } from '../common/conversion-types';
2
+ export declare function isFiniteNumber(value: unknown): value is number;
3
+ export declare function asRecord(value: unknown): Record<string, unknown> | undefined;
4
+ export declare function toFiniteNumberArray(value: unknown): number[] | undefined;
5
+ export declare function toFirstNumber(value: unknown): number | undefined;
6
+ export declare function isKeyframedProperty(property: Record<string, unknown>): boolean;
7
+ export declare function toFiniteNumber(value: unknown, fallback: number): number;
8
+ /**
9
+ * Returns a Layer whose separated position channels are represented by one combined `ks.p` property.
10
+ *
11
+ * Animated axes are merged on the union of their keyframe times; an axis without a keyframe at a merged time is
12
+ * linearly sampled between its surrounding values.
13
+ */
14
+ export declare function normalizeSeparatedPosition(lottieLayer: LottieVisualLayer): {
15
+ layer: LottieVisualLayer;
16
+ approximated: boolean;
17
+ };
@@ -0,0 +1,3 @@
1
+ import type { LottieLayer } from '../common/conversion-types';
2
+ /** Returns the first Text Document keyframe used for static text conversion. */
3
+ export declare function parseLottieTextDocument(layer: LottieLayer): Record<string, unknown> | undefined;
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@vvfx/lottie2ir",
3
+ "version": "0.0.1-beta.10",
4
+ "description": "Lottie to Animation IR converter",
5
+ "module": "./dist/index.mjs",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.mjs",
14
+ "require": "./dist/index.js",
15
+ "types": "./dist/index.d.ts"
16
+ }
17
+ },
18
+ "dependencies": {
19
+ "@lottie-animation-community/lottie-types": "^1.2.0",
20
+ "@progress/jszip-esm": "^1.0.4",
21
+ "uuid": "^13.0.0",
22
+ "@vvfx/animation-ir": "0.0.1-beta.10"
23
+ },
24
+ "devDependencies": {
25
+ "@galacean/effects": "2.9.0",
26
+ "@galacean/effects-specification": "2.7.2",
27
+ "@lottie-animation-community/lottie-specs": "^0.3.2",
28
+ "ajv": "^8.20.0",
29
+ "@vvfx/ge-ir": "0.0.1-beta.10"
30
+ },
31
+ "contributors": [
32
+ {
33
+ "name": "澄弈"
34
+ }
35
+ ],
36
+ "author": "Ant Group CO., Ltd.",
37
+ "license": "MIT",
38
+ "publishConfig": {
39
+ "access": "public",
40
+ "registry": "https://registry.npmjs.org"
41
+ },
42
+ "scripts": {
43
+ "prebuild": "pnpm clean",
44
+ "build": "pnpm build:declaration && pnpm build:module",
45
+ "build:module": "rollup -c --bundleConfigAsCjs",
46
+ "build:declaration": "tsc -b ../animation-ir tsconfig.json --emitDeclarationOnly",
47
+ "clean": "rimraf dist *.tsbuildinfo",
48
+ "test": "vitest run"
49
+ }
50
+ }