react-native-keyboard-controller
Version:
Keyboard manager which works in identical way on both iOS and Android
16 lines (15 loc) • 942 B
TypeScript
import { Animated, findNodeHandle } from "react-native";
type EventHandler = (event: never) => void;
type ComponentOrHandle = Parameters<typeof findNodeHandle>[0];
export declare function useEventHandlerRegistration<H extends Partial<Record<string, EventHandler>>>(map: Map<keyof H, string>, viewTagRef: React.MutableRefObject<ComponentOrHandle>): (handler: H) => () => void;
/**
* TS variant of `useAnimatedValue` hook which is added in RN 0.71
* A better alternative of storing animated values in refs, since
* it doesn't recreate a new `Animated.Value` object on every re-render
* and therefore consumes less memory. We can not use a variant from
* RN, since this library supports earlier versions of RN.
*
* @see https://github.com/facebook/react-native/commit/e22217fe8b9455e32695f88ca835e11442b0a937
*/
export declare function useAnimatedValue(initialValue: number, config?: Animated.AnimatedConfig): Animated.Value;
export {};