import { LitElement } from 'lit'; import { TemplateResult } from 'lit/html.js'; import type { AnimationItem } from 'lottie-web'; import { Manifest, ManifestAnimation } from './manifest'; export declare enum PlayerState { Loading = "loading", Playing = "playing", Paused = "paused", Stopped = "stopped", Frozen = "frozen", Error = "error" } export declare enum PlayMode { Normal = "normal", Bounce = "bounce" } export declare enum PlayerEvents { Load = "load", Error = "error", Ready = "ready", Play = "play", Pause = "pause", Stop = "stop", Freeze = "freeze", Loop = "loop", Complete = "complete", Rendered = "rendered", Frame = "frame" } export interface Versions { lottieWebVersion: string; dotLottiePlayerVersion: string; } export declare type PlaybackOptions = Omit; /** * DotLottiePlayer web component class * * @export * @class DotLottiePlayer * @extends {LitElement} */ export declare class DotLottiePlayer extends LitElement { /** * Animation container. */ protected container: HTMLElement; /** * Play mode. */ mode: PlayMode; /** * Autoplay animation on load. */ autoplay: boolean; /** * Background color. */ background?: string; /** * Show controls. */ controls: boolean; /** * Direction of animation. */ direction: number; /** * Whether to play on mouse hover */ hover: boolean; /** * Whether to loop animation. */ loop?: string; /** * Renderer to use. */ renderer: string; /** * Animation speed. */ speed: number; /** * Bodymovin JSON data or URL to JSON. */ src?: string; /** * Player state. */ currentState: PlayerState; seeker: any; intermission: number; /** * Animation id as string or index to play on load. */ activeAnimationId?: string | null; static get properties(): { mode: { type: StringConstructor; }; autoplay: { type: BooleanConstructor; }; background: { type: StringConstructor; }; controls: { type: BooleanConstructor; }; direction: { type: NumberConstructor; }; hover: { type: BooleanConstructor; }; loop: { type: StringConstructor; }; renderer: { type: StringConstructor; }; speed: { type: NumberConstructor; }; src: { type: StringConstructor; }; currentState: { type: StringConstructor; }; seeker: { type: ObjectConstructor; }; intermission: { type: NumberConstructor; }; activeAnimationId: { type: StringConstructor; }; }; private _io?; private _loop?; private _lottie?; private _prevState?; private _counter; private _activeAnimationIndex; private _manifest; private _animations?; private _count?; constructor(); /** * * @param loop - either a string representing a boolean or a number of loops to play * @returns boolean - if loop was activated or not */ private _parseLoop; /** * Handle visibility change events. */ private _onVisibilityChange; /** * Handles click and drag actions on the progress track. */ private _handleSeekChange; private isLottie; private parseSrc; private _fetchDotLottie; private _fetchJsonFile; private _fetchFileAndLoad; /** * Loads playback options from the manifest file for the active animation. */ private _loadManifestOptions; private _initListeners; /** * Configure and initialize lottie-web player instance. */ load(src: string | AnimationItem, overrideRendererSettings?: Record, playbackOptions?: PlaybackOptions): Promise; /** * Get current animation's id */ getActiveId(): string | null; /** * Get current animation's index */ getActiveAnimationIndex(): number; /** * @returns The current number of animations */ animationCount(): number; /** * * @returns The current manifest. */ getManifest(): Manifest; /** * @returns The current lottie-web instance. */ getLottie(): AnimationItem; /** * @returns The current version of the dotLottie player and lottie-web. */ getVersions(): Versions; private _requireAnimationsInTheManifest; private _requireAnimationsToBeLoaded; /** * Play the previous animation. The order is taken from the manifest. */ previous(playbackOptions?: PlaybackOptions): void; /** * Play the next animation. The order is taken from the manifest. */ next(playbackOptions?: PlaybackOptions): void; /** * Reset to the initial state defined in the manifest. */ reset(): void; private _validateAnimationIndex; /** * Start playing animation. */ play(targetAnimation?: string | number, playbackOptions?: PlaybackOptions): void; /** * Pause animation play. */ pause(): void; /** * Stops animation play. */ stop(): void; /** * Seek to a given frame. */ seek(value: number | string): void; /** * Snapshot the current frame as SVG. * * If 'download' argument is boolean true, then a download is triggered in browser. */ snapshot(download?: boolean): string | void; /** * Freeze animation play. * This internal state pauses animation and is used to differentiate between * user requested pauses and component instigated pauses. */ private freeze; /** * Sets animation play speed. * * @param value Playback speed. */ setSpeed(value?: number): void; /** * Animation play direction. * * @param value Direction values. */ setDirection(value: number): void; /** * Sets the looping of the animation. * * @param value Whether to enable looping. Boolean true enables looping. */ setLooping(value: string): void; isLooping(): boolean; /** * Toggle playing state. */ togglePlay(): void; /** * Toggles animation looping. */ toggleLooping(): void; /** * Returns the styles for the component. */ static get styles(): any; /** * Initialize everything on component first render. */ protected firstUpdated(): Promise; /** * Cleanup on component destroy. */ disconnectedCallback(): void; protected renderControls(): any; render(): TemplateResult | void; } //# sourceMappingURL=dotlottie-player.d.ts.map