huntabyte / bits-ui

The headless components for Svelte.
https://bits-ui.com
MIT License
953 stars 70 forks source link

`Select.ContentProps` is typed as `any` #543

Closed Stadly closed 1 month ago

Stadly commented 1 month ago

Describe the bug

When doing

import { Select } from 'bits-ui';

type Props = Select.ContentProps;

Props is typed as any!

image

If you open the StackBlitz and hover Props, it is shown as any

And just below, a variable typed as Props is set to the value 5. This should not be possible if the type of Props was correct.

You can run npm run lint to see the errors.

Related issues: https://github.com/huntabyte/bits-ui/issues/376 https://github.com/huntabyte/bits-ui/issues/512

Reproduction

https://stackblitz.com/edit/github-gn5sax-8qtxtf?file=src%2Flib%2Findex.ts

Logs

No response

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @sveltejs/kit: ^2.0.0 => 2.5.8 
    bits-ui: latest => 0.21.7 
    svelte: ^4.2.7 => 4.2.17

Severity

annoyance