Ver código fonte

[BREAKING] Rename animation options class name

I found the names used for the animation classes to be a bit undescriptive,
even though this might break a few users I think it’s for the best as a few
contributors were confused by these names as well.
Guy Carmeli 6 anos atrás
pai
commit
4517d22b38
1 arquivos alterados com 23 adições e 28 exclusões
  1. 23
    28
      lib/src/interfaces/Options.ts

+ 23
- 28
lib/src/interfaces/Options.ts Ver arquivo

672
   interpolation?: 'accelerate' | 'decelerate';
672
   interpolation?: 'accelerate' | 'decelerate';
673
 }
673
 }
674
 
674
 
675
-export interface OptionsAnimationProperties {
675
+/**
676
+ * Used to animate the actual content added to the hierarchy.
677
+ * Content can be a React component (component) or any other layout (Stack, BottomTabs etc)
678
+ */
679
+export interface ScreenAnimationOptions {
676
   /**
680
   /**
677
    * Animate the element over translateX
681
    * Animate the element over translateX
678
    */
682
    */
735
   right?: number;
739
   right?: number;
736
 }
740
 }
737
 
741
 
738
-export interface OptionsAnimationPropertiesId extends OptionsAnimationProperties {
742
+export interface ViewAnimationOptions extends ScreenAnimationOptions {
739
   /**
743
   /**
740
    * ID of the Top Bar we want to animate
744
    * ID of the Top Bar we want to animate
741
    */
745
    */
742
   id?: string;
746
   id?: string;
743
 }
747
 }
744
 
748
 
745
-export interface OptionsAnimationSeparate {
749
+/**
750
+ * Used for describing stack commands animations.
751
+ */
752
+export interface StackAnimationOptions {
746
   /**
753
   /**
747
    * Wait for the View to render before start animation
754
    * Wait for the View to render before start animation
748
-   * Example:
749
-   ```js
750
-   animations: {
751
-     push: {
752
-       waitForRender: true
753
-     },
754
-     showModal: {
755
-       waitForRender: true
756
-     },
757
-     setRoot: {
758
-       waitForRender: true
759
-     }
760
-     }
761
-   }
762
-   ```
763
    */
755
    */
764
   waitForRender?: boolean;
756
   waitForRender?: boolean;
765
   /**
757
   /**
770
   /**
762
   /**
771
    * Configure animations for the top bar
763
    * Configure animations for the top bar
772
    */
764
    */
773
-  topBar?: OptionsAnimationPropertiesId;
765
+  topBar?: ViewAnimationOptions;
774
   /**
766
   /**
775
    * Configure animations for the bottom tabs
767
    * Configure animations for the bottom tabs
776
    */
768
    */
777
-  bottomTabs?: OptionsAnimationPropertiesId;
769
+  bottomTabs?: ViewAnimationOptions;
778
   /**
770
   /**
779
    * Configure animations for the content (Screen)
771
    * Configure animations for the content (Screen)
780
    */
772
    */
781
-  content?: OptionsAnimationPropertiesId;
773
+  content?: ViewAnimationOptions;
782
 }
774
 }
783
 
775
 
784
-export interface OptionsAnimations {
776
+/**
777
+ * Used for configuring command animations
778
+ */
779
+export interface AnimationOptions {
785
   /**
780
   /**
786
    * Configure the setRoot animation
781
    * Configure the setRoot animation
787
    */
782
    */
788
-  setRoot?: OptionsAnimationProperties;
783
+  setRoot?: ScreenAnimationOptions;
789
   /**
784
   /**
790
    * Configure what animates when a screen is pushed
785
    * Configure what animates when a screen is pushed
791
    */
786
    */
792
-  push?: OptionsAnimationSeparate;
787
+  push?: StackAnimationOptions;
793
   /**
788
   /**
794
    * Configure what animates when a screen is popped
789
    * Configure what animates when a screen is popped
795
    */
790
    */
796
-  pop?: OptionsAnimationSeparate;
791
+  pop?: StackAnimationOptions;
797
   /**
792
   /**
798
    * Configure what animates when modal is shown
793
    * Configure what animates when modal is shown
799
    */
794
    */
800
-  showModal?: OptionsAnimationProperties;
795
+  showModal?: ScreenAnimationOptions;
801
   /**
796
   /**
802
    * Configure what animates when modal is dismissed
797
    * Configure what animates when modal is dismissed
803
    */
798
    */
804
-  dismissModal?: OptionsAnimationProperties;
799
+  dismissModal?: ScreenAnimationOptions;
805
 }
800
 }
806
 
801
 
807
 export interface OptionsCustomTransition {
802
 export interface OptionsCustomTransition {
906
 }
901
 }
907
 ```
902
 ```
908
    */
903
    */
909
-  animations?: OptionsAnimations;
904
+  animations?: AnimationOptions;
910
 
905
 
911
   /**
906
   /**
912
    * Custom Transition used for animate shared element between two screens
907
    * Custom Transition used for animate shared element between two screens