props.d.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { IBaseProps } from '../_util/base';
  2. export interface ICommonError {
  3. detail: Error;
  4. errorCode: string;
  5. message: string;
  6. onRetry?: () => Promise<void>;
  7. }
  8. export declare enum InputTypes {
  9. stroke = "stroke",
  10. pinyin = "pinyin",
  11. handwriting = "handwriting"
  12. }
  13. export interface IPinYinMapItem {
  14. label: string;
  15. value: string;
  16. extraClassName?: string;
  17. }
  18. export interface IWordsItem {
  19. charId?: string;
  20. unicodeChar: string;
  21. unicodeCodePoint: string;
  22. unicodeFont: string | null;
  23. pinYinChars: string[];
  24. splitChars: string[];
  25. weight?: number | null;
  26. type?: string;
  27. extInfo?: string | null;
  28. sort?: number;
  29. }
  30. export type IFilterType = 'pinyin' | 'split' | 'all';
  31. export interface IWordsItem {
  32. charId?: string;
  33. unicodeChar: string;
  34. unicodeCodePoint: string;
  35. unicodeFont: string | null;
  36. pinYinChars: string[];
  37. splitChars: string[];
  38. weight?: number | null;
  39. type?: string;
  40. extInfo?: string | null;
  41. sort?: number;
  42. }
  43. export type IWordsData = IWordsItem[];
  44. export interface IRareWordsKeyboardProps extends IBaseProps {
  45. /**
  46. * @title 是否可见
  47. */
  48. visible?: boolean;
  49. /**
  50. * @title 键盘类型
  51. */
  52. type?: InputTypes | string;
  53. /**
  54. * @title 是否展示蒙层
  55. * @description 默认 true
  56. */
  57. showMask?: boolean;
  58. /**
  59. * @description 安全距离
  60. * @default true
  61. */
  62. safeArea?: boolean;
  63. /**
  64. * @title 关闭的时候触发的回调
  65. */
  66. onClose?: () => void;
  67. /**
  68. * @title 输入完成的时候触发的回调
  69. */
  70. onChange?: (value: string) => void;
  71. /**
  72. * @title 组件错误的时候的回调
  73. */
  74. onError?: (err: Error) => void;
  75. }
  76. export declare const RareWordsKeyboardProps: Partial<IRareWordsKeyboardProps>;