Skip to content

Commit

Permalink
Merge pull request #672 from Polymer/gen-tsd-export-legacy-interfaces
Browse files Browse the repository at this point in the history
Export generated legacy Polymer function element interfaces.
  • Loading branch information
aomarks authored Aug 25, 2018
2 parents 1c0d612 + 408ccaa commit c64bfa1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/gen-typescript-declarations/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
<!-- ## [Unreleased] -->
<!-- Add new, unreleased changes here. -->

## [1.5.1] - 2018-08-25
* Legacy Polymer function element interfaces are now exported from ES modules.

## [1.5.0] - 2018-08-15
* Legacy Polymer function components will no longer have a `_template`
property.
Expand Down
2 changes: 1 addition & 1 deletion packages/gen-typescript-declarations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polymer/gen-typescript-declarations",
"version": "1.5.0",
"version": "1.5.1",
"description": "Generate TypeScript type declarations for Polymer components.",
"homepage": "https://github.com/Polymer/tools/tree/master/packages/gen-typescript-declarations",
"repository": "github:Polymer/tools",
Expand Down
6 changes: 6 additions & 0 deletions packages/gen-typescript-declarations/src/gen-ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,12 @@ class TypeGenerator {
...legacyPolymerInterfaces,
],
}));

if (isPolymerElement(feature) && feature.isLegacyFactoryCall &&
this.root.isEsModule) {
this.root.members.push(
new ts.Export({identifiers: [{identifier: shortName}]}));
}
}

// The `HTMLElementTagNameMap` global interface maps custom element tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ interface PaperButtonElement extends PaperButtonBehavior, LegacyElementMixin, HT
_calculateElevation(): void;
}

export {PaperButtonElement};

declare global {

interface HTMLElementTagNameMap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ interface PaperMenuGrowHeightAnimationElement extends NeonAnimationBehavior, Leg
configure(config: any): any;
}

export {PaperMenuGrowHeightAnimationElement};

declare global {

interface HTMLElementTagNameMap {
Expand All @@ -32,10 +34,16 @@ interface PaperMenuGrowWidthAnimationElement extends NeonAnimationBehavior, Lega
configure(config: any): any;
}

export {PaperMenuGrowWidthAnimationElement};

interface PaperMenuShrinkWidthAnimationElement extends NeonAnimationBehavior, LegacyElementMixin, HTMLElement {
configure(config: any): any;
}

export {PaperMenuShrinkWidthAnimationElement};

interface PaperMenuShrinkHeightAnimationElement extends NeonAnimationBehavior, LegacyElementMixin, HTMLElement {
configure(config: any): any;
}

export {PaperMenuShrinkHeightAnimationElement};

0 comments on commit c64bfa1

Please sign in to comment.