diff options
Diffstat (limited to 'apps/files/src/components/VirtualList.vue')
-rw-r--r-- | apps/files/src/components/VirtualList.vue | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/files/src/components/VirtualList.vue b/apps/files/src/components/VirtualList.vue index 0ca2d869d17..3a08ab590e0 100644 --- a/apps/files/src/components/VirtualList.vue +++ b/apps/files/src/components/VirtualList.vue @@ -62,6 +62,10 @@ interface RecycledPoolItem { item: Node, } +type DataSource = File | Folder + +type DataSourceKey = keyof DataSource + export default Vue.extend({ name: 'VirtualList', @@ -73,11 +77,11 @@ export default Vue.extend({ required: true, }, dataKey: { - type: String, + type: String as PropType<DataSourceKey>, required: true, }, dataSources: { - type: Array as PropType<(File | Folder)[]>, + type: Array as PropType<DataSource[]>, required: true, }, extraProps: { @@ -260,7 +264,7 @@ export default Vue.extend({ // Adding scroll listener AFTER the initial scroll to index this.$el.addEventListener('scroll', this.onScroll, { passive: true }) - this.$_recycledPool = {} as Record<string, any> + this.$_recycledPool = {} as Record<string, DataSource[DataSourceKey]> }, beforeDestroy() { |