Platform-specific TypeScript declarations for NativeScript for accessing native objects
84
Build a simple animation manager for a mobile application that handles custom view transitions with configurable duration and easing.
Create an animation manager that can:
Transition Configuration: Accept configuration for a transition including:
Animation Execution: Execute the configured transition and handle:
Multiple Property Animations: Support animating multiple properties simultaneously:
Performance Monitoring: Track basic animation performance:
TransitionConfig interface/class to hold transition parameters (duration, properties to animate, interpolator type)AnimationManager class with methods to:
Provides NativeScript platform declarations for accessing Android widgets and animation APIs.
File: animation-manager.test.ts
Test: Create a fade-in animation that changes alpha from 0 to 1 over 300ms with linear interpolation. Verify the animation completes successfully.
Expected: Animation should complete and return success status with performance metrics showing duration close to 300ms.
File: animation-manager.test.ts
Test: Create an animation that simultaneously changes alpha from 0 to 1 and translates a view by 100 pixels vertically over 500ms. Verify both properties animate together.
Expected: Both alpha and translation animations should execute simultaneously and complete after approximately 500ms.
File: animation-manager.test.ts
Test: Start an animation with 1000ms duration, then cancel it after 200ms. Verify the animation stops and cleanup occurs properly.
Expected: Animation should be canceled before completion, returning a canceled status rather than a completed status.
Install with Tessl CLI
npx tessl i tessl/npm-tns-platform-declarationsevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10