Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: prepare for TS defs generation #110

Merged
merged 2 commits into from
May 15, 2020
Merged

feat: prepare for TS defs generation #110

merged 2 commits into from
May 15, 2020

Conversation

Haprog
Copy link
Contributor

@Haprog Haprog commented May 15, 2020

Fixes #109

The generated TS definitions look like this:

import {PolymerElement} from '@polymer/polymer/polymer-element.js';

import {templatize} from '@polymer/polymer/lib/utils/templatize.js';

import {ElementMixin} from '@vaadin/vaadin-element-mixin/vaadin-element-mixin.js';

import {ThemableMixin} from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

import {ThemePropertyMixin} from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';

import {FlattenedNodesObserver} from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';

import {html} from '@polymer/polymer/lib/utils/html-tag.js';

declare class NotificationContainer extends
  ElementMixin(
  ThemableMixin(
  PolymerElement)) {

  opened: boolean;
}

declare global {
  interface HTMLElementTagNameMap {
    "vaadin-notification-container": NotificationContainer;
    "vaadin-notification-card": NotificationCard;
    "vaadin-notification": NotificationElement;
  }
}

declare class NotificationCard extends
  ThemableMixin(
  PolymerElement) {

  ready(): void;
}

declare class NotificationElement extends
  ThemePropertyMixin(
  ElementMixin(
  PolymerElement)) {

  duration: number;
  opened: boolean;
  position: NotificationPosition;
  renderer: NotificationRenderer|undefined;
  _notificationTemplate: HTMLTemplateElement|undefined;

  ready(): void;
  _setTemplateFromNodes(nodes: Node[]): void;
  render(): void;
  open(): void;
  close(): void;
}

export {NotificationContainer};

export {NotificationCard};

export {NotificationElement};

import {NotificationPosition} from '../@types/interfaces';

import {NotificationRenderer} from '../@types/interfaces';

@Haprog Haprog requested a review from web-padawan May 15, 2020 09:29
@web-padawan web-padawan merged commit 0ee0706 into master May 15, 2020
@web-padawan web-padawan deleted the gen-ts-defs branch May 15, 2020 10:25
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate TypeScript definitions for P3
2 participants