UNPKG

micromark-extension-cjk-friendly-util

Version:

common library for micromark-extension-cjk-friendly and its related packages

30 lines (27 loc) 975 B
import { constants } from 'micromark-util-symbol'; import { Code } from 'micromark-util-types'; declare namespace constantsEx { const spaceOrPunctuation: 3; const cjk: 4096; const cjkPunctuation: 4098; const ivs: 8192; const cjkOrIvs: 12288; const svsFollowingCjk: 16384; const variationSelector: 28672; } /** * Classify whether a code represents whitespace, punctuation, or something * else. * * Used for attention (emphasis, strong), whose sequences can open or close * based on the class of surrounding characters. * * > 👉 **Note**: eof (`null`) is seen as whitespace. * * @param code * Code. * @returns * Group. */ declare function classifyCharacter(code: Code): typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | typeof constantsEx.cjk | typeof constantsEx.cjkPunctuation | typeof constantsEx.ivs | typeof constantsEx.svsFollowingCjk | 0; export { classifyCharacter, constantsEx };