import { ContextManager, Event, Observable, PlayOptions, Stream } from '@zcomponent/core'; import { HTMLElementProps, ZHTMLElement } from '@zcomponent/html/lib/HTMLElement'; /** * The properties for constructing a Lottie canvas element. */ export interface LottieCanvasConstructorProps extends HTMLElementProps { /** * The Lottie animation JSON file. * @zprop * @zvalues files *.json */ source: string; /** * Whether the animation should autoplay * @zprop * @zdefault false */ autoplay: boolean; } /** * Creates a canvas element that plays a Lottie animation. * @zcomponent * @ztag html/element/LottieAnimation * @zparents html/element/** * @zicon code * @zstream */ export declare class LottieAnimation extends ZHTMLElement implements Stream { protected constructorProps: LottieCanvasConstructorProps; /** * Fires when the animation completes * @zui */ onEnded: Event<[LottieAnimation]>; /** * Fires when the animation is paused * @zui */ onPause: Event<[LottieAnimation]>; /** * Fires when the animation starts playing * @zui */ onPlay: Event<[LottieAnimation]>; /** * Whether the animation should loop * @zgroup Play Settings * @zgrouppriority 20 * @zprop * @zdefault false */ loop: Observable; loaded: Promise; private _loader; private _animation; private _canvas; constructor(contextManager: ContextManager, constructorProps: LottieCanvasConstructorProps); private _onLoopChange; private _load; /** * Start playing the animation * @zprop * @zui */ play(opts?: PlayOptions): void; /** * Pause the animation * @zprop * @zui */ pause(): void; /** * Stop the animation and return to start * @zprop * @zui */ stop(): void; /** * Seek to a specific millisecond in the animation. * @zprop * @zui */ seek(/** @ztype time-milliseconds */ t: number): void; length(): number; dispose(): never; }