@zh-keyboard/core 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +10 -2
- package/dist/index.d.ts +10 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -70,6 +70,14 @@ declare function calculateKeyboardPosition(inputElement: HTMLElement | null, key
|
|
|
70
70
|
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/handwriting.d.ts
|
|
73
|
+
interface RecognizerInitOptions {
|
|
74
|
+
/**
|
|
75
|
+
* 初始化进度回调函数
|
|
76
|
+
* @param progress 进度范围为0到1,表示初始化的完成度
|
|
77
|
+
* @returns void
|
|
78
|
+
*/
|
|
79
|
+
onProgress?: (progress: number) => void;
|
|
80
|
+
}
|
|
73
81
|
/**
|
|
74
82
|
* 手写识别器接口
|
|
75
83
|
* 用于实现手写汉字识别功能
|
|
@@ -79,7 +87,7 @@ interface HandwritingRecognizer {
|
|
|
79
87
|
* 初始化手写识别服务
|
|
80
88
|
* @returns 返回是否初始化成功
|
|
81
89
|
*/
|
|
82
|
-
initialize(): Promise<boolean>;
|
|
90
|
+
initialize(options?: RecognizerInitOptions): Promise<boolean>;
|
|
83
91
|
/**
|
|
84
92
|
* 识别手写笔迹
|
|
85
93
|
* @param strokeData 笔迹数据,格式为 x y c x y c ...,其中x和y是坐标,c表示是否为笔画的最后一点(1表示是,0表示否)
|
|
@@ -159,5 +167,5 @@ declare class SimplePinyinEngine {
|
|
|
159
167
|
}
|
|
160
168
|
|
|
161
169
|
//#endregion
|
|
162
|
-
export { AdvancedPinyinEngine, CanvasDrawer, CanvasDrawerOptions, HandwritingRecognizer, KeyboardPosition, PinyinCharEntry, SimplePinyinEngine, calculateKeyboardPosition, delToInputElement, getInputElement, isInputElement, moveCursor, writeToInputElement };
|
|
170
|
+
export { AdvancedPinyinEngine, CanvasDrawer, CanvasDrawerOptions, HandwritingRecognizer, KeyboardPosition, PinyinCharEntry, RecognizerInitOptions, SimplePinyinEngine, calculateKeyboardPosition, delToInputElement, getInputElement, isInputElement, moveCursor, writeToInputElement };
|
|
163
171
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -70,6 +70,14 @@ declare function calculateKeyboardPosition(inputElement: HTMLElement | null, key
|
|
|
70
70
|
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region src/handwriting.d.ts
|
|
73
|
+
interface RecognizerInitOptions {
|
|
74
|
+
/**
|
|
75
|
+
* 初始化进度回调函数
|
|
76
|
+
* @param progress 进度范围为0到1,表示初始化的完成度
|
|
77
|
+
* @returns void
|
|
78
|
+
*/
|
|
79
|
+
onProgress?: (progress: number) => void;
|
|
80
|
+
}
|
|
73
81
|
/**
|
|
74
82
|
* 手写识别器接口
|
|
75
83
|
* 用于实现手写汉字识别功能
|
|
@@ -79,7 +87,7 @@ interface HandwritingRecognizer {
|
|
|
79
87
|
* 初始化手写识别服务
|
|
80
88
|
* @returns 返回是否初始化成功
|
|
81
89
|
*/
|
|
82
|
-
initialize(): Promise<boolean>;
|
|
90
|
+
initialize(options?: RecognizerInitOptions): Promise<boolean>;
|
|
83
91
|
/**
|
|
84
92
|
* 识别手写笔迹
|
|
85
93
|
* @param strokeData 笔迹数据,格式为 x y c x y c ...,其中x和y是坐标,c表示是否为笔画的最后一点(1表示是,0表示否)
|
|
@@ -159,5 +167,5 @@ declare class SimplePinyinEngine {
|
|
|
159
167
|
}
|
|
160
168
|
|
|
161
169
|
//#endregion
|
|
162
|
-
export { AdvancedPinyinEngine, CanvasDrawer, CanvasDrawerOptions, HandwritingRecognizer, KeyboardPosition, PinyinCharEntry, SimplePinyinEngine, calculateKeyboardPosition, delToInputElement, getInputElement, isInputElement, moveCursor, writeToInputElement };
|
|
170
|
+
export { AdvancedPinyinEngine, CanvasDrawer, CanvasDrawerOptions, HandwritingRecognizer, KeyboardPosition, PinyinCharEntry, RecognizerInitOptions, SimplePinyinEngine, calculateKeyboardPosition, delToInputElement, getInputElement, isInputElement, moveCursor, writeToInputElement };
|
|
163
171
|
//# sourceMappingURL=index.d.ts.map
|