react-native-keyboard-controller
Version:
Keyboard manager which works in identical way on both iOS and Android
24 lines (23 loc) • 1 kB
TypeScript
import { Animated } from "react-native";
import type { FocusedInputHandler, FocusedInputLayoutChangedEvent, KeyboardHandler } from "./types";
import type React from "react";
import type { SharedValue } from "react-native-reanimated";
export type AnimatedContext = {
progress: Animated.Value;
height: Animated.AnimatedMultiplication<number>;
};
export type ReanimatedContext = {
progress: SharedValue<number>;
height: SharedValue<number>;
};
export type KeyboardAnimationContext = {
enabled: boolean;
animated: AnimatedContext;
reanimated: ReanimatedContext;
layout: SharedValue<FocusedInputLayoutChangedEvent | null>;
setKeyboardHandlers: (handlers: KeyboardHandler) => () => void;
setInputHandlers: (handlers: FocusedInputHandler) => () => void;
setEnabled: React.Dispatch<React.SetStateAction<boolean>>;
};
export declare const KeyboardContext: React.Context<KeyboardAnimationContext>;
export declare const useKeyboardContext: () => KeyboardAnimationContext;