interface.d.ts 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. export declare type SelectSource = 'option' | 'selection' | 'input' | 'clear';
  2. export declare type Key = string | number;
  3. export declare type RawValueType = string | number;
  4. export interface LabelValueType {
  5. key?: Key;
  6. value?: RawValueType;
  7. label?: any;
  8. /** Only works on `treeCheckStrictly` */
  9. halfChecked?: boolean;
  10. }
  11. export declare type DefaultValueType = RawValueType | RawValueType[] | LabelValueType | LabelValueType[];
  12. export interface DataNode {
  13. value?: RawValueType;
  14. title?: any;
  15. label?: any;
  16. key?: Key;
  17. disabled?: boolean;
  18. disableCheckbox?: boolean;
  19. checkable?: boolean;
  20. selectable?: boolean;
  21. children?: DataNode[];
  22. /** Customize data info */
  23. [prop: string]: any;
  24. }
  25. export interface InternalDataEntity {
  26. key: Key;
  27. value: RawValueType;
  28. title?: any;
  29. checkable: boolean;
  30. disableCheckbox: boolean;
  31. disabled: boolean;
  32. selectable: boolean;
  33. isLeaf: boolean;
  34. children?: InternalDataEntity[];
  35. /** Origin DataNode */
  36. node: DataNode;
  37. dataRef: DataNode;
  38. slots?: Record<string, string>;
  39. }
  40. export interface LegacyDataNode extends DataNode {
  41. props: any;
  42. }
  43. export interface TreeDataNode extends DataNode {
  44. key: Key;
  45. children?: TreeDataNode[];
  46. }
  47. export interface FlattenDataNode {
  48. data: InternalDataEntity;
  49. key: Key;
  50. value: RawValueType;
  51. level: number;
  52. parent?: FlattenDataNode;
  53. }
  54. export interface SimpleModeConfig {
  55. id?: Key;
  56. pId?: Key;
  57. rootPId?: Key;
  58. }
  59. /** @deprecated This is only used for legacy compatible. Not works on new code. */
  60. export interface LegacyCheckedNode {
  61. pos: string;
  62. node: any;
  63. children?: LegacyCheckedNode[];
  64. }
  65. export interface ChangeEventExtra {
  66. /** @deprecated Please save prev value by control logic instead */
  67. preValue: LabelValueType[];
  68. triggerValue: RawValueType;
  69. /** @deprecated Use `onSelect` or `onDeselect` instead. */
  70. selected?: boolean;
  71. /** @deprecated Use `onSelect` or `onDeselect` instead. */
  72. checked?: boolean;
  73. /** @deprecated This prop not work as react node anymore. */
  74. triggerNode: any;
  75. /** @deprecated This prop not work as react node anymore. */
  76. allCheckedNodes: LegacyCheckedNode[];
  77. }
  78. export interface FieldNames {
  79. value?: string;
  80. label?: string;
  81. children?: string;
  82. }