pinyin.d.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. declare module "data/dict-zi" {
  2. const dict: Record<number, string>;
  3. export default dict;
  4. }
  5. declare module "data/phrases-dict" {
  6. const phrases_dict: Record<string, string[][]>;
  7. export default phrases_dict;
  8. }
  9. declare module "constant" {
  10. import type { IPinyinAllOptions } from "declare";
  11. export enum ENUM_PINYIN_STYLE {
  12. NORMAL = 0,
  13. TONE = 1,
  14. TONE2 = 2,
  15. TO3NE = 5,
  16. INITIALS = 3,
  17. FIRST_LETTER = 4,
  18. PASSPORT = 6
  19. }
  20. export enum ENUM_PINYIN_MODE {
  21. NORMAL = 0,
  22. SURNAME = 1
  23. }
  24. export const DEFAULT_OPTIONS: IPinyinAllOptions;
  25. export const PHONETIC_SYMBOL: Record<string, string>;
  26. export const INITIALS: string[];
  27. export const FINALS: string[];
  28. }
  29. declare module "declare" {
  30. import { ENUM_PINYIN_STYLE, ENUM_PINYIN_MODE } from "constant";
  31. export interface IPinyin {
  32. (han: string, options?: IPinyinOptions): string[][];
  33. compare: (a: string, b: string) => number;
  34. compact: (arr: string[][]) => string[][];
  35. STYLE_TONE: ENUM_PINYIN_STYLE;
  36. STYLE_TONE2: ENUM_PINYIN_STYLE;
  37. STYLE_TO3NE: ENUM_PINYIN_STYLE;
  38. STYLE_NORMAL: ENUM_PINYIN_STYLE;
  39. STYLE_INITIALS: ENUM_PINYIN_STYLE;
  40. STYLE_FIRST_LETTER: ENUM_PINYIN_STYLE;
  41. STYLE_PASSPORT: ENUM_PINYIN_STYLE;
  42. MODE_NORMAL: ENUM_PINYIN_MODE;
  43. MODE_SURNAME: ENUM_PINYIN_MODE;
  44. }
  45. export type IPinyinStyle = ENUM_PINYIN_STYLE | "normal" | "tone" | "tone2" | "to3ne" | "initials" | "first_letter" | "passport" | // 推荐使用小写,和输出的拼音一致
  46. "NORMAL" | "TONE" | "TONE2" | "TO3NE" | "INITIALS" | "FIRST_LETTER" | "PASSPORT" | // 方便老版本迁移
  47. 0 | 1 | 2 | 5 | 3 | 4;
  48. export type IPinyinMode = ENUM_PINYIN_MODE | "normal" | "surname" | "NORMAL" | "SURNAME";
  49. export type IPinyinSegment = "nodejieba" | "segmentit" | "@node-rs/jieba" | "Intl.Segmenter";
  50. export interface IPinyinAllOptions {
  51. style: ENUM_PINYIN_STYLE;
  52. mode: ENUM_PINYIN_MODE;
  53. segment?: IPinyinSegment;
  54. heteronym: boolean;
  55. group: boolean;
  56. compact: boolean;
  57. }
  58. export interface IPinyinOptions {
  59. style?: IPinyinStyle;
  60. mode?: IPinyinMode;
  61. segment?: IPinyinSegment | boolean;
  62. heteronym?: boolean;
  63. group?: boolean;
  64. compact?: boolean;
  65. }
  66. }
  67. declare module "segment-web" {
  68. import type { IPinyinSegment } from "declare";
  69. /**
  70. * TODO: 分词并带词性信息,需要调整 segment_pinyin 方法。
  71. * 分词并标注词性。
  72. */
  73. export function segment(hans: string, segment?: IPinyinSegment): string[];
  74. }
  75. declare module "util" {
  76. import type { IPinyinAllOptions, IPinyinOptions, IPinyinStyle, IPinyinMode } from "declare";
  77. import { ENUM_PINYIN_STYLE, ENUM_PINYIN_MODE } from "constant";
  78. export function hasKey(obj: any, key: string): boolean;
  79. export function convertPinyinStyle(style?: IPinyinStyle): ENUM_PINYIN_STYLE;
  80. export function convertPinyinMode(mode?: IPinyinMode): ENUM_PINYIN_MODE;
  81. export function convertUserOptions(options?: IPinyinOptions): IPinyinAllOptions;
  82. /**
  83. * 组合 2 个拼音数组。
  84. * @param {string[]} a1 第一个数组,形如 ["zhāo", "cháo"]
  85. * @param {string[]} a2 字符串型数组。形如 ["yáng"]
  86. * @return {string[]} 组合后的一维数组,如上可得 ["zhāoyáng", "cháoyáng"]
  87. */
  88. export function combo2array(a1: string[], a2: string[]): string[];
  89. /**
  90. * 合并二维元祖。
  91. * @param {string[][]} arr 二维元祖 [["zhāo", "cháo"], ["yáng"], ["dōng"], ["shēng"]]
  92. * @return {string[]} 返回二维字符串组合数组。形如
  93. * [
  94. * ["zhāoyáng"], ["dōng"], ["shēng"],
  95. * ["cháoyáng"], ["dōng"], ["shēng"]
  96. * ]
  97. */
  98. export function combo(arr: string[][]): string[];
  99. /**
  100. * 组合两个拼音数组,形成一个新的二维数组
  101. * @param {string[]|string[][]} arr1 eg: ["hai", "huan"]
  102. * @param {string[]} arr2 eg: ["qian"]
  103. * @returns {string[][]} 组合后的二维数组,eg: [ ["hai", "qian"], ["huan", "qian"] ]
  104. */
  105. export function compact2array(a1: string[] | string[][], a2: string[]): string[][];
  106. export function compact(arr: string[][]): string[][];
  107. }
  108. declare module "format" {
  109. import { ENUM_PINYIN_STYLE } from "constant";
  110. /**
  111. * 格式化拼音风格。
  112. *
  113. * @param {string} pinyin TONE 风格的拼音。
  114. * @param {ENUM_PINYIN_STYLE} style 目标转换的拼音风格。
  115. * @return {string} 转换后的拼音。
  116. */
  117. export function toFixed(pinyin: string, style: ENUM_PINYIN_STYLE): string;
  118. }
  119. declare module "data/surname" {
  120. const _default: {
  121. 赵: string[][];
  122. 钱: string[][];
  123. 孙: string[][];
  124. 李: string[][];
  125. 周: string[][];
  126. 吴: string[][];
  127. 郑: string[][];
  128. 王: string[][];
  129. 冯: string[][];
  130. 陈: string[][];
  131. 褚: string[][];
  132. 卫: string[][];
  133. 蒋: string[][];
  134. 沈: string[][];
  135. 韩: string[][];
  136. 杨: string[][];
  137. 朱: string[][];
  138. 秦: string[][];
  139. 尤: string[][];
  140. 许: string[][];
  141. 何: string[][];
  142. 吕: string[][];
  143. 施: string[][];
  144. 张: string[][];
  145. 孔: string[][];
  146. 曹: string[][];
  147. 严: string[][];
  148. 华: string[][];
  149. 金: string[][];
  150. 魏: string[][];
  151. 陶: string[][];
  152. 姜: string[][];
  153. 戚: string[][];
  154. 谢: string[][];
  155. 邹: string[][];
  156. 喻: string[][];
  157. 柏: string[][];
  158. 水: string[][];
  159. 窦: string[][];
  160. 章: string[][];
  161. 云: string[][];
  162. 苏: string[][];
  163. 潘: string[][];
  164. 葛: string[][];
  165. 奚: string[][];
  166. 范: string[][];
  167. 彭: string[][];
  168. 郎: string[][];
  169. 鲁: string[][];
  170. 韦: string[][];
  171. 昌: string[][];
  172. 马: string[][];
  173. 苗: string[][];
  174. 凤: string[][];
  175. 花: string[][];
  176. 方: string[][];
  177. 俞: string[][];
  178. 任: string[][];
  179. 袁: string[][];
  180. 柳: string[][];
  181. 酆: string[][];
  182. 鲍: string[][];
  183. 史: string[][];
  184. 唐: string[][];
  185. 费: string[][];
  186. 廉: string[][];
  187. 岑: string[][];
  188. 薛: string[][];
  189. 雷: string[][];
  190. 贺: string[][];
  191. 倪: string[][];
  192. 汤: string[][];
  193. 滕: string[][];
  194. 殷: string[][];
  195. 罗: string[][];
  196. 毕: string[][];
  197. 郝: string[][];
  198. 邬: string[][];
  199. 安: string[][];
  200. 常: string[][];
  201. 乐: string[][];
  202. 于: string[][];
  203. 时: string[][];
  204. 傅: string[][];
  205. 皮: string[][];
  206. 卞: string[][];
  207. 齐: string[][];
  208. 康: string[][];
  209. 伍: string[][];
  210. 余: string[][];
  211. 元: string[][];
  212. 卜: string[][];
  213. 顾: string[][];
  214. 孟: string[][];
  215. 平: string[][];
  216. 黄: string[][];
  217. 和: string[][];
  218. 穆: string[][];
  219. 萧: string[][];
  220. 尹: string[][];
  221. 姚: string[][];
  222. 邵: string[][];
  223. 湛: string[][];
  224. 汪: string[][];
  225. 祁: string[][];
  226. 毛: string[][];
  227. 禹: string[][];
  228. 狄: string[][];
  229. 米: string[][];
  230. 贝: string[][];
  231. 明: string[][];
  232. 臧: string[][];
  233. 计: string[][];
  234. 伏: string[][];
  235. 成: string[][];
  236. 戴: string[][];
  237. 谈: string[][];
  238. 宋: string[][];
  239. 茅: string[][];
  240. 庞: string[][];
  241. 熊: string[][];
  242. 纪: string[][];
  243. 舒: string[][];
  244. 屈: string[][];
  245. 项: string[][];
  246. 祝: string[][];
  247. 董: string[][];
  248. 梁: string[][];
  249. 杜: string[][];
  250. 阮: string[][];
  251. 蓝: string[][];
  252. 闵: string[][];
  253. 席: string[][];
  254. 季: string[][];
  255. 麻: string[][];
  256. 强: string[][];
  257. 贾: string[][];
  258. 路: string[][];
  259. 娄: string[][];
  260. 危: string[][];
  261. 江: string[][];
  262. 童: string[][];
  263. 颜: string[][];
  264. 郭: string[][];
  265. 梅: string[][];
  266. 盛: string[][];
  267. 林: string[][];
  268. 刁: string[][];
  269. 钟: string[][];
  270. 徐: string[][];
  271. 邱: string[][];
  272. 骆: string[][];
  273. 高: string[][];
  274. 夏: string[][];
  275. 蔡: string[][];
  276. 田: string[][];
  277. 樊: string[][];
  278. 胡: string[][];
  279. 凌: string[][];
  280. 霍: string[][];
  281. 虞: string[][];
  282. 万: string[][];
  283. 支: string[][];
  284. 柯: string[][];
  285. 昝: string[][];
  286. 管: string[][];
  287. 卢: string[][];
  288. 莫: string[][];
  289. 经: string[][];
  290. 房: string[][];
  291. 裘: string[][];
  292. 缪: string[][];
  293. 干: string[][];
  294. 解: string[][];
  295. 应: string[][];
  296. 宗: string[][];
  297. 丁: string[][];
  298. 宣: string[][];
  299. 贲: string[][];
  300. 邓: string[][];
  301. 郁: string[][];
  302. 单: string[][];
  303. 杭: string[][];
  304. 洪: string[][];
  305. 包: string[][];
  306. 诸: string[][];
  307. 左: string[][];
  308. 石: string[][];
  309. 崔: string[][];
  310. 吉: string[][];
  311. 钮: string[][];
  312. 龚: string[][];
  313. 程: string[][];
  314. 嵇: string[][];
  315. 邢: string[][];
  316. 滑: string[][];
  317. 裴: string[][];
  318. 陆: string[][];
  319. 荣: string[][];
  320. 翁: string[][];
  321. 荀: string[][];
  322. 羊: string[][];
  323. 於: string[][];
  324. 惠: string[][];
  325. 甄: string[][];
  326. 曲: string[][];
  327. 家: string[][];
  328. 封: string[][];
  329. 芮: string[][];
  330. 羿: string[][];
  331. 储: string[][];
  332. 靳: string[][];
  333. 汲: string[][];
  334. 邴: string[][];
  335. 糜: string[][];
  336. 松: string[][];
  337. 井: string[][];
  338. 段: string[][];
  339. 富: string[][];
  340. 巫: string[][];
  341. 乌: string[][];
  342. 焦: string[][];
  343. 巴: string[][];
  344. 弓: string[][];
  345. 牧: string[][];
  346. 隗: string[][];
  347. 山: string[][];
  348. 谷: string[][];
  349. 车: string[][];
  350. 侯: string[][];
  351. 宓: string[][];
  352. 蓬: string[][];
  353. 全: string[][];
  354. 郗: string[][];
  355. 班: string[][];
  356. 仰: string[][];
  357. 秋: string[][];
  358. 仲: string[][];
  359. 伊: string[][];
  360. 宫: string[][];
  361. 宁: string[][];
  362. 仇: string[][];
  363. 栾: string[][];
  364. 暴: string[][];
  365. 甘: string[][];
  366. 钭: string[][];
  367. 厉: string[][];
  368. 戎: string[][];
  369. 祖: string[][];
  370. 武: string[][];
  371. 符: string[][];
  372. 刘: string[][];
  373. 景: string[][];
  374. 詹: string[][];
  375. 束: string[][];
  376. 龙: string[][];
  377. 叶: string[][];
  378. 幸: string[][];
  379. 司: string[][];
  380. 韶: string[][];
  381. 郜: string[][];
  382. 黎: string[][];
  383. 蓟: string[][];
  384. 薄: string[][];
  385. 印: string[][];
  386. 宿: string[][];
  387. 白: string[][];
  388. 怀: string[][];
  389. 蒲: string[][];
  390. 邰: string[][];
  391. 从: string[][];
  392. 鄂: string[][];
  393. 索: string[][];
  394. 咸: string[][];
  395. 籍: string[][];
  396. 赖: string[][];
  397. 卓: string[][];
  398. 蔺: string[][];
  399. 屠: string[][];
  400. 蒙: string[][];
  401. 池: string[][];
  402. 乔: string[][];
  403. 阴: string[][];
  404. 鬱: string[][];
  405. 胥: string[][];
  406. 能: string[][];
  407. 苍: string[][];
  408. 双: string[][];
  409. 闻: string[][];
  410. 莘: string[][];
  411. 党: string[][];
  412. 翟: string[][];
  413. 谭: string[][];
  414. 贡: string[][];
  415. 劳: string[][];
  416. 逄: string[][];
  417. 姬: string[][];
  418. 申: string[][];
  419. 扶: string[][];
  420. 堵: string[][];
  421. 冉: string[][];
  422. 宰: string[][];
  423. 郦: string[][];
  424. 雍: string[][];
  425. 郤: string[][];
  426. 璩: string[][];
  427. 桑: string[][];
  428. 桂: string[][];
  429. 濮: string[][];
  430. 牛: string[][];
  431. 寿: string[][];
  432. 通: string[][];
  433. 边: string[][];
  434. 扈: string[][];
  435. 燕: string[][];
  436. 冀: string[][];
  437. 郏: string[][];
  438. 浦: string[][];
  439. 尚: string[][];
  440. 农: string[][];
  441. 温: string[][];
  442. 别: string[][];
  443. 庄: string[][];
  444. 晏: string[][];
  445. 柴: string[][];
  446. 瞿: string[][];
  447. 阎: string[][];
  448. 充: string[][];
  449. 慕: string[][];
  450. 连: string[][];
  451. 茹: string[][];
  452. 习: string[][];
  453. 宦: string[][];
  454. 艾: string[][];
  455. 鱼: string[][];
  456. 容: string[][];
  457. 向: string[][];
  458. 古: string[][];
  459. 易: string[][];
  460. 慎: string[][];
  461. 戈: string[][];
  462. 廖: string[][];
  463. 庾: string[][];
  464. 终: string[][];
  465. 暨: string[][];
  466. 居: string[][];
  467. 衡: string[][];
  468. 步: string[][];
  469. 都: string[][];
  470. 耿: string[][];
  471. 满: string[][];
  472. 弘: string[][];
  473. 匡: string[][];
  474. 国: string[][];
  475. 文: string[][];
  476. 寇: string[][];
  477. 广: string[][];
  478. 禄: string[][];
  479. 阙: string[][];
  480. 东: string[][];
  481. 欧: string[][];
  482. 殳: string[][];
  483. 沃: string[][];
  484. 利: string[][];
  485. 蔚: string[][];
  486. 越: string[][];
  487. 夔: string[][];
  488. 隆: string[][];
  489. 师: string[][];
  490. 巩: string[][];
  491. 厍: string[][];
  492. 聂: string[][];
  493. 晁: string[][];
  494. 勾: string[][];
  495. 敖: string[][];
  496. 融: string[][];
  497. 冷: string[][];
  498. 訾: string[][];
  499. 辛: string[][];
  500. 阚: string[][];
  501. 那: string[][];
  502. 简: string[][];
  503. 饶: string[][];
  504. 空: string[][];
  505. 曾: string[][];
  506. 母: string[][];
  507. 沙: string[][];
  508. 乜: string[][];
  509. 养: string[][];
  510. 鞠: string[][];
  511. 须: string[][];
  512. 丰: string[][];
  513. 巢: string[][];
  514. 关: string[][];
  515. 蒯: string[][];
  516. 相: string[][];
  517. 查: string[][];
  518. 后: string[][];
  519. 荆: string[][];
  520. 红: string[][];
  521. 游: string[][];
  522. 竺: string[][];
  523. 权: string[][];
  524. 逯: string[][];
  525. 盖: string[][];
  526. 益: string[][];
  527. 桓: string[][];
  528. 公: string[][];
  529. 牟: string[][];
  530. 哈: string[][];
  531. 言: string[][];
  532. 福: string[][];
  533. };
  534. export default _default;
  535. }
  536. declare module "data/compound_surname" {
  537. const _default_1: {
  538. 万俟: string[][];
  539. 上官: string[][];
  540. 东方: string[][];
  541. 东郭: string[][];
  542. 东门: string[][];
  543. 乐正: string[][];
  544. 亓官: string[][];
  545. 仉督: string[][];
  546. 令狐: string[][];
  547. 仲孙: string[][];
  548. 公冶: string[][];
  549. 公孙: string[][];
  550. 公羊: string[][];
  551. 公良: string[][];
  552. 公西: string[][];
  553. 单于: string[][];
  554. 南宫: string[][];
  555. 南门: string[][];
  556. 司寇: string[][];
  557. 司徒: string[][];
  558. 司空: string[][];
  559. 司马: string[][];
  560. 呼延: string[][];
  561. 壤驷: string[][];
  562. 夏侯: string[][];
  563. 太叔: string[][];
  564. 夹谷: string[][];
  565. 子车: string[][];
  566. 宇文: string[][];
  567. 宗政: string[][];
  568. 宰父: string[][];
  569. 尉迟: string[][];
  570. 左丘: string[][];
  571. 巫马: string[][];
  572. 慕容: string[][];
  573. 拓跋: string[][];
  574. 梁丘: string[][];
  575. 榖梁: string[][];
  576. 欧阳: string[][];
  577. 段干: string[][];
  578. 淳于: string[][];
  579. 漆雕: string[][];
  580. 澹台: string[][];
  581. 濮阳: string[][];
  582. 申屠: string[][];
  583. 百里: string[][];
  584. 皇甫: string[][];
  585. 端木: string[][];
  586. 第五: string[][];
  587. 羊舌: string[][];
  588. 西门: string[][];
  589. 诸葛: string[][];
  590. 赫连: string[][];
  591. 轩辕: string[][];
  592. 钟离: string[][];
  593. 长孙: string[][];
  594. 闻人: string[][];
  595. 闾丘: string[][];
  596. 颛孙: string[][];
  597. 鲜于: string[][];
  598. };
  599. export default _default_1;
  600. }
  601. declare module "PinyinBase" {
  602. import { ENUM_PINYIN_MODE, ENUM_PINYIN_STYLE } from "constant";
  603. import type { IPinyinAllOptions, IPinyinOptions, IPinyinSegment, IPinyin } from "declare";
  604. export default class PinyinBase {
  605. STYLE_TONE: ENUM_PINYIN_STYLE;
  606. STYLE_TONE2: ENUM_PINYIN_STYLE;
  607. STYLE_TO3NE: ENUM_PINYIN_STYLE;
  608. STYLE_NORMAL: ENUM_PINYIN_STYLE;
  609. STYLE_INITIALS: ENUM_PINYIN_STYLE;
  610. STYLE_FIRST_LETTER: ENUM_PINYIN_STYLE;
  611. STYLE_PASSPORT: ENUM_PINYIN_STYLE;
  612. MODE_NORMAL: ENUM_PINYIN_MODE;
  613. MODE_SURNAME: ENUM_PINYIN_MODE;
  614. /**
  615. * 拼音转换入口。
  616. */
  617. pinyin(hans: string, options?: IPinyinOptions): string[][];
  618. /**
  619. * 不使用分词算法的拼音转换。
  620. */
  621. normal_pinyin(hans: string, options: IPinyinAllOptions): string[][];
  622. /**
  623. * 单字拼音转换。
  624. * @param {String} han, 单个汉字
  625. * @return {Array} 返回拼音列表,多音字会有多个拼音项。
  626. */
  627. single_pinyin(han: string, options: IPinyinAllOptions): string[];
  628. segment(hans: string, segmentType?: IPinyinSegment): string[];
  629. /**
  630. * 将文本分词,并转换成拼音。
  631. */
  632. segment_pinyin(hans: string, options: IPinyinAllOptions): string[][];
  633. /**
  634. * 词语注音
  635. * @param {String} phrases, 指定的词组。
  636. * @param {Object} options, 选项。
  637. * @return {Array}
  638. */
  639. phrases_pinyin(phrases: string, options: IPinyinAllOptions): string[][];
  640. groupPhrases(phrases: string[][]): string[];
  641. surname_pinyin(hans: string, options: IPinyinAllOptions): string[][];
  642. compound_surname(hans: string, options: IPinyinAllOptions): string[][];
  643. single_surname(hans: string, options: IPinyinAllOptions): string[][];
  644. /**
  645. * 比较两个汉字转成拼音后的排序顺序,可以用作默认的拼音排序算法。
  646. *
  647. * @param {String} hanA 汉字字符串 A。
  648. * @return {String} hanB 汉字字符串 B。
  649. * @return {Number} 返回 -1,0,或 1。
  650. */
  651. compare(hanA: string, hanB: string): number;
  652. compact(pys: string[][]): string[][];
  653. }
  654. export function getPinyinInstance(py: PinyinBase): IPinyin;
  655. }
  656. declare module "phonetic-symbol" {
  657. const phonetic_symbol: Record<string, string>;
  658. export default phonetic_symbol;
  659. }
  660. declare module "pinyin-web" {
  661. import PinyinBase from "PinyinBase";
  662. export class Pinyin extends PinyinBase {
  663. }
  664. export const pinyin: import("declare").IPinyin;
  665. export default pinyin;
  666. export const compare: (a: string, b: string) => number;
  667. export { compact } from "util";
  668. }
  669. declare module "segment" {
  670. import type { IPinyinSegment } from "declare";
  671. /**
  672. * TODO: 分词并带词性信息,需要调整 segment_pinyin 方法。
  673. * 分词并标注词性。
  674. */
  675. export function segment(hans: string, segment?: IPinyinSegment): string[];
  676. }
  677. declare module "pinyin" {
  678. import PinyinBase from "PinyinBase";
  679. import type { IPinyinSegment } from "declare";
  680. export class Pinyin extends PinyinBase {
  681. segment(hans: string, segmentType?: IPinyinSegment): string[];
  682. }
  683. export const pinyin: import("declare").IPinyin;
  684. export default pinyin;
  685. export const compare: (a: string, b: string) => number;
  686. export { compact } from "util";
  687. }