UNPKG

1.11 kBTypeScriptView Raw
1import type { FrameInfo } from '../frameCallback/FrameCallbackRegistryUI';
2/**
3 * @param setActive - A function that lets you start the frame callback or stop
4 * it from running.
5 * @param isActive - A boolean indicating whether a callback is running.
6 * @param callbackId - A number indicating a unique identifier of the frame
7 * callback.
8 * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/useFrameCallback#returns
9 */
10export type FrameCallback = {
11 setActive: (isActive: boolean) => void;
12 isActive: boolean;
13 callbackId: number;
14};
15/**
16 * Lets you run a function on every frame update.
17 *
18 * @param callback - A function executed on every frame update.
19 * @param autostart - Whether the callback should start automatically. Defaults
20 * to `true`.
21 * @returns A frame callback object - {@link FrameCallback}.
22 * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/useFrameCallback
23 */
24export declare function useFrameCallback(callback: (frameInfo: FrameInfo) => void, autostart?: boolean): FrameCallback;
25//# sourceMappingURL=useFrameCallback.d.ts.map
\No newline at end of file