(options?: { tension?: number; friction?: number; mass?: number; delay?: number; velocity?: number; animateOptions?: UIViewAnimationOptions; animations?: () => void; completion?: (finished?: boolean) => void })
| 336 | } |
| 337 | |
| 338 | function animateWithSpring(options?: { tension?: number; friction?: number; mass?: number; delay?: number; velocity?: number; animateOptions?: UIViewAnimationOptions; animations?: () => void; completion?: (finished?: boolean) => void }) { |
| 339 | // for convenience, default spring settings are provided |
| 340 | const opt = { |
| 341 | ...CORE_ANIMATION_DEFAULTS.spring, |
| 342 | delay: 0, |
| 343 | animateOptions: null, |
| 344 | animations: null, |
| 345 | completion: null, |
| 346 | ...(options || {}), |
| 347 | }; |
| 348 | const { duration, damping } = getDurationWithDampingFromSpring(opt); |
| 349 | |
| 350 | if (duration === 0) { |
| 351 | UIView.animateWithDurationAnimationsCompletion(0, opt.animations, opt.completion); |
| 352 | return; |
| 353 | } |
| 354 | UIView.animateWithDurationDelayUsingSpringWithDampingInitialSpringVelocityOptionsAnimationsCompletion(duration, opt.delay, damping, opt.velocity, opt.animateOptions, opt.animations, opt.completion); |
| 355 | } |
| 356 | |
| 357 | // these don't exist on iOS. Stub them to empty functions. |
| 358 | export const ad = platformCheck('Utils.ad'); |
nothing calls this directly
no test coverage detected