Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
chore: updating mixin's type
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodek committed Apr 25, 2020
1 parent 6a78dba commit 1b822b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/ApiFormMixin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ import {IronFormElement} from '@polymer/iron-form';

export {ApiFormMixin};

declare function ApiFormMixin<T extends new (...args: any[]) => {}>(base: T): T & ApiFormMixinConstructor;

interface ApiFormMixinConstructor {
new(...args: any[]): ApiFormMixin;
}

export {ApiFormMixinConstructor};

/**
* A mixin to be implemented to elements that processes AMF data via form
* data model and displays forms from the model.
Expand Down Expand Up @@ -176,5 +184,3 @@ interface ApiFormMixin {
*/
_gaEvent(category: string, action: string, label?: string): void;
}

declare const ApiFormMixin: object;
5 changes: 2 additions & 3 deletions test/test-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { ApiFormMixin } from '../api-form-mixin.js';
import '@polymer/iron-form/iron-form.js';
import styles from '../api-form-styles.js';
/**
* @customElement
* @demo demo/index.html
* @appliesMixin ApiFormMixin
* @mixes ApiFormMixin
* @extends LitElement
*/
class TestElement extends ApiFormMixin(LitElement) {
static get styles() {
Expand Down

0 comments on commit 1b822b5

Please sign in to comment.