appium-adb
Version:
Android Debug Bridge interface
78 lines • 2.77 kB
TypeScript
import type { ADB } from '../adb';
import type { KeyboardState } from './types';
/**
* Hides software keyboard if it is visible.
* Noop if the keyboard is already hidden.
*
* @param timeoutMs - For how long to wait (in milliseconds)
* until the keyboard is actually hidden.
* @returns `false` if the keyboard was already hidden
* @throws {Error} If the keyboard cannot be hidden.
*/
export declare function hideKeyboard(this: ADB, timeoutMs?: number): Promise<boolean>;
/**
* Retrieve the state of the software keyboard on the device under test.
*
* @return The keyboard state.
*/
export declare function isSoftKeyboardPresent(this: ADB): Promise<KeyboardState>;
/**
* Send the particular keycode to the device under test.
*
* @param keycode - The actual key code to be sent.
*/
export declare function keyevent(this: ADB, keycode: string | number): Promise<void>;
/**
* Retrieve the list of available input methods (IMEs) for the device under test.
*
* @return The list of IME names or an empty list.
*/
export declare function availableIMEs(this: ADB): Promise<string[]>;
/**
* Retrieve the list of enabled input methods (IMEs) for the device under test.
*
* @return The list of enabled IME names or an empty list.
*/
export declare function enabledIMEs(this: ADB): Promise<string[]>;
/**
* Enable the particular input method on the device under test.
*
* @param imeId - One of existing IME ids.
*/
export declare function enableIME(this: ADB, imeId: string): Promise<void>;
/**
* Disable the particular input method on the device under test.
*
* @param imeId - One of existing IME ids.
*/
export declare function disableIME(this: ADB, imeId: string): Promise<void>;
/**
* Set the particular input method on the device under test.
*
* @param imeId - One of existing IME ids.
*/
export declare function setIME(this: ADB, imeId: string): Promise<void>;
/**
* Get the default input method on the device under test.
*
* @return The name of the default input method
*/
export declare function defaultIME(this: ADB): Promise<string | null>;
/**
* Send the particular text or a number to the device under test.
* The text gets properly escaped before being passed to ADB.
* Noop if the text is empty.
*
* @param text - The actual text to be sent.
*/
export declare function inputText(this: ADB, text: string | number): Promise<void>;
/**
* Executes the given function with the given input method context
* and then restores the IME to the original value
*
* @param ime - Valid IME identifier
* @param fn - Function to execute
* @returns The result of the given function
*/
export declare function runInImeContext<T>(this: ADB, ime: string, fn: () => Promise<T>): Promise<T>;
//# sourceMappingURL=keyboard-commands.d.ts.map