stk-table-vue 0.8.13 → 0.9.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +172 -180
  2. package/lib/src/StkTable/StkTable.vue.d.ts +22 -2
  3. package/lib/src/StkTable/useScrollbar.d.ts +57 -0
  4. package/lib/src/StkTable/utils/index.d.ts +10 -0
  5. package/lib/stk-table-vue.js +563 -294
  6. package/lib/style.css +49 -2
  7. package/package.json +74 -72
  8. package/src/StkTable/StkTable.vue +1730 -1653
  9. package/src/StkTable/components/DragHandle.vue +9 -9
  10. package/src/StkTable/components/SortIcon.vue +6 -6
  11. package/src/StkTable/components/TriangleIcon.vue +3 -3
  12. package/src/StkTable/const.ts +50 -50
  13. package/src/StkTable/index.ts +4 -4
  14. package/src/StkTable/style.less +627 -580
  15. package/src/StkTable/types/highlightDimOptions.ts +26 -26
  16. package/src/StkTable/types/index.ts +297 -297
  17. package/src/StkTable/useAutoResize.ts +91 -91
  18. package/src/StkTable/useColResize.ts +216 -216
  19. package/src/StkTable/useFixedCol.ts +150 -148
  20. package/src/StkTable/useFixedStyle.ts +75 -75
  21. package/src/StkTable/useGetFixedColPosition.ts +65 -65
  22. package/src/StkTable/useHighlight.ts +257 -257
  23. package/src/StkTable/useKeyboardArrowScroll.ts +112 -112
  24. package/src/StkTable/useMaxRowSpan.ts +55 -55
  25. package/src/StkTable/useMergeCells.ts +120 -123
  26. package/src/StkTable/useRowExpand.ts +88 -88
  27. package/src/StkTable/useScrollRowByRow.ts +114 -79
  28. package/src/StkTable/useScrollbar.ts +187 -0
  29. package/src/StkTable/useThDrag.ts +102 -102
  30. package/src/StkTable/useTrDrag.ts +113 -118
  31. package/src/StkTable/useTree.ts +161 -161
  32. package/src/StkTable/useVirtualScroll.ts +494 -494
  33. package/src/StkTable/utils/constRefUtils.ts +29 -29
  34. package/src/StkTable/utils/index.ts +287 -242
  35. package/src/StkTable/utils/useTriggerRef.ts +33 -33
  36. package/src/VirtualTree.vue +622 -622
  37. package/src/VirtualTreeSelect.vue +367 -367
  38. package/src/vite-env.d.ts +10 -10
package/README.md CHANGED
@@ -1,180 +1,172 @@
1
- <p align="center">
2
- <a href="https://ja-plus.github.io/stk-table-vue/">
3
- <img src="./docs-src/public/assets/logo.svg" width="152">
4
- </a>
5
- <h3 align='center'>Stk Table Vue</h3>
6
- <p align="center">
7
- <a href="https://www.npmjs.com/package/stk-table-vue"><img src="https://img.shields.io/npm/v/stk-table-vue"></a>
8
- <a href="https://www.npmjs.com/package/stk-table-vue"><img src="https://img.shields.io/npm/dw/stk-table-vue"></a>
9
- <a href="https://github.com/ja-plus/stk-table-vue/stargazers"><img src="https://img.shields.io/github/stars/ja-plus/stk-table-vue.svg"></a>
10
- <a href="https://raw.githubusercontent.com/ja-plus/stk-table-vue/master/LICENSE"><img src="https://img.shields.io/npm/l/stk-table-vue"></a>
11
- <a href="https://github.com/ja-plus/stk-table-vue"><img src="https://img.shields.io/npm/types/stk-table-vue"></a>
12
- </p>
13
- </p>
14
-
15
- > Stk Table Vue(Sticky Table) is a high-performance virtual list component based on Vue.
16
- >
17
- > Used for real-time data display, with data highlighting and dynamic effects
18
- >
19
- > Support Vue3 and Vue2.7
20
-
21
-
22
- ## Documentation
23
- ### [Stk Table Vue Official en](https://ja-plus.github.io/stk-table-vue/en/)
24
- ### [Stk Table Vue Official zh-CN](https://ja-plus.github.io/stk-table-vue/)
25
-
26
-
27
- ## Repo:
28
- - [Github](https://github.com/ja-plus/stk-table-vue)
29
- - [Gitee](https://gitee.com/japlus/stk-table-vue) 🇨🇳
30
-
31
- ## Demo
32
- [<span style="font-size: 16px;font-weight: bold;">Online Demo in stackblitz</span>](https://stackblitz.com/edit/vitejs-vite-ad91hh?file=src%2FDemo%2Findex.vue)
33
-
34
- ## Compare
35
- Compare performance with other vue table [vue-table-compare](https://github.com/ja-plus/vue-table-compare)
36
-
37
-
38
-
39
- ## Usage
40
- > npm install stk-table-vue
41
-
42
- ```html
43
- <script setup>
44
- import { StkTable } from 'stk-table-vue'
45
- import { ref, useTemplateRef } from 'vue'
46
- const stkTableRef = ref<InstanceType<typeof StkTable>>();
47
- // or Vue 3.5 useTemplateRef
48
- const stkTableRef = useTemplateRef('stkTableRef');
49
-
50
- // highlight row
51
- stkTableRef.value.setHighlightDimRow([rowKey],{
52
- method: 'css'|'animation',// default animation。
53
- className: 'custom-class-name', // method css。
54
- keyframe: [{backgroundColor:'#aaa'}, {backgroundColor: '#222'}],//same as https://developer.mozilla.org/zh-CN/docs/Web/API/Web_Animations_API/Keyframe_Formats
55
- duration: 2000,。
56
- });
57
- // highlight cell
58
- stkTableRef.value.setHighlightDimCell(rowKey, colDataIndex, {
59
- method: 'css'|'animation',
60
- className:'custom-class-name', // method css。
61
- keyframe: [{backgroundColor:'#aaa'}, {backgroundColor: '#222'}], // method animation。
62
- duration: 2000,。
63
- });
64
-
65
- const columns = [
66
- {title: 'name', dataIndex: 'name'},
67
- {title: 'age', dataIndex: 'age'},
68
- {title: 'address', dataIndex: 'address'},
69
- ];
70
-
71
- const dataSource = [
72
- {id: 1, name: 'John', age: 32, address: 'New York'},
73
- {id: 2, name: 'Jim', age: 42, address: 'London'},
74
- {id: 3, name: 'Joe', age: 52, address: 'Tokyo'},
75
- {id: 4, name: 'Jack', age: 62, address: 'Sydney'},
76
- {id: 5, name: 'Jill', age: 72, address: 'Paris'},
77
- ]
78
-
79
- </script>
80
-
81
- <template>
82
- <StkTable ref='stkTableRef' row-key="id" :data-source="dataSource" :columns="columns"></StkTable>
83
- </template>
84
-
85
- ```
86
-
87
- ### Vue2.7 Usage
88
- [Vue2.7 Usage](https://ja-plus.github.io/stk-table-vue/main/start/vue2-usage.html)
89
-
90
- ## API
91
- ### Props
92
- [Props 表格配置](https://ja-plus.github.io/stk-table-vue/main/api/table-props.html)
93
-
94
- ### Emits
95
- [Emits 事件](https://ja-plus.github.io/stk-table-vue/main/api/emits.html)
96
-
97
- ### Slots
98
- [Slots 插槽](https://ja-plus.github.io/stk-table-vue/main/api/slots.html)
99
-
100
- ### Expose
101
- [Expose 实例方法](https://ja-plus.github.io/stk-table-vue/main/api/expose.html)
102
-
103
- ### StkTableColumn 列配置
104
- [StkTableColumn 列配置](https://ja-plus.github.io/stk-table-vue/main/api/stk-table-column.html)
105
-
106
- ### setHighlightDimCell & setHighlightDimRow
107
- [Highlight 高亮](https://ja-plus.github.io/stk-table-vue/main/api/expose.html#sethighlightdimcell)
108
-
109
-
110
- ### Example
111
- ```vue
112
- <template>
113
- <StkTable
114
- ref="stkTable"
115
- row-key="name"
116
- v-model:columns="columns"
117
- :style="{height:props.height}"
118
- theme='dark'
119
- height='200px'
120
- bordered="h"
121
- :row-height="28"
122
- :show-overflow="false"
123
- :show-header-overflow="false"
124
- :sort-remote="false"
125
- col-resizable
126
- header-drag
127
- virtual
128
- virtual-x
129
- no-data-full
130
- col-resizable
131
- auto-resize
132
- fixed-col-shadow
133
- :col-min-width="10"
134
- :headless="false"
135
- :data-source="dataSource"
136
- @current-change="onCurrentChange"
137
- @row-menu="onRowMenu"
138
- @header-row-menu="onHeaderRowMenu"
139
- @row-click="onRowClick"
140
- @row-dblclick="onRowDblclick"
141
- @sort-change="handleSortChange"
142
- @cell-click="onCellClick"
143
- @header-cell-click="onHeaderCellClick"
144
- @scroll="onTableScroll"
145
- @scroll-x="onTableScrollX"
146
- @col-order-change="onColOrderChange"
147
- />
148
- </template>
149
- <script setup>
150
- import { h, defineComponent } from 'vue';
151
- const columns = [
152
- {
153
- title: 'Name',
154
- dataIndex: 'name',
155
- fixed: 'left',
156
- width: '200px',
157
- headerClassName: 'my-th',
158
- className: 'my-td',
159
- sorter: true,
160
- customHeaderCell: function FunctionalComponent(props){
161
- return h(
162
- 'span',
163
- { style: 'overflow:hidden;text-overflow:ellipsis;white-space:nowrap' },
164
- props.col.title + '(render) text-overflow,',
165
- );
166
- },
167
- customCell: defineComponent({
168
- setup(){
169
- //...
170
- return () => <div></div> // vue jsx
171
- }
172
- })
173
- },
174
- ]
175
- </script>
176
- ```
177
-
178
-
179
- ## Other
180
- * `$*$`
1
+ <p align="center">
2
+ <a href="https://ja-plus.github.io/stk-table-vue/">
3
+ <img src="./docs-src/public/assets/logo.svg" width="152">
4
+ </a>
5
+ <h3 align='center'>Stk Table Vue</h3>
6
+ <p align="center">
7
+ <a href="https://www.npmjs.com/package/stk-table-vue"><img src="https://img.shields.io/npm/v/stk-table-vue"></a>
8
+ <a href="https://www.npmjs.com/package/stk-table-vue"><img src="https://img.shields.io/npm/dw/stk-table-vue"></a>
9
+ <a href="https://github.com/ja-plus/stk-table-vue/stargazers"><img src="https://img.shields.io/github/stars/ja-plus/stk-table-vue.svg"></a>
10
+ <a href="https://raw.githubusercontent.com/ja-plus/stk-table-vue/master/LICENSE"><img src="https://img.shields.io/npm/l/stk-table-vue"></a>
11
+ <a href="https://github.com/ja-plus/stk-table-vue"><img src="https://img.shields.io/npm/types/stk-table-vue"></a>
12
+ </p>
13
+ </p>
14
+
15
+ > Stk Table Vue(Sticky Table) is a high-performance virtual list component based on Vue.
16
+ >
17
+ > Used for real-time data display, with data highlighting and dynamic effects
18
+ >
19
+ > Support Vue3 and Vue2.7
20
+
21
+
22
+ ## Documentation
23
+ ### [Stk Table Vue Official en](https://ja-plus.github.io/stk-table-vue/en/)
24
+ ### [Stk Table Vue Official zh-CN](https://ja-plus.github.io/stk-table-vue/)
25
+
26
+
27
+ ## Repo:
28
+ - [Github](https://github.com/ja-plus/stk-table-vue)
29
+ - [Gitee](https://gitee.com/japlus/stk-table-vue) 🇨🇳
30
+
31
+ ## Demo
32
+ [<span style="font-size: 16px;font-weight: bold;">Online Demo in stackblitz</span>](https://stackblitz.com/edit/vitejs-vite-ad91hh?file=src%2FDemo%2Findex.vue)
33
+
34
+ ## Usage
35
+ > npm install stk-table-vue
36
+
37
+ ```html
38
+ <script setup>
39
+ import { StkTable } from 'stk-table-vue'
40
+ import { ref, useTemplateRef } from 'vue'
41
+ const stkTableRef = ref<InstanceType<typeof StkTable>>();
42
+ // or Vue 3.5 useTemplateRef
43
+ const stkTableRef = useTemplateRef('stkTableRef');
44
+
45
+ // highlight row
46
+ stkTableRef.value.setHighlightDimRow([rowKey],{
47
+ method: 'css'|'animation',// default animation。
48
+ className: 'custom-class-name', // method css。
49
+ keyframe: [{backgroundColor:'#aaa'}, {backgroundColor: '#222'}],//same as https://developer.mozilla.org/zh-CN/docs/Web/API/Web_Animations_API/Keyframe_Formats
50
+ duration: 2000,。
51
+ });
52
+ // highlight cell
53
+ stkTableRef.value.setHighlightDimCell(rowKey, colDataIndex, {
54
+ method: 'css'|'animation',
55
+ className:'custom-class-name', // method css。
56
+ keyframe: [{backgroundColor:'#aaa'}, {backgroundColor: '#222'}], // method animation。
57
+ duration: 2000,。
58
+ });
59
+
60
+ const columns = [
61
+ {title: 'name', dataIndex: 'name'},
62
+ {title: 'age', dataIndex: 'age'},
63
+ {title: 'address', dataIndex: 'address'},
64
+ ];
65
+
66
+ const dataSource = [
67
+ {id: 1, name: 'John', age: 32, address: 'New York'},
68
+ {id: 2, name: 'Jim', age: 42, address: 'London'},
69
+ {id: 3, name: 'Joe', age: 52, address: 'Tokyo'},
70
+ {id: 4, name: 'Jack', age: 62, address: 'Sydney'},
71
+ {id: 5, name: 'Jill', age: 72, address: 'Paris'},
72
+ ]
73
+
74
+ </script>
75
+
76
+ <template>
77
+ <StkTable ref='stkTableRef' row-key="id" :data-source="dataSource" :columns="columns"></StkTable>
78
+ </template>
79
+
80
+ ```
81
+
82
+ ### Vue2.7 Usage
83
+ [Vue2.7 Usage](https://ja-plus.github.io/stk-table-vue/main/start/vue2-usage.html)
84
+
85
+ ## API
86
+ * [Props](https://ja-plus.github.io/stk-table-vue/main/api/table-props.html)
87
+
88
+ * [Emits](https://ja-plus.github.io/stk-table-vue/main/api/emits.html)
89
+
90
+ * [Slots](https://ja-plus.github.io/stk-table-vue/main/api/slots.html)
91
+
92
+ * [Expose](https://ja-plus.github.io/stk-table-vue/main/api/expose.html)
93
+
94
+ * [StkTableColumn: Define column type](https://ja-plus.github.io/stk-table-vue/main/api/stk-table-column.html)
95
+
96
+ * [Highlight: setHighlightDimCell & setHighlightDimRow](https://ja-plus.github.io/stk-table-vue/main/api/expose.html#sethighlightdimcell)
97
+
98
+
99
+ ### Example
100
+ ```vue
101
+ <template>
102
+ <StkTable
103
+ ref="stkTable"
104
+ row-key="name"
105
+ v-model:columns="columns"
106
+ :style="{height:props.height}"
107
+ theme='dark'
108
+ height='200px'
109
+ bordered="h"
110
+ :row-height="28"
111
+ :show-overflow="false"
112
+ :show-header-overflow="false"
113
+ :sort-remote="false"
114
+ col-resizable
115
+ header-drag
116
+ virtual
117
+ virtual-x
118
+ no-data-full
119
+ col-resizable
120
+ auto-resize
121
+ fixed-col-shadow
122
+ :col-min-width="10"
123
+ :headless="false"
124
+ :data-source="dataSource"
125
+ @current-change="onCurrentChange"
126
+ @row-menu="onRowMenu"
127
+ @header-row-menu="onHeaderRowMenu"
128
+ @row-click="onRowClick"
129
+ @row-dblclick="onRowDblclick"
130
+ @sort-change="handleSortChange"
131
+ @cell-click="onCellClick"
132
+ @header-cell-click="onHeaderCellClick"
133
+ @scroll="onTableScroll"
134
+ @scroll-x="onTableScrollX"
135
+ @col-order-change="onColOrderChange"
136
+ />
137
+ </template>
138
+ <script setup>
139
+ import { h, defineComponent } from 'vue';
140
+ const columns = [
141
+ {
142
+ title: 'Name',
143
+ dataIndex: 'name',
144
+ fixed: 'left',
145
+ width: '200px',
146
+ headerClassName: 'my-th',
147
+ className: 'my-td',
148
+ sorter: true,
149
+ customHeaderCell: function FunctionalComponent(props){
150
+ return h(
151
+ 'span',
152
+ { style: 'overflow:hidden;text-overflow:ellipsis;white-space:nowrap' },
153
+ props.col.title + '(render) text-overflow,',
154
+ );
155
+ },
156
+ customCell: defineComponent({
157
+ setup(){
158
+ //...
159
+ return () => <div></div> // vue jsx
160
+ }
161
+ })
162
+ },
163
+ ]
164
+ </script>
165
+ ```
166
+
167
+ ## Compare
168
+ Compare performance with other vue table [vue-table-compare](https://github.com/ja-plus/vue-table-compare)
169
+
170
+
171
+ ## Other
172
+ * `$*$`
@@ -1,9 +1,12 @@
1
1
  import { AutoRowHeightConfig, ColResizableConfig, DragRowConfig, ExpandConfig, HeaderDragConfig, HighlightConfig, Order, PrivateRowDT, PrivateStkTableColumn, RowActiveOption, SeqConfig, SortConfig, SortOption, StkTableColumn, TreeConfig, UniqKey, UniqKeyProp } from './types/index';
2
+ import { ScrollbarOptions } from './useScrollbar';
2
3
 
3
4
  /** Generic stands for DataType */
4
5
  type DT = any & PrivateRowDT;
5
6
  /**
6
7
  * 选中一行
8
+ *
9
+ * en: Select a row
7
10
  * @param {string} rowKeyOrRow selected rowKey, undefined to unselect
8
11
  * @param {boolean} option.silent if set true not emit `current-change`. default:false
9
12
  * @param {boolean} option.deep if set true, deep search in children. default:false
@@ -62,8 +65,8 @@ declare function __VLS_template(): {
62
65
  row: any;
63
66
  col: StkTableColumn<any> | undefined;
64
67
  }): any;
65
- empty?(_: {}): any;
66
68
  customBottom?(_: {}): any;
69
+ empty?(_: {}): any;
67
70
  };
68
71
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
69
72
  width?: string;
@@ -203,6 +206,13 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
203
206
  * - scrollbar:仅拖动滚动条生效
204
207
  */
205
208
  scrollRowByRow?: boolean | "scrollbar";
209
+ /**
210
+ * 自定义滚动条配置
211
+ * - false: 禁用自定义滚动条
212
+ * - true: 启用默认配置的自定义滚动条
213
+ * - ScrollbarOptions: 启用并配置自定义滚动条
214
+ */
215
+ scrollbar?: boolean | ScrollbarOptions;
206
216
  }>, {
207
217
  width: string;
208
218
  fixedMode: boolean;
@@ -255,6 +265,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
255
265
  cellFixedMode: string;
256
266
  smoothScroll: boolean;
257
267
  scrollRowByRow: boolean;
268
+ scrollbar: boolean;
258
269
  }>>, {
259
270
  /**
260
271
  * 重新计算虚拟列表宽高
@@ -572,6 +583,13 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
572
583
  * - scrollbar:仅拖动滚动条生效
573
584
  */
574
585
  scrollRowByRow?: boolean | "scrollbar";
586
+ /**
587
+ * 自定义滚动条配置
588
+ * - false: 禁用自定义滚动条
589
+ * - true: 启用默认配置的自定义滚动条
590
+ * - ScrollbarOptions: 启用并配置自定义滚动条
591
+ */
592
+ scrollbar?: boolean | ScrollbarOptions;
575
593
  }>, {
576
594
  width: string;
577
595
  fixedMode: boolean;
@@ -624,6 +642,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
624
642
  cellFixedMode: string;
625
643
  smoothScroll: boolean;
626
644
  scrollRowByRow: boolean;
645
+ scrollbar: boolean;
627
646
  }>>> & Readonly<{
628
647
  onScroll?: ((ev: Event, data: {
629
648
  startIndex: number;
@@ -680,6 +699,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
680
699
  minWidth: string;
681
700
  maxWidth: string;
682
701
  sortConfig: SortConfig<DT>;
702
+ colKey: UniqKeyProp;
683
703
  rowHeight: number;
684
704
  headless: boolean;
685
705
  autoRowHeight: boolean | AutoRowHeightConfig<DT>;
@@ -687,7 +707,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
687
707
  optimizeVue2Scroll: boolean;
688
708
  rowKey: UniqKeyProp;
689
709
  headerRowHeight: number | string | null;
690
- colKey: UniqKeyProp;
710
+ scrollbar: boolean | ScrollbarOptions;
691
711
  fixedMode: boolean;
692
712
  theme: "light" | "dark";
693
713
  rowHover: boolean;
@@ -0,0 +1,57 @@
1
+ import { Ref } from 'vue';
2
+
3
+ export type ScrollbarOptions = {
4
+ enabled?: boolean;
5
+ /** scroll-y width */
6
+ width?: number;
7
+ /** scroll-x height */
8
+ height?: number;
9
+ /** min scroll-y width */
10
+ minWidth?: number;
11
+ /** min scroll-x height */
12
+ minHeight?: number;
13
+ };
14
+ /**
15
+ * 自定义滚动条hooks
16
+ * @param containerRef 滚动容器的ref
17
+ * @param options 滚动条配置选项
18
+ * @returns 滚动条相关状态和方法
19
+ */
20
+ export declare function useScrollbar(containerRef: Ref<HTMLDivElement | undefined>, options?: boolean | ScrollbarOptions): {
21
+ scrollbarOptions: {
22
+ enabled: boolean;
23
+ width: number;
24
+ height: number;
25
+ minWidth: number;
26
+ minHeight: number;
27
+ };
28
+ scrollbar: Ref<{
29
+ h: number;
30
+ w: number;
31
+ top: number;
32
+ left: number;
33
+ }, {
34
+ h: number;
35
+ w: number;
36
+ top: number;
37
+ left: number;
38
+ } | {
39
+ h: number;
40
+ w: number;
41
+ top: number;
42
+ left: number;
43
+ }>;
44
+ showScrollbar: Ref<{
45
+ x: boolean;
46
+ y: boolean;
47
+ }, {
48
+ x: boolean;
49
+ y: boolean;
50
+ } | {
51
+ x: boolean;
52
+ y: boolean;
53
+ }>;
54
+ onVerticalScrollbarMouseDown: (e: MouseEvent | TouchEvent) => void;
55
+ onHorizontalScrollbarMouseDown: (e: MouseEvent | TouchEvent) => void;
56
+ updateCustomScrollbar: () => void;
57
+ };
@@ -51,3 +51,13 @@ export declare function howDeepTheHeader(arr: StkTableColumn<any>[], level?: num
51
51
  export declare function transformWidthToStr(width?: string | number): string | undefined;
52
52
  export declare function getBrowsersVersion(browserName: string): number;
53
53
  export declare function pureCellKeyGen(rowKey: UniqKey, colKey: UniqKey): string;
54
+ export declare function getClosestTr(e: MouseEvent): HTMLTableRowElement | null;
55
+ export declare function getClosestTrIndex(e: MouseEvent): number;
56
+ export declare function getClosestColKey(e: MouseEvent): string | undefined;
57
+ /**
58
+ * 改进的节流函数,确保最后一个调用不会被丢弃
59
+ * @param fn 要执行的函数
60
+ * @param delay 延迟时间(毫秒)
61
+ * @returns 节流处理后的函数
62
+ */
63
+ export declare function throttle<T extends (...args: any[]) => any>(fn: T, delay: number): (...args: Parameters<T>) => void;