Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3242395
D5556.id18216.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D5556.id18216.diff
View Options
diff --git a/native/flow-typed/npm/react-native-reanimated_v2.x.x.js b/native/flow-typed/npm/react-native-reanimated_v2.x.x.js
--- a/native/flow-typed/npm/react-native-reanimated_v2.x.x.js
+++ b/native/flow-typed/npm/react-native-reanimated_v2.x.x.js
@@ -14,6 +14,26 @@
*/
declare module 'react-native-reanimated' {
+ // This was taken from the flow typed library definitions of bottom-tabs_v6
+ declare type StyleObj =
+ | null
+ | void
+ | number
+ | false
+ | ''
+ | $ReadOnlyArray<StyleObj>
+ | { [name: string]: any, ... };
+
+ declare type ViewStyleProp = StyleObj;
+ declare type TextStyleProp = StyleObj;
+
+ declare type StyleProps = {|
+ ...ViewStyleProp,
+ ...TextStyleProp,
+ +originX?: number,
+ +originY?: number,
+ +[key: string]: any,
+ |};
declare class Node { }
@@ -123,6 +143,7 @@
...
};
declare export var EasingNode: EasingModule;
+ declare type EasingFn = (t: number) => number;
declare export type TimingState = {
+finished: Value,
@@ -213,6 +234,165 @@
): Node,
|};
+ declare type LayoutAnimation = {|
+ +initialValues: StyleProps,
+ +animations: StyleProps,
+ +callback?: (finished: boolean) => void,
+ |};
+
+ declare type AnimationFunction = (a?: any, b?: any, c?: any) => any;
+
+ declare type EntryAnimationsValues = {|
+ +targetOriginX: number,
+ +targetOriginY: number,
+ +targetWidth: number,
+ +targetHeight: number,
+ +targetGlobalOriginX: number,
+ +targetGlobalOriginY: number,
+ |};
+
+ declare type ExitAnimationsValues = {|
+ +currentOriginX: number,
+ +currentOriginY: number,
+ +currentWidth: number,
+ +currentHeight: number,
+ +currentGlobalOriginX: number,
+ +currentGlobalOriginY: number,
+ |};
+
+ declare export type EntryExitAnimationFunction = (
+ targetValues: EntryAnimationsValues | ExitAnimationsValues,
+ ) => LayoutAnimation;
+
+ declare type AnimationConfigFunction<T> = (
+ targetValues: T,
+ ) => LayoutAnimation;
+
+ declare type LayoutAnimationsValues = {|
+ +currentOriginX: number,
+ +currentOriginY: number,
+ +currentWidth: number,
+ +currentHeight: number,
+ +currentGlobalOriginX: number,
+ +currentGlobalOriginY: number,
+ +targetOriginX: number,
+ +targetOriginY: number,
+ +targetWidth: number,
+ +targetHeight: number,
+ +targetGlobalOriginX: number,
+ +argetGlobalOriginY: number,
+ +windowWidth: number,
+ +windowHeight: number,
+ |};
+
+ declare type LayoutAnimationFunction = (
+ targetValues: LayoutAnimationsValues,
+ ) => LayoutAnimation;
+
+ declare type BaseLayoutAnimationConfig = {|
+ +duration?: number,
+ +easing?: EasingFn,
+ +type?: AnimationFunction,
+ +damping?: number,
+ +mass?: number,
+ +stiffness?: number,
+ +overshootClamping?: number,
+ +restDisplacementThreshold?: number,
+ +restSpeedThreshold?: number,
+ |};
+
+ declare type BaseBuilderAnimationConfig = {|
+ ...BaseLayoutAnimationConfig,
+ rotate?: number | string,
+ |};
+
+ declare type LayoutAnimationAndConfig = [
+ AnimationFunction,
+ BaseBuilderAnimationConfig,
+ ];
+
+ declare export class BaseAnimationBuilder {
+ static duration(durationMs: number): BaseAnimationBuilder;
+ duration(durationMs: number): BaseAnimationBuilder;
+
+ static delay(delayMs: number): BaseAnimationBuilder;
+ delay(delayMs: number): BaseAnimationBuilder;
+
+ static withCallback(
+ callback: (finished: boolean) => void,
+ ): BaseAnimationBuilder;
+ withCallback(callback: (finished: boolean) => void): BaseAnimationBuilder;
+
+ static getDuration(): number;
+ getDuration(): number;
+
+ static randomDelay(): BaseAnimationBuilder;
+ randomDelay(): BaseAnimationBuilder;
+
+ getDelay(): number;
+ getDelayFunction(): AnimationFunction;
+
+ static build(): EntryExitAnimationFunction | LayoutAnimationFunction;
+ }
+
+ declare export type ReanimatedAnimationBuilder =
+ | Class<BaseAnimationBuilder>
+ | BaseAnimationBuilder;
+
+ declare export class ComplexAnimationBuilder extends BaseAnimationBuilder {
+ static easing(easingFunction: EasingFn): ComplexAnimationBuilder;
+ easing(easingFunction: EasingFn): ComplexAnimationBuilder;
+
+ static rotate(degree: string): ComplexAnimationBuilder;
+ rotate(degree: string): ComplexAnimationBuilder;
+
+ static springify(): ComplexAnimationBuilder;
+ springify(): ComplexAnimationBuilder;
+
+ static damping(damping: number): ComplexAnimationBuilder;
+ damping(damping: number): ComplexAnimationBuilder;
+
+ static mass(mass: number): ComplexAnimationBuilder;
+ mass(mass: number): ComplexAnimationBuilder;
+
+ static stiffness(stiffness: number): ComplexAnimationBuilder;
+ stiffness(stiffness: number): ComplexAnimationBuilder;
+
+ static overshootClamping(
+ overshootClamping: number,
+ ): ComplexAnimationBuilder;
+ overshootClamping(overshootClamping: number): ComplexAnimationBuilder;
+
+ static restDisplacementThreshold(
+ restDisplacementThreshold: number,
+ ): ComplexAnimationBuilder;
+ restDisplacementThreshold(
+ restDisplacementThreshold: number,
+ ): ComplexAnimationBuilder;
+
+ static restSpeedThreshold(
+ restSpeedThreshold: number,
+ ): ComplexAnimationBuilder;
+ restSpeedThreshold(restSpeedThreshold: number): ComplexAnimationBuilder;
+
+ static withInitialValues(values: StyleProps): BaseAnimationBuilder;
+ withInitialValues(values: StyleProps): BaseAnimationBuilder;
+
+ getAnimationAndConfig(): LayoutAnimationAndConfig;
+ }
+
+ declare export class SlideInDown extends ComplexAnimationBuilder {
+ static createInstance(): SlideInDown;
+
+ build(): AnimationConfigFunction<EntryAnimationsValues>;
+ }
+
+ declare export class SlideOutDown extends ComplexAnimationBuilder {
+ static createInstance(): SlideOutDown;
+
+ build(): AnimationConfigFunction<ExitAnimationsValues>;
+ }
+
declare type $SyntheticEvent<T: { ... }> = {
+nativeEvent: $ReadOnly<$Exact<T>>,
...
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 14, 8:56 PM (11 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2492861
Default Alt Text
D5556.id18216.diff (5 KB)
Attached To
Mode
D5556: [native] introduced flow type for reanimated layout animations
Attached
Detach File
Event Timeline
Log In to Comment