Convert files to typescript

The change converts the following files to typescript:

* elements/shared/gr-hovercard/gr-hovercard.ts

Change-Id: I089692ab6746159432436679d7753d36377d4a78
This commit is contained in:
Ben Rohlfs
2020-08-21 21:13:20 +02:00
parent 8bb159a70b
commit 77a00e62aa
2 changed files with 20 additions and 28 deletions

View File

@@ -42,15 +42,6 @@ const SHOW_DELAY_MS = 500;
*/ */
const HIDE_DELAY_MS = 300; const HIDE_DELAY_MS = 300;
/**
* Augment the interface with detailed $.
*/
export interface HovercardElInterface {
$: {
container: HTMLElement;
};
}
/** /**
* The mixin for gr-hovercard-behavior. * The mixin for gr-hovercard-behavior.
* *
@@ -69,11 +60,7 @@ export interface HovercardElInterface {
* @mixinFunction * @mixinFunction
*/ */
export const hovercardBehaviorMixin = dedupingMixin( export const hovercardBehaviorMixin = dedupingMixin(
< <T extends Constructor<PolymerElement & LegacyElementMixin>>(
T extends Constructor<
PolymerElement & LegacyElementMixin & HovercardElInterface
>
>(
superClass: T superClass: T
): T & Constructor<GrHovercardBehaviorInterface> => { ): T & Constructor<GrHovercardBehaviorInterface> => {
/** /**

View File

@@ -15,21 +15,26 @@
* limitations under the License. * limitations under the License.
*/ */
import '../../../styles/shared-styles.js'; import '../../../styles/shared-styles';
import {GestureEventListeners} from '@polymer/polymer/lib/mixins/gesture-event-listeners.js'; import {GestureEventListeners} from '@polymer/polymer/lib/mixins/gesture-event-listeners';
import {PolymerElement} from '@polymer/polymer/polymer-element.js'; import {PolymerElement} from '@polymer/polymer/polymer-element';
import {htmlTemplate} from './gr-hovercard_html.js'; import {htmlTemplate} from './gr-hovercard_html';
import {hovercardBehaviorMixin} from './gr-hovercard-behavior.js'; import {hovercardBehaviorMixin} from './gr-hovercard-behavior';
import {LegacyElementMixin} from '@polymer/polymer/lib/legacy/legacy-element-mixin.js'; import {LegacyElementMixin} from '@polymer/polymer/lib/legacy/legacy-element-mixin';
import './gr-hovercard-shared-style.js'; import './gr-hovercard-shared-style';
import {customElement} from '@polymer/decorators';
/** @extends PolymerElement */ @customElement('gr-hovercard')
class GrHovercard extends GestureEventListeners( export class GrHovercard extends GestureEventListeners(
hovercardBehaviorMixin(LegacyElementMixin(PolymerElement)) hovercardBehaviorMixin(LegacyElementMixin(PolymerElement))
) { ) {
static get template() { return htmlTemplate; } static get template() {
return htmlTemplate;
static get is() { return 'gr-hovercard'; } }
} }
customElements.define(GrHovercard.is, GrHovercard); declare global {
interface HTMLElementTagNameMap {
'gr-hovercard': GrHovercard;
}
}