forked from kirillzyusko/react-native-keyboard-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bindings.ts
42 lines (39 loc) · 1.35 KB
/
bindings.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { View } from "react-native";
import type {
FocusedInputEventsModule,
KeyboardControllerNativeModule,
KeyboardControllerProps,
KeyboardEventsModule,
KeyboardGestureAreaProps,
OverKeyboardViewProps,
WindowDimensionsEventsModule,
} from "./types";
import type { EmitterSubscription } from "react-native";
const NOOP = () => {};
export const KeyboardControllerNative: KeyboardControllerNativeModule = {
setDefaultMode: NOOP,
setInputMode: NOOP,
dismiss: NOOP,
setFocusTo: NOOP,
addListener: NOOP,
removeListeners: NOOP,
};
export const KeyboardEvents: KeyboardEventsModule = {
addListener: () => ({ remove: NOOP } as EmitterSubscription),
};
/**
* This API is not documented, it's for internal usage only (for now), and is a subject to potential breaking changes in future.
* Use it with cautious.
*/
export const FocusedInputEvents: FocusedInputEventsModule = {
addListener: () => ({ remove: NOOP } as EmitterSubscription),
};
export const WindowDimensionsEvents: WindowDimensionsEventsModule = {
addListener: () => ({ remove: NOOP } as EmitterSubscription),
};
export const KeyboardControllerView =
View as unknown as React.FC<KeyboardControllerProps>;
export const KeyboardGestureArea =
View as unknown as React.FC<KeyboardGestureAreaProps>;
export const RCTOverKeyboardView =
View as unknown as React.FC<OverKeyboardViewProps>;