List.d.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. import type { PropType, Component, CSSProperties } from 'vue';
  2. import type { Key } from '../_util/type';
  3. export type ScrollAlign = 'top' | 'bottom' | 'auto';
  4. export type ScrollConfig = {
  5. index: number;
  6. align?: ScrollAlign;
  7. offset?: number;
  8. } | {
  9. key: Key;
  10. align?: ScrollAlign;
  11. offset?: number;
  12. };
  13. export type ScrollTo = (arg: number | ScrollConfig) => void;
  14. export interface ListState {
  15. scrollTop: number;
  16. scrollMoving: boolean;
  17. }
  18. declare const List: import("vue").DefineComponent<{
  19. prefixCls: StringConstructor;
  20. data: import("vue-types").VueTypeValidableDef<unknown[]> & {
  21. default: () => unknown[];
  22. };
  23. height: NumberConstructor;
  24. itemHeight: NumberConstructor;
  25. /** If not match virtual scroll condition, Set List still use height of container. */
  26. fullHeight: {
  27. type: BooleanConstructor;
  28. default: any;
  29. };
  30. itemKey: {
  31. type: PropType<Key | ((item: Record<string, any>) => Key)>;
  32. required: true;
  33. };
  34. component: {
  35. type: PropType<string | Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>>;
  36. };
  37. /** Set `false` will always use real scroll instead of virtual one */
  38. virtual: {
  39. type: BooleanConstructor;
  40. default: any;
  41. };
  42. children: FunctionConstructor;
  43. onScroll: FunctionConstructor;
  44. onMousedown: FunctionConstructor;
  45. onMouseenter: FunctionConstructor;
  46. onVisibleChange: PropType<(visibleList: any[], fullList: any[]) => void>;
  47. }, {
  48. state: {
  49. scrollTop: number;
  50. scrollMoving: boolean;
  51. };
  52. mergedData: import("vue").ShallowRef<any[]>;
  53. componentStyle: import("vue").ComputedRef<CSSProperties>;
  54. onFallbackScroll: (e: UIEvent) => void;
  55. onScrollBar: (newScrollTop: number) => void;
  56. componentRef: import("vue").ShallowRef<HTMLDivElement>;
  57. useVirtual: import("vue").ComputedRef<boolean>;
  58. calRes: {
  59. scrollHeight?: number;
  60. start?: number;
  61. end?: number;
  62. offset?: number;
  63. };
  64. collectHeight: () => void;
  65. setInstance: (item: Record<string, any>, instance: HTMLElement) => void;
  66. sharedConfig: {
  67. getKey: (item: Record<string, any>) => any;
  68. };
  69. scrollBarRef: import("vue").ShallowRef<any>;
  70. fillerInnerRef: import("vue").ShallowRef<HTMLDivElement>;
  71. delayHideScrollBar: () => void;
  72. }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
  73. prefixCls: StringConstructor;
  74. data: import("vue-types").VueTypeValidableDef<unknown[]> & {
  75. default: () => unknown[];
  76. };
  77. height: NumberConstructor;
  78. itemHeight: NumberConstructor;
  79. /** If not match virtual scroll condition, Set List still use height of container. */
  80. fullHeight: {
  81. type: BooleanConstructor;
  82. default: any;
  83. };
  84. itemKey: {
  85. type: PropType<Key | ((item: Record<string, any>) => Key)>;
  86. required: true;
  87. };
  88. component: {
  89. type: PropType<string | Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>>;
  90. };
  91. /** Set `false` will always use real scroll instead of virtual one */
  92. virtual: {
  93. type: BooleanConstructor;
  94. default: any;
  95. };
  96. children: FunctionConstructor;
  97. onScroll: FunctionConstructor;
  98. onMousedown: FunctionConstructor;
  99. onMouseenter: FunctionConstructor;
  100. onVisibleChange: PropType<(visibleList: any[], fullList: any[]) => void>;
  101. }>>, {
  102. data: unknown[];
  103. virtual: boolean;
  104. fullHeight: boolean;
  105. }, {}>;
  106. export default List;