[Link](https://ykimn.csb.app/)
npm install hangul-ime
npm install hangul-ime
or
yarn add hangul-ime
`
Example
$3
`ts
const hangulIme = new HangulIme();
hangulIme.insert("ㄱ");
hangulIme.insert("ㅏ");
hangulIme.insert("ㄱ");
hangulIme.insert("ㅅ");
console.log(hangulIme.composingSyllable); // result: 값
`
$3
`ts
const hangulIme = new HangulIme();
hangulIme.insert("ㄱ");
hangulIme.insert("ㅏ");
hangulIme.insert("ㄱ");
hangulIme.insert("ㅅ");
hangulIme.insert("ㅏ");
console.log(hangulIme.completedSyllable); // result: 각
console.log(hangulIme.composingSyllable); // result: 사
`
$3
`ts
const hangulIme = new HangulIme();
let actualCompletedSyllable = "";
let actualComposingSyllable = "";
const onComplete = (completedSyllable: string, composingSyllable: string) => {
actualCompletedSyllable = completedSyllable;
actualComposingSyllable = composingSyllable;
};
const onCompose = (composingSyllable: string) => {
actualComposingSyllable = composingSyllable;
}
hangulIme.insert("ㄱ").onComplete(onComplete).onCompose(onCompose);
hangulIme.insert("ㅏ").onComplete(onComplete).onCompose(onCompose);
hangulIme.insert("ㄱ").onComplete(onComplete).onCompose(onCompose);
hangulIme.insert("ㅅ").onComplete(onComplete).onCompose(onCompose);
hangulIme.insert("ㅏ").onComplete(onComplete).onCompose(onCompose);
console.log(actualCompletedSyllable); // result: 각
console.log(actualComposingSyllable); // result: 사
`
$3
`ts
const hangulIme = new HangulIme();
let actualCompletedSyllable = "";
let actualComposingSyllable = "";
hangulIme.insert("ㄱ");
hangulIme.insert("ㅏ");
hangulIme.insert("ㄱ");
hangulIme.insert("ㅅ");
hangulIme.insert("ㅏ");
if (hangulIme.step === "completed") {
actualCompletedSyllable = hangulIme.latestCompletedSyllable;
actualComposingSyllable = hangulIme.composingSyllable;
}
console.log(actualCompletedSyllable); // result: 각
console.log(actualComposingSyllable); // result: 사
``