UNPKG

rc-virtual-keyboard

Version:
50 lines (49 loc) 2.31 kB
/// <reference types="react" /> import { VKB } from '../typing'; declare const useInput: ({ themeMode, positionMode, defaultActiveKeyboard, useKeydownAudio, keydownAudioUrl, autoPopup, onChangeShow, onThemeModeChange, onPositionModeChange, onUseKeydownAudioChange, onKeydownAudioUrlChange, onPinyin2Chinese, onImageToWord, }: { /** 主题模式 */ themeMode?: string | undefined; /** 位置模式 */ positionMode?: string | undefined; /** 默认活跃的键盘 */ defaultActiveKeyboard?: string | undefined; /** 使用按键音效 */ useKeydownAudio?: "Y" | "N" | undefined; /** 按键音效url */ keydownAudioUrl?: string | undefined; /** 自动弹出 */ autoPopup?: boolean | undefined; /** 显示/隐藏 */ onChangeShow?: ((s: boolean) => void) | undefined; /** 主题改变 */ onThemeModeChange?: ((mode: string) => void) | undefined; /** 位置模式改变 */ onPositionModeChange?: ((mode: string) => void) | undefined; /** 开启按键音效 */ onUseKeydownAudioChange?: ((mode: 'Y' | 'N') => void) | undefined; onKeydownAudioUrlChange?: ((url: string) => void) | undefined; /** 拼音转汉字,自定义实现拼音转汉字,默认采用最简单的单字输入模式 */ onPinyin2Chinese?: ((value: string) => { pinyin: string; chinese: string[]; }) | undefined; /** 图片转文字,自定义实现图片转文字,默认采用 tesseract.js 识别图片文字 */ onImageToWord?: ((url: string) => Promise<string[]>) | undefined; }) => { inputMode: VKB.InputMode; inputValue: string; vkbThemeMode: string; vkbPositionMode: string; vkbKeydownAudio: "Y" | "N"; chinese: string[]; activeKeyboard: string; onClick: (e: VKB.KeyboardAttributeType) => void; onMouseDown: (e: React.MouseEvent<HTMLDivElement, MouseEvent> | React.TouchEvent<HTMLDivElement>) => void; onSelectChinese: (chinese: string) => void; onChangeInputMode: (mode: VKB.InputMode) => void; setActiveKeyboard: import("react").Dispatch<import("react").SetStateAction<string>>; onRecognition: (url: string) => Promise<void>; onKeyDown: (e: VKB.KeyboardAttributeType) => void; onKeyUp: (e: VKB.KeyboardAttributeType) => void; }; export default useInput;