import { BaseSDK } from './sdk'; import { Keyboard, ResponseType } from '@jolibox/types'; /** * @private * Manages keyboard functionalities within the Jolibox ecosystem. Only Support in Native App */ export class KeyboardSDK extends BaseSDK implements Keyboard { /** * Show the keyboard * @param params * @returns */ showKeyboard(params: { defaultValue?: string; maxLength?: number; multiple?: boolean }) { const errMsg = this.canIUseIfThrow('keyboard.showKeyboard'); if (errMsg) { return errMsg; } this.commands.executeCommand('KeyboardSDK.showKeyboard', params); } /** * Update the keyboard * @param value * @returns */ updateKeyboard(value: string) { const errMsg = this.canIUseIfThrow('keyboard.updateKeyboard'); if (errMsg) { return errMsg; } this.commands.executeCommand('KeyboardSDK.updateKeyboard', { value }); } /** * Hide the keyboard * @returns */ hideKeyboard() { const errMsg = this.canIUseIfThrow('keyboard.hideKeyboard'); if (errMsg) { return errMsg; } this.commands.executeCommand('KeyboardSDK.hideKeyboard'); } }