simple-ime 1.2.2 → 1.2.3
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/simple-ime.cjs +5 -5
- package/dist/simple-ime.es.js +1693 -720
- package/dist/simple-ime.global.js +5 -5
- package/dist/simple-ime.umd.js +5 -5
- package/dist/src/engine/index.d.ts +5 -4
- package/dist/src/ime/index.d.ts +4 -1
- package/dist/src/types.d.ts +3 -0
- package/package.json +9 -3
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Candidate } from '../types';
|
|
2
2
|
|
|
3
|
+
interface Result {
|
|
4
|
+
segments: string[];
|
|
5
|
+
candidates: Candidate[];
|
|
6
|
+
}
|
|
3
7
|
interface LookUpOptions {
|
|
4
8
|
limit: number;
|
|
5
9
|
corrected?: string[];
|
|
@@ -10,8 +14,5 @@ export declare function mergeSegments(segments: string[], start: number, end: nu
|
|
|
10
14
|
};
|
|
11
15
|
export declare function backwardLookupCandidates(segments: string[], end: number, opts: LookUpOptions): Candidate[];
|
|
12
16
|
export declare function forwardLookupCandidates(segments: string[], end: number, opts: LookUpOptions): Candidate[];
|
|
13
|
-
export declare function requestCandidates(text: string, category?: number):
|
|
14
|
-
segments: string[];
|
|
15
|
-
candidates: Candidate[];
|
|
16
|
-
};
|
|
17
|
+
export declare function requestCandidates(text: string, category?: number): Result;
|
|
17
18
|
export {};
|
package/dist/src/ime/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ImeOptions } from '../types';
|
|
2
|
+
|
|
1
3
|
export declare class Ime {
|
|
2
4
|
version: string;
|
|
3
5
|
private page;
|
|
@@ -27,6 +29,7 @@ export declare class Ime {
|
|
|
27
29
|
private pressedKeys;
|
|
28
30
|
private preeditEle;
|
|
29
31
|
private compositionEle;
|
|
32
|
+
private options;
|
|
30
33
|
private injectCSS;
|
|
31
34
|
private bindEvents;
|
|
32
35
|
private bindFocusEvent;
|
|
@@ -62,7 +65,7 @@ export declare class Ime {
|
|
|
62
65
|
private moveCursorLeft;
|
|
63
66
|
private moveCursorRight;
|
|
64
67
|
private updateCompositionPosition;
|
|
65
|
-
init(): void;
|
|
68
|
+
init(options?: Partial<ImeOptions>): void;
|
|
66
69
|
toggleOnOff(): void;
|
|
67
70
|
turnOn(): void;
|
|
68
71
|
turnOff(): void;
|
package/dist/src/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simple-ime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.3",
|
|
5
5
|
"description": "A simple browser tool to use Chinese Pinyin Input Method (IME).",
|
|
6
6
|
"author": "nieyuyao <nieyuyao0826@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/nieyuyao/simple-ime.git"
|
|
10
10
|
},
|
|
11
|
-
"keywords": [
|
|
11
|
+
"keywords": [
|
|
12
|
+
"ime",
|
|
13
|
+
"input method",
|
|
14
|
+
"web ime",
|
|
15
|
+
"pinyin"
|
|
16
|
+
],
|
|
12
17
|
"main": "./dist/simple-ime.js",
|
|
13
18
|
"module": "./dist/simple-ime.es.js",
|
|
14
19
|
"unpkg": "./dist/simple-ime.umd.js",
|
|
@@ -29,7 +34,8 @@
|
|
|
29
34
|
"release": "bash ./release.sh"
|
|
30
35
|
},
|
|
31
36
|
"dependencies": {
|
|
32
|
-
"dawg-lookup": "^2.2.1"
|
|
37
|
+
"dawg-lookup": "^2.2.1",
|
|
38
|
+
"lru-cache": "^11.1.0"
|
|
33
39
|
},
|
|
34
40
|
"devDependencies": {
|
|
35
41
|
"@antfu/eslint-config": "^3.15.0",
|