UNPKG

1.01 kBTypeScriptView Raw
1import type { Component } from 'react';
2import type { AnimatedRef } from '../hook/commonTypes';
3/** An object which contains relative coordinates. */
4export interface ComponentCoords {
5 x: number;
6 y: number;
7}
8/**
9 * Lets you determines the location on the screen, relative to the given view.
10 *
11 * @param animatedRef - An [animated
12 * ref](https://docs.swmansion.com/react-native-reanimated/docs/core/useAnimatedRef#returns)
13 * connected to the component you'd want to get the coordinates from.
14 * @param absoluteX - A number which is an absolute x coordinate.
15 * @param absoluteY - A number which is an absolute y coordinate.
16 * @returns An object which contains relative coordinates -
17 * {@link ComponentCoords}.
18 * @see https://docs.swmansion.com/react-native-reanimated/docs/utilities/getRelativeCoords
19 */
20export declare function getRelativeCoords(animatedRef: AnimatedRef<Component>, absoluteX: number, absoluteY: number): ComponentCoords | null;
21//# sourceMappingURL=getRelativeCoords.d.ts.map
\No newline at end of file