import type { Copy, Debug, Display, Equal, Into, Option, PartialEq } from '@chzky/core'; import type { Char, Str } from '../../../mod.js'; export interface InterChar extends Copy, Into, Debug, PartialEq, Display, Equal { as_str(): Str; as_string(): string; /** ### `to_ascii` : 将字符转换为 ASCII 码 */ to_ascii(): Option; /** ### `to_lowercase` : 将字符转换为小写 */ to_lowercase(): Char; /** ### `to_uppercase` : 将字符转换为大写 */ to_uppercase(): Char; /** ### `is_ascii` : 是否是[ASCII字符](https://www.runoob.com/w3cnote/ascii.html) */ is_ascii(): boolean; /** ### `is_alphabetic` : 检查是否是[Unicode字母](https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt) @example ```ts assert(Char('a').is_alphabetic()) assert(Char('α').is_alphabetic()) assert(Char('あ').is_alphabetic()) assert.not(Char('1').is_alphabetic()) // 不是字母是数字 assert.not(Char('@').is_alphabetic()) ``` + */ is_alphabetic(): boolean; /** ### `is_whitespace` : 检查是否是[Unicode空格](https://cloud.tencent.com/developer/article/2128593) */ is_whitespace(): boolean; /** ### `is_ascii_whitespace` : 检查是否是[ASCII空格](https://infra.spec.whatwg.org/#ascii-whitespace) */ is_ascii_whitespace(): boolean; /** ### `is_numeric` : 检查是否是[Unicode数字](https://www.unicode.org/reports/tr44/),包括各种脚本中的十进制数字、罗马数字字符、分数、上标/下标数字等。 + 和`Str.is_numeric()`的区别在于,`Str`只会检查阿拉伯数字,而`Char`会检查所有Unicode数字。 @example ```ts assert(Char('1').is_numeric()) assert(Char('Ⅷ').is_numeric()) // Roman numeral assert.not(Char('a').is_numeric()) ``` */ is_numeric(): boolean; /** ### `is_lowercase` : 检查是否是[Unicode小写字母](https://www.unicode.org/reports/tr44/) */ is_lowercase(): boolean; /** ### `is_uppercase` : 检查是否是[Unicode大写字母](https://www.unicode.org/reports/tr44/) */ is_uppercase(): boolean; /** ### `len_utf8` : 返回字符在UTF-8编码中的字节数 */ len_utf8(): number; clone(): Char; } //# sourceMappingURL=interface.d.ts.map