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
18 changes: 18 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export interface UseKeyboardOptions {
/**
* @default false
*/
useWillShow?: boolean
/**
* @default false
*/
useWillHide?: boolean
}

/**
* Hook that listens to keyboard events and tell whether the keyboard is currently
* visible or not.
* Returns [isVisible, a dismiss function]
*/
declare const useKeyboard: (options?: UseKeyboardOptions) => [boolean, () => void];
export default useKeyboard;
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "dist/react-native-hooks-keyboard.cjs.js",
"jsnext:main": "dist/react-native-hooks-keyboard.esm.js",
"module": "dist/react-native-hooks-keyboard.esm.js",
"types": "index.d.ts",
"scripts": {
"prebuild": "rimraf dist",
"prepublishOnly": "run-s build",
Expand All @@ -19,7 +20,8 @@
"yalc": "npm run build && yalc push"
},
"files": [
"dist"
"dist",
"index.d.ts"
],
"keywords": [
"react-native",
Expand Down