Describe the bug
Carousel, Galleria, and Timeline components use any for their value arrays and slot scoped data. This means:
- Carousel
#item slot's data parameter is any
- Galleria
#item / #caption / #thumbnail slot's item parameter is any
- Timeline
#content / #opposite / #marker / #connector slot's item parameter is any
With a generic T parameter, TypeScript can infer the item type from the value binding and flow it to all slots.
Same root cause as #8442 — DefineComponent uses a no-arg constructor that prevents generic inference.
Reproducer: StackBlitz — bun run type-check (0 errors, typo undetected) → bun run patch && bun run type-check (TS2339 catches it)
Reproducer
<Carousel :value="products">
<template #item="{ data }">
{{ data.name }} <!-- data: any — no autocomplete -->
</template>
</Carousel>
Pull Request Link
#8490
PrimeVue version
4.5.4
Vue version
3.5.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
N/A (type-level issue)
Steps to reproduce the behavior
- Pass a typed array to Carousel
value, Galleria value, or Timeline value
- Use the
#item, #content, or related slot
- The slot parameter is typed as
any instead of the array element type
Expected behavior
data should be inferred as the element type of the value array (e.g., Product).
Describe the bug
Carousel, Galleria, and Timeline components use
anyfor their value arrays and slot scoped data. This means:#itemslot'sdataparameter isany#item/#caption/#thumbnailslot'sitemparameter isany#content/#opposite/#marker/#connectorslot'sitemparameter isanyWith a generic
Tparameter, TypeScript can infer the item type from thevaluebinding and flow it to all slots.Same root cause as #8442 —
DefineComponentuses a no-arg constructor that prevents generic inference.Reproducer: StackBlitz —
bun run type-check(0 errors, typo undetected) →bun run patch && bun run type-check(TS2339 catches it)Reproducer
Pull Request Link
#8490
PrimeVue version
4.5.4
Vue version
3.5.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
N/A (type-level issue)
Steps to reproduce the behavior
value, Galleriavalue, or Timelinevalue#item,#content, or related slotanyinstead of the array element typeExpected behavior
datashould be inferred as the element type of thevaluearray (e.g.,Product).