import { GetSelectedTextRangeOptions } from "./GetSelectedTextRangeOptions"; import { HideKeyboardOptions } from "./HideKeyboardOptions"; import { KeyboardHeightChangeEvent } from "./KeyboardHeightChangeEvent"; import { SelectedTextRange } from "./SelectedTextRange"; export declare class KeyboardAPI { /** * 在 input、textarea 等 focus 之后,获取输入框的光标位置。注意:只有在 focus 的时候调用此接口才有效。 * @param options * @returns * * @example * ```javascript * const { start, end } = await ks.getSelectedTextRange(); * * ``` * */ getSelectedTextRange(options?: GetSelectedTextRangeOptions): Promise; /** * 在 input、textarea 等 focus 拉起键盘之后,手动调用此接口收起键盘。 * @param options * @returns * * @example * ```javascript * ks.hideKeyboard({ * success() { * console.log('hideKeyboard success'); * }, * fail() { * console.log('hideKeyboard fail'); * }, * }); * * ``` * */ hideKeyboard(options?: HideKeyboardOptions): Promise; /** * 监听键盘高度变化。 * @param callback * * @example * ```javascript * ks.onKeyboardHeightChange((res) => { * console.log(res.height); * }); * * ``` * */ onKeyboardHeightChange(callback: (event: KeyboardHeightChangeEvent) => void): void; }