Skip to content

Commit

Permalink
Fix .d.ts again (#4180)
Browse files Browse the repository at this point in the history
## Summary

* Add missing `InterfaceOrientation`
* Restore missing`EasingFunction`
* Remove `Animated.Extrapolate` from .d.ts

## Test plan
  • Loading branch information
tomekzaw committed Mar 7, 2023
1 parent 1134b95 commit c9873f1
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions react-native-reanimated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,6 @@ declare module 'react-native-reanimated' {
import('./lib/types/lib/reanimated2/commonTypes').MeasuredDimensions;

namespace Animated {
export enum Extrapolate {
EXTEND = 'extend',
CLAMP = 'clamp',
IDENTITY = 'identity',
}

type ExtrapolateParameter =
| Extrapolate
| { extrapolateLeft?: Extrapolate; extrapolateRight?: Extrapolate };

interface InterpolationConfig {
inputRange: ReadonlyArray<Adaptable<number>>;
outputRange: ReadonlyArray<Adaptable<number | string>>;
extrapolate?: ExtrapolateParameter;
extrapolateLeft?: Extrapolate;
extrapolateRight?: Extrapolate;
}
type Value = string | number | boolean;

export type SharedValue<T> = { value: T };
Expand Down Expand Up @@ -133,6 +116,8 @@ declare module 'react-native-reanimated' {
sharedTransitionStyle?: ILayoutAnimationBuilder;
};

export type EasingFunction = (value: number) => number;

// components
export class View extends Component<AnimateProps<ViewProps>> {
getNode(): ReactNativeView;
Expand Down Expand Up @@ -240,6 +225,13 @@ declare module 'react-native-reanimated' {

export type SensorValue3D = SharedValue<Value3D>;

export enum InterfaceOrientation {
ROTATION_0 = 0,
ROTATION_90 = 90,
ROTATION_180 = 180,
ROTATION_270 = 270,
}

export type ValueRotation = {
qw: number;
qx: number;
Expand Down Expand Up @@ -864,7 +856,7 @@ declare module 'react-native-reanimated' {

export function enableLayoutAnimations(flag: boolean): void;

export const Extrapolate: typeof Animated.Extrapolate;
export const Extrapolate: typeof Extrapolation;

type AnimationFactoryType = (values: LayoutAnimationsValues) => StyleProps;

Expand Down

0 comments on commit c9873f1

Please sign in to comment.