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

Extending Input has incorrect types with typescript. #2065

Open
ErhanKurnaz opened this issue Aug 24, 2023 · 0 comments
Open

Extending Input has incorrect types with typescript. #2065

ErhanKurnaz opened this issue Aug 24, 2023 · 0 comments

Comments

@ErhanKurnaz
Copy link

Expected behavior

Being able to extend LionInput class and register it as a custom element. And being able to call common methods on it like focus and validate.

minimal reproducible code snippet

import { LionInput } from '@lion/ui/input';
import { customElement } from 'lit/decorators.js';

import '@lion/ui/define/lion-input';

@customElement('input-atom')
export class Input extends LionInput {
}

declare global {
	interface HTMLElementTagNameMap {
		'input-atom': Input;
	}
}

Actual Behavior

I get an error when trying to use the customElement decorator:

Unable to resolve signature of class decorator when called as an expression.
  Argument of type 'typeof Input' is not assignable to parameter of type 'CustomElementClass | ClassDescriptor'.
    Type 'typeof Input' is not assignable to type 'CustomElementClass'.
      Types of property 'prototype' are incompatible.
        Type 'LionInput' is missing the following properties from type 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir, and 283 more. [1238]

And functions that I know exist in the input component don't exist according to typescript.

Additional context

I use @lion/ui version 0.3.5

Also this behaviour exists for all the input components. I have the feeling that it might be a tsconfig issue. I couldn't find an example of a tsconfig that works.

All help is appreciated.

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

1 participant