Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback types shown in the documentation ARE NOT CORRECT. Callbacks are typed differently in the actual library type definitions. #657

Open
mattbruv opened this issue Jan 6, 2025 · 0 comments
Assignees

Comments

@mattbruv
Copy link

mattbruv commented Jan 6, 2025

Describe the issue
https://www.telerik.com/kendo-vue-ui/components/inputs/api/RadioButtonProps/#toc-onchange

Radio Button Props in the API references describes onChange as having the type of:

onChange? (event: RadioButtonChangeEvent) => void

But in the actual library, this is not the case. We are using "@progress/kendo-vue-inputs": "^6.0.1",.
Here are the actual type definitions in node_modules > @progress > kendo-vue-inputs > index.d.mts > RadioButton

onChange?: (...args: any[] | unknown[]) => any;

This is causing TypeScript errors when I try to use the component how the documentation suggests:

Type '(event: RadioButtonChangeEvent) => void' is not assignable to type '(...args: any[] | unknown[]) => any'.
  Types of parameters 'event' and 'args' are incompatible.
    Type 'any[] | unknown[]' is not assignable to type '[event: RadioButtonChangeEvent]'.
      Type 'any[]' is not assignable to type '[event: RadioButtonChangeEvent]'.
        Target requires 1 element(s) but source may have fewer.ts-plugin(2322)
index.d.mts(2721, 1): The expected type comes from property 'onChange' which is declared here on type '__VLS_NormalizeComponentEvent<NonNullable<Partial<{ size: string; valid: boolean; tag: string; }> & Omit<{ readonly tag: string; readonly size: string; readonly id?: string | undefined; readonly ariaDescribedBy?: string | undefined; ... 17 more ...; readonly onFocus?: ((...args: any[] | unknown[]) => any) | undefine...'
(property) onChange?: ((...args: any[] | unknown[]) => any) | undefined

This isn't only limited to Radio Buttons or just this library, but other libraries as well. Take this one for example:

Image

Screenshots
Image
Image
Image

Browser

  • OS: N/A
  • Browser N/A
  • Version N/A

Additional context
N/A

@PekoPPT PekoPPT self-assigned this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants