import * as lottie_web from 'lottie-web'; import * as rxjs from 'rxjs'; import { Observable } from 'rxjs'; import * as i0 from '@angular/core'; import { InjectionToken, Provider, OnDestroy, SimpleChanges, OnChanges, ElementRef } from '@angular/core'; interface BMEnterFrameEvent { type: 'enterFrame'; currentTime: number; totalTime: number; duration: number; } interface BMCompleteLoopEvent { type: 'loopComplete'; currentLoop: boolean | number; totalLoops: number; direction: number; } interface BMCompleteEvent { type: 'complete'; direction: number; } interface BMSegmentStartEvent { type: 'segmentStart'; firstFrame: number; totalFrames: number; } interface BMDestroyEvent { target: AnimationItem; type: 'destroy'; } interface BMRenderFrameErrorEvent { type: 'renderFrameError'; nativeError: Error; currentTime: number; } interface BMConfigErrorEvent { type: 'configError'; nativeError: Error; } type AnimationFilename = string; type AnimationItem = lottie_web.AnimationItem; type LottiePlayer = typeof lottie_web.default; /** * @example * import player from 'lottie-web'; * const factory = () => player; */ type LottiePlayerFactory = () => LottiePlayer; /** * @example * const factory = () => import('lottie-web'); */ type LottieLoader = () => Promise; type LottiePlayerFactoryOrLoader = LottiePlayerFactory | LottieLoader; interface LottieOptions { useWebWorker?: boolean; player: LottiePlayerFactoryOrLoader; } type RendererType = lottie_web.RendererType; type AnimationConfigWithData = lottie_web.AnimationConfigWithData; type AnimationConfigWithPath = lottie_web.AnimationConfigWithPath; type AnimationOptions = Partial> | Partial>; declare const LOTTIE_OPTIONS: InjectionToken; declare class AnimationLoader { protected player$: Observable; private ngZone; loadAnimation(options: AnimationConfigWithData | AnimationConfigWithPath): Observable; resolveOptions(options: AnimationOptions | null, container: HTMLElement): AnimationConfigWithData | AnimationConfigWithPath; protected createAnimationItem(player: LottiePlayer, options: AnimationConfigWithData | AnimationConfigWithPath): AnimationItem; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare function provideCacheableAnimationLoader(): Provider[]; declare function provideLottieOptions(options: LottieOptions): Provider[]; declare class BaseDirective implements OnDestroy { options: i0.InputSignal; containerClass: i0.InputSignal; styles: i0.InputSignal | null>; /** * `animationCreated` is dispatched after calling `loadAnimation`. */ readonly animationCreated: Observable; /** * `complete` is dispatched after completing the last frame. */ readonly complete: Observable; /** * `loopComplete` is dispatched after completing the frame loop. */ readonly loopComplete: Observable; /** * `enterFrame` is dispatched after entering the new frame. */ readonly enterFrame: Observable; /** * `segmentStart` is dispatched when the new segment is adjusted. */ readonly segmentStart: Observable; /** * Original event name is `config_ready`. `config_ready` is dispatched * after the needed renderer is configured. */ readonly configReady: Observable; /** * Original event name is `data_ready`. `data_ready` is dispatched * when all parts of the animation have been loaded. */ readonly dataReady: Observable; /** * Original event name is `DOMLoaded`. `DOMLoaded` is dispatched * when elements have been added to the DOM. */ readonly domLoaded: Observable; /** * `destroy` will be dispatched when the component gets destroyed, * it's handy for releasing resources. */ readonly destroy: Observable; /** * `error` will be dispatched if the Lottie player could not render * some frame or parse config. */ readonly error: Observable; private ngZone; private isBrowser; private animationLoader; private loadAnimation$; private animationItem$; constructor(); ngOnDestroy(): void; protected loadAnimation(changes: SimpleChanges, container: HTMLElement): void; private getAnimationItem; private awaitAnimationItemAndStartListening; private setupLoadAnimationListener; private destroyAnimation; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class LottieDirective extends BaseDirective implements OnChanges { private host; ngOnChanges(changes: SimpleChanges): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class LottieComponent extends BaseDirective implements OnChanges { width: i0.InputSignal; height: i0.InputSignal; container: ElementRef; ngOnChanges(changes: SimpleChanges): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class LottieTransferState { private transferState; get(animation: AnimationFilename): T | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare function transformAnimationFilenameToKey(animation: AnimationFilename): string; declare class CacheableAnimationLoader extends AnimationLoader implements OnDestroy { private cache; ngOnDestroy(): void; loadAnimation(options: AnimationConfigWithData | AnimationConfigWithPath): rxjs.Observable; private awaitConfigAndCache; private transformOptions; private isAnimationConfigWithPath; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { AnimationLoader, BaseDirective, LottieComponent, LottieDirective, LottieTransferState, provideCacheableAnimationLoader, provideLottieOptions, transformAnimationFilenameToKey, CacheableAnimationLoader as ɵCacheableAnimationLoader, LOTTIE_OPTIONS as ɵLOTTIE_OPTIONS }; export type { AnimationFilename, AnimationOptions, BMCompleteEvent, BMCompleteLoopEvent, BMConfigErrorEvent, BMDestroyEvent, BMEnterFrameEvent, BMRenderFrameErrorEvent, BMSegmentStartEvent };