()
| 25 | * @docs-private |
| 26 | */ |
| 27 | export function _getAnimationsState(): 'enabled' | 'di-disabled' | 'reduced-motion' { |
| 28 | if ( |
| 29 | inject(MATERIAL_ANIMATIONS, {optional: true})?.animationsDisabled || |
| 30 | inject(ANIMATION_MODULE_TYPE, {optional: true}) === 'NoopAnimations' |
| 31 | ) { |
| 32 | return 'di-disabled'; |
| 33 | } |
| 34 | |
| 35 | reducedMotion ??= inject(MediaMatcher).matchMedia('(prefers-reduced-motion)').matches; |
| 36 | return reducedMotion ? 'reduced-motion' : 'enabled'; |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Returns whether animations have been disabled by DI. Must be called in a DI context. |
no test coverage detected