Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve types for PreviousNextView #97

Merged
merged 3 commits into from
Feb 3, 2023
Merged
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
46 changes: 27 additions & 19 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -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<boolean>;
export class PreviousNextView extends View { }

namespace KeyboardManager {
function setEnable(enable: boolean): Promise<void>;
function setEnableDebugging(enable: boolean): Promise<void>;
function setLayoutIfNeededOnUpdate(enable: boolean): Promise<void>;
function setKeyboardDistanceFromTextField(distance: number): Promise<void>;
function setEnableAutoToolbar(enable: boolean): Promise<void>;
function setToolbarDoneBarButtonItemText(text: string): Promise<void>;
function setToolbarManageBehaviourBy(behaviour: ToolbarBehaviour): Promise<void>;
function setToolbarPreviousNextButtonEnable(enable: boolean): Promise<void>;
function setToolbarTintColor(hexColor: string): Promise<void>;
function setToolbarBarTintColor(hexColor: string): Promise<void>;
function setShouldShowToolbarPlaceholder(enable: boolean): Promise<void>;
function setOverrideKeyboardAppearance(enable: boolean): Promise<void>;
function setKeyboardAppearance(appearance: KeyboardAppearance): Promise<void>;
function setShouldResignOnTouchOutside(enable: boolean): Promise<void>;
function setShouldPlayInputClicks(enable: boolean): Promise<void>;
function setShouldToolbarUsesTextFieldTintColor(enable: boolean): Promise<void>;
function resignFirstResponder(): Promise<void>;
function reloadLayoutIfNeeded(): Promise<void>;
function isKeyboardShowing(): Promise<boolean>;
}

export default KeyboardManager;
}