PinyinBase.d.ts 1.4 KB

1234567891011121314151617181920212223242526
  1. import { ENUM_PINYIN_MODE, ENUM_PINYIN_STYLE } from "./constant";
  2. import type { IPinyinAllOptions, IPinyinOptions, IPinyinSegment, IPinyin } from "./declare";
  3. export default class PinyinBase {
  4. STYLE_TONE: ENUM_PINYIN_STYLE;
  5. STYLE_TONE2: ENUM_PINYIN_STYLE;
  6. STYLE_TO3NE: ENUM_PINYIN_STYLE;
  7. STYLE_NORMAL: ENUM_PINYIN_STYLE;
  8. STYLE_INITIALS: ENUM_PINYIN_STYLE;
  9. STYLE_FIRST_LETTER: ENUM_PINYIN_STYLE;
  10. STYLE_PASSPORT: ENUM_PINYIN_STYLE;
  11. MODE_NORMAL: ENUM_PINYIN_MODE;
  12. MODE_SURNAME: ENUM_PINYIN_MODE;
  13. pinyin(hans: string, options?: IPinyinOptions): string[][];
  14. normal_pinyin(hans: string, options: IPinyinAllOptions): string[][];
  15. single_pinyin(han: string, options: IPinyinAllOptions): string[];
  16. segment(hans: string, segmentType?: IPinyinSegment): string[];
  17. segment_pinyin(hans: string, options: IPinyinAllOptions): string[][];
  18. phrases_pinyin(phrases: string, options: IPinyinAllOptions): string[][];
  19. groupPhrases(phrases: string[][]): string[];
  20. surname_pinyin(hans: string, options: IPinyinAllOptions): string[][];
  21. compound_surname(hans: string, options: IPinyinAllOptions): string[][];
  22. single_surname(hans: string, options: IPinyinAllOptions): string[][];
  23. compare(hanA: string, hanB: string): number;
  24. compact(pys: string[][]): string[][];
  25. }
  26. export declare function getPinyinInstance(py: PinyinBase): IPinyin;