Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 1 addition & 44 deletions src/animated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import type { KeyboardAnimationContext } from "./context";
import type {
FocusedInputLayoutChangedEvent,
KeyboardControllerProps,
KeyboardProviderProps,
NativeEvent,
} from "./types";
import type { ViewStyle } from "react-native";
Expand All @@ -55,50 +56,6 @@ const styles = StyleSheet.create<Styles>({
},
});

type KeyboardProviderProps = {
children: React.ReactNode;
/**
* Set the value to `true`, if you use translucent status bar on Android.
* If you already control status bar translucency via `react-native-screens`
* or `StatusBar` component from `react-native`, you can ignore it.
* Defaults to `false`.
*
* @platform android
* @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/14
*/
statusBarTranslucent?: boolean;
/**
* Set the value to `true`, if you use translucent navigation bar on Android.
* Defaults to `false`.
*
* @platform android
* @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/119
*/
navigationBarTranslucent?: boolean;
/**
* A boolean property indicating whether to keep edge-to-edge mode always enabled (even when you disable the module).
* Defaults to `false`.
*
* @platform android
* @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/592
*/
preserveEdgeToEdge?: boolean;
/**
* A boolean prop indicating whether the module is enabled. It indicate only initial state
* (if you try to change this prop after component mount it will not have any effect).
* To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.
* Defaults to `true`.
*/
enabled?: boolean;
/**
* A boolean prop indicating whether to preload the keyboard to reduce time-to-interaction (TTI) on first input focus.
* Defaults to `true`.
*
* @platform ios
*/
preload?: boolean;
};

// capture `Platform.OS` in separate variable to avoid deep workletization of entire RN package
// see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/393 and https://github.com/kirillzyusko/react-native-keyboard-controller/issues/294 for more details
const OS = Platform.OS;
Expand Down
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from "./hooks";
export * from "./views";
export * from "./module";
export * from "./internal";
export * from "./provider";
43 changes: 43 additions & 0 deletions src/types/provider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
export type KeyboardProviderProps = {
children: React.ReactNode;
/**
* Set the value to `true`, if you use translucent status bar on Android.
* If you already control status bar translucency via `react-native-screens`
* or `StatusBar` component from `react-native`, you can ignore it.
* Defaults to `false`.
*
* @platform android
* @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/14
*/
statusBarTranslucent?: boolean;
/**
* Set the value to `true`, if you use translucent navigation bar on Android.
* Defaults to `false`.
*
* @platform android
* @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/119
*/
navigationBarTranslucent?: boolean;
/**
* A boolean property indicating whether to keep edge-to-edge mode always enabled (even when you disable the module).
* Defaults to `false`.
*
* @platform android
* @see https://github.com/kirillzyusko/react-native-keyboard-controller/issues/592
*/
preserveEdgeToEdge?: boolean;
/**
* A boolean prop indicating whether the module is enabled. It indicate only initial state
* (if you try to change this prop after component mount it will not have any effect).
* To change the property in runtime use `useKeyboardController` hook and `setEnabled` method.
* Defaults to `true`.
*/
enabled?: boolean;
/**
* A boolean prop indicating whether to preload the keyboard to reduce time-to-interaction (TTI) on first input focus.
* Defaults to `true`.
*
* @platform ios
*/
preload?: boolean;
};