Skip to content

Commit

Permalink
[BREAKING] Rename animation options class name
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
guyca committed Mar 14, 2019
1 parent dc1b980 commit 4517d22
Showing 1 changed file with 23 additions and 28 deletions.
51 changes: 23 additions & 28 deletions lib/src/interfaces/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,11 @@ export interface OptionsAnimationPropertyConfig {
interpolation?: 'accelerate' | 'decelerate';
}

export interface OptionsAnimationProperties {
/**
* Used to animate the actual content added to the hierarchy.
* Content can be a React component (component) or any other layout (Stack, BottomTabs etc)
*/
export interface ScreenAnimationOptions {
/**
* Animate the element over translateX
*/
Expand Down Expand Up @@ -735,31 +739,19 @@ export interface IconInsets {
right?: number;
}

export interface OptionsAnimationPropertiesId extends OptionsAnimationProperties {
export interface ViewAnimationOptions extends ScreenAnimationOptions {
/**
* ID of the Top Bar we want to animate
*/
id?: string;
}

export interface OptionsAnimationSeparate {
/**
* Used for describing stack commands animations.
*/
export interface StackAnimationOptions {
/**
* Wait for the View to render before start animation
* Example:
```js
animations: {
push: {
waitForRender: true
},
showModal: {
waitForRender: true
},
setRoot: {
waitForRender: true
}
}
}
```
*/
waitForRender?: boolean;
/**
Expand All @@ -770,38 +762,41 @@ export interface OptionsAnimationSeparate {
/**
* Configure animations for the top bar
*/
topBar?: OptionsAnimationPropertiesId;
topBar?: ViewAnimationOptions;
/**
* Configure animations for the bottom tabs
*/
bottomTabs?: OptionsAnimationPropertiesId;
bottomTabs?: ViewAnimationOptions;
/**
* Configure animations for the content (Screen)
*/
content?: OptionsAnimationPropertiesId;
content?: ViewAnimationOptions;
}

export interface OptionsAnimations {
/**
* Used for configuring command animations
*/
export interface AnimationOptions {
/**
* Configure the setRoot animation
*/
setRoot?: OptionsAnimationProperties;
setRoot?: ScreenAnimationOptions;
/**
* Configure what animates when a screen is pushed
*/
push?: OptionsAnimationSeparate;
push?: StackAnimationOptions;
/**
* Configure what animates when a screen is popped
*/
pop?: OptionsAnimationSeparate;
pop?: StackAnimationOptions;
/**
* Configure what animates when modal is shown
*/
showModal?: OptionsAnimationProperties;
showModal?: ScreenAnimationOptions;
/**
* Configure what animates when modal is dismissed
*/
dismissModal?: OptionsAnimationProperties;
dismissModal?: ScreenAnimationOptions;
}

export interface OptionsCustomTransition {
Expand Down Expand Up @@ -906,7 +901,7 @@ setRoot: {
}
```
*/
animations?: OptionsAnimations;
animations?: AnimationOptions;

/**
* Custom Transition used for animate shared element between two screens
Expand Down

0 comments on commit 4517d22

Please sign in to comment.