Skip to content

Commit 9939729

Browse files
authored
refactor: reuse existing TS definitions for Lit-based elements (#6189)
1 parent 2877894 commit 9939729

8 files changed

Lines changed: 8 additions & 148 deletions

File tree

‎packages/avatar/src/vaadin-lit-avatar.d.ts‎

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,4 @@
33
* Copyright (c) 2020 - 2023 Vaadin Ltd.
44
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
55
*/
6-
import { LitElement } from 'lit';
7-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
8-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10-
import { AvatarMixin } from './vaadin-avatar-mixin.js';
11-
12-
export { AvatarI18n } from './vaadin-avatar-mixin.js';
13-
14-
/**
15-
* LitElement based version of `<vaadin-avatar>` web component.
16-
*
17-
* ## Disclaimer
18-
*
19-
* This component is an experiment not intended for publishing to npm.
20-
* There is no ETA regarding specific Vaadin version where it'll land.
21-
* Feel free to try this code in your apps as per Apache 2.0 license.
22-
*/
23-
declare class Avatar extends AvatarMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {}
24-
25-
declare global {
26-
interface HTMLElementTagNameMap {
27-
'vaadin-avatar': Avatar;
28-
}
29-
}
30-
31-
export { Avatar };
6+
export * from './vaadin-avatar.js';

‎packages/button/src/vaadin-lit-button.d.ts‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,4 @@
33
* Copyright (c) 2017 - 2023 Vaadin Ltd.
44
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
55
*/
6-
import { LitElement } from 'lit';
7-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
8-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10-
import { ButtonMixin } from './vaadin-button-mixin.js';
11-
12-
/**
13-
* LitElement based version of `<vaadin-button>` web component.
14-
*
15-
* ## Disclaimer
16-
*
17-
* This component is an experiment not intended for publishing to npm.
18-
* There is no ETA regarding specific Vaadin version where it'll land.
19-
* Feel free to try this code in your apps as per Apache 2.0 license.
20-
*/
21-
declare class Button extends ButtonMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {}
22-
23-
export { Button };
6+
export * from './vaadin-button.js';

‎packages/checkbox/src/vaadin-lit-checkbox.d.ts‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,4 @@
33
* Copyright (c) 2017 - 2023 Vaadin Ltd.
44
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
55
*/
6-
import { LitElement } from 'lit';
7-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
8-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10-
import { CheckboxMixin } from './vaadin-checkbox-mixin.js';
11-
12-
/**
13-
* LitElement based version of `<vaadin-checkbox>` web component.
14-
*
15-
* ## Disclaimer
16-
*
17-
* This component is an experiment not intended for publishing to npm.
18-
* There is no ETA regarding specific Vaadin version where it'll land.
19-
* Feel free to try this code in your apps as per Apache 2.0 license.
20-
*/
21-
declare class Checkbox extends CheckboxMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {}
22-
23-
export { Checkbox };
6+
export * from './vaadin-checkbox.js';

‎packages/email-field/src/vaadin-lit-email-field.d.ts‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,4 @@
33
* Copyright (c) 2021 - 2023 Vaadin Ltd.
44
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
55
*/
6-
import { TextField } from '@vaadin/text-field/src/vaadin-lit-text-field.js';
7-
8-
/**
9-
* LitElement based version of `<vaadin-email-field>` web component.
10-
*
11-
* ## Disclaimer
12-
*
13-
* This component is an experiment not intended for publishing to npm.
14-
* There is no ETA regarding specific Vaadin version where it'll land.
15-
* Feel free to try this code in your apps as per Apache 2.0 license.
16-
*/
17-
declare class EmailField extends TextField {}
18-
19-
export { EmailField };
6+
export * from './vaadin-email-field.js';

‎packages/number-field/src/vaadin-lit-number-field.d.ts‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,4 @@
33
* Copyright (c) 2021 - 2023 Vaadin Ltd.
44
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
55
*/
6-
import { LitElement } from 'lit';
7-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
8-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10-
import { NumberFieldMixin } from './vaadin-number-field-mixin.js';
11-
12-
/**
13-
* LitElement based version of `<vaadin-number-field>` web component.
14-
*
15-
* ## Disclaimer
16-
*
17-
* This component is an experiment not intended for publishing to npm.
18-
* There is no ETA regarding specific Vaadin version where it'll land.
19-
* Feel free to try this code in your apps as per Apache 2.0 license.
20-
*/
21-
declare class NumberField extends NumberFieldMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {}
22-
23-
export { NumberField };
6+
export * from './vaadin-number-field.js';

‎packages/progress-bar/src/vaadin-lit-progress-bar.d.ts‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,4 @@
33
* Copyright (c) 2017 - 2023 Vaadin Ltd.
44
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
55
*/
6-
import { LitElement } from 'lit';
7-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
8-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10-
import { ProgressMixin } from './vaadin-progress-mixin.js';
11-
12-
/**
13-
* LitElement based version of `<vaadin-progress-bar>` web component.
14-
*
15-
* ## Disclaimer
16-
*
17-
* This component is an experiment not intended for publishing to npm.
18-
* There is no ETA regarding specific Vaadin version where it'll land.
19-
* Feel free to try this code in your apps as per Apache 2.0 license.
20-
*/
21-
declare class ProgressBar extends ProgressMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {}
22-
23-
export { ProgressBar };
6+
export * from './vaadin-progress-bar.js';

‎packages/text-area/src/vaadin-lit-text-area.d.ts‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,4 @@
33
* Copyright (c) 2021 - 2023 Vaadin Ltd.
44
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
55
*/
6-
import { LitElement } from 'lit';
7-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
8-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10-
import { TextAreaMixin } from './vaadin-text-area-mixin.js';
11-
12-
/**
13-
* LitElement based version of `<vaadin-text-area>` web component.
14-
*
15-
* ## Disclaimer
16-
*
17-
* This component is an experiment not intended for publishing to npm.
18-
* There is no ETA regarding specific Vaadin version where it'll land.
19-
* Feel free to try this code in your apps as per Apache 2.0 license.
20-
*/
21-
declare class TextArea extends TextAreaMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {}
22-
23-
export { TextArea };
6+
export * from './vaadin-text-area.js';

‎packages/text-field/src/vaadin-lit-text-field.d.ts‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,4 @@
33
* Copyright (c) 2021 - 2023 Vaadin Ltd.
44
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
55
*/
6-
import { LitElement } from 'lit';
7-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
8-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10-
import { TextFieldMixin } from './vaadin-text-field-mixin.js';
11-
12-
/**
13-
* LitElement based version of `<vaadin-text-field>` web component.
14-
*
15-
* ## Disclaimer
16-
*
17-
* This component is an experiment not intended for publishing to npm.
18-
* There is no ETA regarding specific Vaadin version where it'll land.
19-
* Feel free to try this code in your apps as per Apache 2.0 license.
20-
*/
21-
declare class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {}
22-
23-
export { TextField };
6+
export * from './vaadin-text-field.js';

0 commit comments

Comments
 (0)