Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix useAnimatedSensor return type #3094

Merged
merged 3 commits into from Apr 12, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion react-native-reanimated.d.ts
Expand Up @@ -501,10 +501,19 @@ declare module 'react-native-reanimated' {
interval: number;
};

export type AnimatedSensor = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason it's using a type rather than an interface?

sensor: SensorValue3D | SensorValueRotation | null;
unregister: () => void;
isAvailable: boolean;
config: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be using the type defined above

Suggested change
config: {
config: SensorConfig

interval: number;
};
};

export function useAnimatedSensor(
sensorType: SensorType,
userConfig?: SensorConfig
);
): AnimatedSensor;

export interface ExitAnimationsValues {
currentOriginX: number;
Expand Down