#include "NamespaceRedirect.h" namespace LottieReactNative { // // This interface is applied to classes generated by LottieGen and is used within LottieView to access metadata about the codegen'd animations. // It must match the code LottieGen generates. // interface ILottieMediaSource { Double FrameCount { get; }; Double Framerate { get; }; Windows.Foundation.TimeSpan Duration { get; }; Windows.Foundation.Collections.IMapView Markers { get; }; // Converts zero-based frame number to corresponding progress value (frame / FrameCount) Double FrameToProgress(Double frame); void SetColorProperty(String propertyName, Windows.UI.Color value); void SetScalarProperty(String propertyName, Double value); }; // // This interface is applied to the LottieCodegenSourceProvider class created by our MSBuild task. // It must match the code LottieGen.*.targets generates. // interface ILottieSourceProvider { // Loads a code-generated animation by name. Only animations registered as LottieAnimation elements in your project file will be available. // Returns null if not found. Windows.Foundation.IAsyncOperation GetSourceFromName(String name); // Loads an animation from JSON dynamically at runtime. This is currently only supported in C# as it requires // use of the .NET-only AnimatedVisualSource. // Returns null if not supported. Windows.Foundation.IAsyncOperation GetSourceFromJson(String json); } runtimeclass ReactPackageProvider : [default]Microsoft.ReactNative.IReactPackageProvider { ReactPackageProvider(ILottieSourceProvider sourceProvider); } // // The XAML element we use to render animations in the UI tree. // Subclassing WinUI 2.x classes is broken (so we can't subclass AnimatedVisualPlayer). Instead we'll subclass Grid and compose // the player as a child element. // [default_interface] runtimeclass LottieView : XAML_NAMESPACE.Controls.Grid { LottieView(); LottieView(Microsoft.ReactNative.IReactContext context, ILottieSourceProvider sourceProvider); XAML_NAMESPACE.Media.Stretch ResizeMode { get; set; }; void SetSourceName(String name); void SetSourceJson(String json); void SetLoop(Boolean loop); void SetNativeLooping(Boolean enable); void SetProgress(Double progress); void SetSpeed(Double speed); void SetColorFilters(Windows.Foundation.Collections.IMapView colors); void ApplyPropertyChanges(); void Play(Int64 from, Int64 to); void Pause(); void Resume(); void Reset(); } }