UNPKG

1.11 kBTypeScriptView Raw
1import type { EventHandlerProcessed } from './useEvent';
2type ComposedHandlerProcessed<Event extends object, Context extends Record<string, unknown> = Record<string, unknown>> = EventHandlerProcessed<Event, Context>;
3/**
4 * Lets you compose multiple event handlers based on
5 * [useEvent](https://docs.swmansion.com/react-native-reanimated/docs/advanced/useEvent)
6 * hook.
7 *
8 * @param handlers - An array of event handlers created using
9 * [useEvent](https://docs.swmansion.com/react-native-reanimated/docs/advanced/useEvent)
10 * hook.
11 * @returns An object you need to pass to a coresponding "onEvent" prop on an
12 * `Animated` component (for example handlers responsible for `onScroll` event
13 * go to `onScroll` prop).
14 * @see https://docs.swmansion.com/react-native-reanimated/docs/advanced/useComposedEventHandler
15 */
16export declare function useComposedEventHandler<Event extends object, Context extends Record<string, unknown>>(handlers: (EventHandlerProcessed<Event, Context> | null)[]): ComposedHandlerProcessed<Event, Context>;
17export {};
18//# sourceMappingURL=useComposedEventHandler.d.ts.map
\No newline at end of file