From 01ed42a788dafee634336ba22d6e64367e55a052 Mon Sep 17 00:00:00 2001 From: Douglas Nassif Roma Junior Date: Mon, 2 Jan 2023 12:08:02 -0300 Subject: [PATCH 1/3] Update index.d.ts --- index.d.ts | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/index.d.ts b/index.d.ts index b3ebc8c..8503e53 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,24 +1,32 @@ +import type { View } from "react-native"; + declare module 'react-native-keyboard-manager' { export type ToolbarBehaviour = 'subviews' | 'tag' | 'position'; export type KeyboardAppearance = 'default' | 'light' | 'dark'; - export function setEnable(enable: boolean); - export function setEnableDebugging(enable: boolean); - export function setLayoutIfNeededOnUpdate(enable: boolean); - export function setKeyboardDistanceFromTextField(distance: number); - export function setEnableAutoToolbar(enable: boolean); - export function setToolbarDoneBarButtonItemText(text: string); - export function setToolbarManageBehaviourBy(behaviour: ToolbarBehaviour); - export function setToolbarPreviousNextButtonEnable(enable: boolean); - export function setToolbarTintColor(hexColor: string); - export function setToolbarBarTintColor(hexColor: string); - export function setShouldShowToolbarPlaceholder(enable: boolean); - export function setOverrideKeyboardAppearance(enable: boolean); - export function setKeyboardAppearance(appearance: KeyboardAppearance); - export function setShouldResignOnTouchOutside(enable: boolean); - export function setShouldPlayInputClicks(enable: boolean); - export function setShouldToolbarUsesTextFieldTintColor(enable: boolean); - export function resignFirstResponder(); - export function reloadLayoutIfNeeded(); - export function isKeyboardShowing(): Promise; + export const PreviousNextView = {} as View; + + type KeyboardManager = { + setEnable(enable: boolean): Promise; + setEnableDebugging(enable: boolean): Promise; + setLayoutIfNeededOnUpdate(enable: boolean): Promise; + setKeyboardDistanceFromTextField(distance: number): Promise; + setEnableAutoToolbar(enable: boolean): Promise; + setToolbarDoneBarButtonItemText(text: string): Promise; + setToolbarManageBehaviourBy(behaviour: ToolbarBehaviour): Promise; + setToolbarPreviousNextButtonEnable(enable: boolean): Promise; + setToolbarTintColor(hexColor: string): Promise; + setToolbarBarTintColor(hexColor: string): Promise; + setShouldShowToolbarPlaceholder(enable: boolean): Promise; + setOverrideKeyboardAppearance(enable: boolean): Promise; + setKeyboardAppearance(appearance: KeyboardAppearance): Promise; + setShouldResignOnTouchOutside(enable: boolean): Promise; + setShouldPlayInputClicks(enable: boolean): Promise; + setShouldToolbarUsesTextFieldTintColor(enable: boolean): Promise; + resignFirstResponder(): Promise; + reloadLayoutIfNeeded(): Promise; + isKeyboardShowing(): Promise; + } + + export default {} as KeyboardManager; } From f55531f39811b807ed368900df53b7779d42cc48 Mon Sep 17 00:00:00 2001 From: Douglas Nassif Roma Junior Date: Mon, 2 Jan 2023 12:12:15 -0300 Subject: [PATCH 2/3] Update index.d.ts --- index.d.ts | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/index.d.ts b/index.d.ts index 8503e53..3eeec44 100644 --- a/index.d.ts +++ b/index.d.ts @@ -4,29 +4,29 @@ declare module 'react-native-keyboard-manager' { export type ToolbarBehaviour = 'subviews' | 'tag' | 'position'; export type KeyboardAppearance = 'default' | 'light' | 'dark'; - export const PreviousNextView = {} as View; + export class PreviousNextView extends View { } - type KeyboardManager = { - setEnable(enable: boolean): Promise; - setEnableDebugging(enable: boolean): Promise; - setLayoutIfNeededOnUpdate(enable: boolean): Promise; - setKeyboardDistanceFromTextField(distance: number): Promise; - setEnableAutoToolbar(enable: boolean): Promise; - setToolbarDoneBarButtonItemText(text: string): Promise; - setToolbarManageBehaviourBy(behaviour: ToolbarBehaviour): Promise; - setToolbarPreviousNextButtonEnable(enable: boolean): Promise; - setToolbarTintColor(hexColor: string): Promise; - setToolbarBarTintColor(hexColor: string): Promise; - setShouldShowToolbarPlaceholder(enable: boolean): Promise; - setOverrideKeyboardAppearance(enable: boolean): Promise; - setKeyboardAppearance(appearance: KeyboardAppearance): Promise; - setShouldResignOnTouchOutside(enable: boolean): Promise; - setShouldPlayInputClicks(enable: boolean): Promise; - setShouldToolbarUsesTextFieldTintColor(enable: boolean): Promise; - resignFirstResponder(): Promise; - reloadLayoutIfNeeded(): Promise; - isKeyboardShowing(): Promise; + namespace KeyboardManager { + export function setEnable(enable: boolean): Promise; + export function setEnableDebugging(enable: boolean): Promise; + export function setLayoutIfNeededOnUpdate(enable: boolean): Promise; + export function setKeyboardDistanceFromTextField(distance: number): Promise; + export function setEnableAutoToolbar(enable: boolean): Promise; + export function setToolbarDoneBarButtonItemText(text: string): Promise; + export function setToolbarManageBehaviourBy(behaviour: ToolbarBehaviour): Promise; + export function setToolbarPreviousNextButtonEnable(enable: boolean): Promise; + export function setToolbarTintColor(hexColor: string): Promise; + export function setToolbarBarTintColor(hexColor: string): Promise; + export function setShouldShowToolbarPlaceholder(enable: boolean): Promise; + export function setOverrideKeyboardAppearance(enable: boolean): Promise; + export function setKeyboardAppearance(appearance: KeyboardAppearance): Promise; + export function setShouldResignOnTouchOutside(enable: boolean): Promise; + export function setShouldPlayInputClicks(enable: boolean): Promise; + export function setShouldToolbarUsesTextFieldTintColor(enable: boolean): Promise; + export function resignFirstResponder(): Promise; + export function reloadLayoutIfNeeded(): Promise; + export function isKeyboardShowing(): Promise; } - export default {} as KeyboardManager; + export default KeyboardManager; } From 5a4bc3a13bd11e1f440198ad5a756ea472f2b753 Mon Sep 17 00:00:00 2001 From: Douglas Nassif Roma Junior Date: Mon, 2 Jan 2023 12:15:01 -0300 Subject: [PATCH 3/3] Update index.d.ts --- index.d.ts | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/index.d.ts b/index.d.ts index 3eeec44..afea533 100644 --- a/index.d.ts +++ b/index.d.ts @@ -7,25 +7,25 @@ declare module 'react-native-keyboard-manager' { export class PreviousNextView extends View { } namespace KeyboardManager { - export function setEnable(enable: boolean): Promise; - export function setEnableDebugging(enable: boolean): Promise; - export function setLayoutIfNeededOnUpdate(enable: boolean): Promise; - export function setKeyboardDistanceFromTextField(distance: number): Promise; - export function setEnableAutoToolbar(enable: boolean): Promise; - export function setToolbarDoneBarButtonItemText(text: string): Promise; - export function setToolbarManageBehaviourBy(behaviour: ToolbarBehaviour): Promise; - export function setToolbarPreviousNextButtonEnable(enable: boolean): Promise; - export function setToolbarTintColor(hexColor: string): Promise; - export function setToolbarBarTintColor(hexColor: string): Promise; - export function setShouldShowToolbarPlaceholder(enable: boolean): Promise; - export function setOverrideKeyboardAppearance(enable: boolean): Promise; - export function setKeyboardAppearance(appearance: KeyboardAppearance): Promise; - export function setShouldResignOnTouchOutside(enable: boolean): Promise; - export function setShouldPlayInputClicks(enable: boolean): Promise; - export function setShouldToolbarUsesTextFieldTintColor(enable: boolean): Promise; - export function resignFirstResponder(): Promise; - export function reloadLayoutIfNeeded(): Promise; - export function isKeyboardShowing(): Promise; + function setEnable(enable: boolean): Promise; + function setEnableDebugging(enable: boolean): Promise; + function setLayoutIfNeededOnUpdate(enable: boolean): Promise; + function setKeyboardDistanceFromTextField(distance: number): Promise; + function setEnableAutoToolbar(enable: boolean): Promise; + function setToolbarDoneBarButtonItemText(text: string): Promise; + function setToolbarManageBehaviourBy(behaviour: ToolbarBehaviour): Promise; + function setToolbarPreviousNextButtonEnable(enable: boolean): Promise; + function setToolbarTintColor(hexColor: string): Promise; + function setToolbarBarTintColor(hexColor: string): Promise; + function setShouldShowToolbarPlaceholder(enable: boolean): Promise; + function setOverrideKeyboardAppearance(enable: boolean): Promise; + function setKeyboardAppearance(appearance: KeyboardAppearance): Promise; + function setShouldResignOnTouchOutside(enable: boolean): Promise; + function setShouldPlayInputClicks(enable: boolean): Promise; + function setShouldToolbarUsesTextFieldTintColor(enable: boolean): Promise; + function resignFirstResponder(): Promise; + function reloadLayoutIfNeeded(): Promise; + function isKeyboardShowing(): Promise; } export default KeyboardManager;