diff --git a/packages/gen-typescript-declarations/CHANGELOG.md b/packages/gen-typescript-declarations/CHANGELOG.md index 2ce6666c7..60a570a7c 100644 --- a/packages/gen-typescript-declarations/CHANGELOG.md +++ b/packages/gen-typescript-declarations/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. +## [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. diff --git a/packages/gen-typescript-declarations/package.json b/packages/gen-typescript-declarations/package.json index c26a0e5a1..52cf57048 100644 --- a/packages/gen-typescript-declarations/package.json +++ b/packages/gen-typescript-declarations/package.json @@ -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", diff --git a/packages/gen-typescript-declarations/src/gen-ts.ts b/packages/gen-typescript-declarations/src/gen-ts.ts index cca61bf35..4e4954b0f 100644 --- a/packages/gen-typescript-declarations/src/gen-ts.ts +++ b/packages/gen-typescript-declarations/src/gen-ts.ts @@ -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 diff --git a/packages/gen-typescript-declarations/src/test/goldens/paper-button-3/paper-button.d.ts b/packages/gen-typescript-declarations/src/test/goldens/paper-button-3/paper-button.d.ts index 497059068..29e016172 100644 --- a/packages/gen-typescript-declarations/src/test/goldens/paper-button-3/paper-button.d.ts +++ b/packages/gen-typescript-declarations/src/test/goldens/paper-button-3/paper-button.d.ts @@ -25,6 +25,8 @@ interface PaperButtonElement extends PaperButtonBehavior, LegacyElementMixin, HT _calculateElevation(): void; } +export {PaperButtonElement}; + declare global { interface HTMLElementTagNameMap { diff --git a/packages/gen-typescript-declarations/src/test/goldens/paper-menu-button-3/paper-menu-button-animations.d.ts b/packages/gen-typescript-declarations/src/test/goldens/paper-menu-button-3/paper-menu-button-animations.d.ts index a09eeae04..b36c792af 100644 --- a/packages/gen-typescript-declarations/src/test/goldens/paper-menu-button-3/paper-menu-button-animations.d.ts +++ b/packages/gen-typescript-declarations/src/test/goldens/paper-menu-button-3/paper-menu-button-animations.d.ts @@ -18,6 +18,8 @@ interface PaperMenuGrowHeightAnimationElement extends NeonAnimationBehavior, Leg configure(config: any): any; } +export {PaperMenuGrowHeightAnimationElement}; + declare global { interface HTMLElementTagNameMap { @@ -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};