hangul-unicode-composer 1.6.0

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.
@@ -0,0 +1,133 @@
1
+ /**
2
+ * HangulUnicodeComposer
3
+ * Ports the AS3 한글 조합 라이브러리 to TypeScript.
4
+ * Composes Korean Jamo characters into Unicode Hangul syllables.
5
+ */
6
+ export declare class HangulUnicodeComposer extends EventTarget {
7
+ /**
8
+ * Initial consonant (초성) Unicode values
9
+ */
10
+ private static readonly INITIAL;
11
+ /**
12
+ * Medial vowel (중성) Unicode values
13
+ */
14
+ private static readonly MEDIAL;
15
+ /**
16
+ * Final consonant (종성) Unicode values. Index 0 is empty (no final consonant).
17
+ */
18
+ private static readonly FINAL;
19
+ private static used;
20
+ /**
21
+ * Helper to make one letter by composing 3 syllables.
22
+ */
23
+ static getString3Syllables(init: string, mid: string, fin: string): string;
24
+ /**
25
+ * Returns true if the character is a Hangeul Jaeum (consonant) in the range 3131 ~ 314E.
26
+ */
27
+ static isHangulJaeum(char: string): boolean;
28
+ /**
29
+ * Returns true if the character is a Hangeul Jamo in the range 3130 ~ 318F.
30
+ */
31
+ static isHangulJamo(char: string): boolean;
32
+ /**
33
+ * Returns true if the character is a Hangeul Moeum (vowel) in the range 314F ~ 3163.
34
+ */
35
+ static isHangulMoeum(char: string): boolean;
36
+ compositionString: string;
37
+ extra: string;
38
+ restrict: number;
39
+ private instant;
40
+ private archives;
41
+ onUpdate?: (text: string) => void;
42
+ onLimited?: (text: string) => void;
43
+ onError?: (text: string) => void;
44
+ constructor();
45
+ ver(): string;
46
+ get instantChars(): string[];
47
+ set instantChars(value: string[]);
48
+ /**
49
+ * Input Jaeum or Moeum to compose.
50
+ */
51
+ addJamo(char: string): void;
52
+ /**
53
+ * Save current composed strings by key.
54
+ */
55
+ archive(key: string, txt?: string | null): number;
56
+ /**
57
+ * Restore composed state from the saved key.
58
+ */
59
+ restore(key: string): string;
60
+ /**
61
+ * Logic engine to process the composition of characters in instant array.
62
+ */
63
+ private instantUpdate;
64
+ /**
65
+ * Helper to dispatch events and invoke corresponding callbacks.
66
+ */
67
+ private dispatchComposerEvent;
68
+ /**
69
+ * Insert character that is not available to compose (e.g. English, numbers, symbols).
70
+ */
71
+ addSpecialChar(char: string, at?: number): void;
72
+ /**
73
+ * Add Jamo by Unicode character code.
74
+ */
75
+ addJamoUnicode(code: number): void;
76
+ /**
77
+ * Delete character by backspace.
78
+ */
79
+ backSpace(at?: number): void;
80
+ /**
81
+ * Composes two Jamos and returns array with composed character or split ones.
82
+ */
83
+ compare2Jamo(charA: string, charB: string): string[];
84
+ /**
85
+ * Composes three Jamos.
86
+ */
87
+ compare3Syllables(init: string, mid: string, fin: string): string[];
88
+ /**
89
+ * Checks if string is a valid Hangul syllable or Jamo.
90
+ */
91
+ compatibleHangulJamo(char: string): boolean;
92
+ /**
93
+ * Checks if character is a Jaeum.
94
+ */
95
+ compatibleJaeum(char: string): boolean;
96
+ /**
97
+ * Checks if character is a Moeum.
98
+ */
99
+ compatibleMoeum(char: string): boolean;
100
+ /**
101
+ * Deletes characters at target index.
102
+ */
103
+ del(at?: number): void;
104
+ /**
105
+ * Resets composer state.
106
+ */
107
+ reset(): void;
108
+ /**
109
+ * Checks if character is in FINAL.
110
+ */
111
+ isFinalJamo(char: string): boolean;
112
+ /**
113
+ * Checks if character is in INITIAL.
114
+ */
115
+ isInitialJamo(char: string): boolean;
116
+ /**
117
+ * Checks if character is in MEDIAL.
118
+ */
119
+ isMedialJamo(char: string): boolean;
120
+ /**
121
+ * Adds space.
122
+ */
123
+ space(at?: number): void;
124
+ /**
125
+ * Combines initial, medial, and final into a single Hangul syllable.
126
+ */
127
+ combine3Syllables(init: string, mid: string, fin: string): string;
128
+ /**
129
+ * Combine two characters (Jaeum + Jaeum, Moeum + Moeum, or Initial + Medial)
130
+ */
131
+ private combine;
132
+ private isCombinableFinalJamo;
133
+ }