-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
130 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Type definitions for rc-queue-anim 1.6 | ||
// Project: https://github.com/react-component/queue-anim | ||
// Definitions by: jljsj33 <https://github.com/jljsj33> | ||
// Definitions: https://github.com/react-component/queue-anim | ||
import * as React from 'react'; | ||
|
||
export type IQueueType = 'alpha' | 'left' | 'right' | 'top' | 'bottom' | 'scale' | 'scaleBig' | 'scaleX' | 'scaleY'; | ||
export type INumberOrArrayOrFunc = number | [number, number] | ((e: { key: string, index: number }) => number | [number, number]); | ||
export type IEaseType = 'linear' | | ||
'easeInSine' | 'easeOutSine' | 'easeInOutSine' | | ||
'easeInQuad' | 'easeOutQuad' | 'easeInOutQuad' | | ||
'easeInCubic' | 'easeOutCubic' | 'easeInOutCubic' | | ||
'easeInQuart' | 'easeOutQuart' | 'easeInOutQuart' | | ||
'easeInQuint' | 'easeOutQuint' | 'easeInOutQuint' | | ||
'easeInExpo' | 'easeInOutExpo' | 'easeInOutExpo' | | ||
'easeInCirc' | 'easeOutCirc' | 'easeInOutCirc' | | ||
'easeInBack' | 'easeOutBack' | 'easeInOutBack' | | ||
'easeInElastic' | 'easeOutElastic' | 'easeInOutElastic' | | ||
'easeInBounce' | 'easeOutBounce' | 'easeInOutBounce' | | ||
((t: number, b: number, c: number, d: number) => number); // TweenOne ease path; | ||
|
||
export interface IProps { | ||
type?: IQueueType; | ||
animConfig?: {} | [{}]; | ||
delay?: INumberOrArrayOrFunc; | ||
duration?: INumberOrArrayOrFunc; | ||
interval?: INumberOrArrayOrFunc; | ||
leaveReverse?: boolean; | ||
ease?: IEaseType; | ||
appear?: boolean; | ||
component?: string | React.ReactNode; | ||
componentProps?: {}; | ||
animatingClassName?: [string, string]; | ||
forcedReplay?: boolean; | ||
onEnd?: (e: { key: string, type: string }) => void; | ||
} | ||
|
||
export default class RcQueueAnim extends React.Component<IProps> { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as React from 'react'; | ||
|
||
import QueueAnim from '../'; | ||
|
||
export default () => ( | ||
<QueueAnim | ||
type="left" | ||
interval={100} | ||
delay={[100, 200]} | ||
duration={({ key, index }) => { | ||
if (key === '1' || index === 2) { | ||
return 200; | ||
} | ||
return 100; | ||
}} | ||
component="div" | ||
forcedReplay={false} | ||
animatingClassName={['enter', 'leave']} | ||
appear={false} | ||
ease="easeInOutCirc" | ||
leaveReverse={false} | ||
componentProps={{ id: 'Test' }} | ||
onEnd={({ key, type }) => { }} | ||
> | ||
<div key="0">test</div> | ||
<div key="1">test</div> | ||
<div key="2">test</div> | ||
</QueueAnim> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"compilerOptions": { | ||
"strictNullChecks": true, | ||
"moduleResolution": "node", | ||
"jsx": "react", | ||
"target": "es6", | ||
"noImplicitAny": true | ||
} | ||
} |