UNPKG

1.3 kBTypeScriptView Raw
1/**
2 * Unicode algorithms for CJK (Chinese, Japanese, Korean) writing systems.
3 *
4 * Utilities for Hanzi/Kanji/Hanja logographs and Kanas (Katakana and Hiragana)
5 * syllables.
6 *
7 * For Korean Hangul see module `UnicodeHangulKorean`.
8 */
9declare namespace UnicodeCJK {
10 /**
11 * Whether the string includes any Katakana or Hiragana characters.
12 */
13 function hasKana(str: string): boolean;
14
15 /**
16 * Whether the string includes any CJK Ideograph characters.
17 */
18 function hasIdeograph(str: string): boolean;
19
20 /**
21 * Whether the string includes any CJK Ideograph or Syllable characters.
22 */
23 function hasIdeoOrSyll(str: string): boolean;
24
25 /**
26 * Replace any Hiragana character with the matching Katakana
27 */
28 function hiraganaToKatakana(str: string): string;
29
30 /**
31 * Whether the string is exactly a sequence of Kana characters followed by one
32 * Latin character.
33 */
34 function isKanaWithTrailingLatin(str: string): string;
35
36 /**
37 * Drops the trailing Latin character from a string that is exactly a sequence
38 * of Kana characters followed by one Latin character.
39 */
40 function kanaRemoveTrailingLatin(str: string): string;
41}
42
43// eslint-disable-next-line @definitelytyped/export-just-namespace
44export = UnicodeCJK;