import * as PIXI from "pixi.js"; import zod from "zod"; import { WrapModeEnum } from '../../../../types'; import { Clip, ClipOptions } from "../../Clip"; import { ClipStyle } from "../../ClipStyle"; /** * Normalized gradient payload used by editable Lottie gradient properties. */ export interface IGradientColor { colorStops: number[]; colorValues: number[][]; alphaStops: number[]; alphaValues: number[]; } /** * Supported editable property types exposed by a `LottieClip`. */ export declare enum LottiePropertyTypeEnum { TEXT = "text", FILL_COLOR = "fill-color", STROKE_COLOR = "stroke-color", STROKE_WIDTH = "stroke-width", GRADIENT_FILL_COLOR = "gradient-fill-color", GRADIENT_STROKE_COLOR = "gradient-stroke-color", IMAGE = "image" } /** * Zod schema for one editable Lottie property descriptor. */ export declare const PropertySchema: zod.ZodObject<{ id: zod.ZodString; type: zod.ZodDefault>; label: zod.ZodString; path: zod.ZodString; group: zod.ZodOptional; value: zod.ZodOptional; }, "strip", zod.ZodTypeAny, { type: LottiePropertyTypeEnum; path: string; label: string; id: string; group?: string | undefined; value?: unknown; }, { path: string; label: string; id: string; type?: LottiePropertyTypeEnum | undefined; group?: string | undefined; value?: unknown; }>; /** * Zod schema for a Lottie property group definition. */ export declare const GroupSchema: zod.ZodObject<{ id: zod.ZodString; label: zod.ZodString; }, "strip", zod.ZodTypeAny, { label: string; id: string; }, { label: string; id: string; }>; /** * Zod schema for the optional external property manifest consumed by `LottieClip`. */ export declare const PropertiesSchema: zod.ZodObject<{ version: zod.ZodNumber; groups: zod.ZodOptional, "many">>; properties: zod.ZodArray>; label: zod.ZodString; path: zod.ZodString; group: zod.ZodOptional; value: zod.ZodOptional; }, "strip", zod.ZodTypeAny, { type: LottiePropertyTypeEnum; path: string; label: string; id: string; group?: string | undefined; value?: unknown; }, { path: string; label: string; id: string; type?: LottiePropertyTypeEnum | undefined; group?: string | undefined; value?: unknown; }>, "many">; }, "strip", zod.ZodTypeAny, { properties: { type: LottiePropertyTypeEnum; path: string; label: string; id: string; group?: string | undefined; value?: unknown; }[]; version: number; groups?: { label: string; id: string; }[] | undefined; }, { properties: { path: string; label: string; id: string; type?: LottiePropertyTypeEnum | undefined; group?: string | undefined; value?: unknown; }[]; version: number; groups?: { label: string; id: string; }[] | undefined; }>; /** * Convenience alias for a validated Lottie property group entry. */ export type Group = zod.infer; /** * Convenience alias for a validated editable Lottie property entry. */ export type Property = zod.infer; /** * Options for creating a Lottie-backed clip. */ export interface LottieClipOptions extends ClipOptions { dataUrl: string; assetsUrl?: string; propertiesUrl?: string; groups?: zod.infer[]; properties?: zod.infer[]; playbackSpeed?: number; } /** * Clip implementation for Lottie animations rendered into a canvas-backed Pixi texture. * * In addition to normal clip timing/styling, this class exposes a property editing surface for text, fills, * gradients, and images defined inside the Lottie composition. */ export declare class LottieClip extends Clip> { private dataUrl; private assetsUrl; private animation?; private propertiesUrl?; private playbackSpeed; protected properties: Property[]; protected groups: Group[]; private propertyMap; private autoFit; private canvas; private context; private lastUpdatedFrame; private hasTimeExpression; constructor(options: LottieClipOptions); init(layerId: string): Promise; private checkForTimeExpressions; private applyProperties; /** * Returns the raw Lottie animation JSON currently loaded in the runtime animation instance. * * @returns The animation data object, or `undefined` when the animation is not initialized yet. */ getAnimationData(): any | undefined; /** * Replaces the in-memory Lottie animation data and rebuilds the runtime renderer around it. * * This is intended for editor workflows that mutate the composition definition after the clip is already loaded. * * @param data New Lottie animation JSON payload. * @returns A promise that resolves after the new animation is ready for rendering. */ replaceAnimationData(data: any): Promise; private initProperties; /** * Sets the value of an exposed Lottie property and applies the change to the current animation renderer. * * Supported property types also create undo records so editor changes can be reverted. * * @param propertyId Property descriptor id from the clip's property manifest. * @param value New property value. */ setProperty(propertyId: string, value: unknown): void; /** * Returns the available Lottie property groups. * * @returns Property groups used to organize editable properties in the UI. */ getGroups(): { label: string; id: string; }[]; /** * Returns the full property map keyed by property id. * * @returns Editable Lottie property descriptors. */ getProperties(): Map; /** * Returns one editable property descriptor by id. * * @param propertyId Property descriptor id. * @returns The property descriptor, or `undefined` if it is not exposed. */ getProperty(propertyId: string): { type: LottiePropertyTypeEnum; path: string; label: string; id: string; group?: string | undefined; value?: unknown; } | undefined; /** * Reads the current value of an exposed Lottie property, falling back to the live animation state when needed. * * @param propertyId Property descriptor id. * @returns The resolved property value, or `undefined` when the property cannot be found. */ getPropertyValue(propertyId: string): any; preload(currentTime: number): void; updateVisibility(currentTime: number): void; private getGlobalTimeToClipTime; update(currentTime: number): void; clone(): LottieClip; destroy(): void; private getElementFromPath; replaceText(path: string | number, text: string): void; private updateShapesFillCachedData; private updateShapesStrokeColorCachedData; private updateShapesGradientFillColorData; private updateShapesGradientStrokeColorData; private updateShapesStrokeWidthCachedData; replaceFillColor(path: string | number, color: Array): void; replaceStrokeColor(path: string | number, color: Array): void; replaceStrokeWidth(path: string | number, width: number): void; replaceImage(layerId: string | number, url: string): void; replaceGradientFillColor(path: string | number, colorData: IGradientColor): void; replaceGradientStrokeColor(path: string | number, colorData: IGradientColor): void; /** * Updates the Lottie playback speed and retimes trims/start-time so the clip stays consistent on the timeline. * * @param speed New playback speed multiplier. * @param perserveLeftBound When `true`, keeps the current visible left edge anchored in timeline space. * @param perserveTrimmedDuration When `true`, attempts to preserve the current trimmed visible duration. */ setPlaybackSpeed(speed: number, perserveLeftBound?: boolean, perserveTrimmedDuration?: boolean): void; /** * Returns the current Lottie playback speed multiplier. * * @returns Playback speed multiplier. */ getPlaybackSpeed(): number; /** * Serializes the Lottie clip, including URLs, editable properties, groups, and playback speed. * * @returns Serialized Lottie clip payload. */ serialize(): { type: string; id: string; duration: number; subtitlesOffset: number; startTime: number; leftTrim: number; rightTrim: number; filters: { intensity: number; id: string; provider: string; filterId: string; clipId?: string | undefined; }[]; effects: any[]; isVisible: boolean; playbackSpeed: number; dataUrl: string; text?: string | undefined; name?: string | undefined; customData?: [string, unknown][] | undefined; wrapMode?: WrapModeEnum | undefined; blendMode?: import('../../../../types').BlendModeEnum | undefined; style?: unknown; mediaDataId?: string | undefined; subtitlesId?: string | undefined; animationController?: { animationInDuration: number; animationOutDuration: number; animationLoopCount: number; loopSmoothing: number; animationDataIn?: { name: string; inOutOfRange: import("../../../..").OutOfRangeEnum; outOutOfRange: import("../../../..").OutOfRangeEnum; propertyAnimations: { property: string; keyframes: { value: string | number; time: number; easing: import("../../../..").EasingEnum; space: import("../../../..").AnimationSpaceEnum; relativeProperty?: string | undefined; }[]; inOutOfRange: import("../../../..").OutOfRangeEnum; outOutOfRange: import("../../../..").OutOfRangeEnum; }[]; speed?: number | undefined; offset?: number | undefined; amplification?: number | undefined; } | undefined; animationDataOut?: { name: string; inOutOfRange: import("../../../..").OutOfRangeEnum; outOutOfRange: import("../../../..").OutOfRangeEnum; propertyAnimations: { property: string; keyframes: { value: string | number; time: number; easing: import("../../../..").EasingEnum; space: import("../../../..").AnimationSpaceEnum; relativeProperty?: string | undefined; }[]; inOutOfRange: import("../../../..").OutOfRangeEnum; outOutOfRange: import("../../../..").OutOfRangeEnum; }[]; speed?: number | undefined; offset?: number | undefined; amplification?: number | undefined; } | undefined; animationDataLoop?: { name: string; inOutOfRange: import("../../../..").OutOfRangeEnum; outOutOfRange: import("../../../..").OutOfRangeEnum; propertyAnimations: { property: string; keyframes: { value: string | number; time: number; easing: import("../../../..").EasingEnum; space: import("../../../..").AnimationSpaceEnum; relativeProperty?: string | undefined; }[]; inOutOfRange: import("../../../..").OutOfRangeEnum; outOutOfRange: import("../../../..").OutOfRangeEnum; }[]; speed?: number | undefined; offset?: number | undefined; amplification?: number | undefined; } | undefined; } | undefined; clipMasks?: { wrapMode: import("../../../filter").MaskWrapModeEnum; id: string; clipId: string; }[] | undefined; propertyAnimator?: { tracks: { type: import("../../../library").PropertyDescriptionTypeEnum; property: string; keyframes: { value: (string | number | boolean | number[]) & (string | number | boolean | number[] | undefined); time: number; handleIn: { value: number; time: number; }; handleOut: { value: number; time: number; }; hold?: boolean | undefined; }[]; defaults?: { handleIn?: { value: number; time: number; } | undefined; handleOut?: { value: number; time: number; } | undefined; hold?: boolean | undefined; } | undefined; customData?: [string, unknown][] | undefined; }[]; initialValues?: [string, string | number | boolean | number[]][] | undefined; } | undefined; assetsUrl?: string | undefined; propertiesUrl?: string | undefined; groups?: { label: string; id: string; }[] | undefined; properties?: { type: LottiePropertyTypeEnum; path: string; label: string; id: string; group?: string | undefined; value?: unknown; }[] | undefined; }; /** * Reconstructs a Lottie clip from serialized state. * * @param payload Serialized Lottie clip payload. * @returns Deserialized Lottie clip instance. */ static deserialize(payload: object): LottieClip; }